/* Sales JARVIS — additions to the shared BROOT design language (/shared/styles.css). Same tokens, same type, same
   restraint: only the pieces a sales screen needs that the company brain never did — a stat strip, a pipeline
   board, a dense timeline, the proposal card, and a wider canvas for tables. No new colours. */

:root { --col-wide: 1080px; }

/* ------------------------------------------------------------------------------------------ frame */

.view--wide { max-width: var(--col-wide); }
.rail { overflow-y: auto; scrollbar-width: none; gap: 10px; }
.rail::-webkit-scrollbar { display: none; }
.rail__mark { margin-bottom: 2px; }
.rail__link { min-height: 48px; }
.tabbar__list { grid-template-columns: repeat(5, 1fr); }

.demo-flag {
  position: fixed; z-index: 26; top: calc(10px + var(--safe-top)); right: 14px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
}
.sync {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.sync.is-waiting { color: var(--accent); }
.dock .sync { justify-content: center; padding-bottom: 2px; }

.view__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.view__header--row .view__actions { flex: 0 0 auto; padding-top: 6px; }

/* ------------------------------------------------------------------------------------------ today */

.today__date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.today__hello {
  margin: 6px 0 28px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.1; font-weight: 650; letter-spacing: -0.026em;
}
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 0; margin: 0 0 36px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat {
  display: grid; gap: 2px; padding: 14px 12px 14px 0; min-width: 0;
  border: 0; background: none; text-align: left; color: inherit; text-decoration: none; cursor: pointer;
}
.stat + .stat { padding-left: 14px; border-left: 1px solid var(--line); }
.stat:hover .stat__n { color: var(--accent); }
.stat__n {
  font-family: var(--font-display); font-size: 26px; line-height: 1.1; font-weight: 640;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.stat__n.is-loud { color: var(--accent); }
.stat__label { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.stat--static { cursor: default; }
.stat--static:hover .stat__n { color: inherit; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 0 14px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.section-title a, .section-title .link { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.section { margin-top: 44px; }

.action {
  position: relative;
  padding: 22px 24px 20px;
  border-radius: 20px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.action + .action { margin-top: 14px; }
.action--first::before {
  content: ""; position: absolute; left: 24px; top: -1px; width: 28px; height: 2px; border-radius: 2px; background: var(--accent);
}
.action__kicker {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.action__kicker.is-loud { color: var(--accent); }
.action__who { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
.action__who .link { font-weight: 560; color: var(--ink); }
.action__title {
  margin-top: 4px;
  font-family: var(--font-display); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.25; font-weight: 620;
  letter-spacing: -0.014em; text-wrap: pretty;
}
.why { margin-top: 14px; display: grid; gap: 8px; }
.why__row { display: grid; grid-template-columns: 124px 1fr; gap: 12px; font-size: 14.5px; line-height: 1.45; }
.why__label { color: var(--muted); font-size: 13px; padding-top: 1px; }
.why__text { color: var(--ink-2); overflow-wrap: anywhere; }
.suggest {
  margin-top: 14px; padding: 10px 14px;
  border-radius: var(--radius-s); background: var(--bg-sunk);
  font-size: 14.5px; color: var(--ink);
}
.suggest__label { display: block; font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.action .actions { margin-top: 16px; gap: 8px; }
.action .btn--small { padding: 0 13px; }

/* ------------------------------------------------------------------------------------------ pills, meta */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--bg-sunk); color: var(--ink-2);
  font-size: 12px; font-weight: 560; white-space: nowrap; line-height: 1.5;
}
.pill--accent { background: var(--accent-soft); color: var(--accent); }
.pill--quiet { background: none; border: 1px solid var(--line-strong); color: var(--muted); }
.pill--ai { background: none; border: 1px dashed var(--line-strong); color: var(--muted); font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.num { font-variant-numeric: tabular-nums; }
.row__side { flex: 0 0 auto; text-align: right; display: grid; gap: 3px; justify-items: end; align-content: start; }
.row__side .row__meta { white-space: nowrap; }
.row__title .pill { margin-left: 8px; vertical-align: 1px; }
.row__main--link .row__side { grid-column: 2; grid-row: 1 / span 4; align-self: start; }
.row.is-done .row__title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.row.is-overdue .row__meta--due { color: var(--accent); font-weight: 560; }

.check {
  flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px;
  border-radius: 50%; border: 1.5px solid var(--line-strong); background: none; cursor: pointer;
  display: grid; place-items: center; color: transparent;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.check:hover { border-color: var(--accent); color: var(--accent); }
.check.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ------------------------------------------------------------------------------------------ pipeline board */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.board__col { min-width: 0; display: flex; flex-direction: column; }
.board__head { padding: 0 2px 10px; border-bottom: 2px solid var(--line-strong); margin-bottom: 10px; }
.board__name { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.board__sum { margin-top: 3px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board__cards { display: grid; gap: 8px; align-content: start; }
.deal {
  display: grid; gap: 3px; width: 100%;
  padding: 12px 13px; border-radius: 13px;
  background: var(--bg-raise); border: 1px solid var(--line);
  text-align: left; color: inherit; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.deal:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.deal__account { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.deal__meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.deal__next { font-size: 13px; color: var(--ink-2); }
.deal__warn { font-size: 12.5px; color: var(--accent); font-weight: 560; }
.board__empty { font-size: 13px; color: var(--faint); padding: 8px 2px; }

/* ------------------------------------------------------------------------------------------ tables (team, founder) */

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th {
  padding: 8px 10px; text-align: right; white-space: nowrap;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}
.table td { padding: 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 4px; position: sticky; left: 0; background: var(--bg); }
.table td:first-child { font-weight: 560; }
.table tfoot td { font-weight: 650; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.table .is-loud { color: var(--accent); font-weight: 600; }
.table .is-zero { color: var(--faint); }

/* ------------------------------------------------------------------------------------------ the proposal (Tell JARVIS) */

.proposal { display: grid; gap: 14px; }
.tellbox .proposal, .tellbox .notice { margin-top: 18px; }
.proposal__state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.steps { display: inline-flex; gap: 0; list-style: none; font-size: 11px; font-weight: 650; letter-spacing: 0.08em; }
.steps li { padding: 3px 9px; color: var(--faint); border: 1px solid var(--line); margin-left: -1px; }
.steps li:first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
.steps li:last-child { border-radius: 0 999px 999px 0; }
.steps li.is-past { color: var(--muted); background: var(--bg-sunk); }
.steps li.is-current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.proposal__said {
  padding: 10px 14px; border-left: 2px solid var(--line-strong);
  color: var(--ink-2); font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.fields { display: grid; gap: 0; }
.fields__row {
  display: grid; grid-template-columns: 148px 1fr; gap: 12px; padding: 8px 0;
  border-top: 1px solid var(--line);
}
.fields__row:first-child { border-top: 0; }
.fields dt { font-size: 11.5px; font-weight: 650; letter-spacing: 0.07em; color: var(--muted); padding-top: 3px; }
.fields dd { margin: 0; font-size: 15.5px; font-weight: 560; overflow-wrap: anywhere; }
.fields__note { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.fields__note.is-new { color: var(--accent); }
.proposal__warn { font-size: 14px; color: var(--ink-2); padding-left: 12px; border-left: 2px solid var(--accent); }
.proposal .question { padding: 12px 14px; border-radius: var(--radius-s); background: var(--bg-sunk); }
.proposal__done { display: grid; gap: 4px; }
.proposal__done li { list-style: none; font-size: 14.5px; color: var(--ink-2); }

/* ------------------------------------------------------------------------------------------ detail sheets */

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.kv__item { min-width: 0; }
.kv__k { font-size: 12px; color: var(--muted); }
.kv__v { font-size: 15.5px; font-weight: 560; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv__v.is-empty { color: var(--faint); font-weight: 400; }
.block { margin-top: 30px; }
.block > .t-label { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.block > .t-label .link { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; }

.tl { list-style: none; position: relative; display: grid; gap: 16px; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.tl__item { position: relative; }
.tl__dot { position: absolute; left: -22px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--faint); }
.tl__item--real .tl__dot { border-color: var(--ink-2); background: var(--ink-2); }
.tl__item:first-child .tl__dot { border-color: var(--accent); background: var(--accent); }
.tl__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl__kind { font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px; color: var(--ink-2); }
.tl__text { margin-top: 2px; font-size: 15px; overflow-wrap: anywhere; }
.tl__item--system .tl__text { color: var(--muted); font-size: 14px; }
.tl__raw { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--bg-sunk); color: var(--ink-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl__next { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }

.form { display: grid; gap: 0; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .field { margin-bottom: 14px; }
.lineitems { display: grid; gap: 8px; margin-bottom: 14px; }
.lineitem { display: grid; grid-template-columns: 1fr 96px 110px 40px; gap: 8px; align-items: center; }

.callmode__objective { font-family: var(--font-display); font-size: 22px; line-height: 1.25; font-weight: 620; letter-spacing: -0.014em; }
.talkpoints { list-style: none; display: grid; gap: 6px; }
.talkpoints li { position: relative; padding-left: 16px; color: var(--ink-2); }
.talkpoints li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.draft { padding: 14px 16px; border-radius: var(--radius-s); background: var(--bg-sunk); white-space: pre-wrap; font-size: 15px; color: var(--ink); }
.state-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.state-tag.is-draft, .state-tag.is-proposed { color: var(--accent); }

/* ------------------------------------------------------------------------------------------ phone */

@media (max-width: 899px) {
  .view--wide { max-width: 100%; }
  .action { padding: 18px 18px 16px; border-radius: 18px; }
  .action--first::before { left: 18px; }
  .why__row { grid-template-columns: 1fr; gap: 0; }
  .why__label { font-size: 12px; }
  .fields__row { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 12px 8px 12px 0; }
  .stat + .stat { padding-left: 10px; }
  .stat:nth-child(4n + 1) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 5) { border-top: 1px solid var(--line); }
  .stat__n { font-size: 22px; }
  .stat__label { font-size: 11.5px; }
  .stats--wide { grid-template-columns: repeat(2, 1fr); }
  .stats--wide .stat:nth-child(4n + 1) { border-left: 1px solid var(--line); padding-left: 10px; }
  .stats--wide .stat:nth-child(2n + 1) { border-left: 0; padding-left: 0; }
  .stats--wide .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stats--wide .stat:nth-child(-n + 4) { border-top-width: 0; }
  .stats--wide .stat:nth-child(n + 3) { border-top-width: 1px; }
  .form__row { grid-template-columns: 1fr; gap: 0; }
  .lineitem { grid-template-columns: 1fr 76px 92px 40px; }
  .board { grid-auto-columns: 78%; }
  .demo-flag { top: calc(6px + var(--safe-top)); right: 8px; }
  .row__side { text-align: left; justify-items: start; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4n + 1) { border-left: 1px solid var(--line); padding-left: 10px; }
  .stat:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media print {
  .demo-flag { display: none !important; }
}

/* ------------------------------------------------------------------------------------------ reach: parked, rework, catch-up */

.pill--alert { background: var(--accent-soft); color: var(--accent); }
.row--muted .row__title, .row--muted .row__detail { color: var(--muted); }
.is-struck { text-decoration: line-through; text-decoration-thickness: 1px; }
.notice--park { border-left: 3px solid var(--accent); }
.action--rework { border-left: 3px solid var(--line-strong); }
.recovery {
  margin: -8px 0 24px; padding: 16px 18px; border-radius: 14px;
  background: var(--accent-soft);
}
.recovery__title { font-weight: 620; font-size: 17px; }
.recovery__grid { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.recovery__item { display: inline-flex; align-items: baseline; gap: 6px; color: var(--ink); text-decoration: none; font-size: 15px; }
.recovery__item:hover { text-decoration: underline; }
.recovery__n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.recovery__basis { margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.recovery .rows { margin-top: 8px; }
.point__side { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.recovery__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section--rework { margin-top: 8px; }

/* ------------------------------------------------------------------------------------------ orders: the state ladder */

.ladder { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; padding: 0; list-style: none; counter-reset: step; }
.ladder__step { flex: 1 1 0; min-width: 88px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 12.5px; font-weight: 560; text-align: center; }
.ladder__step.is-done { color: var(--ink); border-color: var(--ink-2); }
.ladder__step.is-now { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* a row of filters wider than a phone scrolls sideways instead of wrapping each label */
.seg--scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg--scroll::-webkit-scrollbar { display: none; }
.seg--scroll .seg__opt { white-space: nowrap; flex: none; }
