/* =========================================================
   Cadence — design system v3
   Calm, modern, instrument-like. One accent per founder, ink
   for the primary action, colour only where state needs it.
   Fonts: Instrument Sans (UI) · Instrument Serif (editorial)
          JetBrains Mono (dates, times, numbers in columns)
   ========================================================= */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  color-scheme: light;

  --font-ui:    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg:            #f4f5f8;
  --surface:       #ffffff;
  --surface-2:     #f3f4f7;
  --surface-3:     #e9ebf0;
  --border:        rgba(15, 18, 28, .08);
  --border-strong: rgba(15, 18, 28, .16);

  --text:          #0c0f16;
  --text-2:        #5b6474;
  --text-3:        #8a92a2;

  --ink:           #0f1217;
  --ink-hover:     #232833;
  --ink-contrast:  #ffffff;

  --success:       #0e8a63;
  --success-soft:  #e3f5ec;
  --warn:          #995c0d;
  --warn-soft:     #fbf0db;
  --danger:        #c73f3d;
  --danger-soft:   #fbe8e7;
  --watch:         #0b7c8a;  /* Monitoring: done on our side, waiting on a result */
  --watch-soft:    #e1f3f5;
  --hot:           #d9530f;
  --hot-soft:      #fff1e6;

  --ring-track:    #e6e8ee;

  --shadow-card: 0 1px 2px rgba(15, 18, 28, .04), 0 8px 24px -12px rgba(15, 18, 28, .10);
  --shadow-pop:  0 20px 50px -16px rgba(15, 18, 28, .28), 0 2px 8px rgba(15, 18, 28, .06);
  --shadow-lift: 0 12px 30px -14px rgba(15, 18, 28, .22);

  --r-xs: 7px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --side: 236px;
  --maxw: 1240px;

  --ease:   cubic-bezier(.22, 1, .36, 1);
  --fast:   .16s var(--ease);
  --med:    .32s var(--ease);
  --glow-a: 14%;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #07090d;
  --surface:       #0e1117;
  --surface-2:     #141922;
  --surface-3:     #1b212c;
  --border:        rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .15);

  --text:          #eef1f6;
  --text-2:        #a1a9b8;
  --text-3:        #737d8f;

  --ink:           #f2f4f8;
  --ink-hover:     #ffffff;
  --ink-contrast:  #0b0e14;

  --success:       #35c08f;
  --success-soft:  rgba(53, 192, 143, .13);
  --warn:          #dcab5a;
  --warn-soft:     rgba(220, 171, 90, .13);
  --danger:        #ef7472;
  --danger-soft:   rgba(239, 116, 114, .13);
  --watch:         #4cc3d0;
  --watch-soft:    rgba(76, 195, 208, .13);
  --hot:           #ff9152;
  --hot-soft:      rgba(255, 145, 82, .11);

  --ring-track:    #1b212c;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
  --shadow-pop:  0 24px 60px -18px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .05);
  --shadow-lift: 0 16px 36px -18px rgba(0, 0, 0, .9);
  --glow-a: 22%;
}

/* Identity accents — set on <html> (the viewer) and on any founder-scoped
   element. Light and dark are separate steps of the same hue, validated for
   contrast and separation on their surfaces. */
[data-accent="indigo"] { --accent: #4353f0; }
[data-accent="teal"]   { --accent: #0b9488; }
[data-accent="violet"] { --accent: #9d3fd0; }
[data-accent="amber"]  { --accent: #b4690e; }
[data-accent="rose"]   { --accent: #d63a6e; }
:root[data-theme="dark"] [data-accent="indigo"], :root[data-theme="dark"][data-accent="indigo"] { --accent: #5470f0; }
:root[data-theme="dark"] [data-accent="teal"],   :root[data-theme="dark"][data-accent="teal"]   { --accent: #1aa896; }
:root[data-theme="dark"] [data-accent="violet"], :root[data-theme="dark"][data-accent="violet"] { --accent: #bd52dc; }
:root[data-theme="dark"] [data-accent="amber"],  :root[data-theme="dark"][data-accent="amber"]  { --accent: #c2872f; }
:root[data-theme="dark"] [data-accent="rose"],   :root[data-theme="dark"][data-accent="rose"]   { --accent: #e4568a; }

[data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 30%, var(--border));
  --accent-glow: color-mix(in srgb, var(--accent) 45%, transparent);
  --focus:       color-mix(in srgb, var(--accent) 32%, transparent);
}

/* ── Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv05";
}
/* The canvas: two soft accent glows at the top. Depth, not decoration. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 360px at 18% -8%, color-mix(in srgb, var(--accent) var(--glow-a), transparent), transparent 70%),
    radial-gradient(640px 320px at 92% -6%, color-mix(in srgb, #9d3fd0 calc(var(--glow-a) / 2), transparent), transparent 70%);
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.012em; }
::selection { background: var(--accent-soft); }
:where(a, button, [tabindex], input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs);
}

.icon { flex: none; vertical-align: middle; }
.muted  { color: var(--text-3); }
.subtle { color: var(--text-2); }
.mono   { font-family: var(--font-mono); font-size: .92em; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
[hidden] { display: none !important; }

/* Entrance: things rise in, staggered by --i. Reduced motion kills it wholesale. */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .42s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ── Shell ──────────────────────────────────────────── */
.shell-side {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #9d3fd0));
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}
.brand-text small { display: block; margin-top: -2px; font-size: 10.5px; font-weight: 500; color: var(--text-3); letter-spacing: .02em; }

.nav { display: none; }
.side-foot { display: none; }
/* Mobile: the top bar shows brand + theme + avatar; nav lives in the tab bar. */
@media (max-width: 1023px) {
  /* A fixed-viewport app: nothing may widen the page sideways on a phone. */
  html, body { overflow-x: hidden; }
  .shell-side { justify-content: space-between; }
  .side-foot { display: flex; align-items: center; gap: 6px; }
  .theme-label, .user-name, .user-caret { display: none !important; }
  .user-btn { padding: 2px; border: 0; background: none; }
  .theme-btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
}

/* Desktop: a real sidebar. */
@media (min-width: 1024px) {
  .shell-main { margin-left: var(--side); }
  .shell-side {
    position: fixed; inset: 0 auto 0 0; width: var(--side);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 18px 12px 14px;
    border-right: 1px solid var(--border); border-bottom: 0;
    background: color-mix(in srgb, var(--surface) 70%, var(--bg));
    backdrop-filter: none;
  }
  .brand { padding: 4px 8px 18px; }
  .brand-mark { width: 32px; height: 32px; }
  .nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-sep { height: 1px; margin: 10px 8px; background: var(--border); }
  .side-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  min-height: 38px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background var(--fast), color var(--fast), transform var(--fast);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-card); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 3px; height: 18px;
  border-radius: 0 3px 3px 0; background: var(--accent); transform: translateY(-50%);
}
.nav-ico { display: grid; place-items: center; color: var(--text-3); transition: color var(--fast); }
.nav-item:hover .nav-ico { color: var(--text-2); }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.nav-badge.is-danger { background: var(--danger-soft); color: var(--danger); }
.nav-badge.is-soft { background: var(--surface-3); color: var(--text-2); }
.nav-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.theme-btn {
  display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  font-size: 12.5px; font-weight: 550;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); }
:root[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none !important; }
.only-light, .only-dark { display: inline-grid; place-items: center; }

.usermenu { position: relative; }
.user-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color var(--fast), background var(--fast);
}
.user-btn:hover { border-color: var(--border-strong); }
.user-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; }
.user-name small { display: block; font-size: 11px; font-weight: 450; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-caret { color: var(--text-3); display: grid; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity var(--fast), transform var(--fast);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 1024px) { .menu { left: 0; right: auto; top: auto; bottom: calc(100% + 8px); transform: translateY(4px) scale(.98); } }
.menu a, .menu button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; border-radius: var(--r-xs);
  background: none; color: var(--text-2); text-align: left;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
/* A menu that drops down from a button (downloads), on every screen size. */
.dl { position: relative; }
.menu.is-down { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; min-width: 200px; transform: translateY(-4px) scale(.98); }
.menu.is-down.open { transform: none; }
.menu-label { padding: 6px 10px 4px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); white-space: nowrap; }
.menu a small { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* Bottom tab bar — mobile only */
.tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(6, 8, 12, .5); backdrop-filter: blur(4px); }
.sheet-panel {
  position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 8px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  animation: sheetUp .28s var(--ease);
}
@keyframes sheetUp { from { transform: translateY(20px); opacity: 0; } }
.sheet-panel a, .sheet-panel button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 0; border-radius: var(--r-sm); background: none;
  font-size: 14.5px; font-weight: 500; color: var(--text); cursor: pointer;
}
.sheet-panel a:hover, .sheet-panel button:hover { background: var(--surface-2); }
.sheet-panel .icon { color: var(--text-3); }
@media (max-width: 1023px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 0 4px; border: 0; border-radius: var(--r-sm); background: none;
    color: var(--text-3); font-size: 10.5px; font-weight: 600; cursor: pointer;
  }
  .tabbar a.active { color: var(--accent); }
  .tab-dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
  .tab-badge {
    position: absolute; top: 2px; right: calc(50% - 20px);
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
    display: grid; place-items: center;
    background: var(--danger); color: #fff; font-style: normal;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  }
  .tab-badge.is-soft { background: var(--accent); }
  .shell-main { padding-bottom: 84px; }
}

/* ── Page frame ─────────────────────────────────────── */
.page { max-width: var(--maxw); margin: 0 auto; padding: 26px 28px 80px; }
.page.wide { max-width: 1440px; }
.page.narrow { max-width: 760px; }
@media (max-width: 720px) { .page { padding: 18px 16px 90px; } }

.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ph-eyebrow {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
}
.ph-eyebrow .icon { color: var(--accent); }
.ph-title { margin-top: 6px; font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.ph-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.ph-sub { margin-top: 6px; font-size: 14px; color: var(--text-2); max-width: 62ch; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .ph-title { font-size: 25px; } }

/* ── Primitives ─────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title, .section-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
}
.card-title .icon { color: var(--text-3); }
.card-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 550; color: var(--text-3); transition: color var(--fast); }
.card-link:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 14px; min-height: 36px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: var(--ink-contrast); box-shadow: 0 8px 20px -10px rgba(15, 18, 28, .5); }
.btn-primary:hover { background: var(--ink-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-soft:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { min-height: 42px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.danger-text { color: var(--danger) !important; }

.iconbtn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.mini {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-xs); background: none; color: var(--text-3); cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.mini:hover { background: var(--surface-3); color: var(--text); }
.mini.danger:hover { background: var(--danger-soft); color: var(--danger); }
.mini.good:hover { background: var(--success-soft); color: var(--success); }

.input, textarea, select {
  width: 100%; min-height: 36px; padding: 8px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13.5px; outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select { background: var(--surface-2); border-color: var(--border); }
.input::placeholder, textarea::placeholder { color: var(--text-3); }
.input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
textarea { min-height: 80px; line-height: 1.55; resize: vertical; }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"], input[type="time"] { font-family: var(--font-mono); font-size: 12.5px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span, .field > span { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
label.field small, .field small { font-weight: 450; color: var(--text-3); }
.hint { margin-top: 5px; font-size: 12px; color: var(--text-3); }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: 12.5px; }
.check-inline { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 13.5px; cursor: pointer; }
.check-inline input { width: 16px; height: 16px; min-height: 0; margin-top: 2px; accent-color: var(--accent); flex: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: 36px; height: 21px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border-strong); transition: background var(--fast), border-color var(--fast);
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform var(--med);
}
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(15px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Segmented control */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--border); }
.seg a, .seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }

/* Chips & pills */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.chip.is-danger { background: var(--danger-soft); color: var(--danger); }
.chip.is-warn   { background: var(--warn-soft); color: var(--warn); }
.chip.is-good   { background: var(--success-soft); color: var(--success); }
.chip.is-accent { background: var(--accent-soft); color: var(--accent); }
.chip.is-ghost  { background: transparent; border: 1px solid var(--border); }
.chip .icon { opacity: .8; }
.pill {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--surface-3); color: var(--text-2);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.pill.is-danger { background: var(--danger-soft); color: var(--danger); }
.pill.is-good { background: var(--success-soft); color: var(--success); }
.pill.is-warn { background: var(--warn-soft); color: var(--warn); }
.pill.is-accent { background: var(--accent-soft); color: var(--accent); }
.pill.is-watch { background: var(--watch-soft); color: var(--watch); }
.you-chip {
  padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}

.avatar {
  flex: none; overflow: hidden; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); font-weight: 650; letter-spacing: .02em;
}
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar-ring { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.byline { display: inline-flex; align-items: center; gap: 6px; }
.byline .avatar { width: 18px; height: 18px; font-size: 8px; }

.empty { padding: 10px 2px; color: var(--text-3); font-size: 13px; }
.empty a { color: var(--accent); font-weight: 600; }
.empty-state { text-align: center; padding: 44px 24px; }
.empty-ico {
  width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center;
  border-radius: var(--r); background: var(--accent-soft); color: var(--accent);
}
.empty-state h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { max-width: 44ch; margin: 0 auto 16px; color: var(--text-2); }

/* Stat tile: label · value · delta */
.stat { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.stat small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.stat b { display: block; margin-top: 3px; font-size: 24px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; }
.stat b.is-good { color: var(--success); }
.stat b.is-bad { color: var(--danger); }
.stat .delta { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.stat .delta.is-up { color: var(--success); }
.stat .delta.is-down { color: var(--warn); }

/* Rings — a meter: track is a lighter step of the same hue. */
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { display: block; transform: rotate(-90deg); }
.ring .track { stroke: var(--ring-track); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); filter: drop-shadow(0 0 5px var(--accent-glow)); }
.ring .ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .ring-num b { font-size: 16px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.ring .ring-num span { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.ring.lg .ring-num b { font-size: 34px; }
.ring.xs .ring-num b { font-size: 11.5px; }
.ring.is-complete .bar { stroke: var(--success); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--success) 50%, transparent)); }

/* Tooltip layer (shared, JS-positioned) */
.tip {
  position: fixed; z-index: 95; pointer-events: none;
  max-width: 260px; padding: 7px 10px; border-radius: var(--r-xs);
  background: var(--ink); color: var(--ink-contrast); font-size: 12px; line-height: 1.4;
  box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(3px);
  transition: opacity .12s, transform .12s;
}
.tip.show { opacity: 1; transform: none; }
.tip b { font-weight: 650; }

/* ── Toast / flash ──────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); }
@media (max-width: 1023px) { .toast-wrap { bottom: 92px; } }
@media (min-width: 1024px) { .toast-wrap { left: calc(50% + var(--side) / 2); } }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 10px 14px;
  border-radius: var(--r-sm); background: var(--ink); color: var(--ink-contrast);
  box-shadow: var(--shadow-pop); font-size: 13px; font-weight: 550;
  opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast .ok { color: var(--success); }
.toast .err { color: var(--danger); }
.saved-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-size: 11.5px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.saved-pill.show { opacity: 1; }
.flash-wrap { position: fixed; top: 16px; left: 50%; z-index: 80; width: min(460px, 92vw); display: flex; flex-direction: column; gap: 8px; transform: translateX(-50%); }
@media (min-width: 1024px) { .flash-wrap { left: calc(50% + var(--side) / 2); } }
@media (max-width: 1023px) { .flash-wrap { top: 66px; } }
.flash { padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-pop); font-size: 13.5px; font-weight: 550; animation: rise .3s var(--ease); }
.flash.success { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.flash.error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ── Modal ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 20px;
  background: rgba(6, 8, 12, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 460px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  transform: translateY(12px) scale(.98); transition: transform .24s var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-wide { max-width: 580px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; }
.modal-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.modal-body { padding: 4px 22px 18px; max-height: min(70vh, 720px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); }
.modal-subject { margin-bottom: 14px; padding: 10px 12px; border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }

/* ── Confetti ───────────────────────────────────────── */
#confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

/* =========================================================
   TODAY — the task tracker. One screen: the day's line, the
   habits in a strip, both founders' work side by side, and
   the follow-ups. Nothing else competes for the eye.
   ========================================================= */

/* The day's line: one quiet row, author on the right. */
.tq {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 11px 16px 11px 12px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.tq-mark { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.tq-mark .icon { fill: currentColor; stroke: none; opacity: .9; }
.tq blockquote { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 500; line-height: 1.45; letter-spacing: -0.005em; color: var(--text); text-wrap: pretty; }
.tq figcaption { flex: none; max-width: 40%; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: right; line-height: 1.3; }
.tq figcaption::before { content: "— "; }
.tq figcaption span { display: block; font-weight: 450; color: var(--text-3); }
@media (max-width: 760px) {
  .tq { flex-wrap: wrap; align-items: flex-start; padding: 12px 14px; }
  .tq-mark { display: none; }
  .tq blockquote { flex-basis: 100%; font-size: 14.5px; }
  .tq figcaption { max-width: none; text-align: left; line-height: 1.4; }
  .tq figcaption span { display: inline; }
  .tq figcaption span::before { content: " · "; }
}

/* The header row: date + greeting on the left, habits on the right. */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 2px 2px 16px; }
.hero-left { min-width: 0; flex: 1 1 320px; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
}
.hero-title { margin-top: 6px; font-weight: 650; font-size: 30px; line-height: 1.1; letter-spacing: -0.03em; color: var(--text); }
.hero-title span { color: var(--accent); }
.hero-meet { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.hero-meet a { display: inline-flex; align-items: center; gap: 5px; font-weight: 550; transition: color var(--fast); }
.hero-meet a:hover { color: var(--accent); }
.hero-meet b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--text); }
.hero-meet .icon { color: var(--text-3); }
.datenav { display: inline-flex; align-items: center; gap: 4px; }
.datenav .iconbtn { width: 28px; height: 28px; border-radius: 8px; }
.datenav .date-pill { padding: 0 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 720px) { .hero-title { font-size: 26px; } }

/* Habits: a slim strip. Tap a chip to tick it; the ring keeps the score. */
.hs {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 100%;
  padding: 7px 12px 7px 9px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.hs-col { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hs-team { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.hs-col.is-them { gap: 8px; justify-content: space-between; }
.hs-col.is-them .hs-who { flex-direction: row; align-items: baseline; gap: 6px; }
.hs-who { display: flex; flex-direction: column; line-height: 1.2; }
.hs-who b { font-size: 13px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.hs-who small { display: block; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.hs-who small .icon { vertical-align: -1px; }
.hs-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hchip { position: relative; display: inline-flex; align-items: center; }
.hchip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 5px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast), transform var(--fast);
}
.hchip-btn:hover { border-color: var(--accent); color: var(--text); }
.hchip-ico, .hchip-check { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.hchip-ico { background: var(--accent-soft); color: var(--accent); }
.hchip-check { display: none; background: rgba(255, 255, 255, .22); color: #fff; }
.hchip-btn.checked { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px var(--accent-glow); }
.hchip-btn.checked .hchip-ico { display: none; }
.hchip-btn.checked .hchip-check { display: grid; }
.hchip-btn em { font-style: normal; font-weight: 500; font-size: 11.5px; opacity: .8; }
.hchip-btn em:empty { display: none; }
.hchip-btn.is-static { cursor: default; }
.hchip-btn.is-static:hover { border-color: var(--border-strong); color: var(--text-2); }
.hchip-btn.pop { animation: pop .38s var(--ease); }
.hchip-more {
  position: absolute; right: -5px; top: -5px; width: 17px; height: 17px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-3); cursor: pointer;
  opacity: 0; transition: opacity var(--fast), color var(--fast), border-color var(--fast);
}
.hchip-more:hover { color: var(--accent); border-color: var(--accent); }
.hchip:hover .hchip-more, .hchip.open-detail .hchip-more, .hchip-more:focus-visible { opacity: 1; }
@media (hover: none) { .hchip.has-detail .hchip-more { opacity: 1; } }
.hchip .habit-detail {
  display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px;
  padding: 10px; gap: 8px; flex-wrap: wrap; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
}
.hchip.open-detail .habit-detail { display: flex; }
.habit-detail .input { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.habit-detail .dur-input { width: 110px; }
.habit-detail .txt-input { flex: 1; min-width: 140px; }
.hd-hint { width: 100%; font-size: 11px; color: var(--text-3); }
.hs-yday { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; transition: filter var(--fast); }
.hs-yday:hover { filter: brightness(.95); }
.hs-dots { display: flex; gap: 4px; }
.hs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.hs-dot.done { background: var(--accent); box-shadow: none; }
.hs-empty { font-size: 12.5px; color: var(--text-3); }
.hs-empty a { color: var(--accent); font-weight: 600; }
.shake { animation: shake .35s var(--ease); }
@keyframes shake { 25% { transform: translateX(-2px); } 50% { transform: translateX(2px); } 75% { transform: translateX(-1px); } }
@keyframes pop { 40% { transform: scale(1.18); } }
@media (max-width: 900px) {
  .hero { align-items: stretch; }
  .hs { width: 100%; gap: 10px; }
  .hs-col.is-me { flex: 1 1 100%; flex-wrap: wrap; }
  .hs-col.is-me .hs-chips { flex-basis: 100%; }
  .hs-team { padding-left: 0; border-left: 0; }
}

/* ── In motion: one list, everyone ──────────────────────
   A sheet of rows, no boxes inside it. Every row reads the same way,
   left to right: done? · how urgent · what · who · when · where it stands. */
.fx { margin-top: 20px; }
.fx-head { display: flex; align-items: flex-end; gap: 10px 16px; flex-wrap: wrap; padding: 0 4px 12px; }
.fx-titles { flex: 1 1 260px; min-width: 0; }
.fx-titles h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
.fx-titles p { margin-top: 2px; font-size: 13px; color: var(--text-3); }
.fx-titles p b { color: var(--danger); font-weight: 650; }
.fx-who { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); }
.fx-who button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border: 0; border-radius: 999px; background: none; color: var(--text-2); cursor: pointer;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.fx-who button img { width: 18px; height: 18px; margin-left: -6px; border-radius: 50%; object-fit: cover; }
.fx-who button b { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-2); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--text-3); }
.fx-who button:hover { color: var(--text); }
.fx-who button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.fx-who button.on b { background: var(--ink); color: var(--ink-contrast); }
.fx-board { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); transition: color var(--fast), gap var(--fast); }
.fx-board:hover { color: var(--accent); gap: 8px; }

.fx-sheet { position: relative; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }

/* The adder: the first line of the sheet. Options appear while you use it. */
.fx-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; transition: background var(--fast); }
.fx-add:focus-within, .fx-add.has-text { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.fx-add-ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--accent); color: #fff; }
.fx-add-input { flex: 1; min-width: 160px; height: 34px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px; font-weight: 500; outline: 0; }
.fx-add-input::placeholder { color: var(--text-3); font-weight: 450; }
.fx-kbd { font-family: var(--font-mono); font-size: 10.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); color: var(--text-3); }
.fx-add:focus-within .fx-kbd, .fx-add.has-text .fx-kbd { display: none; }
.fx-add-opts { display: none; align-items: center; gap: 8px; flex-wrap: wrap; flex-basis: 100%; padding: 2px 0 2px 30px; }
/* Only once you've typed: opening and closing on focus alone would shift the list under the pointer. */
.fx-add.has-text .fx-add-opts { display: flex; }
.fx-pick { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.fx-pick button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--text-2); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background var(--fast), color var(--fast), box-shadow var(--fast); }
.fx-pick button:hover { color: var(--text); }
.fx-pick button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.fx-pick-prio button { padding: 0 8px; }
.fx-date { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 7px; color: var(--text-3); cursor: pointer; }
.fx-date input { width: 0; padding: 0; border: 0; opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.fx-date.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.fx-date b { font-size: 12px; font-weight: 600; }
.fx-add-go { margin-left: auto; }

/* Groups: a quiet label, then rows. */
.fx-group + .fx-group, .fx-add + .fx-group { border-top: 0; }
.fx-gh { display: flex; align-items: center; gap: 8px; padding: 14px 18px 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.fx-gh b { min-width: 18px; height: 17px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-2); font-size: 10.5px; color: var(--text-2); letter-spacing: 0; }
.fx-gdot { width: 8px; height: 8px; border-radius: 50%; }
.fx-gdot.s-doing { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fx-gdot.s-next { box-shadow: inset 0 0 0 2px var(--text-3); }
.fx-gdot.s-blocked { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.fx-gdot.s-watch { background: var(--watch); box-shadow: 0 0 0 3px var(--watch-soft); }
.fx-group:last-of-type .fx-rows { padding-bottom: 6px; }

/* A row. */
.fr {
  position: relative; display: grid; align-items: center; gap: 12px;
  grid-template-columns: 18px 14px minmax(0, 1fr) 112px 76px 118px;
  min-height: 46px; padding: 6px 14px 6px 18px;
  transition: background var(--fast), opacity .25s, transform .25s;
}
.fr + .fr::before { content: ""; position: absolute; left: 50px; right: 14px; top: 0; height: 1px; background: var(--border); }
.fr:hover, .fr.is-editing { background: var(--surface-2); }
.fr:hover::before, .fr:hover + .fr::before, .fr.is-editing::before, .fr.is-editing + .fr::before { opacity: 0; }
.fr.is-late { box-shadow: inset 2px 0 0 var(--danger); }
/* High priority: a warm wash and an orange edge, so it reads first. */
.fr.is-high { background: linear-gradient(90deg, var(--hot-soft), color-mix(in srgb, var(--hot-soft) 25%, transparent) 70%); box-shadow: inset 3px 0 0 var(--hot); }
.fr.is-high.is-late { box-shadow: inset 3px 0 0 var(--danger); }
.fr.is-high:hover, .fr.is-high.is-editing { background: color-mix(in srgb, var(--hot-soft) 75%, var(--surface-2)); }
.fr.is-high::before, .fr.is-high + .fr::before { opacity: 0; }
.fr.is-high .fr-title { font-weight: 620; }
.fr.is-low .fr-title { color: var(--text-2); }
.fr.is-done.is-high { background: none; box-shadow: none; }
.fr.is-out { display: none; }
.fr.is-leaving { opacity: 0; transform: translateX(10px); }
.fr.is-new { animation: frLand 1.6s var(--ease); }
@keyframes frLand { 0%, 35% { background: var(--accent-soft); } }

.fr-check {
  width: 18px; height: 18px; padding: 0; display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: transparent; cursor: pointer;
  transition: border-color var(--fast), background var(--fast), color var(--fast), transform var(--fast);
}
.fr-check:hover { border-color: var(--success); color: color-mix(in srgb, var(--success) 60%, transparent); transform: scale(1.08); }
.fr-check.checked { background: var(--success); border-color: var(--success); color: #fff; }
.fr-check.pop { animation: pop .3s var(--ease); }
@keyframes pop { 40% { transform: scale(1.22); } }

/* Priority as signal bars: one, two or three. Click to step Low → Medium → High. */
.fr-prio { position: relative; display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; padding: 0; border: 0; background: none; cursor: pointer; }
.fr-prio::after { content: ""; position: absolute; inset: -9px -6px; }
.fr-prio:disabled { cursor: default; }
.fr-prio:not(:disabled):hover i { filter: brightness(1.25); transform: scaleY(1.12); }
.fr-prio:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.fr-prio.bump { animation: pop .3s var(--ease); }
.fr-prio i { width: 3px; border-radius: 1px; background: var(--border-strong); transform-origin: bottom; transition: transform var(--fast), background var(--fast); }
.fr-prio i:nth-child(1) { height: 5px; } .fr-prio i:nth-child(2) { height: 8px; } .fr-prio i:nth-child(3) { height: 12px; }
.fr-prio.p-low i:nth-child(1) { background: var(--text-3); }
.fr-prio.p-med i:nth-child(-n+2) { background: var(--text-2); }
.fr-prio.p-high i { background: var(--hot); }

.fr-main { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; border-radius: 6px; }
.fr-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fr-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; letter-spacing: -0.005em; color: var(--text); }
.fr.is-late .fr-title { font-weight: 550; }
.fr-flags { flex: none; display: inline-flex; align-items: center; gap: 9px; color: var(--text-3); }
.fr-flags:empty { display: none; }
.fr-flag { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--text-3); transition: color var(--fast); }
a.fr-flag:hover { color: var(--accent); }
.fr-flag.is-warn { color: var(--warn); }
.fr-flag.fr-by { font-family: inherit; font-weight: 500; font-size: 11.5px; }

.fr-who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.fr-av { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 700; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.fr-both { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.fr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.fr-name.is-none { color: var(--text-3); font-style: italic; }

.fr-due { justify-self: start; padding: 2px 7px; margin-left: -7px; border-radius: 6px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.fr-due.is-today { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.fr-due.is-late { background: var(--danger-soft); color: var(--danger); font-weight: 650; }
.fr-due.is-none { color: var(--text-3); opacity: .7; }

.fr-status {
  justify-self: start; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); cursor: pointer;
  font-size: 12px; font-weight: 600; white-space: nowrap; transition: border-color var(--fast), background var(--fast), color var(--fast);
}
.fr-status i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.fr-status:hover { border-color: var(--border-strong); color: var(--text); }
.fr-status.s-doing { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.fr-status.s-doing i { background: var(--accent); box-shadow: none; }
.fr-status.s-blocked { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.fr-status.s-blocked i { background: var(--danger); box-shadow: none; }
.fr-status.s-watch { background: var(--watch-soft); border-color: transparent; color: var(--watch); }
.fr-status.s-watch i { background: var(--watch); box-shadow: none; }
.fr-status.s-done { background: var(--success-soft); border-color: transparent; color: var(--success); cursor: default; }
.fr-status.s-done i { background: var(--success); box-shadow: none; }

.fr.is-done .fr-title { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.fr.is-done .fr-prio, .fr.is-done .fr-who, .fr.is-done .fr-flags { opacity: .5; }

/* The grip: drag to move, click for Move to top / up / down / bottom. */
.fr-grip {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 26px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 5px; background: none; color: var(--text-3); cursor: grab; opacity: 0;
  transition: opacity var(--fast), background var(--fast), color var(--fast);
}
.fr:hover .fr-grip, .fr-grip:focus-visible, .fr-grip[aria-expanded="true"] { opacity: .85; }
.fr-grip:hover, .fr-grip[aria-expanded="true"] { background: var(--surface-3); color: var(--text); opacity: 1; }
.fr-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.fr-grip:active { cursor: grabbing; }
@media (hover: none) { .fr-grip { opacity: .5; } }
.fr.is-dragging { opacity: .4; }
.fr.drop-before::after, .fr.drop-after::after { content: ""; position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); pointer-events: none; z-index: 2; }
.fr.drop-before::after { top: -1px; }
.fr.drop-after::after { bottom: -1px; }
.fr.is-moved { animation: frLand 1.2s var(--ease); }

/* The status menu. */
.fr-menu { position: fixed; z-index: 80; min-width: 190px; padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: tlIn .14s var(--ease); }
.fr-menu button { width: 100%; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; font-size: 13px; font-weight: 550; text-align: left; }
.fr-menu button:hover, .fr-menu button:focus-visible { background: var(--surface-2); outline: 0; }
.fr-menu button.is-current { font-weight: 700; }
.fr-menu button.is-current::after { content: "✓"; margin-left: auto; color: var(--accent); font-size: 12px; }
.fr-menu small { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-3); }
.fr-menu i, .fx-pick-status i { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.fr-menu i.s-todo, .fx-pick-status i.s-todo { box-shadow: inset 0 0 0 2px var(--text-3); }
.fr-menu i.s-doing, .fx-pick-status i.s-doing { background: var(--accent); }
.fr-menu i.s-blocked, .fx-pick-status i.s-blocked { background: var(--danger); }
.fr-menu i.s-watch, .fx-pick-status i.s-watch { background: var(--watch); }
.fr-menu i.s-postponed, .fx-pick-status i.s-postponed { background: var(--warn); }
.fr-menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.fr-menu button:disabled { opacity: .38; cursor: default; background: none; }
.fr-move .icon { flex: none; color: var(--text-3); }
@keyframes tlIn { from { opacity: 0; transform: translateY(-4px); } }

/* The editor: opens under its row, inside the sheet. */
.fr-edit { display: grid; gap: 10px; padding: 12px 18px 14px 50px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); animation: tlIn .18s var(--ease); }
.fr-edit .fe-title { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600; }
.fr-edit textarea { width: 100%; min-height: 64px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.5; resize: vertical; }
.fr-edit .fe-title:focus, .fr-edit textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.fe-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fe-field { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text-3); font-size: 12px; font-weight: 600; }
.fe-field input, .fe-field select { min-height: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; outline: 0; box-shadow: none !important; }
.fe-field select { cursor: pointer; }
.fe-foot { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fe-gap { flex: 1; }
.fe-by { padding-left: 6px; font-size: 12px; color: var(--text-3); }
.fe-by:empty { display: none; }
.fe-link { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2); cursor: pointer; font-size: 12.5px; font-weight: 600; transition: background var(--fast), color var(--fast); }
.fe-link:hover { background: var(--surface-3); color: var(--text); }
.fe-link.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Done today: one quiet line at the bottom of the sheet. */
.fx-done { border-top: 1px solid var(--border); }
.fx-done-btn { width: 100%; display: flex; align-items: center; gap: 9px; padding: 12px 18px; border: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); background: none; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; transition: background var(--fast), color var(--fast); }
.fx-done-btn:hover { background: var(--surface-2); color: var(--text); }
.fx-done-btn .icon { color: var(--success); }
.fx-done-btn b { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--success-soft); color: var(--success); font-family: var(--font-mono); font-size: 10.5px; }
.fold-chev { margin-left: auto; display: grid; color: var(--text-3); transition: transform var(--med); }
.fold.is-open .fold-chev { transform: rotate(180deg); }
.fx-done .fold-body { padding-bottom: 6px; }

.fx-empty { display: grid; justify-items: center; gap: 4px; padding: 38px 20px 34px; text-align: center; font-size: 13px; color: var(--text-3); }
.fx-empty b { font-size: 14.5px; font-weight: 650; color: var(--text); }
.fx-empty a { color: var(--accent); font-weight: 600; }
.fx-empty-ico { width: 40px; height: 40px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); }

/* Follow-ups: same rows, same rhythm. */
.fx-fu { margin-top: 26px; }
.fu-row { position: relative; display: grid; align-items: center; gap: 12px; grid-template-columns: 18px 24px auto minmax(0, 1fr) auto; min-height: 46px; padding: 6px 18px; transition: background var(--fast), opacity .25s, transform .25s; }
.fu-row + .fu-row::before { content: ""; position: absolute; left: 50px; right: 14px; top: 0; height: 1px; background: var(--border); }
.fu-row:hover { background: var(--surface-2); }
.fu-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.fu-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.fu-row.is-late { box-shadow: inset 2px 0 0 var(--danger); }
.fu-row.is-out { opacity: 0; transform: translateX(10px); }
.fu-ico { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.fu-name { font-size: 14px; font-weight: 600; white-space: nowrap; transition: color var(--fast); }
.fu-name:hover { color: var(--accent); }
.fu-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-3); }
.fu-more { display: block; padding: 10px 18px 12px 50px; border-top: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.fu-more:hover { color: var(--accent); }

/* Tablet: drop the owner name, keep the face. */
@media (max-width: 1100px) {
  .fr { grid-template-columns: 18px 14px minmax(0, 1fr) 26px 70px 112px; gap: 10px; }
  .fr-name { display: none; }
}
/* Phone: two lines per row — the title, then the facts. */
@media (max-width: 680px) {
  .fx-head { align-items: flex-start; }
  .fx-titles { flex: 1 1 0; }
  .fx-board { height: auto; padding-top: 4px; }
  .fx-who { order: 3; width: 100%; justify-content: space-between; }
  .fx-who button { flex: 1; justify-content: center; padding: 0 8px; }
  .fr {
    grid-template-columns: 18px auto auto auto 1fr auto;
    grid-template-areas: "chk main main main main stat" "grip prio who due . .";
    row-gap: 4px; padding: 10px 12px 10px 14px;
  }
  .fr > .fr-check { grid-area: chk; } .fr > .fr-main { grid-area: main; } .fr > .fr-status { grid-area: stat; }
  .fr > .fr-prio { grid-area: prio; } .fr > .fr-who { grid-area: who; } .fr > .fr-due { grid-area: due; }
  .fr > .fr-grip { grid-area: grip; position: static; transform: none; justify-self: center; opacity: .55; }
  .fr-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .fr-flags { display: none; }
  .fr-name { display: inline; }
  .fr + .fr::before { left: 44px; }
  .fr-edit { padding: 12px 14px 14px; }
  .fu-row { grid-template-columns: 18px 24px minmax(0, 1fr) auto; }
  .fu-note { display: none; }
  .fx-add { padding-left: 14px; }
  .fx-add-opts { padding-left: 0; }
}

.more-link { display: inline-flex; align-items: center; gap: 3px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); transition: color var(--fast); }
.more-link:hover { color: var(--accent); }

/* Goals (on Progress) */
.goals { margin-top: 16px; }
/* Goals */
.goal-list { display: flex; flex-direction: column; }
.goal-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.goal-list .goal-row:last-child { border-bottom: 0; }
.goal-row.is-paused { opacity: .55; }
.goal-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--accent); }
.goal-dot.is-shared { background: var(--text-3); }
.goal-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-when { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.goal-when.is-late { color: var(--warn); font-weight: 600; }
.goal-bar { width: 88px; height: 6px; flex: none; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s var(--ease); }
.goal-row:not([data-accent]) .goal-bar i { background: var(--text-2); }
.goal-row.is-risk .goal-bar i { background: var(--warn); }
.goal-pct { flex: none; min-width: 42px; padding: 2px 4px; text-align: right; border: 0; border-radius: var(--r-xs); background: none; color: var(--text); font-family: var(--font-mono); font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--fast); }
.goal-pct:hover { background: var(--surface-2); }
.goal-pct-input { width: 60px; min-height: 26px; padding: 2px 6px; font-size: 12px; text-align: right; }
.goal-menu { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity var(--fast), background var(--fast), color var(--fast); }
.goal-row:hover .goal-menu, .goal-menu:focus-visible { opacity: 1; }
.goal-menu:hover { background: var(--surface-2); color: var(--text); }
@media (hover: none) { .goal-menu { opacity: 1; } }
.goal-row.goal-out { opacity: 0; transition: opacity .3s; }
.goal-empty { padding: 6px 0; font-size: 13px; color: var(--text-3); }
.goal-more { margin-top: 6px; }
.goal-more summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; color: var(--text-3); }
.goal-more summary::-webkit-details-marker { display: none; }
.goal-add { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.goal-add-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; }
.goal-add .input { min-height: 34px; }
.goal-add-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 12.5px; font-weight: 600; transition: color var(--fast); }
.goal-add-btn:hover { color: var(--accent); }
.goal-edit { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.goal-edit .input { min-height: 32px; font-size: 12.5px; }
.goal-edit-row { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 7px; }
.goal-edit .btn { min-height: 30px; }

/* =========================================================
   TASKS
   ========================================================= */
.dist { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); min-width: 160px; }
.dist-seg { height: 100%; transition: flex .5s var(--ease); }
.dist-seg.s-todo { background: var(--text-3); } .dist-seg.s-doing { background: var(--accent); } .dist-seg.s-blocked { background: var(--danger); } .dist-seg.s-watch { background: var(--watch); } .dist-seg.s-postponed { background: var(--warn); } .dist-seg.s-done { background: var(--success); }
.dist-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
.dist-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dist-legend b { font-family: var(--font-mono); font-weight: 600; color: var(--text-2); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 7px; height: 36px; width: clamp(160px, 24vw, 280px); padding: 0 8px 0 11px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
:root[data-theme="dark"] .search { background: var(--surface-2); border-color: var(--border); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.search > span { display: grid; color: var(--text-3); }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; outline: 0; }
.search .mini { width: 22px; height: 22px; }
.views { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.view-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; transition: all var(--fast); }
.view-tab .icon { color: var(--text-3); }
.view-tab b { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-3); font-family: var(--font-mono); font-size: 10.5px; }
.view-tab:hover { border-color: var(--border-strong); color: var(--text); }
.view-tab.on { background: var(--ink); border-color: var(--ink); color: var(--ink-contrast); }
.view-tab.on .icon { color: var(--ink-contrast); opacity: .8; }
.view-tab.on b { background: color-mix(in srgb, var(--ink-contrast) 20%, transparent); color: var(--ink-contrast); }
.view-tab.is-danger .icon { color: var(--danger); }
.view-tab.is-danger.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.view-tab.is-danger.on .icon { color: #fff; }

.planner { margin-bottom: 14px; }
.planner-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.planner-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--warn-soft); color: var(--warn); }
.planner-copy { flex: 1; min-width: 0; }
.planner-copy h2 { font-size: 14px; font-weight: 650; }
.planner-copy p { font-size: 12.5px; color: var(--text-3); }
.planner.is-open .planner-head .icon.caret { transform: rotate(180deg); }
.planner-body { padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.planner-add { display: grid; grid-template-columns: 1fr 160px 120px auto; gap: 8px; }
.planner-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.planner-list:empty { display: none; }
.planner-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); animation: tlIn .2s var(--ease); }
.planner-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; }
.planner-who { font-size: 11.5px; color: var(--text-3); }
@media (max-width: 860px) { .planner-add { grid-template-columns: 1fr; } }

.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.lane { display: flex; flex-direction: column; min-width: 0; min-height: 240px; border-radius: var(--r); background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); border: 1px solid var(--border); transition: background var(--fast), border-color var(--fast); }
.lane.is-over { background: var(--accent-soft); border-color: var(--accent-line); }
/* Completed folds to a slim strip at the end of the board. */
.board.done-folded { grid-template-columns: repeat(5, minmax(0, 1fr)) 52px; }
.lane-fold { display: none; }
.board.done-folded .is-done-lane { min-height: 240px; }
.board.done-folded .is-done-lane > :not(.lane-fold) { display: none; }
.board.done-folded .lane-fold {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; height: 100%; padding: 14px 0;
  border: 0; border-radius: var(--r); background: none; color: var(--text-2); cursor: pointer; transition: background var(--fast), color var(--fast);
}
.lane-fold:hover { background: var(--success-soft); color: var(--success); }
.lane-fold-label { writing-mode: vertical-rl; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.lane-fold b { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--success); }
.lane-add.is-shown { opacity: 1; }
.lane-older { padding: 2px 4px 0; font-size: 12px; font-weight: 600; color: var(--text-3); }
.lane-older a { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); }
.lane-older a:hover { color: var(--accent); }
@media (max-width: 1100px) { .board.done-folded { grid-template-columns: none; } .board.done-folded .lane-fold { flex-direction: row; justify-content: center; height: auto; } .board.done-folded .is-done-lane { min-height: 0; } .lane-fold-label { writing-mode: horizontal-tb; } }
.tcard.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus), var(--shadow-card); }
.tcard.is-drop { border-color: var(--accent); background: var(--accent-soft); }
.tcard-notes { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 11px; }

/* Task side panel extras */
.tk-ico .lane-dot { width: 12px; height: 12px; }
.tk-ico .lane-dot.s-todo { box-shadow: inset 0 0 0 2.5px var(--text-3); }
.tk-ico { background: var(--surface-2); }
textarea.dw-name { min-height: 0; resize: none; overflow: hidden; line-height: 1.3; }
.tk-status { background: var(--surface); }
.tk-status button { gap: 6px; height: 28px; font-size: 12px; }
.tk-status .lane-dot { width: 7px; height: 7px; }
.tk-newhint { display: flex; align-items: center; gap: 7px; margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--r); font-size: 12.5px; color: var(--text-3); }
.dw-foot .mini[hidden] { display: none; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--border); }
.lane-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.lane-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); }
.lane-dot.s-todo { background: transparent; box-shadow: inset 0 0 0 2px var(--text-3); }
.lane-dot.s-doing { background: var(--accent); } .lane-dot.s-blocked { background: var(--danger); } .lane-dot.s-watch { background: var(--watch); } .lane-dot.s-postponed { background: var(--warn); } .lane-dot.s-done { background: var(--success); }
.lane-count { flex: none; }
.lane-add { width: 24px; height: 24px; flex: none; margin-left: auto; display: grid; place-items: center; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity var(--fast), background var(--fast), color var(--fast); }
.lane:hover .lane-add, .lane-add:focus-visible { opacity: 1; }
.lane-add:hover { background: var(--surface); color: var(--text); }
.lane-list { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.tcard {
  position: relative; padding: 11px 12px 10px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); cursor: grab;
  transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast), opacity var(--fast);
}
.tcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); z-index: 1; }
.tcard:active { cursor: grabbing; }
.tcard.dragging { opacity: .45; transform: rotate(1.5deg) scale(.98); }
.tcard.is-overdue { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-card); }
.tcard.is-done .tcard-title { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.tcard-flags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.flag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-3); font-size: 10.5px; font-weight: 600; }
.flag.is-carried { background: var(--warn-soft); color: var(--warn); }
a.flag:hover { background: var(--accent-soft); color: var(--accent); }
.tcard-title { font-size: 13.5px; font-weight: 600; line-height: 1.38; letter-spacing: -0.005em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-desc { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 22px; }
.prio { display: inline-flex; align-items: center; gap: 5px; height: 20px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--text-2); }
.prio::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.prio.p-high { padding: 0 6px; background: var(--danger-soft); color: var(--danger); }
.prio.p-med::before { background: var(--warn); }
.prio.p-low { color: var(--text-3); } .prio.p-low::before { background: var(--border-strong); }
.due { display: inline-flex; align-items: center; gap: 4px; height: 20px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.due.is-over { padding: 0 6px; border-radius: 5px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.who { margin-left: auto; display: flex; align-items: center; }
.who .avatar { width: 22px; height: 22px; font-size: 9px; }
.who-both { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 10.5px; font-weight: 650; color: var(--text-2); }
.who-none { width: 22px; height: 22px; display: grid; place-items: center; border: 1px dashed var(--border-strong); border-radius: 50%; color: var(--text-3); }
.tcard-actions { position: absolute; right: 7px; bottom: 7px; z-index: 2; display: flex; gap: 1px; padding-left: 14px; background: var(--surface); box-shadow: -12px 0 12px -6px var(--surface); opacity: 0; pointer-events: none; transition: opacity var(--fast); }
.tcard:hover .tcard-actions, .tcard:focus-within .tcard-actions { opacity: 1; pointer-events: auto; }
.tcard-actions form { margin: 0; display: flex; }
.tcard-actions .mini { width: 24px; height: 24px; }
.tcard.just-moved { animation: cardFlash .7s var(--ease); }
@keyframes cardFlash { 0% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); } }
.lane-empty { display: grid; justify-items: center; align-content: center; gap: 7px; min-height: 110px; padding: 18px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); text-align: center; }
.lane-empty p { max-width: 20ch; font-size: 12px; line-height: 1.4; color: var(--text-3); }
.lane-empty-add { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.lane-empty-add:hover { background: var(--accent-soft); color: var(--accent); }
.lane-empty-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text-3); }

.wb-menu { position: fixed; z-index: 75; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); animation: rise .18s var(--ease); }
.wb-menu-label { padding: 6px 9px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.wb-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: background var(--fast), color var(--fast); }
.wb-menu-item:hover { background: var(--surface-2); color: var(--text); }
.wb-menu-item .icon { margin-left: auto; color: var(--accent); opacity: 0; }
.wb-menu-item.is-current { color: var(--text); font-weight: 600; }
.wb-menu-item.is-current .icon { opacity: 1; }
.wb-menu-sep { height: 1px; margin: 5px 2px; background: var(--border); }
.lane-dot.in-menu { width: 8px; height: 8px; }

@media (max-width: 1280px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .search { flex: 1; width: auto; } }
@media (max-width: 599px) { .board { grid-template-columns: minmax(0, 1fr); } }
@media (hover: none) { .tcard-actions { opacity: 1; pointer-events: auto; } .lane-add { opacity: 1; } .tcard:hover { transform: none; } }

/* Recipient picker */
.recipient-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.recipient { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.recipient:hover { border-color: var(--border-strong); }
.recipient:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.recipient input { width: 15px; height: 15px; min-height: 0; flex: none; accent-color: var(--accent); }
.recipient-who { min-width: 0; line-height: 1.3; }
.recipient-who b { display: block; font-size: 12.5px; font-weight: 600; }
.recipient-who small { display: block; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipient.is-off { opacity: .55; cursor: not-allowed; }

/* =========================================================
   OUTREACH
   ========================================================= */
.or-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 16px; }
.or-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.or-cal { display: flex; gap: 3px; align-items: flex-end; }
.or-cell { position: relative; width: 16px; height: 34px; border-radius: 4px; background: var(--surface-3); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding-bottom: 4px; transition: background var(--fast), transform var(--fast); cursor: default; }
.or-cell:hover { transform: translateY(-2px); background: var(--border-strong); }
.or-cell.is-today { background: var(--ink); }
.or-cell i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.or-cell.is-today i { background: var(--ink-contrast); }
.or-cell.is-monday::before { content: ""; position: absolute; top: -6px; left: 50%; width: 1px; height: 4px; background: var(--border-strong); }
.or-cal-cap { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.or-cal-wrap { text-align: right; }
@media (max-width: 900px) { .or-top { grid-template-columns: 1fr; } .or-cal-wrap { text-align: left; } .or-cal { gap: 2px; } .or-cell { flex: 1 1 0; width: auto; min-width: 0; height: 28px; } .or-cell i { width: 4px; height: 4px; } }

.or-add { display: grid; grid-template-columns: 40px minmax(140px, 1fr) minmax(180px, 1.8fr) 140px 96px 118px 100px auto; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.or-add .input { min-height: 36px; background: var(--surface-2); border-color: transparent; }
.or-add .input:focus, .or-add select:focus { background: var(--surface); border-color: var(--accent); }
.or-add select { min-height: 36px; background-color: var(--surface-2); border-color: transparent; }
.or-add-plus { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.or-add .btn { min-height: 36px; }
@media (max-width: 1180px) { .or-add { grid-template-columns: 40px 1fr 1fr 1fr; } .or-add [data-span] { grid-column: span 3; } .or-add .btn { grid-column: span 4; } }
@media (max-width: 640px) { .or-add { grid-template-columns: 1fr 1fr; } .or-add-plus { display: none; } .or-add .btn { grid-column: span 2; } .or-add [data-span] { grid-column: span 2; } }

.or-group { margin-bottom: 14px; }
.or-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 4px 8px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.or-group.is-overdue .or-group-head { color: var(--danger); }
.or-group.is-today .or-group-head { color: var(--accent); }
.or-group-head .pill { margin-left: 2px; }
.or-group[data-count="0"] { display: none; }
.or-rows { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); overflow: hidden; }
.or-rows:empty { display: none; }
.or-row { display: grid; grid-template-columns: 40px minmax(140px, 1.1fr) minmax(200px, 2fr) 150px 36px auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); transition: background var(--fast), opacity var(--fast), transform var(--fast); }
.or-row:last-child { border-bottom: 0; }
.or-row:hover { background: var(--surface-2); }
.or-row.just-in { animation: rise .4s var(--ease); }
.or-row.leaving { opacity: 0; transform: translateX(12px); }
.or-row.focus-flash { animation: cardFlash .9s var(--ease); }
.or-ch { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.or-row.is-done .or-ch { background: var(--success-soft); color: var(--success); }
.or-row.is-overdue .or-ch { background: var(--danger-soft); color: var(--danger); }
.or-who { min-width: 0; }
.or-name {
  display: block; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.or-name:hover { color: var(--accent); }
.or-row.is-done .or-name { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.or-contact { display: inline-flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11.5px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.or-contact:hover { color: var(--accent); }
.or-links { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 1px; }
.or-links .or-contact { min-width: 0; margin-top: 0; }
.or-by { display: block; margin-top: 1px; font-size: 11px; color: var(--text-3); }
.tcard-by { font-size: 11.5px; }
.or-more-links { flex: none; height: 18px; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font: 600 10.5px var(--font-mono); cursor: pointer; transition: color var(--fast), border-color var(--fast); }
.or-more-links:hover { color: var(--accent); border-color: var(--accent-line); }
.or-mid { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.or-why { min-width: 0; font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.or-why:empty::before { content: "No context added"; color: var(--text-3); font-style: italic; }

/* The latest dated note, read straight off the row. */
.or-last {
  display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 8px 3px 6px;
  border: 1px dashed var(--border-strong); border-radius: 999px;
  background: none; color: var(--text-2); font-family: inherit; font-size: 11.5px;
  cursor: pointer; text-align: left; align-self: flex-start; min-width: 0;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.or-last svg { flex: none; color: var(--text-3); }
.or-last:hover { border-color: var(--accent); border-style: solid; color: var(--accent); background: var(--accent-soft); }
.or-last:hover svg { color: var(--accent); }
.or-last-day { flex: none; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.or-last-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or-last-img { flex: none; display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.or-last-n { flex: none; padding: 0 5px; border-radius: 999px; background: var(--surface-3); font-family: var(--font-mono); font-size: 10px; color: var(--text-2); }
/* "Add a note" only shows itself when you're on the row. */
.or-last.is-add { border-color: transparent; color: var(--text-3); opacity: 0; transition: opacity var(--fast), color var(--fast), border-color var(--fast); }
.or-row:hover .or-last.is-add, .or-row:focus-within .or-last.is-add { opacity: 1; border-color: var(--border-strong); }
@media (hover: none) { .or-last.is-add { opacity: 1; border-color: var(--border-strong); } }
.or-when { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.or-date { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text); }
.or-date small { color: var(--text-3); margin-left: 4px; }
.or-rel { height: 19px; padding: 0 7px; font-size: 10.5px; }
.or-owner { display: grid; place-items: center; }
.or-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; opacity: .35; transition: opacity var(--fast); }
.or-row:hover .or-actions, .or-row:focus-within .or-actions { opacity: 1; }
.or-done-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 1.5px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: transparent; cursor: pointer; transition: all var(--fast); }
.or-done-btn:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.or-row.is-done .or-done-btn { background: var(--success); border-color: var(--success); color: #fff; }

/* The whole row opens the side panel; the open one keeps an accent edge. */
.or-row { cursor: pointer; }
.or-row.is-active { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }
.or-row.is-active .or-actions { opacity: 1; }
.or-row.is-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.or-pin.on { color: var(--accent); }
.or-pin.on svg, .dw-pin.on svg { fill: currentColor; fill-opacity: .22; }
.or-group.is-pinned .or-group-head { color: var(--text-2); }

/* On hold: parked on purpose. Muted, folded like Done, back in Monday's email. */
.or-group.is-hold .or-group-head { color: var(--warn); }
.or-row.is-held .or-ch { background: var(--warn-soft); color: var(--warn); }
.or-row.is-held .or-name { color: var(--text-2); }
.or-hold.on { color: var(--warn); }
.dw-hold { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.dw-hold:hover { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.dw-hold.is-on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }

/* Linked tasks: on the row one click goes to the board; the panel lists them all. */
.or-tasks { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 3px; }
.or-task { display: inline-flex; align-items: center; gap: 4px; min-width: 0; height: 19px; padding: 0 7px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background var(--fast), color var(--fast); }
.or-task svg { flex: none; }
.or-task:hover { background: var(--accent-soft); color: var(--accent); }
.or-task.is-done { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--text-3); }
.dw-tasks { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dw-task { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: var(--r-xs); color: var(--text); font-size: 13px; transition: background var(--fast), color var(--fast); }
.dw-task:hover { background: var(--accent-soft); color: var(--accent); }
.dw-task .lane-dot { flex: none; }
.dw-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.dw-task-meta { flex: none; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.dw-task svg { flex: none; color: var(--text-3); }
.dw-task.is-done .dw-task-title { text-decoration: line-through; color: var(--text-3); }
.dw-task-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.dw-task-row .dw-task { flex: 1; }
.dw-task-row .mini { flex: none; opacity: 0; transition: opacity var(--fast); }
.dw-task-row:hover .mini, .dw-task-row:focus-within .mini { opacity: 1; }
@media (hover: none) { .dw-task-row .mini { opacity: 1; } }
.dw-task-empty { margin: 4px 0; font-size: 12px; color: var(--text-3); }
.dw-task-add { display: flex; gap: 6px; }
.dw-panel .dw-tasks #orTaskPick, .dw-panel .dw-tasks .dw-task-add .input { border: 1px dashed var(--border-strong); background: var(--surface); }
.dw-panel .dw-tasks #orTaskPick { margin-top: 4px; cursor: pointer; }
.dw-task-add .input { flex: 1; min-width: 0; }

/* Done folds away; the choice is remembered per device. */
.or-fold {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding: 3px 9px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font: 550 11px var(--font-ui); letter-spacing: 0; text-transform: none; cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.or-fold:hover { border-color: var(--accent); color: var(--accent); }
.or-fold-show { display: none; align-items: center; gap: 5px; }
.or-fold-hide { display: inline-flex; align-items: center; gap: 5px; }
.or-group.is-folded .or-fold-show { display: inline-flex; }
.or-group.is-folded .or-fold-hide { display: none; }
.or-group.is-folded .or-rows { display: none; }

/* Push the day: one tap for tomorrow, the day after, or next week. */
.or-push { display: flex; align-items: center; margin: 0 4px; border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface-2); overflow: hidden; }
.or-push button {
  min-width: 27px; height: 26px; padding: 0 4px; border: 0; border-left: 1px solid var(--border);
  background: none; color: var(--text-3); cursor: pointer;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: -0.02em;
  transition: background var(--fast), color var(--fast);
}
.or-push button:first-child { border-left: 0; }
.or-push button:hover { background: var(--accent-soft); color: var(--accent); }
.or-push button:active { transform: translateY(1px); }

@media (max-width: 1000px) {
  .or-row { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "ch who actions" "ch mid mid" "ch when when"; row-gap: 6px; }
  .or-ch { grid-area: ch; align-self: start; }
  .or-who { grid-area: who; } .or-mid { grid-area: mid; } .or-when { grid-area: when; flex-direction: row; align-items: center; gap: 8px; }
  .or-owner { display: none; } .or-actions { grid-area: actions; opacity: 1; }
}
@media (max-width: 520px) {
  .or-row { grid-template-areas: "ch who who" "ch mid mid" "ch when when" "ch actions actions"; }
  .or-actions { justify-content: flex-start; }
  .or-push { margin-left: 0; }
  .or-push button { min-width: 34px; height: 28px; }
}
@media (hover: none) { .or-actions { opacity: 1; } }

/* ── Outreach side panel ─────────────────────────────
   Slides in from the right. On wide screens there is no scrim, so the list
   stays usable beside it: click another row and the panel follows. */
.dw { position: fixed; inset: 0; z-index: 78; pointer-events: none; }
.dw-scrim { position: absolute; inset: 0; background: rgba(6, 8, 12, .34); opacity: 0; transition: opacity .24s var(--ease); }
.dw-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100vw);
  display: flex; flex-direction: column; background: var(--surface); outline: none;
  border-left: 1px solid var(--border); box-shadow: -32px 0 80px -40px rgba(15, 18, 28, .45);
  transform: translateX(calc(100% + 48px)); visibility: hidden; pointer-events: auto;
  transition: transform .34s var(--ease), visibility 0s linear .34s;
}
.dw.open .dw-panel { transform: none; visibility: visible; transition: transform .34s var(--ease), visibility 0s; }
@media (max-width: 1100px) { .dw.open .dw-scrim { opacity: 1; pointer-events: auto; } }
/* Toasts move into the space left of the panel, so they never cover its footer. */
@media (min-width: 1101px) { body.dw-open .toast-wrap { left: calc((100% - 620px) / 2); } body.dw-open.dw-full .toast-wrap { left: 50%; } }

/* Full screen: the panel takes the window. Details on the left, the history
   (updates, files) on the right, both centred on a readable width. */
.dw-expand .only-full, .dw.is-full .dw-expand .only-side { display: none; }
.dw.is-full .dw-expand .only-full, .dw-expand .only-side { display: inline-grid; place-items: center; }
.dw-expand[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.dw.is-full .dw-panel { width: 100vw; border-left: 0; box-shadow: none; }
.dw.is-full .dw-head, .dw.is-full .dw-bar, .dw.is-full .dw-foot, .dw.is-full .dw-body {
  padding-left: max(24px, calc((100% - 1240px) / 2)); padding-right: max(24px, calc((100% - 1240px) / 2));
}
.dw.is-full .dw-name { font-size: 22px; }
@media (min-width: 900px) {
  .dw.is-full .dw-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 44px; align-items: start; padding-top: 22px; }
  .dw.is-full .dw-body > .dw-sec:first-child { position: sticky; top: 0; }
  .dw.is-full .dw-body > .dw-sec + .dw-sec { margin-top: 0; padding-top: 0; border-top: 0; }
  .dw.is-full .dw-body > :not(.dw-sec) { grid-column: 1 / -1; }
  /* A notebook note is mostly writing: the text gets the wide column. */
  .dw.is-full .dw-body.is-doc { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
}
@media (max-width: 640px) { .dw-expand { display: none; } }

/* Updates | Files */
.dw-tabs { display: flex; gap: 18px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.dw-tabs button {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; margin-bottom: -1px; padding: 0 1px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em;
  transition: color var(--fast), border-color var(--fast);
}
.dw-tabs button:hover { color: var(--text-2); }
.dw-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.dw-tabs .pill { height: 18px; min-width: 18px; font-size: 10.5px; }
.dw-tabs button.on .pill { background: var(--accent-soft); color: var(--accent); }
.dw-files { margin-top: 12px; }
.dw-sec-head .nt-attach { margin-left: auto; text-transform: none; letter-spacing: 0; font-family: var(--font-ui); }

/* Links: one per row, "+ Add link" for another. */
.dw-links { display: flex; flex-direction: column; min-width: 0; }
.dw-link-list { display: flex; flex-direction: column; gap: 2px; }
.dw-link { display: flex; align-items: center; gap: 2px; }
.dw-link .input { flex: 1; min-width: 0; }
.dw-link .mini { flex: none; opacity: 0; transition: opacity var(--fast), background var(--fast), color var(--fast); }
.dw-link:hover .mini, .dw-link:focus-within .mini { opacity: 1; }
@media (hover: none) { .dw-link .mini { opacity: 1; } }
.dw-addlink { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin: 3px 0 6px 4px; padding: 3px 8px; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; transition: background var(--fast), color var(--fast); }
.dw-addlink:hover { background: var(--accent-soft); color: var(--accent); }

.dw-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--border); }
.dw-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.dw-ico.is-overdue { background: var(--danger-soft); color: var(--danger); }
.dw-ico.is-done { background: var(--success-soft); color: var(--success); }
.dw-titles { flex: 1; min-width: 0; }
.dw-eyebrow { padding-left: 1px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
/* The name is the title — and it is editable in place. */
.dw-name {
  display: block; width: 100%; margin: 1px 0 0 -7px; padding: 2px 6px;
  border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; outline: none;
  color: var(--text); font: 650 19px/1.3 var(--font-ui); letter-spacing: -0.02em;
  transition: background var(--fast), border-color var(--fast), box-shadow var(--fast);
}
.dw-name:hover { background: var(--surface-2); }
.dw-name:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.dw-pin.on { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
:root[data-theme="dark"] .dw-name { background: transparent; border-color: transparent; }
:root[data-theme="dark"] .dw-name:hover { background: var(--surface-2); }
:root[data-theme="dark"] .dw-name:focus { background: var(--surface); border-color: var(--accent); }

.dw-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.dw-done { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.dw-done:hover { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.dw-done.is-on { background: var(--success); border-color: var(--success); color: #fff; }
.dw-rel .or-rel { height: 22px; padding: 0 9px; font-size: 11px; }
.dw-push { margin: 0 0 0 auto; background: var(--surface); }
.dw-push-label { padding: 0 8px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.dw-push button { min-width: 34px; height: 28px; font-size: 11px; }
.dw-push[hidden], .dw-pin[hidden] { display: none; }

.dw-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 28px; }
.dw-sec + .dw-sec { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.dw-sec-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }

/* Details as a property list: label left, value right, borders only on hover. */
.dw-props { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 2px 10px; }
.dw-k { display: flex; align-items: center; gap: 7px; min-height: 38px; font-size: 12.5px; font-weight: 550; color: var(--text-3); }
.dw-k svg { flex: none; opacity: .8; }
.dw-panel .dw-props .input, .dw-panel .dw-props textarea, .dw-panel .dw-props select {
  min-height: 38px; background-color: transparent; border-color: transparent; box-shadow: none;
}
.dw-panel .dw-props .input:hover, .dw-panel .dw-props textarea:hover, .dw-panel .dw-props select:hover { background-color: var(--surface-2); }
.dw-panel .dw-props .input:focus, .dw-panel .dw-props textarea:focus, .dw-panel .dw-props select:focus {
  background-color: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus);
}
.dw-props textarea { min-height: 38px; resize: none; overflow: hidden; line-height: 1.5; }
.dw-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.dw-when input[type="date"] { width: 158px; }
.dw-when input[type="time"] { width: 118px; }
.dw-quick { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding: 2px 0 4px 4px; }
.dw-quick button {
  padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-family: inherit; font-size: 11.5px; font-weight: 550;
  cursor: pointer; transition: all var(--fast);
}
.dw-quick button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dw-quick button.on { border-color: var(--accent); background: var(--accent); color: #fff; }

.dw-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.dw-foot-hint { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); }
.dw-foot-hint.is-dirty { color: var(--warn); font-weight: 550; }
.dw-foot-hint.is-dirty::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Note composer: type, paste a screenshot, drop one, or attach. */
.on-add { position: relative; padding: 8px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.on-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.on-add textarea { min-height: 58px; padding: 4px 6px; border: 0; background: none; font-size: 13px; resize: none; }
.on-add textarea:focus { border: 0; box-shadow: none; }
.on-add textarea:focus-visible { outline: none; }  /* the box carries the ring */
:root[data-theme="dark"] .on-add textarea { background: none; border: 0; }
.on-add-foot { display: flex; align-items: center; gap: 8px; padding: 4px 2px 0 2px; }
.on-add-hint { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.on-pending { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 4px 6px 8px; }
.fp {
  position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 7px 28px 9px 7px;
  overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); animation: rise .25s var(--ease);
}
.fp img { width: 36px; height: 36px; flex: none; border-radius: 7px; object-fit: cover; object-position: top; background: var(--surface); }
.fp figcaption { min-width: 0; display: flex; flex-direction: column; }
.fp b { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp small { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .2s linear, opacity .4s; }
.fp.is-ok .fp-bar { opacity: 0; }
.fp.is-err { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); }
.fp.is-err small { color: var(--danger); }
.fp.is-err .fp-bar { background: var(--danger); }
.fp button {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 14px; line-height: 1; cursor: pointer;
}
.fp button:hover { background: var(--danger-soft); color: var(--danger); }

/* A file's type, at a glance: a tinted tile with its icon and extension. */
.fl-ico {
  --k: var(--text-3);
  position: relative; width: 36px; height: 36px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 9px; background: color-mix(in srgb, var(--k) 13%, var(--surface)); color: var(--k);
}
.fl-ico em { font: 650 7.5px/1 var(--font-mono); font-style: normal; text-transform: uppercase; letter-spacing: .04em; }
.fl-ico.is-pdf { --k: #c9372c; } .fl-ico.is-sheet { --k: #128a52; } .fl-ico.is-doc { --k: #2f62d0; }
.fl-ico.is-slides { --k: #c2610f; } .fl-ico.is-image { --k: #8a4fd6; } .fl-ico.is-video, .fl-ico.is-audio { --k: #0b8f86; }
.fl-ico.is-archive { --k: #7c6a4f; }
:root[data-theme="dark"] .fl-ico.is-pdf { --k: #f07167; } :root[data-theme="dark"] .fl-ico.is-sheet { --k: #3fc483; }
:root[data-theme="dark"] .fl-ico.is-doc { --k: #6f9bff; } :root[data-theme="dark"] .fl-ico.is-slides { --k: #f0a04b; }
:root[data-theme="dark"] .fl-ico.is-image { --k: #b98cf5; } :root[data-theme="dark"] .fl-ico.is-video, :root[data-theme="dark"] .fl-ico.is-audio { --k: #3cc9bd; }
:root[data-theme="dark"] .fl-ico.is-archive { --k: #c2ad8a; }
.fl-ico.is-big { width: 64px; height: 64px; gap: 3px; border-radius: 16px; }
.fl-ico.is-big em { font-size: 10px; }

/* The Files list: everything on one item, newest first. */
.fl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fl-item { display: flex; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.fl-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.fl-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.fl-thumb { width: 36px; height: 36px; flex: none; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.fl-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.fl-main { min-width: 0; display: flex; flex-direction: column; }
.fl-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--fast); }
.fl-open:hover .fl-name { color: var(--accent); }
.fl-meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-acts { flex: none; display: flex; gap: 1px; opacity: 0; transition: opacity var(--fast); }
.fl-item:hover .fl-acts, .fl-item:focus-within .fl-acts { opacity: 1; }
@media (hover: none) { .fl-acts { opacity: 1; } }
.fl-acts .mini.is-copied { color: var(--success); }
.fl-empty { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--r); font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.fl-empty .icon { margin-top: 2px; }

/* Drop straight onto a notebook note or a meeting. */
.nt-drop { position: relative; min-height: 48px; border-radius: var(--r); }
.nt-drop .on-pending { padding: 0 0 8px; }
.nt-drop.is-drag .on-drop { display: flex; }
.on-drop {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--accent); border-radius: inherit; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); font-size: 13px; font-weight: 600;
}
.on-add.is-drag .on-drop { display: flex; }

/* The thread: newest first, each note stamped by the server. */
.on-thread { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.on-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-card); animation: rise .3s var(--ease); }
/* The newest note carries the accent edge, so "latest" reads at a glance. */
.on-item:first-child { box-shadow: var(--shadow-card), inset 2px 0 0 var(--accent); }
.on-stamp { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.on-day { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.on-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.on-text { font-size: 13px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.on-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 8px; }
.on-imgs a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: zoom-in; }
.on-imgs img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .35s var(--ease); }
.on-imgs a:hover img { transform: scale(1.03); }
/* One screenshot shows whole, at its own shape. */
.on-shot { position: relative; margin: 0; min-width: 0; }
.on-imgs.is-one .on-shot { justify-self: start; max-width: 100%; }
/* Copy an image straight to the clipboard, to paste into Slack or an email. */
.on-copy {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-2); cursor: pointer; opacity: 0; box-shadow: var(--shadow-card);
  transition: opacity var(--fast), color var(--fast), background var(--fast);
}
.on-shot:hover .on-copy, .on-copy:focus-visible { opacity: 1; }
.on-copy:hover { color: var(--accent); background: var(--surface); }
.on-copy.is-copied { opacity: 1; color: var(--success); }
@media (hover: none) { .on-copy { opacity: 1; } }
.on-imgs.is-one { grid-template-columns: minmax(0, 1fr); }
.on-imgs.is-one a { aspect-ratio: auto; justify-self: start; max-width: 100%; }
.on-imgs.is-one img { width: auto; height: auto; max-width: 100%; max-height: 300px; object-fit: contain; }
.on-files { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.on-file { display: flex; align-items: center; gap: 4px; max-width: 440px; padding: 5px 5px 5px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.on-file-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
.on-file .fl-ico { width: 32px; height: 32px; }
.on-file-main { min-width: 0; display: flex; flex-direction: column; }
.on-file-main b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--fast); }
.on-file-main small { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.on-file-open:hover b { color: var(--accent); }
.on-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.on-who { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); }
.on-foot .mini { width: 24px; height: 24px; opacity: 0; transition: opacity var(--fast), background var(--fast), color var(--fast); }
.on-item:hover .on-foot .mini, .on-item:focus-within .on-foot .mini { opacity: 1; }
@media (hover: none) { .on-foot .mini { opacity: 1; } }
.on-empty { padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r); font-size: 12.5px; color: var(--text-2); }
.on-empty p + p { margin-top: 6px; font-size: 12px; line-height: 1.55; }
.on-load { padding: 12px 2px; font-size: 12.5px; color: var(--text-3); }

@media (max-width: 640px) {
  .dw-head { padding: 14px 12px 12px 16px; }
  .dw-bar, .dw-body, .dw-foot { padding-left: 16px; padding-right: 16px; }
  .dw-props { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dw-k { min-height: 0; padding: 10px 0 4px; }
  .dw-push { margin-left: 0; }
}

/* ── File viewer ─────────────────────────────────────
   One overlay for every file: pictures, PDFs, video and text natively;
   sheets, Word files and decks as a server-made preview; the rest as a
   download card. Download always hands back the original. */
.fv {
  position: fixed; inset: 0; z-index: 92; display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: rgba(6, 8, 12, .9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.fv.open { opacity: 1; pointer-events: auto; }
body.fv-open { overflow: hidden; }
.fv-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 16px; color: #fff; }
.fv-ico.fl-ico { width: 34px; height: 34px; background: rgba(255, 255, 255, .1); color: #fff; }
.fv-titles { flex: 1; min-width: 0; margin-right: 6px; }
.fv-name { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-meta { display: block; font-family: var(--font-mono); font-size: 11px; color: rgba(255, 255, 255, .6); }
.fv-btn, .fv-nav {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 13px; flex: none;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(255, 255, 255, .08);
  color: #fff; font: 550 12.5px var(--font-ui); text-decoration: none; cursor: pointer; transition: background var(--fast);
}
.fv-btn:hover, .fv-nav:hover { background: rgba(255, 255, 255, .18); }
.fv-btn.is-primary { background: #fff; border-color: #fff; color: #0c0f16; }
.fv-btn.is-primary:hover { background: #e9ebf0; }
.fv-btn.is-icon { width: 36px; padding: 0; }
.fv-btn.is-copied { color: #7be0b5; }
.fv-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 6px 76px 28px; overflow: hidden; }
.fv-stage > img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.fv-stage > iframe { width: min(1180px, 100%); height: 100%; border: 0; border-radius: 8px; background: #fff; }
.fv-stage > video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.fv-text, .fv-doc { width: min(1100px, 100%); height: 100%; margin: 0; overflow: auto; border-radius: 10px; background: var(--surface); color: var(--text); }
.fv-text { padding: 20px 24px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.fv-loading { color: rgba(255, 255, 255, .7); font-size: 13px; }
.fv-card { display: grid; justify-items: center; gap: 6px; width: min(420px, 100%); padding: 32px 28px; border-radius: 18px; background: var(--surface); color: var(--text); text-align: center; }
.fv-card b { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.fv-card small { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.fv-card p { margin: 6px 0 10px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.fv-card audio { width: 100%; margin: 12px 0 10px; }
.fv-card .fl-ico { margin-bottom: 6px; }
.fv-nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; padding: 0; display: none; }
.fv.has-many .fv-nav { display: inline-flex; }
.fv-nav.is-prev { left: 16px; }
.fv-nav.is-next { right: 16px; }
@media (max-width: 720px) {
  .fv-top { padding: 10px; gap: 6px; }
  .fv-btn span { display: none; }
  .fv-btn { width: 36px; padding: 0; }
  .fv-stage { padding: 4px 8px 72px; }
  .fv-nav { top: auto; bottom: 14px; margin-top: 0; }
}

/* What the server's preview is made of: sheets, documents, slides. */
.pv-sheets { display: flex; flex-direction: column; height: 100%; }
.pv-tabs { flex: none; display: flex; gap: 2px; padding: 8px 10px 0; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.pv-tab { padding: 7px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.pv-tab:hover { color: var(--text); }
.pv-tab.on { margin-bottom: -1px; border-color: var(--border); background: var(--surface); color: var(--text); }
.pv-pane { flex: 1; min-height: 0; overflow: auto; }
.pv-scroll { overflow: auto; }
.pv-table { min-width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pv-table th, .pv-table td { max-width: 380px; padding: 6px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-weight: 650; }
.pv-table tbody tr:hover td { background: var(--surface-2); }
.pv-cap { padding: 10px 14px; font-size: 12px; color: var(--text-3); }
.pv-empty { padding: 16px; color: var(--text-3); }
.pv-doc { max-width: 780px; margin: 0 auto; padding: 36px 40px 56px; font-size: 14.5px; line-height: 1.7; }
.pv-doc h3 { margin: 24px 0 8px; font-size: 21px; letter-spacing: -0.02em; }
.pv-doc h4 { margin: 18px 0 6px; font-size: 16px; }
.pv-doc p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-doc .pv-li { position: relative; padding-left: 20px; }
.pv-doc .pv-li::before { content: "•"; position: absolute; left: 5px; color: var(--text-3); }
.pv-doc .pv-scroll { margin: 14px 0; }
.pv-slides { display: grid; gap: 12px; max-width: 880px; margin: 0 auto; padding: 22px; }
.pv-slide { position: relative; padding: 18px 22px 16px 58px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.pv-slide-n { position: absolute; left: 18px; top: 19px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.pv-slide p { margin: 0 0 5px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.pv-slide p:first-of-type { font-size: 15.5px; font-weight: 650; color: var(--text); }

/* =========================================================
   MEETINGS
   ========================================================= */
.mt-list { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); overflow: hidden; }
.mt-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); transition: background var(--fast); }
.mt-row:last-child { border-bottom: 0; }
.mt-row:hover { background: var(--surface-2); }
.mt-when { width: 54px; flex: none; text-align: center; padding: 7px 0; border-radius: var(--r-sm); background: var(--surface-2); font-family: var(--font-mono); }
.mt-row:hover .mt-when { background: var(--surface-3); }
.mt-when b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.mt-when small { display: block; margin-top: 3px; font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.mt-main { flex: 1; min-width: 0; }
.mt-title-row { display: flex; align-items: center; gap: 8px; }
.mt-title-row h3 { min-width: 0; font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.mt-sub { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.mt-sub .mono { font-size: 11.5px; }
.mt-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 19px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.mt-chip.is-warn { background: var(--warn-soft); color: var(--warn); }
.mt-chip.is-done, .mt-chip.is-held { background: var(--success-soft); color: var(--success); }
.mt-chip.is-cancelled { background: var(--danger-soft); color: var(--danger); }
.mt-chip.is-scheduled { background: var(--accent-soft); color: var(--accent); }
.mt-people { display: flex; flex: none; }
.mt-people .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.mt-people .avatar:first-child { margin-left: 0; }
.mt-go { flex: none; color: var(--text-3); display: grid; }
.mt-row.s-cancelled h3 { color: var(--text-3); text-decoration: line-through; }
.band { margin-top: 22px; }
.band-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.band-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; }
.callout { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--border)); border-radius: var(--r-lg); background: var(--warn-soft); }
.callout-ico { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.callout-body { flex: 1; min-width: 0; }
.callout-body b { display: block; font-size: 13.5px; font-weight: 650; }
.callout-body p { margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
@media (max-width: 620px) { .mt-people { display: none; } .callout { flex-wrap: wrap; } .callout .btn { width: 100%; } }

.backlink { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: color var(--fast); }
.backlink:hover { color: var(--text); }
.md-head { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; padding: 24px 26px; }
.md-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.md-sent { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); }
.md-head h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.md-head h1.is-struck { color: var(--text-3); text-decoration: line-through; }
.md-facts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.md-facts span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.md-facts .icon { color: var(--text-3); }
.md-people { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.md-person { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.md-guest { color: var(--text-3); font-weight: 500; }
.md-head-side { display: flex; flex-direction: column; gap: 7px; }
.md-head-side form { margin: 0; }
.md-danger-row { display: flex; gap: 7px; margin-top: 3px; }
.md-danger-row form { flex: 1; }
.md-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.md-col { display: flex; flex-direction: column; gap: 16px; }
.md-prose { font-size: 13.5px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 980px) { .md-head { grid-template-columns: 1fr; gap: 18px; } .md-head-side { flex-direction: row; flex-wrap: wrap; } .md-head-side .btn { width: auto; } .md-grid { grid-template-columns: 1fr; } }
.ai-list { display: flex; flex-direction: column; }
.ai-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ai-row:last-child { border-bottom: 0; }
.ai-main { flex: 1; min-width: 0; }
.ai-title { font-size: 13.5px; font-weight: 550; overflow-wrap: anywhere; }
.ai-row.is-done .ai-title { color: var(--text-3); text-decoration: line-through; }
.ai-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-3); }
.ai-row.is-overdue .ai-sub b { color: var(--danger); }
.ai-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.ai-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 7px; margin-top: 7px; }
@media (max-width: 620px) { .ai-form-row { grid-template-columns: 1fr 1fr; } }
.rm-list { display: flex; flex-direction: column; }
.rm-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rm-row:last-child { border-bottom: 0; }
.rm-row form { margin: 0; }
.rm-ico { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-3); }
.rm-row.is-sent .rm-ico { background: var(--success-soft); color: var(--success); }
.rm-row.is-off { opacity: .5; }
.rm-main { flex: 1; min-width: 0; }
.rm-when { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; }
.rm-to { margin-top: 1px; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-err { font-size: 11.5px; color: var(--danger); }
.rm-tag { font-size: 11px; font-weight: 650; color: var(--success); }

/* =========================================================
   PROGRESS
   ========================================================= */
.pg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .pg-grid { grid-template-columns: 1fr; } }
.pg-founder { padding: 20px 22px; }
.pg-founder.is-me { box-shadow: inset 3px 0 0 var(--accent), var(--shadow-card); }
.pg-head { display: flex; align-items: center; gap: 14px; }
.pg-who { flex: 1; min-width: 0; }
.pg-who .name { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.pg-who .tag { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.pg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
@media (max-width: 560px) { .pg-stats { grid-template-columns: repeat(2, 1fr); } }
.pg-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pg-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pg-section-head .card-title { margin: 0; }
.pg-section-head .val { font-size: 12.5px; color: var(--text-2); }
.pg-section-head .val b { font-weight: 650; color: var(--text); }
.area { width: 100%; height: auto; display: block; overflow: visible; }
.area .grid { stroke: var(--border); stroke-width: 1; }
.area .fill { fill: var(--accent); opacity: .12; }
.area .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.area .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.area .dot.is-full { fill: var(--success); }
.area .hit { fill: transparent; }
.area .hit:hover + .dot, .area .dot:hover { r: 5.5; }
.area-x { display: flex; justify-content: space-between; margin-top: 4px; padding: 0 2px; }
.area-x span { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.area-x span.is-today { color: var(--text); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; border-bottom: 1px solid var(--border); }
.bars .b { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.bars .b i { width: 100%; max-width: 24px; height: 100%; border-radius: 4px 4px 0 0; background: var(--accent); transform: scaleY(var(--h, 0)); transform-origin: bottom; transition: transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 40ms); }
.bars .b.zero i { background: var(--surface-3); --h: 1; height: 3px; }
.bars-x { display: flex; gap: 8px; margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.heatmap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.heat-col { display: flex; flex-direction: column; gap: 3px; }
.heat-cell { width: 12px; height: 12px; flex: none; border-radius: 3px; background: var(--surface-3); transition: transform var(--fast), outline-color var(--fast); outline: 1px solid transparent; outline-offset: 1px; }
a.heat-cell:hover { transform: scale(1.25); outline-color: var(--border-strong); }
.heat-cell.future { background: transparent; }
.heat-cell.l1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface-3)); }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent) 50%, var(--surface-3)); }
.heat-cell.l3 { background: color-mix(in srgb, var(--accent) 75%, var(--surface-3)); }
.heat-cell.l4 { background: var(--accent); }
.heat-months { position: relative; height: 14px; margin-bottom: 4px; }
.heat-months span { position: absolute; top: 0; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); white-space: nowrap; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.heat-legend .heat-cell { width: 10px; height: 10px; }

/* =========================================================
   HABITS · NOTES · VAULT
   ========================================================= */
.hm-list { display: flex; flex-direction: column; gap: 8px; }
.hm-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-card); transition: border-color var(--fast), transform var(--fast); }
.hm-item:hover { border-color: var(--border-strong); }
.hm-item.dragging { opacity: .5; }
.hm-grip { display: grid; color: var(--text-3); cursor: grab; }
.hm-meta { flex: 1; min-width: 0; }
.hm-name { font-size: 14px; font-weight: 600; }
.hm-sub { margin-top: 1px; font-size: 12.5px; color: var(--text-3); }
.badge { padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-pick { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all var(--fast); }
.icon-pick:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.icon-pick.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
@media (max-width: 620px) { .icon-grid { grid-template-columns: repeat(6, 1fr); } }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.note-card { display: flex; flex-direction: column; padding: 18px 18px 14px; cursor: pointer; transition: border-color var(--fast), transform var(--fast), box-shadow var(--fast); }
.note-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.note-card h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.note-card .note-body { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; flex: 1; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.note-files { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11px; }
.note-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus), var(--shadow-card); }
/* The note itself: a quiet writing surface, no box. */
.dw-panel textarea.nt-body {
  display: block; width: 100%; min-height: 240px; padding: 2px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-size: 14.5px; line-height: 1.7; resize: none; overflow: hidden;
}
.dw-panel textarea.nt-body:focus, :root[data-theme="dark"] .dw-panel textarea.nt-body { border: 0; background: transparent; box-shadow: none; }
.dw-panel textarea.nt-body:focus-visible { outline: none; }
#noteViewCopy.ok { color: var(--success); border-color: var(--success); }

.vault-list { display: grid; gap: 10px; }
.vault-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; transition: border-color var(--fast); }
.vault-item:hover { border-color: var(--border-strong); }
.vault-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.vault-main { min-width: 0; }
.vault-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.vault-title-row h3 { font-size: 14.5px; font-weight: 650; font-family: var(--font-mono); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.vault-updated { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.vault-secret { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.vault-secret .input { background: var(--surface-2); font-family: var(--font-mono); font-size: 12.5px; }
.vault-item-note { margin-top: 10px; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.vault-actions { display: flex; align-items: center; gap: 4px; }
.vault-actions form { margin: 0; }
.vault-side { display: grid; gap: 12px; }
.vault-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.kpi { padding: 18px; }
.kpi .kpi-ico { width: 36px; height: 36px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.kpi b { display: block; line-height: 1; font-size: 30px; font-weight: 650; letter-spacing: -0.03em; }
.kpi small { display: block; margin-top: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.kpi p { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
@media (max-width: 900px) { .vault-layout { grid-template-columns: 1fr; } .vault-side { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .vault-side { grid-template-columns: 1fr; } .vault-item { grid-template-columns: 1fr; } .vault-icon { display: none; } .vault-title-row { display: block; } .vault-updated { display: block; margin-top: 3px; } .vault-actions { justify-content: flex-end; } }

/* =========================================================
   AUTH · SETTINGS · PROFILE
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; color: #fff; background: #0b0e16; }
.auth-brand::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(60% 50% at 30% 30%, color-mix(in srgb, #4353f0 70%, transparent), transparent 70%), radial-gradient(50% 45% at 80% 70%, color-mix(in srgb, #9d3fd0 60%, transparent), transparent 70%), radial-gradient(45% 40% at 60% 20%, color-mix(in srgb, #0b9488 45%, transparent), transparent 70%); filter: blur(30px); animation: drift 22s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-4%, 3%) rotate(3deg) scale(1.05); } }
.auth-brand > * { position: relative; }
.auth-brand .brand { color: #fff; }
.auth-brand .brand-mark { background: rgba(255, 255, 255, .14); box-shadow: none; backdrop-filter: blur(6px); }
.auth-brand .brand small { color: rgba(255, 255, 255, .6); }
.auth-copy h2 { font-family: var(--font-serif); font-weight: 400; font-style: italic; font-size: clamp(38px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -0.02em; }
.auth-copy p { margin-top: 18px; max-width: 42ch; font-size: 15.5px; line-height: 1.55; color: rgba(255, 255, 255, .72); }
.auth-points { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.auth-points span { display: inline-flex; align-items: center; gap: 7px; }
.auth-points .icon { color: rgba(255, 255, 255, .9); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.025em; }
.auth-card > p { margin: 6px 0 24px; color: var(--text-2); }
.auth-alt { margin-top: 18px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.auth-alt a { color: var(--accent); font-weight: 600; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-brand { min-height: 42vh; padding: 28px 24px; } .auth-copy h2 { font-size: 34px; } .auth-points { display: none; } }

.settings-grid { display: grid; gap: 16px; }
.setting-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row .switch { margin-top: 2px; }
.setting-copy { flex: 1; min-width: 0; }
.setting-copy b { display: block; font-size: 13.5px; font-weight: 600; }
.setting-copy span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--text-2); }
.avatar-pick { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.avatar-preview { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent); font-size: 24px; font-weight: 650; }
.accent-swatches { display: flex; gap: 10px; }
.swatch { width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform var(--fast), box-shadow var(--fast); }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: .001ms !important; transition-duration: .001ms !important; }
}

/* Auth pages have no shell. */
.auth-page .shell-main { margin-left: 0; padding-bottom: 0; }
.auth-page::before { display: none; }

/* ── Morning quote: the first page of the day opens on it ── */
body.qg-on { overflow: hidden; }
.qg {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto;
  background: radial-gradient(1200px 600px at 50% 0%, var(--accent-soft), transparent 70%), var(--bg);
  transition: opacity .3s var(--ease);
}
.qg.is-out { opacity: 0; pointer-events: none; }
.qg-card {
  width: 100%; max-width: 640px; margin: 0; padding: 40px 44px 34px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  animation: rise .5s var(--ease);
  transition: transform .3s var(--ease);
}
.qg.is-out .qg-card { transform: translateY(-10px) scale(.985); }
.qg-eyebrow { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.qg-hello { margin: 14px 0 0; font-size: 15px; font-weight: 550; color: var(--text-2); }
.qg-mark { width: 40px; height: 40px; margin-top: 26px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.qg-mark .icon { fill: currentColor; stroke: none; }
.qg blockquote { margin: 16px 0 0; font-size: 27px; font-weight: 550; line-height: 1.38; letter-spacing: -0.02em; color: var(--text); text-wrap: pretty; }
.qg figcaption { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.qg figcaption::before { content: "— "; }
.qg figcaption span { font-weight: 450; color: var(--text-3); }
.qg figcaption span::before { content: " · "; }
.qg-go { margin-top: 30px; width: 100%; justify-content: center; min-height: 46px; font-size: 15px; }
.qg-hint { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--text-3); }
.qg-hint kbd { padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 5px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
@media (max-width: 720px) {
  .qg-card { padding: 28px 22px 24px; }
  .qg blockquote { font-size: 21px; }
}

/* ── Rich text: the editor and the text it makes ─────────────────
   Long text boxes are a small editor (static/js/vendor/editor.js) that stores
   Markdown. `.rte-prose` styles both the editor and the saved text, so what
   you type looks the same once it's saved. */
textarea.rte-src { display: none !important; }
.rte { position: relative; min-width: 0; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast), background-color var(--fast); }
:root[data-theme="dark"] .rte { background: var(--surface-2); border-color: var(--border); }
.rte.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.rte-host { padding: 8px 11px; cursor: text; }
.rte-input { min-height: 22px; outline: none; font-size: 13.5px; }
.rte-input:focus-visible { outline: none; }
.rte-input p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; height: 0; color: var(--text-3); pointer-events: none; }

/* Toolbar: one quiet row of icons. */
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.rte-btn { display: inline-grid; place-items: center; width: 28px; height: 26px; padding: 0; border: 0; border-radius: var(--r-xs); background: none; color: var(--text-3); cursor: pointer; transition: background-color var(--fast), color var(--fast); }
.rte-btn:hover { background: var(--surface-2); color: var(--text); }
.rte-btn.is-on { background: var(--accent-soft); color: var(--accent); }
.rte-sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border-strong); }
.rte-tbl { display: inline-flex; align-items: center; gap: 1px; }
.rte-tbl[hidden] { display: none !important; }

/* In a details list the box is quiet until you use it; the toolbar shows while you type. */
.dw-props .rte { border-color: transparent; background: transparent; }
.dw-props .rte:hover { background: var(--surface-2); }
.dw-props .rte.is-focus { background: var(--surface); border-color: var(--accent); }
.dw-props .rte:not(.is-focus) .rte-bar { display: none; }
.dw-props .rte-host { padding: 8px 11px; min-height: 36px; }

/* The update box: the card around it carries the border and ring. */
.on-add .rte { border: 0; background: none; box-shadow: none; }
.on-add .rte-bar { padding: 0 0 5px; margin: 0 2px 2px; }
.on-add .rte-host { padding: 4px 6px; }
.on-add .rte-input { min-height: 46px; max-height: 320px; overflow-y: auto; font-size: 13px; }

/* Dark mode: the boxes above stay quiet too. */
:root[data-theme="dark"] .on-add .rte, :root[data-theme="dark"] .dw-panel .rte.is-doc { background: transparent; border-color: transparent; }
:root[data-theme="dark"] .dw-props .rte { background: transparent; border-color: transparent; }
:root[data-theme="dark"] .dw-props .rte:hover { background: var(--surface-2); }
:root[data-theme="dark"] .dw-props .rte.is-focus { background: var(--surface); border-color: var(--accent); }

/* A note: a writing surface, no box. */
.dw-panel .rte.is-doc { border: 0; background: transparent; box-shadow: none; }
.rte.is-doc .rte-bar { position: sticky; top: 0; z-index: 2; margin: 0 0 10px; padding: 4px 0; background: var(--surface); }
.rte.is-doc .rte-host { padding: 2px 0; }
.rte.is-doc .rte-input { min-height: 240px; font-size: 14.5px; line-height: 1.7; }

/* Editing one update in place. */
.on-edit { margin-top: 6px; }
.on-edit .rte-input { min-height: 46px; max-height: 360px; overflow-y: auto; font-size: 13px; }
.on-edit-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.on-edited { font-size: 11px; color: var(--text-3); }

/* The text itself — in the editor and once saved. */
.rte-prose { line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.rte-prose > :first-child { margin-top: 0; }
.rte-prose > :last-child { margin-bottom: 0; }
.rte-prose p { margin: 0 0 .55em; }
.rte-prose h1, .rte-prose h2, .rte-prose h3 { margin: .8em 0 .35em; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.rte-prose h1 { font-size: 1.3em; }
.rte-prose h2 { font-size: 1.15em; }
.rte-prose h3 { font-size: 1.05em; }
.rte-prose strong { font-weight: 650; }
.rte-prose s { color: var(--text-3); }
.rte-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.rte-prose code { padding: 1px 5px; border-radius: 5px; background: var(--surface-3); font-family: var(--font-mono); font-size: .86em; }
.rte-prose pre { margin: 0 0 .7em; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-3); overflow-x: auto; }
.rte-prose pre code { padding: 0; background: none; font-size: .84em; white-space: pre; }
.rte-prose ul, .rte-prose ol { margin: 0 0 .55em; padding-left: 1.4em; }
.rte-prose li { margin: .1em 0; }
.rte-prose li > p { margin: 0; }
.rte-prose blockquote { margin: 0 0 .7em; padding: 2px 0 2px 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.rte-prose hr { margin: 1em 0; border: 0; border-top: 1px solid var(--border-strong); }
/* Checklists */
.rte-prose ul[data-type="taskList"], .rte-prose ul.contains-task-list { padding-left: 2px; list-style: none; }
.rte-prose li[data-type="taskItem"], .rte-prose li.task-list-item { display: flex; align-items: flex-start; gap: 8px; }
.rte-prose li[data-type="taskItem"] > label { flex: none; margin-top: 3px; }
.rte-prose li[data-type="taskItem"] > div { flex: 1; min-width: 0; }
.rte-prose li[data-type="taskItem"][data-checked="true"] > div { color: var(--text-3); text-decoration: line-through; }
.rte-prose li.task-list-item > input { flex: none; margin-top: 4px; }
.rte-prose input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); }
/* Tables: a clean grid that scrolls sideways when it's wide. */
.rte-prose .tableWrapper { margin: 0 0 .7em; overflow-x: auto; }
.rte-prose table { width: 100%; margin: 0 0 .7em; border-collapse: collapse; border-radius: var(--r-xs); font-size: .95em; table-layout: auto; }
.rte-prose .tableWrapper table { margin: 0; }
.rte-prose th, .rte-prose td { min-width: 70px; padding: 6px 10px; border: 1px solid var(--border-strong); text-align: left; vertical-align: top; }
.rte-prose th { background: var(--surface-2); font-weight: 600; }
.rte-prose th p, .rte-prose td p { margin: 0; }
.rte-prose .selectedCell { background: var(--accent-soft); }
