/* ============================================================
   TitleTown · Slip Analyzer flow shell · v0.16.41.7
   v0.16.41.7 — hero → shared bh-hero anatomy; data-tone colors
   retargeted to .bh-v; old sa-command hero rules dead.
   v0.16.41.5 — Tier 3 shrink: eyebrow/title/KPI typography removed;
   owned by tt- layer in styles.css. Layout + data-tone colors stay here.
   v0.16.41.3 — hero title tracking to shared canon (-0.055em, lh .94); eyebrow
   #5DE0AC -> var(--accent-pos), weight 800 -> 700. Cross-page uniformity pass.
   ------------------------------------------------------------
   Visual-only shell to align Slip Analyzer with Slate / Props /
   Track Record: command hero, read strip, processing strip,
   control row, pick-ledger styling, and secondary cards.
   ============================================================ */

body.sa-flow-shell .main {
  max-width: 1500px;
  padding-top: 26px;
}

body.sa-flow-shell .sa-command-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  gap: 42px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 34px 38px;
  background: linear-gradient(180deg, rgba(255,255,255,.026), rgba(255,255,255,.012));
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
body.sa-flow-shell .sa-command-hero::before {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: 10px;
  padding: 1px;
  background: linear-gradient(90deg, rgba(0,217,122,.55), transparent 38%, rgba(255,169,64,.58));
  opacity: .72;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
body.sa-flow-shell .sa-command-copy,
body.sa-flow-shell .sa-command-kpis { position: relative; z-index: 1; }
body.sa-flow-shell .sa-command-hero .sa-hero-title {
  margin: 20px 0 16px;
}
body.sa-flow-shell .sa-command-chips {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
body.sa-flow-shell .sa-command-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body.sa-flow-shell .sa-command-chip-green {
  color: #5DE0AC;
  background: rgba(0,217,122,.12);
  border-color: rgba(0,217,122,.28);
}
body.sa-flow-shell .sa-command-tagline {
  margin: 0;
  text-align: left;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
  letter-spacing: .08em;
  white-space: pre-line;
}
body.sa-flow-shell .sa-command-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255,255,255,.025);
}
body.sa-flow-shell .sa-command-kpi {
  min-width: 0;
  padding: 22px 24px;
  background: rgba(14,14,16,.82);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
body.sa-flow-shell .sa-command-kpi:nth-child(even) { border-right: 0; }
body.sa-flow-shell .sa-command-kpi:nth-child(n+3) { border-bottom: 0; }
body.sa-flow-shell .sa-command-kpi-label {
  display: block;
}
body.sa-flow-shell .sa-command-kpi-value {
  margin-top: 12px;
}
body.sa-flow-shell .sa-command-kpi-value[data-tone="neg"] { color: #ff8a9b; }
body.sa-flow-shell .sa-command-kpi-value[data-tone="pos"] { color: #5DE0AC; }
body.sa-flow-shell .sa-command-kpi-sub {
  margin-top: 8px;
}
body.sa-flow-shell .sa-command-read-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255,169,64,.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.020), rgba(255,255,255,.010));
}
body.sa-flow-shell .sa-command-read-strip[hidden] { display: none; }
body.sa-flow-shell .sa-command-read-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f0c85a;
  border: 1px solid rgba(255,169,64,.28);
  background: rgba(255,169,64,.10);
  font-family: var(--font-mono);
  font-size: 14px;
}
body.sa-flow-shell .sa-command-read-copy {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}
body.sa-flow-shell .sa-command-read-label {
  margin-right: 10px;
  color: #f0c85a;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Processing strip: collapse the old amber rails into a compact terminal status bar. */
body.sa-flow-shell .sa-pipeline {
  margin-bottom: 14px;
  padding: 14px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15,15,17,.75);
}
body.sa-flow-shell .sa-pipeline-track { height: 2px; background: rgba(255,255,255,.10); }
body.sa-flow-shell .sa-pipeline-bar { background: #5DE0AC; box-shadow: 0 0 18px rgba(93,224,172,.18); }
body.sa-flow-shell .sa-pipeline-meta { margin-top: 9px; }
body.sa-flow-shell .sa-confbar { margin-top: 12px; }

/* Control bar: upload/paste/view slip/export reads as one row after hero. */
body.sa-flow-shell .sa-mode-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.008));
}
body.sa-flow-shell .sa-mode-tab,
body.sa-flow-shell .sa-view-slip-btn,
body.sa-flow-shell .sa-json-btn,
body.sa-flow-shell .sa-reanalyze-btn,
body.sa-flow-shell .sa-autograde-btn {
  border-radius: 5px;
  min-height: 34px;
}
body.sa-flow-shell .sa-view-slip-btn { margin-left: auto; }

/* Upload card: lower profile, no giant dead-space read after analysis. */
body.sa-flow-shell .sa-upload-card,
body.sa-flow-shell .sa-input-card {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.008));
}
body.sa-flow-shell .sa-dropzone { min-height: 220px; }

/* Results becomes the primary ledger card. */
body.sa-flow-shell .sa-results {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.026), rgba(255,255,255,.012));
  padding: 0 12px 12px;
  margin-bottom: 14px;
}
body.sa-flow-shell .sa-results-header {
  padding: 20px 12px 0;
  border-bottom: 0;
}
body.sa-flow-shell .sa-results-title::after {
  content: ' · PICK LEDGER';
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--text-tertiary);
  margin-left: 10px;
}
body.sa-flow-shell #sa-json-export-row {
  margin: 14px 0;
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}
body.sa-flow-shell .sa-slip-summary {
  margin: 14px 0;
  border-radius: 9px;
  background: rgba(0,0,0,.16);
}
body.sa-flow-shell .sa-slip-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
body.sa-flow-shell .sa-slip-stat {
  padding: 18px 20px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,.018);
}
body.sa-flow-shell .sa-slip-stat:last-child { border-right: 0; }
body.sa-flow-shell .sa-slip-stat-value { font-size: 22px; }

/* Props-style hit-rate bubbles in the Slip ledger. */
body.sa-flow-shell .sa-table {
  border-radius: 8px;
  overflow: hidden;
}
body.sa-flow-shell .sa-row-header {
  background: rgba(255,255,245,.018);
}
body.sa-flow-shell .sa-cell-window {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 10px 8px;
  background: transparent !important;
}
body.sa-flow-shell .sa-cell-window .sa-win-frac,
body.sa-flow-shell .sa-cell-window .sa-win-empty {
  display: block;
  min-width: 68px;
  padding: 7px 10px 3px;
  border-radius: 8px 8px 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
  text-align: center;
}
body.sa-flow-shell .sa-cell-window .sa-win-pct {
  display: block;
  min-width: 68px;
  padding: 0 10px 7px;
  border-radius: 0 0 8px 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  color: rgba(245,245,240,.62);
}
body.sa-flow-shell .sa-cell-window.sa-heat-hot-hi .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-hot-hi .sa-win-pct,
body.sa-flow-shell .sa-cell-window.sa-heat-hot-mid .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-hot-mid .sa-win-pct,
body.sa-flow-shell .sa-cell-window.sa-heat-hot-lo .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-hot-lo .sa-win-pct {
  background: rgba(0,217,122,.14);
  color: #5DE0AC;
}
body.sa-flow-shell .sa-cell-window.sa-heat-mid .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-mid .sa-win-pct {
  background: rgba(255,169,64,.12);
  color: #f0c85a;
}
body.sa-flow-shell .sa-cell-window.sa-heat-cold-hi .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-cold-hi .sa-win-pct,
body.sa-flow-shell .sa-cell-window.sa-heat-cold-mid .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-cold-mid .sa-win-pct,
body.sa-flow-shell .sa-cell-window.sa-heat-cold-lo .sa-win-frac,
body.sa-flow-shell .sa-cell-window.sa-heat-cold-lo .sa-win-pct {
  background: rgba(255,77,77,.13);
  color: #ff8a9b;
}
body.sa-flow-shell .sa-cell-window .sa-win-empty {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  color: var(--text-secondary);
}

/* Secondary dashboard row: history/calibration/weekly recede under the ledger. */
body.sa-flow-shell .sa-history-idle-grid {
  grid-template-columns: 1.08fr .92fr;
  gap: 14px;
}
body.sa-flow-shell .sa-history-idle-right-stack {
  gap: 14px;
}
body.sa-flow-shell .sa-recent-slips,
body.sa-flow-shell .sa-weekly-record,
body.sa-flow-shell .sa-calibration-card {
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.010));
}
body.sa-flow-shell .sa-calibration-tier-bar {
  opacity: .72;
}

@media (max-width: 1100px) {
  body.sa-flow-shell .sa-command-hero { grid-template-columns: 1fr; padding: 28px 24px; }
  body.sa-flow-shell .sa-command-kpis { grid-template-columns: 1fr; }
  body.sa-flow-shell .sa-command-kpi { border-right: 0; }
  body.sa-flow-shell .sa-command-kpi:nth-child(n+3) { border-bottom: 1px solid var(--border); }
  body.sa-flow-shell .sa-slip-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body.sa-flow-shell .main { padding-left: 16px; padding-right: 16px; }
  body.sa-flow-shell .sa-mode-tabs { align-items: stretch; flex-direction: column; }
  body.sa-flow-shell .sa-view-slip-btn { margin-left: 0; }
  body.sa-flow-shell .sa-slip-stats { grid-template-columns: 1fr; }
}


/* ── v0.16.41.7 · hero converges to the props bh-hero anatomy ──
   Hero markup now uses the shared bh-* primitives
   (styles-append-bh-hero-v0.1.0.css, linked before this file);
   flow-shell v0.1.8.27 is also linked now, so width/heights match
   props (the .sa-flow-shell .main 1500px pin above is inert — 2-class
   tie loses to flow-shell). The sa-command-hero / sa-command-kpi* /
   sa-command-chip* / sa-command-tagline rules above are dead (markup
   removed) — prune at a CSS consolidation. Only the data-tone colors
   migrate, retargeted to .bh-v: */
body.sa-flow-shell .bh-v[data-tone="neg"] { color: #ff8a9b; }
body.sa-flow-shell .bh-v[data-tone="pos"] { color: #5DE0AC; }
