/* Theme tokens are overwritten at load from the client profile (client.json -> theme). */
:root {
  --bg: #000000;
  --surface: #0C0C0D;
  --raised: #141416;
  --text: #F4F4F5;
  --muted: #87898D;
  --line: #232427;
  --accent: #FFFFFF;
  --accent-text: #000000;
  --positive: #3FA877;
  --negative: #D0634F;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 6px;
  --side: 232px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand img.logo { max-width: 150px; max-height: 40px; object-fit: contain; object-position: left; }
.brand img.mark { width: 34px; height: 34px; border-radius: 50%; }
.brand .names { display: flex; flex-direction: column; line-height: 1.15; }
.brand .co { font-weight: 800; letter-spacing: -0.01em; font-size: 15px; }
.brand .sub { color: var(--muted); font-size: 11.5px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius); color: var(--muted); position: relative; }
.nav a:hover { color: var(--text); background: var(--raised); }
.nav a.on { color: var(--text); background: var(--raised); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
.nav .badge { margin-left: auto; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; border: 1px solid var(--line); color: var(--text); }
.nav .badge.live { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.side .foot { margin-top: auto; padding: 0 6px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); min-height: 57px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--positive); }
.dot.bad { background: var(--negative); }
.dot.live { background: var(--positive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 25%, transparent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.assistant-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--raised); }
main.page { padding: 28px 24px 80px; }
.wrap { max-width: 820px; margin: 0 auto; }
.wrap.wide { max-width: 1120px; }
.btn.menu-btn { display: none; }

/* ---- type ---- */
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 700; margin: 0; }
.lede { color: var(--muted); max-width: 560px; margin: 0 0 24px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 32px 0 12px; }
.sec-head a { color: var(--muted); font-size: 12px; }
.sec-head a:hover { color: var(--text); }

/* The brand move: a frame with the title breaking out of it. */
.framed { position: relative; padding: 22px 0 0; margin-bottom: 8px; }
.framed::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 64px; border: 1px solid var(--line); border-bottom: 0; pointer-events: none; }
.framed h1 { position: relative; background: var(--bg); display: inline-block; padding-right: 10px; }
.row > .framed, .row > div:has(> .framed) { flex: 1; }
[data-scheme="light"] .framed::before { display: none; }
[data-scheme="light"] .framed { padding-top: 0; }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(0.9); }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--negative); color: var(--negative); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 12px; }
.link:hover { color: var(--text); }
label.f { display: block; font-weight: 600; margin: 18px 0 6px; font-size: 13px; }
label.f .opt { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.in, select.in, textarea.in { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; outline: none; }
.in:focus { border-color: var(--muted); }
textarea.in { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---- cards / lists ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 14px 16px; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); }
.grid { display: grid; gap: 10px; }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.agents { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 14px; padding: 14px; min-height: 84px; }
.tile:hover, .agent-card:hover { border-color: var(--muted); }
.tile .ic { width: 20px; height: 20px; }
.tile b { font-weight: 700; }
.agent-sec { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.agent-sec:first-of-type { margin-top: 0; }
.agent-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.agent-card .t { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.agent-card p { margin: 0; color: var(--muted); font-size: 13px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.tag.hi { color: var(--text); border-color: var(--muted); }

/* ---- home command ---- */
.cmd { padding: 16px 16px 12px; }
.cmd textarea { width: 100%; background: transparent; border: 0; outline: none; resize: none; font-size: 18px; min-height: 56px; }
.cmd textarea::placeholder { color: var(--muted); }
.cmd .row { justify-content: space-between; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 16px; padding: 4px 12px; font-size: 12px; color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }

/* ---- runs ---- */
.runs { list-style: none; margin: 0; padding: 0; }
.run { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.runs > li:last-child > .run { border-bottom: 0; }
.run:hover, .run.on { background: var(--raised); }
.run .ttl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.run .time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.run .st { font-size: 12px; min-width: 64px; text-align: right; }
.st.running, .st.queued { color: var(--positive); }
.st.failed { color: var(--negative); }
.st.done, .st.stopped { color: var(--muted); }
.run.child { padding-left: 34px; }
.run.child .ttl { font-weight: 400; color: var(--muted); }
.run.child::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.bar { position: absolute; left: 12px; right: 40%; bottom: 3px; height: 1px; background: linear-gradient(90deg, transparent, var(--positive), transparent); background-size: 200% 100%; animation: slide 1.8s linear infinite; opacity: .8; }
@keyframes slide { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.finished .item { display: grid; grid-template-columns: 220px 1fr auto; gap: 16px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.finished .item:hover { background: var(--surface); }
.finished .item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finished .item span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- live split ---- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.tabs { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; margin-bottom: 12px; }
.tabs button { background: none; border: 0; padding: 4px 10px; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.tabs button.on { background: var(--raised); color: var(--text); }
.detail { position: sticky; top: 16px; }
.detail h2 { font-size: 20px; line-height: 1.25; margin: 6px 0 8px; }
.meta { display: flex; gap: 14px; color: var(--muted); font-size: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tx { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
.tx li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tx .at { color: var(--muted); font-size: 11px; text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.tx .k { font-size: 11px; color: var(--muted); }
.tx .k b { color: var(--text); font-weight: 600; }
.tx .body { white-space: pre-wrap; word-break: break-word; }
.tx li.thought .body { color: var(--muted); font-style: italic; }
.tx li.error .body { color: var(--negative); }
.tx li.guidance .body { border-left: 2px solid var(--accent); padding-left: 8px; }
.output { margin-top: 16px; }
.md { line-height: 1.6; word-break: break-word; }
.md h1, .md h2, .md h3 { font-size: 15px; margin: 16px 0 6px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md a { text-decoration: underline; text-underline-offset: 2px; color: var(--text); }
.md code { background: var(--raised); padding: 1px 4px; border-radius: 3px; font-size: 12.5px; }
.md pre { background: var(--raised); padding: 10px; border-radius: var(--radius); overflow: auto; }
.md table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { color: var(--muted); font-weight: 600; }
.steer { margin-top: 16px; }

/* ---- approvals ---- */
.appr { padding: 14px 16px; margin-bottom: 12px; }
.appr .k { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.appr .k .ic { width: 14px; height: 14px; }
.appr h3 { margin: 6px 0 2px; font-size: 14px; }
.appr .tgt { color: var(--muted); font-size: 12px; }
.appr .prev { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; white-space: pre-wrap; }
.appr .result { font-size: 12px; color: var(--muted); margin-top: 6px; }
.status-tag { font-size: 11px; border-radius: 4px; padding: 1px 6px; border: 1px solid var(--line); }
.status-tag.sent, .status-tag.approved { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 50%, transparent); }
.status-tag.rejected, .status-tag.failed { color: var(--negative); border-color: color-mix(in srgb, var(--negative) 50%, transparent); }

/* ---- forms page ---- */
.formgrid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; }
.aside h4 { margin: 0 0 4px; font-size: 12px; }
.aside p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.agent-head { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 8px; }
.agent-head .ic { width: 22px; height: 22px; margin-top: 8px; }
.note-line { color: var(--muted); font-size: 12px; margin: 18px 0 12px; }

/* ---- settings ---- */
.set { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.set > div:first-child h2 { margin-bottom: 4px; }
.set > div:first-child p { margin: 0; color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.kv .muted { font-size: 13px; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member .who2 { flex: 1; min-width: 180px; }
.member .who2 small { display: block; color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.conn { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.conn > div { flex: 1; }
.conn small { color: var(--muted); display: block; }
.swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; vertical-align: -2px; margin-right: 6px; }

/* ---- boards ---- */
.board { margin-bottom: 26px; }
.items { width: 100%; border-collapse: collapse; }
.items td, .items th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: middle; }
.items th { color: var(--muted); font-weight: 500; font-size: 12px; }
.items select { width: auto; padding: 4px 8px; }

/* ---- notes ---- */
.note { padding: 14px 16px; margin-bottom: 10px; }
.note .body { white-space: pre-wrap; color: var(--text); margin-top: 6px; max-height: 160px; overflow: hidden; }
.note.open .body { max-height: none; }
.searchbox { position: relative; margin-bottom: 16px; }
.searchbox .ic { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.searchbox input { padding-left: 36px; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: 100%; max-width: 380px; }
.login .framebox { border: 1px solid var(--line); padding: 36px 28px 28px; position: relative; }
.login .framebox h1 { position: absolute; top: -18px; left: -12px; background: var(--bg); padding: 0 12px; margin: 0; }
.login img { max-height: 56px; max-width: 200px; margin-bottom: 26px; display: block; }
.err { color: var(--negative); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---- toast / modal ---- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: var(--radius); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { width: 100%; max-width: 520px; padding: 20px; }

/* ---- locations ---- */
.loc-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.grid.locs { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.loc-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; min-height: 150px; border-top: 3px solid var(--deep, var(--accent)); }
.loc-card:hover { border-color: var(--muted); border-top-color: var(--accent); }
.loc-card p { margin: 6px 0 auto; color: var(--text); }
.loc-top { display: flex; align-items: center; gap: 8px; min-height: 30px; margin-bottom: 6px; }
.brandlogo { display: inline-flex; align-items: center; height: 30px; padding: 3px 6px; border-radius: 4px; }
.brandlogo img { max-height: 24px; max-width: 110px; object-fit: contain; }
.brandlogo.lg { height: 56px; padding: 6px 10px; }
.brandlogo.lg img { max-height: 44px; max-width: 170px; }
.brandlogo.b-bravo { background: #1d1b1a; }
.loc-head { display: flex; gap: 16px; align-items: center; margin: 10px 0 4px; }
.loc-head h1 { margin: 0; }

/* ---- google import ---- */
.modal.wide-modal { max-width: 640px; }
.glist { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.gl { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.gl:last-child { border-bottom: 0; }
.gl small { display: block; color: var(--muted); }
.gl.done { opacity: .6; }
.modal { max-height: 90vh; overflow: auto; }

/* ---- inbox ---- */
.badge.hot, .nav .badge.hot { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }
.run.mail { align-items: flex-start; }
.run.mail .ttl { white-space: normal; font-weight: 400; }
.run.mail .ttl small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prio { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--line); display: inline-block; }
.prio.p-high { background: var(--accent); }
.prio.p-normal { background: var(--muted); }
.tabs .cnt { color: var(--muted); font-size: 11px; margin-left: 2px; }
.ai-note { margin-top: 12px; border-left: 3px solid var(--accent); }
.mailbody { white-space: pre-wrap; word-break: break-word; margin-top: 12px; max-height: 420px; overflow: auto; font-size: 13px; }
.formcols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.formcols label.f { display: flex; flex-direction: column; gap: 6px; }
.powered { font-size: 11px; color: var(--muted); margin-bottom: 10px; letter-spacing: .02em; }

/* ---- reviews ---- */
.stars-sm { color: #E6A700; letter-spacing: 1px; }
.rv-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rv-stat { display: flex; flex-direction: column; padding: 10px 12px; gap: 2px; }
.rv-stat b { font-size: 20px; }
.appr.rv.alert { border-left: 3px solid var(--negative); }
.rv-alert { background: color-mix(in srgb, var(--negative) 10%, transparent); border-left: 3px solid var(--negative); padding: 6px 10px; margin: 8px 0; font-size: 13px; }
.q-review { background: var(--raised); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; white-space: pre-wrap; }

/* light scheme touches */
[data-scheme="light"] .side { background: var(--surface); }
[data-scheme="light"] .card { box-shadow: 0 1px 2px rgba(0,0,0,.04); }
[data-scheme="light"] .nav a.on { color: var(--accent); }
[data-scheme="light"] h1 { color: var(--text); }
[data-scheme="light"] #toast { background: #222; color: #fff; }

/* ---- responsive ---- */
@media (max-width: 1000px) {
  .split, .cols { grid-template-columns: 1fr; }
  .detail { position: static; }
  .formgrid { grid-template-columns: 1fr; gap: 8px; }
  .set { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; background: var(--bg); transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; margin-right: auto; }
  main.page { padding: 20px 16px 60px; }
  .topbar { padding: 10px 16px; }
  .finished .item { grid-template-columns: 1fr auto; }
  .finished .item span { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .formcols { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}

/* ---- departments ---- */
.dept-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.dept-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; min-height: 130px; }
.dept-card:hover { border-color: var(--muted); }
.dept-card .ic { width: 20px; height: 20px; }
.dept-card p { margin: 2px 0 auto; color: var(--text); }
.dept-card [data-dept-live] { display: inline-flex; align-items: center; gap: 6px; }
.dept-grid { margin-top: 18px; }
.standards { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.standards li { margin-bottom: 6px; }
.standards.plain { list-style: none; padding-left: 0; }
.protocol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.protocol li b { display: block; }
.protocol li span { color: var(--muted); font-size: 13px; }
.audit { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.arow { display: grid; grid-template-columns: 90px 110px 1fr auto; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; align-items: baseline; }
.arow:last-child { border-bottom: 0; }
@media (max-width: 700px) { .arow { grid-template-columns: 1fr; gap: 2px; } }

/* ---- CRM pipeline ---- */
.wrap.wider { max-width: 1400px; }
.pos { color: var(--positive); }
.neg { color: var(--negative); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
a.stat:hover { border-color: var(--muted); }
.stat b { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 180px; display: flex; flex-direction: column; }
.kcol.closed { opacity: .75; }
.kcol.over { border-color: var(--accent); }
.khead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.khead b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kbody { display: flex; flex-direction: column; gap: 8px; padding: 8px; flex: 1; }
.kempty { padding: 14px 6px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.deal { display: flex; flex-direction: column; gap: 4px; padding: 10px 11px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); cursor: grab; }
.deal:hover { border-color: var(--muted); }
.deal.dragging { opacity: .4; }
.deal b { font-size: 13px; line-height: 1.3; }
.deal .nx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scroll-x { overflow-x: auto; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--raised); }
.stage-bar { margin-bottom: 14px; gap: 6px; }
.chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.linkcard { display: flex; flex-direction: column; gap: 2px; }
.linkcard:hover { border-color: var(--muted); }
.logf .row input.in { flex: 1; }
.timeline { display: flex; flex-direction: column; margin-top: 10px; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.tl .ic { margin-top: 3px; color: var(--muted); }
.tl > div { display: flex; flex-direction: column; }
.tl a { text-decoration: underline; text-decoration-color: var(--line); }
.formcols .span2 { grid-column: 1 / -1; }

/* ---- Land listings ---- */
.lfilters { display: grid; grid-template-columns: 2fr 1.2fr repeat(4, 1fr) 1.4fr; gap: 8px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.lcard { overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.lcard:hover { border-color: var(--muted); }
.lphoto { position: relative; height: 150px; background: var(--raised); display: grid; place-items: center; color: var(--muted); }
.lphoto img { width: 100%; height: 100%; object-fit: cover; }
.lphoto .ic { width: 34px; height: 34px; opacity: .5; }
.lbadges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.lb { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; background: rgba(0,0,0,.7); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.lb.new { background: #fff; color: #000; }
.lb.drop { background: var(--negative); border-color: var(--negative); }
.lb.crm { background: var(--positive); border-color: var(--positive); }
.star { position: absolute; right: 8px; top: 6px; background: rgba(0,0,0,.55); border: 0; color: #fff; font-size: 17px; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; line-height: 1; }
td .star { position: static; background: none; color: var(--muted); }
.star.on { color: #E0B84C; }
.lbody { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.lprice { font-size: 17px; font-variant-numeric: tabular-nums; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lacts { margin-top: 8px; gap: 6px; }
.lmap-wrap #lmap { height: 68vh; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); }
.leaflet-popup-content { font-family: var(--font); font-size: 13px; }
.leaflet-popup-content a { text-decoration: underline; }
.lhero { width: calc(100% + 40px); margin: -20px -20px 14px; height: 220px; object-fit: cover; display: block; border-radius: var(--radius) var(--radius) 0 0; }
code.blur { filter: blur(5px); user-select: none; }
@media (max-width: 900px) {
  .lfilters { grid-template-columns: 1fr 1fr; }
  .lfilters [data-f="q"] { grid-column: 1 / -1; }
}
.run .ttl small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-bg { z-index: 1100; }
#toast { z-index: 1200; }
@media (max-width: 760px) { .wrap > .row:first-child { flex-wrap: wrap; } .wrap > .row:first-child > .row { margin-top: 0 !important; } }

/* Connections */
.grid.conn-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.conn-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 118px; }
.conn-card:hover { border-color: var(--accent); }
.conn-card .conn-cta { margin-top: auto; color: var(--accent); font-weight: 600; }
.conn-help { background: var(--raised); border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; line-height: 1.5; }
.conn-steps { margin: 6px 0 12px; padding-left: 20px; line-height: 1.5; } .conn-steps li { margin: 3px 0; }
.stage-map { display: grid; gap: 6px; }
.set.solo { grid-template-columns: 1fr; border-bottom: 0; padding-top: 4px; }
.set.solo > div:first-child { display: none; }
.modal pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--raised); padding: 10px; border-radius: 8px; }

/* Home setup checklist */
.setup { margin-bottom: 14px; padding: 14px 16px; }
.setup summary { cursor: pointer; list-style: none; }
.setup summary::-webkit-details-marker { display: none; }
.setup-list { display: grid; gap: 2px; margin-top: 10px; }
.setup-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.setup-item:hover { background: var(--raised); }
.setup-item .dot { flex: none; }
.set.solo.titled > div:first-child { display: block; }
.set.solo.titled + .set.solo.titled { border-top: 1px solid var(--line); padding-top: 18px; }
.setup-item > .small:last-child { white-space: nowrap; }

/* App keys wizard */
.as-steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 14px; }
.as-step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.as-step p { margin: 4px 0 8px; line-height: 1.5; }
.as-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.as-list { display: grid; gap: 4px; margin: 6px 0 8px; }
.copyrow { gap: 6px; min-width: 0; }
.copyrow code { overflow-wrap: anywhere; font-size: 12px; }

/* Voice orb and panel */
.orb { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--raised); display: grid; place-items: center; cursor: pointer; padding: 0; }
.orb .orb-core { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); transition: transform .2s; }
.orb[data-state="connecting"] .orb-core, .orb[data-state="thinking"] .orb-core { animation: orb-pulse 1s ease-in-out infinite; }
.orb[data-state="listening"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.orb[data-state="speaking"] .orb-core { animation: orb-pulse .45s ease-in-out infinite; }
.orb[data-state="error"] .orb-core { background: var(--negative); }
@keyframes orb-pulse { 50% { transform: scale(1.45); } }
.voice-panel { position: fixed; right: 16px; top: 64px; width: min(360px, calc(100vw - 32px)); z-index: 60; padding: 12px 14px; }
.voice-panel .row { gap: 8px; align-items: center; }
.vp-caps { max-height: 240px; overflow-y: auto; margin-top: 6px; }
.vp-caps p { margin: 4px 0; line-height: 1.45; }
.vp-caps p.action { color: var(--muted); font-style: italic; }
.meter { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; margin: 6px 0; }
.meter span { display: block; height: 100%; background: var(--accent); }
