
/* Layout: a thin prototype bar on top; below it the portal as GHL would frame it.
   Rail + main on wide screens; one column with bottom tabs when the app is narrow (container query),
   so the Phone switch and a real phone share the same layout. Soft dark tokens from mockup/portal.css. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/atkinson-next.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/atkinson-next-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
/* Brand: Echo + Engine kit v1, the same tokens as echoandengine.com (src/css/site.css):
   black base, white type, one Signal Green accent; Geist for UI, Atkinson for reading, Geist Mono for datelines. */
:root {
  --proto: #0A0A0B; --rail: #0D0E10; --page: #0A0A0B; --surface: #121316; --surface-2: #181A1E; --surface-3: #202329;
  --line: #22242A; --line-2: #30333A;
  --text: #F4F5F7; --text-2: #C3C6CD; --muted: #8A8F9C; --faint: #80858F;
  --green: #19E57F; --green-hi: #4DF09F; --green-text: #4DF09F; --green-ink: #03150B; --green-wash: rgba(25,229,127,.09); --green-deep: #0E2619; --green-line: #1D5236;
  --warn: #F0A04B; --warn-wash: rgba(240,160,75,.12); --stop: #F28B8B; --stop-wash: rgba(240,122,122,.12); --info: #8CC0F7; --info-wash: rgba(125,183,245,.11);
  --body: "Atkinson Hyperlegible Next", "Segoe UI Variable", ui-sans-serif, sans-serif;
  --display: "Geist", "Segoe UI Variable", ui-sans-serif, sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", ui-monospace, monospace;
  --r-sm: 8px; --r: 10px; --r-lg: 16px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}
::selection { background: var(--green); color: var(--green-ink); }
* { box-sizing: border-box; }
html, body { background: var(--proto); color: var(--text); }
body { font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; margin: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; text-wrap: balance; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.faint { color: var(--faint); }
.eyebrow, .mono { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eyebrow.green { color: var(--green-text); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Prototype bar ---------- */
.protobar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--proto); border-bottom: 1px solid var(--line);
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--proto); }
.protobar .brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.protobar .brand strong { font: 600 14px var(--display); letter-spacing: -0.01em; }
.protobar .brand img { height: 14px; width: auto; display: block; }
.protobar .brand span { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); }
.pgroup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pgroup > .eyebrow { white-space: nowrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.pbtn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.pbtn.accent { border-color: var(--green-line); background: var(--green-deep); color: var(--green-text); }

/* ---------- Stage and device frames ---------- */
.stage { padding-block: 16px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.app { container-type: inline-size; container-name: app; position: relative; background: var(--page); }
.device-desktop .app { max-width: 1440px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: clip; }
.device-phone .stage { display: flex; justify-content: center; }
.phone { width: 390px; max-width: 100%; height: min(844px, calc(100vh - 130px)); min-height: 560px; border-radius: 40px; border: 1px solid var(--line-2);
  box-shadow: 0 0 0 9px #07080A, 0 30px 80px -20px rgba(0,0,0,.7); overflow: hidden; transform: translateZ(0); background: var(--page); }
.phone-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.phone .app { min-height: 100%; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 760px; }
.rail { background: var(--rail); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; }
.logo { display: block; align-self: flex-start; height: 15px; width: auto; margin: 6px 4px 2px; }
.logo b { color: var(--green); margin: 0 1px; }
.account { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); }
.account strong { font: 600 13px var(--display); }
.account span { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .navlabel { margin: 12px 12px 4px; }
.nav button { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); border: 0; background: transparent; text-align: left; font-size: 14px; width: 100%; }
.nav button:hover { background: var(--surface); }
.nav svg, .tabs svg, .ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); }
.nav button[aria-current="page"] { background: var(--green-wash); color: var(--green-text); box-shadow: inset 3px 0 0 var(--green); }
.nav button[aria-current="page"] .count { color: var(--green-text); }
.nav .ext { margin-left: auto; font-size: 12px; color: var(--faint); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; border-top: 1px solid var(--line); }
.me strong { font-size: 13px; display: block; }
.me span { font-size: 12px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--display); background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); flex: none; }
.avatar.g { background: var(--green-deep); color: var(--green-text); border-color: var(--green-line); }
.main { padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.top .greet { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.top h1 { font-size: 32px; font-weight: 700; line-height: 1.08; letter-spacing: -0.035em; max-width: 22em; }
.top h1 .reply { display: block; color: var(--muted); font-weight: 600; }
.top .eyebrow.green { display: flex; align-items: center; gap: .6em; letter-spacing: .12em; }
.top .eyebrow.green::before { content: "+"; font-size: 1.6em; line-height: 0; font-weight: 400; letter-spacing: 0; color: var(--green); }
.phonehead { display: none; }
.tabs { display: none; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); background: var(--info-wash); border: 1px solid rgba(140,192,247,.35); color: var(--info); font-size: 14px; }
.banner .btn { margin-left: auto; }

/* ---------- Buttons, chips, switches ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: var(--r-pill); font: 600 13.5px var(--display); letter-spacing: -0.005em; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); white-space: nowrap; transition: background .2s, transform .2s var(--ease); }
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--green); border-color: transparent; color: var(--green-ink); }
.btn.primary::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1.5px solid var(--green); opacity: 0; pointer-events: none; }
.btn.primary:hover:not(:disabled)::after { animation: ring 1s var(--ease) both; }
.btn:active:not(:disabled) { transform: scale(.98); }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12, 1.45); } }
.btn.primary:hover:not(:disabled) { background: var(--green-hi); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 0 8px; }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--stop); }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font: 500 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.chip.green { color: var(--green-text); background: var(--green-wash); border-color: var(--green-line); }
.chip.warn { color: var(--warn); background: var(--warn-wash); border-color: rgba(242,182,90,.35); }
.chip.stop { color: var(--stop); background: var(--stop-wash); border-color: rgba(240,122,122,.35); }
.chip.info { color: var(--info); background: var(--info-wash); border-color: rgba(140,192,247,.35); }
.switch { position: relative; width: 40px; height: 24px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-3); flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.switch[aria-checked="true"] { background: var(--green-deep); border-color: var(--green-line); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--green); }
kbd { font: 500 10.5px var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--muted); }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .val { font: 700 32px/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.kpi .val small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.split { display: flex; gap: 3px; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.split i { display: block; height: 100%; }

/* ---------- Panels and lists ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel > header h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.panel .body { padding: 6px 18px 16px; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.li .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.li .t strong { font-size: 14px; font-weight: 600; }
.li .t span { font-size: 12.5px; color: var(--muted); }
.amt { font: 600 14px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.green { color: var(--green-text); }
.empty { padding: 22px 18px; color: var(--muted); font-size: 14px; }

/* Pipeline bars */
.pipe { padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.stage-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .3s ease; }
.stage-row .n { text-align: right; font: 500 12.5px var(--mono); color: var(--muted); }
.stage-row.won span:first-child, .stage-row.won .n { color: var(--green-text); }
.stage-row.lost span:first-child, .stage-row.lost .n { color: var(--stop); }
.stage-row.lost .bar i { background: var(--stop); }

/* ---------- Queue ---------- */
.q { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.q .idx { font: 500 12px var(--mono); color: var(--faint); padding-top: 4px; }
.q.first .idx { color: var(--green-text); }
.q.first .idx::before { content: ""; display: block; width: 8px; height: 8px; margin: 0 0 8px 1px; border-radius: 50%; background: var(--green); animation: echo 2.4s var(--ease) 3; }
@keyframes echo { 0% { box-shadow: 0 0 0 0 rgb(25 229 127 / .5); } 70%, 100% { box-shadow: 0 0 0 9px rgb(25 229 127 / 0); } }
.q .what { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.line1 .who { font: 600 16px var(--display); }
.line1 .when { margin-left: auto; font: 500 11.5px var(--mono); color: var(--faint); }
.bubble { align-self: flex-start; max-width: 100%; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px 14px 14px 4px; padding: 10px 14px; font-size: 14.5px; overflow-wrap: anywhere; }
.bubble .via { display: block; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.note-line { font-size: 14px; color: var(--muted); }
.note-line b { color: var(--text); font-weight: 600; }
.draft { border-left: 2px solid var(--green); padding: 4px 0 4px 14px; display: flex; flex-direction: column; gap: 8px; }
.draft p { font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.draft textarea { width: 100%; min-height: 96px; resize: vertical; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; line-height: 1.5; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.ck { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.ck::before { content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--green-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%234DF09F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.ck.fail { color: var(--stop); }
.ck.fail::before { background: var(--stop-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 5l6 6M11 5l-6 6' fill='none' stroke='%23F28B8B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.ck.warn { color: var(--warn); }
.ck.warn::before { background: var(--warn-wash) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 4v5M8 11.5v.5' fill='none' stroke='%23F0A04B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tasks-mini { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tasks-mini span::before { content: "○ "; }
.tasks-mini span.done { color: var(--green-text); }
.tasks-mini span.done::before { content: "● "; }
.handled { padding: 16px 0 4px; display: flex; flex-direction: column; gap: 9px; }
.handled .row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.tick { width: 18px; height: 18px; border-radius: 50%; background: var(--green-deep); display: grid; place-items: center; flex: none; margin-top: 2px; }
.tick svg { width: 11px; height: 11px; stroke: var(--green-text); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
details.done-today { padding-top: 12px; }
details.done-today summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
details.done-today summary::-webkit-details-marker { display: none; }
.done-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); }
.done-row .t { flex: 1; min-width: 0; }

/* ---------- Tables ---------- */
.tablebox { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.example td { color: var(--muted); }

/* ---------- Rep call card ---------- */
.callcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.biz { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.biz h2 { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.facts b { color: var(--text); font-weight: 600; }
.star { color: var(--warn); }
.script { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.say { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.say .quote { font-size: 16px; line-height: 1.55; }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.note.warn { border-color: rgba(242,182,90,.35); }
.dial { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dial .from { font-size: 12.5px; color: var(--muted); }
.outs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.out { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; font-weight: 600; text-align: left; }
.out:hover:not(:disabled) { background: var(--surface-3); }
.out.good { color: var(--green-text); }
.out.bad { color: var(--stop); }
.out[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--green); }
.cbpick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.cbpick input[type="date"] { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; min-height: 36px; }
.board .r { display: grid; grid-template-columns: 26px 1fr 32px minmax(0, 1.1fr); align-items: center; gap: 10px; padding: 10px 18px; font-size: 14px; border-bottom: 1px solid var(--line); }
.board .r:last-child { border-bottom: 0; }
.board .r.me { background: var(--green-wash); }
.board .n { text-align: right; font: 600 14px var(--display); font-variant-numeric: tabular-nums; }
.li-btn { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; width: 100%; text-align: left; }
.li-btn:hover { background: var(--surface-2); }
.li-btn:last-child { border-bottom: 0; }

/* ---------- Agency ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.alert:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: none; }
.dot.stop { background: var(--stop); } .dot.warn { background: var(--warn); } .dot.info { background: var(--info); }
.pct.bad { color: var(--stop); font-weight: 600; }
.setgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.setrow { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setrow .t strong { font-size: 14px; font-weight: 600; }
.setrow .t span { font-size: 12.5px; color: var(--muted); }
.setrow input[type="text"], .setrow select { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; min-height: 36px; max-width: 180px; }
.ordbtns { display: flex; gap: 4px; }
.gauge { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--warn); }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 14px 18px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.chart .colbar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--green); }
.chart .colbar.dim { background: var(--surface-3); }
.chart .v { font: 500 11px var(--mono); color: var(--muted); }
.chart-x { display: flex; gap: 8px; padding: 6px 18px 16px; }
.chart-x span { flex: 1; text-align: center; font: 500 10.5px var(--mono); color: var(--faint); min-width: 0; }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5,5,6,.72); z-index: 50; display: flex; }
.drawer { margin-left: auto; width: min(460px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; }
.drawer header, .modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer header h2, .modal header h2 { font-size: 16px; flex: 1; min-width: 0; }
.thread { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--green-deep); border: 1px solid var(--green-line); border-bottom-right-radius: 4px; }
.msg.out.failed { background: var(--stop-wash); border-color: rgba(240,122,122,.35); }
.msg .meta { display: block; margin-top: 4px; font: 500 10.5px var(--mono); color: var(--faint); letter-spacing: .03em; }
.composer { border-top: 1px solid var(--line); padding: 14px 18px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.modal-wrap { align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(520px, 100%); max-height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.modal .mbody { padding: 18px; display: flex; flex-direction: column; gap: 14px; font-size: 14.5px; }
.modal .mbody ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.pickgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.pickgrid button { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 9px 12px; min-height: 44px; font-size: 13.5px; }
.pickgrid button[aria-pressed="true"] { border-color: var(--green); color: var(--green-text); background: var(--green-wash); }
.check-line { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--rail); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 14px; font-size: 14px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); animation: rise .2s ease; }
.toast span { flex: 1; min-width: 0; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ---------- Narrow app: phone layout ---------- */
@container app (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); min-height: 100%; }
  .rail { display: none; }
  .phonehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
  .phonehead .account { padding: 6px 10px; }
  .main { padding: 14px 16px 96px; gap: 18px; }
  .top h1 { font-size: 23px; }
  .top .hide-narrow { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .val { font-size: 26px; }
  .cols, .script, .setgrid { grid-template-columns: minmax(0, 1fr); }
  .q { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
  .outs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz h2 { font-size: 23px; }
  .callcard { padding: 16px; }
  .tabs { display: flex; position: sticky; bottom: 0; z-index: 20; isolation: isolate; background-color: var(--rail); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; padding: 6px 2px; min-height: 48px; border-radius: 10px; }
  .tabs button[aria-current="page"] { color: var(--green-text); background: var(--green-wash); }
  .stage-row { grid-template-columns: 92px minmax(0, 1fr) 32px; }
}
@media (max-width: 560px) {
  .protobar .brand { margin-right: 0; width: 100%; }
  .pgroup > .eyebrow { display: none; }
}

/* Production shell: the prototype's app layout, without device controls. */
[hidden] { display: none !important; }
a { color: var(--green-text); }
a.btn { text-decoration: none; }
.app { min-height: calc(100dvh - 55px); }
.shell { min-height: calc(100dvh - 55px); }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; }
.rail { position: sticky; top: 55px; max-height: calc(100dvh - 55px); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--surface); }
.mobile-links { display: none; }
.signin { max-width: 560px; margin: 48px auto; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.biz-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.biz h2, .top h1, .li strong, .li-btn strong, .toast { overflow-wrap: anywhere; }
td { overflow-wrap: break-word; }
td:first-child { min-width: 150px; }
/* One wordmark per screen: the top bar carries it, so the rail starts with the account. */
.rail .logo, .phonehead .logo { display: none; }
.outcome-area { display: flex; flex-direction: column; gap: 10px; }
.li-btn .t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.li-btn .t strong { font-size: 14px; }
.li-btn .t > span { font-size: 12.5px; color: var(--muted); }
.panel-actions, .gauge-wrap { padding: 16px 18px; }
.counts { min-width: 180px; }
.counts div { display: flex; justify-content: space-between; gap: 12px; }
.counts dd { margin: 0; font-variant-numeric: tabular-nums; }
summary { cursor: pointer; }
.toasts { max-height: 40dvh; overflow-y: auto; }
.toast { flex: none; }
.toast .icon-btn { align-self: flex-start; }
#practice { text-transform: none; letter-spacing: 0; white-space: normal; }
@container app (max-width: 1100px) {
  .main { padding-inline: 22px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .cols > .stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cols > .stack > :first-child { grid-column: 1 / -1; }
}
@container app (max-width: 760px) {
  .main { padding-inline: 16px; }
  .cols > .stack { display: flex; }
  .mobile-links { display: flex; gap: 16px; flex-wrap: wrap; }
  .mobile-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn, .btn.sm, .icon-btn, summary { min-height: 44px; }
  .icon-btn { min-width: 44px; }
  .dial > .btn { max-width: 100%; white-space: normal; text-align: center; }
}
@media (max-width: 760px) {
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .signin { margin: 24px 16px; }
}

/* ---------- Client screens: Messages, Quotes, thread pane ---------- */
.chipbar { display: flex; gap: 8px; flex-wrap: wrap; }
.chipbar button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.chipbar button .n { font: 500 11px var(--mono); color: var(--muted); }
.chipbar button[aria-pressed="true"] { border-color: var(--green); color: var(--green-text); background: var(--green-wash); }
.inbox { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.convos .convo { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; position: relative; }
.convos .convo:last-child { border-bottom: 0; }
.convos .convo:hover:not(:disabled) { background: var(--surface-2); }
.convos .convo[aria-current="true"] { background: var(--green-wash); box-shadow: inset 3px 0 0 var(--green); }
.convo .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.convo .t strong { font-size: 14px; font-weight: 600; }
.convo .t span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.convo .when { font: 500 11px var(--mono); color: var(--faint); }
.udot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; animation: echo 2.4s var(--ease) 2; }
.inbox-thread { display: flex; flex-direction: column; min-height: 420px; max-height: calc(100dvh - 120px); position: sticky; top: 70px; overflow: hidden; }
.inbox-thread > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.inbox-thread > header h2 { font-size: 16px; flex: 1; min-width: 0; }
.inbox-thread .thread { min-height: 160px; }
.drawer > header a.icon-btn, .inbox-thread > header a.icon-btn { text-decoration: none; color: inherit; }
.inbox-thread .close-narrow { display: none; }
.composer textarea { width: 100%; min-height: 110px; resize: vertical; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.drawer .thread { min-height: 0; }
a.icon-btn { display: grid; place-items: center; }
@container app (max-width: 1100px) { .inbox { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); } }
@container app (max-width: 760px) { .inbox { grid-template-columns: minmax(0, 1fr); } }
