/* ============================================================
   foodfacts.org — Team Tasks
   Brand tokens taken from foodfacts.org: dark green #102d14,
   neon lime #bff335, yellow #e7fe53, green #3abb75, orange #ff941f,
   sage #f2f4f0 · type: Hanken Grotesk.
   ============================================================ */

:root {
  --ff-dark: #102d14; --ff-deep: #0e3b2e; --ff-green: #3abb75; --ff-neon: #bff335; --ff-yellow: #e7fe53;
  --ff-orange: #ff941f; --ff-red: #e5533f; --ff-mint: #c3ffb4; --ff-sage: #f2f4f0;
  --lime: #bff335; --orange: #ff941f;

  --accent: #bff335; --accent-hover: #afe51f; --on-accent: #102d14;
  --link: #1f8a52; --ring: #3abb75;

  --p1: #d9442f; --p2: #e07b00; --p3: #2f7bf5; --p4: #9aa89f;
  --p1-soft: #fdecea; --p2-soft: #fff1df; --p3-soft: #e8f0fe;

  --bg: #f2f4f0; --bg-elevated: #ffffff; --bg-muted: #e8ede6; --bg-hover: #edf2eb; --bg-active: #eaf8d4; --surface-2: #f7f9f5;
  --text: #102d14; --text-secondary: #46604f; --text-tertiary: #7b8f83;
  --border: #e0e7df; --border-strong: #cad6cc;
  --success: #2e9e5f; --warning: #e07b00; --danger: #d9442f; --info: #2f7bf5; --overdue: #d9442f;

  --sb-bg: #102d14; --sb-text: #e4eee6; --sb-muted: #90aa98; --sb-hover: rgba(255, 255, 255, 0.07); --sb-active: rgba(191, 243, 53, 0.13); --sb-border: rgba(255, 255, 255, 0.09);

  --radius-sm: 7px; --radius: 11px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 45, 20, 0.06);
  --shadow: 0 6px 20px rgba(16, 45, 20, 0.10);
  --shadow-lg: 0 18px 48px rgba(16, 45, 20, 0.20);
  --speed: 160ms; --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-w: 290px; --content-max: 780px; --content-wide: 1180px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --accent: #bff335; --accent-hover: #cdf95a; --on-accent: #0a1a0d; --link: #86e3ad; --ring: #bff335;
  --p1: #ff6b57; --p2: #ffa53d; --p3: #6ea4ff; --p4: #7d9186;
  --p1-soft: #3a1f1a; --p2-soft: #3a2a14; --p3-soft: #172a45;
  --bg: #0a1a0d; --bg-elevated: #10241a; --bg-muted: #173022; --bg-hover: #183322; --bg-active: #1f3a17; --surface-2: #0e2116;
  --text: #e8f2ea; --text-secondary: #a8bfae; --text-tertiary: #78917f;
  --border: #1d3827; --border-strong: #2a4a35;
  --success: #4fcf86; --overdue: #ff6b57; --danger: #ff6b57;
  --sb-bg: #06120a; --sb-border: rgba(255, 255, 255, 0.07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow: 0 6px 22px rgba(0, 0, 0, 0.5); --shadow-lg: 0 18px 52px rgba(0, 0, 0, 0.62);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--link); }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ring) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--ff-neon); color: var(--ff-dark); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
.muted { color: var(--text-tertiary); }
.small { font-size: 12.5px; }
.warn { color: var(--warning); }
.spacer { flex: 1; }

/* ============================================================
   Auth screens (sign in · setup · invite)
   ============================================================ */
.auth-root { min-height: 100vh; min-height: 100dvh; }
.auth-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 480px at 100% 0%, rgba(191, 243, 53, 0.20), transparent 60%),
    radial-gradient(700px 420px at 0% 100%, rgba(58, 187, 117, 0.22), transparent 60%),
    var(--ff-dark);
}
.auth-logo { display: block; height: 42px; width: auto; margin: 0 auto 26px; }
.auth-card {
  width: 100%; max-width: 410px; background: var(--bg-elevated); color: var(--text);
  border-radius: 22px; padding: 30px 28px 26px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.auth-sub { color: var(--text-secondary); margin: 6px 0 20px; font-size: 14.5px; }
.auth-field { display: block; margin-bottom: 13px; }
.auth-field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.auth-err { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 18px; margin: 2px 0 10px; }
.auth-note { color: var(--text-tertiary); font-size: 13px; text-align: center; margin-top: 16px; }
.auth-notice { background: var(--bg-active); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin: -6px 0 16px; }
.auth-foot { display: flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, 0.62); font-size: 12.5px; margin-top: 20px; }
.auth-foot svg { width: 14px; height: 14px; }
.auth-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-secondary); font-weight: 600; padding: 20px 0; }
.auth-loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Layout
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.mobile-bar { display: none; }

/* ---------- Sidebar (always brand-dark, like foodfacts.org's hero) ---------- */
.sidebar {
  background: var(--sb-bg); color: var(--sb-text); display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden; overflow: clip; position: relative;   /* clip: the panel itself must never scroll (only .sidebar-scroll does) */
}
.sidebar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 240px; height: 240px; background: radial-gradient(circle at 88% 92%, rgba(191, 243, 53, 0.12), transparent 66%); pointer-events: none; }
.sb-top { display: flex; align-items: center; gap: 6px; padding: 12px 10px 6px 10px; }
.sb-user { display: flex; align-items: center; gap: 9px; border: none; background: transparent; color: var(--sb-text); padding: 5px 8px 5px 5px; border-radius: 10px; font-weight: 700; font-size: 15px; min-width: 0; }
.sb-user:hover { background: var(--sb-hover); }
.sb-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-caret { width: 15px; height: 15px; opacity: 0.7; }
.sidebar .icon-btn { color: var(--sb-muted); }
.sidebar .icon-btn:hover { background: var(--sb-hover); color: #fff; }
.sb-bell { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--ff-orange); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--sb-bg); }
.sidebar .sb-close { display: none; }
.sb-add-row { display: flex; align-items: center; gap: 6px; padding: 4px 10px 8px; }
.sb-add { flex: 1; display: flex; align-items: center; gap: 10px; border: none; background: transparent; color: var(--ff-neon); font-weight: 800; font-size: 15px; padding: 7px 8px; border-radius: 10px; text-align: left; }
.sb-add:hover { background: var(--sb-hover); }
.sb-add-plus { width: 24px; height: 24px; border-radius: 50%; background: var(--ff-neon); color: var(--ff-dark); display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(191, 243, 53, 0.14); }
.sb-add-plus svg { width: 16px; height: 16px; stroke-width: 3; }
.sb-voice { width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(191, 243, 53, 0.35); background: rgba(191, 243, 53, 0.08); color: var(--ff-neon); display: grid; place-items: center; transition: background var(--speed), transform var(--speed); }
.sb-voice:hover { background: rgba(191, 243, 53, 0.18); transform: translateY(-1px); }
.sb-voice svg { width: 19px; height: 19px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 2px 8px 24px; position: relative; z-index: 1; }
.nav-section { margin-top: 16px; }
.nav-section:first-child { margin-top: 0; }
.nav-section-head { display: flex; align-items: center; gap: 6px; padding: 5px 10px 4px; color: var(--sb-muted); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.nav-section-head span { flex: 1; }
.nav-section-head button, .ws-head button { border: none; background: transparent; color: var(--sb-muted); display: grid; place-items: center; border-radius: 6px; padding: 3px; opacity: 0; transition: opacity var(--speed), background var(--speed), color var(--speed); }
.nav-section:hover .nav-section-head button, .ws-head:hover button { opacity: 1; }
.nav-section-head button:hover, .ws-head button:hover { background: var(--sb-hover); color: #fff; }
.nav-section-head svg, .ws-head button svg { width: 16px; height: 16px; }
.nav-hint { color: var(--sb-muted); font-size: 12.5px; padding: 2px 10px 6px 40px; opacity: 0.85; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; border: none; background: transparent; width: 100%;
  text-align: left; color: var(--sb-text); border-radius: 9px; font-size: 14.5px; font-weight: 600; position: relative; cursor: pointer;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
a.nav-item { text-decoration: none; box-sizing: border-box; -webkit-user-drag: none; }   /* sidebar items are real links (copy link / open in new tab) */
.nav-item:hover { background: var(--sb-hover); }
.nav-item.active { background: var(--sb-active); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--ff-neon); }
.nav-item.active .nav-icon { color: var(--ff-neon); }
.nav-item .nav-icon { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: var(--sb-muted); }
.nav-item .nav-icon svg { width: 19px; height: 19px; }
.nav-item .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-count { font-size: 12.5px; color: var(--sb-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: var(--ff-neon); }
.nav-item .dot-icon { display: grid; place-items: center; width: 20px; flex: none; }
.nav-item .dot-icon svg { width: 17px; height: 17px; }
.nav-item .row-actions { display: none; gap: 2px; }
.nav-item:hover .row-actions { display: flex; }
.nav-item:hover .nav-count { display: none; }
.nav-item .row-actions button { border: none; background: transparent; color: var(--sb-muted); border-radius: 6px; padding: 2px; display: grid; place-items: center; }
.nav-item .row-actions button:hover { background: var(--sb-hover); color: #fff; }
.nav-item .row-actions svg { width: 16px; height: 16px; }
.nav-children { margin-left: 16px; border-left: 1px solid var(--sb-border); padding-left: 4px; }
.folder-row { color: var(--sb-muted); font-weight: 700; }
.folder-caret { display: grid; place-items: center; color: var(--sb-muted); }
.folder-caret svg { width: 15px; height: 15px; transition: transform var(--speed); }
.folder-caret.collapsed svg { transform: rotate(-90deg); }
.ws-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 2px; border-radius: 10px; cursor: pointer; font-weight: 800; color: #fff; }
.ws-head:hover, .ws-head.active { background: var(--sb-hover); }
.ws-head .ws-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-mark { width: 22px; height: 22px; }
.sidebar-foot { border-top: 1px solid var(--sb-border); padding: 8px; display: flex; align-items: center; gap: 2px; position: relative; z-index: 1; }
.sync-btn { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; color: var(--sb-muted); font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 8px; }
.sync-btn:hover { background: var(--sb-hover); color: #fff; }
.sync-led { width: 8px; height: 8px; border-radius: 50%; background: var(--sb-muted); flex: none; }
.sync-btn.s-ok .sync-led { background: var(--ff-green); box-shadow: 0 0 0 3px rgba(58, 187, 117, 0.22); }
.sync-btn.s-pending .sync-led { background: var(--ff-yellow); animation: pulse 1.2s ease-in-out infinite; }
.sync-btn.s-error .sync-led, .sync-btn.s-offline .sync-led { background: var(--ff-orange); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Generic buttons ---------- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; background: transparent; color: var(--text-secondary); border-radius: var(--radius-sm); padding: 7px; transition: background var(--speed), color var(--speed); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.small { padding: 5px; }
.icon-btn.small svg { width: 17px; height: 17px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 10px; padding: 9px 16px; font-weight: 800; font-size: 14px; transition: background var(--speed), opacity var(--speed), transform var(--speed), box-shadow var(--speed); }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 -2px 0 rgba(16, 45, 20, 0.12); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: var(--bg-muted); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--on-accent); border-right-color: transparent; animation: spin 0.7s linear infinite; }
.danger-text { color: var(--danger) !important; }
.header-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--text-secondary); padding: 6px 9px; border-radius: 8px; font-weight: 700; font-size: 13.5px; transition: background var(--speed), color var(--speed); }
.header-btn:hover { background: var(--bg-hover); color: var(--text); }
.header-btn svg { width: 17px; height: 17px; }
.header-btn.active { color: var(--text); background: var(--bg-muted); }
.header-btn.accent { color: var(--link); }
.header-btn.danger { color: var(--danger); }
.link-btn { border: none; background: none; padding: 0; color: var(--link); font-weight: 700; font-size: inherit; display: inline-flex; align-items: center; gap: 5px; }
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 15px; height: 15px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text-secondary); border-radius: 9px; padding: 5px 10px; font-size: 13px; font-weight: 700; transition: background var(--speed), border-color var(--speed), color var(--speed); }
.chip-btn:hover { background: var(--bg-hover); color: var(--text); }
.chip-btn svg { width: 16px; height: 16px; }
.chip-btn.is-set { color: var(--text); border-color: color-mix(in srgb, var(--ff-green) 55%, transparent); background: color-mix(in srgb, var(--ff-green) 9%, var(--bg-elevated)); }
.chip-btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.pill-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text); border-radius: 20px; padding: 4px 11px; font-size: 13px; font-weight: 700; }
.pill-btn svg { width: 14px; height: 14px; }
.pill-btn.joined { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.pill-btn.joined:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- Avatars ---------- */
.avatar {
  --av: #3abb75; width: 26px; height: 26px; border-radius: 50%; background: var(--av); color: #fff; font-weight: 800; font-size: 10.5px;
  display: inline-grid; place-items: center; flex: none; letter-spacing: 0.02em; line-height: 1; user-select: none; vertical-align: middle;
}
.av-xs { width: 18px; height: 18px; font-size: 8px; }
.av-sm { width: 24px; height: 24px; font-size: 9.5px; }
.av-md { width: 30px; height: 30px; font-size: 11.5px; }
.av-lg { width: 42px; height: 42px; font-size: 15px; }
.av-xl { width: 60px; height: 60px; font-size: 21px; }
.avatar.removed { filter: grayscale(1); opacity: 0.55; }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .avatar { box-shadow: 0 0 0 2px var(--bg-elevated); }
.av-stack .avatar + .avatar { margin-left: -7px; }
.av-more { background: var(--bg-muted); color: var(--text-secondary); }
.sidebar .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }
.you-tag, .invited-tag { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 10px; vertical-align: 2px; margin-left: 4px; }
.you-tag { background: var(--bg-active); color: var(--success); }
.invited-tag { background: color-mix(in srgb, var(--ff-orange) 18%, transparent); color: var(--warning); }

/* ============================================================
   Main content
   ============================================================ */
.main { overflow-y: auto; height: 100vh; height: 100dvh; background: var(--bg); position: relative; }
body.backdrop-on .main {
  background:
    radial-gradient(1100px 460px at 108% -8%, rgba(191, 243, 53, 0.30), transparent 62%),
    radial-gradient(800px 420px at -12% 108%, rgba(58, 187, 117, 0.13), transparent 60%),
    var(--bg);
}
[data-theme="dark"] body.backdrop-on .main {
  background:
    radial-gradient(1100px 460px at 108% -8%, rgba(191, 243, 53, 0.13), transparent 62%),
    radial-gradient(800px 420px at -12% 108%, rgba(58, 187, 117, 0.10), transparent 60%),
    var(--bg);
}
.content { max-width: var(--content-max); margin: 0 auto; padding: 34px 44px 140px; }
.content.wide { max-width: var(--content-wide); }
.view-header { margin-bottom: 18px; }
.view-title-row { display: flex; align-items: center; gap: 12px; }
.view-title { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; display: flex; align-items: center; gap: 10px; line-height: 1.2; }
.view-title .swatch-lg { width: 13px; height: 13px; border-radius: 50%; }
.view-sub { color: var(--text-tertiary); font-size: 13.5px; margin-top: 4px; font-weight: 600; }
.view-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.loading-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 90px 20px; color: var(--text-secondary); font-weight: 700; }
.loading-face { width: 64px; height: 64px; animation: bob 2s ease-in-out infinite; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-muted); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--text-secondary); padding: 6px 13px; border-radius: 8px; font-weight: 700; font-size: 13px; transition: background var(--speed), color var(--speed); }
.seg button.on { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-sm button { padding: 4px 11px; font-size: 12.5px; }
.seg-block { display: flex; }
.seg-block button { flex: 1; }

/* ---------- Sections ---------- */
.task-section { margin-bottom: 10px; }
.section-head { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.section-caret { border: none; background: transparent; color: var(--text-tertiary); display: grid; place-items: center; padding: 2px; border-radius: 5px; margin-left: -4px; }
.section-caret:hover { background: var(--bg-hover); color: var(--text); }
.section-caret svg { width: 16px; height: 16px; transition: transform var(--speed); }
.section-caret.collapsed svg { transform: rotate(-90deg); }
.section-name { font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.section-name.overdue-label { color: var(--overdue); }
.section-name.today-label { color: var(--success); }
.section-name.muted { color: var(--text-tertiary); }
.section-count { color: var(--text-tertiary); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-action { border: none; background: transparent; color: var(--text-tertiary); border-radius: 6px; padding: 3px; display: grid; place-items: center; transition: opacity var(--speed), background var(--speed), color var(--speed); }
.section-action:hover { background: var(--bg-hover); color: var(--text); }
.section-action svg { width: 17px; height: 17px; }
.section-head .section-action { opacity: 0; }
.section-head:hover .section-action { opacity: 1; }

/* ---------- Task row ---------- */
.task-list { position: relative; }
.task { display: flex; align-items: flex-start; gap: 11px; padding: 10px 6px 10px 2px; border-bottom: 1px solid var(--border); position: relative; transition: background var(--speed); }
.task:hover .task-actions { opacity: 1; }
.task.dragging { opacity: 0.4; }
.task.drag-over-top { box-shadow: inset 0 2px 0 var(--ff-green); }
.task.drag-over-bottom { box-shadow: inset 0 -2px 0 var(--ff-green); }
.task.removing { opacity: 0; transform: translateX(4px); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); }
.checkbox { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.7px solid var(--p4); background: transparent; display: grid; place-items: center; padding: 0; transition: border-color var(--speed), background var(--speed); }
.checkbox .check { width: 13px; height: 13px; color: var(--text-tertiary); opacity: 0; transform: scale(0.5); transition: opacity var(--speed), transform var(--speed); stroke-width: 3; }
.checkbox:hover .check { opacity: 1; transform: scale(1); }
.checkbox.p1 { border-color: var(--p1); background: var(--p1-soft); }
.checkbox.p1 .check { color: var(--p1); }
.checkbox.p2 { border-color: var(--p2); background: var(--p2-soft); }
.checkbox.p2 .check { color: var(--p2); }
.checkbox.p3 { border-color: var(--p3); background: var(--p3-soft); }
.checkbox.p3 .check { color: var(--p3); }
.checkbox.checked { background: var(--ff-green); border-color: var(--ff-green); }
.checkbox.checked .check { opacity: 1; transform: scale(1); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-main { display: flex; align-items: flex-start; gap: 8px; }
.task-text { flex: 1; min-width: 0; cursor: pointer; }
.task-content { font-size: 14.5px; line-height: 1.45; word-wrap: break-word; font-weight: 500; }
.task-content.done { color: var(--text-tertiary); text-decoration: line-through; }
.task-content .lnk, .mini-name .lnk, .comment-text .lnk, .proj-desc .lnk { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.task-desc-preview { display: flex; align-items: center; gap: 5px; color: var(--text-tertiary); font-size: 12.5px; margin-top: 2px; }
.task-desc-preview svg { width: 13px; height: 13px; flex: none; }
.task-desc-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 11px; margin-top: 5px; }
.meta-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-tertiary); }
.meta-chip svg { width: 13px; height: 13px; }
.meta-chip.due { color: var(--text-secondary); }
.meta-chip.due.today { color: var(--success); font-weight: 800; }
.meta-chip.due.overdue { color: var(--overdue); font-weight: 800; }
.meta-chip.due.tomorrow { color: var(--p2); font-weight: 800; }
.meta-chip.project, .meta-chip.content-link { cursor: pointer; }
.meta-chip.project:hover { color: var(--text); }
.meta-chip.content-link { color: var(--cc); max-width: 260px; }
.meta-chip.content-link:hover { text-decoration: underline; }
.mini-hash { display: inline-grid; }
.mini-hash svg { width: 12px; height: 12px; }
.label-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: var(--bg-muted); color: var(--text-secondary); cursor: pointer; }
.label-chip .swatch { width: 7px; height: 7px; border-radius: 50%; }
.subtask-progress { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-tertiary); font-weight: 700; }
.subtask-progress svg { width: 13px; height: 13px; }
.task-actions { display: flex; gap: 1px; opacity: 0; transition: opacity var(--speed); flex: none; margin-top: -2px; }
.task-actions button { border: none; background: transparent; color: var(--text-tertiary); border-radius: 6px; padding: 4px; display: grid; place-items: center; transition: background var(--speed), color var(--speed); }
.task-actions button:hover { background: var(--bg-hover); color: var(--text); }
.task-actions svg { width: 17px; height: 17px; }
.task-assignee { border: none; background: none; padding: 0; margin-top: -1px; border-radius: 50%; display: grid; }
.drag-handle { cursor: grab; touch-action: none; }
.subtasks { margin-left: 31px; }
.add-task-inline { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 6px; margin-top: 2px; border: none; background: transparent; color: var(--text-tertiary); font-weight: 700; font-size: 14px; border-radius: 8px; transition: color var(--speed); }
.add-task-inline:hover { color: var(--text); }
.add-task-inline .plus-sm { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--success); transition: background var(--speed), color var(--speed); }
.add-task-inline:hover .plus-sm { background: var(--ff-neon); color: var(--ff-dark); }
.add-task-inline .plus-sm svg { width: 15px; height: 15px; stroke-width: 2.6; }
.add-section { margin-top: 14px; }

/* publishing band (Today / Upcoming) */
.pub-band { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 11px; margin: 4px 0 10px; background: color-mix(in srgb, var(--ff-neon) 16%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--ff-green) 28%, transparent); border-radius: 12px; }
.pub-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-right: 4px; }
.pub-label svg { width: 15px; height: 15px; }
.content-mini { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--border); background: var(--bg-elevated); border-left: 3px solid var(--cc); border-radius: 8px; padding: 4px 9px 4px 7px; font-size: 13px; font-weight: 700; color: var(--text); }
.content-mini svg { width: 14px; height: 14px; color: var(--cc); }
.content-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.content-mini:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 20px; color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.channel-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--cc); white-space: nowrap; }
.channel-chip svg { width: 15px; height: 15px; }

/* ============================================================
   Composer
   ============================================================ */
.composer { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--bg-elevated); box-shadow: var(--shadow-sm); padding: 12px 14px 10px; margin: 4px 0 10px; }
.composer:focus-within { border-color: color-mix(in srgb, var(--ff-green) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ff-neon) 22%, transparent); }
.composer-input { width: 100%; border: none; background: transparent; color: var(--text); font-size: 15px; font-weight: 600; resize: none; outline: none; line-height: 1.5; padding: 0; min-height: 22px; max-height: 160px; }
.composer-input::placeholder, .composer-desc::placeholder { color: var(--text-tertiary); font-weight: 500; }
.composer-desc { width: 100%; border: none; background: transparent; color: var(--text-secondary); font-size: 13.5px; resize: none; outline: none; margin-top: 4px; min-height: 20px; max-height: 120px; }
.composer-parsed { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.composer-parsed:empty { margin-top: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border-strong); color: var(--text-secondary); background: var(--bg); }
.pill svg { width: 13px; height: 13px; }
.pill.due { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 8%, transparent); }
.pill.due.overdue { color: var(--overdue); border-color: color-mix(in srgb, var(--overdue) 40%, transparent); background: color-mix(in srgb, var(--overdue) 8%, transparent); }
.pill.prio.p1 { color: var(--p1); background: var(--p1-soft); }
.pill.prio.p2 { color: var(--p2); background: var(--p2-soft); }
.pill.prio.p3 { color: var(--p3); background: var(--p3-soft); }
.composer-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; border-top: 1px solid var(--border); margin: 10px -14px -10px; padding: 8px 12px; }
.composer-actions { display: flex; gap: 8px; margin-left: auto; }

/* ============================================================
   Empty states
   ============================================================ */
.empty { text-align: center; padding: 54px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty.compact { padding: 14px 8px; }
.empty .empty-art { width: 168px; height: 132px; margin-bottom: 8px; }
.empty h3 { font-size: 16px; font-weight: 800; }
.empty p { color: var(--text-tertiary); font-size: 13.5px; max-width: 360px; }

/* ============================================================
   Project header, member header
   ============================================================ */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.crumbs svg { width: 14px; height: 14px; }
.crumbs .link-btn { color: var(--text-tertiary); }
.crumbs .link-btn:hover { color: var(--text); }
.crumb-sep { opacity: 0.6; }
.proj-hash { display: grid; }
.proj-hash svg { width: 22px; height: 22px; stroke-width: 2.4; }
.proj-desc { color: var(--text-secondary); font-size: 14px; margin-top: 6px; max-width: 640px; white-space: pre-wrap; }
.proj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.proj-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.proj-progress .pbar { width: 90px; }
.private-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-tertiary); }
.private-tag svg { width: 14px; height: 14px; }
.archived-banner { display: flex; align-items: center; gap: 10px; background: var(--bg-muted); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.health-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-elevated); font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.health-chip[role="button"] { cursor: pointer; }
.health-chip[role="button"]:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.health-chip svg { width: 15px; height: 15px; color: var(--hc); }
.pbar { display: inline-block; width: 64px; height: 6px; border-radius: 6px; background: var(--bg-muted); overflow: hidden; vertical-align: middle; flex: none; }
.pbar > span { display: block; height: 100%; background: var(--ff-green); border-radius: 6px; transition: width 0.4s var(--ease); }
.member-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.member-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; font-size: 13.5px; color: var(--text-secondary); }
.member-stats strong { color: var(--text); font-size: 15px; }
.member-stats .warn strong { color: var(--warning); }

/* ============================================================
   Workspace page (Projects + People)
   ============================================================ */
.ws-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ws-hero-face { width: 44px; height: 44px; border-radius: 12px; }
.ws-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.ws-hero-sub { color: var(--text-tertiary); font-weight: 700; font-size: 13.5px; margin-top: 2px; }
.ws-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: inline-flex; background: var(--bg-muted); border-radius: 12px; padding: 4px; gap: 2px; }
.tab { border: none; background: transparent; color: var(--text-secondary); font-weight: 800; font-size: 14px; padding: 7px 16px; border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; }
.tab.on { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-count { font-size: 11.5px; background: var(--bg-muted); color: var(--text-secondary); padding: 0 7px; border-radius: 10px; }
.inline-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-secondary); padding: 0 6px; }
.mini-search { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 9px; padding: 0 9px; height: 34px; }
.mini-search svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.mini-search input { border: none; background: transparent; outline: none; width: 150px; font-size: 13.5px; }
.mini-search:focus-within { border-color: color-mix(in srgb, var(--ff-green) 55%, transparent); }
.ws-table { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ws-row { display: grid; grid-template-columns: minmax(240px, 1.7fr) 150px 150px 120px 44px; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--speed); }
.ws-row:last-child { border-bottom: none; }
.ws-row:hover { background: var(--surface-2); }
.ws-headrow { cursor: default; background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); }
.ws-headrow:hover { background: var(--surface-2); }
.ws-cell { min-width: 0; display: flex; align-items: center; gap: 8px; }
.ws-name { gap: 12px; }
.ws-row.nested .ws-name { padding-left: 34px; }
.ws-hash { display: grid; color: var(--text-tertiary); }
.ws-hash svg { width: 18px; height: 18px; stroke-width: 2.3; }
.ws-name-text { min-width: 0; }
.ws-pname { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; border: none; background: none; padding: 0; }
.ws-status svg { width: 13px; height: 13px; }
.ws-status.joined { color: var(--success); }
.ws-status.join { color: var(--link); cursor: pointer; }
.ws-status.join:hover { text-decoration: underline; }
.ws-pct { font-size: 13px; font-weight: 800; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 36px; }
.ws-more { justify-content: flex-end; }
.ws-folder .ws-pname { font-weight: 800; }
.ws-folder .folder-caret { color: var(--text-tertiary); margin-left: -4px; }
.ws-empty { padding: 30px 16px; text-align: center; color: var(--text-tertiary); font-weight: 600; }
.sort-btn { display: inline-flex; align-items: center; gap: 3px; border: none; background: none; color: var(--text-tertiary); font-weight: 700; font-size: 12.5px; padding: 2px 4px; border-radius: 6px; }
.sort-btn:hover { background: var(--bg-hover); color: var(--text); }
.sort-btn svg { width: 14px; height: 14px; }
.people-table .ws-row { grid-template-columns: minmax(230px, 1.8fr) 140px 70px 80px 80px 44px; }
.ws-num { justify-content: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.ws-num.warn { color: var(--warning); }
.people-table .ws-headrow .ws-num { font-weight: 800; }
.role-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); }
.role-tag svg { width: 14px; height: 14px; }
.role-tag.r-owner { color: var(--warning); }
.role-tag.r-admin { color: var(--info); }
.table-note { color: var(--text-tertiary); font-size: 12.5px; margin-top: 10px; }
.select-sm { padding: 5px 8px; font-size: 13px; width: auto; }

/* ============================================================
   Content calendar
   ============================================================ */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.cal-nav { display: inline-flex; align-items: center; gap: 2px; }
.cal-label { font-weight: 800; font-size: 16px; min-width: 150px; text-align: center; letter-spacing: -0.01em; }
.cal-filters { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.filter-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); font-weight: 700; font-size: 13px; padding: 5px 9px; border-radius: 9px; }
.filter-btn svg { width: 14px; height: 14px; }
.filter-btn.is-set { border-color: color-mix(in srgb, var(--ff-green) 55%, transparent); color: var(--text); background: color-mix(in srgb, var(--ff-neon) 18%, var(--bg-elevated)); }
.cal-month { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-dow span { padding: 8px 10px; font-size: 12px; font-weight: 800; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(122px, auto); }
.cal-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; min-width: 0; display: flex; flex-direction: column; gap: 4px; transition: background var(--speed); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .cal-daynum { opacity: 0.45; }
.cal-cell.past .cal-daynum { color: var(--text-tertiary); }
.cal-cell.cal-drop { background: color-mix(in srgb, var(--ff-neon) 24%, var(--bg-elevated)); box-shadow: inset 0 0 0 2px var(--ff-green); }
.cal-cell-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.cal-daynum { font-size: 13px; font-weight: 800; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-daynum { background: var(--ff-neon); color: var(--ff-dark); }
.cal-add { border: none; background: transparent; color: var(--text-tertiary); border-radius: 6px; padding: 2px; display: grid; place-items: center; opacity: 0; transition: opacity var(--speed), background var(--speed); }
.cal-add svg { width: 15px; height: 15px; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--bg-hover); color: var(--text); }
.cal-chip { display: flex; align-items: center; gap: 5px; padding: 3px 7px 3px 5px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; min-width: 0; position: relative;
  background: var(--surface-2); background: color-mix(in srgb, var(--cc) 13%, var(--bg-elevated)); border-left: 3px solid var(--cc); }
.cal-chip:hover { background: color-mix(in srgb, var(--cc) 22%, var(--bg-elevated)); }
.cal-chip::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); flex: none; margin-left: auto; }
.cal-chip.s-published .cal-chip-t { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent); opacity: 0.75; }
.cal-chip.dragging, .cal-card.dragging { opacity: 0.4; }
.cal-chip-ic { display: grid; color: var(--cc); }
.cal-chip-ic svg { width: 13px; height: 13px; }
.cal-chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-time { color: var(--text-tertiary); font-weight: 700; margin-right: 3px; font-size: 11.5px; }
.cal-more { border: none; background: none; color: var(--text-tertiary); font-weight: 800; font-size: 12px; text-align: left; padding: 1px 5px; border-radius: 6px; }
.cal-more:hover { background: var(--bg-hover); color: var(--text); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(126px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.cal-wcol { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 8px; min-height: 280px; display: flex; flex-direction: column; gap: 7px; transition: background var(--speed), box-shadow var(--speed); }
.cal-wcol.today { border-color: color-mix(in srgb, var(--ff-green) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ff-neon) 30%, transparent); }
.cal-wcol.past { opacity: 0.8; }
.cal-wcol.cal-drop { background: color-mix(in srgb, var(--ff-neon) 18%, var(--bg-elevated)); box-shadow: inset 0 0 0 2px var(--ff-green); }
.cal-whead { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 6px; border-bottom: 1px solid var(--border); }
.cal-wdow { font-size: 12px; font-weight: 800; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.cal-wnum { font-size: 20px; font-weight: 800; }
.cal-wcol.today .cal-wnum { color: var(--success); }
.cal-card { border: 1px solid var(--border); border-left: 4px solid var(--sc); border-radius: 10px; padding: 8px 9px; background: var(--bg-elevated); cursor: pointer; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.cal-card:hover { border-color: var(--border-strong); }
.cal-card-top, .cal-card-foot { display: flex; align-items: center; gap: 6px; }
.cal-card-title { font-weight: 800; font-size: 13.5px; line-height: 1.3; }
.cal-tasks { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--text-tertiary); }
.cal-tasks svg { width: 13px; height: 13px; }
.cal-wadd { border: 1px dashed var(--border-strong); background: transparent; color: var(--text-tertiary); border-radius: 9px; padding: 6px; font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: auto; }
.cal-wadd:hover { color: var(--text); border-color: var(--ff-green); }
.cal-wadd svg { width: 14px; height: 14px; }
.cal-list { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 4px; }
.cal-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cal-row:last-child { border-bottom: none; }
.cal-row:hover { background: var(--surface-2); }
.cal-row-main { flex: 1; min-width: 0; }
.cal-row-title { font-weight: 800; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row-sub { color: var(--text-tertiary); font-size: 12.5px; font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.cal-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend.compact { margin-top: 8px; }

/* ============================================================
   Board
   ============================================================ */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 24px; scroll-snap-type: x proximity; }
.board-col { flex: 0 0 290px; max-width: 290px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px; scroll-snap-align: start; }
.board-col.drag-over { outline: 2px dashed var(--ff-green); outline-offset: -2px; }
.board-col-add { background: transparent; border: none; }
.board-col-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 10px; }
.board-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 11px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow-sm); flex-direction: column; align-items: stretch; gap: 0; }
.board-card .task-main { width: 100%; }
.card-foot { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(8, 24, 12, 0.55); display: grid; place-items: start center; padding: 6vh 16px 16px; z-index: 1000; animation: fade-in 0.18s var(--ease); overflow-y: auto; }
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.7); }
.modal { background: var(--bg-elevated); border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; animation: modal-in 0.2s var(--ease); border: 1px solid var(--border); }
.modal.wide { max-width: 640px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 800; flex: 1; }
.modal-head .crumb { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 13px; font-weight: 700; flex: 1; min-width: 0; }
.modal-head .crumb svg { width: 15px; height: 15px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.confirm-text { color: var(--text-secondary); line-height: 1.55; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); margin-bottom: 6px; }
.field-note { color: var(--text-tertiary); font-size: 12.5px; line-height: 1.5; margin: -6px 0 12px; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color var(--speed), box-shadow var(--speed); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--ff-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ff-neon) 26%, transparent); }
.textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.input-sm { padding: 6px 9px; font-size: 13.5px; border-radius: 8px; }
.input-ghost { border-style: dashed; background: transparent; margin-top: 6px; }
.select-auto { width: auto; }
.input.title-input { font-size: 19px; font-weight: 800; border: none; padding: 2px 0; background: transparent; resize: none; line-height: 1.35; letter-spacing: -0.01em; }
.input.title-input:focus { box-shadow: none; }
.input.title-input.done { text-decoration: line-through; color: var(--text-tertiary); }
.desc-input { border: none !important; padding: 2px 0 !important; min-height: 26px; margin-top: 2px; box-shadow: none !important; background: transparent; color: var(--text-secondary); }
.detail-checkrow { display: flex; align-items: flex-start; gap: 12px; }
.detail-checkrow .checkbox { margin-top: 5px; }
.detail-text { flex: 1; min-width: 0; }
.detail-props { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.prop-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; transition: background var(--speed); min-height: 38px; }
.prop-row:hover { background: var(--bg-hover); }
.prop-row.static { cursor: default; }
.prop-row.static:hover { background: transparent; }
.prop-row .prop-label { display: flex; align-items: center; gap: 9px; color: var(--text-secondary); font-size: 13.5px; font-weight: 700; width: 118px; flex: none; }
.prop-row .prop-label svg { width: 17px; height: 17px; color: var(--text-tertiary); }
.prop-row .prop-value { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prop-row .prop-value.placeholder, .prop-value .placeholder { color: var(--text-tertiary); font-weight: 500; }
.prop-inputs { flex-wrap: nowrap !important; }
.prop-inputs .input { max-width: 190px; }
.manage-row .prop-value strong { font-weight: 800; }
.linked-tasks { margin-top: 16px; }
.linked-tasks .section-head .pbar { width: 70px; }
.mini-task { cursor: default; gap: 10px; padding: 7px 8px; }
.mini-task .checkbox { margin: 0; }
.mini-name { cursor: pointer; }
.mini-task.done .mini-name { text-decoration: line-through; color: var(--text-tertiary); }
.mini-task .section-action { opacity: 0.6; }
.open-linked { margin: 10px 10px 0; }
.detail-history { color: var(--text-tertiary); font-size: 12px; margin-top: 16px; }
.content-modal .title-input { margin-bottom: 6px; }

/* comments */
.comments { margin-top: 18px; }
.comment { display: flex; gap: 10px; padding: 9px 2px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-meta span { color: var(--text-tertiary); font-size: 12px; font-weight: 600; }
.comment-del { border: none; background: none; color: var(--text-tertiary); padding: 2px; border-radius: 5px; margin-left: auto; opacity: 0; display: grid; }
.comment:hover .comment-del { opacity: 1; }
.comment-acts { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.comment-like { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-tertiary);
  border-radius: 999px; padding: 2px 9px 2px 7px; font-size: 12px; font-weight: 800; line-height: 1.6; transition: color 120ms, border-color 120ms, background 120ms; }
.comment-like svg { width: 14px; height: 14px; }
.comment-like:hover:not(:disabled) { color: #e5533f; border-color: color-mix(in srgb, #e5533f 45%, var(--border)); }
.comment-like.on { color: #e5533f; background: color-mix(in srgb, #e5533f 10%, var(--bg-elevated)); border-color: color-mix(in srgb, #e5533f 40%, var(--border)); }
.comment-like.own { color: #e5533f; cursor: default; }
.comment-like.pop svg { animation: like-pop 420ms cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.comment-likers { display: inline-flex; }
.comment-likers .avatar + .avatar { margin-left: -6px; }
.comment-likers .avatar { box-shadow: 0 0 0 2px var(--bg-elevated); }
.comment .comment-acts:empty { display: none; }
.comment-del svg { width: 14px; height: 14px; }
.comment-text { font-size: 14px; line-height: 1.5; margin-top: 2px; word-wrap: break-word; }
.mention { background: color-mix(in srgb, var(--ff-neon) 45%, transparent); color: var(--text); border-radius: 5px; padding: 0 4px; font-weight: 700; }
.comment-compose { display: flex; align-items: flex-end; gap: 9px; margin-top: 8px; }
.comment-compose .textarea { min-height: 40px; padding: 9px 11px; resize: none; }
/* @mentions: the picker above the comment box, and who'll be told */
.mention.me { background: color-mix(in srgb, var(--orange) 32%, transparent); }
.compose-box { position: relative; flex: 1; min-width: 0; }
.compose-box .textarea { width: 100%; display: block; }
.mention-btn { flex: none; width: 36px; height: 38px; font-size: 17px; font-weight: 800; color: var(--text-secondary); border: 1px solid var(--border); background: var(--bg-elevated); }
.mention-btn:hover { background: var(--bg-hover); color: var(--text); }
.mention-pop { position: absolute; left: 0; bottom: calc(100% + 6px); width: min(330px, calc(100vw - 88px)); max-height: 264px; overflow-y: auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; z-index: 40; }
.mention-pop[hidden], .mention-hint[hidden] { display: none; }
.mention-opt { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.mention-opt.active, .mention-opt:hover { background: var(--bg-hover); }
.mention-opt.cant { opacity: 0.62; }
.mention-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mention-note { font-size: 11.5px; color: var(--warning); white-space: nowrap; }
.mention-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 6px 0 0 41px; font-size: 12.5px; line-height: 1.4; color: var(--text-tertiary); }
.mention-hint svg { width: 13px; height: 13px; flex: none; }
.warn-text { color: var(--warning); }

/* invite link box */
.invite-lead { color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.link-box { display: flex; gap: 8px; }
.link-box .input { font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.invite-note { display: flex; align-items: flex-start; gap: 7px; color: var(--text-tertiary); font-size: 12.5px; margin-top: 14px; line-height: 1.5; }
.invite-note svg { width: 15px; height: 15px; margin-top: 2px; }

/* ---------- Popover menu ---------- */
.popover { position: fixed; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 1100; min-width: 210px; max-width: 360px; max-height: 70vh; overflow-y: auto; animation: pop-in 0.13s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.97) translateY(-4px); } to { opacity: 1; transform: none; } }
.popover.narrow { min-width: 180px; }
.menu-item { display: flex; align-items: center; gap: 11px; width: 100%; border: none; background: transparent; text-align: left; color: var(--text); padding: 8px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; transition: background var(--speed); }
.menu-item:hover { background: var(--bg-hover); }
.menu-item svg { width: 17px; height: 17px; color: var(--text-tertiary); flex: none; }
.menu-item .mi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .mi-hint { color: var(--text-tertiary); font-size: 12px; font-weight: 600; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-item.is-selected { font-weight: 800; }
.menu-item.is-selected > svg:last-child { color: var(--success); }
.mi-lock { display: grid; }
.mi-lock svg { width: 15px; height: 15px; color: inherit !important; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-head { padding: 7px 10px 4px; font-size: 11.5px; font-weight: 800; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.menu-search { padding: 4px; }
.menu-search input { width: 100%; border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 10px; background: var(--bg); color: var(--text); outline: none; }
.menu-search input:focus { border-color: var(--ff-green); }
.menu-empty { padding: 10px; text-align: center; color: var(--text-tertiary); font-size: 13px; line-height: 1.45; }
.prio-flag { width: 17px; height: 17px; display: grid; }
.prio-flag.p1 { color: var(--p1); } .prio-flag.p2 { color: var(--p2); } .prio-flag.p3 { color: var(--p3); } .prio-flag.p4 { color: var(--p4); }
.color-grid, .av-colors { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 4px 0; }
.av-colors { grid-template-columns: repeat(10, 1fr); max-width: 380px; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; cursor: pointer; transition: transform var(--speed); padding: 0; }
.color-dot:hover { transform: scale(1.12); }
.color-dot.selected { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--text); }
.color-dot svg { width: 14px; height: 14px; color: #fff; opacity: 0; stroke-width: 3; }
.color-dot.selected svg { opacity: 1; }
.label-pick-list { max-height: 240px; overflow-y: auto; }
.label-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.label-pick:hover { background: var(--bg-hover); }
.label-pick .check-box-sm { width: 17px; height: 17px; border: 1.7px solid var(--border-strong); border-radius: 5px; display: grid; place-items: center; }
.label-pick.on .check-box-sm { background: var(--ff-green); border-color: var(--ff-green); }
.label-pick .check-box-sm svg { width: 12px; height: 12px; color: #fff; opacity: 0; stroke-width: 3; }
.label-pick.on .check-box-sm svg { opacity: 1; }
/* user menu + notifications */
.um-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 10px; }
.um-id { min-width: 0; }
.um-name { font-weight: 800; }
.um-email, .um-role { color: var(--text-tertiary); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.notif-pop { width: 400px; padding: 0 !important; }
.np-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.np-title { font-size: 15px; font-weight: 800; }
.np-count { font-size: 11.5px; font-weight: 800; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.np-link { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--link); font-weight: 700; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; }
.np-link:hover:not(:disabled) { background: var(--bg-hover); }
.np-link:disabled { color: var(--text-tertiary); cursor: default; }
.np-link svg { width: 14px; height: 14px; }
.np-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px 16px; border-bottom: 1px solid var(--border); }
.np-chip { border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.np-chip b { color: var(--text-tertiary); font-weight: 800; margin-left: 2px; }
.np-chip:hover { background: var(--bg-hover); }
.np-chip.on { background: var(--ff-dark); border-color: var(--ff-dark); color: #fff; }
.np-chip.on b { color: var(--ff-neon); }
.np-list { max-height: min(60vh, 520px); overflow-y: auto; padding: 4px 6px 8px; }
.np-day { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); padding: 10px 10px 4px; }
.np-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-tertiary); font-weight: 600; }
.np-foot > svg { width: 15px; height: 15px; }
.np-foot .np-link { margin-left: auto; }
.notif { display: flex; align-items: flex-start; border-radius: 10px; position: relative; }
.notif:hover { background: var(--bg-hover); }
.notif.unread { background: color-mix(in srgb, var(--ff-neon) 16%, transparent); }
.notif.unread::before { content: ""; position: absolute; left: 3px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--ff-green); }
.notif-main { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; text-align: left; border: none; background: transparent; padding: 9px 4px 9px 12px; border-radius: 10px; }
.notif-acts { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; opacity: 0; transition: opacity 120ms; }
.notif:hover .notif-acts, .notif:focus-within .notif-acts { opacity: 1; }
@media (hover: none) { .notif-acts { opacity: 1; } }
.notif-kind { margin-right: 5px; }
.notif-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.notif-text { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.notif-snippet { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 11.5px; color: var(--text-tertiary); font-weight: 600; }

/* ============================================================
   Toasts + confetti
   ============================================================ */
.toast-root { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1200; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 14px; background: var(--ff-dark); color: #f1f7f2; border-radius: 13px; padding: 11px 12px 11px 16px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; pointer-events: auto; min-width: 280px; max-width: 92vw; animation: toast-in 0.22s var(--ease); border: 1px solid rgba(191, 243, 53, 0.2); }
[data-theme="dark"] .toast { background: #eaf5ec; color: var(--ff-dark); }
.toast.leaving { animation: toast-out 0.2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }
.toast .toast-msg { flex: 1; }
.toast .toast-action { border: none; background: transparent; color: var(--ff-neon); font-weight: 800; padding: 5px 8px; border-radius: 7px; font-size: 13.5px; }
[data-theme="dark"] .toast .toast-action { color: var(--success); }
.toast .toast-action:hover { background: rgba(255, 255, 255, 0.1); }
.celebrate-root { position: fixed; inset: 0; pointer-events: none; z-index: 1300; overflow: hidden; }
.confetti { position: absolute; width: 9px; height: 14px; top: -20px; will-change: transform, opacity; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { 0% { transform: translateY(-20px) rotateZ(0deg); opacity: 1; } 100% { transform: translateY(105vh) rotateZ(720deg); opacity: 0.9; } }

/* ============================================================
   Search, stats, panels, settings
   ============================================================ */
.search-bar { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-strong); background: var(--bg-elevated); border-radius: 14px; padding: 11px 15px; margin-bottom: 18px; }
.search-bar:focus-within { border-color: var(--ff-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ff-neon) 24%, transparent); }
.search-bar svg { width: 19px; height: 19px; color: var(--text-tertiary); }
.search-bar input { flex: 1; border: none; background: transparent; outline: none; color: var(--text); font-size: 15px; }
.search-group { font-size: 12px; font-weight: 800; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 20px; padding: 4px 12px 4px 5px; font-weight: 700; font-size: 13.5px; }
.person-chip:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm); }
.stat-card.lime { background: var(--ff-dark); color: #fff; border-color: transparent; }
.stat-card.lime .stat-label { color: rgba(255, 255, 255, 0.7); }
.stat-card.lime .stat-icon { color: var(--ff-neon); }
.stat-card .stat-num { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-card .stat-label { color: var(--text-tertiary); font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.stat-card .stat-icon { float: right; color: var(--text-tertiary); }
.stat-card .stat-icon svg { width: 22px; height: 22px; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.insight-grid .panel { margin-bottom: 0; }
.weekbar { display: flex; align-items: flex-end; gap: 8px; height: 130px; margin-top: 14px; }
.weekbar .day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.weekbar .bar { width: 100%; max-width: 42px; background: var(--ff-green); border-radius: 7px 7px 3px 3px; min-height: 4px; position: relative; }
.weekbar .bar.empty { background: var(--bg-muted); }
.weekbar .bar .bar-val { position: absolute; top: -19px; left: 0; right: 0; text-align: center; font-size: 11.5px; font-weight: 800; color: var(--text-secondary); }
.weekbar .day-label { font-size: 11.5px; color: var(--text-tertiary); font-weight: 700; }
.hbar { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; font-weight: 700; }
.hbar-label { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; white-space: nowrap; }
.hbar-label svg { width: 15px; height: 15px; }
.hbar-track { height: 10px; background: var(--bg-muted); border-radius: 6px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 6px; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; }
.stack-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; margin-top: 12px; gap: 2px; }
.stack-bar span { display: block; min-width: 6px; }
.panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.panel .panel-sub { color: var(--text-tertiary); font-size: 13px; line-height: 1.5; }
.panel p.warn, .panel p.muted { margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row.compact { padding: 8px 0 0; border: none; }
.set-row .set-info { flex: 1; min-width: 0; }
.set-row .set-info h4 { font-size: 14px; font-weight: 800; }
.set-row .set-info p { color: var(--text-tertiary); font-size: 12.5px; margin-top: 2px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch.sm { width: 36px; height: 21px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 26px; transition: background var(--speed); cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform var(--speed); box-shadow: var(--shadow-sm); }
.switch.sm .slider::before { width: 15px; height: 15px; }
.switch input:checked + .slider { background: var(--ff-green); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch.sm input:checked + .slider::before { transform: translateX(15px); }
.switch input:focus-visible + .slider { outline: 3px solid color-mix(in srgb, var(--ring) 70%, transparent); outline-offset: 2px; }
.profile-row { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.profile-id { flex: 1; min-width: 0; }
.profile-id .field { margin-bottom: 6px; }
.pw-details { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.pw-details summary { cursor: pointer; font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 8px; list-style: none; }
.pw-details summary::-webkit-details-marker { display: none; }
.pw-details summary svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.pw-form { display: grid; gap: 8px; margin-top: 12px; max-width: 380px; }
.sync-line { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-top: 10px; }
.sync-line.s-ok { color: var(--success); }
.sync-line.s-error, .sync-line.s-offline { color: var(--warning); }
.about-row { display: flex; align-items: center; gap: 14px; }
.about-face { width: 42px; height: 42px; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 700; background: var(--bg-muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--text-secondary); min-width: 18px; display: inline-block; text-align: center; }
.shortcut-list { display: grid; gap: 2px; }
.shortcut-list .sc { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.shortcut-list .sc:last-child { border: none; }
.shortcut-list .sc .keys { display: flex; gap: 4px; }

/* ============================================================
   foodfacts face + notification buddy
   ============================================================ */
.ff-face { display: block; }
.ff-face .ff-eyes { transform-origin: 50% 42%; animation: blink 5.2s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.12); } }
.buddy-root { position: fixed; inset: 0; pointer-events: none; z-index: 1250; }
.buddy { position: fixed; bottom: 22px; right: 22px; width: 60px; height: 60px; padding: 0; border: none; background: transparent; cursor: pointer; pointer-events: auto; transform-origin: 50% 85%; filter: drop-shadow(0 8px 14px rgba(16, 45, 20, 0.28)); animation: bob 3.6s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.buddy:hover { animation: wiggle 0.55s ease-in-out infinite; }
.buddy:active { transform: scale(0.9); }
.buddy .buddy-face, .buddy .buddy-img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.buddy:has(.buddy-img) { width: 84px; height: 84px; }
.buddy:has(.buddy-img.lenny) { width: 78px; height: 78px; }
.voice-mascot.lenny { width: 96px; height: 96px; }
.buddy.shout { animation: shout 0.5s ease-in-out 3; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes shout { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(-15px) scale(1.18) rotate(-6deg); } 50% { transform: translateY(0) scale(1.05) rotate(5deg); } 75% { transform: translateY(-9px) scale(1.12) rotate(-4deg); } 100% { transform: translateY(0) scale(1); } }
.buddy-bubble { position: fixed; bottom: 94px; right: 20px; max-width: 270px; background: var(--ff-dark); color: #fff; border-radius: 16px; border-bottom-right-radius: 5px; padding: 10px 14px; font-size: 13.5px; font-weight: 700; line-height: 1.4; box-shadow: var(--shadow-lg); pointer-events: none; opacity: 0; transform: translateY(8px) scale(0.92); transform-origin: bottom right; transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); border: 1px solid rgba(191, 243, 53, 0.35); }
.buddy-bubble.show { opacity: 1; transform: none; }
/* below big-desktop widths the header actions reach the right edge — dock the buddy bottom-right instead */
@media (max-width: 1360px) {
  .buddy { top: auto; bottom: 22px; right: 22px; }
  .buddy-bubble { top: auto; bottom: 94px; right: 20px; border-top-right-radius: 16px; border-bottom-right-radius: 5px; transform-origin: bottom right; }
}

/* ============================================================
   Voice capture
   ============================================================ */
.voice-body { text-align: center; padding-top: 6px; }
.voice-stage { position: relative; width: 132px; height: 132px; margin: 6px auto 14px; display: grid; place-items: center; }
.voice-mascot { width: 88px; height: 88px; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(16, 45, 20, 0.25)); position: relative; z-index: 2; }
.voice-stage.listening .voice-mascot { animation: bob 1.6s ease-in-out infinite; }
.listen-ring { position: absolute; inset: 0; margin: auto; width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--ff-green); opacity: 0; z-index: 1; }
.voice-stage.listening .listen-ring { animation: ring-pulse 1.8s ease-out infinite; }
.voice-stage.listening .listen-ring.r2 { animation-delay: 0.9s; }
@keyframes ring-pulse { 0% { transform: scale(0.7); opacity: 0.7; } 100% { transform: scale(2); opacity: 0; } }
.voice-hint { color: var(--text-secondary); font-size: 14px; line-height: 1.5; max-width: 440px; margin: 0 auto 12px; font-weight: 600; }
.voice-transcript { width: 100%; min-height: 96px; max-height: 220px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); outline: none; }
.voice-transcript:focus { border-color: var(--ff-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ff-neon) 24%, transparent); }
.voice-status { color: var(--overdue); font-size: 12.5px; font-weight: 700; margin-top: 8px; min-height: 16px; }
.voice-mic.on { background: var(--ff-green); color: #fff; }
.voice-review { display: flex; flex-direction: column; gap: 8px; }
.voice-task { display: flex; align-items: flex-start; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 10px 10px 10px 4px; }
.voice-task-del { border: none; background: transparent; color: var(--text-tertiary); border-radius: 7px; padding: 5px; display: grid; place-items: center; flex: none; margin-top: 2px; }
.voice-task-del:hover { background: var(--bg-hover); color: var(--danger); }
.voice-task-del svg { width: 16px; height: 16px; }
.voice-task-main { flex: 1; min-width: 0; }
.voice-task-input { width: 100%; border: none; background: transparent; color: var(--text); font-size: 15px; font-weight: 700; outline: none; padding: 2px 0; }
.voice-task-input:focus { border-bottom: 2px solid var(--ff-green); }
.voice-task-chips { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .ws-row { grid-template-columns: minmax(200px, 1.6fr) 140px 130px 100px 40px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  :root { --content-max: 100%; --content-wide: 100%; }
  .app { grid-template-columns: 1fr; }
  .mobile-bar { display: flex; align-items: center; gap: 4px; padding: 8px 8px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--ff-dark); color: #fff; position: sticky; top: 0; z-index: 40; }
  .mobile-bar .icon-btn { color: #e4eee6; }
  .mobile-bar .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
  .mobile-bar .mobile-title { flex: 1; font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 2px; }
  #mobile-voice { color: var(--ff-neon); }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 86%; max-width: 330px; z-index: 200; transform: translateX(-100%); transition: transform 0.26s var(--ease); box-shadow: var(--shadow-lg); padding-top: env(safe-area-inset-top); }
  .sidebar.open { transform: none; }
  .sidebar .sb-close { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 150; animation: fade-in 0.2s; }
  .main { height: auto; min-height: 0; }
  .content { padding: 18px 16px 140px; }
  .view-title { font-size: 22px; }
  .ws-hero h1 { font-size: 23px; }
  .prop-row .prop-label { width: 96px; }
  .prop-inputs { flex-wrap: wrap !important; }
  .modal-overlay { padding: 2vh 8px calc(10px + env(safe-area-inset-bottom)); }
  .toast-root { bottom: calc(22px + env(safe-area-inset-bottom)); width: 92%; }
  /* workspace table → stacked cards: name + ⋯ on line one, health + progress on line two */
  .ws-headrow { display: none; }
  .ws-row, .people-table .ws-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 8px; }
  .ws-row .ws-name { order: 1; flex: 1 1 calc(100% - 60px); }
  .ws-row .ws-more { order: 2; flex: none; }
  .ws-row .ws-health { order: 3; margin-left: 30px; }
  .ws-row .ws-prog { order: 4; }
  .ws-row .ws-people, .ws-row .ws-num { display: none; }
  .ws-row .ws-health:has(.muted) { display: none; }
  .ws-folder .ws-health { display: none; }
  .ws-folder .ws-prog { margin-left: 30px; }
  .people-table .ws-row .ws-role { order: 3; margin-left: 42px; }
  .ws-row.nested .ws-name { padding-left: 22px; }
  .ws-row.nested .ws-health { margin-left: 52px; }
  .mini-search input { width: 110px; }
  .cal-toolbar { gap: 8px; }
  .cal-label { min-width: 0; }
  .cal-grid { grid-auto-rows: minmax(76px, auto); }
  .cal-chip-t { display: none; }
  .cal-chip { justify-content: center; padding: 3px; }
  .cal-chip::after { display: none; }
  .hbar { grid-template-columns: 96px 1fr 40px; }
  /* phones have no hover — keep row controls reachable */
  .task-actions { opacity: 1; }
  .task-actions [data-act="schedule"], .task-actions [data-act="assign"], .task-actions .drag-handle { display: none; }
  .nav-item .row-actions { display: flex; }
  .nav-item .nav-count { display: none; }
  .section-head .section-action, .nav-section-head button, .ws-head button { opacity: 1; }
  .checkbox { width: 23px; height: 23px; }
  .buddy { width: 52px; height: 52px; top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); right: 14px; }
  .buddy-bubble { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; max-width: 78vw; border-top-right-radius: 16px; border-bottom-right-radius: 5px; }
  .composer-input, .composer-desc, .search-bar input, .input, .textarea, .select, .menu-search input, .voice-transcript, .voice-task-input, .mini-search input { font-size: 16px; }
  .input.title-input { font-size: 19px; }
  /* popovers become bottom sheets */
  .popover { position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; border-radius: 20px 20px 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); max-height: 82vh; box-shadow: 0 -10px 44px rgba(0, 0, 0, 0.34); animation: sheet-up 0.24s var(--ease); }
  .popover .menu-item { padding: 12px; font-size: 15px; }
  .popover .label-pick { padding: 12px; }
  .notif-pop { width: 100% !important; }
}
@media (min-width: 881px) { .scrim { display: none !important; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 560px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-num { font-size: 24px; }
  .cal-filters { width: 100%; }
  .ws-hero .header-btn { padding: 6px; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .spacer { display: none; }
  .link-box { flex-direction: column; }
}
@media (hover: none) {
  .task-actions { opacity: 1; }
  .task-actions [data-act="schedule"], .task-actions .drag-handle { display: none; }
  .nav-item .row-actions { display: flex; }
  .nav-item .nav-count { display: none; }
  .section-head .section-action, .nav-section-head button, .ws-head button, .cal-add, .comment-del { opacity: 1; }
  .checkbox { width: 23px; height: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .confetti { display: none; }
  .buddy, .ff-face .ff-eyes { animation: none !important; }
}

/* ============================================================
   Editorial — Articles, Misinformation, Watchlist
   ============================================================ */
.nav-item .nav-count.alert { color: #fff; background: var(--ff-red); border-radius: 10px; padding: 0 6px; font-size: 11.5px; line-height: 18px; }
.modal.xwide { max-width: 960px; }
.modal { min-width: 0; }
.stepper { max-width: 100%; }
.hide-sm { display: inline; }

/* toolbar, quick views, filter chips */
.db-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.db-toolbar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.db-toolbar .seg button svg { width: 15px; height: 15px; }
.db-search { flex: 1 1 200px; max-width: 340px; }
.db-search input { width: 100%; }
.chip-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ff-green); color: #fff; font-size: 11px; padding: 0 5px; }
.db-presets { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; scrollbar-width: none; }
.db-presets::-webkit-scrollbar { display: none; }
.db-preset { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 700; transition: background var(--speed), color var(--speed), border-color var(--speed); }
.db-preset svg { width: 14px; height: 14px; }
.db-preset:hover { background: var(--bg-hover); color: var(--text); }
.db-preset.on { background: var(--ff-dark); border-color: var(--ff-dark); color: #fff; }
.db-preset.on svg { color: var(--ff-neon); }
.db-preset-n { font-size: 11.5px; font-weight: 800; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.db-preset.on .db-preset-n { color: var(--ff-neon); }
[data-theme="dark"] .db-preset.on { background: var(--bg-active); border-color: color-mix(in srgb, var(--ff-neon) 40%, transparent); }
.db-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.db-chip { display: inline-flex; align-items: stretch; border: 1px solid color-mix(in srgb, var(--ff-green) 55%, transparent); background: color-mix(in srgb, var(--ff-green) 9%, var(--bg-elevated)); border-radius: 9px; overflow: hidden; }
.db-chip-main { border: none; background: none; padding: 4px 4px 4px 10px; font-size: 12.5px; color: var(--text); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-chip-main strong { font-weight: 800; }
.db-chip-x { border: none; background: none; color: var(--text-tertiary); padding: 0 7px; display: grid; place-items: center; }
.db-chip-x:hover { color: var(--danger); }
.db-chip-x svg { width: 13px; height: 13px; }
.db-empty { background: var(--bg-elevated); border: 1px dashed var(--border-strong); border-radius: 16px; }
.empty-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: -30px auto 20px; text-align: center; color: var(--text-secondary); max-width: 460px; line-height: 1.5; }
.db-filter-pop { min-width: 260px; }
.db-menu-foot { display: flex; justify-content: flex-end; gap: 6px; }

/* who's working on what */
.workload { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.workload::-webkit-scrollbar { display: none; }
.workload-label { flex: none; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-right: 2px; }
.workload-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 20px; padding: 3px 9px 3px 4px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.workload-chip b { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.workload-chip:hover { background: var(--bg-hover); }
.workload-chip.on { border-color: var(--ff-green); background: color-mix(in srgb, var(--ff-green) 12%, var(--bg-elevated)); color: var(--text); }

/* table */
.db-table-wrap { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.db-table { width: 100%; }
.db-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--speed); min-height: 46px; }
.db-row:last-child { border-bottom: none; }
.db-row:hover { background: var(--surface-2); }
.db-row:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.db-head { position: sticky; top: 0; z-index: 2; cursor: default; background: var(--surface-2); min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.db-head:hover { background: var(--surface-2); }
.db-cell { min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.db-th { display: inline-flex; align-items: center; gap: 3px; border: none; background: none; padding: 2px 4px; margin-left: -4px; border-radius: 6px; font-size: 12px; font-weight: 800; color: var(--text-secondary); text-transform: none; white-space: nowrap; }
button.db-th:hover { background: var(--bg-hover); color: var(--text); }
.db-th.on { color: var(--text); }
.db-th svg { width: 13px; height: 13px; }
.db-grouprow { grid-template-columns: 1fr; background: color-mix(in srgb, var(--ff-green) 5%, var(--bg-elevated)); min-height: 38px; font-weight: 800; }
.db-grouprow .db-cell { gap: 8px; }
.db-grouprow .folder-caret { color: var(--text-tertiary); }
.db-title-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.db-title { font-weight: 700; font-size: 14px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; min-width: 0; }
.db-person { display: flex; flex-direction: column; min-width: 0; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 3px 5px; margin-left: -5px; border-radius: 8px; min-width: 0; max-width: 100%; color: var(--text); font-size: 13px; }
.cell-btn:hover { background: var(--bg-hover); }
.cell-btn .placeholder { color: var(--text-tertiary); font-weight: 600; }
.start-btn { color: var(--link); font-weight: 800; }
.start-btn svg { width: 14px; height: 14px; }
.ppl-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; font-size: 13px; }
.num { font-weight: 800; font-variant-numeric: tabular-nums; }
.tick { width: 20px; height: 20px; border-radius: 6px; border: 1.7px solid var(--border-strong); display: inline-grid; place-items: center; color: transparent; flex: none; }
.tick svg { width: 13px; height: 13px; stroke-width: 3; }
.tick.on { background: var(--ff-green); border-color: var(--ff-green); color: #fff; }
.kind-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--kc); white-space: nowrap; }
.kind-chip svg { width: 14px; height: 14px; }
.topic-chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: var(--bg-muted); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.paused-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); border-radius: 20px; padding: 1px 7px; white-space: nowrap; flex: none; }
.paused-chip svg { width: 11px; height: 11px; }
.ever-chip { display: inline-grid; place-items: center; color: var(--success); flex: none; }
.ever-chip svg { width: 15px; height: 15px; }
.hp-flag { display: inline-grid; place-items: center; color: var(--ff-red); flex: none; }
.hp-flag svg { width: 14px; height: 14px; }
.reach { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.reach svg { width: 13px; height: 13px; color: var(--text-tertiary); }
.plat-link { display: inline-flex; }
.score-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 20px; font-variant-numeric: tabular-nums; background: var(--bg-muted); color: var(--text-secondary); }
.score-badge.s5 { background: color-mix(in srgb, var(--ff-green) 18%, transparent); color: var(--success); }
.score-badge.s4 { background: color-mix(in srgb, var(--ff-neon) 30%, transparent); color: var(--text); }

/* board */
.db-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.db-col { background: var(--bg-muted); border-radius: 16px; padding: 8px; min-height: 120px; transition: background var(--speed), box-shadow var(--speed); }
.db-col.drag-over { background: color-mix(in srgb, var(--ff-neon) 22%, var(--bg-muted)); box-shadow: inset 0 0 0 2px var(--ff-green); }
.db-col-head { display: flex; align-items: center; gap: 7px; padding: 4px 6px 8px; font-weight: 800; font-size: 13.5px; }
.db-col-head .section-action { margin-left: auto; opacity: 0.7; }
.db-col-name { white-space: nowrap; }
.db-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.db-col-empty { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 14px; text-align: center; color: var(--text-tertiary); font-size: 12.5px; font-weight: 700; }
.db-col-more { border: none; background: var(--bg-elevated); border-radius: 10px; padding: 7px; font-weight: 800; font-size: 12.5px; color: var(--link); }
.db-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 13px; padding: 10px 11px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow var(--speed), transform var(--speed), border-color var(--speed); display: flex; flex-direction: column; gap: 7px; }
.db-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.db-card.dragging { opacity: 0.45; transform: rotate(1.5deg); }
.db-card.is-paused { border-left: 3px solid var(--warning); }
.db-card.is-high { border-left: 3px solid var(--ff-red); }
.db-card.is-linked { background: color-mix(in srgb, var(--ff-green) 4%, var(--bg-elevated)); }
.dbc-top, .dbc-foot { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.dbc-foot { gap: 8px; }
.dbc-title { font-weight: 700; font-size: 14px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.dbc-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--text-secondary); }
.dbc-person { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* gallery (watchlist) */
.db-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.db-gcard { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow var(--speed), transform var(--speed); display: flex; flex-direction: column; }
.db-gcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.db-gcard.is-high { box-shadow: inset 0 3px 0 var(--ff-red), var(--shadow-sm); }
.pg-photo { position: relative; aspect-ratio: 4 / 3; background: var(--bg-muted); display: grid; place-items: center; overflow: hidden; }
.pg-photo .pthumb.pt-xl { width: 100%; height: 100%; border-radius: 0; object-fit: cover; font-size: 34px; }
.pg-flag { position: absolute; top: 10px; right: 10px; background: var(--bg-elevated); border-radius: 50%; width: 26px; height: 26px; box-shadow: var(--shadow-sm); }
.pg-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pg-name { font-weight: 800; font-size: 15px; line-height: 1.25; }
.pg-role { color: var(--text-secondary); font-size: 12.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pg-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pg-counts { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 4px; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pg-counts span { display: inline-flex; align-items: center; gap: 4px; }
.pg-counts svg { width: 14px; height: 14px; color: var(--text-tertiary); }

/* profile thumbnails */
.pthumb { display: inline-grid; place-items: center; flex: none; object-fit: cover; border-radius: 50%; background: var(--bg-muted); }
.pthumb.pt-empty { background: var(--av, #6b8f71); color: #fff; font-weight: 800; letter-spacing: 0.02em; }
.pt-xs { width: 20px; height: 20px; font-size: 8px; }
.pt-sm { width: 30px; height: 30px; font-size: 11px; }
.pt-md { width: 40px; height: 40px; font-size: 14px; }
.pt-xl { width: 76px; height: 76px; font-size: 26px; border-radius: 18px; }
.avatar.ext { font-weight: 800; }

/* phone cards (table on narrow screens) */
.db-mcards { display: flex; flex-direction: column; gap: 8px; }
.db-mcard { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 11px 12px; cursor: pointer; }
.dbm-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; display: flex; gap: 6px; }
.dbm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 7px; }
.dbm-person { display: flex; align-items: center; gap: 11px; }
.clamp3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* editorial detail panels */
.ed-modal .title-input { margin-bottom: 8px; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; margin-top: 14px; align-items: start; }
.ed-side { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 6px; }
.ed-side .detail-props { margin-top: 0; }
.ed-side .prop-row .prop-label { width: 112px; }
.ed-side .prop-inputs .input { max-width: 100%; min-width: 0; }
.ed-side .detail-history { margin: 8px 10px 4px; }
.ed-block { margin-top: 14px; }
.ed-block .section-name svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; color: var(--text-tertiary); }
.fc-block { background: color-mix(in srgb, var(--ff-red) 4%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--ff-red) 18%, var(--border)); border-radius: 14px; padding: 4px 8px 6px; margin-top: 4px; }
.fc-block .section-head { border-bottom: none; }
.ed-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: color-mix(in srgb, var(--ff-neon) 18%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--ff-green) 35%, var(--border)); border-radius: 14px; padding: 12px 14px; }
.ed-cta > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1; }
.ed-cta span { color: var(--text-secondary); font-size: 13px; }
.ed-cta .btn-row { margin-top: 0; }
.linked-row { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 10px; cursor: pointer; transition: background var(--speed); }
.linked-row:hover { background: var(--bg-hover); }
.linked-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.similar { margin-top: 14px; }
.similar .section-name { color: var(--warning); }
.similar .section-name svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.side-link { margin: 6px 10px; font-size: 13px; }
.pause-btn.on { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 10%, var(--bg-elevated)); }
.hp-toggle.on { color: var(--ff-red); }
.num-input { max-width: 110px !important; }
.pf-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.pf-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.input-ghostline { border: none; padding: 2px 0; background: transparent; color: var(--text-secondary); font-weight: 600; }
.input-ghostline:focus { box-shadow: none; border-bottom: 2px solid var(--ff-green); border-radius: 0; }

/* stage stepper */
.stepper { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 2px; }
.step { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-tertiary); border-radius: 20px; padding: 5px 11px 5px 8px; font-size: 12.5px; font-weight: 700; transition: background var(--speed), color var(--speed), border-color var(--speed); }
.step:hover:not(:disabled) { border-color: var(--sc); color: var(--text); }
.step .step-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--sc); flex: none; }
.step.done { color: var(--text-secondary); }
.step.done .step-dot { background: var(--sc); }
.step.on { background: color-mix(in srgb, var(--sc) 14%, var(--bg-elevated)); border-color: var(--sc); color: var(--text); font-weight: 800; }
.step.on .step-dot { background: var(--sc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 25%, transparent); }
.stepper.locked .step { cursor: default; }
.stepper-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-tertiary); margin-top: 6px; }
.stepper-note svg { width: 14px; height: 14px; }
.stepper-note.warn { color: var(--warning); }

/* SEO block */
.seo-block { background: color-mix(in srgb, var(--ff-green) 5%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--ff-green) 22%, var(--border)); border-radius: 14px; padding: 4px 12px 10px; }
.seo-block .section-head { border-bottom: none; }
.seo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 4px 0 8px; }
.seo-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--text-secondary); }
.seo-f.wide { grid-column: 1 / -1; }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.score-seg button { min-width: 30px; padding: 3px 8px; }

@media (max-width: 880px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-side { order: -1; }
  .db-board { grid-auto-columns: minmax(78vw, 1fr); scroll-snap-type: x mandatory; }
  .db-col { scroll-snap-align: start; }
  .db-search { max-width: none; }
  .modal.xwide { max-width: 100%; }
  .pf-hero .pt-xl { width: 60px; height: 60px; }
}
@media (max-width: 560px) {
  .hide-sm, .seg-label { display: none; }
  .db-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pg-name { font-size: 14px; }
  .seo-grid { grid-template-columns: 1fr; }
  .stepper { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .step { flex: none; }
}
.import-banner { display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, var(--ff-neon) 22%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--ff-green) 40%, var(--border)); border-radius: 14px; padding: 11px 14px; margin-bottom: 12px; font-size: 13.5px; color: var(--text); }
.import-banner > svg { width: 20px; height: 20px; flex: none; color: var(--success); }
.import-banner span { flex: 1; line-height: 1.45; }
.search-rows { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.search-more { margin: 8px 4px 0; font-size: 13px; }

/* security log */
.audit-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.audit-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.audit-row:last-child { border-bottom: none; }
.audit-when { color: var(--text-tertiary); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-what { min-width: 0; overflow-wrap: anywhere; }
.audit-ip { color: var(--text-tertiary); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 560px) { .audit-row { grid-template-columns: 1fr; gap: 2px; } }

/* mobile numbers + WhatsApp */
.auth-field em { font-style: normal; font-weight: 600; color: var(--text-tertiary); }
.auth-hint { margin: -4px 0 12px; font-size: 12.5px; line-height: 1.45; color: var(--text-tertiary); }
.phone-edit { display: flex; gap: 8px; align-items: center; }
.phone-edit .input { width: 190px; }
.wa-nudge { display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, #25d366 12%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, #25d366 38%, var(--border)); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; font-size: 13.5px; }
.wa-nudge > svg { width: 20px; height: 20px; color: #1da851; flex: none; }
.wa-nudge span { flex: 1; line-height: 1.45; }
.phone-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-tertiary); font-weight: 600; }
.phone-tag svg { width: 12px; height: 12px; }
.phone-tag.missing { color: var(--warning); }
.phone-tag.on { color: var(--success); }
.auth-check { display: flex; align-items: flex-start; gap: 10px; margin: -2px 0 6px; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--success); cursor: pointer; }
.wa-state { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; background: var(--bg-sunken, rgba(127, 127, 127, 0.14)); color: var(--text-tertiary); }
.wa-state.on { background: color-mix(in srgb, #25d366 18%, transparent); color: #1da851; }
.wa-consent { margin: 8px 0 0; }
@media (max-width: 560px) { .phone-edit { width: 100%; } .phone-edit .input { flex: 1; width: auto; } }

/* ---------- Completed: the team's done list ---------- */
.done-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.done-controls .select { max-width: min(280px, 100%); min-width: 0; text-overflow: ellipsis; }
.done-people { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.done-person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--speed), color var(--speed); }
.done-person:first-child { padding-left: 11px; }
.done-person:hover { background: var(--bg-hover); color: var(--text); }
.done-person.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.done-n { font-size: 11.5px; font-weight: 800; opacity: 0.65; margin-left: 1px; }
.done-more { margin-top: 2px; }
.done-foot { margin: 24px 0 8px; }
.done-foot .link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.done-foot svg { width: 14px; height: 14px; }
.done-section { margin-top: 18px; }
.done-section .section-name { color: var(--text-tertiary); }
.done-all svg { width: 16px; height: 16px; }

/* ---------- rich text (task descriptions): bold, italic, links, lists ---------- */
.rte { margin-top: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); transition: border-color var(--speed), box-shadow var(--speed); }
.rte:focus-within { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent); }
.rte-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--border); transition: opacity var(--speed); }
.rte:not(:focus-within) .rte-bar { opacity: 0.6; }
.rte-bar button { display: grid; place-items: center; min-width: 32px; height: 30px; padding: 0 6px; border: none; background: none; border-radius: 7px; color: var(--text-secondary); font: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.rte-bar button:hover { background: var(--bg-hover); color: var(--text); }
.rte-bar button.on { background: var(--bg-active); color: var(--text); }
.rte-bar button b, .rte-bar button i { font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.rte-bar svg { width: 16px; height: 16px; }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-ol { font-weight: 800; font-size: 13px; }
.rte-body { min-height: 72px; max-height: 420px; overflow-y: auto; padding: 10px 12px; font-size: 14.5px; line-height: 1.55; color: var(--text); outline: none; overflow-wrap: anywhere; cursor: text; }
.rte-body:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); pointer-events: none; }
.rte-body ul, .rte-body ol { margin: 4px 0; padding-left: 22px; }
.rte-body li { margin: 2px 0; }
.rte-body a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.rte-linkbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.rte-linkbar[hidden], .rte-linkbar [hidden] { display: none; }
.rte-linkbar > svg { width: 15px; height: 15px; color: var(--text-tertiary); flex: none; }
.rte-linkbar .input { flex: 1 1 180px; min-width: 0; height: 32px; padding: 5px 9px; }
.rte-linkbar .input.bad { border-color: var(--danger); }

/* ---------- Reader feedback (votes + comments from foodfacts.org, via Airtable) ---------- */
.fb-live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.fb-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: fbPulse 1.8s ease-in-out infinite; }
.fb-live.off { color: var(--text-tertiary); background: var(--bg-muted); font-weight: 700; }
.fb-live svg { width: 13px; height: 13px; }
@keyframes fbPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .fb-live i { animation: none; } }
.fb-error { display: flex; align-items: center; gap: 6px; }
.fb-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.fb-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fb-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); text-align: left; font: inherit; color: inherit; min-width: 0; }
button.fb-stat { cursor: pointer; }
button.fb-stat:hover { background: var(--bg-hover); }
.fb-stat-n { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fb-stat-l { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.fb-stat.todo.has { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.fb-stat.todo.has .fb-stat-n { color: var(--danger); }
.fb-delta { font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); }
.fb-delta.up { color: var(--success); }
.fb-delta.down { color: var(--danger); }
.fb-chart { display: flex; align-items: flex-end; gap: 2px; height: 74px; padding: 8px 10px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); }
.fb-bar { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; min-width: 2px; border-radius: 3px; overflow: hidden; }
.fb-bar:hover { opacity: 0.75; }
.fb-bar i { display: block; width: 100%; }
.fb-bar i.upv { background: color-mix(in srgb, var(--success) 75%, transparent); }
.fb-bar i.dn { background: color-mix(in srgb, var(--danger) 80%, transparent); }
.fb-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.fb-reason-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.fb-reason-btn:hover { background: var(--bg-hover); color: var(--text); }
.fb-reason-btn.good { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.fb-reason-btn.bad { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.fb-reason-btn.warn { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.fb-reason-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fb-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.fb-feed-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.fb-q { flex: 1 1 200px; min-width: 0; height: 34px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fb-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 99px; background: var(--bg-active); font-size: 13px; font-weight: 700; }
.fb-chip svg { width: 13px; height: 13px; flex: none; }
.fb-chip button { display: grid; place-items: center; width: 22px; height: 22px; border: none; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.fb-chip button:hover { background: var(--bg-hover); }
.fb-list { display: flex; flex-direction: column; gap: 8px; }
.fb-item { display: flex; gap: 11px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); transition: background var(--speed); }
.fb-item.down { border-left: 3px solid var(--danger); }
.fb-item.up { border-left: 3px solid color-mix(in srgb, var(--success) 70%, transparent); }
.fb-item.handled { opacity: 0.62; }
.fb-item.fresh { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.fb-vote { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.fb-item.up .fb-vote { color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.fb-item.down .fb-vote { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.fb-vote svg { width: 16px; height: 16px; }
.fb-main { flex: 1; min-width: 0; }
.fb-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; }
.fb-reason { padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 800; background: var(--bg-muted); color: var(--text-secondary); }
.fb-reason.good { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.fb-reason.bad { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.fb-reason.warn { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.fb-art { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--text); text-align: left; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.fb-art:hover { text-decoration: underline; }
.fb-when { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }
.fb-detail { margin-top: 6px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.fb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; }
.fb-name { color: var(--text-secondary); font-style: italic; }
.fb-link { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--link); text-decoration: none; cursor: pointer; }
.fb-link:hover { text-decoration: underline; }
.fb-link svg, .fb-act svg { width: 13px; height: 13px; }
.fb-act { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-secondary); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.fb-act:hover { background: var(--bg-hover); color: var(--text); }
.fb-act.on { background: color-mix(in srgb, var(--success) 14%, transparent); border-color: color-mix(in srgb, var(--success) 40%, var(--border)); color: var(--success); }
.fb-arts { position: sticky; top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elevated); }
.fb-arts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.fb-arts-head h3 { margin: 0; font-size: 15px; }
.fb-art-row { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 8px; border: none; border-radius: 9px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fb-art-row:hover { background: var(--bg-hover); }
.fb-art-row.on { background: var(--bg-active); }
.fb-art-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.fb-art-nums { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.fb-meter { flex: none; width: 70px; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--danger) 30%, transparent); overflow: hidden; }
.fb-meter i { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.fb-admin { margin-top: 18px; }
.fb-connect ol { margin: 8px 0 12px; padding-left: 20px; line-height: 1.6; }
.fb-connect code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--bg-muted); }
.fb-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 8px; font-size: 13px; font-weight: 700; }
.fb-mini-n { display: inline-flex; align-items: center; gap: 4px; }
.fb-mini-n svg { width: 14px; height: 14px; }
.fb-mini-n.up { color: var(--success); }
.fb-mini-n.down { color: var(--danger); }
.fb-todo { padding: 1px 8px; border-radius: 99px; font-size: 11.5px; background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.fb-quote { display: flex; gap: 8px; padding: 8px 10px; margin-top: 6px; border-radius: 10px; background: var(--bg-muted); }
.fb-quote > svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.fb-quote.up > svg { color: var(--success); }
.fb-quote.down > svg { color: var(--danger); }
.fb-quote p { margin: 0 0 2px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 900px) { .fb-cols { grid-template-columns: minmax(0, 1fr); } .fb-arts { position: static; } }
@media (max-width: 560px) { .fb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fb-stat-n { font-size: 22px; } .fb-chart { height: 56px; } }
.fb-unlinked { padding: 0 6px; border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; background: var(--bg-muted); color: var(--text-tertiary); white-space: nowrap; }
.fbl-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; max-height: 340px; overflow-y: auto; }
.fbl-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: none; border-radius: 9px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fbl-row:hover { background: var(--bg-hover); }
.fbl-title { font-weight: 700; font-size: 14px; }

/* ---------- Volunteer CRM ---------- */
.crm-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--success); }
.crm-tag svg { width: 12px; height: 12px; }
/* the people table's status line wraps instead of spilling into the Role column */
.people-table .ws-status { flex-wrap: wrap; row-gap: 1px; }
.people-table .ws-status .phone-tag, .people-table .ws-status .crm-tag { white-space: nowrap; }
.vol-due-strip { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border)); background: color-mix(in srgb, var(--warning) 9%, var(--bg-elevated)); color: var(--text); font: inherit; font-weight: 700; font-size: 13.5px; text-align: left; cursor: pointer; }
.vol-due-strip > svg { width: 16px; height: 16px; color: var(--warning); flex: none; }
.vol-due-strip:hover .link-btn { text-decoration: underline; }
.db-card.is-due { border-left: 3px solid var(--warning); }
.vol-next-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vol-last { display: block; font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.vol-last-when { font-weight: 800; color: var(--text-tertiary); font-size: 12px; }
.vol-stepper { margin-bottom: 4px; }
.vol-wait, .vol-wait-line { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: #c05a95; }
.vol-wait svg, .vol-wait-line svg { width: 14px; height: 14px; flex: none; }
.vol-wait-line { margin: 6px 0 0; }
.vol-step-gap { width: 1px; align-self: stretch; margin: 3px 4px; background: var(--border-strong); }
.vol-modal .ed-block { margin-top: 4px; margin-bottom: 14px; }
.vol-compose { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.vol-compose .textarea { background: var(--bg-elevated); }
.vol-compose-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vol-compose-row .input[type="date"], .vol-next-row .input[type="date"] { width: auto; }
.vol-log { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.vol-log-item { position: relative; padding: 7px 10px 8px 22px; border-radius: 9px; }
.vol-log-item::before { content: ""; position: absolute; left: 8px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.vol-log-item::after { content: ""; position: absolute; left: 11px; top: 24px; bottom: -6px; width: 1px; background: var(--border); }
.vol-log-item:last-child::after { display: none; }
.vol-log-item:hover { background: var(--bg-hover); }
.vol-log-meta { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: 12.5px; }
.vol-log-date { font-weight: 800; color: var(--text-secondary); }
.vol-log-text { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.vol-log-empty { margin: 10px 0 0; }
.vol-log-del, .vol-tpl-del { margin-left: auto; opacity: 0; transition: opacity var(--speed); }
.vol-log-item:hover .vol-log-del, .vol-log-del:focus-visible, .vol-tpl-del { opacity: 1; }
.vol-log-del.confirm, .vol-tpl-del.confirm { opacity: 1; width: auto; padding: 0 9px; color: var(--danger); font-weight: 800; font-size: 12px; }
.vol-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.vol-next { margin: 8px 4px 4px; padding: 10px; border-radius: 11px; background: var(--bg-elevated); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.vol-next-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; color: var(--text-secondary); }
.vol-next-head svg { width: 15px; height: 15px; color: var(--text-tertiary); }
.vol-next-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vol-next-row .input.is-due { border-color: var(--warning); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 25%, transparent); }
.vol-email-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 4px 0; }
.vol-meta-foot { margin: 10px 6px 4px; font-size: 12px; color: var(--text-tertiary); }
.vol-mail { padding: 12px; border: 1px solid color-mix(in srgb, var(--link) 35%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--link) 5%, var(--bg-elevated)); display: flex; flex-direction: column; gap: 8px; }
.vol-mail .section-name { display: inline-flex; align-items: center; gap: 6px; }
.vol-mail .section-name svg { width: 15px; height: 15px; }
.vol-mail-log { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.vol-mail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vol-mail p { margin: 0; }
.vol-access-list { margin-top: 10px; }
.vol-access-row, .vol-tpl-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.vol-access-row:last-child, .vol-tpl-row:last-child { border-bottom: none; }
.vol-access-row .va-name { flex: 1; min-width: 0; font-weight: 700; }
.vol-access-row .va-state { font-size: 12.5px; font-weight: 700; color: var(--text-tertiary); white-space: nowrap; }
.vol-tpl-row .vt-main { flex: 1; min-width: 0; }
.vol-tpl-row .vt-name { font-weight: 800; }
.vol-tpl-row .vt-sub { font-size: 12.5px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .vol-pair { grid-template-columns: minmax(0, 1fr); } .vol-step-gap { display: none; } }

/* ---------- Custom repeat ---------- */
.repeat-pop { width: 320px; padding: 0; }
.repeat-pop .rep-head { padding: 12px 14px 10px; font-weight: 800; font-size: 15px; border-bottom: 1px solid var(--border); }
.repeat-pop .rep-body { padding: 6px 14px 4px; max-height: min(64vh, calc(100vh - 150px)); overflow-y: auto; }
.repeat-pop .rep-label { margin: 10px 0 4px; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); }
.repeat-pop .rep-opt { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; cursor: pointer; flex-wrap: wrap; }
.repeat-pop .rep-opt .input { width: auto; margin-left: 4px; }
.repeat-pop .rep-row { display: flex; gap: 8px; }
.repeat-pop .rep-row .input { width: 76px; }
.repeat-pop .rep-row .select { width: auto; }
.repeat-pop .rep-days { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.repeat-pop .rep-day { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; cursor: pointer; }
.repeat-pop .rep-note { margin: 2px 0 0; font-size: 12px; color: var(--text-tertiary); }
.repeat-pop .rep-summary { margin: 12px 0 2px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.repeat-pop .rep-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--border); }

/* ---------- Working hours ---------- */
.hours-days { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hours-week-row { align-items: flex-start; flex-wrap: wrap; }
.hours-week { display: grid; gap: 6px; }
.hours-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hours-row .hours-day { width: 118px; }
.hours-row .input { width: auto; }
.hours-row.off .input, .hours-row.off .muted, .hours-row.off .hours-note { opacity: 0.35; }
.hours-note { font-size: 12px; color: var(--text-tertiary); min-width: 84px; }
.hours-day { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.hours-times { display: flex; align-items: center; gap: 8px; }
.hours-times .input { width: auto; }
.hours-status { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--success); }
.hours-status.off { color: var(--warning); }
.hours-status svg { width: 15px; height: 15px; flex: none; }

/* ============================================================
   Home — the dashboard (src/app/58-home.js)
   ============================================================ */
:root { --plate-hi: #ffffff; --plate-lo: #f3f6f0; --plate-rim: #ffffff; }
[data-theme="dark"] { --plate-hi: #15301f; --plate-lo: #0d1f14; --plate-rim: #12281b; }
.home { --gap: 22px; }
.home-hero { padding: 6px 0 4px; max-width: 860px; }
.home-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-tertiary); }
.home-title { font-size: 42px; line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; margin: 8px 0 12px; }
.home-line { font-size: 19px; line-height: 1.55; color: var(--text-secondary); max-width: 780px; }
.home-line strong { color: var(--text); font-weight: 800; }
.hero-num { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; padding: 0 2px; cursor: default;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--rc) 38%, transparent) 58%); border-radius: 2px; }
.hero-away { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--text-secondary);
  background: var(--bg-muted); border-radius: 999px; padding: 3px 11px 3px 9px; vertical-align: 2px; }
.hero-away svg { width: 14px; height: 14px; }
.home-back { margin-top: 12px; font-size: 14px; }
.home-back svg { width: 15px; height: 15px; transform: rotate(180deg); }

/* the plate */
.plate-row { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: center; margin: 14px 0 10px; }
.plate { position: relative; max-width: 560px; width: 100%; justify-self: center; }
.plate-svg { width: 100%; height: auto; display: block; overflow: visible; }
.plate-rim { fill: var(--plate-rim); stroke: var(--border); stroke-width: 1; filter: drop-shadow(0 10px 22px rgba(16, 45, 20, 0.13)) drop-shadow(0 1px 2px rgba(16, 45, 20, 0.08)); }
[data-theme="dark"] .plate-rim { filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.55)); }
.plate-well { stroke: var(--border); stroke-width: 1; }
.plate-band { fill: none; stroke-opacity: 0.12; transition: stroke-opacity 220ms var(--ease); }
.plate-band[data-ring="0"] { stroke-opacity: 0.14; }
.plate-line { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.8; }
.plate-cut { stroke: var(--plate-hi); stroke-width: 2.5; }
.plate-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em; fill: var(--text-secondary); cursor: default; }
.plate-label-n { fill: var(--text-tertiary); font-weight: 600; }
.plate-empty { font-size: 22px; font-weight: 800; fill: var(--text); letter-spacing: -0.02em; }
.plate-empty-sub { font-size: 13px; fill: var(--text-tertiary); }
.pd { stroke: var(--plate-hi); stroke-width: 1.3; cursor: pointer; transition: opacity 200ms var(--ease), stroke-width 120ms; }
.pd:hover { stroke: var(--text); stroke-width: 2.2; }
.pd-p1 { stroke: var(--p1); stroke-width: 1.8; }
.plate.hl .pd { opacity: 0.16; }
.plate.hl .pd.on { opacity: 1; }
.plate.hl .plate-band.on { stroke-opacity: 0.26; }
.home.anim .pd { animation: pd-in 620ms cubic-bezier(0.2, 0.9, 0.25, 1.25) both; animation-delay: calc(var(--i) * 7ms + 140ms); transform-box: fill-box; transform-origin: center; }
.home.anim .plate-band { animation: band-in 700ms var(--ease) both; }
@keyframes pd-in { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: none; } }
@keyframes band-in { from { stroke-opacity: 0; } }

.plate-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.plate-key { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px 10px; box-shadow: var(--shadow-sm); }
.pk-row { display: grid; grid-template-columns: 12px 92px minmax(0, 1fr) 30px; align-items: center; gap: 9px; padding: 4px 4px; border-radius: 8px; font-size: 13.5px; font-weight: 700; cursor: default; }
.pk-row:hover { background: var(--bg-hover); }
.pk-sw { width: 12px; height: 12px; border-radius: 50%; }
.pk-bar { height: 7px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; }
.pk-bar span { display: block; height: 100%; border-radius: 99px; }
.pk-n { text-align: right; font-variant-numeric: tabular-nums; }
.pk-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; padding: 8px 4px 0; border-top: 1px solid var(--border); font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.pk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); display: inline-block; }
.pk-dot.big { width: 11px; height: 11px; box-shadow: 0 0 0 1.5px var(--p1); }
.pk-dia { width: 8px; height: 8px; background: var(--text-tertiary); transform: rotate(45deg); display: inline-block; border-radius: 1px; }
.pk-legend .muted { font-weight: 600; flex-basis: 100%; }
.next-up h3 { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 6px 4px; }
.nu-row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none; border-radius: 10px; padding: 8px 6px; }
.nu-row:hover { background: var(--bg-hover); }
.nu-ring { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--rc); flex: none; }
.nu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nu-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nu-sub { font-size: 12px; color: var(--text-tertiary); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nu-sub i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.nu-when { font-size: 12px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.nu-when.late { color: var(--overdue); }
.nu-all { margin: 4px 0 0 6px; font-size: 13px; }

/* sections */
.home-sec { margin-top: 38px; }
.home-sec-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.home-sec-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.home-sec-head p { color: var(--text-tertiary); font-size: 13.5px; }

/* team plates */
.team-plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.tp-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 18px; padding: 16px 12px 12px;
  box-shadow: var(--shadow-sm); transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms; text-align: center; }
.tp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tp-card.on { border-color: var(--ff-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ff-neon) 55%, transparent), var(--shadow); }
.tp-plate { position: relative; width: 92px; height: 92px; }
.mini-plate { width: 92px; height: 92px; display: block; }
.mp-rim { fill: var(--plate-rim); stroke: var(--border); }
.mp-track { fill: none; stroke: var(--bg-muted); stroke-width: 9; }
.mp-seg { fill: none; stroke-width: 9; }
.mp-n { font-size: 19px; font-weight: 800; fill: var(--text); font-variant-numeric: tabular-nums; }
.tp-av { position: absolute; right: -2px; bottom: -2px; }
.tp-av .avatar { box-shadow: 0 0 0 3px var(--bg-elevated); }
.tp-none { display: inline-grid; place-items: center; background: var(--bg-muted); color: var(--text-secondary); }
.tp-none svg { width: 13px; height: 13px; }
.tp-card.away .mini-plate { opacity: 0.6; }
.tp-name { font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 5px; }
.tp-away { color: var(--text-tertiary); display: inline-grid; }
.tp-away svg { width: 14px; height: 14px; }
.tp-foot { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; font-weight: 700; flex-wrap: wrap; }
.tp-late { color: var(--overdue); }
.tp-done { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); }
.tp-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.tp-spark i { width: 3px; background: var(--ff-green); border-radius: 1px; }
.home.anim .tp-card { animation: rise-in 520ms var(--ease) both; }
.home.anim .tp-card:nth-child(2) { animation-delay: 50ms; } .home.anim .tp-card:nth-child(3) { animation-delay: 100ms; }
.home.anim .tp-card:nth-child(4) { animation-delay: 150ms; } .home.anim .tp-card:nth-child(n+5) { animation-delay: 200ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }

/* the next two weeks */
.tl { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 6px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 18px; padding: 14px 14px 10px; box-shadow: var(--shadow-sm); }
.tl-col { display: flex; flex-direction: column; align-items: stretch; border-radius: 11px; padding: 6px 4px 6px; min-width: 0; }
.tl-col.off { background: repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, var(--border) 70%, transparent) 5px 6px); }
.tl-col.today { background: color-mix(in srgb, var(--ff-neon) 22%, transparent); }
.tl-col.late { background: color-mix(in srgb, var(--p1) 9%, transparent); margin-right: 8px; }
.tl-col.late.empty { opacity: 0.55; }
.tl-n { text-align: center; font-size: 12px; font-weight: 800; color: var(--text-secondary); height: 18px; font-variant-numeric: tabular-nums; }
.tl-stack { display: flex; flex-direction: column-reverse; gap: 3px; height: calc(var(--tl-max) * 12px + 4px); }
.tl-b { display: block; height: 9px; border-radius: 3px; background: var(--c); cursor: pointer; flex: none; transition: transform 120ms var(--ease); }
.tl-b:hover { transform: scaleY(1.5); }
.tl-b.art { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.tl-b.p1 { box-shadow: inset 3px 0 0 var(--p1); }
.tl-more { font-size: 11px; font-weight: 800; color: var(--text-tertiary); text-align: center; }
.tl-day { display: flex; flex-direction: column; align-items: center; margin-top: 8px; line-height: 1.15; }
.tl-day b { font-size: 11px; color: var(--text-tertiary); font-weight: 800; }
.tl-day span { font-size: 14px; font-weight: 800; }
.tl-day span svg { width: 14px; height: 14px; color: var(--overdue); }
.tl-col.today .tl-day span { background: var(--ff-dark); color: var(--ff-neon); border-radius: 7px; padding: 0 6px; }
.home.anim .tl-b { animation: tl-in 420ms var(--ease) both; animation-delay: calc(var(--i) * 30ms + 200ms); transform-origin: bottom; }
@keyframes tl-in { from { opacity: 0; transform: translateY(6px); } }

/* the newsroom */
.news-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.news-grid .panel { margin: 0; }
.pipe-row { display: grid; grid-template-columns: 128px 26px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.pipe-row:first-of-type { margin-top: 10px; }
.pipe-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pipe-label i { width: 9px; height: 9px; border-radius: 50%; }
.pipe-n { font-size: 13px; font-weight: 800; color: var(--text-tertiary); text-align: right; font-variant-numeric: tabular-nums; }
.pipe-sq { display: flex; flex-wrap: wrap; gap: 4px; }
.sq, .wf { display: block; border-radius: 3px; background: var(--c); cursor: pointer; position: relative; transition: transform 120ms var(--ease); }
.sq { width: 15px; height: 15px; }
.sq:hover, .wf:hover { transform: scale(1.3); z-index: 1; }
.sq.mine, .wf.mine { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 3.5px var(--text); }
.sq.late::after { content: ""; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--p1); box-shadow: 0 0 0 1.5px var(--bg-elevated); }
.home.anim .sq, .home.anim .wf { animation: pd-in 480ms var(--ease) both; animation-delay: calc(var(--i) * 4ms + 150ms); }
.pipe-pub { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 14px; }
.pipe-pub > div:first-child { display: flex; flex-direction: column; }
.pipe-big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--success); }
.pub-bars { display: flex; align-items: flex-end; gap: 6px; height: 58px; }
.pub-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 22px; gap: 4px; }
.pub-col i { width: 100%; background: color-mix(in srgb, var(--success) 70%, transparent); border-radius: 4px 4px 2px 2px; }
.pub-col b { font-size: 10.5px; color: var(--text-tertiary); }
.pipe-kinds, .wf-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.pipe-kinds span, .wf-key span { display: inline-flex; align-items: center; gap: 6px; }
.pipe-kinds i, .wf-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.wf-key b { color: var(--text); }
.waffle { display: grid; grid-template-columns: repeat(auto-fill, 13px); gap: 4px; margin-top: 14px; }
.wf { width: 13px; height: 13px; }
.wf.gone { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.wf-key .wf-gone-key { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.wf.hi { background: radial-gradient(circle, var(--plate-hi) 0 2.2px, var(--c) 2.8px); }
.wf-key .wf-hi-key { background: radial-gradient(circle, var(--plate-hi) 0 2px, var(--text-tertiary) 2.6px); }

/* rhythm */
.rhythm { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px 40px; margin: 0; padding: 20px 24px; }
.rh-stats { display: grid; grid-template-columns: repeat(2, minmax(90px, auto)); gap: 14px 26px; }
.rh-stats div { display: flex; flex-direction: column; }
.rh-stats b { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rh-stats span { font-size: 12px; color: var(--text-tertiary); font-weight: 700; }
.rh-wrap { display: flex; gap: 8px; padding-top: 18px; min-width: 0; }
.rh-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; font-size: 10px; font-weight: 700; color: var(--text-tertiary); align-items: center; }
.rh-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 4px; max-width: 520px; }
.rh-week { display: grid; grid-template-rows: repeat(7, auto); gap: 4px; position: relative; }
.rh-mon { position: absolute; top: -17px; left: 0; font-size: 10.5px; font-weight: 700; color: var(--text-tertiary); white-space: nowrap; }
.rh-c { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--bg-muted); }
.rh-scale .rh-c { width: 12px; }
.rh-c.future { background: transparent; }
.rh-c.l1 { background: color-mix(in srgb, var(--ff-green) 32%, var(--bg-muted)); }
.rh-c.l2 { background: color-mix(in srgb, var(--ff-green) 60%, var(--bg-muted)); }
.rh-c.l3 { background: var(--ff-green); }
.rh-c.l4 { background: #1f6b3a; }
[data-theme="dark"] .rh-c.l4 { background: var(--ff-neon); }
.rh-scale { display: flex; align-items: center; gap: 4px; font-size: 11px; grid-column: 2; }
.rh-scale .muted { margin: 0 4px; }

/* one tooltip for every chart */
.viz-tip { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; max-width: 300px; white-space: pre-line;
  background: var(--ff-dark); color: #eef6ef; font-size: 12.5px; line-height: 1.45; padding: 8px 11px; border-radius: 10px; box-shadow: var(--shadow-lg); }
.viz-tip::first-line { font-weight: 800; color: #fff; }

@media (max-width: 1080px) {
  .plate-row { grid-template-columns: minmax(0, 1fr); }
  .plate { max-width: 500px; }
  .plate-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .home-title { font-size: 30px; }
  .home-line { font-size: 16.5px; }
  .plate-side { grid-template-columns: minmax(0, 1fr); }
  .tl { overflow-x: auto; grid-template-columns: repeat(15, minmax(34px, 1fr)); gap: 4px; padding: 12px 8px 8px; }
  .team-plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-row { grid-template-columns: 104px 22px minmax(0, 1fr); }
  .home-sec { margin-top: 30px; }
  .rhythm { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .rh-stats { grid-template-columns: repeat(4, minmax(0, auto)); gap: 10px 18px; }
  .rh-stats b { font-size: 22px; }
  .rh-scale { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .home.anim .pd, .home.anim .plate-band, .home.anim .tp-card, .home.anim .tl-b, .home.anim .sq, .home.anim .wf { animation: none; }
  .tp-card, .tp-card:hover { transform: none; transition: none; }
}

/* ============================================================
   The Publisher (src/app/91-publisher.js)
   ============================================================ */
.pub-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pub-h { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 12px; }
.pub-new { padding: 20px 22px 22px; }
.pub-new .field { margin-top: 16px; }
.pub-new .field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.pub-new textarea { resize: vertical; min-height: 90px; }
.pub-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; line-height: 1.5; }
.pub-hint code, .pf code { font-size: 11.5px; background: var(--bg-muted); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.pub-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 18px; padding: 30px 18px; background: var(--surface-2); transition: border-color 160ms, background 160ms, transform 160ms; }
.pub-drop:hover, .pub-drop.over { border-color: var(--ff-green); background: color-mix(in srgb, var(--ff-neon) 12%, var(--surface-2)); }
.pub-drop.over { transform: scale(1.01); }
.pub-drop.has { padding: 18px; }
.pub-drop strong { font-size: 15px; }
.pub-drop span { font-size: 13px; color: var(--text-tertiary); }
.pub-drop-art { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--ff-dark); color: var(--ff-neon); margin-bottom: 4px; }
.pub-drop-art svg { width: 22px; height: 22px; }
.pub-drop.has .pub-drop-art { display: none; }
.pub-files { display: grid; gap: 8px; margin-top: 12px; }
.pub-file { display: flex; align-items: center; gap: 11px; padding: 8px 8px 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated); }
.pub-file.doc { border-color: color-mix(in srgb, var(--ff-green) 55%, var(--border)); background: color-mix(in srgb, var(--ff-green) 6%, var(--bg-elevated)); }
.pub-file img, .pub-file-ic { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.pub-file-ic { display: grid; place-items: center; background: var(--bg-muted); color: var(--text-secondary); }
.pub-file.doc .pub-file-ic { background: var(--ff-dark); color: var(--ff-neon); }
.pub-file-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pub-file-t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-file-t span { font-size: 12px; color: var(--text-tertiary); }
.pub-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; color: var(--text-tertiary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.pub-or::before, .pub-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pub-go { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.pub-process { padding: 11px 22px; font-size: 15px; }
.pub-process svg { width: 17px; height: 17px; }
.pub-upbar { margin-top: 20px; display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.pub-bar { display: block; height: 8px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.pub-bar span { display: block; height: 100%; border-radius: 99px; background: var(--ff-green); transition: width 500ms var(--ease); }
.pub-bar.sm { height: 5px; margin: 8px 0 2px; }
.pub-bar.big { height: 12px; }
.pub-bar.live span { background-image: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.35) 50%, transparent 100%); background-size: 200px 100%; background-repeat: no-repeat; animation: pub-shine 1.6s linear infinite; }
@keyframes pub-shine { from { background-position: -200px 0; } to { background-position: calc(100% + 200px) 0; } }
.pub-bot { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); background: var(--bg-muted); border-radius: 999px; padding: 5px 12px 5px 10px; }
.pub-bot i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); }
.pub-bot.on i { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.pub-side { min-width: 0; }
.pub-job { display: block; text-decoration: none; color: inherit; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); transition: transform 140ms var(--ease), box-shadow 140ms; }
.pub-job:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.pub-job-top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.pub-job-top b { font-size: 14.5px; line-height: 1.35; }
.pub-job-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.pub-score-mini { font-weight: 800; color: var(--text-secondary); }
.pub-chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, transparent); border-radius: 999px; padding: 3px 10px 3px 8px; }
.pub-chip svg { width: 13px; height: 13px; }
.pub-chip.live svg { animation: pub-pulse 1.2s ease-in-out infinite; }
@keyframes pub-pulse { 50% { opacity: 0.35; } }
.pub-empty { text-align: center; color: var(--text-tertiary); padding: 30px 10px; border: 1px dashed var(--border-strong); border-radius: 16px; font-size: 13.5px; }
.pub-empty svg { width: 26px; height: 26px; margin-bottom: 6px; }

/* one job */
.pub-crumb { margin-bottom: 10px; }
.pub-crumb .link-btn svg { width: 15px; height: 15px; }
.pub-head { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; margin-bottom: 16px; }
.pub-head .view-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pub-head-act { display: flex; align-items: center; gap: 8px; flex: none; }
.pub-prog { padding: 16px 20px 14px; }
.pub-prog.done { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.pub-prog.failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.pub-prog-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 14.5px; }
.pub-prog-top span { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.pub-stages { list-style: none; display: flex; justify-content: space-between; margin: 12px 0 0; padding: 0; gap: 6px; }
.pub-stages li { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-tertiary); }
.pub-stages i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-elevated); }
.pub-stages li.on { color: var(--text); }
.pub-stages li.on i { background: var(--ff-green); border-color: var(--ff-green); }
.pub-stages li.now i { background: var(--ff-neon); border-color: var(--ff-dark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ff-neon) 40%, transparent); animation: pub-pulse 1.2s ease-in-out infinite; }
.pub-job-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pub-convo { display: flex; flex-direction: column; padding: 16px 18px; margin: 0; }
.pub-convo-head { display: flex; align-items: baseline; justify-content: space-between; }
.pub-convo-head .link-btn { font-size: 12.5px; }
.pub-feed { display: flex; flex-direction: column; gap: 10px; max-height: min(62vh, 640px); min-height: 220px; overflow-y: auto; padding: 4px 2px 10px; }
.pub-feed-empty { color: var(--text-tertiary); font-size: 13.5px; text-align: center; margin: auto; }
.pf-sys { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-secondary); padding: 2px 4px; }
.pf-sys svg { width: 15px; height: 15px; margin-top: 2px; color: var(--success); }
.pf-sys span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pf-sys time { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.pf-sys.log { font-size: 12px; color: var(--text-tertiary); }
.pf-sys.log svg { color: var(--text-tertiary); }
.pf-sys.warn svg { color: var(--warning); }
.pf-sys.error { color: var(--danger); font-weight: 700; }
.pf-sys.error svg { color: var(--danger); }
.pf-sys.result { font-weight: 700; color: var(--text); }
.pf-user, .pf-bot { max-width: 88%; }
.pf-user { align-self: flex-end; }
.pf-who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); margin-bottom: 4px; }
.pf-user .pf-who { justify-content: flex-end; }
.pf-b { font-size: 14px; line-height: 1.55; padding: 10px 13px; border-radius: 14px; background: var(--bg-muted); overflow-wrap: anywhere; }
.pf-user.me .pf-b { background: var(--ff-dark); color: #eef6ef; border-bottom-right-radius: 4px; }
.pf-user.me .pf-b a { color: var(--ff-neon); }
.pf-bot .pf-b { background: var(--bg-elevated); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.pf-bot.q .pf-b { border-color: color-mix(in srgb, var(--warning) 60%, var(--border)); background: color-mix(in srgb, var(--warning) 8%, var(--bg-elevated)); }
.pf-bot-av { width: 18px; height: 18px; border-radius: 6px; background: var(--ff-neon); display: inline-grid; place-items: center; }
.pf-bot-av svg { width: 14px; height: 14px; }
.pf-bot.typing .pf-b { display: inline-flex; gap: 4px; padding: 13px 14px; }
.pf-bot.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); animation: pub-dot 1.2s ease-in-out infinite; }
.pf-bot.typing i:nth-child(2) { animation-delay: 0.15s; } .pf-bot.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pub-dot { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.pub-compose { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.pub-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; }
.pub-compose .btn { height: 44px; width: 48px; padding: 0; display: grid; place-items: center; }
.pub-aside { display: grid; gap: 16px; min-width: 0; }
.pub-aside .panel { margin: 0; }
.pub-qa { display: flex; align-items: center; gap: 14px; }
.pub-ring { width: 64px; height: 64px; flex: none; }
.pr-track { fill: none; stroke: var(--bg-muted); stroke-width: 7; }
.pr-val { fill: none; stroke-width: 7; stroke-linecap: round; }
.pub-ring text { font-size: 17px; font-weight: 800; fill: var(--text); }
.pub-qa b { display: block; font-size: 16px; }
.pub-qa span { font-size: 12.5px; color: var(--text-tertiary); }
.pub-sum { font-size: 13.5px; color: var(--text-secondary); margin-top: 12px; line-height: 1.55; }
.pub-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pub-links .btn svg { width: 15px; height: 15px; }
.pub-art { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.pub-art > svg { color: var(--text-secondary); }
.pub-art span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--text-tertiary); }
.pub-art b { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-list { margin-top: 16px; }
.pub-list h4 { font-size: 12.5px; font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.pub-list h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); }
.pub-list.warn h4::before { background: var(--warning); } .pub-list.ok h4::before { background: var(--success); } .pub-list.todo h4::before { background: var(--info); } .pub-list.issues h4::before { background: var(--p1); }
.pub-list ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.pub-list .sev { display: inline-block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 5px; padding: 0 5px; margin-right: 6px; background: var(--bg-muted); }
.pub-list .sev.high { background: var(--p1-soft); color: var(--p1); } .pub-list .sev.medium { background: var(--p2-soft); color: var(--p2); }
.pub-list .fix { display: block; color: var(--text-tertiary); font-size: 12.5px; margin-top: 2px; }
.pub-sent-f { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.pub-sent-f svg { width: 15px; height: 15px; color: var(--text-tertiary); }
.pub-sent-f span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 980px) {
  .pub-cols, .pub-job-cols { grid-template-columns: minmax(0, 1fr); }
  .pub-feed { max-height: none; }
}
@media (max-width: 560px) {
  .pub-head { flex-direction: column; }
  .pub-stages li { font-size: 0; gap: 0; }
  .pub-stages li.now { font-size: 11px; gap: 5px; }
  .pf-user, .pf-bot { max-width: 96%; }
}
@media (prefers-reduced-motion: reduce) { .pub-bar.live span, .pub-chip.live svg, .pub-stages li.now i, .pf-bot.typing i { animation: none; } }
.pub-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; font-size: 13.5px; line-height: 1.5;
  background: color-mix(in srgb, var(--warning) 10%, var(--bg-elevated)); border: 1px solid color-mix(in srgb, var(--warning) 40%, var(--border)); color: var(--text-secondary); }
.pub-notice svg { color: var(--warning); margin-top: 1px; }
.pub-notice strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) { .comment-like.pop svg { animation: none; } }

/* ============================================================
   Joy (src/app/57-joy.js) — small, quick, never in the way
   ============================================================ */
.joy-ring { position: fixed; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2.5px solid var(--ff-green); pointer-events: none; z-index: 1300; animation: joy-ring 560ms cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }
@keyframes joy-ring { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
.joy-spark { position: fixed; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; pointer-events: none; z-index: 1300; animation: joy-spark 620ms cubic-bezier(0.15, 0.7, 0.3, 1) forwards; }
@keyframes joy-spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; } }
.joy-heart { position: fixed; color: #e5533f; font-size: 14px; line-height: 1; pointer-events: none; z-index: 1300; animation: joy-heart 1000ms ease-out forwards; }
@keyframes joy-heart { from { transform: translate(0, 0) scale(0.6); opacity: 0; } 20% { opacity: 1; } to { transform: translate(var(--drift), -46px) scale(1.15); opacity: 0; } }
.buddy.joy-jump { animation: joy-jump 1.2s cubic-bezier(0.3, 0.7, 0.4, 1.3); }
@keyframes joy-jump { 0% { transform: none; } 15% { transform: translateY(4px) scaleY(0.88) scaleX(1.08); } 40% { transform: translateY(-34px) rotate(-10deg); } 60% { transform: translateY(-34px) rotate(10deg); } 80% { transform: translateY(2px) scaleY(0.92); } 100% { transform: none; } }
.buddy.joy-hop { animation: joy-hop 0.65s cubic-bezier(0.3, 0.7, 0.4, 1.4); }
@keyframes joy-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-14px) rotate(-6deg); } }
.buddy.joy-spin { animation: joy-spin 1.1s cubic-bezier(0.4, 0.1, 0.3, 1); }
@keyframes joy-spin { 0% { transform: none; } 30% { transform: translateY(-24px) rotate(180deg) scale(1.1); } 70% { transform: translateY(-24px) rotate(540deg) scale(1.1); } 100% { transform: rotate(720deg); } }
.empty-lenny { width: 108px; height: auto; margin: 0 auto 12px; display: block; filter: drop-shadow(0 10px 14px rgba(16, 45, 20, 0.18)); animation: lenny-float 4.2s ease-in-out infinite; }
@keyframes lenny-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-7px) rotate(3deg); } }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled), .seg button:active { transform: scale(0.96); }
.checkbox.checked { animation: check-pop 260ms cubic-bezier(0.3, 0.7, 0.4, 1.5); }
@keyframes check-pop { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) {
  .joy-ring, .joy-spark, .joy-heart { display: none; }
  .buddy.joy-jump, .buddy.joy-hop, .buddy.joy-spin, .empty-lenny, .checkbox.checked { animation: none; }
  .btn:active, .icon-btn:active, .seg button:active { transform: none; }
}
/* Assigned by me: a person's overdue count beside their name */
.section-head .avatar { margin-right: 2px; }
.section-late { font-size: 11.5px; font-weight: 800; color: var(--overdue); background: color-mix(in srgb, var(--overdue) 12%, transparent); border-radius: 999px; padding: 1px 8px; }

/* ============================================================
   Article generator + document editor (92-generator.js, 93-doc-editor.js)
   ============================================================ */
:root { --claude: #d97757; --claude-ink: #ffffff; --page: #ffffff; --page-ink: #1d2a21; --canvas: #eef1ec; }
[data-theme="dark"] { --page: #f7f8f5; --page-ink: #1d2a21; --canvas: #0d1d13; }
.claude-spark { width: 22px; height: 14px; flex: none; fill: currentColor; overflow: visible; }
.claude-spark .eye { fill: #2b1a12; }
.btn.gen-btn .claude-spark { fill: #fff; }
.btn.gen-btn .claude-spark .eye { fill: var(--claude); }
.claude-spark.big { width: 44px; height: 28px; fill: var(--claude); }
.pub-chip .claude-spark { width: 16px; height: 10px; }
.claude-spark.spin { animation: clawd-walk 0.9s steps(2) infinite; }
@keyframes clawd-walk { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes spark-spin { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-3px) rotate(-6deg); } 75% { transform: translateY(-3px) rotate(6deg); } }
.btn.gen-btn { background: var(--claude); color: var(--claude-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--claude) 60%, #000); }
.btn.gen-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--claude) 88%, #000); }
.btn.gen-btn:hover:not(:disabled) .claude-spark { animation: spark-spin 1.6s linear infinite; }
.btn.gen-btn:disabled { opacity: 0.5; }
.btn.gen-inline { padding: 8px 14px; font-size: 13.5px; }
.linked-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.gen-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; }
.gen-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.gen-kind { border: 1px solid var(--border); background: var(--bg-elevated); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13.5px; color: var(--text-secondary); }
.gen-kind:hover { background: var(--bg-hover); }
.gen-kind.on { background: var(--ff-dark); border-color: var(--ff-dark); color: #fff; }
.gen-kind-note { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.gen-type { font-weight: 800; color: var(--text-secondary); }
.pub-empty .claude-spark { margin-bottom: 6px; }
.gen-failed { display: grid; gap: 12px; border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.gen-live { display: grid; gap: 12px; padding: 16px 20px; border-color: color-mix(in srgb, var(--claude) 40%, var(--border)); }
.gen-live-top { display: flex; align-items: center; gap: 14px; }
.gen-live-top div { display: grid; gap: 2px; }
.gen-live-top span { font-size: 13px; color: var(--text-secondary); }
.gen-bar { height: 4px; border-radius: 99px; background: color-mix(in srgb, var(--claude) 18%, var(--bg-muted)); overflow: hidden; }
.gen-bar span { display: block; height: 100%; width: 30%; border-radius: 99px; background: var(--claude); animation: gen-bar 1.6s ease-in-out infinite; }
@keyframes gen-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
.gen-wait { text-align: center; padding: 40px 0; }
.gen-cursor { display: inline-block; width: 9px; height: 1.1em; background: var(--claude); vertical-align: -3px; margin-left: 2px; animation: pub-pulse 0.9s steps(2) infinite; }

/* the editor */
.doc-shell { display: grid; gap: 0; margin: -34px -44px -140px; }
.content.wide:has(.doc-shell) { max-width: none; }
@media (max-width: 880px) { .doc-shell { margin: -18px -16px -140px; } }
.doc-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
.doc-back svg { width: 15px; height: 15px; }
.doc-title-in { border: 1px solid transparent; background: transparent; font: inherit; font-size: 17px; font-weight: 800; color: var(--text); padding: 4px 8px; border-radius: 8px; min-width: 0; flex: 1 1 240px; max-width: 520px; }
.doc-title-in:hover { border-color: var(--border); }
.doc-title-in:focus { border-color: var(--ff-green); outline: none; background: var(--bg); }
.doc-save { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-tertiary); font-weight: 600; white-space: nowrap; }
.doc-save svg { width: 14px; height: 14px; }
.doc-here { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.doc-here .avatar + .avatar { margin-left: -6px; }
.doc-conflict, .doc-warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; font-size: 13.5px; background: color-mix(in srgb, var(--warning) 12%, var(--bg-elevated)); border-bottom: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.doc-conflict svg, .doc-warn svg { color: var(--warning); }
.doc-conflict span { flex: 1; min-width: 200px; }
.doc-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px 12px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); position: sticky; top: 53px; z-index: 29; }
.doc-toolbar .tb { min-width: 32px; height: 32px; display: inline-grid; place-items: center; border: none; background: transparent; border-radius: 7px; color: var(--text-secondary); padding: 0 6px; }
.doc-toolbar .tb:hover { background: var(--bg-hover); color: var(--text); }
.doc-toolbar .tb.on { background: color-mix(in srgb, var(--ff-green) 18%, transparent); color: var(--text); }
.doc-toolbar .tb svg { width: 16px; height: 16px; }
.doc-toolbar .tb svg.flip { transform: scaleX(-1); }
.tb-t { font-weight: 700; font-size: 14px; line-height: 1; font-family: Georgia, "Times New Roman", serif; }
.tb-t sub { font-size: 9px; }
.tb-hl { background: #ffe86b; color: #1d2a21; padding: 0 3px; border-radius: 3px; font-family: var(--font); }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.tb-style { height: 32px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-elevated); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 0 6px; }
.doc-cols { display: grid; grid-template-columns: 180px minmax(0, 1fr) 300px; align-items: start; background: var(--canvas); min-height: calc(100vh - 160px); }
.doc-outline { position: sticky; top: 105px; padding: 22px 8px 22px 16px; display: grid; gap: 2px; max-height: calc(100vh - 120px); overflow-y: auto; }
.doc-outline-h { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 6px; }
.doc-outline button { border: none; background: none; text-align: left; font-size: 12.5px; color: var(--text-secondary); padding: 4px 6px; border-radius: 6px; line-height: 1.35; }
.doc-outline button:hover { background: var(--bg-hover); color: var(--text); }
.doc-outline .ol-h1 { font-weight: 800; }
.doc-outline .ol-h2 { font-weight: 600; }
.doc-outline .ol-h3 { padding-left: 16px; }
.doc-canvas { padding: 28px 16px 80px; min-width: 0; }
.doc-canvas.preview { background: var(--canvas); border-radius: 18px; margin-top: 16px; }
.doc-page { max-width: 816px; margin: 0 auto; background: var(--page); color: var(--page-ink); border-radius: 4px; box-shadow: 0 1px 3px rgba(16, 45, 20, 0.12), 0 8px 30px rgba(16, 45, 20, 0.08); padding: 72px 84px 96px; }
.doc-body { outline: none; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 17px; line-height: 1.7; color: var(--page-ink); min-height: 600px; overflow-wrap: anywhere; }
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 { font-family: var(--font); color: #102d14; line-height: 1.25; letter-spacing: -0.01em; margin: 1.4em 0 0.4em; }
.doc-body h1 { font-size: 30px; font-weight: 800; }
.doc-body h2 { font-size: 23px; font-weight: 800; }
.doc-body h3 { font-size: 18.5px; font-weight: 700; }
.doc-body h4 { font-size: 16px; font-weight: 700; }
.doc-body > :first-child { margin-top: 0; }
.doc-body p { margin: 0 0 0.9em; }
.doc-body ul, .doc-body ol { margin: 0 0 1em; padding-left: 1.6em; }
.doc-body li { margin: 0.25em 0; }
.doc-body blockquote { margin: 1em 0; padding: 0.2em 0 0.2em 1em; border-left: 3px solid #3abb75; color: #46604f; font-style: italic; }
.doc-body a { color: #1f6fd1; text-decoration: underline; }
.doc-body mark { background: #ffe86b; color: inherit; padding: 0 2px; }
.doc-body sup { font-size: 0.7em; color: #1f8a52; font-family: var(--font); font-weight: 700; }
.doc-body img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 1em 0; }
.doc-body hr { border: none; border-top: 1px solid #d6ddd5; margin: 2em 0; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-family: var(--font); font-size: 14.5px; }
.doc-body th, .doc-body td { border: 1px solid #d6ddd5; padding: 8px 10px; text-align: left; vertical-align: top; }
.doc-body th { background: #f2f4f0; font-weight: 800; }
.doc-body code, .doc-body pre { font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; background: #f2f4f0; border-radius: 4px; padding: 1px 4px; }
.doc-side { position: sticky; top: 105px; max-height: calc(100vh - 120px); overflow-y: auto; background: var(--bg-elevated); border-left: 1px solid var(--border); padding: 0 0 20px; align-self: stretch; }
.doc-tabs { display: flex; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-elevated); z-index: 1; }
.doc-tabs button { flex: 1; border: none; background: none; padding: 11px 6px; font-weight: 700; font-size: 13px; color: var(--text-tertiary); border-bottom: 2px solid transparent; }
.doc-tabs button.on { color: var(--text); border-bottom-color: var(--ff-green); }
.doc-meta, .doc-claude, .doc-history { display: grid; gap: 12px; padding: 14px 16px; }
.dm { display: grid; gap: 4px; }
.dm-l { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--text-secondary); }
.dm-n { font-weight: 700; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.dm-n.over { color: var(--danger); }
.dm-h { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.4; }
.dm textarea { resize: vertical; }
.dm-group { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin-top: 6px; }
.doc-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.doc-facts dt { color: var(--text-tertiary); font-weight: 700; }
.doc-facts dd { margin: 0; }
.dv { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dv div { display: grid; gap: 2px; min-width: 0; }
.dv b { font-size: 13px; }
.dv span { font-size: 12px; color: var(--text-tertiary); }
.doc-status { display: flex; gap: 16px; padding: 6px 16px; font-size: 12px; color: var(--text-tertiary); background: var(--bg-elevated); border-top: 1px solid var(--border); position: sticky; bottom: 0; z-index: 5; flex-wrap: wrap; }
.doc-pop { display: grid; gap: 6px; padding: 8px; min-width: 260px; }
.doc-pop label { font-size: 12px; font-weight: 800; color: var(--text-secondary); }
.doc-pop-go { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.version-view { padding: 32px 40px; max-height: 60vh; overflow-y: auto; box-shadow: none; border: 1px solid var(--border); }
@media (max-width: 1180px) { .doc-cols { grid-template-columns: minmax(0, 1fr) 300px; } .doc-outline { display: none; } }
@media (max-width: 860px) {
  .doc-cols { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; max-height: none; border-left: none; border-top: 1px solid var(--border); }
  .doc-page { padding: 36px 22px 60px; }
  .doc-toolbar { top: 0; position: relative; }
  .doc-top { position: relative; }
}
@media (prefers-reduced-motion: reduce) { .claude-spark.spin, .btn.gen-btn:hover .claude-spark, .gen-bar span, .gen-cursor { animation: none; } }

/* system alerts (the owner's Home page + bell) */
.sys-alerts { display: grid; gap: 10px; margin: 0 0 18px; }
.sys-alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 8%, var(--bg-elevated)); }
.sys-alert.watch { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); background: color-mix(in srgb, var(--warning) 7%, var(--bg-elevated)); }
.sys-alert.ok { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--bg-elevated)); padding: 10px 16px; }
.sys-ic { font-size: 20px; line-height: 1.2; flex: none; }
.sys-body { flex: 1; min-width: 0; }
.sys-body b { display: block; font-size: 15px; margin-bottom: 3px; }
.sys-body p { margin: 0 0 4px; font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.sys-body .sys-meta { font-size: 12px; color: var(--text-tertiary); margin: 0; }
.sys-body details { margin-top: 6px; font-size: 12.5px; }
.sys-body summary { cursor: pointer; color: var(--link); font-weight: 700; }
.sys-body code { display: block; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--bg-hover); white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.avatar.sys-av { --av: var(--danger); font-weight: 900; }
