/* Intake prototype (mockups/intake/): a deck, one beat per screen.
   Loads after app.css (tokens, type scale) and ../commands/commands.css (the
   shared chrome: .page, .lbl, table.ref, .wrap, .btn, .flip). Only what this
   page adds. Charts: one hue (the accent), thin marks, rounded ends, text in
   text tokens, no legend for a single series. */

  html, body { height: 100%; }
  body { overflow: hidden; }

  /* ── The deck ─────────────────────────────────────────────────────────── */
  .deck { position: relative; height: 100vh; height: 100dvh; }
  .slide { position: absolute; inset: 0; display: none; overflow: auto; padding: 44px 56px 96px; }
  .slide.on { display: flex; flex-direction: column; gap: 26px; }
  .slide > .inner { max-width: 1240px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }

  .beat { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-tertiary); }
  .hed { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; margin: 0; max-width: 20ch; color: var(--color-text-primary); }
  .hed.wide { max-width: 28ch; }
  .lede { font-size: 17px; line-height: 1.45; color: var(--color-text-secondary); margin: 0; max-width: 62ch; }
  .lede b { color: var(--color-text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

  /* Headline + proof side by side, the picture underneath. */
  .top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 36px; align-items: start; }
  @media (max-width: 900px) { .top { grid-template-columns: 1fr; } }

  /* A stat: a large number under a small label, never a sentence. */
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
  .stat { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 10px;
          border: 1px solid var(--color-border-subtle); background: var(--color-bg-elevated); }
  .stat .n { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
  .stat .l { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat .d { font-size: 13px; color: var(--color-text-secondary); }
  /* Under the number: rows of label and value, never a phrase. */
  .stat dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 4px 0 0; font-size: 13px; }
  .stat dt { color: var(--color-text-tertiary); white-space: nowrap; }
  .stat dd { margin: 0; color: var(--color-text-primary); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
  /* The key under a stacked bar: a table, not a line of phrases. */
  table.keys { border-collapse: collapse; font-size: 13px; }
  table.keys th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-tertiary); padding: 0 18px 6px 0; }
  table.keys td { padding: 4px 18px 4px 0; border-top: 1px solid var(--color-border-subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }
  table.keys td.c { text-align: right; }
  table.keys .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
  .stat.warn .n { color: var(--color-status-progress); }
  .stat.bad .n { color: var(--color-text-destructive); }
  .stat.ok .n { color: var(--color-status-done); }

  /* ── Pictures ─────────────────────────────────────────────────────────── */
  .vis { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; border-radius: 12px;
         border: 1px solid var(--color-border-subtle); background: var(--color-bg-base); }
  .vis .cap { font-size: 13px; color: var(--color-text-tertiary); }
  .vis h3 { margin: 0; font-size: 14px; font-weight: 500; color: var(--color-text-secondary); }
  .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .two > * { min-width: 0; overflow-x: auto; }
  @media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

  /* Horizontal bars: label, bar, value. One series, so one hue. */
  .bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: 8px 14px; align-items: center; font-size: 14px; }
  .bars .k { color: var(--color-text-primary); white-space: nowrap; }
  .bars .k small { color: var(--color-text-tertiary); margin-left: 6px; }
  .bars .v { color: var(--color-text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
  .bars .b { height: 14px; border-radius: 0 4px 4px 0; background: var(--color-accent); min-width: 2px; }
  .bars .b.none { width: 2px !important; background: var(--color-border-strong); }
  .bars .b.dim { background: color-mix(in srgb, var(--color-accent) 45%, transparent); }
  .bars .hole { background: none; }
  .bars.tight { gap: 6px 12px; font-size: 13px; }
  .bars.tight .b { height: 12px; }

  /* A 100% bar split into segments: the people who type the orders. */
  .stack { display: flex; height: 44px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--color-bg-base); }
  .stack > div { display: flex; align-items: center; padding: 0 12px; font-size: 13px; white-space: nowrap; overflow: hidden; color: var(--color-primary-foreground); font-variant-numeric: tabular-nums; }
  .stack .s1 { background: var(--color-accent); }
  .stack .s2 { background: color-mix(in srgb, var(--color-accent) 72%, var(--color-bg-base)); }
  .stack .s3 { background: color-mix(in srgb, var(--color-accent) 50%, var(--color-bg-base)); }
  .stack .rest { background: var(--color-border-strong); color: var(--color-text-primary); }
  .stack-keys { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
  .stack-keys b { color: var(--color-text-primary); font-weight: 600; }

  /* The clock: one request's first half hour as an event strip — five marks,
     evenly spaced, not to scale (the first four fall inside five minutes and
     would pile up on a true axis); a break before the last. */
  .clock { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; padding-top: 26px; }
  .clock::before { content: ""; position: absolute; left: 8%; right: 8%; top: 32px; height: 2px; background: var(--color-border-default); }
  .clock .brk { position: absolute; left: calc(80% - 24px); top: 20px; width: 28px; height: 26px; background: var(--color-bg-base); color: var(--color-text-tertiary); font-size: 16px; letter-spacing: 2px; text-align: center; line-height: 26px; }
  .clock .mark { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
  .clock .mark .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--color-accent); border: 3px solid var(--color-bg-base); box-shadow: 0 0 0 2px var(--color-accent); }
  .clock .mark.cov .dot { background: var(--color-status-progress); box-shadow: 0 0 0 2px var(--color-status-progress); }
  .clock .mark.cust .dot { background: var(--color-text-tertiary); box-shadow: 0 0 0 2px var(--color-text-tertiary); }
  .clock .mark .t { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
  .clock .mark .who { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-tertiary); }
  .clock .mark .w { font-size: 13px; color: var(--color-text-secondary); line-height: 1.35; max-width: 22ch; }

  /* The email card: WN's own template, as the customer sees it. */
  .mail { border: 1px solid var(--color-border-default); border-radius: 10px; background: var(--color-bg-elevated); padding: 16px 18px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
  .mail .hd { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12px; color: var(--color-text-tertiary); }
  .mail .hd b { color: var(--color-text-secondary); font-weight: 500; }
  .mail .body { color: var(--color-text-primary); line-height: 1.5; }
  .mail .body mark { background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 3px; }
  /* The reply is structured: a heading per part, label/value rows for the
     services requested and the load, the questions, one line for what is next. */
  .mail .addr { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--color-border-default); background: color-mix(in srgb, var(--color-accent) 8%, transparent); line-height: 1.45; font-size: 13px; }
  .mail .addr .k, .mail .addr .nt { display: block; font-size: 11px; color: var(--color-text-tertiary); }
  .mail .addr b { display: block; font-weight: 600; }
  .mail .addr .nt { margin-top: 4px; color: var(--color-text-secondary); font-size: 12px; }
  .mail .rh { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-tertiary); margin: 2px 0 -5px; }
  .mail table.rt { border-collapse: collapse; width: 100%; font-size: 13px; }
  .mail table.rt th { text-align: left; font-weight: 500; color: var(--color-text-secondary); width: 84px; padding: 2px 8px 2px 0; vertical-align: top; white-space: nowrap; }
  .mail table.rt td { padding: 2px 0; color: var(--color-text-primary); white-space: nowrap; }

  /* Two columns of ticks: what the QB's form asks against what coverage needs. */
  table.ticks { border-collapse: collapse; width: 100%; font-size: 14px; }
  table.ticks th { text-align: left; font-weight: 500; color: var(--color-text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 8px; }
  table.ticks td { padding: 7px 10px; border-top: 1px solid var(--color-border-subtle); font-variant-numeric: tabular-nums; }
  table.ticks td.c { text-align: center; white-space: nowrap; }
  table.ticks .yes { color: var(--color-status-done); font-weight: 600; }
  table.ticks .no { color: var(--color-text-tertiary); }
  table.ticks .late { color: var(--color-status-progress); font-weight: 600; }
  table.ticks .never { color: var(--color-text-destructive); font-weight: 600; }
  /* One line per row, always: short labels, and nothing wraps. */
  table.ticks.oneline th, table.ticks.oneline td { white-space: nowrap; }
  table.ticks.oneline td:first-child { width: 1%; padding-right: 18px; }

  /* Where the documents go: three places, and what lands in each. */
  .flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: stretch; }
  .flow .box { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 10px; border: 1px solid var(--color-border-default); background: var(--color-bg-elevated); }
  .flow .box h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-tertiary); font-weight: 500; }
  .flow .box .big { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-text-primary); line-height: 1.1; }
  .flow .box .big.bad { color: var(--color-text-destructive); }
  .flow .box .r { font-size: 13px; color: var(--color-text-secondary); display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
  .flow .arrow { align-self: center; color: var(--color-text-tertiary); font-size: 22px; }

  /* The numbers behind a beat, folded. */
  details.raw { border-top: 1px solid var(--color-border-subtle); padding-top: 10px; }
  details.raw summary { cursor: pointer; font-size: 13px; color: var(--color-text-secondary); list-style: none; display: inline-flex; gap: 8px; align-items: center; }
  details.raw summary::before { content: "▸"; color: var(--color-text-tertiary); }
  details.raw[open] summary::before { content: "▾"; }
  details.raw > div { padding-top: 14px; display: flex; flex-direction: column; gap: 14px; }
  table.ref td.num, table.ref th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  table.ref td.dim { color: var(--color-text-tertiary); }
  .src { font-size: 12px; color: var(--color-text-tertiary); }
  .src code { font-size: 11px; }

  /* ── Navigation ───────────────────────────────────────────────────────── */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 14px; padding: 12px 24px;
         background: color-mix(in srgb, var(--color-bg-app) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--color-border-subtle); z-index: 20; }
  .nav .btn.arrow { width: 40px; padding: 0; justify-content: center; font-size: 18px; }
  .nav .dots { display: flex; gap: 6px; align-items: center; }
  .nav .dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--color-border-strong); cursor: pointer; }
  .nav .dots button.on { background: var(--color-accent); transform: scale(1.25); }
  .nav .dots .gap { width: 10px; }
  .nav .where { margin-left: auto; font-size: 13px; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; display: flex; gap: 14px; align-items: baseline; }
  .nav .where b { color: var(--color-text-secondary); font-weight: 500; }
  .nav .part-k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
  .flip { bottom: 62px; }

  /* The title and part-divider slides. */
  .slide.title .inner { justify-content: center; min-height: 70vh; gap: 18px; }
  .slide.title .hed { font-size: 44px; max-width: 24ch; }
  .parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
  .parts .p { padding: 16px 18px; border-radius: 10px; border: 1px solid var(--color-border-subtle); background: var(--color-bg-elevated); display: flex; flex-direction: column; gap: 6px; }
  .parts .p .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-tertiary); }
  .parts .p .t { font-size: 16px; font-weight: 600; color: var(--color-text-primary); }
  .parts .p .d { font-size: 13px; color: var(--color-text-secondary); }
  .parts .p.todo { opacity: .5; border-style: dashed; }

  /* ── Part 2: the problems ─────────────────────────────────────────────── */
  /* The cause → what happens → what it costs strip reuses .flow; each box
     gets a plain-language title under its uppercase label. */
  .flow .box .t { font-size: 15px; font-weight: 500; color: var(--color-text-primary); margin-top: -4px; }
  .flow .box .big.late { color: var(--color-status-progress); }
  .flow .box .r > span:last-child { color: var(--color-text-primary); text-align: right; }
  .flow .box .r > span { white-space: nowrap; }
  /* The list of problems on the divider and the close. */
  .slide.title table.plist { margin-top: 10px; max-width: 1000px; font-size: 15px; }
  .slide.title table.plist td { padding: 10px 12px; }
  table.ticks a { color: var(--color-text-primary); text-decoration: none; border-bottom: 1px solid var(--color-border-strong); }
  table.ticks a:hover { border-bottom-color: var(--color-accent); }
  table.ticks .yes.plain { font-weight: 500; }
  /* The case log: one order, minute by minute. Only the last column is wide. */
  table.log td, table.log th { font-size: 13px; padding: 6px 10px; }
  table.log td:first-child { font-variant-numeric: tabular-nums; color: var(--color-text-primary); }
  table.log td:nth-child(2), table.log td:nth-child(3) { color: var(--color-text-secondary); white-space: nowrap; width: 1%; padding-right: 18px; }
  table.log td:last-child { color: var(--color-text-primary); white-space: normal; }
  table.log td.late { color: var(--color-status-progress); font-weight: 600; }
  .stat dd.late { color: var(--color-status-progress); }
  .slide.title table.plist { max-width: 1100px; }

  /* ── Part 3: the #qb-team message, and drafts with sources ───────────── */
  .qbcard { border: 1px solid var(--color-border-default); border-radius: 12px; background: var(--color-bg-elevated); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
  .qbcard .hd { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--color-text-tertiary); }
  .qbcard .hd .app { font-weight: 600; color: var(--color-text-primary); font-size: 13px; }
  .qbcard .hd .t { margin-left: auto; font-variant-numeric: tabular-nums; }
  .qbcard .title { font-size: 15px; color: var(--color-text-primary); }
  .qbcard .title b { font-weight: 600; }
  .qbcard table.ticks td { font-size: 13px; padding: 6px 10px; }
  .qbcard table.ticks td:first-child { color: var(--color-text-tertiary); }
  .qbcard .btns { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
  .qbcard .btns .more { margin-left: auto; font-size: 12px; color: var(--color-text-tertiary); }
  table.draft td, table.draft th { font-size: 13px; padding: 6px 8px; }
  table.draft td:nth-child(3) { color: var(--color-text-tertiary); }
  table.rule td:first-child { width: auto; }
  table.rule td:nth-child(2), table.rule td:nth-child(3) { width: 1%; }
  .hed.wide { max-width: 30ch; }
  table.rule td:last-child { white-space: nowrap; }
