/* Corneal thickness calculator — Figma: Catalog — Corneal Thickness Calculator ›
   "Corneal thickness calculator — Desktop · ICD style" (+ "· Empty state", "Tooltip — hover state"). Loaded after store.css.
   Shares the diagnosis-codes tool's language: flat hairline tables, radius-6 chips, pill buttons, numbered step headings.
   Content sits 20px in from the 1200 column (1160 wide) throughout. */
.ctc__inner {
  padding: 72px 0 120px;
}

/* ---- title + intro */
.ctc-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px;
}
.ctc-head > .eyebrow {
  margin: 0;
  padding: 0 20px;
}
.ctc-head h1 {
  margin: 0;
}
.ctc-print-patient {
  display: none;
}
.ctc-intro {
  display: grid;
  grid-template-columns: 675fr 471fr;
  gap: 14px 24px;
  align-items: start;
}
.ctc-intro__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ctc-intro__lede {
  margin: 0;
  padding: 0 20px;
  font-size: var(--fs-body-l);
  line-height: 1.6;
  color: var(--pcli-color-text-secondary);
}
.ctc-intro__note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 20px;
}
.ctc-intro__note h2,
.ctc-card h2,
.ctc-alert h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--pcli-color-text-primary);
}
.ctc-intro__note p,
.ctc-card p,
.ctc-alert p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--pcli-color-text-secondary);
}
.ctc-intro__aside {
  padding: 6px 20px 0 0;
}
/* tip-style note (same recipe as the diagnosis-codes tip bar) */
.ctc-card,
.ctc-alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 6px;
  background: var(--pcli-color-bg-subtle);
}
.ctc-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ctc-card__body a {
  font-size: 13px;
  font-weight: 600;
  color: var(--pcli-color-text-link);
  text-decoration: none;
}
.ctc-card__body a:hover {
  text-decoration: underline;
}

/* ---- thin-cornea caution: only when a thickness under 500 µm is entered */
.ctc-alert {
  margin: 32px 20px 0;
}
.ctc-alert[hidden] {
  display: none;
}
.ctc-alert .ctc-alert__tag {
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 5px 10px;
  border-radius: 4px;
  background: #fff;
  color: var(--orange-800);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

/* ---- calculator grid: inputs 468 (420 + panel padding) | results fill */
.ctc-grid {
  display: grid;
  grid-template-columns: 468px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 40px 20px 0;
}

/* numbered step headings — "1 Enter the refraction", "2 Results" */
.ctc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--pcli-color-border-strong);
}
.ctc-step__n {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--teal-800);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.ctc-step__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--teal-800);
}
.ctc-step__sub {
  margin-left: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--pcli-color-text-tertiary);
}

/* ---- inputs: the one filled panel on the page */
.ctc-side {
  position: sticky;
  top: 160px; /* below the nav + Resources bar */
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-radius: 8px;
  background: var(--pcli-color-bg-subtle);
}
.ctc-inputs {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}
.ctc-inputs fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.ctc-patient {
  padding-top: 24px !important;
  border-top: 1px solid var(--pcli-color-border-subtle) !important;
}
.ctc-patient + .ctc-hint {
  margin-top: -12px;
}
.ctc-overline {
  margin: 0 0 14px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--pcli-color-text-tertiary);
}
.ctc-overline span {
  font-weight: 400;
}
.ctc-row {
  display: flex;
  gap: 12px;
}
.ctc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ctc-field--grow {
  flex: 1;
}
.ctc-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pcli-color-text-primary);
}
.ctc-input {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--pcli-color-border-input);
  border-radius: var(--r-md);
  background: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--pcli-color-text-primary);
  box-sizing: border-box;
  width: 100%;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.ctc-input--date {
  width: 128px;
}
.ctc-input:focus,
.ctc-input:focus-within {
  outline: none;
  border-color: var(--teal-800);
  box-shadow:
    inset 0 0 0 1px var(--teal-800),
    0 0 0 4px rgba(14, 107, 114, 0.18);
}
.ctc-input--unit input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  font: inherit;
  color: inherit;
}
.ctc-input input::placeholder,
.ctc-input::placeholder {
  color: var(--pcli-color-text-tertiary);
  font-weight: 400;
}
.ctc-sign {
  flex: none;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--pcli-color-border-default);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--pcli-color-text-secondary);
  cursor: pointer;
} /* ± sign toggle in the diopter fields — iPhone's decimal keypad has no minus */
.ctc-sign:hover {
  border-color: var(--teal-800);
  color: var(--teal-800);
}
.ctc-sign:focus-visible {
  outline: 2px solid var(--teal-800);
  outline-offset: 1px;
}
.ctc-input__unit {
  flex: none;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--pcli-color-text-tertiary);
}
.ctc-input.is-invalid {
  border-color: var(--red-800);
  box-shadow: 0 0 0 3px rgba(138, 42, 30, 0.12);
}
.ctc-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--pcli-color-text-tertiary);
}
.ctc-eyes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ctc-eye {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ctc-eye__title {
  margin: 0 0 14px;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--pcli-color-text-primary);
}
.ctc-eye__title span {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--pcli-color-text-tertiary);
}
.ctc-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--red-100);
  color: var(--red-800);
  font-size: 13px;
  line-height: 1.45;
}
.ctc-error[hidden] {
  display: none;
}

/* pill buttons (filter-chip language from the diagnosis-codes page) */
.ctc-actions {
  display: flex;
  gap: 8px;
}
.ctc-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.ctc-btn--print {
  border: 1px solid var(--pcli-color-action-secondary);
  background: var(--pcli-color-action-secondary);
  color: #fff;
}
.ctc-btn--print:hover {
  background: var(--charcoal-900);
  border-color: var(--charcoal-900);
}
.ctc-btn--reset {
  border: 1px solid var(--pcli-color-border-default);
  background: #fff;
  color: var(--pcli-color-text-primary);
}
.ctc-btn--reset:hover {
  border-color: var(--pcli-color-text-tertiary);
}
.ctc-btn:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

/* ---- results */
.ctc-results {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}
.ctc-empty {
  margin: 0;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--pcli-color-bg-subtle);
  font-size: 13px;
  line-height: 1.5;
  color: var(--pcli-color-text-secondary);
}
.ctc-empty[hidden] {
  display: none;
}
.ctc-table__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pcli-color-border-subtle);
  font-size: 15px;
  font-weight: 700;
  color: var(--pcli-color-text-primary);
}
.ctc-table__title span {
  font-size: 13px;
  font-weight: 400;
  color: var(--pcli-color-text-tertiary);
}
.ctc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ctc-table th,
.ctc-table td {
  padding: 14px 8px;
  text-align: left;
  white-space: nowrap;
}
.ctc-table tr > :first-child {
  padding-left: 0;
}
.ctc-table tr > :last-child {
  padding-right: 0;
}
.ctc-table thead th {
  padding: 14px 8px 10px;
  border-bottom: 1px solid var(--pcli-color-border-subtle);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--pcli-color-text-tertiary);
}
.ctc-table tbody tr {
  border-bottom: 1px solid var(--pcli-color-border-subtle);
}
.ctc-table tbody th {
  font-size: 15px;
  font-weight: 500;
  color: var(--pcli-color-text-primary);
}
.ctc-table tbody td {
  color: var(--pcli-color-text-secondary);
}
.ctc-table thead th {
  vertical-align: bottom;
}
.ctc-th__eye {
  display: block;
  margin-bottom: 2px;
  color: var(--pcli-color-text-secondary);
} /* "Right eye (OD)" above Needed / Surplus */
.ctc-th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* surplus chips — radius 6 like the code chips; teal = OK, red = none */
.ctc-pill {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--teal-800);
  border-radius: 6px;
  background: var(--teal-100);
  color: var(--teal-800);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.ctc-pill.is-none {
  border-color: var(--red-800);
  background: var(--red-100);
  color: var(--red-800);
}
.ctc-pill:empty {
  display: none;
}
/* waiting for input: dashes, no chips */
.ctc-results.is-empty [data-need],
.ctc-results.is-empty .ctc-pill {
  color: var(--stone-300);
}
.ctc-results.is-empty .ctc-pill {
  padding: 0;
  border: 0;
  background: none;
}
.ctc-results.is-empty .ctc-foot {
  display: none;
}
.ctc-foot {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--pcli-color-text-tertiary);
}

/* ---- ⓘ tooltips — hover or keyboard focus; title + text (Figma: Tooltip content, Tooltip — hover state) */
.ctc-tip {
  position: relative;
  display: inline-flex;
}
.ctc-tip__btn {
  display: inline-flex;
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--pcli-color-text-tertiary);
  cursor: help;
}
.ctc-tip__btn:hover,
.ctc-tip__btn:focus-visible {
  color: var(--pcli-color-text-primary);
}
.ctc-tip__text {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 240px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--charcoal-800);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.ctc-tip__text strong {
  font-size: 12px;
  font-weight: 600;
}
.ctc-tip:hover .ctc-tip__text,
.ctc-tip__btn:focus-visible + .ctc-tip__text {
  opacity: 1;
  visibility: visible;
}
.ctc-table thead th:first-child .ctc-tip__text {
  left: 0;
  transform: none;
}
.ctc-table thead th:last-child .ctc-tip__text {
  left: auto;
  right: 0;
  transform: none;
}

/* ---- responsive */
@media (max-width: 1100px) {
  .ctc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ctc-side {
    position: static;
    max-width: 560px;
  }
  .ctc-table__scroll {
    overflow-x: auto;
  }
}
@media (max-width: 900px) {
  .ctc-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .ctc-intro__aside {
    padding: 0 20px;
  }
}
@media (max-width: 720px) {
  .ctc__inner {
    padding: 40px 0 72px;
  }
  .ctc-head,
  .ctc-head > .eyebrow,
  .ctc-intro__lede,
  .ctc-intro__note,
  .ctc-intro__aside {
    padding-left: 0;
    padding-right: 0;
  }
  .ctc-alert {
    margin: 28px 0 0;
  }
  .ctc-grid {
    padding: 32px 0 0;
  }
  .ctc-side {
    padding: 20px;
  }
  .ctc-table__title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ctc-input,
  .ctc-btn,
  .ctc-tip__text {
    transition: none;
  }
}

/* ---- print: Figma "Corneal thickness calculator — Print (Letter)" — patient, inputs and both tables */
@media print {
  .nav-utility,
  .nav-primary,
  .footer,
  .skip-link,
  .so,
  .ctc-actions,
  .ctc-sign,
  .ctc-hint,
  .ctc-tip,
  .ctc-intro,
  .ctc-patient,
  .ctc-empty,
  .ctc-step__n,
  .ctc-step__sub {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .ctc__inner {
    padding: 0;
  }
  .ctc-head > .eyebrow {
    color: var(--teal-800);
  }
  .ctc-print-patient {
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 600;
  }
  .ctc-alert {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 4px;
  }
  .ctc-grid {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    padding: 16px 0 0;
  }
  .ctc-side {
    position: static;
    padding: 0;
    background: none;
  }
  .ctc-step {
    padding-bottom: 6px;
    border-bottom-width: 1px;
  }
  .ctc-step__title {
    font-size: 10pt;
    letter-spacing: 0.08em;
  }
  .ctc-input {
    height: 30px;
    box-shadow: none;
    border-color: var(--pcli-color-border-subtle);
  }
  .ctc-table__title {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--pcli-color-border-strong);
    font-size: 10pt;
    letter-spacing: 0.08em;
    color: var(--teal-800);
  }
  .ctc-table__title span {
    font-size: 9.5pt;
    letter-spacing: 0;
  }
  .ctc-table th,
  .ctc-table td {
    padding: 7px 8px;
  }
  .ctc-table thead th {
    padding-top: 8px;
    padding-bottom: 6px;
    font-size: 9pt;
  }
  .ctc-pill {
    padding: 0;
    border: 0 !important;
    background: none !important;
  }
}
