/**
 * INS CARE ROI Estimator — styles
 *
 * Design tokens copied verbatim from the ai-pm brand system
 * (apps/web/src/styles/tokens.css). Feature CSS references only these
 * variables — no raw hex outside :root / [data-theme="dark"].
 *
 * Brand: Industrial Networking Solutions. Cyan #2BACE2 → deep #1B6B8D,
 * orange CTA #F4A23C, industrial navy #16263F. Health-green carries the
 * savings/ROI emphasis, mirroring the green fill in the source spreadsheet.
 */

:root {
  /* --- INS brand --- */
  --color-brand: #2bace2; /* INS cyan — primary actions, links, active, focus */
  --color-brand-strong: #1b6b8d; /* deep cyan — hover/pressed */
  --color-brand-tint: #e7f6fd; /* cyan wash — active backgrounds, info */
  --color-accent2: #f4a23c; /* INS orange — secondary CTA, eyebrows, attention */
  --color-accent2-strong: #d9842a;
  --color-accent2-tint: #fdf1df;
  --color-navy: #16263f; /* dark surfaces, headings-on-photo */
  --color-navy-2: #1f3759;
  --color-navy-line: rgba(255, 255, 255, 0.09);
  --color-navy-text: #c5d2e4;

  /* Legacy accent names (kept; now INS cyan) */
  --color-accent: var(--color-brand);
  --color-accent-bg: var(--color-brand-tint);

  /* Inline text links on light surfaces (deep cyan for AA contrast) */
  --color-link: var(--color-brand-strong);

  /* --- Surfaces & text --- */
  --color-bg: #eef2f7; /* app background (cool, not cream) */
  --color-bg-subtle: #e7ecf3; /* hover rows, neutral fills */
  --color-surface: #ffffff; /* cards, tables, panels */
  --color-surface-2: #f7f9fc; /* table header, inset surfaces */
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;
  --color-text-strong: #0e1726; /* headings, primary table text */
  --color-text: #36404e; /* body */
  --color-text-muted: #5b6678; /* secondary, placeholders (AA on tinted bg) */

  /* --- Health (savings / ROI emphasis = green) --- */
  --color-health-green: #1f7a4d;
  --color-health-green-bg: #e3f5ec;
  --color-health-yellow: #b06f12;
  --color-health-yellow-bg: #fcf2db;
  --color-health-red: #b52d3a;
  --color-health-red-bg: #fce7e9;

  /* --- Typography --- */
  --font-body: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  --font-display: var(--font-body);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas,
    monospace;

  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 21px;
  --font-size-2xl: 27px;
  --weight-normal: 400;
  --weight-medium: 600;
  --weight-bold: 800;

  /* --- Spacing (4px base) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  /* --- Radius & elevation --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 56, 0.06), 0 1px 3px rgba(16, 32, 56, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 32, 56, 0.08), 0 2px 4px rgba(16, 32, 56, 0.05);
  --shadow-lg: 0 12px 32px rgba(16, 32, 56, 0.14);
  --ring: 0 0 0 3px rgba(43, 172, 226, 0.35);

  /* --- Motion --- */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 0.12s;
  --dur: 0.2s;

  /* --- Layout --- */
  --topbar-height: 60px;
  --content-max-width: 1100px;
}

/* --- Dark theme --- */
:root[data-theme='dark'] {
  --color-bg: #0c1320;
  --color-bg-subtle: #182338;
  --color-surface: #111c2e;
  --color-surface-2: #16233a;
  --color-border: #233148;
  --color-border-strong: #324563;
  --color-text-strong: #eef3fb;
  --color-text: #c2cddd;
  --color-text-muted: #8493aa;

  /* Brighter cyan for inline links on dark surfaces (AA contrast) */
  --color-link: #5cc5ef;

  --color-brand-tint: rgba(43, 172, 226, 0.16);
  --color-accent2-tint: rgba(244, 162, 60, 0.16);
  --color-navy: #0a1422;
  --color-navy-2: #16233a;
  --color-navy-text: #aebed6;

  --color-health-green: #34d399;
  --color-health-green-bg: rgba(31, 122, 77, 0.22);
  --color-health-yellow: #fbbf24;
  --color-health-yellow-bg: rgba(176, 111, 18, 0.22);
  --color-health-red: #f87171;
  --color-health-red-bg: rgba(194, 57, 69, 0.22);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-text-strong);
  margin: 0;
  letter-spacing: -0.01em;
}

::selection {
  background: var(--color-brand-tint);
  color: var(--color-text-strong);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------ */
/* Topbar (replicates ai-pm .topbar)                                   */
/* ------------------------------------------------------------------ */

.topbar {
  flex-shrink: 0;
  z-index: 20;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 rgba(16, 32, 56, 0.02);
}

.topbar__logo {
  height: 30px;
  width: auto;
  display: block;
}
/* When the logo links home (e.g. on the Terms page), keep it a fixed-size,
   focusable flex item. */
.topbar__logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.topbar__mark {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 17px;
  color: var(--color-text-strong);
  letter-spacing: -0.02em;
}
.topbar__mark--accent {
  color: var(--color-brand);
}

.topbar__breadcrumb {
  position: relative;
  padding-left: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__breadcrumb::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 18px;
  width: 1px;
  background: var(--color-border-strong);
  transform: translateY(-50%);
}

.topbar__spacer {
  flex: 1;
}
/* Fixed topbar items never squeeze; only the breadcrumb absorbs slack. */
.topbar__logo,
.topbar__mark,
.topbar__action,
.theme-toggle {
  flex-shrink: 0;
}

/* Responsive label for the Print button (short variant shown on small screens) */
.label-short {
  display: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 34px;
  padding: 0 var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  font-size: 15px;
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.theme-toggle:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-border-strong);
}

/* ------------------------------------------------------------------ */
/* Button primitive                                                    */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--color-brand);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.btn:hover {
  background: var(--color-brand-strong);
  color: #fff;
}
.btn:active {
  transform: translateY(1px);
}
.btn--secondary {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text-strong);
}
.btn--secondary:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-text-muted);
  color: var(--color-text-strong);
}
.btn--sm {
  height: 28px;
  padding: 0 var(--space-3);
  font-size: var(--font-size-xs);
}

/* ------------------------------------------------------------------ */
/* Page layout                                                         */
/* ------------------------------------------------------------------ */

.page {
  flex: 1;
  padding: var(--space-8) var(--space-6);
}
.page__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-6);
}
.page-header__title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
  letter-spacing: -0.02em;
}
.page-header__subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin: var(--space-1) 0 0;
  max-width: 70ch;
}

/* Two-column responsive grid */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-6);
  align-items: start;
}

.results {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

@media (max-width: 860px) {
  .layout {
    /* minmax(0,...) lets the single column shrink below its content's
       min-content so wide children (e.g. the comparison table) scroll
       instead of forcing horizontal page overflow. */
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ */
/* Card primitive                                                      */
/* ------------------------------------------------------------------ */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}
.card__actions {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-3);
}

/* ------------------------------------------------------------------ */
/* Form fields                                                         */
/* ------------------------------------------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  min-width: 0;
}
.field__label-wrap {
  display: flex;
  align-items: center;
}
.field__label {
  font-size: var(--font-size-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
}
.field__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.field input {
  font: inherit;
  font-size: var(--font-size-sm);
  padding: 9px var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-strong);
  /* Width sized to the field's realistic content (--in-chars) plus room for
     horizontal padding and the number spinner; never wider than the column. */
  width: calc(var(--in-chars, 6) * 1ch + 2.75rem);
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.field input::placeholder {
  color: var(--color-text-muted);
}
.field input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: var(--ring);
}
/* Per-field content widths — digits in each field's realistic max value,
   so boxes are proportional to what they actually hold (not a fixed width). */
#devices {
  --in-chars: 5;
}
#internalRate {
  --in-chars: 6;
}
#supportHours,
#incidents,
#downtimeHours,
#failureRate,
#hoursPerRma {
  --in-chars: 4;
}
#downtimeCost {
  --in-chars: 5;
}
#premierPrice,
#totalPrice {
  --in-chars: 4;
}

.field--inline {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* INS CARE pricing subsection (secondary config, brand-tinted)        */
/* ------------------------------------------------------------------ */

.pricing {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-md);
  background: var(--color-brand-tint);
}
.pricing__title {
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-bold);
  /* --color-link resolves to --color-brand-strong in light (unchanged) and to
     a lightened cyan in dark, so this title clears AA contrast on the
     brand-tinted panel in both themes. */
  color: var(--color-link);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pricing__note {
  margin: var(--space-1) 0 var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
/* Muted note text lacks AA contrast on the dark brand-tint panel; use the
   brighter body color there (light theme already clears the threshold). */
:root[data-theme='dark'] .pricing__note {
  color: var(--color-text);
}
.pricing__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.pricing .field__label {
  color: var(--color-text-strong);
}
.pricing input {
  background: var(--color-surface);
}

/* ------------------------------------------------------------------ */
/* Self-managed result list                                            */
/* ------------------------------------------------------------------ */

.result-list {
  margin: 0;
}
.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.result-row dt {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}
.result-row dd {
  margin: 0;
  font-size: var(--font-size-md);
  color: var(--color-text-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.result-row--total {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-bottom: none;
  border-top: 2px solid var(--color-border-strong);
}
.result-row--total dt {
  font-size: var(--font-size-md);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
}
.result-row--total dd {
  font-size: var(--font-size-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
}

/* Subtotal row (e.g. Total Internal Labor Hours Cost) — lighter than the grand total. */
.result-row--subtotal {
  border-top: 1px solid var(--color-border-strong);
  border-bottom: none;
}
.result-row--subtotal dt {
  font-weight: var(--weight-medium);
  color: var(--color-text-strong);
}
.result-row--subtotal dd {
  font-weight: var(--weight-medium);
  color: var(--color-text-strong);
}

/* Monospace numeric values */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Comparison table                                                    */
/* ------------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}
table.table th {
  text-align: left;
  font-weight: var(--weight-bold);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
table.table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  height: 48px;
  vertical-align: middle;
  color: var(--color-text-strong);
}
table.table tbody tr:last-child td {
  border-bottom: none;
}
table.table .num {
  text-align: right;
}
table.table th.num {
  text-align: right;
}
.compare-table .plan-name {
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
}

/* Health-green emphasis for savings & ROI (mirrors the sheet green fill) */
.compare-table .emphasis {
  color: var(--color-health-green);
  font-weight: var(--weight-bold);
  /* Call out the payoff — larger than base table text, but kept at lg so the
     table still fits the narrow two-column print layout without clipping ROI. */
  font-size: var(--font-size-lg);
  letter-spacing: -0.01em;
  background: var(--color-health-green-bg);
}
.compare-table .emphasis.is-negative {
  color: var(--color-health-red);
  background: var(--color-health-red-bg);
}

/* Mobile: stack each plan into its own card so the enlarged Savings and ROI
   figures are both fully visible without horizontal scrolling. */
@media (max-width: 640px) {
  .compare-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table td,
  .compare-table th.plan-name {
    display: block;
    width: 100%;
  }
  .compare-table tr {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }
  .compare-table tr:last-child {
    border-bottom: none;
  }
  .compare-table th.plan-name {
    font-size: var(--font-size-md);
    padding: 0 0 var(--space-2);
  }
  .compare-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    height: auto;
    padding: var(--space-1) 0;
    border: none;
    text-align: right;
  }
  .compare-table td::before {
    content: attr(data-label);
    font-size: var(--font-size-xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    text-align: left;
    white-space: nowrap;
  }
  /* Drop the block fill on mobile; keep the big bold green figure. */
  .compare-table .emphasis {
    background: transparent;
  }
}

/* Two side-by-side "How savings are modeled" cards (Premier + Total). */
.compare-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.compare-note {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-brand);
  background: var(--color-brand-tint);
  font-size: var(--font-size-xs);
  color: var(--color-text);
  line-height: 1.5;
}
.compare-note__title {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
}
.compare-note__body {
  margin: 0;
}
@media (max-width: 640px) {
  .compare-notes {
    grid-template-columns: 1fr;
  }
}

/* Liability disclaimer shown beneath the results/comparison table. */
.disclaimer {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid #eab866;
  border-left: 4px solid #e58f2c;
  border-radius: var(--radius-md);
  background: #fff6e6;
  color: var(--color-text);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}
/* Dark theme: translucent amber notice on the dark card. */
:root[data-theme='dark'] .disclaimer {
  border-color: rgba(244, 162, 60, 0.45);
  border-left-color: #f4a23c;
  background: rgba(244, 162, 60, 0.14);
}
/* Inline "Terms of Use" link within the disclaimer. */
.disclaimer a,
.disclaimer__link {
  color: var(--color-link);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.disclaimer a:hover,
.disclaimer__link:hover {
  color: var(--color-brand);
}

/* ------------------------------------------------------------------ */
/* Terms of Use / prose content page                                   */
/* ------------------------------------------------------------------ */

.terms__back {
  display: inline-block;
  margin-bottom: var(--space-4);
  color: var(--color-link);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.terms__back:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.terms__title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-strong);
  letter-spacing: -0.01em;
  margin: var(--space-6) 0 var(--space-2);
}
.prose p {
  margin: 0 0 var(--space-3);
  max-width: 75ch;
  color: var(--color-text);
  font-size: var(--font-size-md);
  line-height: 1.6;
}
.terms__copyright {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

/* ------------------------------------------------------------------ */
/* Footer (same design language; ai-pm has none)                       */
/* ------------------------------------------------------------------ */

/*
 * Footer — replicates the industrialnetworking.com site footer. Uses fixed
 * INS brand colors (dark navy #0C141D) regardless of the calculator's
 * light/dark theme, so it always reads as the corporate footer.
 */
.footer {
  flex-shrink: 0;
  background: #0c141d;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer__inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Top region: brand/contact column + two link columns */
.footer__top {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 1fr 1fr;
  gap: var(--space-8);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}
.footer__logo {
  height: 56px;
  width: auto;
  display: block;
  margin-bottom: var(--space-2);
}
.footer__call-label {
  font-size: var(--font-size-md);
  color: #c6ccd2;
}
.footer__phone {
  font-size: 19px;
  font-weight: var(--weight-bold);
  color: #ffffff;
  text-decoration: none;
}
.footer__phone:hover {
  color: var(--color-brand);
}
.footer__buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
  width: 180px;
}
.footer__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.footer__btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

/* Link columns */
.footer__col-title {
  margin: 0 0 var(--space-4);
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: #c6ccd2;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer__links a {
  color: #ffffff;
  text-decoration: none;
  font-size: var(--font-size-md);
  transition: color var(--dur-fast) var(--ease);
}
.footer__links a:hover {
  color: var(--color-brand);
}

/* Bottom bar: legal text + social icons */
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer__legal {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  color: #8693aa;
}
.footer__legal a {
  color: #8693aa;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.footer__legal a:hover {
  color: #ffffff;
}
.footer__social {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: background var(--dur-fast) var(--ease);
}
.footer__social a:hover {
  background: var(--color-brand);
}
.footer__social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 860px) {
  .footer__top {
    grid-template-columns: 1fr 1fr;
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 540px) {
  .footer__top {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Mobile / small-screen refinements                                   */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  /* Topbar: tighten spacing and drop the breadcrumb so controls fit */
  .topbar {
    padding: 0 var(--space-4);
    gap: var(--space-2);
  }
  .topbar__breadcrumb {
    display: none;
  }

  /* Reduce page + card padding so panels aren't oversized on phones */
  .page {
    padding: var(--space-6) var(--space-4);
  }
  .page-header__title {
    font-size: var(--font-size-xl);
  }
  .card {
    padding: var(--space-4);
  }

  /* Stack the INS CARE pricing inputs (this is what removed the overflow) */
  .pricing__grid {
    grid-template-columns: 1fr;
  }

  /* Comfortable touch targets */
  .field input {
    min-height: 44px;
  }
  .btn--sm {
    height: 36px;
    padding: 0 var(--space-3);
  }
  .theme-toggle {
    height: 40px;
    min-width: 40px;
  }

  /* Compact the comparison table so it fits without horizontal scrolling */
  table.table {
    font-size: var(--font-size-xs);
  }
  table.table td {
    padding: var(--space-1);
    height: 40px;
  }
  table.table th {
    padding: var(--space-1);
  }
}

/* Tiny screens: shorten the Print button label so the topbar never overflows */
@media (max-width: 480px) {
  .label-full {
    display: none;
  }
  .label-short {
    display: inline;
  }
}

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Print — customer leave-behind, one page, forced light theme         */
/* ------------------------------------------------------------------ */

@media print {
  :root,
  :root[data-theme='dark'] {
    /* Force the light palette regardless of the active theme. */
    --color-bg: #ffffff;
    --color-bg-subtle: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-2: #f7f9fc;
    --color-border: #cbd5e1;
    --color-border-strong: #94a3b8;
    --color-text-strong: #0e1726;
    --color-text: #36404e;
    --color-text-muted: #4b5563;
    --color-brand-tint: #e7f6fd;
    --color-health-green-bg: #e3f5ec;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }

  body {
    background: #fff;
  }

  /* Hide interactive controls */
  #theme-toggle,
  #print-btn,
  #reset-btn,
  .card__actions {
    display: none !important;
  }

  .topbar {
    box-shadow: none;
    border-bottom: 1px solid var(--color-border-strong);
  }

  .page {
    padding: var(--space-4) 0;
  }

  /* Single-page two-column layout */
  .layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .card,
  .table-wrap {
    box-shadow: none;
    border: 1px solid var(--color-border-strong);
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Inputs print as legible read-only values */
  .field input {
    border: 1px solid var(--color-border-strong);
    background: #fff;
    color: var(--color-text-strong);
    -webkit-appearance: none;
    appearance: none;
  }

  /* Keep the green emphasis fill in print */
  .compare-table .emphasis {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* The 4-column table can't fit the narrow two-column print layout, so it
     clips the Savings/ROI. Stack each plan into a card (same as mobile) so
     every value — including Projected ROI — prints in full. */
  .compare-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table td,
  .compare-table th.plan-name {
    display: block;
    width: 100%;
  }
  .compare-table tr {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }
  .compare-table tr:last-child {
    border-bottom: none;
  }
  .compare-table th.plan-name {
    font-size: var(--font-size-md);
    padding: 0 0 var(--space-1);
  }
  .compare-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    height: auto;
    padding: 2px 0;
    border: none;
    text-align: right;
  }
  .compare-table td::before {
    content: attr(data-label);
    font-size: var(--font-size-xs);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    text-align: left;
    white-space: nowrap;
  }
  .compare-table .emphasis {
    background: transparent;
  }
  .pricing {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .footer {
    background: #fff;
    color: var(--color-text);
    border-top: 1px solid var(--color-border-strong);
  }
  .footer__top,
  .footer__social {
    display: none;
  }
  .footer__inner {
    padding: var(--space-3) var(--space-6);
    gap: 0;
  }
  .footer__bottom {
    border-top: none;
    padding-top: 0;
  }
  .footer__legal,
  .footer__legal a {
    color: var(--color-text-muted);
  }
}
