/* Helm Sales Tool: the founder's "Ledger" design (plans/design/helm-design). One file, both themes. */

/* --- Tokens: light by default, dark when the system asks for it ------------------------------------------------ */
:root {
  --bg: #F5F3EE; --surface: #FFFFFF; --surface-2: #FAF8F4; --line: #E4DFD5; --line-strong: #CEC7B9;
  --ink: #1E1C19; --ink-2: #4A463F; --ink-3: #6A655B;
  --accent-bg: #1F5F8B; --on-accent: #FFFFFF; --accent-ink: #1A5A85; --accent-soft: #E5EEF5; --accent-line: #B5CDE0;
  --ok: #1D6A39; --ok-soft: #E2F0E5; --ok-line: #A9D3B5;
  --warn: #835500; --warn-soft: #FBF0D3; --warn-line: #E5C46A;
  --bad: #A1271E; --bad-soft: #F9E3DF; --bad-line: #E8ADA6;
  --notice-bg: #F1E7CF; --notice-ink: #3D3112; --notice-line: #DCCB9F;
  --bar: #C2AC80; --bar-hi: #1F5F8B; --track: #EEEAE2;
  --shadow: 0 1px 2px rgba(40,32,20,.07), 0 0 0 1px rgba(40,32,20,.02);
  --menu-shadow: 0 8px 24px rgba(0,0,0,.14);
  --sans: 'Public Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412; --surface: #1F1E1B; --surface-2: #1A1917; --line: #34312C; --line-strong: #4A463F;
    --ink: #EEEBE4; --ink-2: #C7C2B7; --ink-3: #9C968B;
    --accent-bg: #5E9DD2; --on-accent: #0E1822; --accent-ink: #8FBFE6; --accent-soft: #1E2E3B; --accent-line: #34536E;
    --ok: #82CD9A; --ok-soft: #18301F; --ok-line: #2F5A3B;
    --warn: #E9BC62; --warn-soft: #352A12; --warn-line: #6A5322;
    --bad: #F2918A; --bad-soft: #3A1D1A; --bad-line: #6E3330;
    --notice-bg: #2A2416; --notice-ink: #EADCB6; --notice-line: #4D4127;
    --bar: #8C7A55; --bar-hi: #5E9DD2; --track: #2C2A26;
    --shadow: 0 1px 2px rgba(0,0,0,.45);
    --menu-shadow: 0 8px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* --- Base ---------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; color: var(--ink-3); }
a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
code { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 0 4px; border-radius: 4px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* A do-not-call number: still shown, in red, beside its red capsule (founder, Oct 20) */
.mono.dnc { color: var(--bad); }
.dnc-chip { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.quiet { color: var(--ink-3); font-size: 13px; }
.small { font-size: 12px; }
.src { font-size: 12px; color: var(--ink-3); }
.src a { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.only-narrow { display: none; }
.print-only { display: none; }

/* --- Do-not-call notice and top bar (every page) -------------------------------------------------------------- */
.dnc { display: flex; gap: 10px; align-items: flex-start; padding: 9px 24px; background: var(--notice-bg); color: var(--notice-ink);
       border-bottom: 1px solid var(--notice-line); font-size: 13px; line-height: 1.45; }
.dnc svg { flex: 0 0 16px; margin-top: 2px; }
.dnc p { max-width: 1100px; }
.dnc strong { font-weight: 600; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding: 0 24px; min-height: 56px;
          background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.topbar ul a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-2); text-decoration: none; }
.topbar ul a[aria-current=page] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent-bg); }
.who { display: flex; align-items: center; gap: 14px; font-size: 13px; margin: 0; }
.who .person-chip { display: inline-flex; align-items: center; gap: 8px; }
a.person-chip { color: inherit; text-decoration: none; }
a.person-chip:hover strong { text-decoration: underline; }
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
          display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.who .role { color: var(--ink-3); }

/* --- Page frame ---------------------------------------------------------------------------------------------- */
main { max-width: 1440px; margin: 0 auto; padding: 20px 24px 56px; display: flex; flex-direction: column; gap: 20px; }
.crumbs { font-size: 13px; color: var(--ink-3); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.columns { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.columns > .main-col { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.columns > .side-col { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* --- Cards --------------------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
        padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.strong { border-color: var(--line-strong); }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.dashed { background: var(--surface-2); border: 1px dashed var(--line-strong); box-shadow: none; gap: 6px; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; }
.card-head h2 .count { font-weight: 400; color: var(--ink-3); }
.card.flush > .card-head { padding: 16px 20px 12px; }
.card .row { padding: 14px 20px; border-top: 1px solid var(--line); }

/* --- Badges, chips and tags ------------------------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
         font-weight: 600; white-space: nowrap; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2);
         text-decoration: none; width: fit-content; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.badge.stale { background: transparent; color: var(--warn); border: 1px dashed var(--warn-line); }
.badge.sm { font-size: 11.5px; padding: 1px 7px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
       background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); white-space: nowrap; width: fit-content; }
.tag.strong { font-weight: 600; }
.tag.dark { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.tag.outline { background: transparent; border-color: var(--line-strong); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.chip { padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); font-weight: 600; }

/* --- Buttons ------------------------------------------------------------------------------------------------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
       border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500;
       text-decoration: none; white-space: nowrap; }
.btn.primary, button.primary { border-color: var(--accent-bg); background: var(--accent-bg); color: var(--on-accent); font-weight: 600; }
.btn.danger, button.danger { border-color: var(--bad-line); background: var(--surface); color: var(--bad); font-weight: 600; }
.btn.soft, button.soft { background: var(--surface-2); font-weight: 600; }
.btn.lg, button.lg { min-height: 44px; padding: 0 18px; }
.btn.sm, button.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
button:disabled, .btn[aria-disabled=true] { border-style: dashed; background: transparent; color: var(--ink-3); font-weight: 600; }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 500; text-decoration: underline;
              text-decoration-thickness: 1px; text-underline-offset: 2px; }
button.link.quiet { color: var(--ink-3); font-size: 12px; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.refused { font-size: 11.5px; color: var(--bad); font-weight: 600; }

/* A menu that opens from a button (<details class="menu">) */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > .menu-items { position: absolute; right: 0; top: 46px; z-index: 5; margin: 0; padding: 6px; min-width: 260px; list-style: none;
       background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--menu-shadow); font-size: 14px; }
.menu-items button, .menu-items a { width: 100%; justify-content: flex-start; min-height: 40px; padding: 0 10px; border: 0; border-radius: 6px;
       background: transparent; color: var(--ink); font-weight: 400; text-decoration: none; }
.menu-items button:hover, .menu-items a:hover { background: var(--surface-2); }
.menu-items .other { display: flex; flex-direction: column; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); margin-top: 4px; }

/* --- Forms --------------------------------------------------------------------------------------------------- */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  min-height: 38px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; }
textarea { padding: 8px 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field > input, .field > select { font-weight: 400; color: var(--ink); }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; background: var(--surface);
             border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.filterbar .grow { flex: 1 1 260px; }
.filterbar .mid { flex: 1 1 140px; }
.filterbar .zip { flex: 0 1 110px; }
.filterbar input, .filterbar select { width: 100%; min-height: 40px; }
.filterbar .break { flex-basis: 100%; height: 0; }
.filterbar .minrev { flex: 0 1 160px; }
.filterbar .check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; color: var(--ink);
                    cursor: pointer; margin-right: 8px; }
.filterbar .check input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent-bg); }
@media (max-width: 720px) {
  .filterbar > .field { flex: 1 1 100%; }
  .filterbar .check { flex: 1 1 100%; min-height: 32px; }
}
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-rows { display: flex; flex-direction: column; }
.form-row { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 8px 24px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.form-row .label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.form-row .label span { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.money { display: inline-flex; width: fit-content; align-items: center; border: 1px solid var(--line-strong); border-radius: 6px;
         background: var(--surface); overflow: hidden; }
.money > span { padding: 0 10px; color: var(--ink-3); border-right: 1px solid var(--line); min-height: 38px; display: flex; align-items: center; background: var(--surface-2); }
.money input { border: 0 !important; background: transparent !important; width: 130px; text-align: right; font-family: var(--mono); font-size: 15px; }
.money:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.money input:focus-visible { outline: none; }
.checks { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; max-height: 280px; overflow-y: auto;
          display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; }
.checks label { font-size: 14px; white-space: nowrap; min-height: 32px; display: flex; align-items: center; gap: 6px; }

/* Segmented tabs (All · Unclaimed · My claims · My territory) */
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.seg a, .seg label { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 6px; color: var(--ink-2);
       text-decoration: none; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg a[aria-current=page], .seg label:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* --- Alert boxes --------------------------------------------------------------------------------------------- */
.alert { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: baseline; padding: 10px 14px; border-radius: 8px; font-size: 13px;
         background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); }
.alert > .mark { font-weight: 700; color: var(--accent-ink); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.alert.warn > .mark { color: var(--warn); }
.alert.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.alert.bad > .mark { color: var(--bad); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.alert.ok > .mark { color: var(--ok); }
.alert.big { padding: 18px 20px; border-radius: 12px; font-size: 14px; justify-content: space-between; align-items: center; gap: 16px; }

/* --- Number tiles and bars ------------------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { padding: 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.tile .big { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: 12px; color: var(--ink-3); }
.tile.raised { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.tile.raised .big { font-size: 26px; }
.track { display: block; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.track.thin { height: 6px; }
.track > span { display: block; height: 100%; border-radius: 999px; background: var(--bar); }
.track.hi > span { background: var(--bar-hi); }
.track.ink > span { background: var(--ink-2); }
.star-row { display: grid; grid-template-columns: 30px 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.star-row .n { text-align: right; font-weight: 600; }
.comp { display: grid; grid-template-columns: 28px minmax(0, 1.6fr) 58px minmax(80px, 1.4fr) 56px 44px; gap: 10px; padding: 8px; align-items: center;
        font-size: 14px; border-bottom: 1px solid var(--line); }
.comp.head { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 8px; }
.comp.me { border-radius: 6px; background: var(--accent-soft); font-weight: 700; }
.comp.me .track > span { background: var(--bar-hi); }
.comp .r { text-align: right; }

/* --- Lists of facts ------------------------------------------------------------------------------------------- */
dl.facts { margin: 0; display: grid; grid-template-columns: minmax(96px, 160px) 1fr; gap: 8px 14px; font-size: 14px; }
dl.facts dt { color: var(--ink-3); font-size: 13px; }
dl.facts dd { margin: 0; min-width: 0; }
dl.facts.tight { grid-template-columns: 82px 1fr; gap: 4px 10px; }
dl.facts.tight dt { font-size: 12px; padding-top: 2px; }
ul.plain, ol.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
ol.numbered { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.fact .src-tag { font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.fact .src-tag a { color: var(--ink-3); }
.fact form { margin-left: 6px; }
.split { display: flex; justify-content: space-between; gap: 10px; }
blockquote { margin: 0; font-size: 14px; }
figure.quote { flex: 1 1 280px; margin: 0; padding: 12px 14px; border-radius: 8px; display: flex; flex-direction: column; gap: 6px;
               background: var(--surface-2); border: 1px solid var(--line); }
figure.quote figcaption { font-size: 12px; font-weight: 700; }
figure.quote.praise { background: var(--ok-soft); border-color: var(--ok-line); }
figure.quote.praise figcaption { color: var(--ok); }
figure.quote.complaint { background: var(--bad-soft); border-color: var(--bad-line); }
figure.quote.complaint figcaption { color: var(--bad); }
.wrap-row { display: flex; flex-wrap: wrap; gap: 12px; }
.opener { padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--accent-line); background: var(--accent-soft); font-size: 14px;
          display: flex; flex-direction: column; gap: 4px; }
.opener .kicker, .kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.kicker.muted { color: var(--ink-3); }

/* --- Profile ---------------------------------------------------------------------------------------------------- */
.profile-head { gap: 16px; padding: 22px 24px; }
.profile-head .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 24px; align-items: flex-start; }
.profile-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.profile-head .ident { display: flex; flex-direction: column; gap: 8px; flex: 1 1 420px; min-width: 0; }
.profile-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--ink-2); }
.profile-head .control { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; flex: 0 1 auto; }
.profile-head .who-what { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); justify-content: flex-end; align-items: center; }
.profile-head .reach { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.phone { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.phone .mono { font-size: 16px; font-weight: 500; }
.source-boxes { display: flex; flex-wrap: wrap; gap: 12px; }
.source-box { flex: 1 1 200px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
              display: flex; flex-direction: column; gap: 4px; }
.dm-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.dm-name strong { font-size: 19px; font-weight: 700; }
.reach-grid { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.reach-grid > .k { font-size: 12px; color: var(--ink-3); }
.reach-grid > .v { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; }
.reach-grid .mono { font-size: 15px; overflow-wrap: anywhere; }
.struck { text-decoration: line-through; color: var(--ink-3); }
.contact { display: flex; flex-direction: column; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; padding-bottom: 0; }
.people { display: flex; flex-wrap: wrap; gap: 20px; }
.people > .person { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.history li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* --- Queue: a table on wide screens, cards under 720px -------------------------------------------------------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12px;
                font-weight: 600; color: var(--ink-3); white-space: nowrap; }
table.grid td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid th:first-child, table.grid td:first-child { padding-left: 20px; }
table.grid th:last-child, table.grid td:last-child { padding-right: 20px; }
table.grid .r { text-align: right; }
table.grid tr.inactive td { color: var(--ink-3); }
.biz { display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.biz > a, .biz > span > a { font-weight: 600; color: var(--ink); text-decoration: none; }
.biz > a:hover, .biz > span > a:hover { text-decoration: underline; }
.biz .legal { font-size: 12px; color: var(--ink-3); }
.biz .size-line { font-size: 12px; color: var(--ink-3); }
td.c-sen { white-space: nowrap; }
.trades { display: flex; gap: 6px; color: var(--ink-2); }
.claim-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.claim-cell .refused { text-align: right; max-width: 220px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }
.pager .links { display: flex; gap: 14px; }

@media (max-width: 720px) {
  .dnc, .topbar { padding-left: 16px; padding-right: 16px; }
  main { padding: 16px 16px 40px; }
  .only-wide { display: none !important; }
  .only-narrow { display: block; }
  .profile-head { padding: 18px 16px; }
  .profile-head h1 { font-size: 26px; }
  .profile-head .control { align-items: flex-start; }
  .profile-head .who-what { justify-content: flex-start; }
  .card { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  dl.facts:not(.tight) { grid-template-columns: 1fr; gap: 2px; }
  dl.facts:not(.tight) dd { margin-bottom: 6px; }
  /* queue rows become cards */
  .table-card.cards { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.grid.cards, table.grid.cards tbody { display: block; }
  table.grid.cards thead { display: none; }
  table.grid.cards tr { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 16px; margin-bottom: 10px;
       background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
       grid-template-areas: "biz status" "reach reach" "foot claim"; }
  table.grid.cards td { display: block; padding: 0 !important; border: 0; }
  table.grid.cards td.c-biz { grid-area: biz; }
  table.grid.cards td.c-status { grid-area: status; }
  table.grid.cards td.c-reach { grid-area: reach; }
  table.grid.cards td.c-sen { grid-area: foot; align-self: center; font-size: 13px; padding-top: 10px !important; border-top: 1px solid var(--line); }
  table.grid.cards td.c-claim { grid-area: claim; padding-top: 10px !important; border-top: 1px solid var(--line); }
  table.grid.cards td.c-claim button { min-height: 44px; padding: 0 18px; }
  table.grid.cards td.c-trades, table.grid.cards td.c-city, table.grid.cards td.c-metro, table.grid.cards td.c-sdr { display: none; }
  table.grid.cards .card-line { display: block; font-size: 12px; color: var(--ink-3); }
  .pager { padding: 8px 2px; border: 0; }
}
.card-line, .only-narrow-inline { display: none; }
@media (max-width: 720px) { .only-narrow-inline { display: inline; } }

/* --- Region page ------------------------------------------------------------------------------------------------ */
.spend-meter { flex: 0 1 340px; display: flex; flex-direction: column; gap: 6px; }
.spend-meter .split { font-size: 13px; }
.stages { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.stage { flex: 1 1 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
         display: flex; flex-direction: column; min-width: 0; }
.stage > header { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.stage > header h3 { font-size: 17px; font-weight: 650; color: var(--ink); }
.stage > header p { font-size: 13px; color: var(--ink-2); }
.stage ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; flex: 1; }
.stage ol > li { padding: 14px 18px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; border-bottom: 1px solid var(--line); }
.stage ol > li:last-child { border-bottom: 0; margin-top: auto; }
.step { width: 22px; height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 12px;
        font-weight: 700; display: flex; align-items: center; justify-content: center; }
.est { display: flex; gap: 20px; }
.est > span { display: flex; flex-direction: column; }
.est .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.est .v.dim { color: var(--ink-2); font-weight: 600; }
.stage .done-note { padding: 14px 18px; font-size: 13px; color: var(--ink-2); }
.runs td .track { margin-top: 5px; min-width: 90px; }

/* --- Data review and admin ----------------------------------------------------------------------------------- */
.group-actions { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.stacked { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.stacked label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
details.inline-actions summary { cursor: pointer; color: var(--accent-ink); }
details.inline-actions[open] { background: var(--surface-2); padding: 10px; border-radius: 8px; border: 1px solid var(--line); min-width: 280px; }
.login { max-width: 400px; margin: 10vh auto; }
.dev-users { display: grid; gap: 8px; }
.dev-users button { justify-content: space-between; min-height: 48px; }

/* --- Print: the dedicated 2-page view (/accounts/{id}/print) ------------------------------------------------------- */
.sheet { width: 8.5in; height: 11in; margin: 0 auto 24px; padding: 0.42in 0.46in 0.38in; background: #FFFFFF; color: #1E1C19;
         display: flex; flex-direction: column; gap: 10px; overflow: hidden; font-size: 12.5px; line-height: 1.38; box-shadow: var(--shadow); }
.sheet, .sheet * { --surface: #FFFFFF; --surface-2: #FAF8F4; --line: #E4DFD5; --line-strong: #CEC7B9; --ink: #1E1C19; --ink-2: #4A463F;
         --ink-3: #6A655B; --ok: #1D6A39; --bad: #A1271E; --warn: #835500; --warn-line: #E5C46A; --accent-soft: #E5EEF5; --accent-ink: #1A5A85;
         --accent-line: #B5CDE0; --notice-bg: #F1E7CF; --notice-ink: #3D3112; --notice-line: #DCCB9F; --bar: #C2AC80; --bar-hi: #1F5F8B; --track: #EEEAE2; }
.sheet h2 { font-size: 14px; font-weight: 700; }
/* The body clips at the bottom only (what doesn't fit is dropped, lowest priority last); nothing in it shrinks, so the
   Decision-makers card on page 1 is always whole. The footer stays below it. */
.sheet .s-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.sheet .s-body > * { flex-shrink: 0; }
.sheet .s-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.sheet .s-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.sheet .s-dnc { padding: 7px 11px; border: 1px solid var(--notice-line); border-radius: 6px; background: var(--notice-bg); color: var(--notice-ink); font-size: 11px; line-height: 1.38; }
.sheet .s-box { border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.sheet .s-box > .s-title { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.sheet .s-box > .s-person { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); }
.sheet .s-box > .s-person:last-child { border-bottom: 0; }
.sheet .s-sec { display: flex; flex-direction: column; gap: 5px; }
.sheet .s-sec > .split { align-items: baseline; }
.sheet .s-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet .s-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.sheet .s-cell { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 6px; }
.sheet .s-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.sheet .s-tiles .big { font-size: 18px; font-weight: 700; }
.sheet .s-foot > span:last-child { white-space: nowrap; }
.sheet .s-foot { flex-shrink: 0; gap: 16px; display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line-strong); font-size: 11px; color: var(--ink-3); }
.sheet ul { margin: 0; padding-left: 16px; }
.sheet .clip { overflow: hidden; }
.print-bar { display: flex; gap: 10px; justify-content: center; padding: 14px; }

@page { size: letter; margin: 0; }
@media print {
  body { background: #FFFFFF; }
  .dnc, .topbar, .print-bar, .no-print { display: none !important; }
  main { padding: 0; max-width: none; gap: 0; display: block; }
  .sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-of-type { break-after: auto; page-break-after: auto; }
  a { color: inherit; text-decoration: none; }
}

/* --- CRM: summary banner, timeline and its form ------------------------------------------------------------------ */
.summary-card { border-color: var(--accent-line); background: linear-gradient(var(--accent-soft), var(--surface) 70%); }
.tasks .task { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.tasks .due { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tasks .due.late { color: var(--bad); }
.composer { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.composer textarea { width: 100%; font: inherit; }
.composer .field select { max-width: 340px; }
.composer .outcome { display: none; }
.composer .new-person { display: none; }
.composer:has(select[name=person_id] option[value=new]:checked) .new-person { display: flex; }
.composer:has(input[value=call]:checked) .o-call, .composer:has(input[value=email]:checked) .o-email,
.composer:has(input[value=meeting]:checked) .o-meeting { display: flex; }
details.more > summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.timeline { gap: 0; }
.timeline .entry { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.entry-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.entry-head .when { color: var(--ink-3); font-size: 12px; min-width: 150px; }
.entry-note { white-space: pre-wrap; font-size: 14px; }
.entry.kind-claim, .entry.kind-system, .entry.kind-review { opacity: .85; }
.entry.kind-claim .entry-head, .entry.kind-system .entry-head, .entry.kind-review .entry-head { font-size: 12px; }
.said { font-size: 14px; }
@media (max-width: 720px) { .tasks .task { grid-template-columns: 1fr; gap: 4px; } }

/* --- Insights ------------------------------------------------------------------------------------------------------ */
.funnel td .track { min-width: 120px; }

/* --- Top bar search and notifications ------------------------------------------------------------------------------ */
.top-search input { width: 240px; max-width: 100%; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong);
                    border-radius: 999px; background: var(--surface-2); }
.count-pill { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; align-items: center;
              justify-content: center; border-radius: 999px; background: var(--bad); color: var(--surface); font-size: 11.5px; font-weight: 700; }
mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 var(--warn-line); }
.results li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.results li:first-child { border-top: 0; }
.notice-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.notice-list li.unread a { font-weight: 600; }
.notice-list .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 720px) { .top-search, .top-search input { width: 100%; } }

/* --- What they told us (profile) ------------------------------------------------------------------------------------ */
.told li { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); }
.told li:first-child { border-top: 0; }
.told .k { font-size: 12px; color: var(--ink-3); }
.told .quote-line { font-size: 12.5px; color: var(--ink-2); }

/* --- Weekly report ---------------------------------------------------------------------------------------------------- */
.report-sec ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.report-sec li > p { font-size: 15px; line-height: 1.5; }
.report-sec .headline li > p { font-size: 16px; font-weight: 600; }
.evidence summary { cursor: pointer; font-size: 12px; color: var(--accent-ink); margin-top: 4px; }
.evidence ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.evidence li { font-size: 13px; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--ink-2); }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }

/* --- Call panel (opens over the profile) ----------------------------------------------------------------------------- */
.callpanel { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 20px 22px;
             border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--menu-shadow); }
.callpanel::backdrop { background: rgba(20, 16, 10, .45); }
.callpanel fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.callpanel legend { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 0 4px; }
.cp-notice { padding: 10px 12px; border-radius: 8px; background: var(--notice-bg); color: var(--notice-ink); border: 1px solid var(--notice-line); font-size: 13px; font-weight: 600; }
.cp-time { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.cp-person { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.cp-person:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.cp-person input { margin-top: 3px; }
.cp-number { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
.cp-number .mono { font-size: 15px; }
.cp-openers { display: flex; flex-direction: column; gap: 3px; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--accent-line); background: var(--surface); }
.cp-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-buttons label { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-size: 13.5px; background: var(--surface); }
.cp-buttons label.stop { border-color: var(--bad-line); color: var(--bad); }
.cp-buttons input { position: absolute; opacity: 0; pointer-events: none; }
.cp-buttons label:has(input:checked) { background: var(--accent-bg); color: var(--on-accent); border-color: var(--accent-bg); font-weight: 600; }
.cp-buttons label.stop:has(input:checked) { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.cp-buttons label:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.cp-outcomes .f { display: none; }
.cp-outcomes:has(input[value=callback]:checked) .f-callback, .cp-outcomes:has(input[value=meeting]:checked) .f-meeting,
.cp-outcomes:has(input[value=not_now]:checked) .f-not_now, .cp-outcomes:has(input[value=under_contract]:checked) .f-under_contract,
.cp-outcomes:has(input[value=not_fit]:checked) .f-not_fit, .cp-outcomes:has(input[value=stop_person]:checked) .f-stop_person,
.cp-outcomes:has(input[value=stop_company]:checked) .f-stop_company { display: flex; }
.cp-outcomes:has(input[value=no_answer]:checked) .f-fu, .cp-outcomes:has(input[value=voicemail]:checked) .f-fu,
.cp-outcomes:has(input[value=gatekeeper]:checked) .f-fu, .cp-outcomes:has(input[value=bad_number]:checked) .f-fu,
.cp-outcomes:has(input[value=talked]:checked) .f-fu, .cp-outcomes:has(input[value=callback]:checked) .f-fu,
.cp-outcomes:has(input[value=meeting]:checked) .f-fu, .cp-outcomes:has(input[value=stop_person]:checked) .f-fu { display: block; }
.follow-ups { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; }
.follow-ups legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.follow-ups legend .src { font-weight: 400; margin-left: 6px; }
.follow-ups .check .src { margin-left: 6px; }
.follow-ups .fu-rows { display: flex; flex-direction: column; gap: 8px; }
.follow-ups > button.link { align-self: flex-start; }
.callpanel:has(.cp-outcomes input[value=no_answer]:checked) .cp-said, .callpanel:has(.cp-outcomes input[value=voicemail]:checked) .cp-said,
.callpanel:has(.cp-outcomes input[value=bad_number]:checked) .cp-said { display: none; }
@media (max-width: 720px) { .callpanel { padding: 16px; } }

/* --- Do-not-call acknowledgement (first sign-in) ------------------------------------------------------------------ */
.ack-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(20, 16, 10, .45); overflow: auto; }
.ack { width: min(620px, 100%); gap: 16px; box-shadow: var(--menu-shadow); }
.ack h1 { font-size: 20px; }
.ack .dnc { border: 1px solid var(--notice-line); border-radius: 10px; padding: 14px 16px; font-size: 15px; }

/* --- Roles and permissions matrix (Admin) -------------------------------------------------------------------------- */
.matrix th.c, .matrix td.c { text-align: center; min-width: 96px; }
.matrix tr.group th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
.matrix input[type=checkbox] { width: 18px; height: 18px; }

/* Growth and size signals: ↗ growing, $ likely $5M+ (app/size.py; hover explains) */
.sig { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 1; vertical-align: middle; cursor: help; }
.sig + .sig { margin-left: 3px; }
.sig.grow { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.sig.big { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line); }
h1 .sig { width: 26px; height: 26px; font-size: 15px; }
.check .sig { margin-right: 2px; }

/* Deleted timeline entries (leadership's "Show deleted") and an entry's history */
.timeline .entry.deleted { opacity: 0.6; }
.timeline .entry.deleted .entry-note { text-decoration: line-through; }
details.history > summary { cursor: pointer; }
details.history ul { margin: 6px 0 0; padding-left: 0; gap: 6px; }

/* The guided timeline form (app/static/entry_form.js): numbered steps, what's still needed, highlights */
.composer.guided { gap: 14px; }
.guided .form-step { display: flex; flex-direction: column; gap: 8px; }
.guided .form-step + .form-step { border-top: 1px solid var(--line); padding-top: 12px; }
.guided .form-step h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.num-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
           background: var(--accent-bg); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.guided .needed > select, .guided .needed > input, .guided textarea.needed, .guided fieldset.needed { border-color: var(--accent-bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.guided label.needed { color: var(--accent-ink); font-weight: 600; }
.save-row { align-items: center; gap: 12px; flex-wrap: wrap; }
.still { font-size: 13px; color: var(--accent-ink); font-weight: 600; }
.still.ready { color: var(--ok); }
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* Long timeline notes (a pasted transcript): the first 5 lines, then "See more" */
.note-wrap.long:not(.open) .entry-note { max-height: 7.5em; overflow: hidden; line-height: 1.5;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.note-wrap .entry-note { line-height: 1.5; }
@media print { .note-wrap.long .entry-note { max-height: none; -webkit-mask-image: none; mask-image: none; } }
