/* Vow ops. Restraint: one neutral grotesk, near-black on white, grey hairlines, hierarchy from weight and space, colour only
   where it means something (a state, a link). */
:root {
  --ink: #171717; --ink-2: #404040; --muted: #737373; --faint: #a3a3a3;
  --paper: #fafafa; --card: #ffffff; --rule: #e5e5e5; --rule-2: #efefef; --hover: #f5f5f5;
  --navy: #171717; --navy-ink: #000000; --navy-tint: #f0f0f0; --link: #2563eb;
  --green: #15803d; --green-tint: #ecfdf3; --red: #b91c1c; --red-tint: #fef2f2; --amber: #b45309; --amber-tint: #fffbeb;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 8px; --r-s: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/20px var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
#nav a, .brand, .btn, .q-act, .q-back a { text-decoration: none; }
b, strong { font-weight: 600; }
code { font: 12px/18px var(--mono); background: var(--rule-2); padding: 1px 5px; border-radius: 4px; }
h1 { font: 600 22px/28px var(--sans); letter-spacing: -0.01em; margin: 0 0 4px; color: var(--ink); }
h2 { font: 600 16px/24px var(--sans); letter-spacing: -0.005em; margin: 32px 0 10px; }
h3 { font: 500 12px/16px var(--sans); color: var(--muted); margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.ok { color: var(--green); } .bad { color: var(--red); }

/* bar */
.bar { display: flex; align-items: center; gap: 20px; height: 52px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.brand { font: 600 15px/20px var(--sans); letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 400; }
#nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; flex: 1; min-width: 0; height: 52px; }
#nav::-webkit-scrollbar { display: none; }
#nav a { position: relative; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; }
#nav a:hover { color: var(--ink); background: var(--hover); }
#nav a.on { color: var(--ink); background: var(--rule-2); }
#nav a.primary { margin-right: 8px; background: var(--ink); color: #fff; }
#nav a.primary:hover, #nav a.primary.on { background: #000; color: #fff; }
#who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
#who .email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#alerts { display: none; background: var(--red-tint); color: var(--red); border-bottom: 1px solid #efcdc8; padding: 10px 28px; font-weight: 500; font-size: 13px; line-height: 18px; }
#alerts div { padding: 1px 0; }
main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }

/* page heads */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; }
.row h1 { margin: 0; }
.row .muted { font-size: 13px; }

/* controls */
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], select, textarea { font: inherit; height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-s); background: #fff; color: var(--ink); min-width: 200px; transition: border-color 120ms, box-shadow 120ms; }
textarea { height: auto; min-height: 84px; padding: 8px 10px; width: 100%; line-height: 20px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--rule-2); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; -webkit-appearance: none; padding-right: 28px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%236b7280' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center; }
button, .btn { font: inherit; font-weight: 500; font-size: 13px; height: 34px; padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: background 100ms, border-color 100ms; }
button:hover, .btn:hover { background: #000; text-decoration: none; }
button.quiet, .btn.quiet { background: #fff; color: var(--ink); border-color: var(--rule); }
button.quiet:hover, .btn.quiet:hover { background: var(--hover); border-color: #d4d4d4; }
button.danger { background: #fff; color: var(--red); border-color: var(--rule); }
button.danger:hover { background: var(--red-tint); border-color: #e4b9b3; }
button:disabled { opacity: 0.5; cursor: default; }
select.quiet { height: 32px; font-size: 13px; color: var(--ink); min-width: 0; }

/* tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll table { min-width: 760px; }
.scroll table.wide { min-width: 1160px; }
td.who { min-width: 170px; }
td.acts select { width: 132px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; font-size: 13px; line-height: 19px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; line-height: 16px; padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--rule); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
td .muted { font-size: 13px; }
td.acts { white-space: nowrap; text-align: right; }

/* states: a dot and a word */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.pill.ok::before { background: var(--green); } .pill.ok { color: var(--green); }
.pill.warn::before { background: var(--amber); } .pill.warn { color: var(--amber); }
.pill.bad::before { background: var(--red); } .pill.bad { color: var(--red); }
.pill.navy::before { background: var(--link); } .pill.navy { color: var(--ink-2); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 20px; }
.card h3 { margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; font-size: 14px; }
.kv .k { color: var(--muted); }
.diff .k { color: var(--muted); }
.diff .was { text-decoration: line-through; color: var(--muted); margin-right: 8px; }
.diff .now { font-weight: 600; }
pre { background: #1b1f26; color: #e8e4dc; padding: 14px 16px; border-radius: var(--r); font: 12px/18px var(--mono); overflow: auto; max-height: 380px; white-space: pre-wrap; }

/* sign in */
.login { max-width: 360px; margin: 96px auto; text-align: left; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 28px 28px 24px; }
.login h1 { font-size: 20px; }
.login p.muted { margin: 0 0 20px; font-size: 14px; }
.login input { width: 100%; margin: 0 0 10px; height: 42px; }
.login button[type=submit] { width: 100%; height: 42px; margin-top: 4px; }
.login svg { display: block; margin: 6px auto 10px; }
.login p { margin-top: 14px; }

/* copy editor */
.tabs { display: flex; gap: 4px; margin: 0 0 14px; flex-wrap: wrap; }
.tabs button { height: 30px; padding: 0 12px; background: transparent; color: var(--ink-2); border-color: transparent; font-weight: 500; }
.tabs button:hover { background: var(--hover); }
.tabs button.on { background: var(--rule-2); color: var(--ink); }
.copyrow td:first-child { white-space: nowrap; font: 12px/18px var(--mono); color: var(--ink-2); width: 220px; }
.copyrow textarea { min-height: 60px; }
.flash { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; opacity: 0; transition: opacity 150ms; font-size: 13px; z-index: 20; }
.flash.on { opacity: 1; }

/* watch and replay */
.screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.screen { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.screen .head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); font-size: 13px; min-height: 44px; }
.screen .head b { font-size: 14px; }
.screen img { display: block; width: 100%; aspect-ratio: 16 / 10; background: #e9e5dc; object-fit: cover; object-position: top; }
.screen .none { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.replay { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.replay input[type=range] { width: 100%; accent-color: var(--navy); }
.steps { margin: 0; padding: 4px 14px 12px 30px; max-height: 240px; overflow: auto; font-size: 13px; line-height: 19px; }
.steps li { cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.steps li.on { background: var(--rule-2); color: var(--ink); font-weight: 500; }

/* new quote: the form */
.q-wrap { display: grid; grid-template-columns: minmax(0, 700px) 300px; gap: 48px; align-items: start; }
.q-head { margin: 4px 0 24px; }
.q-head h1 { font-size: 24px; line-height: 32px; }
.q-head p { color: var(--muted); margin: 4px 0 0; max-width: 60ch; font-size: 14px; line-height: 21px; }
.q-sec { padding: 0 0 28px; margin: 0 0 28px; border-bottom: 1px solid var(--rule); }
.q-sec:last-of-type { border-bottom: 0; }
.q-sec-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.q-sec-head h2 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.q-num { font: 500 12px/16px var(--mono); color: var(--faint); }
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.q-field { display: flex; flex-direction: column; min-width: 0; }
.q-field.span-2 { grid-column: span 2; }
.q-field label { font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; line-height: 18px; }
.q-opt { color: var(--faint); font-weight: 400; }
.q-field input, .q-field textarea { width: 100%; min-width: 0; height: 38px; padding: 0 11px; font-size: 14px; }
.q-field textarea { height: auto; padding: 9px 12px; }
.q-field.bad input, .q-field.bad .q-seg, .q-field.bad .q-affix { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.q-affix { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--r-s); background: #fff; transition: border-color 120ms, box-shadow 120ms; }
.q-affix span { padding: 0 0 0 11px; color: var(--muted); font-size: 14px; }
.q-affix input { border: 0 !important; box-shadow: none !important; padding-left: 6px; }
.q-affix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--rule-2); }
.q-hint { font-size: 12px; line-height: 17px; color: var(--muted); margin-top: 6px; }
.q-err { font-size: 12px; line-height: 17px; color: var(--red); font-weight: 500; margin-top: 4px; }
.q-err:empty { display: none; }
.q-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r-s); overflow: hidden; background: #fff; height: 38px; width: 100%; }
.q-seg button { flex: 1; height: auto; border: 0; border-radius: 0; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 13px; padding: 0 8px; cursor: pointer; border-right: 1px solid var(--rule-2); }
.q-seg button:last-child { border-right: 0; }
.q-seg button:hover { background: var(--hover); }
.q-seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.q-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); cursor: pointer; background: var(--card); }
.q-check:hover { background: var(--hover); }
.q-check:has(input:checked) { border-color: var(--ink); background: var(--card); }
.q-check input { margin: 3px 0 0; accent-color: var(--ink); }
.q-check b { display: block; font-weight: 500; }
.q-check small { display: block; color: var(--muted); font-size: 12px; line-height: 17px; margin-top: 2px; }
.q-bar { display: flex; align-items: center; gap: 16px; padding: 8px 0 0; }
.q-carriers { display: flex; gap: 8px; flex-wrap: wrap; }
.q-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.q-chip:has(input:checked) { border-color: var(--ink); color: var(--ink); }
.q-chip input { accent-color: var(--ink); margin: 0; }
.q-go { margin-left: auto; height: 40px; padding: 0 18px; font-size: 14px; border-radius: 6px; }
.q-rail { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.q-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; }
.q-needs { list-style: none; margin: 0; padding: 0; }
.q-needs li { display: grid; grid-template-columns: 10px 1fr; gap: 2px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule-2); font-size: 14px; }
.q-needs li:first-child { border-top: 0; padding-top: 0; }
.q-needs .q-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); grid-row: span 2; }
.q-needs li.ok .q-dot { background: var(--green); }
.q-needs .q-need-txt { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 16px; }
.q-needs li.ok .q-need-txt { color: var(--green); }
.q-steps { margin: 0; padding-left: 18px; font-size: 14px; line-height: 21px; color: var(--ink-2); }
.q-steps li { margin: 4px 0; padding-left: 2px; }

/* the board */
.q-board { max-width: 1180px; }
.q-back { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.q-board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.q-board-head h1 { font-size: 22px; line-height: 28px; margin: 0; }
.q-sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.q-status { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.q-gate { flex-basis: 100%; font-weight: 400; color: var(--amber); margin: 4px 0 0; }
.q-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.q-live.on { background: var(--link); animation: q-pulse 1.2s ease-in-out infinite; }
.q-live.wait { background: var(--amber); animation: q-pulse 1.6s ease-in-out infinite; }
.q-live.ok { background: var(--green); } .q-live.bad { background: var(--red); } .q-live.warn { background: var(--amber); }
@keyframes q-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.q-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.q-cc { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color 200ms; }
.q-cc.running { border-color: var(--link); }
.q-cc.paused { border-color: var(--amber); }
.q-cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule-2); min-height: 48px; }
.q-cc-head b { font-size: 15px; font-weight: 600; }
.q-cc-state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; text-align: right; }
.q-shot { position: relative; background: #e9e5dc; aspect-ratio: 16 / 10; }
.q-cc.done .q-shot:not(.has) { display: none; }
.q-shot img { display: none; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.q-shot img.has { display: block; }
.q-shot img.has + .q-shot-empty { display: none; }
.q-shot-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 0 20px; text-align: center; }
.q-result { padding: 16px 16px 8px; }
.q-prem { font: 600 28px/34px var(--sans); letter-spacing: -0.02em; }
.q-prem span { font: 500 13px/18px var(--sans); color: var(--muted); margin-left: 6px; }
.q-prem-sub { color: var(--muted); font-size: 13px; line-height: 19px; margin-top: 4px; }
.q-why { font-size: 14px; line-height: 20px; }
.q-notes { list-style: none; margin: 0; padding: 8px 16px 10px; font-size: 13px; line-height: 19px; color: var(--ink-2); max-height: 240px; overflow: auto; flex: 1; }
.q-notes li { display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid var(--rule-2); }
.q-notes li:first-child { border-top: 0; }
.q-notes li span { color: var(--faint); }
.q-cc-foot { padding: 10px 16px 12px; border-top: 1px solid var(--rule-2); font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.q-cc-foot:empty { display: none; }
.q-sent { margin-top: 24px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; }
.q-kv { display: grid; grid-template-columns: 130px 1fr 130px 1fr; gap: 8px 16px; font-size: 14px; }
.q-kv .k { color: var(--muted); }
.q-pause { background: var(--amber-tint); border: 1px solid #ecd9a4; border-radius: var(--r); padding: 12px 14px; font-size: 14px; line-height: 20px; margin: 4px 0 8px; }
.q-pause b { display: block; color: var(--amber); font-weight: 600; }
.q-pause p { margin: 6px 0 10px; color: var(--ink); }
.q-pause-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.q-act { font: inherit; font-weight: 500; font-size: 13px; height: 30px; padding: 0 11px; border-radius: var(--r-s); border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.q-act.quiet { background: #fff; color: var(--ink); border-color: var(--rule); }
.q-act.danger { background: #fff; color: var(--red); border-color: var(--rule); }
.q-act:disabled { opacity: .5; }

@media (max-width: 1100px) { .q-wrap { grid-template-columns: 1fr; gap: 28px; } .q-rail { position: static; } }
@media (max-width: 820px) { .q-cards { grid-template-columns: 1fr; } .q-kv { grid-template-columns: 110px 1fr; } }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; } .bar { padding: 0 14px; gap: 10px; } .brand { display: none; } #who .email { display: none; } main { padding: 18px 14px 60px; } #alerts { padding: 8px 14px; } h1 { font-size: 20px; line-height: 26px; } }
@media (max-width: 640px) { .q-seg button { font-size: 13px; padding: 0 4px; } .q-grid, .q-checks { grid-template-columns: 1fr; } .q-field.span-2 { grid-column: span 1; } .q-bar { flex-direction: column; align-items: stretch; } .q-go { margin-left: 0; } .q-head h1 { font-size: 22px; line-height: 28px; } }
.login button.google { width: 100%; height: 42px; background: #fff; color: var(--ink); border-color: var(--rule); font-size: 14px; gap: 10px; justify-content: center; }
.login button.google:hover { background: var(--hover); }
.login details.alt { margin-top: 18px; }
.login details.alt summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.login details.alt form { margin-top: 12px; }

/* ---- the workspace shell: rail | list | pane ---- */
body { overflow: hidden; }
body:not(.in) #rail, body:not(.in) #pane { display: none; }
body:not(.in) #work { display: block; overflow: auto; height: 100vh; }
#app { display: grid; grid-template-columns: 208px 1fr; height: 100vh; }
#rail { display: flex; flex-direction: column; border-right: 1px solid var(--rule); background: var(--card); padding: 14px 12px; gap: 6px; overflow-y: auto; }
#rail .brand { padding: 2px 8px 10px; }
#rail .new { display: flex; align-items: center; justify-content: center; height: 32px; margin: 0 0 8px; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 500; font-size: 13px; }
#rail .new:hover { background: #000; text-decoration: none; }
#nav { display: flex; flex-direction: column; gap: 1px; height: auto; overflow: visible; white-space: normal; }
#nav a { display: flex; align-items: center; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
#nav a:hover { background: var(--hover); color: var(--ink); }
#nav a.on { background: var(--rule-2); color: var(--ink); }
#floor { margin-top: 18px; border-top: 1px solid var(--rule-2); padding-top: 12px; font-size: 13px; }
.floor-head { font-size: 12px; color: var(--muted); padding: 0 8px 6px; display: flex; justify-content: space-between; gap: 8px; }
.floor-lane { display: grid; grid-template-columns: 8px 1fr auto; gap: 0 8px; align-items: center; padding: 6px 8px; border-radius: 6px; }
.floor-lane b { font-weight: 500; }
.floor-word { color: var(--muted); font-size: 12px; }
.floor-lane.warn { background: var(--amber-tint); }
.floor-lane.warn .floor-word { color: var(--amber); font-weight: 500; }
.floor-sub, .floor-pause { grid-column: 2 / span 2; font-size: 12px; line-height: 17px; color: var(--ink-2); margin-top: 2px; }
.floor-pause .muted { font-size: 12px; }
.floor-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.floor-acts .q-act { height: 26px; padding: 0 9px; font-size: 12px; }
.floor-all { display: block; padding: 8px 8px 0; font-size: 12px; color: var(--muted); }
#who { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--rule-2); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
#who .email { color: var(--ink); font-weight: 500; }
#who a { color: var(--muted); font-size: 12px; margin-top: 4px; }
#work { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100vh; min-width: 0; }
body.has-pane #work { grid-template-columns: minmax(0, 1fr) minmax(400px, 46%); }
#alerts { grid-column: 1 / -1; }
#main { overflow-y: auto; min-width: 0; }
#pane { overflow-y: auto; border-left: 1px solid var(--rule); background: var(--card); padding: 20px 22px 60px; }
.page { padding: 24px 28px 80px; max-width: 1100px; }
.page h1 { margin-bottom: 16px; }

/* list */
.q-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule); background: var(--card); position: sticky; top: 0; z-index: 2; }
.q-top input[type=search] { height: 32px; min-width: 240px; flex: 1; max-width: 360px; -webkit-appearance: none; }
.views { display: flex; gap: 2px; }
.views button, .views a { height: 30px; padding: 0 10px; background: transparent; color: var(--muted); border: 0; border-radius: 6px; font-weight: 500; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; }
.views button:hover, .views a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.views button.on, .views a.on { background: var(--rule-2); color: var(--ink); }
.upd { font-size: 12px; color: var(--link); cursor: pointer; }
.q-list { padding: 4px 0 60px; }
.q-day { font-size: 12px; color: var(--muted); padding: 14px 20px 6px; }
.q-row { display: grid; grid-template-columns: 52px minmax(130px, 1fr) minmax(170px, 1.3fr) repeat(3, minmax(84px, 0.8fr)) minmax(96px, 0.8fr) 92px; gap: 12px; align-items: center; min-height: 44px; padding: 7px 20px; border-bottom: 1px solid var(--rule-2); cursor: pointer; font-size: 13px; line-height: 17px; }
.q-row:hover { background: var(--hover); }
.q-row.sel { background: var(--rule-2); }
.q-row.unread .q-who b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--link); margin: 0 6px 1px -12px; }
.q-row.queued { opacity: .75; cursor: default; }
.q-row.queued:hover { background: transparent; }
.q-when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.q-who b, .q-home b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-who span, .q-home span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.c-price.basis { color: var(--amber); }
.c-price sup { font-size: 10px; margin-left: 1px; }
.c-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.c-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.c-state.on { color: var(--ink); } .c-state.on::before { background: var(--link); animation: q-pulse 1.2s ease-in-out infinite; }
.c-state.ok { color: var(--green); } .c-state.ok::before { background: var(--green); }
.c-state.warn { color: var(--amber); } .c-state.warn::before { background: var(--amber); }
.c-state.bad { color: var(--red); } .c-state.bad::before { background: var(--red); }
.c-state.navy { color: var(--ink-2); } .c-state.navy::before { background: var(--link); }
.c-state.muted::before { display: none; }
.q-vs { font-size: 13px; white-space: nowrap; }
.q-kind { text-align: right; white-space: nowrap; }
.pill.muted { color: var(--muted); } .pill.muted::before { background: var(--faint); }
.q-empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.c-row { grid-template-columns: minmax(150px, 1.2fr) minmax(170px, 1.3fr) minmax(120px, 1fr) 100px minmax(120px, 1fr) 100px; }

/* pane */
.pane-empty { padding: 60px 20px; color: var(--muted); text-align: center; line-height: 20px; }
.pane-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.pane-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 24px; }
.pane-side { text-align: right; font-size: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.pane-vs { font-size: 14px; margin: 0 0 14px; padding: 10px 12px; background: var(--paper); border-radius: 8px; }
.pc { border: 1px solid var(--rule); border-radius: 10px; margin-bottom: 12px; overflow: hidden; background: var(--card); transition: border-color 200ms; }
.pc.running { border-color: var(--link); } .pc.paused { border-color: var(--amber); }
.pc-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); }
.pc-head b { font-size: 14px; font-weight: 600; }
.pc-state { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pc-shot { display: none; background: #eee; aspect-ratio: 16 / 10; }
.pc-shot img { display: none; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pc-shot img.has { display: block; }
.pc.running .pc-shot, .pc.paused .pc-shot, .pc-shot:has(img.has) { display: block; }
.pc-body { padding: 12px 14px 4px; }
.pc-body:empty { padding: 0; }
.pc-body .q-prem { font-size: 24px; line-height: 30px; }
.pc-notes { max-height: 180px; padding: 6px 14px 8px; }
.pc-notes:empty { display: none; }
.pc-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 14px 10px; border-top: 1px solid var(--rule-2); font-size: 13px; }
.pc-acts:empty { display: none; }
.pane-call, .pane-versions, .pane-sec, .pane-links { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.pane-call .muted, .pane-versions .muted, .pane-sec > .muted { font-size: 12px; margin-bottom: 8px; }
.call-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.call-acts button { height: 30px; font-size: 13px; }
.call-acts button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pane-call input { width: 100%; }
.call-log { margin-top: 10px; font-size: 13px; line-height: 19px; }
.call-log > div { padding: 6px 0; border-top: 1px solid var(--rule-2); }
.pane-versions a { display: block; padding: 4px 0; font-size: 13px; }
.pane-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.kv-row { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; padding: 5px 0; font-size: 13px; line-height: 19px; border-top: 1px solid var(--rule-2); }
.kv-row:first-of-type { border-top: 0; }
.kv-row .k { color: var(--muted); }
.setup-form .kv-row { grid-template-columns: 260px 1fr; padding: 8px 0; align-items: start; }
.setup-form input, .setup-form select { max-width: 420px; }
.setup-form .q-hint { margin-top: 4px; }

/* sheet (new quote, new link) */
#sheet { position: fixed; inset: 0; background: rgba(23, 23, 23, .32); z-index: 30; display: flex; justify-content: flex-end; }
#sheet[hidden] { display: none; }
.sheet-in { width: min(1040px, 94vw); height: 100%; background: var(--card); overflow-y: auto; padding: 28px 32px 80px; position: relative; box-shadow: -8px 0 24px rgba(0,0,0,.08); }
.sheet-x { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; padding: 0; border-radius: 50%; background: #fff; color: var(--ink); border-color: var(--rule); font-size: 18px; justify-content: center; }
.sheet-in .q-wrap { grid-template-columns: minmax(0, 640px) 280px; gap: 36px; }

@media (max-width: 1180px) { body.has-pane #work { grid-template-columns: minmax(0, 1fr); } body.has-pane #pane { position: fixed; inset: 0 0 0 208px; z-index: 20; display: none; } body.has-pane.pane-open #pane { display: block; } .q-row { grid-template-columns: 52px 1fr 1.2fr repeat(3, 0.7fr) 90px; } .q-vs { display: none; } }
@media (max-width: 760px) { #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } #rail { flex-direction: row; align-items: center; padding: 8px 12px; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); } #rail .brand { display: none; } #rail .new { margin: 0; padding: 0 12px; } #nav { flex-direction: row; } #floor { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 6px; } .floor-head, .floor-word, .floor-sub, .floor-pause, .floor-all { display: none; } .floor-lane { padding: 4px; grid-template-columns: 8px auto; } .floor-lane b { font-size: 11px; } #who { display: none; } body.has-pane #pane { inset: 48px 0 0 0; } .q-row { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; } .q-when, .q-cell, .q-vs { display: none; } .sheet-in { width: 100vw; padding: 20px 16px 60px; } .sheet-in .q-wrap { grid-template-columns: 1fr; } }
/* after the first look: the list must never clip; the pane's back button is a phone thing; the floor on a phone is dots only */
body.has-pane #work { grid-template-columns: minmax(0, 1fr) minmax(380px, 42%); }
.q-row { grid-template-columns: 48px minmax(120px, 1fr) minmax(150px, 1.25fr) repeat(3, minmax(72px, 0.75fr)) minmax(90px, 0.7fr) 84px; gap: 10px; padding: 7px 16px; }
@media (max-width: 1540px) { body.has-pane .q-vs { display: none; } body.has-pane .q-row { grid-template-columns: 48px minmax(110px, 1fr) minmax(140px, 1.2fr) repeat(3, minmax(66px, 0.7fr)) 80px; } }
@media (max-width: 1300px) { body.has-pane .q-who span, body.has-pane .q-home span { display: none; } body.has-pane .q-when { display: none; } body.has-pane .q-row { grid-template-columns: minmax(100px, 1fr) minmax(120px, 1.2fr) repeat(3, minmax(60px, 0.7fr)) 76px; } }
.pane-close { display: none; }
@media (max-width: 1180px) { .pane-close { display: inline-flex; margin-bottom: 12px; } }
@media (max-width: 760px) { #floor { display: none; } #rail { gap: 10px; } }

/* ---- second look (10-13): the sign-in card was squeezed into the hidden rail's column; rail items inherited the old top
   bar's centring; state words shouted in colour; the pane head spilled. Fixed at the source, below. ---- */
body:not(.in) #app { grid-template-columns: 1fr; }
body:not(.in) #work { display: flex; align-items: center; justify-content: center; min-height: 100vh; height: auto; padding: 24px 16px; }
body:not(.in) main { max-width: none; margin: 0; padding: 0; width: 100%; }
.login { width: 100%; max-width: 400px; margin: 0 auto; padding: 32px 32px 28px; border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 24px 48px -32px rgba(0, 0, 0, .25); }
.login-brand { display: flex; align-items: center; gap: 8px; font: 600 12px/16px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 20px; }
.login-brand::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--ink); }
.login h1 { font-size: 22px; line-height: 28px; letter-spacing: -0.015em; margin: 0 0 6px; }
.login p.muted { font-size: 14px; line-height: 21px; margin: 0 0 22px; }
.login p.bad { font-size: 13px; line-height: 19px; margin: -10px 0 16px; }
.login button.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.login button.google svg { display: block; margin: 0; flex: none; }
.login details.alt { margin-top: 20px; }
.login details.alt summary { list-style: none; display: inline; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.login details.alt summary::-webkit-details-marker { display: none; }
.login details.alt summary:hover { color: var(--ink); text-decoration-color: var(--ink); }
.login details.alt form { margin-top: 14px; }
.login input, .login button[type=submit] { height: 40px; border-radius: 8px; }

/* rail: left-aligned, one size */
#rail #nav { align-items: stretch; }
#rail #nav a { justify-content: flex-start; }
#who { align-items: flex-start; }
.floor-lane b { font-size: 13px; }

/* states: the dot carries the colour; the word stays ink, so a row reads as text, not as a badge rack */
.c-state, .c-state.ok, .c-state.warn, .c-state.bad, .c-state.navy { color: var(--ink-2); }
.c-state.on { color: var(--ink); }
.c-state.muted { color: var(--muted); }
.pill, .pill.ok, .pill.warn, .pill.bad, .pill.navy { color: var(--ink-2); }
.pill.muted { color: var(--muted); }
.q-kind .pill { font-size: 12px; }
.floor-lane.warn .floor-word { color: var(--amber); }

/* pane head: name and state on one line, then the address, then two quiet meta lines that wrap instead of spilling */
.pane-head { display: block; margin-bottom: 14px; }
.pane-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; line-height: 24px; }
.pane-title .pill { font-size: 12px; font-weight: 500; }
.pane-addr { font-size: 13px; line-height: 19px; color: var(--ink-2); margin-top: 2px; }
.pane-meta { font-size: 12px; line-height: 18px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.pane-meta:empty { display: none; }
.pane-vs { font-size: 13px; }
#who { margin-left: 0; width: 100%; }
/* a finished carrier card leads with the number; its last frame becomes a short receipt strip under it */
.pc:not(.running):not(.paused) { flex-direction: column; }
.pc:not(.running):not(.paused) .pc-shot:has(img.has) { order: 5; aspect-ratio: auto; height: 120px; border-top: 1px solid var(--rule-2); }
.pc:not(.running):not(.paused) .pc-shot img { object-position: top left; }
.pc { display: flex; flex-direction: column; }
.pc-acts { order: 6; }
