/* CDC Desk — tokens from compounddigitalco.com styles.css. System fonts only, no external requests. */
:root {
  --navy: #152436;
  --navy-deep: #0e1826;
  --navy-2: #24364d;
  --ink: #152436;
  --slate: #4a5568;
  --slate-soft: #5c6b7a;
  --paper: #f5f2ec;
  --paper-2: #ebe6dc;
  --white: #fff;
  --accent: #c56a32;
  --accent-dark: #9e4e22;
  --accent-soft: #d27a42;
  --line: rgba(21, 36, 54, 0.12);
  --line-strong: rgba(21, 36, 54, 0.22);
  --serif: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ok: #1e7a4f; --ok-bg: #e3f3ea;
  --warn: #8a5a00; --warn-bg: #fff4d6;
  --bad: #a3302a; --bad-bg: #fbe7e5;
  --info: #1f4f7a; --info-bg: #e5eef7;
  --r: 14px; --r-s: 10px;
  --shadow: 0 1px 2px rgba(14, 24, 38, .06), 0 6px 20px rgba(14, 24, 38, .06);
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--slate); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 80% at 50% 0%, #24364d, var(--navy) 55%, var(--navy-deep)); color: var(--paper); }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-lockup { width: auto; height: 52px; max-width: 240px; margin: 0 auto 18px; display: block; }
.login h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; font-size: 32px; margin: 0 0 6px; color: var(--paper); }
.login p.sub { color: rgba(245, 242, 236, 0.72); margin: 0 0 26px; }
.login form { background: rgba(245, 242, 236, 0.06); border: 1px solid rgba(245, 242, 236, 0.14); border-radius: var(--r); padding: 20px; text-align: left; }
.login label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.login input { width: 100%; padding: 14px; border-radius: var(--r-s); border: 1px solid rgba(245, 242, 236, 0.25); background: rgba(14, 24, 38, 0.5); color: #fff; font-size: 17px; }
.login .btn { width: 100%; margin-top: 14px; }
.login .err { color: #ffb4ab; font-size: 14px; min-height: 20px; margin-top: 10px; }
.login .fine { color: rgba(245, 242, 236, 0.6); font-size: 13px; margin-top: 18px; }

/* ---------- Shell ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: var(--paper); border-bottom: 3px solid var(--accent); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: 1 1 auto; min-width: 0; }
.brand img { height: 36px; width: auto; max-width: 180px; flex: none; }
.brand .word { min-width: 0; }
.brand b { font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: -0.02em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: rgba(245, 242, 236, 0.65); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.tabs-top { display: none; gap: 4px; }
.tabs-top a, .tabs-bottom a { text-decoration: none; color: rgba(245, 242, 236, 0.7); font-weight: 600; }
.tabs-top a { padding: 9px 14px; border-radius: 999px; font-size: 15px; }
.tabs-top a[aria-current="page"] { background: rgba(197, 106, 50, 0.2); color: #f0c4a4; }
.tabs-top a:hover { color: #fff; }
.signout { background: none; border: 1px solid rgba(245, 242, 236, 0.25); color: var(--paper); border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; flex: none; }
.tabs-bottom { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--navy); border-top: 1px solid rgba(245, 242, 236, 0.12); padding-bottom: env(safe-area-inset-bottom); }
.tabs-bottom a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; padding: 9px 0 10px; min-height: var(--nav-h); justify-content: center; }
.tabs-bottom a svg { width: 22px; height: 22px; }
.tabs-bottom a[aria-current="page"] { color: #f0c4a4; }
.badge-dot { background: var(--accent); color: var(--navy-deep); border-radius: 999px; font-size: 10.5px; font-weight: 800; padding: 0 6px; margin-left: 4px; }
main.view { max-width: 1180px; margin: 0 auto; padding: 16px 14px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
h2.page { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -0.02em; margin: 6px 0 2px; color: var(--navy); }
p.lede { margin: 0 0 16px; color: var(--slate); }

/* ---------- Bits ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 700; text-decoration: none; transition: background 0.2s var(--ease); }
.btn-accent { background: var(--accent); color: var(--navy-deep); }
.btn-accent:hover { background: var(--accent-soft); }
.btn-navy { background: var(--navy); color: var(--paper); }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line-strong); color: var(--navy); border-radius: 999px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { background: #f8e4d4; color: #8a3e14; }
.st-contacted { background: var(--info-bg); color: var(--info); }
.st-proposal { background: #ece6fb; color: #5a3c9e; }
.st-won { background: var(--ok-bg); color: var(--ok); }
.st-lost { background: #eceae5; color: #5f5a50; }
.chip { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; background: var(--paper-2); color: var(--navy); margin: 0 4px 4px 0; }
.chip-urgent { background: var(--bad-bg); color: var(--bad); }
.chip-soon { background: var(--warn-bg); color: var(--warn); }
.tag-sample { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); border: 1px dashed #d9a400; vertical-align: middle; }
.alert { border-radius: var(--r-s); padding: 12px 14px; margin-bottom: 14px; font-size: 14.5px; border: 1px solid; }
.alert b { display: block; margin-bottom: 2px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-warn { background: var(--warn-bg); border-color: #f0d48a; color: #5c3d00; }
.alert-bad { background: var(--bad-bg); border-color: #efc1bc; color: #6f1f1a; }
.alert-info { background: var(--info-bg); border-color: #c3d6ea; color: #173a5c; }
.muted { color: var(--slate); }
.small { font-size: 13.5px; }
.empty { text-align: center; padding: 40px 16px; color: var(--slate); }

/* ---------- Inbox / mail list ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1.5px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--slate); }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.filters button .n { opacity: .7; margin-left: 4px; font-weight: 500; }
.search { width: 100%; padding: 12px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line-strong); background: #fff; }
.req-list, .mail-list { display: grid; gap: 10px; }
.req, .mail { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); position: relative; }
.req:hover, .mail:hover { border-color: var(--accent); }
.req.is-new, .mail.is-unread { border-left: 5px solid var(--accent); }
.req-top, .mail-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.req-name, .mail-from { font-weight: 800; font-size: 17px; }
.req-meta, .mail-meta { color: var(--slate); font-size: 13.5px; margin: 2px 0 8px; }
.mail-sub { font-weight: 700; margin: 0 0 4px; }
.mail-snip { color: var(--slate); font-size: 14px; margin: 0; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }

/* ---------- Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; color: var(--accent-dark); margin: 4px 0 8px; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.detail-head h2 { margin: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; margin: 0; }
.kv dt { color: var(--slate); font-size: 13px; font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.message, .mail-body, .draft { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; margin: 0; }
.notes { width: 100%; min-height: 110px; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-s); resize: vertical; }
.status-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.status-row button { border: 1.5px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--slate); text-transform: capitalize; }
.status-row button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.sec-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); margin: 14px 0 6px; }
.ai-sum { margin: 0 0 10px; font-size: 16px; }
.tidy, .qs, .assume { margin: 0; padding-left: 18px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.pending { display: flex; align-items: center; gap: 10px; color: var(--slate); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--paper-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.next-step { background: var(--paper); border-left: 4px solid var(--accent); border-radius: var(--r-s); padding: 12px 14px; margin: 8px 0; }

/* ---------- Overview ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--slate); font-weight: 700; }
.stat .v { font-family: var(--serif); font-weight: 500; font-size: 30px; color: var(--navy); line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.stat .v.sm { font-size: 22px; }
.stat .s { font-size: 12.5px; color: var(--slate); }
.stat.hero { grid-column: 1 / -1; background: var(--navy); color: var(--paper); border-color: var(--navy); }
.stat.hero .k { color: rgba(245, 242, 236, 0.65); }
.stat.hero .v { color: #f0c4a4; font-size: 34px; }
.stat.hero .s { color: rgba(245, 242, 236, 0.65); }
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 14px; }
.bar .lbl { text-transform: capitalize; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 12px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; background: var(--accent); min-width: 4px; }
.bar .fill.f-new { background: var(--accent); }
.bar .fill.f-contacted { background: #3d77ad; }
.bar .fill.f-proposal { background: #7b5cc4; }
.bar .fill.f-won { background: var(--ok); }
.bar .fill.f-lost { background: #a39d91; }
.bar .cnt { text-align: right; font-weight: 800; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { text-decoration: none; color: inherit; display: block; }
.recent-list .nm { font-weight: 700; }

/* ---------- Settings ---------- */
.set-sec { margin-bottom: 14px; }
.pkg-row { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pkg-row:last-child { border-bottom: 0; }
.pkg-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line-strong); border-radius: 9px; background: #fff; font-size: 16px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input.is-example, .field textarea.is-example { border-style: dashed; border-color: #d9a400; background: #fffaf0; }
.field .hint { font-size: 12px; color: var(--slate); margin-top: 4px; }
.savebar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy); color: var(--paper); border-radius: var(--r); padding: 10px 10px 10px 16px; box-shadow: 0 10px 30px rgba(14, 24, 38, .25); }
.savebar span { font-size: 14px; }
.confirm-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }

/* ---------- Log ---------- */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log .act { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.log .when { color: var(--slate); font-size: 12.5px; white-space: nowrap; }
.log .det { grid-column: 1 / -1; color: var(--slate); font-size: 13px; overflow-wrap: anywhere; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--navy-deep); color: #fff; padding: 11px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.notfound { padding: 20vh 20px; text-align: center; }

/* ---------- Desktop ---------- */
@media (min-width: 820px) {
  :root { --nav-h: 0px; }
  .tabs-bottom { display: none; }
  .tabs-top { display: flex; }
  .brand { flex: 0 1 auto; margin-right: auto; }
  .brand img { height: 40px; max-width: 220px; }
  main.view { padding: 24px 24px 48px; }
  h2.page { font-size: 36px; }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .search { max-width: 320px; }
  .req-list, .mail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat.hero { grid-column: span 2; }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  .savebar { bottom: 16px; }
  #toast { bottom: 28px; }
}
@media (min-width: 1100px) {
  .req-list, .mail-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  #toast { transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- First-login tour ---------- */
#tour-root { position: static; }
.tour-card { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: #fff; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r); box-shadow: 0 16px 50px rgba(14, 24, 38, .28); padding: 14px 16px; max-height: min(48vh, 380px); overflow: auto; }
.tour-card:focus, .tour-card:focus-visible { outline: none; }
.tour-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.tour-step { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.tour-skip { background: none; border: 0; color: var(--slate); font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px 4px; }
.tour-skip:hover { color: var(--navy); }
.tour-card h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -0.02em; text-transform: none; color: var(--navy); }
.tour-card p#tour-body { margin: 0 0 12px; font-size: 15px; color: var(--ink); }
.tour-dots { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 0 0 12px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: #d9d2c3; }
.tour-dots span.done { background: #c8b98a; }
.tour-dots span.on { width: 16px; border-radius: 99px; background: var(--navy); }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tour-spotlight { position: relative; z-index: 25; outline: 3px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 8px rgba(197, 106, 50, .28), var(--shadow); border-radius: var(--r-s); }
header.top .tour-spotlight, .signout.tour-spotlight { outline-color: var(--accent); box-shadow: 0 0 0 6px rgba(197, 106, 50, .4); border-radius: 999px; }
.tour-ex-wrap { display: grid; gap: 6px; }
.tour-ex-label { margin: 8px 0 0; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.req.is-example, .mail.is-example { border-style: dashed; border-color: #d9a400; background: #fffaf0; }
.tour-replay { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--r-s); padding: 10px 12px; margin-bottom: 14px; }
.tour-replay p { margin: 0; }
body.tour-on { overflow: hidden; }
body.tour-on #app { pointer-events: none; }
body.tour-on .savebar { visibility: hidden; }
body.tour-on #tour-root, body.tour-on .tour-card { pointer-events: auto; }
body.tour-on main.view { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 320px); }
.tour-spotlight { scroll-margin-top: 88px; scroll-margin-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 300px); }
@media (min-width: 820px) {
  .tour-card { left: 50%; right: auto; width: 420px; bottom: 28px; transform: translateX(-50%); max-height: min(46vh, 400px); }
}
@media (prefers-reduced-motion: reduce) {
  .tour-spotlight { transition: none; }
}
