/* Creator Studio styles. Brand fonts (Work Sans, Lora), warm white canvas, pastel brand tints as accents,
   dark blue ink for text and buttons (the full-strength brand blue is too light for text). Light + dark, phone first-class. */
@font-face { font-family: 'Work Sans'; src: url('/fonts/WorkSans.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/fonts/Lora.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }

:root {
  --canvas: #f7f5f1; --bg: #ffffff; --bg-hover: #f1efea; --bg-sunken: #faf9f6;
  --border: #e8e4dc; --border-strong: #d4cec3; --text: #16233a; --muted: #5a6577; --faint: #8f97a5;
  --accent: #2b6cc4; --accent-hover: #2159a8; --accent-soft: #e7f2fb; --on-accent: #ffffff;
  --peach: #f08572; --peach-soft: #fbe6df; --yellow-soft: #fcf1d6; --orange-soft: #fbe8d2;
  --danger: #c2372f; --danger-soft: #fdeceA; --warn-bg: #fdf2e0; --warn-text: #8a4b10; --ok: #23824f; --ok-soft: #e3f4ea;
  --sunrise: linear-gradient(135deg, #3c8be8 0%, #7f8be0 34%, #f08572 68%, #ffc94b 100%);
  --shadow-sm: 0 1px 2px rgba(30, 30, 20, .06), 0 1px 1px rgba(30, 30, 20, .03);
  --shadow: 0 10px 30px rgba(30, 35, 50, .12), 0 2px 6px rgba(30, 35, 50, .05);
  --shadow-lg: 0 24px 70px rgba(20, 26, 44, .24), 0 4px 14px rgba(20, 26, 44, .08);
  --radius: 12px; --side-w: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0e1218; --bg: #151a22; --bg-hover: #1f2630; --bg-sunken: #121720;
    --border: #252d39; --border-strong: #354050; --text: #e8ebf0; --muted: #a0a9b8; --faint: #6d7788;
    --accent: #7db0f2; --accent-hover: #9cc3f6; --accent-soft: #19283d; --on-accent: #0b1422;
    --peach: #f39b8a; --peach-soft: #3a2420; --yellow-soft: #352d18; --orange-soft: #3a2a18;
    --danger: #f2837a; --danger-soft: #3b1d1c; --warn-bg: #352919; --warn-text: #f1c38d; --ok: #5cc98d; --ok-soft: #173325;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 10px 30px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 70px rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--text); font: 14.5px/1.5 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font: 600 26px/1.2 'Lora', Georgia, serif; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0; }
h3 { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
p { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.serif { font-family: 'Lora', Georgia, serif; }
.eyebrow { font-style: italic; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .strong { font-weight: 600; }
.spacer { flex: 1; } .grow { flex: 1; min-width: 140px; } .center { text-align: center; } .block { display: block; }
.mt { margin-top: 28px; } .pad { padding: 18px 20px; } .pad-x { padding-left: 14px; padding-right: 14px; }
.pre { white-space: pre-wrap; }
.struck { text-decoration: line-through; color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.icon { flex: none; display: block; }
.danger-text { color: var(--danger); } .ok-text { color: var(--ok); font-weight: 550; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::placeholder { color: var(--faint); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
#root, .app { height: 100%; }
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.main { min-width: 0; height: 100%; overflow-y: auto; outline: none; }
.page { max-width: 1040px; margin: 0 auto; padding: 26px 28px 110px; }
.page.wide { max-width: 1320px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ph-text { min-width: 0; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.splash, .empty { padding: 56px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.big-empty { font-size: 22px; color: var(--text); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; }
.offline { background: var(--warn-bg); color: var(--warn-text); padding: 7px 16px; font-size: 13px; text-align: center; }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; padding: 16px 12px 12px; gap: 2px; min-height: 0; overflow-y: auto; border-right: 1px solid var(--border); background: var(--canvas); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand img { border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; } .brand-text b { font-size: 17px; font-weight: 600; }
.brand-text small { font-size: 11.5px; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px; color: var(--text); min-height: 38px; transition: background .12s; }
.nav-item:hover { background: var(--bg-hover); text-decoration: none; }
.nav-item.on { background: var(--bg); box-shadow: var(--shadow-sm); font-weight: 600; }
.nav-item .icon { color: var(--muted); } .nav-item.on .icon { color: var(--accent); }
.badge { margin-left: auto; background: var(--peach); color: #1d1410; font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 0 7px; min-width: 20px; text-align: center; line-height: 20px; }
.badge.quiet { background: var(--bg-hover); color: var(--muted); }
.mail-state { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 8px 10px; }
.me-box { display: flex; align-items: center; gap: 6px; padding: 8px 6px 4px 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; } .me-text small { color: var(--muted); font-size: 11.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--faint); }
.dot.ok { background: #2fae67; } .dot.warn { background: #f0a530; } .dot.bad { background: var(--danger); } .dot.off { background: var(--faint); }
.scrim, .panel-scrim { display: none; }
.bottom-nav { display: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--bg); font-weight: 550; white-space: nowrap; min-height: 38px; transition: background .12s, transform .06s; color: var(--text); }
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.small { padding: 4px 11px; min-height: 32px; font-size: 13px; }
.btn.link { border-color: transparent; background: none; color: var(--muted); }
.btn.link:hover { color: var(--text); background: var(--bg-hover); }
.btn.danger, .btn.link.danger { color: var(--danger); }
.btn.big { padding: 12px 20px; font-size: 15.5px; min-height: 50px; border-radius: 12px; }
.btn.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.linklike { color: var(--text); font-weight: 600; text-align: left; }
.linklike:hover { color: var(--accent); text-decoration: underline; }
.input { border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 11px; background: var(--bg); width: 100%; min-height: 40px; transition: border-color .12s, box-shadow .12s; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input.big { font-size: 16px; padding: 11px 13px; }
.input.auto { width: auto; }
.input.small { min-height: 32px; padding: 3px 8px; font-size: 13px; }
.input.mono, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.w-num { width: 140px !important; } .w-city { width: 170px !important; }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { padding-right: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 32px; }
.check input, .big-check, td input[type="checkbox"], th input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; flex: none; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.note { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.note.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.note.ok { background: var(--ok-soft); color: var(--text); border-color: transparent; }
.note.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.result-note { justify-content: space-between; align-items: flex-start; flex-wrap: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 20px; font-size: 12px; font-weight: 550; background: var(--bg-hover); color: var(--muted); white-space: nowrap; }
.tag.tiny { font-size: 11px; padding: 0 7px; margin-left: 6px; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
button.tag { cursor: pointer; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--bg-hover); color: var(--muted); white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid2.tight { gap: 10px; }
.span2 { grid-column: span 2; }
.filters { margin-bottom: 12px; }
.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.search-box { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 10px; min-height: 40px; color: var(--muted); background: var(--bg); min-width: 220px; }
.search-box input { border: 0; background: none; outline: none; flex: 1; min-width: 0; color: var(--text); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); font-size: 13px; min-height: 32px; }
.chip-btn small { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip-btn:hover { border-color: var(--border-strong); }
.chip-btn.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); font-weight: 600; }
.dot-s { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; margin-right: 2px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.switch-track { width: 40px; height: 24px; border-radius: 12px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch.on .switch-track { background: var(--ok); } .switch.on .switch-knob { transform: translateX(16px); }
.switch.big { font-size: 18px; } .switch.big .switch-track { width: 60px; height: 34px; border-radius: 17px; } .switch.big .switch-knob { width: 28px; height: 28px; }
.switch.big.on .switch-knob { transform: translateX(26px); }
.stars { display: inline-flex; gap: 2px; } .stars button { color: var(--border-strong); padding: 3px; border-radius: 6px; } .stars button.on { color: #f0a530; } .stars button.on .icon { fill: #f0a530; }
.stars-mini { color: #f0a530; letter-spacing: 1px; }
.tags-input { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; padding: 5px 8px; background: var(--bg); min-height: 40px; }
.tags-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.tags-input input { border: 0; outline: 0; background: none; flex: 1; min-width: 100px; padding: 3px; }
.tags-input .tag { background: var(--accent-soft); color: var(--text); padding-right: 3px; }
.tags-input .tag button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); }
.tags-input .tag button:hover { background: var(--bg-hover); }
.list-editor { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.le-row { display: flex; gap: 6px; width: 100%; }

/* ---------- stage + status colours ---------- */
.stage-candidate { background: var(--bg-hover); color: var(--muted); }
.stage-rejected, .stage-no_show, .stage-no_reply { background: var(--bg-hover); color: var(--faint); }
.stage-shortlisted { background: var(--accent-soft); color: var(--accent); }
.stage-approved { background: color-mix(in srgb, #7f8be0 18%, transparent); color: color-mix(in srgb, #5a64c8 80%, var(--text)); }
.stage-contacted { background: var(--orange-soft); color: var(--warn-text); }
.stage-replied { background: var(--yellow-soft); color: color-mix(in srgb, #9a7000 80%, var(--text)); }
.stage-accepted, .stage-attended { background: var(--ok-soft); color: var(--ok); }
.stage-declined, .stage-cancelled { background: var(--danger-soft); color: var(--danger); }
.stage-bg-candidate { background: #b7bcc6; } .stage-bg-rejected, .stage-bg-no_show, .stage-bg-no_reply { background: #9aa1ad; }
.stage-bg-shortlisted { background: #3c8be8; } .stage-bg-approved { background: #7f8be0; } .stage-bg-contacted { background: #fca248; }
.stage-bg-replied { background: #ffc94b; } .stage-bg-accepted { background: #34b06f; } .stage-bg-attended { background: #1f8a55; }
.stage-bg-declined { background: #e0645a; } .stage-bg-cancelled { background: #f08572; }
.status-active { background: var(--ok-soft); color: var(--ok); } .status-draft { background: var(--bg-hover); color: var(--muted); }
.status-paused { background: var(--warn-bg); color: var(--warn-text); } .status-done, .status-archived { background: var(--bg-hover); color: var(--faint); }
.user-active { background: var(--ok-soft); color: var(--ok); } .user-invited { background: var(--warn-bg); color: var(--warn-text); } .user-disabled { color: var(--faint); }
.cls-accepted { background: var(--ok-soft); color: var(--ok); } .cls-interested { background: var(--accent-soft); color: var(--accent); }
.cls-declined { background: var(--danger-soft); color: var(--danger); } .cls-question { background: var(--yellow-soft); color: color-mix(in srgb, #9a7000 80%, var(--text)); }
.cls-payment { background: var(--peach-soft); color: color-mix(in srgb, #c0503c 85%, var(--text)); } .cls-bounce { background: var(--danger-soft); color: var(--danger); }
.job-done { background: var(--ok-soft); color: var(--ok); } .job-running { background: var(--accent-soft); color: var(--accent); } .job-failed { background: var(--danger-soft); color: var(--danger); } .job-queued { background: var(--warn-bg); color: var(--warn-text); }
.chan { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 5px; flex: none; }
.chan-email { background: var(--accent-soft); color: var(--accent); } .chan-dm { background: var(--peach-soft); color: color-mix(in srgb, #c0503c 85%, var(--text)); }
.initials { display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 650; color: hsl(var(--h) 45% 28%); background: hsl(var(--h) 60% 88%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .initials { color: hsl(var(--h) 60% 85%); background: hsl(var(--h) 30% 25%); } }
.ig { font-size: 13px; color: var(--muted); margin-left: 7px; white-space: nowrap; }
.ig:hover { color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.empty-card { padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--muted); }
.section-head { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.section-head h3 { margin: 10px 0; }
.form-sec { margin-bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.form-sec > h2 { font: 600 19px 'Lora', Georgia, serif; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.tile:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.tile-icon { grid-row: span 3; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.tone-blue .tile-icon { background: var(--accent-soft); color: var(--accent); } .tone-peach .tile-icon { background: var(--peach-soft); color: var(--peach); }
.tone-orange .tile-icon { background: var(--orange-soft); color: #d47a20; } .tone-sky .tile-icon { background: var(--yellow-soft); color: #b98710; }
.tile-value { font-size: 26px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: 13px; } .tile-hint { color: var(--faint); font-size: 12px; }
.tile.zero .tile-value { color: var(--faint); }
.dash-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.mail-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.mail-card:hover { text-decoration: none; border-color: var(--border-strong); }
.mail-card .dot { width: 11px; height: 11px; }
.mail-main { display: flex; flex-direction: column; flex: 1; min-width: 0; } .mail-main small { color: var(--muted); }
.mail-card.tone-warn { background: var(--warn-bg); border-color: transparent; } .mail-card.tone-bad { background: var(--danger-soft); border-color: transparent; }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.project-card { margin-bottom: 14px; overflow: hidden; }
.pc-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 10px; color: var(--text); }
.pc-head:hover { text-decoration: none; } .pc-head:hover h2 { color: var(--accent); }
.pc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-title h2 { font-size: 19px; font-weight: 600; }
.pc-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; padding: 4px 18px 16px; }
.pc-side { display: flex; flex-direction: column; gap: 10px; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.pc-stats a { color: var(--muted); } .pc-stats b { color: var(--text); font-variant-numeric: tabular-nums; }

/* funnel + progress */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; }
.funnel.compact .funnel-row { grid-template-columns: 84px minmax(0, 1fr) 34px; gap: 8px; font-size: 12.5px; }
.funnel-label { color: var(--muted); }
.funnel-bar { height: 10px; background: var(--bg-hover); border-radius: 5px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 5px; transition: width .4s; }
.funnel-num { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.funnel-side { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.funnel-side b { color: var(--text); }
.progress-line { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.progress-top { display: flex; justify-content: space-between; color: var(--muted); } .progress-top b { color: var(--text); font-variant-numeric: tabular-nums; }
.progress-line .bar { height: 8px; border-radius: 4px; background: var(--bg-hover); overflow: hidden; }
.progress-line .bar i { display: block; height: 100%; background: var(--sunrise); border-radius: 4px; transition: width .4s; }
.two-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }

/* activity */
.activity { list-style: none; margin: 0; padding: 6px 16px; }
.activity li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.activity li:last-child { border-bottom: 0; }
.act-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--peach); margin-top: 7px; flex: none; }
.act-main { display: flex; flex-direction: column; min-width: 0; }
.act-text { overflow-wrap: anywhere; }
.pad.small { padding: 12px; }

/* list rows */
.list-card { overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--bg-sunken); text-decoration: none; }
.lr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lr-num { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; min-width: 70px; } .lr-num small { color: var(--muted); font-size: 11.5px; }
.lr-actions { display: flex; gap: 6px; } .lr-seen { min-width: 120px; }
.list-row .icon:last-child { color: var(--faint); }
.small-rows .list-row { padding: 9px 18px; }
details.past { margin-top: 28px; } details.past summary { cursor: pointer; list-style: none; } details.past summary h3 { display: inline; }
details.past summary::before { content: '▸ '; color: var(--faint); } details.past[open] summary::before { content: '▾ '; }
details.past .card { margin-top: 10px; }

/* ---------- project page ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .on { color: var(--text); border-bottom-color: var(--peach); }
.tabs small { color: var(--faint); font-weight: 500; }
.small-tabs { margin-bottom: 12px; }
.filter-row .small-tabs { margin-bottom: 0; border-bottom: 0; }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ov-grid h3:first-child { margin-top: 0; }
.big-line { font-size: 15px; margin: 4px 0 10px; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; margin: 0 0 12px; font-size: 13.5px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.desc { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; white-space: pre-wrap; }
.jobs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.jobs li { display: flex; align-items: center; gap: 10px; }
.job-main { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; } .job-main small { overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { position: sticky; top: 0; background: var(--bg-sunken); text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--bg-sunken); }
.table tr.sel { background: var(--accent-soft); }
.table tr.dnc td { opacity: .6; }
.table tr.expand { cursor: default; background: var(--bg-sunken); } .table tr.expand td { font-size: 13px; } .table tr.expand p { margin: 3px 0; max-width: 80ch; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-check { width: 36px; }
.col-name { min-width: 200px; }
.fit-line { display: block; color: var(--muted); font-size: 12px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.niches { color: var(--muted); max-width: 180px; }
.ellipsis-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { font-weight: 700; padding: 2px 9px; border-radius: 8px; min-width: 36px; text-align: center; background: var(--bg-hover); font-variant-numeric: tabular-nums; }
.score.hi { background: var(--ok-soft); color: var(--ok); } .score.mid { background: var(--yellow-soft); } .score.lo { color: var(--muted); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; }
.bulk-bar { position: fixed; bottom: 20px; z-index: 25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px 12px 10px 18px; max-width: calc(100vw - var(--side-w) - 32px); animation: rise-in .16s ease-out; }
.bulk-bar { left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); transform: translateX(-50%); }
.pc-personal { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; max-width: 720px; }
.pp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.pp-group { display: inline-flex; align-items: center; gap: 6px; }
.skips { margin: 0; padding-left: 18px; max-height: 300px; overflow-y: auto; font-size: 13.5px; }

/* intake */
.intake { display: flex; flex-direction: column; max-width: 940px; }
.rows-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rt-head, .rt-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 120px minmax(0, 1.2fr) 36px; gap: 8px; align-items: center; }
.rows-table.two .rt-head, .rows-table.two .rt-row { grid-template-columns: 180px 180px 36px; }
.rt-head { font-size: 12px; color: var(--muted); font-weight: 600; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 4px; accent-color: var(--accent); }
.radio-card span { display: flex; flex-direction: column; gap: 2px; } .radio-card small { color: var(--muted); font-size: 13px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 0 -4px; background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); justify-content: flex-end; }
.save-bar > .muted { margin-right: auto; }

/* templates */
.tpl-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-list { padding: 6px 0 12px; position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow-y: auto; }
.tpl-group { padding: 2px 6px; }
.tpl-kind { font-size: 12px; color: var(--faint); padding: 8px 8px 3px; font-weight: 600; }
.tpl-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 8px; min-height: 36px; font-size: 13.5px; }
.tpl-item:hover { background: var(--bg-hover); } .tpl-item.on { background: var(--accent-soft); font-weight: 600; } .tpl-item.inactive { opacity: .6; }
.tpl-item .ellipsis { flex: 1; }
.tpl-form { display: flex; flex-direction: column; gap: 14px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ph-chip { font: 12px ui-monospace, 'SF Mono', Menlo, monospace; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); min-height: 28px; }
.ph-chip:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.preview { border-top: 1px solid var(--border); padding-top: 6px; }
.pv-subject { margin: 4px 0 8px; }

/* ---------- messages ---------- */
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; animation: rise-in .16s ease-out; }
.msg-card.sel { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 2px var(--accent-soft); }
.msg-card.focus { box-shadow: 0 0 0 3px var(--peach); }
.msg-card.is-new { border-left: 4px solid var(--peach); }
.msg-head { display: flex; align-items: flex-start; gap: 12px; }
.msg-head .big-check { margin-top: 9px; width: 20px; height: 20px; }
.who { display: flex; gap: 11px; align-items: center; flex: 1; min-width: 0; }
.who-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.who-line { display: flex; align-items: baseline; flex-wrap: wrap; font-size: 15px; }
.who-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.msg-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.msg-line { font-size: 13.5px; margin: 2px 0; overflow-wrap: anywhere; } .msg-line .muted { display: inline-block; width: 64px; }
.msg-line.subject { font-size: 14.5px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; line-height: 1.55; }
.msg-text.clamp { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.small-text { font-size: 13.5px; padding: 9px 12px; }
mark.gap { background: var(--danger-soft); color: var(--danger); font-weight: 700; border-radius: 4px; padding: 0 2px; outline: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.gap-note { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: 13px; font-weight: 550; }
.msg-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.small-actions { font-size: 13px; }
.dm-rule { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--peach-soft); padding: 8px 12px; border-radius: 9px; }
.dm-rule .icon { margin-top: 2px; }
.dm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.summary { display: flex; gap: 8px; align-items: flex-start; font-weight: 550; } .summary .icon { color: var(--peach); margin-top: 3px; }
.reply-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.handle-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.handle-row .chips { margin-bottom: 0; }
.thread { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 10px; }
.thread li { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }
.thread li.th-in { border-left: 3px solid var(--peach); } .thread li.th-out { border-left: 3px solid var(--accent); }
.thread li.st-discarded { opacity: .55; }
.th-meta { font-size: 12.5px; margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.th-subj { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.thread details summary { cursor: pointer; margin-bottom: 4px; }

/* ---------- creator panel ---------- */
.panel-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(14, 18, 28, .3); animation: fade-in .16s; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(720px, 100%); background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow-y: auto; animation: slide-in .2s cubic-bezier(.2, .8, .2, 1); }
.panel-body { padding: 10px 24px 60px; }
.panel-top { display: flex; align-items: center; position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 2; }
.creator-page { margin-top: 10px; } .creator-page .panel-body { padding-top: 18px; }
.cr-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 10px; }
.cr-title { min-width: 0; } .cr-title h1 { font-size: 24px; overflow-wrap: anywhere; }
.cr-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.cr-sub .ig { margin-left: 0; font-size: 13.5px; }
.cr-sec { padding: 4px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.cr-sec:last-child { border-bottom: 0; }
.pc-list, .email-list, .content-list, .simple-list { list-style: none; margin: 0; padding: 0; }
.pc-item { padding: 10px 0; border-bottom: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; }
.pc-item:last-child { border-bottom: 0; }
.pc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.pc-item .pc-personal { background: var(--bg-sunken); }
.notes { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.email-list li, .content-list li, .simple-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); justify-content: space-between; }
.email-list li:last-child, .content-list li:last-child, .simple-list li:last-child { border-bottom: 0; }
.em-main { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.em-act { display: flex; align-items: center; gap: 2px; flex: none; }
.inline-form { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 10px; }
.inline-form h3 { margin-top: 0; }
.bio { font-size: 13.5px; color: var(--muted); white-space: pre-wrap; margin-bottom: 8px; }
.danger-check { color: var(--danger); font-weight: 550; }
.review .grow { min-width: 0; }
.raw { background: var(--bg-sunken); border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }

/* ---------- team + settings ---------- */
.link-box { display: flex; flex-direction: column; gap: 10px; }
.link-row { display: flex; gap: 8px; } .link-row .input { flex: 1; }
.sending { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.send-switch { padding: 14px 18px; border-radius: 14px; background: var(--bg-sunken); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 260px; }
.send-switch.on { background: var(--ok-soft); border-color: transparent; }
.cap-form { display: flex; gap: 8px; align-items: flex-end; }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------- modal, toast, login ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(14, 18, 28, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; animation: fade-in .12s; }
.modal { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; animation: rise-in .16s ease-out; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 4px 22px; }
.modal-head h2 { font: 600 19px 'Lora', Georgia, serif; }
.modal-body { padding: 8px 22px 22px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow); font-size: 14px; font-weight: 500; max-width: calc(100vw - 32px); animation: rise-in .16s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.login { position: relative; min-height: 100%; display: grid; place-items: center; padding: 16px; overflow: hidden; background: var(--canvas); }
.login-glow { position: absolute; inset: -20%; background: radial-gradient(38% 42% at 22% 28%, rgba(60, 139, 232, .32), transparent 70%), radial-gradient(34% 40% at 78% 30%, rgba(240, 133, 114, .3), transparent 70%), radial-gradient(40% 42% at 55% 82%, rgba(255, 201, 75, .3), transparent 70%); filter: blur(30px); }
.login-card { position: relative; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); border: 1px solid var(--border); border-radius: 22px; padding: 36px 32px 28px; width: 100%; max-width: 410px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); animation: rise-in .3s ease-out; }
.login-card img { border-radius: 14px; align-self: center; }
.login-card .eyebrow, .login-card h1 { text-align: center; } .login-card h1 { font-size: 30px; margin-bottom: 2px; }
.login-card > .muted { text-align: center; }
.login-card .btn.big { width: 100%; margin-top: 6px; }

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr; }
  .tpl-layout { grid-template-columns: 240px minmax(0, 1fr); }
}

/* ---------- phones ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .2s ease; padding-top: calc(16px + env(safe-area-inset-top)); border-right: 0; }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(14, 18, 28, .45); animation: fade-in .16s; }
  .nav-item { min-height: 46px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; font-size: 11.5px; color: var(--muted); text-align: center; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .on { color: var(--accent); font-weight: 650; }
  .bn-icon { position: relative; display: grid; place-items: center; }
  .bn-icon .badge { position: absolute; top: -6px; left: 14px; margin: 0; font-size: 10.5px; line-height: 17px; min-width: 17px; padding: 0 5px; }
  .page, .page.wide, .page.narrow { padding: calc(16px + env(safe-area-inset-top)) 14px 40px; }
  h1 { font-size: 23px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; column-gap: 10px; } .tile-icon { width: 36px; height: 36px; } .tile-value { font-size: 22px; }
  .pc-body { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .input, .search-box input, .tags-input input, select.input { font-size: 16px; } /* no iOS zoom on focus */
  .filter-row { gap: 6px; } .filter-row > .input.auto, .filter-row > select { flex: 1 1 140px; }
  .search-box { flex: 1 1 100%; }
  .w-num, .w-city { width: auto !important; flex: 1 1 120px; }
  .table .opt { display: none; }
  .table td, .table th { padding: 10px 8px; }
  .col-name { min-width: 0; }
  .fit-line { max-width: 40vw; }
  .creators-table .num small { display: none; }
  .bulk-bar { left: 8px; right: 8px; transform: none; bottom: calc(70px + env(safe-area-inset-bottom)); max-width: none; padding: 10px; }
  .list-row { gap: 10px; padding: 12px 14px; flex-wrap: wrap; }
  .lr-num, .lr-seen { display: none; }
  .lr-actions { width: 100%; }
  .rt-head { display: none; }
  .rt-row { grid-template-columns: 1fr 1fr 36px; } .rt-row .input:nth-child(2) { grid-column: span 2; order: -1; } .rt-row .input:nth-child(4) { grid-column: span 2; }
  .rows-table.two .rt-row { grid-template-columns: 1fr 1fr 36px; }
  .rt-row { padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
  .tpl-layout { grid-template-columns: 1fr; } .tpl-list { position: static; max-height: none; }
  .msg-card { padding: 14px; }
  .msg-head { flex-wrap: wrap; } .msg-tags { justify-content: flex-start; width: 100%; padding-left: 32px; }
  .dm-card .msg-tags { padding-left: 0; }
  .msg-actions .btn.primary { flex: 1; }
  .dm-steps { grid-template-columns: 1fr; }
  .dm-steps .btn.big { min-height: 54px; }
  .panel { width: 100%; border-left: 0; }
  .panel-body { padding: calc(6px + env(safe-area-inset-top)) 16px 80px; }
  .facts { grid-template-columns: 96px minmax(0, 1fr); }
  .two-progress { grid-template-columns: 1fr; }
  .overlay { padding: 12px 8px; }
  .modal-body { padding: 8px 16px 18px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .save-bar { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .handle-row .btn.primary { width: 100%; }
  .icon-btn { width: 40px; height: 40px; }
}
