/* RankEarned portal: Option B "Airy". Tokens and rationale: planning repo docs/design/README.md. */
:root {
  --teal: #0F7B83; --teal-dark: #0B6168; --teal-text: #0B5C62; --teal-soft: #E6F4F5;
  --deep: #062F3C; --gold: #E9A820; --gold-soft: #FDF5E1;
  --ink: #1B1F27; --ink-2: #3F4652; --muted: #5B6270;
  --surface: #F7F8FA; --fill: #F2F4F7; --line: #ECEEF2; --border: #DCE0E6;
  --attn: #FFF1E6; --attn-text: #8A3B0B;
  --radius: 12px; --radius-lg: 16px; --radius-xl: 20px;
}
* { box-sizing: border-box; }
body { margin: 0; background: #FFFFFF; color: var(--ink); font: 15px/1.6 'Onest', ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-text); text-decoration: none; }
a:hover { color: #08464B; text-decoration: underline; text-underline-offset: 3px; }
h1 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 18px; font-weight: 500; }
p { margin: 0; }
.mono { font-family: 'DM Mono', ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-40 { gap: 40px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 380px), 100%), 1fr)); }

/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.tab:hover { background: var(--fill); color: var(--ink); text-decoration: none; }
.tab.on { background: var(--ink); color: #FFFFFF; }
.next { font-size: 11px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--fill); color: var(--muted); line-height: 18px; }
.tab.on .next { background: var(--ink-2); color: #FFFFFF; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-text); font-weight: 600; font-size: 13px; }
.page { max-width: 1040px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 72px; display: flex; flex-direction: column; gap: 32px; }
.page.narrow { max-width: 720px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font: 500 14px/1 'Onest', sans-serif; border: 1px solid var(--border); background: #FFFFFF; color: var(--ink); cursor: pointer; }
.btn:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.btn.pri { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.btn.pri:hover { background: var(--teal-dark); }
.btn.sm { min-height: 36px; padding: 0 14px; }
.btn[disabled] { background: var(--fill); border-color: var(--fill); color: var(--muted); cursor: not-allowed; }
.seg-track { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--fill); }
.seg { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
.seg:hover { text-decoration: none; color: var(--ink); }
.seg.on { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 2px rgba(27, 31, 39, .12); }
.field { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: #FFFFFF; }
.field input { border: 0; outline: none; flex: 1; min-width: 160px; font: 15px 'Onest', sans-serif; color: var(--ink); background: transparent; min-height: 40px; }
input[type=text], textarea { font: 15px 'Onest', sans-serif; color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* labels: told apart by shape (filled, outlined, dashed, struck) */
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.highly_recommended { background: var(--teal-soft); color: var(--teal-text); }
.pill.worth_trying { border: 1px solid var(--teal); color: var(--teal-text); }
.pill.long_shot { border: 1px dashed #9AA0AB; color: #4A505C; }
.pill.rejected { color: var(--muted); text-decoration: line-through; padding: 0; }
.pill.review { background: var(--attn); color: var(--attn-text); }
.pill.waiting { color: var(--muted); padding: 0; }
.pill.won { background: var(--gold); color: var(--ink); font-weight: 600; }

/* surfaces */
.panel { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--surface); }
.card { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.todo { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.todo:hover { text-decoration: none; color: var(--ink); background: var(--fill); }
.count { min-width: 40px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #FFFFFF; color: var(--teal-text); font-weight: 500; }
.notice { padding: 12px 18px; border-radius: 999px; background: var(--fill); font-size: 14px; }
.flash { padding: 12px 18px; border-radius: var(--radius); background: var(--teal-soft); color: var(--teal-text); font-size: 14px; }

/* pipeline stepper */
.stepper { position: relative; }
.stepper::before { content: ""; position: absolute; left: 6px; right: 6px; top: 5px; height: 2px; background: var(--border); }
.steps { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(110px, 100%), 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--ink); }
.step:hover { text-decoration: none; color: var(--ink); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px #FFFFFF; }
.dot.off { background: #FFFFFF; border: 1.5px solid #B8BEC8; }
.dot.gold { background: #FFFFFF; border: 2.5px solid var(--gold); }
.step .big { font-size: 22px; font-weight: 500; line-height: 1.1; }

/* lists */
.item { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 220px); gap: 20px; align-items: start; padding: 18px 16px; border-radius: var(--radius); color: var(--ink); }
.item:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
.dense .item { padding: 8px 16px; gap: 16px; }
.dense .why { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dense .meta { display: none; }
.bar { height: 6px; background: var(--fill); border-radius: 999px; }
.bar > span { display: block; height: 6px; background: var(--teal); border-radius: 999px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.line-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--fill); font-size: 14px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; min-height: 56px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--border); background: #FFFFFF; font: 500 14px 'Onest', sans-serif; color: var(--ink); cursor: pointer; text-align: left; width: 100%; }
.pick:hover { background: var(--surface); }
.pick.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-text); }
.pick .hint { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .item { grid-template-columns: 44px minmax(0, 1fr); }
  .item .contact { grid-column: 2; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
}

/* bar widths in 5% steps (no inline styles under the CSP) */
.w0 { width: 0%; }
.w5 { width: 5%; }
.w10 { width: 10%; }
.w15 { width: 15%; }
.w20 { width: 20%; }
.w25 { width: 25%; }
.w30 { width: 30%; }
.w35 { width: 35%; }
.w40 { width: 40%; }
.w45 { width: 45%; }
.w50 { width: 50%; }
.w55 { width: 55%; }
.w60 { width: 60%; }
.w65 { width: 65%; }
.w70 { width: 70%; }
.w75 { width: 75%; }
.w80 { width: 80%; }
.w85 { width: 85%; }
.w90 { width: 90%; }
.w95 { width: 95%; }
.w100 { width: 100%; }

/* grid minimum column widths (no inline styles under the CSP) */
.g150 { --min: 150px; } .g170 { --min: 170px; } .g380 { --min: 380px; } .g420 { --min: 420px; }
.gap-40 { gap: 40px; }
.lead { font-size: 19px; line-height: 1.55; max-width: 68ch; text-wrap: pretty; }
.big { font-size: 20px; font-weight: 500; line-height: 1.2; }
.grow { flex: 1 1 auto; min-width: 80px; }
.grow-label { width: 140px; }
input.field { border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; min-height: 44px; }
.pill.worth_trying.kw { font-weight: 400; }

/* client report */
.headline { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); }
.stat.zero .big { color: var(--muted); }
.stat.win { background: var(--gold); color: var(--ink); }
.line-row-stack { padding: 10px 0; border-bottom: 1px solid var(--fill); }
.plain { margin: 0; padding-left: 20px; }
.report footer { padding-top: 16px; border-top: 1px solid var(--line); }
textarea.card { font: 15px/1.5 'Onest', sans-serif; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; }

/* Guard: kill switch */
.halt { padding: 12px clamp(16px, 4vw, 40px); background: var(--attn); color: var(--attn-text); font-size: 14px; }
.btn.danger { border-color: var(--attn-text); color: var(--attn-text); }
.btn.danger:hover { background: var(--attn); color: var(--attn-text); }
.num { min-width: 92px; text-align: right; }
.up { color: var(--teal-text); font-weight: 500; }

/* Desk */
.mailcard { max-width: 720px; }
.mail { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.6 'Onest', sans-serif; color: var(--ink); }
.mail.tiny { font-size: 13px; }
.mail-edit { font: 15px/1.6 'Onest', sans-serif; min-height: 280px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 120px; }
.halt-inline { padding: 10px 14px; border-radius: var(--radius); background: var(--attn); color: var(--attn-text); font-size: 14px; }
details summary { cursor: pointer; }
