/* Layout: one dense ranked list under a sticky filter bar, with a company card that
   is a right-hand drawer on a laptop and the whole screen on a phone. */
:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #E9EDF3; --line: #D9DFE8;
  --fg: #131822; --muted: #556072; --faint: #8792A3;
  --accent: #1F4FD8; --accent-soft: #E1E9FD; --band: #C9D7FA;
  --good: #1B7A4C; --good-soft: #DAF0E4; --warn: #8F5200; --warn-soft: #FAEACC;
  --stop: #B3261E; --stop-soft: #FBE2DF; --shadow: 0 12px 40px rgba(19, 24, 34, .14);
  --display: "Archivo", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1117; --surface: #161A22; --surface-2: #1F2530; --line: #2B3340;
    --fg: #E7EBF2; --muted: #9AA5B5; --faint: #6C7686;
    --accent: #86A8FF; --accent-soft: #1B2A4F; --band: #26396B;
    --good: #5FCB97; --good-soft: #143325; --warn: #F0B55C; --warn-soft: #3A2A0D;
    --stop: #FF8E85; --stop-soft: #41191A; --shadow: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--text); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
@media (min-width: 1320px) { body.has-panel .wrap { margin-left: 0; margin-right: 500px; max-width: none; } }

/* Sign-in page */
body.signin { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
body.signin main { max-width: 420px; display: grid; gap: 12px; }
body.signin h1 { font-family: var(--display); font-size: 28px; }
body.signin p { color: var(--muted); }

/* Header */
.top { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; justify-content: space-between; }
.top h1 { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -.01em; line-height: 1.1; }
.sub { color: var(--muted); margin-top: 4px; }
.stats { font-family: var(--data); font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.stats b { color: var(--fg); font-weight: 500; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.me { color: var(--muted); font-size: 12.5px; margin-left: 4px; }

/* Buttons and fields */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-height: 34px; padding: 0 12px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--fg); }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.small { min-height: 26px; padding: 0 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.btn.danger { color: var(--stop); }
.btn[disabled], .field[disabled] { opacity: .5; cursor: not-allowed; }
.field { min-height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 0 10px; min-width: 0; max-width: 100%; }
textarea.field { width: 100%; padding: 8px 10px; resize: vertical; line-height: 1.45; min-height: 70px; }
select.field { cursor: pointer; padding-right: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }

/* Filter bar */
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding: 12px 0; margin-top: 14px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .bar { position: static; } }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.tab { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab .n { font-family: var(--data); font-size: 11.5px; color: var(--faint); margin-left: 5px; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(19, 24, 34, .12); }
.tab.new .n { color: var(--accent); }
#q { flex: 1 1 200px; }

.notice { margin-top: 12px; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 6px; background: var(--surface); color: var(--muted); }
.notice.err { border-left-color: var(--stop); }

/* Ranked list */
.list { container-type: inline-size; margin-top: 10px; }
.head, .row { display: grid; gap: 4px 14px; align-items: center; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.1fr) 150px; grid-template-areas: "name size own sig status"; }
.head { padding: 6px 12px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.head span:last-child { text-align: right; }
.row { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 12px; cursor: pointer; }
.row:hover { background: var(--surface); }
.row[aria-current="true"] { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.c-name { grid-area: name; min-width: 0; }
.c-size { grid-area: size; min-width: 0; }
.c-own { grid-area: own; min-width: 0; color: var(--muted); font-size: 12.5px; }
.c-sig { grid-area: sig; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.c-status { grid-area: status; justify-self: end; text-align: right; display: grid; gap: 4px; justify-items: end; }
.name { font-weight: 600; overflow-wrap: anywhere; display: block; }
.where { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; display: block; }
.size { font-family: var(--data); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.size .how { color: var(--faint); font-family: var(--text); font-size: 11.5px; }
.c-size .band { max-width: 190px; }
.own-note { display: block; color: var(--faint); font-size: 12px; overflow-wrap: anywhere; margin-top: 2px; }
.quiet { color: var(--faint); font-size: 12px; }
.who { font-size: 11.5px; color: var(--faint); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.sig, .pill.working { background: var(--accent-soft); color: var(--accent); }
.pill.contacted, .pill.Medium, .pill.unknown { background: var(--warn-soft); color: var(--warn); }
.pill.talking, .pill.meeting, .pill.ready, .pill.High, .pill.yes { background: var(--good-soft); color: var(--good); }
.pill.dnc, .pill.no { background: var(--stop-soft); color: var(--stop); }
.pill.none, .pill.None, .pill.notready { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); }
@container (max-width: 820px) {
  .head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "size size" "own own" "sig sig"; row-gap: 7px; padding: 13px 4px; }
  .c-status { align-self: start; }
  .c-sig:empty { display: none; }
}
.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--fg); font-family: var(--display); font-size: 17px; margin-bottom: 4px; }

/* Band meter: a log scale from $10M to $1B with the $30M to $250M band shaded */
.band { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.band-zone { position: absolute; top: 0; bottom: 0; left: 23.86%; width: 46.04%; background: var(--band); border-radius: 2px; }
.band-mark { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 1.5px; background: var(--muted); }
.band-range { position: absolute; top: -1px; height: 8px; border-radius: 4px; background: var(--muted); opacity: .85; min-width: 4px; }
.band-mark.in, .band-range.in { background: var(--accent); }
.band-mark.edge, .band-range.edge { background: var(--warn); }
.band.none { background: repeating-linear-gradient(90deg, var(--surface-2) 0 6px, transparent 6px 10px); }
.ticks { position: relative; height: 16px; margin-top: 5px; font-family: var(--data); font-size: 10.5px; color: var(--faint); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks .t0 { left: 0; transform: none; }
.ticks .t1 { left: 23.86%; }
.ticks .t2 { left: 69.9%; }
.ticks .t3 { left: 100%; transform: translateX(-100%); }

.rules { margin-top: 26px; color: var(--muted); max-width: 72ch; }
.rules summary { cursor: pointer; color: var(--fg); font-weight: 500; }
.rules ul { padding-left: 18px; margin: 10px 0; display: grid; gap: 5px; }

/* Company card */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(500px, 100%); z-index: 20; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); overflow-y: auto; overscroll-behavior: contain; padding: calc(16px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) 18px; }
.p-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.p-head h2 { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; text-wrap: balance; }
.p-sub { color: var(--muted); margin-top: 4px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.quick .btn { min-height: 44px; }
@media (max-width: 520px) { .quick { grid-template-columns: 1fr 1fr; } }
.quick .btn.off { color: var(--faint); border-style: dashed; cursor: default; font-weight: 400; }
.banner { margin-top: 14px; padding: 10px 12px; border-radius: 8px; }
.banner b { display: block; }
.banner.dnc { background: var(--stop-soft); color: var(--stop); }
.banner.queued { background: var(--accent-soft); color: var(--fg); display: grid; gap: 8px; }
.banner .row-btns { display: flex; gap: 8px; }
.ready-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.ready-box.ok { border-color: var(--good); background: var(--good-soft); }
.ready-title { font-weight: 600; margin-bottom: 8px; }
.ready-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.ready-box li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; color: var(--muted); }
.ready-box li.ok { color: var(--fg); }
.ready-box li .mark { font-family: var(--data); color: var(--faint); }
.ready-box li.ok .mark { color: var(--good); }
.sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec h3 { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fld { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.fld .field { width: 100%; font-size: 14px; color: var(--fg); }
.fld small { color: var(--faint); }
.form { display: grid; gap: 10px; }
.form .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }
.item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.item-top { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: 12px; }
.owner-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); }
.owner-line b { color: var(--fg); }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: var(--data); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.entry { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.entry .t { font-weight: 600; }
.entry .s { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.entry .l { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; align-items: center; }
.tag { font-size: 11px; font-weight: 500; color: var(--good); margin-left: 6px; }
.checks { display: grid; gap: 6px; margin-top: 12px; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
.check-row .pts { font-family: var(--data); font-size: 12px; color: var(--muted); }
.check-row .nt { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.band-wrap { margin-top: 14px; }
.saved { font-size: 11.5px; color: var(--faint); margin-top: 4px; min-height: 16px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kind { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 34px; padding: 0 13px; cursor: pointer; color: var(--muted); }
.kind[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.touch-form { display: flex; gap: 8px; margin-top: 10px; }
.touch-form .field { flex: 1 1 auto; }
.touches { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.touches li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; }
.touches .meta { font-size: 12px; color: var(--muted); }
.touches .meta b { color: var(--fg); font-weight: 600; }
.touches .txt, .touches .gap { grid-column: 1 / -1; overflow-wrap: anywhere; }
.touches .gap { color: var(--warn); font-size: 12px; }
.note { color: var(--muted); overflow-wrap: anywhere; }
.spaced { margin-top: 8px; }

/* Dialogs */
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); padding: 20px; width: min(460px, calc(100% - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 14, 20, .45); }
dialog h2 { font-family: var(--display); font-size: 19px; margin-bottom: 12px; }
.link-box { display: grid; gap: 6px; padding: 10px; border-radius: 8px; background: var(--accent-soft); overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); z-index: 40; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; max-width: min(92vw, 460px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: slide .16s ease-out; }
  /* Movement only: the card must never be see-through, even if the animation stalls. */
  @keyframes slide { from { transform: translateX(14px); } to { transform: none; } }
}
