/* Sales Buddy mobile: one phone-first stylesheet. Every color is a token; the dark set is the hub's palette, the light
   set follows the system. Nothing scrolls sideways; the bar and the tabs sit inside the phone's safe areas. */
:root {
  --background: #0d1117; --foreground: #e6edf3;
  --card: #151b23; --card-2: #1c232d; --border: #28303b; --border-2: #333d4a;
  --muted: #b4c0cd; --muted-2: #8b98a8;
  --primary: #3b82f6; --primary-foreground: #ffffff; --ring: rgba(59, 130, 246, .45);
  --success: #22c55e; --warning: #f59e0b; --destructive: #ef4444; --purple: #a855f7; --gold: #e8c96a;
  --success-bg: rgba(34, 197, 94, .14); --warning-bg: rgba(245, 158, 11, .14); --destructive-bg: rgba(239, 68, 68, .14); --purple-bg: rgba(168, 85, 247, .14); --gold-bg: rgba(217, 165, 20, .16);
  --shadow: 0 -8px 30px rgba(0, 0, 0, .45);
  --bar-h: 56px; --tabs-h: 58px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --background: #ffffff; --foreground: #1f2328;
    --card: #f6f8fa; --card-2: #eef1f4; --border: #d8dee4; --border-2: #c6ced6;
    --muted: #57606a; --muted-2: #6e7781;
    --primary: #2563eb; --ring: rgba(37, 99, 235, .35);
    --success: #15803d; --warning: #b45309; --destructive: #b91c1c; --purple: #7e22ce; --gold: #a16207;
    --success-bg: rgba(21, 128, 61, .1); --warning-bg: rgba(180, 83, 9, .1); --destructive-bg: rgba(185, 28, 28, .1); --purple-bg: rgba(126, 34, 206, .1); --gold-bg: rgba(161, 98, 7, .12);
    --shadow: 0 -8px 30px rgba(0, 0, 0, .15);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 15px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.s { font-size: 12px; color: var(--muted); line-height: 1.4; }
.bad { color: var(--destructive); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* sign-in */
#login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; padding-top: max(24px, env(safe-area-inset-top)); }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.login-box label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-box input { height: 46px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--card); padding: 0 12px; font-size: 16px; }
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.login-box .err { min-height: 18px; color: var(--destructive); font-size: 13px; }
.login-box .btn { margin-top: 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: .2px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.hub-gate { font-size: 14px; }

/* the shell */
#app { display: flex; flex-direction: column; height: 100%; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--border); flex: none; }
.bar .icon { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none; color: var(--muted); padding: 0; }
.bar .icon svg { width: 22px; height: 22px; }
.bar .icon.text { width: auto; padding: 0 4px; color: var(--primary); font-weight: 600; display: none; }
body.searching .bar .icon.text { display: inline-flex; }
body.searching .bar #bell, body.searching .bar .chip-me, body.searching .bar #back { display: none; }
.search { position: relative; flex: 1; min-width: 0; }
.search .mag { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
.search input { width: 100%; height: 40px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--background); padding: 0 36px; font-size: 16px; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.search .clear { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted-2); }
.chip-me { flex: none; height: 32px; max-width: 86px; padding: 0 11px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--border); color: var(--foreground); text-decoration: none; font-size: 13px; font-weight: 600; line-height: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#search-panel { position: fixed; inset: 0; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 15; overflow-y: auto; background: var(--background); padding: 6px 8px calc(16px + env(safe-area-inset-bottom)); }
#search-panel .head { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.hit { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'dot name' 'dot sub'; column-gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; }
.hit:last-of-type { border-bottom: 0; }
.hit.hl, .hit:active { background: var(--card); border-radius: 10px; }
.hit .dot { grid-area: dot; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.hit .dot.ok { background: var(--success); } .hit .dot.warn { background: var(--warning); } .hit .dot.bad { background: var(--destructive); }
.hit-name { grid-area: name; font-weight: 650; font-size: 15px; }
.hit-sub { grid-area: sub; font-size: 12.5px; color: var(--muted); }
.hint { padding: 10px; font-size: 12px; color: var(--muted-2); }
#page { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--border); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a.on { color: var(--primary); }
body.searching .tabs { display: none; }

/* blocks */
.hero { padding: 6px 4px 0; }
.hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -.2px; }
.hero p { margin: 4px 0 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px; }
.card p { margin: 0; }
.card.soon { border-style: dashed; }
.rows { display: flex; flex-direction: column; margin: 0 -14px -14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font-size: 15px; min-height: 48px; }
.row b { font-weight: 600; }
.row span { font-size: 13px; }
.row:active { background: var(--card-2); }
.empty { padding: 18px 6px; color: var(--muted-2); text-align: center; font-size: 14px; }
.loading { display: flex; align-items: center; gap: 8px; padding: 18px 6px; color: var(--muted); justify-content: center; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn { height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:disabled { opacity: .55; }
.btn.ghost { background: none; color: var(--primary); }
.mini { height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border-2); background: none; color: var(--foreground); font-size: 12px; font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 38px; padding: 0 13px; border-radius: 19px; border: 1px solid var(--border-2); background: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.links { display: flex; gap: 14px; margin-top: 10px; font-size: 14px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 650; border: 1px solid var(--border-2); color: var(--muted); background: var(--card-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.ok { color: var(--success); background: var(--success-bg); border-color: transparent; }
.chip.warn { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.chip.bad { color: var(--destructive); background: var(--destructive-bg); border-color: transparent; }
.chip.legacy { color: var(--purple); background: var(--purple-bg); border-color: transparent; }
.chip.active { color: var(--success); background: var(--success-bg); border-color: transparent; }
.chip.great { color: var(--gold); background: var(--gold-bg); border-color: transparent; }
.chip.stage { color: var(--foreground); }
.chip.own.confirmed, .chip.own.candidates { color: var(--success); background: var(--success-bg); border-color: transparent; }
.chip.own.located_unconfirmed, .chip.own.needs_full_title, .chip.own.behind_paywall { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.chip.own.likely_stale, .chip.own.not_worth { color: var(--destructive); background: var(--destructive-bg); border-color: transparent; }

/* the 360 header */
.lead-head { display: flex; flex-direction: column; gap: 10px; }
.lead-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.2px; padding: 4px 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.fact { background: var(--card); padding: 10px 12px; min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.fact .k .s { text-transform: none; letter-spacing: 0; font-weight: 600; }
.fact .v { font-size: 15px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.fact .v .s { font-weight: 500; }
.fact .v.warn { color: var(--warning); } .fact .v.ok { color: var(--success); }
.fact .none { color: var(--muted-2); font-weight: 500; }
.team { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 4px; font-size: 14px; }
.team .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin-right: 2px; }
.think { background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.think.warn { border-color: var(--warning); }
.think summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.think summary::-webkit-details-marker { display: none; }
.think summary::after { content: '⌄'; position: absolute; right: 14px; color: var(--muted-2); font-size: 18px; line-height: 1; }
.think { position: relative; }
.think[open] summary::after { content: '⌃'; }
.think .who { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); display: flex; align-items: center; gap: 8px; padding-right: 24px; }
.think .tier { padding: 1px 7px; border-radius: 6px; background: var(--purple-bg); color: var(--purple); letter-spacing: 0; text-transform: none; }
.think .at { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 500; }
.think .head { font-size: 15px; font-weight: 600; line-height: 1.4; padding-right: 20px; }
.think-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.think .stuck { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.think .stuck b { color: var(--foreground); }
.note { padding: 8px 10px; border-radius: 9px; background: var(--card-2); font-size: 13px; }
.note.warn { background: var(--warning-bg); color: var(--warning); }
.note.bad { background: var(--destructive-bg); color: var(--destructive); }
.bq .bk, .drive .bk, .says .sk { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 2px; }
.bq.warn .bv { color: var(--warning); }
.drive { border-left: 3px solid var(--primary); padding-left: 10px; }
.drive .act { font-weight: 600; }
.says { margin-top: 8px; background: var(--card-2); border-radius: 9px; padding: 8px 10px; }
.says .sk { display: flex; align-items: center; justify-content: space-between; }
.says .sv { white-space: pre-wrap; }
.alerts { display: flex; flex-wrap: wrap; gap: 6px; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 6px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; height: 38px; padding: 0 13px; border-radius: 19px; border: 1px solid var(--border-2); background: var(--card); color: var(--foreground); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pill:active { background: var(--card-2); }
.pill .n { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--success-bg); color: var(--success); }
.pill .n.z { background: var(--card-2); color: var(--muted-2); }

/* the sheet */
.sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 88vh; max-height: 88dvh; border: 0; border-radius: 18px 18px 0 0; padding: 0; background: var(--card); color: var(--foreground); box-shadow: var(--shadow); display: none; flex-direction: column; }
.sheet[open] { display: flex; }
.sheet::backdrop { background: rgba(0, 0, 0, .55); }
.sheet-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px 16px; border-bottom: 1px solid var(--border); position: relative; flex: none; }
.sheet-bar .grip { position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border-2); }
.sheet-title { flex: 1; font-size: 16px; font-weight: 700; padding-top: 10px; }
.sheet-bar .icon { width: 36px; height: 36px; margin-top: 8px; border: 0; border-radius: 10px; background: var(--card-2); color: var(--muted); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.item:last-of-type { border-bottom: 0; }
.item summary { list-style: none; cursor: pointer; }
.item summary::-webkit-details-marker { display: none; }
.item .td { font-size: 12px; color: var(--muted-2); }
.item .txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 4px; }
.item .tx { color: var(--muted); font-size: 13px; }
.item .link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; font-size: 15px; text-align: left; }
.item .link:disabled { color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 88%; padding: 8px 11px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.inbound { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 4px; }
.bubble.outbound { align-self: flex-end; background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 4px; }
.bubble .td { font-size: 11px; opacity: .75; margin-bottom: 2px; }
.note-form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.note-form textarea { width: 100%; border: 1px solid var(--border-2); border-radius: 10px; background: var(--background); padding: 9px 11px; font-size: 16px; resize: vertical; min-height: 64px; }
.row-end { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group summary { padding: 10px 0 4px; font-weight: 700; cursor: pointer; }
.field { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field .src { padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; background: var(--card-2); color: var(--muted-2); }
.field .src.auto { color: var(--purple); background: var(--purple-bg); } .field .src.ghl { color: var(--primary); background: var(--card-2); } .field .src.\33 60 { color: var(--success); background: var(--success-bg); }
.field .ok { margin-left: auto; font-size: 11.5px; color: var(--success); }
.field input, .field select, .field textarea { width: 100%; height: 40px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--background); padding: 0 10px; font-size: 16px; }
.field textarea { height: auto; padding: 8px 10px; min-height: 56px; }
.field .checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.field .checks label { font-size: 14px; color: var(--foreground); }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--foreground); color: var(--background); padding: 9px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; max-width: calc(100vw - 32px); }

/* the bell (hub/hub-notify.js) on a phone: the panel is a sheet under the bar, not a desktop dropdown */
#bell { display: inline-flex; }
#bell .notify-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
#bell .notify-btn svg { width: 22px; height: 22px; }
#bell .notify-panel { position: fixed; left: 8px; right: 8px; top: calc(var(--bar-h) + 6px + env(safe-area-inset-top)); width: auto; max-height: 70vh; background: var(--card); border: 1px solid var(--border-2); border-radius: 14px; }
#bell .notify-row { min-height: 48px; }

/* the junior landman view (view-junior.js) */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card-head .state { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.card.now { border-width: 1px; border-left-width: 4px; }
.card.now.working { border-left-color: var(--primary); } .card.now.blocked { border-left-color: var(--warning); } .card.now.ready { border-left-color: var(--primary); } .card.now.done { border-left-color: var(--success); } .card.now.stale { border-left-color: var(--border-2); }
.card.now.working .state { color: var(--primary); } .card.now.blocked .state { color: var(--warning); } .card.now.done .state { color: var(--success); }
.now-head { font-size: 18px; font-weight: 750; letter-spacing: -.1px; }
.now-why { margin-top: 4px; font-size: 14px; line-height: 1.5; }
.now-act { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.now-act .btn { width: 100%; }
.jobs { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.job { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.job.running, .job.queued { color: var(--primary); } .job.failed { color: var(--destructive); }
.card p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.card .chips { margin-top: 8px; padding: 0; }
.pass { margin-top: 2px; padding: 8px 10px; border-radius: 9px; background: var(--card-2); border-left: 3px solid var(--primary); font-size: 13.5px; line-height: 1.5; }
.pass.ok { border-left-color: var(--success); }
.facts.small { margin-top: 10px; }
.facts.small .fact .v { font-size: 14px; }
.next { margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: var(--card-2); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.next .bk { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 2px; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--primary); font-size: 13.5px; font-weight: 600; }
.ev { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.holds { display: flex; flex-direction: column; margin-top: 4px; }
.hold { border-top: 1px solid var(--border); padding: 8px 0; }
.hold summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.hold summary::-webkit-details-marker { display: none; }
.hold summary b { font-size: 14px; }
.hold summary .s, .hold summary .nums { grid-column: 2; }
.hold summary .nums { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hold > .s { margin-top: 4px; padding-left: 2px; }
.card.ask .chat { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-top: 4px; }
.card.ask .m { max-width: 92%; padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.card.ask .m.u { align-self: flex-end; background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 4px; }
.card.ask .m.a { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 4px; }
.card.ask .tools { font-size: 11px; color: var(--muted-2); margin-bottom: 3px; }
.card.ask .chips { margin-top: 10px; }
.card.ask .chips .chip { height: 32px; border-radius: 16px; font-size: 13px; cursor: pointer; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.ask-form textarea { flex: 1; min-width: 0; border: 1px solid var(--border-2); border-radius: 10px; background: var(--background); padding: 9px 11px; font-size: 16px; resize: none; }
.ask-form .btn { height: 44px; }
/* the map under the header: the engine's chrome inside, the note and the resolution under it */
.map-card { padding: 0; overflow: hidden; }
.map-card .card-head { padding: 12px 14px 0; }
.leadmap { height: 300px; width: 100%; background: #0b1220; margin-top: 8px; }
.map-card .mapnote { padding: 8px 14px 12px; line-height: 1.45; }
.map-card .mapnote .warn { color: var(--warning); }
.map-card.big { position: fixed; inset: 0; z-index: 40; border-radius: 0; border: 0; display: flex; flex-direction: column; }
.map-card.big .card-head { padding-top: calc(12px + env(safe-area-inset-top)); }
.map-card.big .leadmap { flex: 1; height: auto; }
.map-card.big .mapnote { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
body.map-big .bar, body.map-big .tabs { display: none; }
.leadmap .mbase { position: absolute; left: 8px; top: 8px; z-index: 6; max-width: calc(100% - 52px); flex-wrap: wrap; }
.leadmap .mbase button { min-height: 30px; }
.leadmap .mctl button { width: 36px; height: 36px; }

/* the senior, broker, rep and setter views */
.price { padding: 10px 12px; border-radius: 10px; background: var(--card-2); margin-top: 8px; }
.price .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.price .v { font-size: 22px; font-weight: 800; letter-spacing: -.2px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.price .s.ok { color: var(--success); } .price .s.warn { color: var(--warning); }
.needs { margin: 4px 0 0; padding-left: 18px; }
.needs li { margin: 2px 0; }
.rows-plain { display: flex; flex-direction: column; margin-top: 4px; }
.rows-plain .item { border-top: 1px solid var(--border); border-bottom: 0; }
.rows-plain .item b { font-size: 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns .btn { flex: 1 1 40%; height: 42px; }
.pick { width: 100%; height: 44px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--background); padding: 0 10px; font-size: 16px; margin: 6px 0 8px; }
.card.now.muted { border-left-color: var(--border-2); }
/* the setter's game */
.card.game { border-left: 4px solid var(--primary); }
.card.game.ready { border-left-color: var(--success); }
.ring { --pct: 0; width: 92px; height: 92px; border-radius: 50%; margin: 6px auto 10px; background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--card-2) 0); display: grid; place-items: center; transition: background .3s; }
.card.game.ready .ring { background: conic-gradient(var(--success) calc(var(--pct) * 1%), var(--card-2) 0); }
.ring-in { width: 72px; height: 72px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ring-in b { font-size: 24px; font-weight: 800; }
.ring-in span { font-size: 11px; color: var(--muted-2); }
.cps { display: flex; flex-direction: column; }
.cp { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); align-items: start; }
.cp .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--primary-foreground); margin-top: 1px; transition: transform .2s, background .2s; }
.cp.lit .dot { background: var(--success); border-color: var(--success); }
.cp.req:not(.lit) .dot { border-color: var(--warning); }
.cp.pop .dot { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.cp-l { font-size: 14px; font-weight: 600; }
.cp-l .s { font-weight: 600; color: var(--warning); }
.cp-v { font-size: 14px; }
.cp.lit .cp-l { color: var(--muted); font-weight: 500; }
.cp-in { display: flex; gap: 6px; margin-top: 6px; }
.cp-in input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--background); padding: 0 10px; font-size: 16px; }
.cp-in .mini { height: 40px; padding: 0 12px; border-radius: 9px; }
.note.ok { background: var(--success-bg); color: var(--success); }

/* ── Buyers (buyers.js): the desk on the phone ── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 10px; }
.tile { border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.tile b { font-size: 20px; color: var(--foreground); line-height: 1.1; }
.tile span { font-size: 11px; text-align: center; line-height: 1.15; }
.tile.on { border-color: var(--primary); color: var(--primary); background: var(--card-2); }
.tile.on b { color: var(--primary); }
.bctl { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.bctl .seg { flex: 1; }
.bctl .seg button { height: 34px; padding: 0 12px; font-size: 13.5px; }
.strip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--muted); font-size: 13.5px; text-align: left; }
.strip b { color: var(--foreground); }
.strip span { flex: 1; }
.strip .chev { flex: none; font-size: 18px; color: var(--muted-2); }
.rank .rb a.plain { color: inherit; text-decoration: none; }
.bgroup { margin: 14px 2px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 6px; align-items: baseline; }
.bgroup span { color: var(--muted-2); font-weight: 600; }
.bcard { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.bcard.you { border-left: 3px solid var(--warning); }
.bc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bc-name { font-size: 16px; font-weight: 700; flex: 1 1 auto; }
.who { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--card-2); color: var(--foreground); white-space: nowrap; }
.who.ns { color: var(--muted-2); font-weight: 600; }
.bflag { font-size: 13.5px; font-weight: 700; }
.bflag.you { color: var(--warning); }
.bflag.needs { color: var(--muted); }
.bflag.wait { color: var(--muted-2); font-weight: 600; }
.bbuyers { display: flex; flex-direction: column; gap: 3px; }
.bb { display: flex; align-items: baseline; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.bb b { font-weight: 650; }
.bb .up { color: var(--success); font-weight: 600; } .bb .dn { color: var(--destructive); font-weight: 600; }
.bb .s { margin-left: auto; }
.bc-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bc-act .btn { height: 38px; font-size: 14px; padding: 0 13px; }
.bfacts { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.bfacts b { color: var(--foreground); font-weight: 600; }
.rank { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rank:last-of-type { border-bottom: 0; }
.rank input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }
.rank .rb { flex: 1; min-width: 0; }
.rank .rb > b { display: block; font-size: 15px; }
.rank .why { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rank-add { display: flex; gap: 6px; margin-top: 6px; }
.rank-add input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--background); padding: 0 10px; font-size: 15px; }
.draft { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 10px; margin-top: 8px; background: var(--card-2); }
.draft summary { list-style: none; padding: 8px 0; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.draft summary::-webkit-details-marker { display: none; }
.draft summary b { flex: 1; }
.draft .field { border-bottom: 0; padding: 4px 0; }
.draft .field input, .draft .field textarea { font-size: 15px; background: var(--card); }
.draft .field textarea { min-height: 180px; }
.mail { padding: 8px 0; border-bottom: 1px solid var(--border); }
.mail:last-of-type { border-bottom: 0; }
.mail .mh { font-size: 12px; color: var(--muted-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.mail .mh b { color: var(--foreground); }
.mail.ours .mh b { color: var(--primary); }
.mail .mb { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 4px; }
.mail .mf { font-size: 12px; color: var(--muted); margin-top: 4px; }
.offer-line { list-style: none; padding: 0; margin: 4px 0 0; }
.offer-line li { padding: 6px 0 6px 12px; border-left: 2px solid var(--border-2); font-size: 13.5px; }
.offer-line li.cur { border-left-color: var(--primary); }
.offer-line .q { color: var(--muted); margin-top: 3px; }
.bsum { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }
.bsum b { color: var(--foreground); }
.sub { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sub > b { grid-column: 1 / -1; }
.sub select, .sub input { height: 36px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--background); padding: 0 8px; font-size: 15px; width: 100%; min-width: 0; }
.sub input.nt { grid-column: 1 / -1; }
.sub .end { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.bhead { display: flex; flex-direction: column; gap: 6px; }
.bhead h1 { font-size: 20px; margin: 0; }
.bhead .top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.neg select { width: 100%; height: 40px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--background); padding: 0 10px; font-size: 16px; margin: 6px 0; }
.sent-ok { color: var(--success); font-weight: 700; }

/* ── Numbers (metrics.js): the home card ── */
.seg.small button { height: 32px; padding: 0 12px; font-size: 13px; }
.metrics { display: flex; flex-direction: column; margin-top: 6px; }
.metric { border-top: 1px solid var(--border); }
.metric summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 11px 0; cursor: pointer; }
.metric summary::-webkit-details-marker { display: none; }
.metric[data-empty] summary { color: var(--muted-2); cursor: default; }
.metric .mn { font-size: 26px; font-weight: 750; min-width: 52px; line-height: 1; }
.metric .ml { flex: 1; font-size: 15px; font-weight: 600; display: flex; flex-direction: column; gap: 1px; }
.metric .ml .s { font-weight: 500; }
.metric .dots { display: flex; gap: 3px; }
.metric .dots i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pies { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 2px 0 12px; }
.pie { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pie svg { width: 92px; height: 92px; transform: rotate(0deg); }
.pie-t { font-size: 12px; color: var(--muted); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 8px; font-size: 12px; color: var(--muted); }
.legend .lg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend .lg b { color: var(--foreground); }
