/* site OS — design system. Plain CSS, no build step. */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --border: #e4e7ee;
  --border-strong: #d3d8e2;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8391a7;
  --primary: #0b5fe8;
  --primary-600: #0847b8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --green: #059669;   --green-bg: #ecfdf5;  --green-bd: #a7f3d0;
  --amber: #b45309;   --amber-bg: #fffbeb;  --amber-bd: #fde68a;
  --red: #dc2626;     --red-bg: #fef2f2;    --red-bd: #fecaca;
  --blue: #2563eb;    --blue-bg: #eff6ff;   --blue-bd: #bfdbfe;
  --gray-bg: #f1f5f9; --gray-bd: #e2e8f0;
  --sidebar: #040b22;
  --sidebar-2: #0a1535;
  --sidebar-text: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --surface: #111827;
    --surface-2: #0f1522;
    --surface-3: #1a2233;
    --border: #1f2a3d;
    --border-strong: #2b3850;
    --text: #e5e9f2;
    --text-2: #a6b0c3;
    --text-3: #6b778d;
    --primary: #4da3ff;
    --primary-600: #8cc4ff;
    --primary-50: rgba(77, 163, 255, .10);
    --primary-100: rgba(77, 163, 255, .18);
    --green: #34d399;  --green-bg: rgba(52, 211, 153, .10);  --green-bd: rgba(52, 211, 153, .25);
    --amber: #fbbf24;  --amber-bg: rgba(251, 191, 36, .10);  --amber-bd: rgba(251, 191, 36, .25);
    --red: #f87171;    --red-bg: rgba(248, 113, 113, .10);   --red-bd: rgba(248, 113, 113, .25);
    --blue: #60a5fa;   --blue-bg: rgba(96, 165, 250, .10);   --blue-bd: rgba(96, 165, 250, .25);
    --gray-bg: rgba(148, 163, 184, .10); --gray-bd: rgba(148, 163, 184, .2);
    --sidebar: #030814;
    --sidebar-2: #07102a;
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text);
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .wm b { font-weight: 800; letter-spacing: -.03em; }
.brand .wm i { font-style: normal; font-weight: 800; letter-spacing: -.03em; color: #38bdf8; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-text); letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5b6b85; padding: 16px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; text-decoration: none; }
.nav a.active { background: rgba(10, 172, 252, .16); color: #fff; box-shadow: inset 2px 0 0 #0aacfc; }
.nav a .count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.08); padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 12px; }
.sidebar-foot strong { color: #e2e8f0; display: block; font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.content { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.crumbs { font-size: 12px; color: var(--text-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-3); }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 560px; }
.search svg.icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search input {
  width: 100%; height: 38px; padding: 0 64px 0 36px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
  box-shadow: var(--shadow-sm);
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); }
.search-results:empty { display: none; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto;
}
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.focused { background: var(--surface-3); text-decoration: none; }
.search-results .kind { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.search-results .empty-line { padding: 14px; color: var(--text-3); text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(11, 95, 232, .3), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #0b0f19; } }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red-bd); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 30px; padding: 0; }
.btn[disabled], .btn.htmx-request { opacity: .6; pointer-events: none; }
.btn-block { width: 100%; height: 42px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-head .count { font-size: 11px; color: var(--text-3); font-weight: 600; background: var(--surface-3); padding: 1px 8px; border-radius: 99px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1180px) { .grid-main, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi::after { content: ""; position: absolute; inset: auto -30px -40px auto; width: 110px; height: 110px; border-radius: 50%; background: var(--primary-50); }
.kpi.green::after { background: var(--green-bg); }
.kpi.amber::after { background: var(--amber-bg); }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--border); }
.kpi-strip > div { padding: 14px 20px; border-right: 1px solid var(--border); }
.kpi-strip > div:last-child { border-right: 0; }
.kpi-strip .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.kpi-strip .value { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- Badges, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bd); }
.badge-green { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.badge-amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-bd); }
.badge-red { color: var(--red); background: var(--red-bg); border-color: var(--red-bd); }
.badge-gray { color: var(--text-2); background: var(--gray-bg); border-color: var(--gray-bd); }
.badge-violet { color: var(--primary); background: var(--primary-50); border-color: var(--primary-100); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; background: var(--surface-3); color: var(--text-2); font-weight: 500; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #0158f1, #002b80);
  box-shadow: 0 0 0 2px var(--surface);
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.c1 { background: linear-gradient(135deg, #0aacfc, #0158f1); }
.avatar.c2 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.avatar.c3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.avatar.c4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .title { font-weight: 600; color: var(--text); }
.table a.title:hover { color: var(--primary); text-decoration: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-text { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px;
  border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.input.sm, .select.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238391a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.input-group { position: relative; }
.input-group .prefix, .input-group .suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }
.input-group .prefix { left: 12px; }
.input-group .prefix + .input { padding-left: 26px; }
.input-group .suffix { right: 12px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--red); }
.field-error { font-size: 12px; color: var(--red); font-weight: 500; }
.form-error { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--red-bg); border: 1px solid var(--red-bd); color: var(--red); font-weight: 500; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; color: var(--text); }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
fieldset { border: 0; padding: 0; margin: 0; }
details.disclosure > summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--primary); font-size: 13px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: 14px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; padding: 0 12px; border-top: 1px solid var(--border); overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 12px; color: var(--text-2); font-weight: 600; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 6px; border-radius: 99px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; gap: 2px; }
.segmented a { padding: 5px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Deal header ---------- */
.deal-hero { margin-bottom: 20px; overflow: hidden; }
.deal-hero .top { display: flex; justify-content: space-between; gap: 18px; padding: 22px 22px 18px; flex-wrap: wrap; }
.deal-hero h1 { font-size: 26px; }
.deal-hero .meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--text-2); font-size: 13px; align-items: center; }
.deal-hero .meta > span { display: inline-flex; align-items: center; gap: 6px; }
.stage-track { display: flex; gap: 4px; padding: 0 22px 18px; }
.stage-track button {
  flex: 1; min-width: 0; height: 30px; border: 0; cursor: pointer;
  background: var(--surface-3); color: var(--text-3);
  font: inherit; font-size: 11.5px; font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
  padding: 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .15s, color .15s;
}
.stage-track button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stage-track button.done { background: var(--primary-100); color: var(--primary); }
.stage-track button.current { background: var(--primary); color: #fff; }
@media (prefers-color-scheme: dark) { .stage-track button.current { color: #0b0f19; } }
.stage-track button:hover:not(.current) { background: var(--primary-50); color: var(--primary); }
.stage-track button[disabled] { cursor: default; }

/* ---------- Kanban board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--surface-3); border-radius: 14px; padding: 10px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; transition: background .15s, box-shadow .15s; }
.column.drag-over { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; }
.column-head h3 { font-size: 13px; display: flex; gap: 8px; align-items: center; }
.column-head .total { font-size: 12px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.column-head .n { font-size: 11px; background: var(--surface); padding: 0 7px; border-radius: 99px; color: var(--text-2); }
.deal-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px; color: var(--text); box-shadow: var(--shadow-sm); cursor: grab;
  transition: box-shadow .12s, transform .12s, border-color .12s;
}
.deal-card:hover { text-decoration: none; box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.deal-card.dragging { opacity: .45; transform: rotate(1.5deg); }
.deal-card .name { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.deal-card .price { font-weight: 700; font-size: 15px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.deal-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; }
.column .empty-drop { border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 18px 10px; text-align: center; color: var(--text-3); font-size: 12px; }

/* ---------- Bars / charts ---------- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .name { color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0158f1, #0aacfc); min-width: 2px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.green > span { background: linear-gradient(90deg, #10b981, #34d399); }
.bar.amber > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.red > span { background: linear-gradient(90deg, #ef4444, #f87171); }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-step { display: grid; grid-template-columns: 170px 1fr 120px; gap: 12px; align-items: center; }
.funnel-step .shape { height: 34px; border-radius: 8px; background: linear-gradient(90deg, #0158f1, #0aacfc); display: flex; align-items: center; padding: 0 12px; color: #fff; font-weight: 700; font-size: 13px; min-width: 40px; }
.funnel-step.won .shape { background: linear-gradient(90deg, #10b981, #34d399); }
.donut { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; }
.donut > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }

/* ---------- Lists, timeline ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.timeline { position: relative; padding: 4px 0; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 10px 0 10px; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 40px; bottom: -10px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-icon { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); position: relative; z-index: 1; }
.tl-icon.deal { background: var(--primary-50); color: var(--primary); }
.tl-icon.document { background: var(--blue-bg); color: var(--blue); }
.tl-icon.task, .tl-icon.workflow { background: var(--green-bg); color: var(--green); }
.tl-icon.approval { background: var(--amber-bg); color: var(--amber); }
.tl-icon.underwriting { background: #f5f3ff; color: #7c3aed; }
@media (prefers-color-scheme: dark) { .tl-icon.underwriting { background: rgba(167, 139, 250, .12); color: #a78bfa; } }
.tl-body { flex: 1; min-width: 0; padding-top: 5px; }
.tl-body .what { color: var(--text); }
.tl-body .what strong { font-weight: 600; }
.tl-body .when { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tl-body .detail { margin-top: 6px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment .body { white-space: pre-wrap; margin-top: 3px; }

/* ---------- Tasks ---------- */
.task-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); transition: background .12s; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.task-row .title { font-weight: 500; }
.task-row.done .title { text-decoration: line-through; color: var(--text-3); }
.task-row.blocked { opacity: .65; }
.check {
  width: 20px; height: 20px; border-radius: 6px; flex: none; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; padding: 0; color: transparent;
  transition: all .15s;
}
.check:hover { border-color: var(--green); color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check svg { width: 12px; height: 12px; stroke-width: 3; }
.due { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.due.overdue { color: var(--red); font-weight: 600; }
.due.due-soon { color: var(--amber); font-weight: 600; }
.group-label { padding: 10px 18px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.group-label.overdue { color: var(--red); }

/* ---------- Empty states, misc ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty .art { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty .art svg { width: 24px; height: 24px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid var(--primary-100); background: linear-gradient(90deg, var(--primary-50), transparent); }
.dl { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13.5px; }
.dl dt { color: var(--text-3); font-weight: 500; }
.dl dd { margin: 0; color: var(--text); font-weight: 500; min-width: 0; }
.quote { border-left: 3px solid var(--primary-100); padding: 4px 10px; color: var(--text-2); font-size: 12.5px; background: var(--surface-2); border-radius: 0 6px 6px 0; font-style: italic; }
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.confidence .bar { width: 54px; height: 6px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary-100); border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.fade-in { animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.htmx-added { animation: fadeIn .25s ease both; }
#tab-panel.htmx-swapping { opacity: .4; transition: opacity .1s; }

/* ---------- Upload ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px;
  display: flex; align-items: center; gap: 16px; background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--primary); background: var(--primary-50); }
.dropzone .art { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); flex: none; }
.upload-progress { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.file-icon { width: 34px; height: 40px; border-radius: 6px; flex: none; display: grid; place-items: end center; padding-bottom: 5px; font-size: 9px; font-weight: 800; color: #fff; background: linear-gradient(160deg, #0aacfc, #0847b8); position: relative; }
.file-icon.pdf { background: linear-gradient(160deg, #f87171, #dc2626); }
.file-icon.xls { background: linear-gradient(160deg, #34d399, #059669); }
.file-icon::after { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: rgba(255,255,255,.35); border-bottom-left-radius: 4px; }

/* ---------- Modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 64px); }
dialog.modal.wide { width: min(980px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .18s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); position: sticky; bottom: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px;
  padding: 12px 14px; border-radius: 12px; background: #0f172a; color: #f1f5f9;
  box-shadow: var(--shadow-lg); font-weight: 500; animation: toastIn .25s cubic-bezier(.2,.8,.2,1) both;
}
.toast.leaving { animation: toastOut .2s ease both; }
.toast .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #10b981; }
.toast.error .dot { background: #ef4444; }
.toast .dot svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- User menu ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 99px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--surface-3); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.menu-panel .who { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-3); text-decoration: none; }
.menu-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------- Organization switcher ---------- */
.org-switcher { flex: 0 1 auto; min-width: 0; }
.org-switcher > summary { padding: 5px 10px 5px 5px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); max-width: 260px; }
.org-switcher > summary .icon { color: var(--text-3); flex: none; }
.org-name { font-weight: 600; font-size: 13px; min-width: 0; }
.org-mark { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.org-panel { left: 0; right: auto; width: 280px; max-height: min(70vh, 480px); overflow-y: auto; }
.menu-panel .org-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; }
.org-item.current { background: var(--surface-3); }
.org-item.current > .icon { margin-left: auto; color: var(--primary); flex: none; }
.org-item-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.org-item-text small { font-size: 11px; color: var(--text-3); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; color: #e2e8f0; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(10, 172, 252, .45), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(1, 88, 241, .4), transparent 60%),
    linear-gradient(160deg, #040b22, #07163d 60%, #002b80);
}
.auth-art .brand { padding: 0; font-size: 18px; }
.auth-art h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700; color: #fff; max-width: 520px; }
.auth-art h2 span { background: linear-gradient(90deg, #7dd3fc, #0aacfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p.lead { color: #a6b3cc; font-size: 15px; max-width: 460px; margin-top: 14px; }
.auth-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-art li { display: flex; gap: 10px; align-items: center; color: #cbd5e1; }
.auth-art li .tick { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(10, 172, 252, .2); color: #7dd3fc; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; opacity: .9; pointer-events: none; }
.auth-art .quote-card { position: relative; z-index: 1; background: rgba(15, 23, 42, .55); border: 1px solid rgba(148, 163, 184, .18); backdrop-filter: blur(8px); border-radius: 14px; padding: 16px 18px; max-width: 420px; }
.auth-art .quote-card .stat { display: flex; gap: 22px; }
.auth-art .quote-card .stat div strong { display: block; color: #fff; font-size: 20px; }
.auth-art .quote-card .stat div span { font-size: 12px; color: #94a3b8; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { color: var(--text-2); margin: 6px 0 26px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .foot { margin-top: 22px; text-align: center; color: var(--text-2); }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.dev-note { margin-top: 22px; font-size: 12px; color: var(--text-3); text-align: center; border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px; }
.consent-app { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.consent-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.consent-box { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.consent-box.stack-sm { align-items: stretch; }
.consent-scopes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.consent-scopes li { display: flex; gap: 10px; align-items: center; }
.consent-scopes li > svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.settings-nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.settings-nav a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .settings-nav { position: static; flex-direction: row; overflow-x: auto; } }

/* ---------- Error page ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-page .code { font-size: 72px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(135deg, #0aacfc, #0158f1); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Responsive shell ---------- */
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .app > * { min-width: 0; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; min-width: 0; }
  .sidebar .brand { padding: 0 12px 0 0; }
  .sidebar .brand small, .nav-label, .sidebar-foot { display: none; }
  .nav { flex-direction: row; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}
.icon.flip { transform: rotate(180deg); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .content { padding: 18px 14px; }
  .bar-row { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; }
  .funnel-step { grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 8px; }
  .kpi-strip > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .dl { grid-template-columns: 110px minmax(0, 1fr); }
  .page-head h1, .deal-hero h1 { font-size: 21px; }
  .topbar { flex-wrap: wrap; }
  .search { order: 2; flex-basis: 100%; max-width: none; }
  .org-switcher > summary { max-width: 180px; }
}

/* ---------- Board drag & drop ---------- */
.drop-placeholder { height: 64px; border-radius: 11px; border: 2px dashed var(--primary); background: var(--primary-50); margin: 0; }
.deal-card.saving { opacity: .7; pointer-events: none; }
.deal-card.just-moved { animation: landed .9s ease both; }
@keyframes landed { 0% { box-shadow: 0 0 0 3px var(--primary-100); } 100% { box-shadow: var(--shadow-sm); } }
.column .cards { min-height: 80px; }

/* ---------- Sortable lists ---------- */
.sortable-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); transition: background .12s; position: relative; }
.sortable-row:last-child { border-bottom: 0; }
.sortable-row.dragging { opacity: .4; background: var(--primary-50); }
.drag-handle { color: var(--text-3); cursor: grab; display: inline-flex; padding: 4px; border-radius: 6px; }
.drag-handle:hover { background: var(--surface-3); color: var(--text); }
.sortable-row:active .drag-handle { cursor: grabbing; }
.stage-row .stage-name { font-weight: 600; }
.stage-row.won .order-index { background: var(--green-bg); color: var(--green); }
.stage-row.lost .order-index { background: var(--red-bg); color: var(--red); }

/* ---------- Workflow editor ---------- */
.workflow-card.inactive { opacity: .72; }
.step-list { list-style: none; margin: 0; padding: 0; }
.step-list li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); }
.step-list .step-name { font-weight: 500; display: block; }
.step-no { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 11.5px; font-weight: 700; flex: none; }
.step-editor { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.step-editor-head, .step-row { display: grid; grid-template-columns: 22px 24px minmax(0, 1fr) 128px 96px 168px 88px; gap: 10px; align-items: center; }
.step-editor-head { padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.step-row .input, .step-row .select { min-width: 0; }
.step-row.has-error { background: var(--red-bg); }
.step-row .step-error { grid-column: 3 / -1; }
.due-group .suffix { right: 10px; font-size: 12px; }
.due-group .input { padding-right: 44px; }
.add-step { margin: 10px 14px; }
.trigger-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.trigger-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.trigger-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.trigger-option input { margin-top: 3px; accent-color: var(--primary); }
.trigger-option > span { display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 900px) {
  .step-editor-head { display: none; }
  .step-row { grid-template-columns: 22px 24px minmax(0, 1fr) 92px; }
  .step-row > .select, .step-row > .due-group { grid-column: 3 / span 2; }
  .trigger-picker { grid-template-columns: 1fr; }
}

/* ---------- Consultants & deliverables ---------- */
.tl-icon.deliverable { background: #f0fdfa; color: #0d9488; }
.dlv-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .12s; }
.dlv-row:last-child { border-bottom: 0; }
.dlv-row:hover { background: var(--surface-2); text-decoration: none; }
.dlv-row .title { font-weight: 600; display: block; }
.dlv-row.late { box-shadow: inset 3px 0 0 var(--red); }
.dlv-row.at_risk { box-shadow: inset 3px 0 0 var(--amber); }
.risk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--green); }
.risk-dot.at_risk { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.risk-dot.late { background: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.risk-dot.closed { background: var(--border-strong); }
.risk-text { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-weight: 500; }
.risk-text svg { width: 13px; height: 13px; }
.risk-text.at_risk { color: var(--amber); }
.risk-text.late { color: var(--red); }
.dlv-dates { display: grid; gap: 2px; text-align: right; color: var(--text-2); white-space: nowrap; }
.dlv-dates em { font-style: normal; color: var(--text-3); margin-right: 4px; }
.dlv-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 96px; }
.slipped { color: var(--amber); }
.risk-banner { display: flex; gap: 12px; margin: 0 22px 18px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--amber-bd); background: var(--amber-bg); color: var(--amber); }
.risk-banner.late { border-color: var(--red-bd); background: var(--red-bg); color: var(--red); }
.risk-banner > svg { width: 18px; height: 18px; margin-top: 2px; }
.risk-banner ul { margin: 4px 0; padding-left: 18px; color: var(--text); }
.convo { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface); max-width: 92%; }
.msg.out { align-self: flex-end; background: var(--surface-2); }
.msg.in { align-self: flex-start; border-color: var(--primary-100); }
.msg.alert { align-self: center; max-width: 100%; border-style: dashed; background: transparent; }
.msg-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); }
.msg-meta svg { width: 14px; height: 14px; }
.chip.auto { background: var(--primary-50); color: var(--primary); gap: 4px; }
.chip.auto svg { width: 12px; height: 12px; }
.msg-body summary { cursor: pointer; font-weight: 600; margin-top: 6px; }
.msg-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; color: var(--text-2); margin: 8px 0 0; max-height: 320px; overflow: auto; }
.understood { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.understood svg { margin-top: 2px; }
.understood.applied { background: var(--green-bg); color: var(--green); }
.understood.applied span { color: var(--text); }
.understood.review { background: var(--amber-bg); color: var(--amber); }
.understood.review span { color: var(--text); }
.review-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.grade { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.grade.gA { background: var(--green-bg); color: var(--green); }
.grade.gB { background: var(--blue-bg); color: var(--blue); }
.grade.gC { background: var(--amber-bg); color: var(--amber); }
.grade.gD { background: var(--red-bg); color: var(--red); }
@media (max-width: 760px) {
  .dlv-row { flex-wrap: wrap; }
  .dlv-dates { text-align: left; order: 3; width: 100%; grid-auto-flow: column; justify-content: start; gap: 12px; padding-left: 24px; }
  .dlv-badges { flex-direction: row; min-width: 0; }
  .msg { max-width: 100%; }
}

/* Consultant response page (/r/:token) */
.respond { background: var(--bg); }
.respond-wrap { max-width: 620px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.respond-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.respond-brand img { width: 34px; height: 34px; }
.respond-brand strong { display: block; }
.respond-brand small { color: var(--text-3); font-size: 12px; }
.respond-card h2 { display: flex; align-items: center; gap: 8px; }
.respond-done { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); font-weight: 600; }
.respond-foot { text-align: center; margin-top: 6px; }

/* ---------- Landing page ---------- */
.lp { background: var(--surface); }
.lp-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.lp-nav-in { display: flex; align-items: center; gap: 28px; height: 88px; }
.lp-logo img { height: 60px; width: auto; display: block; }
.lp-links { display: flex; gap: 22px; margin-left: 12px; }
.lp-links a { color: var(--text-2); font-weight: 500; }
.lp-links a:hover { color: var(--text); text-decoration: none; }
.lp-cta { margin-left: auto; display: flex; gap: 8px; }
.btn-lg { padding: 11px 20px; font-size: 15px; border-radius: 10px; }

.lp-hero { position: relative; overflow: hidden; color: #e2e8f0;
  background: radial-gradient(900px 480px at 85% -10%, rgba(10, 172, 252, .35), transparent 60%),
    radial-gradient(700px 500px at -5% 110%, rgba(1, 88, 241, .45), transparent 60%),
    linear-gradient(160deg, #040b22, #07163d 65%, #002b80); }
.lp-hero-in { display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; padding-top: 88px; padding-bottom: 96px; }
.lp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: #7dd3fc; background: rgba(10, 172, 252, .12); border: 1px solid rgba(10, 172, 252, .3); }
.lp-pill svg { width: 14px; height: 14px; }
.lp-hero h1 { font-size: 54px; line-height: 1.05; letter-spacing: -.035em; font-weight: 800; color: #fff; margin: 18px 0 0; }
.lp-hero h1 span { background: linear-gradient(90deg, #7dd3fc, #0aacfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p { font-size: 17px; line-height: 1.6; color: #a9b8d4; max-width: 520px; margin: 20px 0 0; }
.lp-hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.lp-hero .btn:not(.btn-primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.lp-hero .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .14); }
.lp-hero p.lp-fine { font-size: 13px; color: #7f90b0; margin-top: 18px; }

.lp-mock { background: #0a1535; border: 1px solid rgba(148, 163, 184, .22); border-radius: 16px; box-shadow: 0 40px 80px rgba(0, 0, 0, .45); overflow: hidden; transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); }
.lp-mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(148, 163, 184, .16); }
.lp-mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #1f2d52; }
.lp-mock-bar span { margin-left: 10px; font-size: 12px; font-weight: 600; color: #7f90b0; }
.lp-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; }
.lp-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7f90b0; margin: 0 0 8px; font-weight: 700; }
.lp-col h4 em { font-style: normal; color: #4da3ff; margin-left: 4px; }
.lp-card { background: #101e45; border: 1px solid rgba(148, 163, 184, .16); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 3px; }
.lp-card b { color: #fff; font-size: 12px; line-height: 1.25; }
.lp-card span { font-size: 10.5px; color: #8fa0c0; }
.lp-card u { text-decoration: none; align-self: flex-start; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-top: 3px; }
.lp-card u.t-blue { background: rgba(10, 172, 252, .18); color: #7dd3fc; }
.lp-card u.t-amber { background: rgba(251, 191, 36, .15); color: #fbbf24; }
.lp-card u.t-green { background: rgba(52, 211, 153, .15); color: #34d399; }
.lp-bar { height: 5px; border-radius: 99px; background: rgba(148, 163, 184, .2); margin-top: 5px; overflow: hidden; }
.lp-bar span { display: block; height: 100%; background: linear-gradient(90deg, #0158f1, #0aacfc); }

.lp-sec { padding: 96px 0; scroll-margin-top: 88px; }
.lp-alt { background: var(--bg); border-block: 1px solid var(--border); }
.lp-head { max-width: 640px; margin-bottom: 48px; }
.lp-eyebrow { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.lp-head h2, .lp-trust h2, .lp-final h2 { font-size: 36px; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; margin-top: 10px; }
.lp-head p, .lp-trust p { color: var(--text-2); font-size: 16px; line-height: 1.6; margin: 14px 0 0; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-feat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.lp-feat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.lp-feat > svg { width: 38px; height: 38px; padding: 9px; border-radius: 10px; color: var(--primary); background: var(--primary-50); }
.lp-feat h3 { font-size: 16px; margin: 16px 0 6px; }
.lp-feat p { margin: 0; color: var(--text-2); line-height: 1.55; }
.lp-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.lp-h2 { font-size: 36px; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; margin-top: 10px; }
.lp-lead { color: var(--text-2); font-size: 16px; line-height: 1.6; margin: 14px 0 0; }
.lp-checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.lp-checks li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.55; color: var(--text-2); }
.lp-checks li b { color: var(--text); font-weight: 600; }
.lp-checks li > svg { width: 30px; height: 30px; padding: 7px; border-radius: 8px; color: var(--primary); background: var(--primary-50); flex: none; }
.lp-goal { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--green-bd); background: var(--green-bg); }
.lp-goal strong { font-size: 30px; font-weight: 800; color: var(--green); letter-spacing: -.02em; }
.lp-goal span { color: var(--text); font-weight: 500; }
.lp-thread { background: #0a1535; border: 1px solid rgba(148, 163, 184, .22); border-radius: 16px; box-shadow: 0 40px 80px rgba(4, 11, 34, .35); overflow: hidden; color: #cbd5e1; }
.lp-thread-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lp-dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lp-dates div { background: #101e45; border: 1px solid rgba(148, 163, 184, .16); border-radius: 9px; padding: 8px 10px; }
.lp-dates em { display: block; font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #7f90b0; font-weight: 700; }
.lp-dates b { color: #fff; font-size: 14px; }
.lp-dates b.amber { color: #fbbf24; }
.lp-bubble { max-width: 88%; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.lp-bubble small { display: block; font-size: 10.5px; color: #7f90b0; margin-bottom: 3px; font-weight: 600; }
.lp-bubble.out { align-self: flex-end; background: #13265a; border: 1px solid rgba(77, 163, 255, .25); }
.lp-bubble.in { align-self: flex-start; background: #101e45; border: 1px solid rgba(148, 163, 184, .2); color: #fff; }
.lp-ai, .lp-alert { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.5; }
.lp-ai { background: rgba(52, 211, 153, .12); color: #34d399; }
.lp-ai span, .lp-alert span { color: #e2e8f0; }
.lp-alert { background: rgba(251, 191, 36, .12); color: #fbbf24; }
.lp-ai svg, .lp-alert svg { margin-top: 2px; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.lp-steps li span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #0aacfc, #0158f1); }
.lp-steps h3 { font-size: 18px; margin: 16px 0 8px; }
.lp-steps p { margin: 0; color: var(--text-2); line-height: 1.6; }
.lp-trust { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.lp-trust ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lp-trust li { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.lp-trust .tick { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: var(--primary-50); }
.lp-trust .tick svg { width: 18px; height: 18px; }
.lp-final { text-align: center; padding: 88px 0; color: #e2e8f0; background: linear-gradient(160deg, #040b22, #07163d 60%, #002b80); }
.lp-final h2 { color: #fff; }
.lp-final p { color: #a9b8d4; font-size: 16px; margin: 12px auto 0; max-width: 480px; }
.lp-final .btn:not(.btn-primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.lp-foot { padding: 28px 0; border-top: 1px solid var(--border); }
.lp-foot-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: 13px; }
.lp-foot img { height: 48px; width: auto; }

@media (prefers-color-scheme: dark) {
  .lp-logo img, .lp-foot img { background: #fff; padding: 5px 10px; border-radius: 8px; }
}
@media (max-width: 960px) {
  .lp-hero-in, .lp-trust, .lp-split { grid-template-columns: 1fr; gap: 40px; }
  .lp-hero h1 { font-size: 40px; }
  .lp-grid, .lp-steps { grid-template-columns: 1fr 1fr; }
  .lp-mock { transform: none; }
  .lp-links { display: none; }
}
@media (max-width: 600px) {
  .lp-nav-in { height: 72px; gap: 12px; }
  .lp-logo img { height: 40px; }
}
@media (max-width: 600px) {
  .lp-grid, .lp-steps { grid-template-columns: 1fr; }
  .lp-board { grid-template-columns: 1fr 1fr; }
  .lp-hero h1 { font-size: 34px; }
  .lp-head h2, .lp-trust h2, .lp-final h2, .lp-h2 { font-size: 28px; }
  .lp-sec { padding: 64px 0; }
  .lp-hero-in { padding-top: 56px; padding-bottom: 64px; }
}
