/* ═══════════════════════════════════════════════════
   YSI Processor Live — Design System
   ═══════════════════════════════════════════════════ */

:root {
  /* Palette */
  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-800: #92400e;
  --amber-900: #78350f;

  --teal-50:  #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-600: #0d9488;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --teal-900: #134e4a;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --red-600: #dc2626;
  --red-700: #b91c1c;
  --green-700: #15803d;
  --green-800: #166534;
  --blue-700:  #1d4ed8;
  --blue-800:  #1e40af;

  /* Semantic tokens */
  --bg:             #f5f0e8;
  --surface:        rgba(255, 253, 248, 0.94);
  --surface-raised: rgba(255, 255, 255, 0.98);
  --ink:            var(--slate-800);
  --ink-muted:      var(--slate-500);
  --ink-faint:      var(--slate-400);
  --accent:         var(--amber-700);
  --accent-hover:   var(--amber-800);
  --teal:           var(--teal-700);
  --teal-hover:     var(--teal-800);
  --warn:           var(--red-700);
  --ok:             var(--green-700);
  --border:         rgba(120, 90, 50, 0.14);
  --border-strong:  rgba(120, 90, 50, 0.24);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.06);

  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 24px;
  --hc-header-height: 88px;
  --hc-footer-height: 56px;
}

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

body {
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(180,83,9,.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 95% 5%,  rgba(15,118,110,.10) 0%, transparent 50%),
    linear-gradient(180deg, #f7f2e9 0%, #f1ece0 50%, #ece4d4 100%);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

code, .mono {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 0.88em;
}

/* ═══════════════════════════════════════════════════
   HostCell Suite header / footer
   ═══════════════════════════════════════════════════ */
.hc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hc-header-height);
  z-index: 1001;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(60,64,67,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  box-sizing: border-box;
  overflow: hidden;
}

.hc-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  overflow: hidden;
}

.hc-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff6e7 0%, #fef3c7 100%);
  border: 1px solid rgba(180,83,9,.22);
  box-shadow: 0 1px 4px rgba(60,64,67,0.16);
  flex-shrink: 0;
}

.hc-logo-glyph {
  color: var(--amber-700);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.hc-header-text {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}

.hc-title-line {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.hc-header h1 {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-tagline {
  font-size: 0.83rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hc-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 0;
}

.hc-suite-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #F5F9FF 0%, #E8F0FE 100%);
  border: 1px solid #C5D9FB;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  text-decoration: none !important;
  transition: transform 110ms ease, box-shadow 130ms ease, background 130ms ease;
}

.hc-suite-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #EEF5FF 0%, #DCEBFF 100%);
}

.hc-suite-pill:visited {
  color: inherit;
}

.hc-suite-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #4285F4;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   Page shell + grid
   ═══════════════════════════════════════════════════ */
.page-shell {
  width: min(1400px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(var(--hc-header-height) + 1.5rem) 0 calc(var(--hc-footer-height) + 1.5rem);
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

/* ═══════════════════════════════════════════════════
   Panels
   ═══════════════════════════════════════════════════ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem;
  backdrop-filter: blur(8px);
  grid-column: span 12;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.panel-head-left h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.panel-head-left p {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.panel-head-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   Intake panel
   ═══════════════════════════════════════════════════ */

/* ── Settings bar (horizontal strip above dropzone) ── */
.settings-bar {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.settings-bar .settings-label {
  white-space: nowrap;
  align-self: flex-end;
  padding-bottom: 0.55rem;
}

.settings-bar-fields {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-field span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.setting-field input[type="number"] {
  width: 88px;
}

.settings-bar-actions {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin-left: auto;
}

/* ── Dropzone + info side-by-side ── */
.intake-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

.intake-drop-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.intake-info-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 1px solid var(--border);
  padding-left: 1.5rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 190px;
  padding: 2rem;
  border: 2px dashed rgba(180,83,9,.35);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255,252,246,.97), rgba(254,243,219,.90));
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.dropzone:hover, .dropzone.dragging {
  border-color: rgba(15,118,110,.55);
  background: linear-gradient(145deg, rgba(255,253,250,.99), rgba(220,252,245,.88));
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(15,118,110,.12);
}

.dropzone input { display: none; }

.drop-icon {
  width: 2.2rem;
  height: 2.2rem;
  stroke: var(--amber-700);
  opacity: 0.7;
}

.drop-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.drop-subtitle {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 1rem;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(21,94,117,.09);
  color: var(--teal);
  border: 1px solid rgba(21,94,117,.18);
  font-size: 0.82rem;
  font-weight: 500;
}

.status-bar {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(248, 245, 238, 0.9);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.settings-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
}

.settings-note {
  font-size: 0.78rem;
  color: var(--ink-faint);
  line-height: 1.55;
}

input[type="number"],
input[type="search"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 140ms, box-shadow 140ms;
}

input[type="number"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,118,110,.15);
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(21,94,117,.08);
  color: var(--teal);
  border: 1px solid rgba(21,94,117,.16);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: "JetBrains Mono", monospace;
}

.action-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */
button {
  cursor: pointer;
  font: inherit;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease, opacity 130ms ease;
}

button svg { width: 1em; height: 1em; flex-shrink: 0; }

button:hover   { transform: translateY(-1px); }
button:active  { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  padding: 0.65rem 1.3rem;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--amber-700) 0%, var(--amber-500) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(180,83,9,.35), 0 1px 2px rgba(180,83,9,.2);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(180,83,9,.40), 0 2px 4px rgba(180,83,9,.2);
}

.btn-secondary {
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.87rem;
  background: rgba(15,118,110,.10);
  color: var(--teal);
  border: 1px solid rgba(15,118,110,.22);
}

.btn-secondary:hover { background: rgba(15,118,110,.18); }

.btn-ghost {
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.87rem;
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: rgba(0,0,0,.04); color: var(--ink); }

/* Download strip */
.downloads-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.downloads-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  margin-right: 0.2rem;
}

.dl-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(15,118,110,.08);
  color: var(--teal);
  border: 1px solid rgba(15,118,110,.20);
  border-radius: 999px;
  gap: 0.35rem;
}

.dl-btn svg { width: 0.9em; height: 0.9em; }
.dl-btn:hover { background: rgba(15,118,110,.15); }

/* ═══════════════════════════════════════════════════
   KPI strip
   ═══════════════════════════════════════════════════ */
.kpi-panel {
  padding: 1rem 1.4rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.kpi-card {
  padding: 0.9rem 1.2rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kpi-card:last-child { border-right: none; }

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.kpi-card:nth-child(2) .kpi-value { color: var(--amber-700); }
.kpi-card:nth-child(3) .kpi-value { color: var(--red-700); }

/* ═══════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════ */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-raised);
  font-size: 0.87rem;
}

th, td {
  padding: 0.62rem 0.85rem;
  border-bottom: 1px solid rgba(120,90,50,.08);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: rgba(247, 242, 234, 0.96);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  z-index: 2;
}

tbody tr {
  transition: background 100ms ease;
}

tbody tr:hover td { background: rgba(180,83,9,.04) !important; }

tbody tr:nth-child(even) td { background: rgba(248,243,234,.55); }

tfoot td {
  background: rgba(248,243,234,.8);
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
  padding: 0.6rem;
}

/* ═══════════════════════════════════════════════════
   Status badges
   ═══════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.status-pass    { background: rgba(21,128,61,.12);  color: var(--green-700); border: 1px solid rgba(21,128,61,.2); }
.status-fail    { background: rgba(220,38,38,.12);  color: var(--red-700);   border: 1px solid rgba(220,38,38,.2); }
.status-cleaned { background: rgba(29,78,216,.10);  color: var(--blue-700);  border: 1px solid rgba(29,78,216,.2); }
.status-review  { background: rgba(180,83,9,.12);   color: var(--amber-700); border: 1px solid rgba(180,83,9,.22); }

/* Row tinting */
.row-fail td    { background: rgba(220,38,38,.045) !important; }
.row-fail:hover td  { background: rgba(220,38,38,.09) !important; }
.row-review td  { background: rgba(180,83,9,.040) !important; }
.row-review:hover td { background: rgba(180,83,9,.08) !important; }
.row-cleaned td { background: rgba(29,78,216,.04) !important; }
.row-pass td    { background: transparent !important; }

/* CV coloring */
.cv-high { color: var(--red-700); font-weight: 700; }
.cv-ok   { color: var(--green-700); }

/* ═══════════════════════════════════════════════════
   Pivoted results table
   ═══════════════════════════════════════════════════ */
.chem-group-header {
  text-align: center;
  background: rgba(15,118,110,.10) !important;
  border-left: 2px solid rgba(15,118,110,.30);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.chem-sub-header {
  text-align: center;
  background: rgba(15,118,110,.05) !important;
  font-size: 0.72rem;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.chem-col-first { border-left: 2px solid rgba(15,118,110,.18); }

.well-id-cell { font-weight: 600; }
.plates-cell { font-size: 0.78rem; color: var(--ink-muted); white-space: normal; max-width: 200px; }

td.no-data {
  text-align: center;
  color: var(--ink-faint);
  border-left: 2px solid rgba(15,118,110,.12);
}

#quick-results-table td:not(.well-id-cell):not([colspan]) {
  text-align: center;
}

/* ═══════════════════════════════════════════════════
   CV variability chart
   ═══════════════════════════════════════════════════ */
.chart-wrap { overflow-x: auto; }

.chart-bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(120,90,50,.06);
}

.chart-bar-row:last-child { border-bottom: none; }

.chart-label {
  font-size: 0.82rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(31,41,51,.07);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width 400ms ease;
}

.bar-fill.raw   { background: linear-gradient(90deg, #fb923c, #b45309); }
.bar-fill.clean { background: linear-gradient(90deg, #4ade80, #166534); }

.bar-track-threshold {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: rgba(220,38,38,.65);
  border-radius: 1px;
  z-index: 1;
}

.chart-legend {
  display: flex;
  gap: 1.1rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  align-items: center;
  flex-shrink: 0;
}

.legend-raw::before,
.legend-clean::before,
.legend-threshold::before {
  content: "";
  display: inline-block;
  width: 0.85rem;
  height: 0.5rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.legend-raw::before       { background: linear-gradient(90deg, #fb923c, #b45309); }
.legend-clean::before     { background: linear-gradient(90deg, #4ade80, #166534); }
.legend-threshold::before { background: rgba(220,38,38,.65); width: 2px; height: 0.8rem; border-radius: 1px; }

/* ═══════════════════════════════════════════════════
   Methods accordion
   ═══════════════════════════════════════════════════ */
.method-accordion {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255,252,246,.6);
}

.method-accordion summary {
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber-800);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: rgba(180,83,9,.06);
  transition: background 140ms;
}

.method-accordion summary:hover { background: rgba(180,83,9,.10); }
.method-accordion summary::-webkit-details-marker { display: none; }

.method-accordion summary::after {
  content: "▸";
  font-size: 0.8em;
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.method-accordion[open] summary::after { transform: rotate(90deg); }

.method-body {
  padding: 0.9rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.method-body p  { margin-bottom: 0.6rem; }
.method-body p:last-child { margin-bottom: 0; }
.method-body dl { margin: 0; }
.method-body dt { font-weight: 700; color: var(--ink); margin-top: 0.6rem; font-size: 0.83rem; }
.method-body dd { margin: 0.15rem 0 0; }

/* Manifest preview */
.manifest-preview {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(248,245,238,.9);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════
   Annotated Measurements — collapsible tab
   ═══════════════════════════════════════════════════ */
.measurements-details {
  grid-column: span 12;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.measurements-summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.4rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: rgba(248,244,236,.7);
  border-bottom: 1px solid transparent;
  transition: background 140ms;
}

.measurements-summary::-webkit-details-marker { display: none; }
.measurements-summary:hover { background: rgba(248,244,236,.95); }

.measurements-details[open] .measurements-summary {
  border-bottom-color: var(--border);
}

.measurements-summary svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.measurements-summary > span:first-of-type {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.measurements-desc {
  font-size: 0.82rem;
  color: var(--ink-muted);
  flex: 1;
}

.measurements-chevron {
  font-size: 0.85em;
  color: var(--ink-faint);
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.measurements-details[open] .measurements-chevron {
  transform: rotate(90deg);
}

.measurements-body {
  padding: 1.2rem 1.4rem;
}

/* ═══════════════════════════════════════════════════
   Utility
   ═══════════════════════════════════════════════════ */
.hc-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--hc-footer-height);
  background: rgba(248, 249, 250, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid #E0E0E0;
  box-shadow: 0 -1px 8px rgba(60,64,67,0.07);
  z-index: 9999;
  box-sizing: border-box;
}

.hc-footer-inner {
  height: 100%;
  padding: 0 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: 'Roboto', 'Google Sans', sans-serif;
}

.hc-footer-suite {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hc-footer-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: #4285F4;
  white-space: nowrap;
}

.hc-footer-slogan {
  font-size: 0.67rem;
  color: #5F6368;
  white-space: nowrap;
  font-style: italic;
}

.hc-footer-author {
  font-size: 0.78rem;
  color: #5F6368;
  white-space: nowrap;
  margin-left: auto;
}

.hc-footer-github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.44rem 1.05rem;
  border-radius: 999px;
  background: #1e2330;
  color: #FFFFFF !important;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 130ms ease, transform 110ms ease, box-shadow 130ms ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
  flex-shrink: 0;
  font-family: 'Google Sans', 'Roboto', sans-serif;
}

.hc-footer-github svg { flex-shrink: 0; }
.hc-footer-github:hover { background: #2d3348; transform: translateY(-1px); box-shadow: 0 3px 9px rgba(0,0,0,0.25); }

.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .intake-body {
    grid-template-columns: 1fr;
  }
  .intake-info-side {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 1rem;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-card {
    border-bottom: 1px solid var(--border);
  }
  .kpi-card:nth-child(odd) { border-right: 1px solid var(--border); }
  .kpi-card:nth-child(even) { border-right: none; }
  :root {
    --hc-header-height: 80px;
  }

  .hc-header {
    padding: 0 1rem;
  }

  .hc-logo {
    width: 40px;
    height: 40px;
  }

  .hc-header h1 {
    font-size: 0.98rem;
  }

  .hc-tagline {
    font-size: 0.76rem;
  }

  .hc-suite-label {
    font-size: 0.72rem;
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .page-shell { padding: calc(var(--hc-header-height) + 1rem) 0 calc(var(--hc-footer-height) + 3rem); }

  .panel { padding: 1rem; border-radius: var(--radius); }

  .settings-bar { gap: 0.75rem; }
  .settings-bar-actions { margin-left: 0; }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chart-bar-row { grid-template-columns: 1fr; }

  .downloads-strip { gap: 0.4rem; }
  .dl-btn { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
}

@media (max-width: 680px) {
  :root {
    --hc-header-height: 94px;
    --hc-footer-height: 76px;
  }

  .hc-header {
    align-items: center;
    padding: 0 0.8rem;
  }

  .hc-logo {
    width: 36px;
    height: 36px;
  }

  .hc-logo-glyph {
    font-size: 0.68rem;
  }

  .hc-title-line {
    align-items: flex-start;
    gap: 0.2rem;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .hc-header h1 {
    font-size: 0.9rem;
    white-space: normal;
  }

  .hc-tagline {
    font-size: 0.72rem;
    white-space: normal;
  }

  .hc-footer-inner {
    padding: 0.45rem 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem 1rem;
  }

  .hc-footer-author { margin-left: 0; }
  .hc-footer-github { margin-left: auto; }

  .hc-suite-pill {
    padding: 0.45rem 0.65rem;
  }

  .hc-suite-label {
    font-size: 0.68rem;
  }
}
