:root {
  --right-ear: rgb(231, 76, 60);
  --left-ear: rgb(52, 152, 219);
  --error-bg: #fff3e0;
  --error-border: #ff9800;
}

body {
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  background: #f0f2f5;
  padding: 10px;
  color: #1a1a1a;
}

.container {
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.field input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.main-layout {
  display: grid;
  /* gap: 15px; */
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

/* this is the capsule style from Gemini */
table {
  width: 100%;
  /* Changed to separate to allow spacing between the capsules */
  border-collapse: separate;
  border-spacing: 10px 0; /* Horizontal gap between pairs, no vertical gap */
  font-size: 13px;
}

td {
  padding: 8px 12px;
  text-align: center;
  border-left: 2px solid #64748b; /* The side borders of the capsule */
  border-right: 2px solid #64748b;
}

/* Round the top of the first row */
tr:first-child td:not(.row-label) {
  border-top: 2px solid #64748b;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

/* Round the bottom of the second row */
tr:last-child td:not(.row-label) {
  border-bottom: 2px solid #64748b;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.row-label {
  text-align: left;
  font-weight: 600;
  width: 150px;
  background: #f9fafb;
  border: none; /* Keep labels outside the capsule style */
}

input[type="number"] {
  width: 40px;
  padding: 4px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  text-align: center;
  font-weight: 500;
}
/* this is the capsule style from Gemini */

input.input-error,
td.input-error {
  background-color: var(--error-bg);
  border-color: var(--error-border);
  color: #d35400;
}

.result-row {
  background: #f8fbff;
  font-weight: 800;
  color: #2c3e50;
  font-size: 1.1em;
}

.chart-wrapper {
  max-height: 400px;
  canvas {
    place-self: center;
  }
}

/* .controls {
  display: grid;
  gap: 15px;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
} */

@media print {
  .no-print {
    display: none;
  }

  .container {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  body {
    background: white;
  }
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 10px; /* Stronger separation from the chart */
  margin-left: 10px;
}

/* 👇imported from SAL 1, to use in the norms modal */
.no-border {
  border: none;
}
.threshold-item {
  max-height: 30px;
}
.sm-border {
  border: 1px solid black;
}
.defaults {
  height: 50px;
}
.spacer {
  height: 10px;
  margin-bottom: 10px;
}
.width-3 {
  width: 150px;
}
.btn {
  width: auto;
  height: 100%;
  border: 1px solid black;
  background-color: white;
  border-radius: 3px;
  text-align: center;
  cursor: pointer;
}
.btn:hover {
  background-color: #f0f0f0;
}

a.btn {
  text-decoration: none;
  color: black;
  font-size: 14px;

  padding-inline: 4px;
  padding-block: 1px;
}
/* 👆 imported from SAL 1, to use in the norms modal */

header {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-block: 5x;
}
h1 {
  font-size: 16px;
  padding-left: 15px;
  margin: 0px;
  margin-bottom: 5px;
}
::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}
.tiny-flex {
  display: flex;
  gap: 5px;
  align-items: center;
}
#help_content {
  display: grid;
  grid-template-columns: 80vw;
}

#help_text_modal {
  overflow: auto;
  margin-top: 10dvh;
  max-height: 80dvh;
  margin-left: auto;
  margin-right: auto;
  padding: 15px;
}

#help_text_modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
#warnings_popover {
  position: absolute;
  margin: 0;
  padding: 10px 12px;
  background-color: rgba(255, 243, 224, 1);
  border: 1px solid var(--error-border);
  border-radius: 6px;
  color: #d35400;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.7;
  max-width: 300px;
  pointer-events: none;
}
#warnings_popover::backdrop {
  background: rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 860px) {
  .norm-labels {
    transform: rotate(-45deg);
  }

  .threshold-item {
    max-height: 30px;
  }

  .norms-container {
    max-width: 100%;
    grid-template-columns: 60px repeat(5, 1fr);
  }
  .width-3 {
    width: 60px;
  }
}

#custom_norms_content {
  padding: 2rem;
}
