/* Page parts for console v2. Tokens and shell live in console.css. */

/* ---------- people tabs (converse) ---------- */
.people { display: flex; gap: 4px; margin: 20px 0 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.people::-webkit-scrollbar { display: none; }
.person-tab { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; cursor: pointer; color: var(--muted); white-space: nowrap; }
.person-tab:hover { color: var(--text); }
.person-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: none; }

/* ---------- route rail ---------- */
.route { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 20px 0 0; }
.route-step { position: relative; padding: 10px 12px 0 0; }
.route-step::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 2px; background: var(--rule); margin-right: 8px; }
.route-step.lit::before { background: var(--accent); }
.route-step.wait::before { background: none; border-top: 3px dashed var(--control); height: 0; }
.route-step b { display: block; font-size: 13px; line-height: 18px; font-weight: 600; }
.route-step span { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }

/* ---------- converse grid ---------- */
.converse { display: grid; grid-template-columns: 320px minmax(0, 1fr) 320px; gap: var(--gap); margin-top: 20px; align-items: start; }

/* phone */
.phone { border: 1px solid var(--border); border-radius: 28px; background: var(--raised); padding: 10px; position: sticky; top: 16px; }
.phone-screen { background: var(--surface); border-radius: 20px; border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; height: 600px; }
.phone-head { display: flex; flex-direction: column; align-items: center; padding: 14px 12px 10px; border-bottom: 1px solid var(--rule); }
.phone-head .avatar { width: 32px; height: 32px; font-size: 12px; background: var(--accent-pale); color: #123f80; }
.phone-head b { font-size: 13px; margin-top: 4px; }
.phone-head span { font-size: 11px; color: var(--faint); }
.thread { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.bubble { max-width: 84%; padding: 8px 11px; border-radius: 16px; font-size: 13px; line-height: 18px; }
.bubble.cady { align-self: flex-start; background: var(--raised); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.lead { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.note { align-self: center; background: none; color: var(--faint); font-size: 11px; padding: 2px 0; }
.bubble.typing { color: var(--faint); }
.bubble-in { animation: rise 260ms var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.composer { border-top: 1px solid var(--rule); padding: 10px; }
.composer p { margin: 0; font-size: 12px; line-height: 16px; color: var(--faint); }
.composer form { display: flex; gap: 6px; margin-top: 8px; }
.composer input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.composer input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer .btn { height: 32px; padding: 0 12px; font-size: 13px; }

/* decision trail */
.trail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.turn { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.turn-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: 0; background: none; cursor: pointer; text-align: left; }
.turn-head .quote { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-head .meta { margin-left: auto; color: var(--faint); font-size: 13px; white-space: nowrap; }
.turn-head .chev { width: 14px; height: 14px; color: var(--faint); transition: transform 150ms var(--ease); flex: none; }
.turn[data-open="true"] .chev { transform: rotate(90deg); }
.turn-body { display: none; padding: 0 16px 16px; }
.turn[data-open="true"] .turn-body { display: block; }
.stages { list-style: none; margin: 0; padding: 0; }
.stage { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 14px; }
.stage::before { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--rule); }
.stage:last-child { padding-bottom: 0; }
.stage:last-child::before { display: none; }
.stage .mark { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid var(--control); margin-top: 0; }
.stage.done .mark { border-color: var(--accent); background: var(--accent); }
.stage.done .mark svg { color: #fff; }
.stage.skip .mark { border-style: dashed; }
.stage.stop .mark { border-color: var(--negative); background: var(--negative); }
.stage.stop .mark svg { color: #fff; }
.stage.pending .mark { border-color: var(--control); }
.stage .mark svg { width: 11px; height: 11px; }
.stage-name { font-size: 13px; line-height: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-text { font-size: 14px; line-height: 20px; margin-top: 2px; }
.stage-detail { font-size: 13px; line-height: 18px; color: var(--muted); margin-top: 4px; }
.stage.skip .stage-text { color: var(--muted); }
.stage-hidden { opacity: 0; transform: translateY(6px); }
.stage-show { transition: opacity 220ms var(--ease), transform 220ms var(--ease); opacity: 1; transform: none; }
.reply-quote { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--raised); font-size: 14px; line-height: 20px; }
.keys { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.key { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--surface); }
.key svg { width: 13px; height: 13px; }
.key.open { color: #123f80; background: var(--accent-pale); border-color: #cddcf2; }
.key.shut { color: var(--pill-negative-ink); background: var(--pill-negative-bg); border-color: #f6cfc9; }
.ghl-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ghl-steps li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 10px; border-radius: 8px; background: var(--raised); }
.ghl-steps b { font-size: 13px; font-weight: 600; }
.ghl-steps .when { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.ghl-steps .proof { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.view-business .detail-only { display: none !important; }

/* GHL record and memory */
.side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; }
.kv dt { color: var(--muted); font-size: 13px; line-height: 18px; padding: 7px 0; white-space: nowrap; }
.kv dd { margin: 0; font-size: 13px; line-height: 18px; padding: 7px 0 7px 12px; text-align: right; font-weight: 500; }
.kv dt, .kv dd { border-bottom: 1px solid var(--rule); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sub-h { margin: 16px 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; }
.plain-list li { display: flex; gap: 8px; align-items: flex-start; }
.plain-list li, .kv dd, .ghl-steps .proof, .facts span, .notice { overflow-wrap: anywhere; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.facts b { font-size: 13px; font-weight: 600; }
.facts span { display: block; font-size: 13px; color: var(--muted); line-height: 18px; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ladder li { font-size: 12px; line-height: 15px; color: var(--faint); padding-top: 8px; position: relative; }
.ladder li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--rule); }
.ladder li.reached { color: var(--text); }
.ladder li.reached::before { background: var(--accent); }
.empty-line { font-size: 13px; color: var(--faint); }

/* ---------- tables (pick, outcomes) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; height: 36px; padding: 0 12px; white-space: nowrap; }
.table td { height: 52px; padding: 0 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--raised); }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: var(--faint); font-size: 13px; line-height: 18px; }

/* ---------- results ---------- */
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); margin-top: 24px; align-items: start; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bars li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 40px; align-items: center; gap: 12px; }
.bars .label b { display: block; font-size: 14px; font-weight: 500; }
.bars .label span { display: block; font-size: 13px; color: var(--muted); line-height: 18px; }
.bars .track { display: block; height: 10px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.bars .fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bars .fill.grey { background: #9aa3ae; }
.bars .count { text-align: right; font-weight: 600; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fig { padding: 14px 0; border-top: 1px solid var(--rule); }
.fig:nth-child(odd) { padding-right: 16px; }
.fig:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.fig .v { font-size: 24px; line-height: 30px; font-weight: 500; }
.fig .v small { font-size: 14px; color: var(--muted); font-weight: 400; }
.fig .l { font-size: 13px; color: var(--muted); line-height: 18px; }
.reasons { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 18px; }
.reasons li { display: flex; gap: 8px; }
.reasons .n { margin-left: auto; font-weight: 600; }
.model-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.model-row b { font-size: 20px; color: var(--text); font-weight: 600; }

/* ---------- pick ---------- */
.pick-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); margin-top: 24px; align-items: start; }
.check { width: 18px; height: 18px; accent-color: var(--accent); }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 18px; }
.rules li { display: flex; gap: 10px; }
.rules li span:last-child { margin-left: auto; color: var(--muted); white-space: nowrap; }

/* ---------- how it's built ---------- */
.flow { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.lane { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.lane h2 { margin: 0; font-size: 16px; line-height: 22px; }
.lane .lane-sub { margin: -6px 0 2px; font-size: 13px; color: var(--muted); }
.box { border-radius: 8px; background: var(--raised); padding: 10px 12px; }
.box b { display: block; font-size: 13px; }
.box span { display: block; font-size: 13px; color: var(--muted); line-height: 18px; }
.box.accent { background: var(--accent-pale); }
.lane-engine .box { position: relative; }
.arrow-row { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-top: 24px; }

@media (max-width: 1280px) {
  .converse { grid-template-columns: 300px minmax(0, 1fr); }
  .converse .side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .converse { grid-template-columns: 1fr; }
  .converse .side { grid-template-columns: 1fr; }
  .phone { position: static; max-width: 360px; width: 100%; margin: 0 auto; }
  .phone-screen { height: 460px; }
  .grid-2-1, .pick-grid, .flow { grid-template-columns: 1fr; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .route { grid-template-columns: 1fr; gap: 10px; }
  .route-step { padding: 0 0 0 14px; }
  .route-step::before { right: auto; width: 3px; top: 2px; bottom: 2px; height: auto; margin: 0; }
  .route-step.wait::before { border-top: 0; border-left: 3px dashed var(--control); width: 0; }
}
@media (max-width: 640px) {
  .bars li { grid-template-columns: 110px minmax(0, 1fr) 32px; }
  .table .hide-sm { display: none; }
  .facts-grid { grid-template-columns: 1fr; }
}

/* Page 1: the message that fits each person's history */
.opener-row td { padding-top: 0; border-top: 0; }
.opener-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 4px; }
.case-chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line, #d9d4cd); }
.opener-why { font-size: 12px; color: var(--muted, #6b6560); }
.opener-text { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.conf-chip { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent, #2a9d5c) 14%, transparent); color: var(--ink, #1d1b19); }
.conf-chip.low { background: color-mix(in srgb, #c98a12 20%, transparent); }
.opener-reasons { font-size: 12px; color: var(--muted, #6b6560); margin-bottom: 3px; }

/* last time / this time */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; margin-top: 8px; }
.story-col { min-width: 0; }
.story-label { display: block; font-size: 11px; line-height: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.story-head { font-size: 13px; line-height: 18px; font-weight: 500; }
.story-quotes { margin: 4px 0 0; padding: 0; list-style: none; }
.story-quotes li { font-size: 12px; line-height: 17px; color: var(--muted); padding-left: 8px; border-left: 2px solid var(--rule); margin-top: 4px; }
.story-src { color: var(--faint); white-space: nowrap; }
.story-why { font-size: 12px; line-height: 17px; color: var(--muted); margin-top: 4px; }
.case-chip.held { background: #fdecec; color: #9b1c1c; border-color: #f3c6c6; }
@media (max-width: 720px) { .story { grid-template-columns: 1fr; gap: 8px; } }
