/* app.css — RouteLoad AI planning flow (Phase 5).
 *
 * Layout + components built ONLY on the tokens in brand.css. No colours or
 * fonts are hardcoded here; every value references an --athera-* variable or a
 * brand utility class. One blue accent per viewport, generous whitespace,
 * calm 0.2s transitions, no shadows on text.
 */

/* ------------------------------------------------------------------ header --- */
.app-header {
  border-bottom: 1px solid var(--athera-line);
  background: var(--athera-off-white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.header-left { display: flex; align-items: baseline; gap: 20px; }

/* Wordmark: "A!" blue, "thera" charcoal, Cormorant 300; "Partners" raised. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.wordmark .wm-a { color: var(--athera-blue-deep); }
.wordmark .wm-t { color: var(--athera-charcoal); }
.wordmark .wm-p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--athera-grey);
  position: relative;
  top: -4px;
}
.header-right { display: flex; align-items: center; gap: 28px; }
.nav-link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13.5px;
  color: var(--athera-blue-deep);
}
.nav-link:hover { color: var(--athera-navy); }

/* ----------------------------------------------------------------- stepper --- */
.stepper {
  border-bottom: 1px solid var(--athera-line);
  background: var(--athera-white);
}
.stepper .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 26px 18px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--ease);
  opacity: 0.5;
}
.step:not(:disabled):hover { opacity: 0.85; }
.step:disabled { cursor: not-allowed; }
.step.active { opacity: 1; }
.step .step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--athera-grey);
}
.step.active .step-num { color: var(--athera-blue-deep); }
.step .step-name {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--athera-charcoal);
}
.step.done .step-num { color: var(--athera-charcoal); }

/* ------------------------------------------------------------------ screen --- */
.screen { padding: 56px 0 88px; animation: fade var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.screen-head { margin-bottom: 36px; }
.screen-head .label { display: block; margin-bottom: 14px; }
.screen-head .display-md { max-width: 18ch; }
.lead { max-width: 60ch; margin-top: 12px; color: var(--athera-grey); }

.footer-bar {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--athera-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-note { color: var(--athera-grey); }

/* ---------------------------------------------------------------- S1 hero --- */
.hero {
  background: var(--athera-navy);
  border-radius: var(--radius);
  padding: 72px 64px 64px;
  color: var(--athera-white);
}
.hero .blue-rule {
  width: 48px;
  height: 1px;
  background: var(--athera-blue);
  margin-bottom: 32px;
}
.hero .display-lg { color: var(--athera-white); max-width: 16ch; }
.hero-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
  max-width: 52ch;
  margin: 24px 0 40px;
}
.hero-stats {
  display: flex;
  gap: 56px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
.hero-stat .stat-num {
  font-family: var(--font-mono);
  font-size: 34px;
  color: var(--athera-blue);
  line-height: 1;
}
.hero-stat .stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 10px;
}

/* --------------------------------------------------------------- grids ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

.card-title { margin-bottom: 6px; }
.card .card-cap { color: var(--athera-grey); margin-bottom: 20px; }

/* big real count inside a card */
.bignum {
  font-family: var(--font-mono);
  font-size: 40px;
  color: var(--athera-navy);
  line-height: 1;
}
.bignum-row { display: flex; gap: 40px; margin: 8px 0 22px; flex-wrap: wrap; }
.bignum-row .bn-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--athera-grey);
  margin-top: 8px;
}

/* file input */
.file-drop {
  border: 1px dashed var(--athera-line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  transition: border-color var(--ease);
}
.file-drop:hover { border-color: var(--athera-blue-deep); }
.file-drop input { display: none; }

/* tags ----------------------------------------------------------------- */
.tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--athera-line);
  color: var(--athera-grey);
  display: inline-block;
  line-height: 1.2;
}
.tag-cold { color: var(--athera-blue-deep); border-color: var(--athera-blue-deep); }
.tag-amber { color: var(--athera-amber); border-color: var(--athera-amber); }
.tag-p1 { color: var(--athera-critical); border-color: var(--athera-critical); }

/* ------------------------------------------------------------ S3 readiness -- */
.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--athera-line);
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}
.counter {
  background: var(--athera-white);
  padding: 22px 20px;
}
.counter .c-num {
  font-family: var(--font-mono);
  font-size: 30px;
  color: var(--athera-navy);
  line-height: 1;
}
.counter .c-num.warn { color: var(--athera-amber); }
.counter .c-label {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12.5px;
  color: var(--athera-grey);
  margin-top: 10px;
  line-height: 1.35;
}

.issue {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--athera-surface);
  margin-bottom: 12px;
  border-left: 3px solid var(--athera-line);
}
.issue.blocker { border-left-color: var(--athera-critical); }
.issue.warning { border-left-color: var(--athera-amber); }
.issue .issue-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.issue .issue-msg { color: var(--athera-charcoal); }
.issue .issue-fix { color: var(--athera-grey); margin-top: 4px; }

.assump-block { margin-top: 24px; }
.assump-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--athera-line);
  font-size: 13px;
}
.assump-row:last-child { border-bottom: none; }
.assump-row .a-key { color: var(--athera-grey); }
.assump-row .a-val { font-family: var(--font-mono); color: var(--athera-charcoal); text-align: right; }

.maps-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--athera-grey);
}
.maps-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--athera-grey); }
.maps-pill.on .dot { background: var(--athera-blue-deep); }

/* indeterminate loading bar */
.loading-line { margin-top: 18px; }
.loading-line .lbl { color: var(--athera-grey); margin-bottom: 10px; }
.progress {
  height: 2px;
  width: 100%;
  background: var(--athera-mist);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress::after {
  content: '';
  position: absolute;
  left: -40%;
  top: 0;
  height: 100%;
  width: 40%;
  background: var(--athera-blue-deep);
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* --------------------------------------------------------------- S4 KPIs --- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--athera-line);
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.kpi {
  background: var(--athera-white);
  padding: 20px 18px;
}
.kpi .k-num {
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--athera-navy);
  line-height: 1;
}
.kpi .k-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--athera-grey);
  margin-top: 9px;
}

.baseline-band {
  background: var(--athera-surface);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.baseline-band .bb-label { color: var(--athera-grey); }
.baseline-band .bb-figs {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--athera-charcoal);
}
.baseline-band .bb-figs .pos { color: var(--athera-blue-deep); }

/* route cards layout */
.routes-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--gap); align-items: start; }
.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

.route-card { transition: opacity var(--ease); }
.route-card.refreshing { opacity: 0.35; }
.route-card .rc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.route-card .rc-title { font-family: var(--font-body); font-weight: 500; font-size: 15px; color: var(--athera-navy); }
.route-card .rc-util {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--athera-grey);
}
.route-card .rc-driver { color: var(--athera-grey); font-size: 12.5px; margin-bottom: 14px; }

.util-bar {
  height: 4px;
  width: 100%;
  background: var(--athera-mist);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 18px;
}
.util-bar > span { display: block; height: 100%; background: var(--athera-blue-deep); transition: width var(--ease); }
.util-bar.low > span { background: var(--athera-amber); }
.util-bar.high > span { background: var(--athera-critical); }

/* stop timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 22px 56px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--athera-line);
  align-items: baseline;
}
.timeline li:last-child { border-bottom: none; }
.timeline .t-seq { font-family: var(--font-mono); font-size: 12px; color: var(--athera-grey); }
.timeline .t-eta { font-family: var(--font-mono); font-size: 12.5px; color: var(--athera-charcoal); }
.timeline .t-cust { font-size: 13px; color: var(--athera-charcoal); }
.timeline .t-area { color: var(--athera-grey); font-size: 11.5px; }
.timeline .t-risk { font-size: 11.5px; color: var(--athera-amber); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.timeline .risk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--athera-amber); flex: none; }

.shift-note { font-size: 11.5px; color: var(--athera-grey); margin-top: 14px; font-family: var(--font-mono); }
.shift-note.bad { color: var(--athera-critical); }

/* collapsibles */
.collapse { margin-top: 14px; border-top: 1px solid var(--athera-line); }
.collapse > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--athera-blue-deep);
}
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary::before { content: '+ '; }
.collapse[open] > summary::before { content: '– '; }
.why {
  border-left: 2px solid var(--athera-blue-deep);
  padding: 4px 0 4px 16px;
  margin: 10px 0 4px;
  color: var(--athera-charcoal);
}

/* exceptions sidebar */
.side { position: sticky; top: 96px; }
.side .side-title { margin-bottom: 16px; }
.exc {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--athera-surface);
  margin-bottom: 10px;
  border-left: 3px solid var(--athera-line);
}
.exc.blocker { border-left-color: var(--athera-critical); }
.exc.warning { border-left-color: var(--athera-amber); }
.exc .exc-type {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--athera-grey);
  margin-bottom: 4px;
}
.exc .exc-msg { font-size: 12.5px; color: var(--athera-charcoal); }

/* urgent order mini-form */
.urgent-form { margin-top: 22px; }
.urgent-form .uf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--athera-grey);
}
.field input, .field select {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 13px;
  padding: 9px 10px;
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  background: var(--athera-white);
  color: var(--athera-charcoal);
  transition: border-color var(--ease);
}
.field input:focus, .field select:focus { border-color: var(--athera-blue-deep); outline: none; }
.field.full { grid-column: 1 / -1; }

.diff-card {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--athera-navy);
  color: var(--athera-white);
}
.diff-card .dc-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--athera-blue); margin-bottom: 8px; }
.diff-card .dc-body { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.85); }

/* ----------------------------------------------------------- S5 brief ------ */
.brief-stage { background: var(--athera-off-white); padding: 24px 0 60px; }
.brief-paper {
  background: var(--athera-white);
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  padding: 56px 60px;
}
.brief-paper .bp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--athera-line);
  padding-bottom: 22px;
  margin-bottom: 30px;
}
.brief-paper .bp-meta .label { display: block; margin-bottom: 6px; }
.brief-paper .bp-meta .bp-date { font-family: var(--font-mono); font-size: 14px; color: var(--athera-navy); }
.brief-section { margin-bottom: 34px; }
.brief-section .display-sm { margin-bottom: 14px; }
.brief-section .body { font-size: 14px; }
.brief-section .table { margin-top: 8px; }
.brief-disclaimer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--athera-line);
  color: var(--athera-grey);
}
.brief-route {
  padding: 16px 0;
  border-bottom: 1px solid var(--athera-line);
}
.brief-route:last-child { border-bottom: none; }
.brief-route .br-title { font-family: var(--font-body); font-weight: 500; font-size: 14px; color: var(--athera-navy); margin-bottom: 4px; }
.brief-route .br-line { font-family: var(--font-mono); font-size: 12px; color: var(--athera-grey); margin-bottom: 8px; }

.copy-confirm { font-size: 12.5px; color: var(--athera-blue-deep); margin-left: 14px; font-family: var(--font-mono); }

/* errors / empty */
.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--athera-surface);
  border-left: 3px solid var(--athera-amber);
  color: var(--athera-charcoal);
  font-size: 13.5px;
}
.notice.bad { border-left-color: var(--athera-critical); }
.muted { color: var(--athera-grey); }
.stack-sm > * + * { margin-top: 10px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* ---------------------------------------------------------- responsive ----- */
@media (max-width: 920px) {
  .grid-2, .grid-3-2, .cards-2, .route-grid { grid-template-columns: 1fr; }
  .routes-layout { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .counter-grid { grid-template-columns: repeat(2, 1fr); }
  .side { position: static; }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .display-lg { font-size: 38px; }
  .display-md { font-size: 30px; }
  .hero { padding: 44px 26px; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .counter-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 32px; }
  .brief-paper { padding: 34px 24px; }
  .uf-grid { grid-template-columns: 1fr; }
}

/* ============================================================ PHASE 6 — OPS ===
 * Operations board, history, calibration, and the CSV import wizard. Built on
 * the same brand tokens; no new colours or fonts. Status is always shown as
 * colour + a text label (never colour alone).
 */

/* tab bar (replaces the stepper on ops.html) -------------------------------- */
.tabbar {
  border-bottom: 1px solid var(--athera-line);
  background: var(--athera-white);
}
.tabbar .container { display: flex; gap: 0; overflow-x: auto; }
.tab {
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  padding: 18px 28px 16px 0;
  margin-right: 4px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--athera-grey);
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.tab:hover { color: var(--athera-charcoal); }
.tab.active { color: var(--athera-navy); border-bottom-color: var(--athera-blue-deep); }

/* ops board header row with an action ---------------------------------------- */
.ops-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* status summary strip ------------------------------------------------------- */
.ops-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--athera-line);
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.ops-summary .s-cell { background: var(--athera-white); padding: 18px 16px; }
.ops-summary .s-num {
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--athera-navy);
  line-height: 1;
}
.ops-summary .s-num.blue { color: var(--athera-blue-deep); }
.ops-summary .s-num.crit { color: var(--athera-critical); }
.ops-summary .s-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--athera-grey);
  margin-top: 9px;
}

/* progress bar (delivered / total) ------------------------------------------ */
.delivery-progress {
  height: 4px;
  width: 100%;
  background: var(--athera-mist);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 36px;
}
.delivery-progress > span { display: block; height: 100%; background: var(--athera-blue-deep); transition: width var(--ease); }

/* status pills (colour + text) ---------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 11px;
  border: 1px solid var(--athera-line);
  color: var(--athera-grey);
  white-space: nowrap;
  line-height: 1.3;
}
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill--planned { color: var(--athera-grey); }
.pill--loaded { color: var(--athera-charcoal); border-color: var(--athera-charcoal); }
.pill--dispatched { color: var(--athera-charcoal); border-color: var(--athera-charcoal); }
.pill--in_transit { color: var(--athera-blue-deep); border-color: var(--athera-blue-deep); }
.pill--delivered { color: var(--athera-white); background: var(--athera-blue-deep); border-color: var(--athera-blue-deep); }
.pill--failed { color: var(--athera-white); background: var(--athera-critical); border-color: var(--athera-critical); }
.pill--returned { color: var(--athera-amber); border-color: var(--athera-amber); }

/* a route as an expandable row ---------------------------------------------- */
.route-row {
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  background: var(--athera-white);
  margin-bottom: 12px;
  overflow: hidden;
}
.route-row .rr-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--ease);
}
.route-row .rr-head:hover { background: var(--athera-off-white); }
.route-row .rr-caret { font-family: var(--font-mono); color: var(--athera-blue-deep); font-size: 13px; width: 14px; flex: none; }
.route-row .rr-title { font-family: var(--font-body); font-weight: 500; font-size: 14.5px; color: var(--athera-navy); }
.route-row .rr-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--athera-grey); margin-top: 3px; }
.route-row .rr-spacer { flex: 1; }
.route-row .rr-mini { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.route-row .rr-mini .mini {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--athera-grey);
}
.route-row .rr-mini .mini b { color: var(--athera-charcoal); font-weight: 400; }
.route-row .rr-body { padding: 6px 22px 18px; border-top: 1px solid var(--athera-line); }

/* vertical stop timeline (ops + compact history) ---------------------------- */
.ops-timeline { list-style: none; margin: 0; padding: 0; }
.ops-timeline > li {
  display: grid;
  grid-template-columns: 26px 60px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--athera-line);
  align-items: center;
}
.ops-timeline > li:last-child { border-bottom: none; }
.ops-timeline .ot-seq { font-family: var(--font-mono); font-size: 12px; color: var(--athera-grey); }
.ops-timeline .ot-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--athera-charcoal); }
.ops-timeline .ot-cust { font-size: 13.5px; color: var(--athera-charcoal); }
.ops-timeline .ot-area { color: var(--athera-grey); font-size: 11.5px; }
.ops-timeline .ot-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* small inline action button on a stop -------------------------------------- */
.stop-act {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--athera-line);
  background: var(--athera-white);
  color: var(--athera-charcoal);
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
  white-space: nowrap;
}
.stop-act:hover { border-color: var(--athera-blue-deep); color: var(--athera-blue-deep); }
.stop-act.fail:hover { border-color: var(--athera-critical); color: var(--athera-critical); }
.stop-act:disabled { opacity: 0.4; cursor: default; }

/* inline fail-reason form ---------------------------------------------------- */
.fail-form {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 2px;
  flex-wrap: wrap;
}
.fail-form select {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  background: var(--athera-white);
  color: var(--athera-charcoal);
}
.fail-form select:focus { border-color: var(--athera-critical); outline: none; }

/* calibration learning note -------------------------------------------------- */
.learn-note {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--athera-blue-deep);
  padding: 6px 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.learn-note::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--athera-blue-deep); flex: none; }

.sim-notes { margin: 0 0 28px; padding: 16px 18px; border-radius: var(--radius); background: var(--athera-surface); border-left: 3px solid var(--athera-blue-deep); }
.sim-notes .sn-title { display: block; margin-bottom: 8px; }
.sim-notes ul { margin: 0; padding-left: 18px; }
.sim-notes li { font-family: var(--font-mono); font-size: 11.5px; color: var(--athera-charcoal); line-height: 1.7; }

/* ------------------------------------------------------------- history ----- */
.history-table tbody tr { cursor: pointer; transition: background var(--ease); }
.history-table tbody tr:hover { background: var(--athera-off-white); }
.history-table tbody tr.selected { background: var(--athera-surface); }
.history-table td.ontime { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.order-search { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }
.order-search .field { min-width: 220px; }
.order-search input {
  font-family: var(--font-body); font-weight: 300; font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--athera-line);
  border-radius: var(--radius); background: var(--athera-white); color: var(--athera-charcoal);
}
.order-search input:focus { border-color: var(--athera-blue-deep); outline: none; }

/* order lifecycle: planned vs actual ---------------------------------------- */
.pva-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--athera-line); border: 1px solid var(--athera-line); border-radius: var(--radius); overflow: hidden; margin: 18px 0 24px; }
.pva-cell { background: var(--athera-white); padding: 18px 20px; }
.pva-cell .pva-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--athera-grey); }
.pva-cell .pva-v { font-family: var(--font-mono); font-size: 22px; color: var(--athera-navy); margin-top: 8px; }
.pva-cell .pva-v.late { color: var(--athera-amber); }

.life-timeline { list-style: none; margin: 0; padding: 0; }
.life-timeline > li { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--athera-line); align-items: center; }
.life-timeline > li:last-child { border-bottom: none; }
.life-timeline .lt-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--athera-charcoal); }
.life-timeline .lt-note { font-size: 12.5px; color: var(--athera-grey); }

/* ----------------------------------------------------------- calibration --- */
.accuracy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 14px;
}
.accuracy .acc-cell { padding: 4px 0; }
.accuracy .acc-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--athera-grey); }
.accuracy .acc-v { font-family: var(--font-mono); font-size: 40px; line-height: 1; margin-top: 12px; color: var(--athera-navy); }
.accuracy .acc-v.better { color: var(--athera-blue-deep); }
.accuracy .acc-unit { font-size: 16px; color: var(--athera-grey); }

.calib-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; margin-top: 28px; }
.calib-scroll { max-height: 520px; overflow-y: auto; }

/* ---------------------------------------------------------------- wizard ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  overflow-y: auto;
  z-index: 60;
  animation: fade var(--ease);
}
.modal-card {
  background: var(--athera-white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 760px;
  padding: 36px 40px 32px;
}
.modal-card .mc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.modal-card .mc-close { background: transparent; border: none; cursor: pointer; font-family: var(--font-mono); font-size: 20px; color: var(--athera-grey); line-height: 1; padding: 4px; }
.modal-card .mc-close:hover { color: var(--athera-navy); }
.modal-card .mc-cap { color: var(--athera-grey); margin-bottom: 24px; max-width: 60ch; }

.map-row { display: grid; grid-template-columns: 1fr 18px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--athera-line); }
.map-row:last-of-type { border-bottom: none; }
.map-row .mr-src { font-family: var(--font-mono); font-size: 13px; color: var(--athera-charcoal); display: flex; flex-direction: column; gap: 4px; }
.map-row .mr-srctag { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--athera-grey); }
.map-row .mr-arrow { font-family: var(--font-mono); color: var(--athera-grey); text-align: center; }
.map-row select {
  font-family: var(--font-body); font-weight: 300; font-size: 13px;
  padding: 9px 10px; border: 1px solid var(--athera-line);
  border-radius: var(--radius); background: var(--athera-white); color: var(--athera-charcoal);
  width: 100%;
}
.map-row select:focus { border-color: var(--athera-blue-deep); outline: none; }

.sample-scroll { overflow-x: auto; margin-top: 8px; }
.sample-scroll .table th .sm-field { display: block; font-size: 9px; color: var(--athera-blue-deep); margin-top: 3px; }
.sample-scroll .table th .sm-ignored { display: block; font-size: 9px; color: var(--athera-grey); margin-top: 3px; }

.commit-stat { display: flex; gap: 40px; flex-wrap: wrap; margin: 8px 0 22px; }
.commit-stat .cs-num { font-family: var(--font-mono); font-size: 34px; color: var(--athera-navy); line-height: 1; }
.commit-stat .cs-num.crit { color: var(--athera-critical); }
.commit-stat .cs-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--athera-grey); margin-top: 8px; }

.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--athera-line); flex-wrap: wrap; }

.empty-state { padding: 56px 0; text-align: center; }
.empty-state .display-sm { margin-bottom: 12px; }

/* responsive ---------------------------------------------------------------- */
@media (max-width: 920px) {
  .ops-summary { grid-template-columns: repeat(3, 1fr); }
  .calib-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ops-summary { grid-template-columns: repeat(2, 1fr); }
  .accuracy { grid-template-columns: 1fr; }
  .pva-grid { grid-template-columns: 1fr; }
  .ops-timeline > li { grid-template-columns: 22px 1fr; row-gap: 6px; }
  .ops-timeline .ot-time { grid-column: 2; }
  .ops-timeline .ot-right { grid-column: 1 / -1; justify-content: flex-start; }
  .map-row { grid-template-columns: 1fr; }
  .map-row .mr-arrow { display: none; }
  .modal-card { padding: 26px 22px; }
}

/* ------------------------------------------------------------- print ------- */
@media print {
  .app-header, .stepper, .tabbar, .footer-bar, .no-print { display: none !important; }
  body, .brief-stage { background: var(--athera-white); }
  .brief-paper { border: none; max-width: 100%; padding: 0; }
  .screen { padding: 0; animation: none; }
}

/* ---------------------------------------------------- PHASE 7 — accessibility */
/* Screen-reader-only text: present for assistive tech, removed from view. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until focused, then anchored top-left so keyboard users can
   jump past the header/nav straight to the content. */
.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 100;
  background: var(--athera-navy);
  color: var(--athera-white);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; color: var(--athera-white); }

/* Form controls suppress the default outline on :focus (mouse + keyboard) in
   favour of a border colour; restore a real focus ring for KEYBOARD focus so
   every control stays visibly focusable (brand global is otherwise outranked by
   the more specific :focus rules above). */
.field input:focus-visible,
.field select:focus-visible,
.fail-form select:focus-visible,
.order-search input:focus-visible,
.map-row select:focus-visible,
.file-drop input:focus-visible {
  outline: 2px solid var(--athera-blue-deep);
  outline-offset: 1px;
}

/* ============================================================ SETUP (add-on) */
.setup-hero { background: var(--athera-white); border-bottom: 1px solid var(--athera-line); padding: 48px 0 40px; }
.order-hint {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--athera-charcoal);
}
.order-hint li { display: flex; align-items: center; gap: 10px; }
.order-hint .oh-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--athera-line);
  font-size: 11px;
  color: var(--athera-blue-deep);
  flex: none;
}

.setup-body { padding: 40px 32px 72px; display: flex; flex-direction: column; gap: var(--gap); }
.setup-body .ops-summary { margin-bottom: 8px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .setup-body .ops-summary { grid-template-columns: repeat(2, 1fr); } }
.ops-summary .s-sub { font-size: 11px; color: var(--athera-grey); margin-top: 8px; }
.amber-text { color: var(--athera-amber); }

.setup-card .col-list { font-size: 12px; color: var(--athera-charcoal); }
.setup-card .map-row .mr-field { font-size: 13px; color: var(--athera-blue-deep); text-align: left; }
.setup-card .map-row .mr-field.muted { color: var(--athera-grey); }

.setup-preview { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--athera-line); }
.setup-actions { display: flex; align-items: center; gap: 18px; margin-top: 24px; flex-wrap: wrap; }
.setup-result { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--athera-line); }

.file-drop.drag { border-color: var(--athera-blue-deep); background: var(--athera-surface); }

.geo-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 28px;
  border: 1px solid var(--athera-line);
  border-radius: var(--radius);
  background: var(--athera-white);
}

@media (max-width: 560px) {
  .setup-body { padding: 28px 20px 56px; }
  .geo-block { flex-direction: column; align-items: flex-start; }
}
