/* Argon Builds Client Portal — theme tokens from theme.txt */
:root {
  --card: oklch(1.00 0 0);
  --ring: oklch(0 0 0);
  --input: oklch(0.94 0 0);
  --muted: oklch(0.97 0 0);
  --accent: oklch(0.94 0 0);
  --border: oklch(0.92 0 0);
  --radius: 0.5rem;
  --chart-1: oklch(0.81 0.17 75.35);
  --chart-2: oklch(0.55 0.22 264.53);
  --primary: oklch(0 0 0);
  --primary-foreground: oklch(1.00 0 0);
  --secondary: oklch(0.94 0 0);
  --background: oklch(0.99 0 0);
  --foreground: oklch(0 0 0);
  --muted-foreground: oklch(0.44 0 0);
  --destructive: oklch(0.63 0.19 23.03);
  --success: oklch(0.55 0.13 150);
  --font-sans: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --shadow: 0 1px 2px hsl(0 0% 0% / 0.08), 0 1px 1px hsl(0 0% 0% / 0.04);
  /* screen styles (B · Noir & Amber, C · Pulse) */
  --line: oklch(0.955 0 0);
  --page-b: oklch(0.97 0 0);
  --ink: oklch(0 0 0);
  --ink-2: oklch(0.19 0 0);
  --ink-3: oklch(0.27 0 0);
  --ink-edge: oklch(0 0 0);
  --on-ink: oklch(0.74 0 0);
  --amber-soft: oklch(0.96 0.06 85);
  --amber-ink: oklch(0.48 0.11 70);
  --blue-soft: oklch(0.96 0.03 264);
  --blue-ink: oklch(0.55 0.22 264.53);
  --red-soft: oklch(0.96 0.03 25);
  --red-ink: oklch(0.5 0.19 25);
  --green-soft: oklch(0.96 0.04 150);
  --green-ink: oklch(0.45 0.12 150);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --card: oklch(0.14 0 0);
    --ring: oklch(0.72 0 0);
    --input: oklch(0.32 0 0);
    --muted: oklch(0.23 0 0);
    --accent: oklch(0.32 0 0);
    --border: oklch(0.26 0 0);
    --chart-2: oklch(0.58 0.21 260.84);
    --primary: oklch(1.00 0 0);
    --primary-foreground: oklch(0 0 0);
    --secondary: oklch(0.25 0 0);
    --background: oklch(0 0 0);
    --foreground: oklch(1.00 0 0);
    --muted-foreground: oklch(0.72 0 0);
    --destructive: oklch(0.69 0.20 23.91);
    --success: oklch(0.72 0.15 150);
    --shadow: 0 1px 2px hsl(0 0% 0% / 0.5);
    --line: oklch(0.22 0 0);
    --page-b: oklch(0 0 0);
    --ink: oklch(0.12 0 0);
    --ink-2: oklch(0.2 0 0);
    --ink-3: oklch(0.28 0 0);
    --ink-edge: oklch(0.26 0 0);
    --amber-soft: oklch(0.3 0.06 75);
    --amber-ink: oklch(0.86 0.13 80);
    --blue-soft: oklch(0.28 0.06 264);
    --blue-ink: oklch(0.8 0.1 264);
    --red-soft: oklch(0.3 0.08 25);
    --red-ink: oklch(0.8 0.13 25);
    --green-soft: oklch(0.3 0.06 150);
    --green-ink: oklch(0.82 0.12 150);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { max-width: 1248px; margin: 0 auto; padding: 24px 16px 64px; }
.loading { color: var(--muted-foreground); padding: 48px 0; text-align: center; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.8125rem; }
.mono { font-family: var(--font-mono); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); font-weight: 500; }

/* ---------- app shell: two screen styles, picked per user (body[data-style]) */
/*   B · Noir & Amber: black sidebar → icon rail (701–1099) → floating pill tab bar (≤700)
     C · Pulse: soft sidebar → top bar with pills (701–1099) → flat tab bar + FAB (≤700) */
:root { --side-w: 0px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; letter-spacing: -0.01em; min-width: 0; }
.brand img, .brand .mark { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.brand > span { display: grid; line-height: 1.2; }
.brand strong { font-weight: 600; font-size: 0.9375rem; }
.brand small { font-size: 0.75rem; color: var(--muted-foreground); }
.mark rect { fill: var(--primary); }
.mark path { fill: var(--primary-foreground); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--side-w);
  display: flex; flex-direction: column; gap: 30px; overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}
.sidebar .brand { padding: 0 6px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px;
  text-decoration: none; font-size: 0.9375rem; font-weight: 500; transition: background .15s, color .15s;
}
.side-nav svg, .side-signout svg, .top-pills svg, .bottom-nav svg, .round svg { width: 20px; height: 20px; flex: none; }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; min-width: 0; text-decoration: none; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-foreground); font-size: 0.75rem; font-weight: 600; letter-spacing: .02em;
}
.side-user-text { display: grid; min-width: 0; line-height: 1.25; }
.side-user-text strong { font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text small { font-size: 0.75rem; color: var(--muted-foreground); }
.side-signout {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 14px; border: 0; border-radius: 12px;
  background: transparent; font-size: 0.9375rem; font-weight: 500; cursor: pointer; text-align: left;
}
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none; padding: 0;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--foreground); cursor: pointer;
}
.icon-btn:hover { background: var(--muted); }
.icon-btn svg { width: 22px; height: 22px; }
.mobile-bar, .top-pills, .bottom-nav, .bottom-nav .fab { display: none; }
.m-actions { display: flex; gap: 8px; margin-left: auto; }
.round {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  text-decoration: none; font-size: 0.75rem; font-weight: 600;
}
.round.me { background: var(--card); border: 1px solid var(--border); }
body.has-sidebar { padding-left: var(--side-w); }
body.has-sidebar .toast { left: calc(50% + var(--side-w) / 2); }
body.has-sidebar .container { max-width: 1500px; padding: 32px 40px 56px; }

/* B · Noir & Amber */
body[data-style="b"] { --side-w: 260px; background: var(--page-b); }
[data-style="b"] .sidebar { background: var(--ink); color: #fff; border-right: 1px solid var(--ink-edge); }
[data-style="b"] .sidebar .mark rect { fill: var(--chart-1); }
[data-style="b"] .sidebar .mark path { fill: #000; }
[data-style="b"] .sidebar .brand small, [data-style="b"] .side-user-text small { color: var(--on-ink); }
[data-style="b"] .side-nav a { color: var(--on-ink); }
[data-style="b"] .side-nav a:hover { color: #fff; background: var(--ink-2); }
[data-style="b"] .side-nav a[aria-current="page"] { background: var(--chart-1); color: #000; }
[data-style="b"] .side-user { background: var(--ink-2); color: #fff; }
[data-style="b"] .avatar { background: #fff; color: #000; }
[data-style="b"] .side-signout { color: var(--on-ink); }
[data-style="b"] .side-signout:hover { color: #fff; background: var(--ink-2); }
[data-style="b"] .round.new { background: var(--ink); color: var(--chart-1); }
[data-style="b"] .card { border-radius: 20px; }

/* C · Pulse */
body[data-style="c"] { --side-w: 236px; }
[data-style="c"] .sidebar { background: var(--muted); border-right: 1px solid var(--line); padding-left: 14px; padding-right: 14px; gap: 28px; }
[data-style="c"] .side-nav { gap: 2px; }
[data-style="c"] .side-nav a { height: 42px; padding: 0 12px; border-radius: 10px; color: var(--muted-foreground); }
[data-style="c"] .side-nav a:hover { color: var(--foreground); }
[data-style="c"] .side-nav a[aria-current="page"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 0 0 1px var(--border); }
[data-style="c"] .side-user { padding: 8px; }
[data-style="c"] .side-user:hover { background: var(--card); }
[data-style="c"] .side-signout { height: 38px; padding: 0 12px; color: var(--muted-foreground); }
[data-style="c"] .side-signout:hover { color: var(--destructive); background: var(--card); }
[data-style="c"] .round.new { display: none; }
[data-style="c"] .card { border-radius: 16px; }

/* Tablet */
@media (min-width: 701px) and (max-width: 1099px) {
  body.has-sidebar .container { padding: 28px 28px 48px; }

  body[data-style="b"] { --side-w: 84px; }
  [data-style="b"] .sidebar { padding: 22px 14px; align-items: center; }
  [data-style="b"] .sidebar .brand { padding: 0; }
  [data-style="b"] .sidebar .brand > span, [data-style="b"] .side-nav .lbl,
  [data-style="b"] .side-user-text, [data-style="b"] .side-signout .lbl { display: none; }
  [data-style="b"] .side-nav a, [data-style="b"] .side-signout { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 16px; }
  [data-style="b"] .side-user { padding: 0; background: none; justify-content: center; }

  body[data-style="c"] { --side-w: 0px; }
  [data-style="c"] .sidebar { display: none; }
  [data-style="c"] .mobile-bar {
    display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20;
    padding: calc(12px + env(safe-area-inset-top)) 28px 12px;
    background: color-mix(in oklch, var(--background) 90%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  [data-style="c"] .mobile-bar .brand > span { display: none; }
  [data-style="c"] .mobile-bar .m-actions { margin-left: 0; }
  [data-style="c"] .top-pills { display: flex; gap: 4px; background: var(--muted); padding: 4px; border-radius: 99px; margin: 0 auto; }
  [data-style="c"] .top-pills a {
    height: 36px; padding: 0 16px; border-radius: 99px; display: flex; align-items: center; gap: 8px;
    font-weight: 500; color: var(--muted-foreground); text-decoration: none; white-space: nowrap;
  }
  [data-style="c"] .top-pills a[aria-current="page"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
}
@media (min-width: 701px) and (max-width: 880px) {
  [data-style="c"] .top-pills svg { display: none; }
  [data-style="c"] .top-pills a { padding: 0 14px; }
}

/* Phone */
@media (max-width: 700px) {
  body.has-sidebar { --side-w: 0px; }
  body.has-sidebar .container { padding: 16px 16px calc(112px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .mobile-bar .brand .mark { width: 34px; height: 34px; }
  .bottom-nav { display: flex; position: fixed; z-index: 20; align-items: center; }
  .bottom-nav a { text-decoration: none; position: relative; }
  body.has-tabbar .bottom-nav { display: none; }
  body.has-sidebar .toast, body.has-sidebar .a2hs-hint { bottom: calc(96px + env(safe-area-inset-bottom)); }

  [data-style="b"] .mobile-bar .brand .mark rect { fill: var(--ink); }
  [data-style="b"] .mobile-bar .brand .mark path { fill: var(--chart-1); }
  [data-style="b"] .bottom-nav {
    left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    height: 66px; padding: 8px; border-radius: 99px; background: var(--ink); border: 1px solid var(--ink-edge);
    box-shadow: 0 10px 30px rgb(0 0 0 / .25); justify-content: space-between;
  }
  [data-style="b"] .bottom-nav a {
    height: 50px; min-width: 50px; border-radius: 99px; display: flex; align-items: center; justify-content: center;
    gap: 8px; color: var(--on-ink); font-weight: 500;
  }
  [data-style="b"] .bottom-nav a[aria-current="page"] { background: var(--chart-1); color: #000; padding: 0 18px; }
  [data-style="b"] .bottom-nav a:not([aria-current]) .lbl { display: none; }

  [data-style="c"] .bottom-nav {
    left: 0; right: 0; bottom: 0; height: calc(70px + env(safe-area-inset-bottom));
    padding: 0 12px env(safe-area-inset-bottom); justify-content: space-around;
    background: color-mix(in oklch, var(--background) 94%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  [data-style="c"] .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px;
    font-size: 11px; font-weight: 500; color: var(--muted-foreground);
  }
  [data-style="c"] .bottom-nav a[aria-current="page"] { color: var(--foreground); }
  [data-style="c"] .bottom-nav .fab {
    display: flex; width: 54px; height: 54px; min-width: 0; border-radius: 50%; justify-content: center;
    background: var(--primary); color: var(--chart-1); margin-top: -22px; box-shadow: 0 8px 20px rgb(0 0 0 / .25);
  }
  [data-style="c"] .bottom-nav .fab svg { width: 24px; height: 24px; }
}

/* Screen-style picker (Account) and per-client select (Clients) */
.style-pick { display: grid; gap: 10px; }
.style-opt {
  display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
}
.style-opt:hover { background: var(--muted); }
.style-opt:has(input:checked) { border-color: var(--foreground); box-shadow: 0 0 0 1px var(--foreground); }
.style-opt:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.style-txt { display: grid; line-height: 1.3; }
.style-txt small { color: var(--muted-foreground); font-size: 0.8125rem; }
.sw { flex: none; width: 64px; height: 44px; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; display: grid; grid-template-columns: 16px 1fr; grid-template-rows: 1fr 1fr; gap: 3px; padding: 0 4px 0 0; }
.sw i:first-child { grid-row: 1 / -1; }
.sw-b { background: oklch(0.97 0 0); }
.sw-b i:nth-child(1) { background: #000; }
.sw-b i:nth-child(2) { background: oklch(0.81 0.17 75.35); border-radius: 4px; margin-top: 4px; }
.sw-b i:nth-child(3) { background: #000; border-radius: 4px; margin-bottom: 4px; width: 50%; }
.sw-c { background: #fff; }
.sw-c i:nth-child(1) { background: oklch(0.94 0 0); }
.sw-c i:nth-child(2) { margin-top: 5px; border-radius: 4px; background: repeating-linear-gradient(90deg, oklch(0.94 0 0) 0 5px, transparent 5px 7px); }
.sw-c i:nth-child(3) { margin: 2px 0 5px; width: 16px; border-radius: 50%; border: 3px solid #000; border-right-color: oklch(0.94 0 0); }
.style-select { width: auto; padding: 5px 8px; font-size: 0.8125rem; }
@media (prefers-reduced-motion: reduce) { .side-nav a { transition: none; } }

/* ---------- cards & forms */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 20px;
  box-shadow: var(--shadow);
}
.auth-wrap { min-height: calc(100vh - 48px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { margin-bottom: 24px; }

label.field { display: block; }
label.field > span { display: block; font-size: 0.8125rem; font-weight: 500; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 72px; }
.input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 15%, transparent); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 500; font-size: 0.875rem;
  cursor: pointer;
  background: var(--primary); color: var(--primary-foreground);
  text-decoration: none;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--secondary); color: var(--foreground); }
.btn.ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn.ghost:hover { background: var(--muted); opacity: 1; }
.btn.danger { background: transparent; color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 40%, transparent); }
.btn.sm { padding: 4px 10px; font-size: 0.8125rem; }
.btn.icon { padding: 4px 8px; }
.btn.block { width: 100%; padding: 10px 14px; }

.error { color: var(--destructive); font-size: 0.875rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--primary); color: var(--primary-foreground);
  padding: 10px 16px; border-radius: var(--radius); font-size: 0.875rem; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px); z-index: 50;
}
.toast.is-error { background: var(--destructive); color: #fff; }

details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel[open] > summary { margin-bottom: 16px; }

/* ---------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted-foreground); font-size: 0.875rem; margin-bottom: 12px; }
.back:hover { color: var(--foreground); }

/* ---------- progress */
.bar { height: 8px; background: var(--secondary); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .4s ease; }
.bar.lg { height: 10px; }

/* ---------- project cards */
.project-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.project-card { display: block; text-decoration: none; transition: border-color .15s, transform .15s; }
.project-card:hover { border-color: var(--ring); }
.project-card h3 { margin-bottom: 4px; }
.project-card .bar { margin: 16px 0 8px; }
.project-card .meta { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--muted-foreground); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted-foreground); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: var(--secondary); color: var(--foreground);
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-foreground); }
.chip.s-completed::before { background: var(--success); }
.chip.s-in_progress::before, .chip.s-awaiting_review::before, .chip.s-awaiting_client_review::before { background: var(--chart-1); }
.chip.s-delayed { color: var(--destructive); }
.chip.s-delayed::before { background: var(--destructive); }
.chip.s-scheduled::before { background: var(--chart-2); }

/* ---------- client project view */
.hero { padding: 28px; }
.hero h1 { margin-top: 6px; }
.hero .desc { margin-top: 8px; max-width: 60ch; }
.big-progress { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 12px; flex-wrap: wrap; }
.big-progress .pct { font-size: 3rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.current { margin-top: 16px; font-size: 0.875rem; }
.current strong { font-weight: 600; }

.timeline { list-style: none; margin: 24px 0 0; padding: 0; }
.tl { position: relative; display: flex; gap: 16px; padding-bottom: 24px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { /* connecting line */
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border);
}
.tl:last-child::before { display: none; }
.tl.is-done::before { background: var(--primary); }
.dot {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--border); background: var(--card);
  position: relative; z-index: 1;
}
.dot svg { width: 16px; height: 16px; }
.tl.is-done .dot { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.tl.is-current .dot { border-color: var(--chart-1); }
.tl.is-current .dot::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--chart-1);
  animation: pulse 1.8s ease-in-out infinite;
}
.tl.is-delayed .dot { border-color: var(--destructive); }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .tl.is-current .dot::after { animation: none; } }
.tl-body { padding-top: 4px; min-width: 0; }
.tl-body h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl.is-todo .tl-body h3 { color: var(--muted-foreground); font-weight: 500; }
.tl-body .note { margin-top: 4px; color: var(--muted-foreground); font-size: 0.875rem; white-space: pre-wrap; }
.tl-body .when { margin-top: 2px; font-size: 0.8125rem; color: var(--muted-foreground); }

/* ---------- admin milestone editor */
.ms-list { list-style: none; margin: 0; padding: 0; }
.ms-row {
  display: grid; grid-template-columns: auto 1fr; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.ms-row:first-child { border-top: 0; }
.ms-row.is-hidden { opacity: 0.6; }
.check {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--input); background: var(--card); color: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 4px;
  transition: background .15s, border-color .15s;
}
.check svg { width: 14px; height: 14px; }
.check:hover { border-color: var(--ring); }
.check.is-done { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.ms-main { min-width: 0; display: grid; gap: 8px; }
.ms-title { font-weight: 500; border-color: transparent; background: transparent; padding: 4px 8px; margin-left: -8px; }
.ms-title:hover { border-color: var(--input); }
.ms-note { font-size: 0.8125rem; padding: 6px 8px; }
.ms-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ms-controls select, .ms-controls input[type="date"] { width: auto; padding: 5px 8px; font-size: 0.8125rem; }
.vis { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--muted-foreground); cursor: pointer; }
.saved { font-size: 0.75rem; color: var(--success); opacity: 0; transition: opacity .3s; }
.saved.show { opacity: 1; }

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted-foreground); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  .table .hide-sm { display: none; }
  .hero { padding: 20px; }
  .big-progress .pct { font-size: 2.5rem; }
}

/* ---------- project tabs (top on desktop, native-style bottom bar on phones) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  padding: 10px 14px; text-decoration: none; color: var(--muted-foreground);
  font-size: 0.875rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a svg { width: 18px; height: 18px; }
.tabs a:hover { color: var(--foreground); }
.tabs a[aria-current="page"] { color: var(--foreground); border-bottom-color: var(--primary); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px; background: var(--destructive); color: #fff; font-size: 0.6875rem; font-weight: 600;
}
@media (max-width: 700px) {
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    background: color-mix(in oklch, var(--background) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); border-bottom: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs a {
    flex: 1; flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 0.6875rem;
    border-bottom: 0; border-radius: var(--radius);
  }
  .tabs a svg { width: 22px; height: 22px; }
  .tabs a[aria-current="page"] { background: var(--secondary); }
  .tabs .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
  body.has-tabbar .container, body.has-sidebar.has-tabbar .container { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  body.has-tabbar .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  [data-style="b"] .tabs {
    left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 66px; padding: 8px; gap: 4px;
    border-radius: 99px; background: var(--ink); border: 1px solid var(--ink-edge); box-shadow: 0 10px 30px rgb(0 0 0 / .25);
    backdrop-filter: none; align-items: center;
  }
  [data-style="b"] .tabs a { height: 50px; flex-direction: row; justify-content: center; gap: 8px; border-radius: 99px; color: var(--on-ink); font-size: 0.8125rem; padding: 0 6px; }
  [data-style="b"] .tabs a[aria-current="page"] { background: var(--chart-1); color: #000; flex: 1.6; }
  [data-style="b"] .tabs a:not([aria-current]) span:not(.badge) { display: none; }
  [data-style="b"] .tabs a svg { width: 20px; height: 20px; }
  [data-style="b"] .tabs .badge { top: 4px; left: calc(50% + 4px); }
  [data-style="b"] .tabs a[aria-current="page"] .badge { position: static; }
}

.add-row { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.alert {
  border: 1px solid color-mix(in oklch, var(--chart-1) 60%, transparent);
  background: color-mix(in oklch, var(--chart-1) 14%, var(--card));
  border-radius: calc(var(--radius) * 2); padding: 12px 16px; font-size: 0.875rem;
}
.chip.s-waived { text-decoration: line-through; }

/* ---------- payments */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pay-list { list-style: none; margin: 16px 0 0; padding: 0; }
.pay-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.pay-item:first-child { border-top: 0; padding-top: 4px; }
.pay-item .dot { width: 28px; height: 28px; }
.pay-item.is-done .dot { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.pay-item.is-waived { opacity: 0.55; }
.pay-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pay-body .note { color: var(--muted-foreground); font-size: 0.8125rem; }
.pay-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.amount-input { width: 150px; text-align: right; font-variant-numeric: tabular-nums; padding: 4px 8px; }
.vis .input { width: auto; padding: 4px 6px; font-size: 0.8125rem; }

/* ---------- messages */
.thread { display: flex; flex-direction: column; gap: 16px; padding: 0; overflow: hidden; }
.msgs {
  display: flex; flex-direction: column; gap: 12px; padding: 20px;
  max-height: 60vh; min-height: 200px; overflow-y: auto; overscroll-behavior: contain;
}
.empty-thread { text-align: center; margin: auto 0; }
.msg { max-width: min(80%, 560px); align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg-meta { font-size: 0.75rem; color: var(--muted-foreground); margin-bottom: 4px; }
.msg-body {
  display: inline-block; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 10px 14px; border-radius: 16px; background: var(--secondary); border-bottom-left-radius: 4px;
}
.msg.mine .msg-body { background: var(--primary); color: var(--primary-foreground); border-radius: 16px; border-bottom-right-radius: 4px; }
.msg.internal .msg-body {
  background: color-mix(in oklch, var(--chart-1) 16%, var(--card)); color: var(--foreground);
  border: 1px dashed color-mix(in oklch, var(--chart-1) 80%, transparent);
}
.tag {
  display: inline-block; font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: 1px 6px; border-radius: 4px; background: var(--chart-1); color: #000;
}
.composer { border-top: 1px solid var(--border); padding: 16px 20px 20px; display: grid; gap: 10px; transition: background .15s; }
.composer.is-internal { background: color-mix(in oklch, var(--chart-1) 12%, var(--card)); }
.composer.is-internal textarea { border-color: color-mix(in oklch, var(--chart-1) 80%, transparent); }
.composer.is-internal .composer-hint { color: var(--foreground); font-weight: 500; }
.composer-hint { color: var(--muted-foreground); }
.seg { display: inline-flex; background: var(--secondary); border-radius: var(--radius); padding: 3px; gap: 3px; justify-self: start; }
.seg label { padding: 5px 12px; border-radius: calc(var(--radius) - 2px); font-size: 0.8125rem; font-weight: 500; cursor: pointer; color: var(--muted-foreground); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--card); color: var(--foreground); box-shadow: var(--shadow); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ring); }
@media (max-width: 640px) {
  .msgs { max-height: none; min-height: 40vh; padding: 16px; }
  .composer { padding: 12px 16px 16px; }
  .amount-input { width: 110px; }
}

/* ---------- install-to-home-screen hint */
.a2hs-hint { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; }
body.has-tabbar .a2hs-hint { bottom: calc(96px + env(safe-area-inset-bottom)); }
.a2hs-inner {
  display: flex; gap: 12px; align-items: center; max-width: 460px; margin: 0 auto; padding: 12px 14px;
  background: var(--primary); color: var(--primary-foreground); border-radius: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .25);
}
.a2hs-inner img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.a2hs-text { font-size: .85rem; line-height: 1.35; flex: 1; }
.a2hs-inner .btn { background: var(--primary-foreground); color: var(--primary); }
.a2hs-close { background: none; border: 0; color: inherit; opacity: .7; font-size: 1rem; cursor: pointer; padding: 4px; }

/* ---------- small shared bits */
[hidden] { display: none !important; }
.badge.alt { background: var(--chart-1); color: #000; }
.section-title { margin: 32px 0 12px; }
.project-card.is-closed { opacity: 0.7; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- show/hide password */
.pw-wrap { position: relative; display: block; }
label.field > .pw-wrap { font-size: inherit; font-weight: inherit; margin-bottom: 0; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--radius); padding: 0;
  color: var(--muted-foreground); cursor: pointer;
}
.pw-toggle:hover { color: var(--foreground); background: var(--muted); }
.pw-toggle:focus-visible { outline: 2px solid var(--ring); }
.pw-toggle svg { width: 18px; height: 18px; }
input::-ms-reveal, input::-ms-clear { display: none; }

/* ---------- change requests */
.cr-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cr { padding: 14px 0; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.cr:first-child { border-top: 0; }
.cr.is-attention {
  border: 1px solid color-mix(in oklch, var(--chart-1) 60%, transparent);
  background: color-mix(in oklch, var(--chart-1) 8%, var(--card));
  border-radius: calc(var(--radius) * 1.5); padding: 14px; margin: 8px 0;
}
.cr.is-attention + .cr { border-top: 0; }
.cr-desc { white-space: pre-wrap; font-size: 0.9rem; margin-top: 4px; overflow-wrap: anywhere; }
.cr-impact { font-size: 0.875rem; margin-top: 4px; }
.cr-reply {
  margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--border);
  background: var(--muted); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cr-respond { margin-top: 12px; }
.close-anyway { margin-top: 10px; }
.close-anyway > summary { cursor: pointer; font-size: 0.875rem; color: var(--muted-foreground); }
.close-anyway > summary:hover { color: var(--foreground); }

/* ---------- handover & closure */
.closure.is-attention {
  border-color: color-mix(in oklch, var(--chart-1) 70%, transparent);
  background: color-mix(in oklch, var(--chart-1) 10%, var(--card));
}
.closure.is-closed { border-color: color-mix(in oklch, var(--success) 50%, transparent); }
.checklist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 0.875rem; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .ci {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--input);
}
.checklist .ci svg { width: 11px; height: 11px; }
.checklist li.ok .ci { background: var(--success); border-color: var(--success); color: #fff; }
.checklist li.no { color: var(--muted-foreground); }
.handover-note {
  margin-top: 10px; padding: 10px 14px; background: var(--muted); border-radius: var(--radius);
  font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------- home screens (dash.js): shared bits */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.nb a, .pl a { text-decoration: none; }
:where(.nb, .pl) :where(ul, ol) { list-style: none; margin: 0; padding: 0; }
.nb, .pl { font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.db-empty { color: var(--muted-foreground); padding: 8px 22px 22px; }
.db-more > summary { list-style: none; cursor: pointer; display: flex; justify-content: center; padding: 10px 16px 14px; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); }
.db-more > summary::-webkit-details-marker { display: none; }
.db-more > summary:hover { color: var(--foreground); }
.db-more > summary > span { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 99px; background: var(--muted); }
.db-more .db-more-hide, .db-more[open] .db-more-show { display: none; }
.db-more[open] .db-more-hide { display: inline-flex; }
.db-more[open] > summary { order: 2; }
.db-more[open] { display: flex; flex-direction: column; }
.pl .db-more > summary { padding: 10px 0 0; }
.pl .db-more > .pl-needs { margin-top: 8px; }

/* ---------- B · Noir & Amber */
.nb { display: flex; flex-direction: column; gap: 20px; }
.nb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.nb-head p { color: var(--muted-foreground); font-size: 14px; }
.nb-head h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; margin-top: 2px; }
.nb-head-r { display: flex; align-items: center; gap: 10px; }
.nb-datechip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 99px; background: var(--card); border: 1px solid var(--border); font-weight: 500; }
.nb-new { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 6px; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 500; }
.nb-plus { width: 32px; height: 32px; border-radius: 50%; background: var(--chart-1); color: #000; display: grid; place-items: center; }

.nb-top { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.nb-mid, .nb-low { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.nb-hero { background: var(--chart-1); color: #000; border-radius: 24px; padding: 26px 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; min-width: 0; }
.nb-hero.is-link:hover { box-shadow: 0 10px 30px rgb(0 0 0 / .12); }
.nb-hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.nb-hero-main { min-width: 0; }
.nb-k { display: flex; align-items: center; gap: 10px; font-weight: 500; min-width: 0; }
.nb-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nb-cur { flex: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; background: #000; color: #fff; padding: 2px 8px; border-radius: 99px; }
.nb-big { font-size: 46px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-top: 14px; overflow-wrap: anywhere; }
.nb-big.sm { font-size: 30px; }
.nb-of { margin-top: 8px; font-weight: 500; opacity: 0.75; }
.nb-hero-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.nb-gauge { width: 150px; flex: none; position: relative; margin-top: 8px; }
.nb-gauge svg { display: block; width: 100%; height: auto; }
.nb-gauge path { fill: none; stroke-width: 20; stroke-linecap: round; }
.nb-gauge .g-bg { stroke: rgb(0 0 0 / .14); }
.nb-gauge .g-fg { stroke: #000; }
.nb-gauge-pct { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; line-height: 1; }
.nb-gauge-pct b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; display: block; }
.nb-gauge-pct span { font-size: 12px; font-weight: 500; opacity: 0.75; }
.nb-minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nb-mini { background: rgb(255 255 255 / .55); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nb-mini span { font-size: 12px; font-weight: 500; opacity: 0.75; }
.nb-mini b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-mini b.red { color: oklch(0.5 0.19 25); }

.nb-tile { border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nb-tile .nb-k { font-weight: 500; }
.nb-tile-big { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; margin: 6px 0 8px; }
.nb-tile.dark { background: var(--ink); color: #fff; border: 1px solid var(--ink-edge); }
.nb-tile.dark .nb-k { color: var(--on-ink); }
.nb-tile.dark .nb-tile-big { color: var(--chart-1); }
.nb-bd { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.nb-bd li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--ink-3); font-size: 13px; color: var(--on-ink); }
.nb-bd li b { color: #fff; font-weight: 600; }
.nb-bd-short { display: none; color: var(--on-ink); font-size: 13px; }
.nb-tile.light { background: var(--card); border: 1px solid var(--border); }
.nb-tile.light .nb-k, .nb-sub { color: var(--muted-foreground); }
.nb-sub { font-size: 13px; }
.nb-faces { display: flex; margin: 4px 0 10px; }
.nb-faces span { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--card); margin-left: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.nb-faces span:first-child { margin-left: 0; }
.nb-faces .amber { background: var(--chart-1); color: #000; }
.nb-faces .ink { background: var(--ink); color: #fff; }
.nb-faces .grey { background: var(--secondary); }
.nb-faces .blue { background: var(--blue-soft); color: var(--blue-ink); }
.nb-faces .green { background: var(--green-soft); color: var(--green-ink); }
.nb-ready { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--green-ink); }
.nb-ready.plain { color: var(--foreground); }
.nb-link { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; }
.nb-link:hover, .nb-hero-link:hover { text-decoration: underline; }

.nb-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; min-width: 0; }
.nb-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.nb-card-h h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.nb-card-h > span { font-size: 13px; color: var(--muted-foreground); text-align: right; }
.nb-n { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--chart-1); color: #000; font-weight: 600; letter-spacing: 0; }

.nb-att, .nb-quick { padding: 6px 10px 10px; }
.nb-att a, .nb-quick a { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; }
.nb-att a:hover, .nb-quick a:hover { background: var(--muted); }
.nb-quick a > .ic { color: var(--muted-foreground); }
.nb-chip { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--muted); }
.nb-chip.red { background: var(--red-soft); color: var(--red-ink); }
.nb-chip.amber { background: var(--amber-soft); color: var(--amber-ink); }
.nb-chip.blue { background: var(--blue-soft); color: var(--blue-ink); }
.nb-chip.green { background: var(--green-soft); color: var(--green-ink); }
.nb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb-t b { font-weight: 500; overflow-wrap: anywhere; }
.nb-t > span { font-size: 13px; color: var(--muted-foreground); }
.nb-t .nb-m { display: none; font-size: 12px; font-weight: 500; margin-top: 2px; color: var(--muted-foreground); }
.nb-t .nb-m.red { color: var(--red-ink); }
.nb-pill { flex: none; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px; white-space: nowrap; background: var(--muted); }
.nb-pill.red { background: var(--red-soft); color: var(--red-ink); }
.nb-pill.green { background: var(--green-soft); color: var(--green-ink); }
.nb-pill.dark { background: var(--ink); color: #fff; }

.nb-card.dark { background: var(--ink); color: #fff; border-color: var(--ink-edge); }
.nb-card.dark .nb-card-h > span, .nb-card.dark .db-empty { color: var(--on-ink); }
.nb-due { padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.nb-due a { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 14px; background: var(--ink-2); }
.nb-due a:hover { background: var(--ink-3); }
.nb-due .nb-t > span { color: var(--on-ink); }
.nb-date { flex: none; width: 48px; height: 52px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; background: var(--ink-3); }
.nb-date.pay { background: var(--chart-1); color: #000; }
.nb-date.late { background: var(--destructive); color: #fff; }
.nb-date small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; opacity: 0.8; }
.nb-date b { font-size: 19px; font-weight: 700; }

.nb-prog { padding: 8px 22px 20px; display: flex; flex-direction: column; }
.nb-prog li + li { border-top: 1px solid var(--line); }
.nb-prog a { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 46px; align-items: center; gap: 16px; padding: 11px 0; }
.nb-prog a:hover b { text-decoration: underline; }
.nb-track { height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.nb-track i { display: block; height: 100%; border-radius: 99px; background: var(--foreground); }
.nb-track i.done { background: var(--chart-1); }
.nb-pct { text-align: right; font-weight: 600; }

.nb-feed { padding: 6px 22px 18px; }
.nb-feed li { display: flex; gap: 12px; padding: 10px 0; }
.nb-feed li + li { border-top: 1px solid var(--line); }
.nb-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); }
.nb-ic.amber { background: var(--chart-1); color: #000; }
.nb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.nb-txt a:hover { text-decoration: underline; }
.nb-txt time { font-size: 12px; color: var(--muted-foreground); }

@media (min-width: 701px) and (max-width: 1099px) {
  .nb-head h1 { font-size: 32px; }
  .nb-datechip { display: none; }
  .nb-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nb-hero { grid-column: 1 / -1; }
  .nb-mid, .nb-low { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .nb { gap: 14px; }
  .nb-head { flex-wrap: nowrap; align-items: center; }
  .nb-head h1 { font-size: 28px; }
  .nb-head-r { display: none; }
  .nb-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nb-hero { grid-column: 1 / -1; padding: 20px; border-radius: 22px; gap: 16px; }
  .nb-big { font-size: 34px; margin-top: 10px; }
  .nb-big.sm { font-size: 24px; }
  .nb-of { font-size: 13px; }
  .nb-gauge { width: 112px; margin-top: 4px; }
  .nb-gauge-pct b { font-size: 20px; }
  .nb-gauge-pct span { display: none; }
  .nb-minis { gap: 6px; }
  .nb-mini { padding: 10px; border-radius: 12px; }
  .nb-mini b { font-size: 15px; }
  .nb-mini span { font-size: 11px; }
  .nb-tile { padding: 18px; border-radius: 22px; }
  .nb-tile-big { font-size: 44px; }
  .nb-bd { display: none; }
  .nb-bd-short { display: block; }
  .nb-faces span { width: 28px; height: 28px; font-size: 10px; }
  .nb-faces span:nth-child(n+5) { display: none; }
  .nb-link { display: none; }
  .nb-mid, .nb-low { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .nb-card { border-radius: 22px; }
  .nb-card-h { padding: 18px 18px 6px; }
  .nb-att, .nb-quick { padding: 4px 6px 8px; }
  .nb-att a, .nb-quick a { padding: 10px; gap: 12px; }
  .nb-att .nb-pill { display: none; }
  .nb-t .nb-m { display: block; }
  .nb-prog { padding: 4px 18px 16px; }
  .nb-prog a { grid-template-columns: minmax(0, 1fr) 40px; gap: 6px 12px; }
  .nb-prog .nb-track { grid-column: 1 / -1; grid-row: 2; }
  .nb-feed { padding: 4px 18px 14px; }
  .db-empty { padding: 6px 18px 18px; }
}

/* ---------- C · Pulse */
.pl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pl-head p { color: var(--muted-foreground); font-weight: 500; }
.pl-head h1 { font-size: 34px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.pl-head h1 em { font-style: normal; color: var(--amber-ink); }
.pl-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 99px; background: var(--primary); color: var(--primary-foreground); font-weight: 500; white-space: nowrap; }
.pl-btn:hover { opacity: .88; }

.pl-week { margin-top: 24px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.pl-day { border-radius: 16px; background: var(--muted); padding: 12px 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pl-day small { font-size: 12px; color: var(--muted-foreground); font-weight: 500; }
.pl-day b { font-size: 20px; font-weight: 600; }
.pl-dots { height: 6px; display: flex; gap: 3px; margin-top: 4px; }
.pl-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--chart-1); }
.pl-dots i.blue { background: var(--chart-2); }
.pl-what { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pl-day.is-today { background: var(--primary); color: var(--primary-foreground); }
.pl-day.is-today small, .pl-day.is-today .pl-what { color: color-mix(in oklch, var(--primary-foreground) 75%, transparent); }

.pl-grid { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.pl-sec { min-width: 0; }
.pl-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pl-sec-h h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.pl-sec-h a, .pl-sec-h > span { font-size: 13px; color: var(--muted-foreground); font-weight: 500; }
.pl-sec-h a:hover { color: var(--foreground); }

.pl-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.pl-projects.one { grid-template-columns: minmax(0, 1fr); }
.pl-projects-empty, .pl-money { background: var(--card); border: 1px solid var(--border); border-radius: 20px; }
.pl-projects-empty .db-empty { padding: 22px; }
.pl-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: box-shadow .15s; min-width: 0; }
.pl-card:hover { box-shadow: 0 8px 24px rgb(0 0 0 / .07); }
.pl-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-card-top .pl-t b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.pl-t > span { font-size: 13px; color: var(--muted-foreground); }
.pl-ring { width: 58px; height: 58px; flex: none; position: relative; }
.pl-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pl-ring circle { fill: none; stroke-width: 4; }
.pl-ring .bg { stroke: var(--secondary); }
.pl-ring .fg { stroke: var(--foreground); stroke-linecap: round; }
.pl-ring.done .fg { stroke: var(--chart-1); }
.pl-ring.late .fg { stroke: var(--destructive); }
.pl-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.pl-stage { font-size: 13px; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.pl-stage span { color: var(--muted-foreground); font-size: 12px; }
.pl-flags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.pl-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--muted); color: var(--muted-foreground); }
.pl-tag.red { background: var(--red-soft); color: var(--red-ink); }
.pl-tag.amber { background: var(--amber-soft); color: var(--amber-ink); }
.pl-tag.blue { background: var(--blue-soft); color: var(--blue-ink); }
.pl-tag.green { background: var(--green-soft); color: var(--green-ink); }
.pl-tag.ok { background: transparent; padding-left: 0; }

.pl-rail { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.pl-needs { display: flex; flex-direction: column; gap: 8px; }
.pl-needs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--muted); }
.pl-needs a:hover { background: var(--secondary); }
.pl-needs .pl-t b { font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.pl-needs .pl-t > span { font-size: 12px; }
.pl-go { color: var(--muted-foreground); }
.pl-clear { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 16px; background: var(--muted); color: var(--muted-foreground); }
.pl-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted-foreground); }
.pl-dot.red { background: var(--destructive); }
.pl-dot.amber { background: var(--chart-1); }
.pl-dot.blue { background: var(--chart-2); }
.pl-dot.green { background: var(--success); }
.pl-dot.ink { background: var(--foreground); }

.pl-money { padding: 20px; }
.pl-money .db-empty { padding: 0; }
.pl-money-body { display: flex; align-items: center; gap: 20px; }
.pl-donut { width: 128px; height: 128px; flex: none; position: relative; }
.pl-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pl-donut circle { fill: none; stroke-width: 5; }
.pl-donut .d-bg { stroke: var(--secondary); }
.pl-donut .d-ink { stroke: var(--foreground); }
.pl-donut .d-amber { stroke: var(--chart-1); }
.pl-donut .d-red { stroke: var(--destructive); }
.pl-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.pl-donut-c b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.pl-donut-c span { font-size: 11px; color: var(--muted-foreground); }
.pl-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pl-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.pl-legend li span:not(.pl-dot) { font-size: 12px; color: var(--muted-foreground); }
.pl-legend li b { grid-column: 2; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.pl-legend li b.red { color: var(--red-ink); }
.pl-cur { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted-foreground); gap: 10px; }
.pl-cur b { color: var(--foreground); font-weight: 600; }
.pl-cur-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--chart-1); overflow: hidden; max-width: 110px; }
.pl-cur-bar i { display: block; height: 100%; background: var(--foreground); }

.pl-acts li { display: flex; gap: 10px; padding: 9px 0; font-size: 13px; }
.pl-acts li + li { border-top: 1px solid var(--line); }
.pl-acts .pl-dot { margin-top: 5px; width: 8px; height: 8px; }
.pl-acts div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pl-acts a:hover { text-decoration: underline; }
.pl-acts time { display: block; font-size: 12px; color: var(--muted-foreground); }
.pl-sec-acts .db-empty { padding: 0; }

@media (min-width: 701px) and (max-width: 1099px) {
  .pl-head h1 { font-size: 30px; }
  .pl-grid { grid-template-columns: minmax(0, 1fr); }
  .pl-grid > .pl-rail { order: -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .pl-rail .pl-sec-needs { grid-column: 1 / -1; grid-row: 1; }
  .pl-money-body { flex-direction: column; align-items: stretch; }
  .pl-donut { align-self: center; }
  .pl-legend { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
}
@media (max-width: 700px) {
  .pl-head { flex-wrap: nowrap; }
  .pl-head h1 { font-size: 26px; }
  .pl-head .pl-btn { display: none; }
  .pl-week { margin: 18px 0 0; gap: 6px; }
  .pl-day { padding: 9px 2px 10px; border-radius: 14px; }
  .pl-day b { font-size: 17px; }
  .pl-what { display: none; }
  .pl-grid { margin-top: 22px; display: flex; flex-direction: column; align-items: stretch; gap: 26px; }
  .pl-grid > .pl-rail { display: contents; }
  .pl-sec-needs { order: 1; }
  .pl-sec-projects { order: 2; }
  .pl-sec-money { order: 3; }
  .pl-sec-acts { order: 4; }
  .pl-projects:not(.one) { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 6px; gap: 12px; scrollbar-width: none; }
  .pl-projects::-webkit-scrollbar { display: none; }
  .pl-projects:not(.one) .pl-card { flex: 0 0 78%; scroll-snap-align: start; scroll-margin-left: 16px; }
  .pl-money-body { gap: 16px; }
  .pl-donut { width: 112px; height: 112px; }
}
