/* cpt.css: page layer for cpt-profile.html on the GeoLiquefy design harness.
   Load order matters: harness.css (tokens + primitives), dashboard.css
   (gl-* input/table primitives, .hidden, .db-wall, .db-plot-toggles,
   .db-thin-preface; its page-layout rules are scoped to html.db-root /
   body.db-body-root and are inert here), then this file. Only rules with no
   equivalent in those two live here, and they read the same tokens.
   Replaces the retired lhe.css (parked at docs/parked/lhe.css). */

body.cpt-body {
  margin: 0;
  background: var(--surface-0);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- top navigation (this tool keeps a Back link) ---- */
.cpt-nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface-0) 92%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border-divider);
}
.cpt-nav-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--space-4);
  height: 52px; display: flex; align-items: center;
  justify-content: space-between; gap: var(--space-4);
}
.cpt-brand {
  font-family: var(--font-heading); font-weight: var(--font-bold);
  font-size: 19px; color: var(--on-surface-0); text-decoration: none;
  letter-spacing: var(--tracking-wordmark); flex-shrink: 0;
}
.cpt-brand span { font-weight: var(--font-light); }
.cpt-nav-right { display: flex; align-items: center; gap: var(--space-3); }
.cpt-back-link {
  font-size: 13px; color: var(--accent-600); text-decoration: none;
}
.cpt-back-link:hover { text-decoration: underline; }
.cpt-health {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--on-surface-1);
}
.health-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--border-divider);
}
.health-dot.ok      { background: var(--accent-600); }
.health-dot.loading { background: var(--on-surface-1); animation: cpt-pulse 1.4s ease-in-out infinite; }
.health-dot.error   { background: var(--danger-600); }
@keyframes cpt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- page frame ---- */
.cpt-main {
  max-width: 1240px; margin: 0 auto;
  padding: 0 var(--space-4) var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.cpt-title {
  font-size: 26px; margin: var(--space-6) 0 0;
  letter-spacing: 0.01em;
}

/* ---- step cards ---- */
.step-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.step-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border-divider);
  flex-wrap: wrap;
}
.step-title {
  font-size: 19px; margin: 0; letter-spacing: 0.01em;
}
.step-body { padding: var(--space-6); }
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 12px; font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  background: var(--surface-0); color: var(--on-surface-2);
  border: 1px solid var(--border-divider); flex-shrink: 0;
}
.step-badge.active { border-color: var(--accent-600); color: var(--accent-600); }
.step-badge.done { background: var(--accent-600); color: var(--surface-0); border-color: var(--accent-600); }

.cpt-lede { font-size: 13px; color: var(--on-surface-2); margin: 0 0 var(--space-3); line-height: 1.6; }
.hint { font-size: 11.5px; color: var(--on-surface-1); }
.hint-block { display: block; margin: var(--space-1) 0 var(--space-2); }
.field-warning {
  font-size: 11.5px; color: var(--danger-600); margin-top: 2px;
}

/* ---- inputs ---- */
textarea.cpt-textarea {
  width: 100%; min-height: 200px; box-sizing: border-box;
  background: var(--surface-0);
  border: 1px solid var(--border-divider);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface-0); resize: vertical;
}
textarea.cpt-textarea:focus-visible { outline: 2px solid var(--accent-600); outline-offset: 1px; }
textarea.cpt-textarea::placeholder { color: var(--on-surface-1); }

.cpt-row {
  display: flex; gap: var(--space-4); align-items: flex-end;
  margin-top: var(--space-3); flex-wrap: wrap;
}
.cpt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); }
.cpt-grid2 .span-2 { grid-column: 1 / -1; }
@media (max-width: 480px) { .cpt-grid2 { grid-template-columns: 1fr; } }

/* ---- banners ---- */
.banner {
  font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--border-divider);
  border-left: 3px solid var(--on-surface-1);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
  background: var(--surface-0);
  color: var(--on-surface-0);
}
.banner-info { border-left-color: var(--accent-600); }
.banner-warn { border-left-color: var(--warn-800); color: var(--warn-800); }
.banner-error { border-left-color: var(--danger-600); color: var(--danger-600); }

/* ---- step 2: visualization layout ---- */
.viz-row { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.viz-plot { flex: 1; min-width: 300px; }
.viz-plot canvas { width: 100%; height: 520px; display: block; }
.viz-panel {
  width: 320px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: var(--space-3);
}
@media (max-width: 768px) { .viz-row { flex-direction: column; } .viz-panel { width: 100%; } }

.cl-card {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-600);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.cl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.cl-item { display: flex; flex-direction: column; gap: 2px; }
.cl-item-label {
  /* no uppercase: these labels carry notation (qc, fs, Ic) */
  font-size: 12px; letter-spacing: 0.02em; font-weight: 500;
  font-family: var(--font-body);
  color: var(--on-surface-1);
}
.cl-item-val { font-size: 13px; color: var(--on-surface-0); }
.cl-warn { font-size: 11.5px; color: var(--warn-800); margin-top: var(--space-2); }
.cl-why { margin-top: var(--space-2); font-size: 12px; color: var(--on-surface-2); }
.cl-why summary { cursor: pointer; color: var(--accent-600); }
.cl-why p { margin: var(--space-2) 0 0; line-height: 1.55; }

.cpt-hr { border: none; border-top: 1px solid var(--border-divider); margin: var(--space-2) 0; }
.reset-link { font-size: 11.5px; color: var(--accent-600); text-decoration: none; }
.reset-link:hover { text-decoration: underline; }

/* ---- spinner ---- */
.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: cpt-spin 0.8s linear infinite;
  display: inline-block; vertical-align: -2px; margin-right: 6px;
}
@keyframes cpt-spin { to { transform: rotate(360deg); } }

/* ---- results ---- */
.provenance {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-600);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 12.5px; line-height: 1.5; color: var(--on-surface-0);
}
.results-header {
  display: flex; align-items: baseline; gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-2);
}
.results-title { font-size: 22px; margin: 0; }
.results-meta {
  font-size: 12px; color: var(--on-surface-1);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}

.insufficient-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 13px; line-height: 1.55;
  margin-bottom: var(--space-4);
}
.progress-card-heading { font-family: var(--font-heading); font-size: 15px; }

.results-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.results-card-head {
  display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

/* verdict: one fixed style regardless of level (color is ink here, never a
   risk scale), matching the dashboard's verdict discipline */
.verdict-tag {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--on-surface-0);
  border-bottom: 2px solid var(--accent-600);
  padding-bottom: 1px;
}
.stage-chip {
  font-size: 11.5px; letter-spacing: 0.06em;
  font-family: var(--font-body);
  color: var(--on-surface-2);
  border: 1px solid var(--border-divider);
  border-radius: 999px; padding: 3px 10px;
}
.ai-eyebrow {
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  font-family: var(--font-body);
  color: var(--accent-600);
}
.sample-size-note { font-size: 12px; color: var(--on-surface-2); margin-bottom: var(--space-2); }
/* The index under the site label: body text, no level colour, like the label. */
.index-note { margin-bottom: var(--space-2); }
.index-note-headline { font-size: 13px; color: var(--on-surface-0); }
.index-note-disclosure { font-size: 12px; color: var(--on-surface-2); }
.index-note-citation { font-size: 11.5px; color: var(--on-surface-2); }
.sample-size-note.sample-size-thin { color: var(--warn-800); }
.ai-compliance-warn {
  font-size: 12.5px; color: var(--danger-600);
  border: 1px solid var(--danger-600); border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}
.ai-stage { font-size: 12.5px; color: var(--on-surface-2); font-style: italic; }
.ai-memo { font-size: 13.5px; line-height: 1.65; }
.ai-memo p { margin: 0 0 var(--space-2); }
.ai-memo .gl-grp { margin: var(--space-3) 0 var(--space-1); }
.memo-note { color: var(--on-surface-2); font-style: italic; }

/* screening table (markup emitted by js/screening_table.mjs) */
.screening-table-wrap { overflow-x: auto; }
.screening-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.screening-table th {
  /* no uppercase: headers can carry notation */
  text-align: left; font-weight: 500; font-size: 12px;
  letter-spacing: 0.02em; font-family: var(--font-body);
  color: var(--on-surface-1);
  border-bottom: 1px solid var(--border-divider);
  padding: 4px 10px 4px 0;
}
.screening-table td {
  border-bottom: 1px solid var(--border-divider);
  padding: 6px 10px 6px 0; vertical-align: top;
}
.screening-preface {
  border-left: 3px solid var(--accent-600);
  background: var(--surface-0);
  padding: var(--space-2) var(--space-3);
  font-size: 13px; margin: 0 0 var(--space-2);
}
.screening-thin-flag { color: var(--warn-800); font-size: 11px; }
.screening-site-conclusion { font-size: 13px; margin: var(--space-2) 0 0; }

/* CSR plot */
.csr-plot-sub { font-size: 12px; color: var(--on-surface-2); }
#csr-plot svg { width: 100%; height: auto; display: block; }
#csr-plot-placeholder {
  font-size: 12px; color: var(--on-surface-1);
  padding: 20px 0; text-align: center;
}
.cpt-legend {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 11px; color: var(--on-surface-2); margin-top: var(--space-2);
}
.cpt-legend .db-legend-item { display: flex; gap: 6px; align-items: center; }
.cpt-legend .db-legend-note { color: var(--on-surface-1); font-style: italic; }

/* matches table */
.results-table-wrap {
  overflow-x: auto;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4) var(--space-3);
  margin-bottom: var(--space-4);
}
#results-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#results-table th {
  /* no uppercase: headers carry notation (Mw, qc, N60, D50, Vs) */
  text-align: left; font-weight: 500; font-size: 12px;
  letter-spacing: 0.02em; font-family: var(--font-body);
  color: var(--on-surface-1);
  border-bottom: 1px solid var(--border-divider);
  padding: 8px 10px 6px 0; white-space: nowrap;
}
#results-table td {
  border-bottom: 1px solid var(--border-divider);
  padding: 8px 10px 8px 0; vertical-align: top;
}
.results-empty { text-align: center; color: var(--on-surface-1); padding: 24px; line-height: 1.5; }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-divider); font-size: 11px;
  font-family: var(--font-body);
  color: var(--on-surface-2);
}
.site-name { font-weight: 500; }
.event-name { font-size: 11.5px; color: var(--on-surface-1); }
.stack-cell { white-space: nowrap; }
.stack-top, .stack-bot { display: block; }
.stack-bot { font-size: 11.5px; color: var(--on-surface-1); }
.fmt-unit { font-size: 11px; color: var(--on-surface-1); }
.fmt-missing { color: var(--on-surface-1); }
.liq-yes { color: var(--danger-600); font-weight: 500; }
.liq-no { color: var(--success-700); font-weight: 500; }
.liq-unk { color: var(--on-surface-1); font-style: italic; }
.consequence-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.cflag {
  font-size: 11px; font-family: var(--font-body); color: var(--on-surface-2);
  border: 1px solid var(--border-divider);
  border-radius: 999px; padding: 1px 7px;
}
.sim-cell { min-width: 90px; }
.sim-pct { display: block; }
.sim-bar-wrap {
  height: 3px; background: var(--surface-2);
  border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.sim-bar { height: 100%; background: var(--accent-600); }

/* ---- affiliation disclaimer + footer ---- */
.affiliation-disclaimer {
  border-top: 1px solid var(--border-divider);
  margin-top: var(--space-6); padding-top: var(--space-4);
  font-size: 12px; color: var(--on-surface-2); line-height: 1.6;
}
.affiliation-disclaimer p { margin: 0; max-width: 72ch; }
.cpt-footer {
  border-top: 1px solid var(--border-divider);
  background: var(--surface-0);
  margin-top: var(--space-8);
}
.cpt-footer-inner {
  max-width: 1240px; margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
  font-size: 12px; color: var(--on-surface-1);
}
.cpt-footer-inner a { color: var(--on-surface-2); }
.cpt-footer-inner a:hover { color: var(--on-surface-0); }

/* ---- entrance ---- */
.fade-up { animation: cpt-fade-up 0.45s ease-out; }
@keyframes cpt-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
