/* Charlotte PM: quiet surfaces, emerald actions and a clear information hierarchy. */

@import url("../assets/vendor/fonts/fonts.css");
@import url("../assets/vendor/fontawesome/css/all.min.css");

:root {
  color-scheme: dark;
  --font-sans: "Manrope", "Vazirmatn", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Manrope", "Vazirmatn", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --bg: #08090a;
  --bg-soft: #0b0c0e;
  --surface: #0f1113;
  --surface-2: #141619;
  --surface-3: #1b1e22;
  --surface-4: #24282d;
  --overlay: rgba(3, 4, 5, 0.66);
  --glass: rgba(13, 15, 16, 0.92);

  --text: #f4f7fb;
  --text-soft: #cfd3d8;
  --muted: #9299a2;
  --muted-2: #818a94;

  --brand: #55e69c;
  --brand-2: #10b981;
  --brand-ink: #052414;
  --brand-soft: rgba(85, 230, 156, 0.12);
  --accent: #b9a0ff;
  --accent-soft: rgba(185, 160, 255, 0.13);
  --info: #57c7ff;
  --info-soft: rgba(87, 199, 255, 0.12);
  --warn: #f4b95e;
  --warn-soft: rgba(244, 185, 94, 0.13);
  --danger: #ff6f7d;
  --danger-soft: rgba(255, 111, 125, 0.12);
  --ok: #49d17d;
  --success: #55e69c;
  --success-soft: rgba(85, 230, 156, 0.12);
  --love: #fb7185;
  --love-soft: rgba(251, 113, 133, 0.13);

  --line: rgba(190, 198, 207, 0.105);
  --line-strong: rgba(204, 211, 220, 0.2);
  --focus: #55e69c;
  --input-bg: rgba(255, 255, 255, 0.04);
  --hover: rgba(255, 255, 255, 0.045);
  --chip: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);

  --viz-1: #25a868;
  --viz-2: #9a7cf0;
  --viz-3: #c0801f;
  --viz-4: #2a9fd8;
  --viz-grid: rgba(190, 198, 207, 0.1);

  --r-panel: 16px;
  --r-card: 12px;
  --r-control: 9px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sidebar-w: 252px;
  --topbar-h: 68px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f3;
  --bg-soft: #fbfcfa;
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --surface-3: #eef2ed;
  --surface-4: #e1e8e1;
  --overlay: rgba(20, 32, 48, 0.36);
  --glass: rgba(255, 255, 255, 0.84);

  --text: #20362c;
  --text-soft: #43594d;
  --muted: #687b70;
  --muted-2: #728278;

  --brand: #19a85d;
  --brand-2: #0b8249;
  --brand-ink: #ffffff;
  --brand-soft: rgba(25, 168, 93, 0.1);
  --accent: #6d4fe0;
  --accent-soft: rgba(109, 79, 224, 0.09);
  --info: #0d6b9e;
  --info-soft: rgba(13, 107, 158, 0.09);
  --warn: #a8670c;
  --warn-soft: rgba(185, 120, 23, 0.11);
  --danger: #d63d54;
  --danger-soft: rgba(214, 61, 84, 0.09);
  --ok: #128a4a;
  --success: #19a85d;
  --success-soft: rgba(25, 168, 93, 0.1);
  --love: #d63d6a;
  --love-soft: rgba(214, 61, 106, 0.09);

  --line: rgba(43, 71, 52, 0.11);
  --line-strong: rgba(43, 71, 52, 0.24);
  --focus: #19a85d;
  --input-bg: rgba(15, 23, 42, 0.03);
  --hover: rgba(15, 23, 42, 0.04);
  --chip: rgba(15, 23, 42, 0.05);

  --shadow-sm: 0 2px 4px rgba(32, 54, 44, 0.035);
  --shadow-md: 0 8px 24px rgba(32, 54, 44, 0.07);
  --shadow-lg: 0 28px 70px rgba(32, 48, 77, 0.2);

  --viz-1: #14995a;
  --viz-2: #7b5ce6;
  --viz-3: #b26b00;
  --viz-4: #0b7fbf;
  --viz-grid: rgba(38, 55, 77, 0.1);
}

/* Personal accent (Settings > Appearance). Only interactive chrome follows it; "done" stays --success. */
:root[data-accent="violet"] {
  --brand: #b9a0ff; --brand-2: #9a7cf0; --brand-ink: #170b36; --brand-soft: rgba(185, 160, 255, 0.13); --focus: #b9a0ff;
  --accent: #57c7ff; --accent-soft: rgba(87, 199, 255, 0.12);
}
:root[data-accent="ocean"] {
  --brand: #57c7ff; --brand-2: #2a9fd8; --brand-ink: #03202e; --brand-soft: rgba(87, 199, 255, 0.12); --focus: #57c7ff;
}
:root[data-theme="light"][data-accent="violet"] {
  --brand: #6d4fe0; --brand-2: #5a3dc9; --brand-ink: #ffffff; --brand-soft: rgba(109, 79, 224, 0.09); --focus: #6d4fe0;
  --accent: #0b7fbf; --accent-soft: rgba(11, 127, 191, 0.09);
}
:root[data-theme="light"][data-accent="ocean"] {
  --brand: #0b7fbf; --brand-2: #086a9f; --brand-ink: #ffffff; --brand-soft: rgba(11, 127, 191, 0.09); --focus: #0b7fbf;
}

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

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  font-feature-settings: "cv05", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A soft wash of the accent in the top corners: enough warmth to feel alive, never enough to distract. */
.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 18% -8%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 70%),
    radial-gradient(700px 380px at 92% -12%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
p { margin: 0; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, kbd { font-family: var(--font-mono); font-size: 0.86em; }
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface-3); color: var(--muted); font-size: 0.72rem;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
.small { font-size: 0.82rem; }
.tiny { font-size: 0.72rem; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; align-content: start; }
.stack.tight { gap: 6px; }
.grow { flex: 1 1 auto; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ shell */

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 16px 16px;
  border-inline-end: 1px solid var(--line);
  background: var(--bg-soft);
  z-index: 40;
}

.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px; }
.sidebar-brand img { height: 34px; width: auto; display: block; }
.sidebar-brand .pm-tag {
  font-family: var(--font-display); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.14em;
  color: var(--brand); border: 1px solid var(--brand-soft); background: var(--brand-soft);
  padding: 3px 7px; border-radius: 999px;
}

.project-switch {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 32px; max-width: 200px;
  padding: 4px 6px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; text-align: start; font-size: inherit;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.project-switch:hover { color: var(--text); background: var(--hover); }
.project-switch .mobile-project-icon { display: none; }

.project-icon {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  color: var(--pc, var(--brand)); background: color-mix(in srgb, var(--pc, var(--brand)) 16%, var(--surface-3));
  border: 1px solid color-mix(in srgb, var(--pc, var(--brand)) 30%, var(--line)); font-size: 0.8rem;
}
.mono-letter { font-family: var(--font-display); font-weight: 600; font-size: 0.95em; line-height: 1; }
.project-icon.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 1.05rem; }
.project-icon.sm { width: 20px; height: 20px; border-radius: 5px; font-size: 0.62rem; }

.nav { flex: 1 1 auto; overflow-y: auto; margin: 6px -4px 0; padding: 0 4px; }
.nav-section {
  padding: 22px 12px 9px; color: var(--muted-2); font-size: 0.63rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px;
  padding: 8px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-soft); font-weight: 500; font-size: 0.86rem; cursor: pointer; text-align: start;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.nav-item i { width: 18px; text-align: center; color: var(--muted); font-size: 0.9rem; transition: color 0.14s; }
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.nav-item.active i { color: var(--brand); }
.nav-item.active::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 13px; bottom: 13px; width: 3px;
  border-radius: 3px; background: var(--brand);
}
.nav-item .count {
  margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 0.68rem; font-weight: 700;
  background: var(--chip); color: var(--muted);
}
.nav-item .count.alert { background: var(--danger-soft); color: var(--danger); }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.user-card {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0;
  border-radius: 8px; background: transparent; cursor: pointer; text-align: start;
}
.user-card:hover { background: var(--hover); }
.user-card .u-name { font-weight: 700; font-size: 0.84rem; }
.user-card .u-role { font-size: 0.7rem; color: var(--muted); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 32px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px);
}
.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-title .crumb { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; font-size: 0.86rem; white-space: nowrap; }
.topbar-title .crumb i { font-size: 0.6rem; color: var(--muted-2); }
.topbar-title h1 { font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1 1 auto; }

.search-trigger {
  display: flex; align-items: center; gap: 10px; width: min(300px, 28vw); height: 36px; padding: 0 8px 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--muted);
  cursor: pointer; font-size: 0.84rem; transition: border-color 0.16s, background 0.16s;
}
.search-trigger:hover { border-color: var(--line-strong); background: var(--hover); }
.search-trigger span { flex: 1; text-align: start; }

.menu-toggle { display: none; }

.content { padding: 32px 36px 48px; width: 100%; max-width: 1536px; margin: 0 auto; flex: 1 1 auto; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 500; padding: 12px 20px; background: var(--brand); color: var(--brand-ink); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.mobile-tabbar { display: none; }
.sidebar-scrim { display: none; }

/* ------------------------------------------------------------------ page */

.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; animation: enter 0.28s var(--ease) both; min-width: 0; }
.page-host { min-width: 0; }

@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.stagger > * { animation: enter 0.4s var(--ease) both; }
.stagger > :nth-child(2) { animation-delay: 0.04s; }
.stagger > :nth-child(3) { animation-delay: 0.08s; }
.stagger > :nth-child(4) { animation-delay: 0.12s; }
.stagger > :nth-child(5) { animation-delay: 0.16s; }
.stagger > :nth-child(n + 6) { animation-delay: 0.2s; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.page-head h2 { font-size: clamp(1.6rem, 2vw, 1.9rem); letter-spacing: -0.035em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 0.875rem; }
.kicker {
  display: block; color: var(--muted); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px;
}
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.panel {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px;
  padding: 12px 18px 12px 22px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600; letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.panel-head h3 i { color: var(--muted); font-size: 0.85rem; }
.panel-body { padding: 20px 22px; }
.panel-body.flush { padding: 4px 0; }

.grid { display: grid; gap: 22px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr); align-items: start; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ------------------------------------------------------------------ kpis */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi {
  position: relative; overflow: hidden; display: grid; gap: 10px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  cursor: default; transition: border-color 0.16s, background 0.16s; text-align: start; color: var(--text); box-shadow: var(--shadow-sm);
}
.kpi[data-href] { cursor: pointer; }
.kpi[data-href]:hover { border-color: var(--line-strong); background: var(--surface-2); }
.kpi .k-label { display: flex; align-items: center; gap: 8px; min-height: 28px; color: var(--text-soft); font-size: 0.82rem; font-weight: 500; }
.kpi .k-label i { order: 2; margin-inline-start: auto; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 0.78rem; color: var(--tone, var(--brand)); background: color-mix(in srgb, var(--tone, var(--brand)) 12%, transparent); }
.kpi .k-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k-hint { color: var(--muted); font-size: 0.76rem; }

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.82rem;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform 0.14s var(--ease), background 0.14s, border-color 0.14s, box-shadow 0.14s, opacity 0.14s;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-4); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn i { font-size: 0.85em; }
.btn.primary { background: var(--brand); border-color: transparent; color: var(--brand-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 90%, var(--text)); border-color: transparent; }
.btn.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); border-color: transparent; color: var(--text); }
.btn.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 0.78rem; border-radius: 7px; }
.btn.xs { min-height: 24px; padding: 0 8px; font-size: 0.72rem; border-radius: 6px; gap: 5px; }
.btn.block { width: 100%; }
.btn.loading { pointer-events: none; opacity: 0.7; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-soft);
  cursor: pointer; position: relative; transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.bordered { border-color: var(--line); background: var(--surface-2); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 6px; font-size: 0.8rem; }
.icon-btn .dot {
  position: absolute; top: 4px; inset-inline-end: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 0.78rem; font-weight: 600; color: var(--text-soft); }
.field .hint { font-size: 0.74rem; color: var(--muted-2); }
.field.error .input { border-color: var(--danger); }
.field .err { font-size: 0.74rem; color: var(--danger); }

.input, select.input, textarea.input {
  width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--input-bg); color: var(--text); font: inherit; font-size: 0.88rem;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted-2); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }
select.input { appearance: none; padding-inline-end: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239299a2' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
[dir="rtl"] select.input { background-position: left 12px center; }
select.input option { background: var(--surface-2); color: var(--text); }
.input.sm { min-height: 32px; padding: 5px 10px; font-size: 0.8rem; border-radius: 7px; }
.input.title-input { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; border-color: transparent; background: transparent; padding: 4px 8px; margin-inline-start: -8px; }
.input.title-input:hover { background: var(--hover); }
.input.title-input:focus { background: var(--input-bg); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 0.86rem; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 17px; height: 17px; flex: 0 0 auto; border-radius: 5px; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; transition: all 0.14s var(--ease); background: var(--input-bg);
}
.check .box::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.6rem; color: var(--brand-ink); transform: scale(0); transition: transform 0.18s var(--spring); }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box::after { transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--focus); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 0.86rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-4); position: relative; transition: background 0.16s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--spring); }
.switch input:checked + .track { background: var(--brand); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 3px; }
.switch input:checked + .track::after { transform: translateX(14px); }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-14px); }

.seg {
  display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
}
.seg button {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-weight: 500; font-size: 0.8rem; cursor: pointer; transition: all 0.14s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-4); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .input { width: auto; min-width: 130px; }
.filters .search { position: relative; }
.filters .search i { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 0.8rem; }
.filters .search .input { padding-inline-start: 32px; min-width: 220px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); font-weight: 500; font-size: 0.78rem; cursor: pointer;
}
.filter-chip:hover { border-color: var(--line-strong); }
.filter-chip.on { font-weight: 600; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------------ chips, avatars, progress */

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 6px;
  background: var(--chip); color: var(--text-soft); font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.chip i { font-size: 0.85em; }
.chip.good { background: var(--success-soft); color: var(--ok); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.violet { background: var(--accent-soft); color: var(--accent); }
.chip.outline { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.chip.label { background: color-mix(in srgb, var(--lc) 14%, transparent); color: color-mix(in srgb, var(--lc) 80%, var(--text)); }
.chip.label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lc); }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; border: 2px solid var(--sc); }
.status-dot.fill { background: var(--sc); }
.status-dot.half { background: linear-gradient(90deg, var(--sc) 50%, transparent 50%); }

.prio { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 12px; }
.prio span { width: 3px; border-radius: 1px; background: var(--line-strong); }
.prio span:nth-child(1) { height: 5px; }
.prio span:nth-child(2) { height: 8px; }
.prio span:nth-child(3) { height: 12px; }
.prio.p-low span:nth-child(1) { background: var(--muted); }
.prio.p-medium span:nth-child(-n + 2) { background: var(--info); }
.prio.p-high span { background: var(--warn); }
.prio.p-critical { color: var(--danger); font-size: 0.75rem; align-items: center; }

.avatar {
  --ac: var(--brand);
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--ac) 22%, var(--surface-3)); color: color-mix(in srgb, var(--ac) 85%, var(--text));
  border: 1px solid color-mix(in srgb, var(--ac) 40%, transparent); font-weight: 700; font-size: 0.68rem;
  font-family: var(--font-display); letter-spacing: 0; text-transform: uppercase;
}
.avatar.xs { width: 20px; height: 20px; font-size: 0.55rem; }
.avatar.sm { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar.lg { width: 44px; height: 44px; font-size: 0.95rem; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.3rem; }
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar { border: 2px solid var(--surface); margin-inline-start: -7px; }
.avatars .avatar:first-child { margin-inline-start: 0; }
.avatars .more { font-size: 0.7rem; color: var(--muted); margin-inline-start: 4px; font-weight: 600; }

.bar { height: 6px; border-radius: 999px; background: var(--surface-4); overflow: hidden; min-width: 40px; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--bc, var(--brand)); transition: width 0.5s var(--ease); }
.bar.thin { height: 4px; }
.bar.thick { height: 9px; }

.ring { --p: 0; --rc: var(--brand); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--surface-4) 0); flex: 0 0 auto; }
.ring::before { content: attr(data-label); width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; }

/* ------------------------------------------------------------------ lists */

.list { display: grid; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-width: 0;
  border-top: 1px solid var(--line); cursor: pointer; transition: background 0.12s;
}
.list-item:first-child { border-top: 0; }
.list-item:hover { background: var(--hover); }
.list-item .li-main { flex: 1 1 auto; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-sub { color: var(--muted); font-size: 0.76rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.list-group-title { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.list-group-title .n { color: var(--muted-2); }

.task-code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.due.soon { color: var(--warn); }
.due.over { color: var(--danger); }
.due.done { color: var(--muted-2); text-decoration: line-through; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.table th {
  position: sticky; top: 0; text-align: start; padding: 10px 12px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background 0.1s; }
.table tbody tr:hover { background: var(--hover); }
.table tr.group-row td { background: var(--surface-2); font-weight: 700; font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; cursor: default; }
.table .t-title { font-weight: 600; max-width: 420px; }

/* ------------------------------------------------------------------ board */

/* The page scrolls, not the columns: no clipped cards, no double scrollbars. */
.board { display: flex; gap: 16px; overflow-x: auto; padding: 2px 2px 16px; align-items: flex-start; min-height: 50vh; }
.column {
  flex: 1 1 0; min-width: 208px; max-width: 400px; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--bg-soft); transition: border-color 0.16s, background 0.16s;
}
.column.drop { border-color: color-mix(in srgb, var(--sc) 60%, transparent); background: color-mix(in srgb, var(--sc) 6%, var(--surface)); }
.column-head {
  display: flex; align-items: center; gap: 8px; padding: 14px 12px 14px 16px;
}
.column-head h4 { font-size: 0.84rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.col-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--chip); color: var(--muted); font-size: 0.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.column-head .icon-btn { opacity: 0.65; transition: opacity 0.14s; }
.column:hover .column-head .icon-btn, .column-head .icon-btn:focus-visible { opacity: 1; }
.column-body { padding: 0 10px 10px; display: grid; gap: 12px; align-content: start; }
.col-add {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border: 1px dashed transparent; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 0.8rem; font-weight: 500; cursor: pointer; text-align: start; transition: all 0.14s;
}
.col-add:hover { color: var(--text); background: var(--hover); }
.col-add.empty { flex-direction: column; justify-content: center; gap: 4px; min-height: 96px; border-color: var(--line-strong); text-align: center; }
.col-add.empty > i { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--chip); margin-bottom: 4px; }
.col-add.empty u { text-decoration: none; color: var(--accent); font-weight: 600; }

.tcard {
  position: relative; display: grid; gap: 12px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: grab; user-select: none; overflow: hidden; --ring: var(--surface);
  box-shadow: inset 3px 0 0 var(--pc, transparent), var(--shadow-sm);
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s, opacity 0.14s;
}
.tcard:hover { border-color: var(--line-strong); background: var(--surface); --ring: var(--surface); box-shadow: inset 3px 0 0 var(--pc, transparent), var(--shadow-md); }
.tcard:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tcard.dragging { opacity: 0.35; }
.tcard.placeholder-before::before, .tcard.placeholder-after::after {
  content: ""; position: absolute; inset-inline: 6px; height: 2px; border-radius: 2px; background: var(--accent);
}
.tcard.placeholder-before::before { top: 0; }
.tcard.placeholder-after::after { bottom: 0; }
.tcard.blocked { --pc: var(--danger); }
.tcard.closed { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tcard.closed .tc-title { color: var(--muted); }
.tc-top { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.tc-check {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1.5px solid var(--line-strong); background: transparent; color: transparent; font-size: 0.55rem; cursor: pointer;
  transition: all 0.16s var(--ease);
}
.tc-check:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.tc-check.on { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.tc-title { font-weight: 700; font-size: 0.89rem; line-height: 1.6; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding-top: 10px; border-top: 1px solid var(--line); }
.tc-unassigned { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border: 1px dashed var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 0.7rem; }
.tc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.74rem; font-weight: 500; }
.tc-meta > span:not(.tc-due) { display: inline-flex; align-items: center; gap: 4px; }
.tc-meta .ok { color: var(--ok); }
.tc-meta .need { color: var(--accent); }
.tc-due {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 6px;
  background: var(--chip); color: var(--text-soft); font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.tc-due.soon { background: var(--warn-soft); color: var(--warn); }
.tc-due.over { background: var(--danger-soft); color: var(--danger); }
.tc-due.done { background: var(--success-soft); color: var(--ok); }
.tc-progress { position: absolute; inset: auto 0 0 0; height: 2px; background: var(--surface-4); }
.tc-progress span { display: block; height: 100%; background: var(--success); }
.avatars .avatar { border-color: var(--ring, var(--surface)); }

.all-clear {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--r-card);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}
.all-clear > i { font-size: 1.4rem; color: var(--brand); }
.all-clear > div { flex: 1; display: grid; }
.all-clear span { color: var(--muted); font-size: 0.84rem; }

/* ------------------------------------------------------------------ task toolbar & views */

.views { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.view-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px 12px; border-radius: 0; flex: 0 0 auto;
  border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all 0.14s;
}
.view-tab i { color: var(--muted); font-size: 0.8rem; }
.view-tab b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--chip); color: var(--muted); font-size: 0.7rem; font-weight: 600; }
.view-tab:hover { color: var(--text); }
.view-tab.danger b { background: var(--danger-soft); color: var(--danger); }
.view-tab.warn b { background: var(--warn-soft); color: var(--warn); }
.view-tab.on { border-bottom-color: var(--brand); color: var(--brand); font-weight: 700; }
.view-tab.on i { color: var(--brand); }
.view-tab.on b { background: var(--brand-soft); color: var(--brand); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.toolbar .search { position: relative; }
.toolbar .search i { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 0.8rem; }
.toolbar .search .input { padding-inline-start: 32px; width: 240px; }
.fbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); font-size: 0.8rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.fbtn:hover { border-color: var(--line-strong); color: var(--text); }
.fbtn > i:first-child { color: var(--muted); font-size: 0.78rem; }
.fbtn .fb-caret { font-size: 0.6rem; color: var(--muted-2); }
.fbtn.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--text); padding-inline-end: 4px; }
.fbtn.on > i:first-child { color: var(--accent); }
.fbtn .fb-key { color: var(--muted); }
.fbtn .fb-val { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.fbtn .fb-x { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--muted); }
.fbtn .fb-x:hover { background: var(--hover); color: var(--text); }

#task-summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.summary-bar { width: 120px; height: 6px; border-radius: 999px; background: var(--surface-4); overflow: hidden; margin-inline-start: 8px; }
.summary-bar span { display: block; height: 100%; background: var(--success); border-radius: 999px; }

.bulk-bar {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px 8px 14px; margin-bottom: 10px; border-radius: var(--r-card); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--surface-2); box-shadow: var(--shadow-md);
}
.task-table tr.closed .t-title { color: var(--muted); }
.cell-edit {
  display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 2px 8px; margin-inline: -8px; border: 1px solid transparent;
  border-radius: 6px; background: transparent; color: var(--text-soft); font-size: 0.82rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.cell-edit:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.cell-edit:disabled { cursor: default; }
.task-table .group-row td { padding-top: 14px; }

.quick-add { display: grid; gap: 8px; padding: 10px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 10px; background: var(--surface-2); }

/* ------------------------------------------------------------------ drawer & modal */

.scrim { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); z-index: 80; animation: fade 0.18s var(--ease); }

.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 90; width: min(760px, 100vw);
  display: flex; flex-direction: column; background: var(--surface); border-inline-start: 1px solid var(--line);
  box-shadow: var(--shadow-lg); animation: slide-in 0.28s var(--ease);
}
[dir="rtl"] .drawer { animation-name: fade; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 22px 40px; }
.drawer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; }

.props { display: grid; gap: 4px; align-content: start; }
.prop { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prop:last-child { border-bottom: 0; }
.prop > .label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.prop-value {
  display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 8px; margin-inline: -8px;
  border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.84rem; flex-wrap: wrap;
}
.prop-value:hover { background: var(--hover); }
.prop-value.readonly { cursor: default; }
.prop-value.readonly:hover { background: transparent; }
.prop-value .placeholder { color: var(--muted-2); font-weight: 600; }

.section { display: grid; gap: 10px; margin-top: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title h4 { font-size: 0.8rem; font-family: var(--font-sans); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: flex; gap: 8px; align-items: center; }

.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 0.84rem;
  border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); background: color-mix(in srgb, var(--tc) 9%, transparent);
  --tc: var(--info);
}
.alert i { color: var(--tc); margin-top: 3px; }
.alert.danger { --tc: var(--danger); }
.alert.warn { --tc: var(--warn); }
.alert.good { --tc: var(--ok); }
.alert.violet { --tc: var(--accent); }

.checklist { display: grid; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-inline: -8px; border-radius: 9px; }
.check-row:hover { background: var(--hover); }
.check-row .ct { flex: 1; font-size: 0.86rem; }
.check-row.done .ct { color: var(--muted); text-decoration: line-through; }
.check-row .icon-btn { opacity: 0; }
.check-row:hover .icon-btn { opacity: 1; }

.comment { display: flex; gap: 10px; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: baseline; gap: 8px; font-size: 0.8rem; }
.comment .c-head b { font-size: 0.84rem; }
.comment .c-text { margin-top: 4px; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.86rem; }
.comment .c-actions { opacity: 0; transition: opacity 0.14s; }
.comment:hover .c-actions { opacity: 1; }
.composer { display: flex; gap: 10px; align-items: flex-start; }
.composer textarea { min-height: 64px; }

.timeline-item { display: flex; gap: 10px; font-size: 0.8rem; color: var(--muted); padding: 4px 0; align-items: baseline; }
.timeline-item b { color: var(--text-soft); }

.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 9vh 16px 16px; overflow-y: auto; }
.modal {
  width: min(560px, 100%); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-lg); animation: pop 0.22s var(--ease); display: flex; flex-direction: column; max-height: 84vh;
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; }
.modal-head h3 { font-size: 1.08rem; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }

.popover {
  position: fixed; z-index: 120; min-width: 200px; max-width: 320px; max-height: 360px; overflow-y: auto;
  padding: 5px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2);
  box-shadow: var(--shadow-lg); animation: pop 0.14s var(--ease);
}
.popover .search-box { padding: 4px 4px 6px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-soft); font-size: 0.84rem; font-weight: 600; cursor: pointer; text-align: start;
}
.menu-item:hover, .menu-item.focus { background: var(--hover); color: var(--text); }
.menu-item .mi-check { margin-inline-start: auto; color: var(--brand); font-size: 0.75rem; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-title { padding: 6px 9px 4px; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); }

/* ------------------------------------------------------------------ command palette */

.palette {
  width: min(640px, 100%); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.18s var(--ease);
}
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-input i { color: var(--muted); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1rem; }
.palette-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.palette-item.focus { background: var(--accent-soft); }
.palette-item .pi-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 0.78rem; flex: 0 0 auto; }
.palette-item .pi-main { flex: 1; min-width: 0; }
.palette-item .pi-title { font-weight: 600; font-size: 0.88rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.palette-item .pi-sub { font-size: 0.74rem; color: var(--muted); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; }

/* ------------------------------------------------------------------ toasts */

.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 200; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); box-shadow: var(--shadow-lg);
  font-weight: 500; font-size: 0.86rem; animation: pop 0.22s var(--spring);
}
.toast i { color: var(--tc, var(--brand)); }
.toast.error { --tc: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all 0.2s; }
.toast .btn { margin-inline-start: auto; }

/* ------------------------------------------------------------------ notifications */

.notif-panel { width: min(400px, calc(100vw - 24px)); max-width: none; max-height: 70vh; padding: 0; display: flex; flex-direction: column; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.notif:hover { background: var(--hover); }
.notif.unread::before { content: ""; position: absolute; inset-inline-start: 5px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.notif .n-title { font-weight: 600; font-size: 0.84rem; }
.notif .n-body { color: var(--muted); font-size: 0.78rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif .n-time { color: var(--muted-2); font-size: 0.7rem; margin-top: 2px; }

/* ------------------------------------------------------------------ empty / skeleton */

.empty { display: grid; place-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .e-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 1.2rem; margin-bottom: 4px; }
.empty b { color: var(--text-soft); font-size: 0.95rem; }
.empty.compact { padding: 18px 12px; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--hover), transparent); animation: shimmer 1.3s infinite; }
.loading-page { display: grid; gap: 16px; }

/* ------------------------------------------------------------------ markdown */

.md { font-size: 0.9rem; line-height: 1.65; color: var(--text-soft); overflow-wrap: anywhere; }
.md p + p, .md ul, .md ol, .md pre, .md blockquote { margin-top: 8px; }
.md ul, .md ol { padding-inline-start: 22px; margin-bottom: 0; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--surface-3); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin-inline: 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--line-strong); color: var(--muted); }
.md h1, .md h2, .md h3 { font-size: 1rem; margin-top: 12px; color: var(--text); }
.md .mention { color: var(--accent); font-weight: 600; background: var(--accent-soft); padding: 0 4px; border-radius: 5px; }
.md .task-ref { font-family: var(--font-mono); font-size: 0.82em; }
.editable-md { border: 1px solid transparent; border-radius: 12px; padding: 8px 10px; margin-inline: -10px; cursor: text; min-height: 44px; }
.editable-md:hover { border-color: var(--line); background: var(--hover); }

/* ------------------------------------------------------------------ files */

.dropzone {
  display: grid; place-items: center; gap: 6px; padding: 18px; border: 1.5px dashed var(--line-strong); border-radius: 14px;
  color: var(--muted); text-align: center; cursor: pointer; transition: all 0.16s; font-size: 0.84rem;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone i { font-size: 1.2rem; }
.files { display: grid; gap: 6px; }
.file {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); min-width: 0;
}
.file .f-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: 0 0 auto; overflow: hidden; }
.file .f-icon img { width: 100%; height: 100%; object-fit: cover; }
.file .f-name { font-weight: 600; font-size: 0.84rem; }
.file .f-meta { font-size: 0.72rem; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.thumb { aspect-ratio: 4 / 3; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, 0.85); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fade 0.15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ------------------------------------------------------------------ calendar */

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-title h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
.cal-title h2 .yr { color: var(--muted); font-weight: 500; }
.cal-system { width: auto; max-width: 100%; }
.cal-nav { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); padding: 3px; gap: 2px; }
.cal-nav button { height: 30px; min-width: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font-weight: 600; font-size: 0.8rem; cursor: pointer; }
.cal-nav button:hover { background: var(--hover); color: var(--text); }

.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-panel);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
}
.cal-dow { padding: 10px 12px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-dow.weekend { color: var(--muted-2); }
.cal-day {
  position: relative; min-height: 124px; padding: 8px; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer; transition: background 0.14s;
}
.cal-day:nth-child(7n) { border-inline-end: 0; }
.cal-day:hover { background: var(--hover); }
.cal-day.weekend { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-day.past .cal-num { color: var(--muted); }
.cal-day.other { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--line) 45%, transparent) 7px 8px); }
.cal-day.other .cal-num { color: var(--muted-2); }
.cal-day.today { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent); }
.cal-day.today .cal-num { background: var(--brand); color: var(--brand-ink); }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.drop { background: var(--accent-soft); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; }
.cal-num { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-wd { display: none; font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.cal-load { display: flex; gap: 3px; justify-content: flex-end; }
.cal-load i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-event {
  display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 8px; font-size: 0.72rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-soft); cursor: pointer; border: 1px solid transparent;
  overflow: hidden; white-space: nowrap; min-width: 0; transition: border-color 0.12s, transform 0.12s, color 0.12s;
}
.cal-event::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ec); }
.cal-event:hover { border-color: color-mix(in srgb, var(--ec) 55%, transparent); color: var(--text); }
.cal-event.overdue { background: var(--danger-soft); color: var(--danger); }
.cal-event.milestone { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cal-event.milestone::before { border-radius: 2px; transform: rotate(45deg); background: var(--accent); }
.cal-event.done { opacity: 0.5; }
.cal-event.done .ce-title { text-decoration: line-through; }
.cal-event .ce-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-more { font-size: 0.7rem; font-weight: 600; color: var(--muted); padding-inline-start: 4px; }

.cal.week .cal-day { min-height: 440px; }
.cal.week .cal-event { white-space: normal; align-items: stretch; padding: 8px 9px; flex-direction: column; gap: 6px; border-inline-start: 3px solid var(--ec); }
.cal.week .cal-event::before { display: none; }
.cal.week .ce-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }

.agenda { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 14px; align-content: start; }
.agenda-day { display: flex; align-items: center; gap: 12px; }
.agenda-date {
  width: 54px; height: 58px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 2px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.agenda-date b { font-family: var(--font-display); font-size: 1.4rem; line-height: 1; }
.agenda-date span { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.agenda-date.today { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.agenda-list { display: grid; gap: 2px; }
.agenda-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-inline: -10px; border-radius: 10px; cursor: pointer; min-width: 0; }
.agenda-item:hover { background: var(--hover); }
.agenda-item .ai-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--ec); flex: 0 0 auto; }

/* ------------------------------------------------------------------ roadmap */

.roadmap { --rm-label: 260px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.rm-scroll { overflow-x: auto; position: relative; scroll-behavior: smooth; }
.rm-canvas { position: relative; }
.rm-head { display: flex; position: relative; z-index: 4; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.rm-corner {
  position: sticky; inset-inline-start: 0; z-index: 5; flex: 0 0 var(--rm-label); display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 16px 10px; background: var(--surface-2); border-inline-end: 1px solid var(--line);
}
.rm-scale { position: relative; height: 60px; flex: 0 0 auto; }
.rm-month { position: absolute; top: 0; height: 32px; padding: 9px 10px; font-size: 0.76rem; font-weight: 700; color: var(--text-soft); white-space: nowrap; border-inline-start: 1px solid var(--line); }
.rm-month small { color: var(--muted-2); font-weight: 600; margin-inline-start: 4px; }
.rm-tick { position: absolute; top: 32px; height: 28px; padding: 6px 0 0 5px; font-size: 0.66rem; font-weight: 600; color: var(--muted-2); border-inline-start: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rm-tick.weekend { color: color-mix(in srgb, var(--muted-2) 60%, transparent); }
.rm-row { display: flex; min-height: 80px; border-bottom: 1px solid var(--line); }
.rm-row:last-child { border-bottom: 0; }
.rm-label {
  position: sticky; inset-inline-start: 0; z-index: 3; flex: 0 0 var(--rm-label); display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-inline-end: 1px solid var(--line); min-width: 0; cursor: pointer; transition: background 0.12s;
}
.rm-label:hover { background: var(--surface-2); }
.rm-label .ring { width: 40px; height: 40px; }
.rm-label .ring::before { width: 32px; height: 32px; font-size: 0.62rem; }
.rm-track { position: relative; flex: 0 0 auto; }
.rm-overlay { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 0; }
.rm-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.rm-line.minor { background: color-mix(in srgb, var(--line) 45%, transparent); }
.rm-weekend { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.rm-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-inline-start: -1px; background: var(--danger); box-shadow: 0 0 14px color-mix(in srgb, var(--danger) 55%, transparent); }
.rm-today-pill { position: absolute; top: 34px; transform: translateX(-50%); z-index: 6; padding: 2px 8px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.rm-target { position: absolute; top: 0; bottom: 0; border-inline-start: 2px dashed var(--accent); opacity: 0.75; }
.rm-target-pill { position: absolute; top: 34px; transform: translateX(-50%); z-index: 6; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.rm-bar {
  position: absolute; top: 16px; height: 36px; border-radius: 10px; cursor: pointer; z-index: 1; min-width: 14px;
  background: color-mix(in srgb, var(--bc) 14%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--bc) 50%, transparent);
  display: flex; align-items: center; overflow: hidden; transition: transform 0.16s var(--ease), box-shadow 0.16s;
}
.rm-bar:hover { box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--bc) 80%, transparent); }
.rm-bar.inferred { border-style: dashed; }
.rm-bar .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: color-mix(in srgb, var(--bc) 42%, transparent); }
.rm-bar .rm-text { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; color: var(--text); }
.rm-bar .rm-text em, .rm-outside em { font-style: normal; color: var(--text-soft); font-weight: 600; }
.rm-outside { position: absolute; top: 25px; z-index: 1; font-size: 0.76rem; font-weight: 700; white-space: nowrap; color: var(--text); pointer-events: none; }
.rm-outside em { margin-inline-start: 6px; color: var(--muted); }
.rm-diamond { position: absolute; top: 26px; width: 16px; height: 16px; margin-inline-start: -8px; transform: rotate(45deg); border-radius: 4px; background: var(--bc); border: 3px solid var(--surface); z-index: 2; }
.rm-dot { position: absolute; top: 60px; width: 10px; height: 10px; margin-inline-start: -5px; border-radius: 50%; background: var(--dc); border: 2px solid var(--surface); z-index: 2; cursor: pointer; transition: transform 0.12s; }
.rm-dot:hover { transform: scale(1.5); }
.rm-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.rm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rm-legend i.sq { border-radius: 3px; transform: rotate(45deg); width: 9px; height: 9px; }
.rm-legend i.dash { width: 18px; height: 10px; border-radius: 4px; background: transparent; border: 1.5px dashed var(--muted); }

.ms-card { gap: 12px; }
.ms-head { display: flex; align-items: center; gap: 8px; }
.ms-body { display: flex; align-items: center; gap: 14px; }
.ms-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.ms-split span { height: 100%; }
.ms-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--muted); }
.ms-stats { display: flex; gap: 12px; font-size: 0.74rem; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.ms-stats b { color: var(--text); }

/* ------------------------------------------------------------------ collapsed sidebar (desktop) */

.sidebar-brand .brand-mark { display: none; width: 36px; height: 36px; border-radius: 10px; }
@media (min-width: 901px) {
  .shell { transition: grid-template-columns 0.24s var(--ease); }
  body.sidebar-collapsed { --sidebar-w: 76px; }
  body.sidebar-collapsed .sidebar { padding-inline: 10px; }
  body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
  body.sidebar-collapsed .sidebar-brand img:not(.brand-mark), body.sidebar-collapsed .pm-tag { display: none !important; }
  body.sidebar-collapsed .sidebar-brand .brand-mark { display: block !important; }
  body.sidebar-collapsed .nav-section { font-size: 0; padding: 10px 0 6px; }
  body.sidebar-collapsed .nav-section::after { content: ""; display: block; height: 1px; margin: 0 12px; background: var(--line); }
  body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px 0; }
  body.sidebar-collapsed .nav-item span:not(.count) { display: none; }
  body.sidebar-collapsed .nav-item i { width: auto; font-size: 1rem; }
  body.sidebar-collapsed .nav-item .count { position: absolute; top: 2px; inset-inline-end: 4px; min-width: 16px; height: 16px; font-size: 0.58rem; padding: 0 4px; }
  body.sidebar-collapsed .nav-item.active::before { inset-inline-start: 0; }
  body.sidebar-collapsed .user-card { justify-content: center; }
  body.sidebar-collapsed .user-card > :not(.avatar) { display: none; }
}

/* ------------------------------------------------------------------ cards: ideas, people, reports */

.card {
  position: relative; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); min-width: 0; transition: border-color 0.16s, transform 0.16s var(--ease), box-shadow 0.16s;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card h4 { font-size: 0.98rem; }

.vote {
  display: grid; place-items: center; gap: 0; width: 46px; padding: 6px 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; flex: 0 0 auto; font-weight: 700; transition: all 0.16s var(--ease);
}
.vote i { font-size: 0.8rem; color: var(--muted); }
.vote:hover { border-color: var(--line-strong); }
.vote.on { border-color: color-mix(in srgb, var(--brand) 50%, transparent); background: var(--brand-soft); color: var(--brand); }
.vote.on i { color: var(--brand); }
.vote:active { transform: scale(0.93); }

.person-card { text-align: center; justify-items: center; }
.person-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.person-stats div { padding: 8px 4px; border-radius: 10px; background: var(--surface-2); }
.person-stats b { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.person-stats span { font-size: 0.68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { position: relative; padding: 10px 12px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; inset-inline: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tab .count { margin-inline-start: 6px; font-size: 0.7rem; color: var(--muted); background: var(--chip); padding: 1px 6px; border-radius: 999px; }

.announce {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card);
  border: 1px solid color-mix(in srgb, var(--tc) 30%, var(--line)); background: var(--surface);
  --tc: var(--info);
}
.announce.success { --tc: var(--brand); }
.announce.warning { --tc: var(--warn); }
.announce.danger { --tc: var(--danger); }
.announce .a-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--tc); flex: 0 0 auto; }

.greeting h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.greeting .wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.2s ease 0.4s 1; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

.health-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 70px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.health-row:first-child { border-top: 0; }
.health-row:hover { background: var(--hover); }

/* ------------------------------------------------------------------ charts */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--viz-grid); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font-sans); font-weight: 600; }
.chart .value-text { fill: var(--text-soft); font-size: 11px; font-weight: 700; font-family: var(--font-sans); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hover-line { stroke: var(--line-strong); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.76rem; color: var(--text-soft); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.viz-tip {
  position: absolute; pointer-events: none; z-index: 5; padding: 8px 10px; border-radius: 10px; min-width: 120px;
  background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); font-size: 0.76rem;
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
}
.viz-tip .t-title { font-weight: 700; margin-bottom: 4px; color: var(--text); }
.viz-tip .t-row { display: flex; align-items: center; gap: 8px; color: var(--text-soft); }
.viz-tip .t-row i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.viz-tip .t-row b { margin-inline-start: auto; color: var(--text); }
.hbar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 5px 0; font-size: 0.8rem; }
.hbar-row .hb-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.hbar-row .hb-val { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-track { height: 12px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: flex; gap: 2px; }
.hbar-track span { height: 100%; background: var(--c); border-radius: 0 4px 4px 0; }

/* ------------------------------------------------------------------ login */

.login {
  position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
}
.login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 50px; padding: clamp(32px, 4vw, 64px);
  border-inline-end: 1px solid var(--line);
  background: var(--bg-soft);
}
.login-art img { height: 44px; width: auto; align-self: flex-start; }
.login-art h1 { font-size: clamp(2.4rem, 4vw, 3.8rem); max-width: 16ch; letter-spacing: -0.055em; line-height: 1.12; }
.login-art h1 em { font-style: normal; color: var(--brand); }
.login-art p { color: var(--muted); max-width: 46ch; margin-top: 20px; font-size: 0.9rem; line-height: 1.8; }
.login-feats { display: flex; flex-wrap: wrap; gap: 8px; }
.login-feats .chip { height: 28px; padding: 0 12px; font-size: 0.76rem; }
.login-board { margin-top: 32px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); padding: 18px; box-shadow: var(--shadow-md); transform: rotate(-2deg); }
.login-board-title { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; padding-bottom: 18px; }
.login-board-title > i { color: var(--brand); }
.login-board-title > span { margin-inline-start: auto; color: var(--muted); font-size: 0.58rem; font-weight: 500; }
.mock-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mock-col { display: grid; gap: 8px; align-content: start; }
.mock-col-title { display: flex; align-items: center; gap: 5px; font-size: 0.62rem; color: var(--text-soft); padding-bottom: 3px; }
.mock-col-title > b { margin-inline-start: auto; color: var(--muted); font-weight: 500; }
.mock-col-title > i { font-size: 0.5rem; }
.mock-card { border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); padding: 11px; display: grid; gap: 10px; animation: enter 0.6s var(--ease) both; }
.mock-card > b { font-size: 0.66rem; line-height: 1.6; font-weight: 600; }
.mock-card-label { color: var(--accent); font-size: 0.5rem; padding: 2px 5px; border-radius: 4px; background: var(--accent-soft); justify-self: start; }
.mock-due { font-size: 0.5rem; color: var(--muted); }
.mock-avatar { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-size: 0.38rem; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 24px; }
.login-form { width: min(380px, 100%); display: grid; gap: 22px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand img { flex-shrink: 0; border-radius: 14px; }
.login-brand .kicker { color: var(--brand); margin: 0; }
.login-heading { margin-block: 8px 12px; }
.login-form h2 { font-size: 2rem; letter-spacing: -0.045em; }
.login-heading p { font-size: 0.8rem; margin-top: 10px; line-height: 1.8; }
.login-form .input { min-height: 46px; background-color: var(--surface); }
.login-form > .btn { min-height: 46px; margin-top: 4px; }
.password-field { position: relative; }
.password-field .input { padding-inline-end: 46px; }
.password-field .icon-btn { position: absolute; inset-inline-end: 6px; top: 6px; color: var(--muted); }
.login-help { display: flex; align-items: flex-start; justify-content: center; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.73rem; line-height: 1.8; }
.login-help > i { margin-top: 4px; }
.login-help span { color: var(--muted-2); }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .agenda { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --topbar-h: 56px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: min(290px, 86vw);
    transform: translateX(-105%); transition: transform 0.26s var(--ease); background: var(--surface);
  }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); }
  /* The tab bar's "More" opens the same menu, so one button is enough. */
  .menu-toggle { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .topbar .new-btn span { display: none; }
  .topbar .new-btn { width: 36px; padding: 0; }
  .content { padding: 16px 16px 92px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer-grid .props { order: -1; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
  .drawer-body { padding: 14px 16px 40px; }
  .drawer-head { padding: 10px 12px; gap: 6px; }
  .drawer-head .btn span { display: none; }
  .drawer-head .btn { padding: 0 10px; }
  .board { scroll-snap-type: x mandatory; }
  .column { flex: 0 0 82vw; max-width: none; scroll-snap-align: start; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .search .input { width: 100%; }
  #task-summary .summary-bar { display: none; }
  .column { scroll-snap-align: start; max-height: none; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .filters .search .input { min-width: 0; width: 100%; }
  .filters .search { flex: 1 1 100%; }
  .mobile-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 6px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--glass); backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
  }
  .mobile-tabbar button {
    display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; border-radius: 12px; background: transparent;
    color: var(--muted); font-size: 0.64rem; font-weight: 700; cursor: pointer;
  }
  .mobile-tabbar button i { font-size: 1rem; }
  .mobile-tabbar button.active { color: var(--brand); background: var(--brand-soft); }
  .toasts { inset-inline: 12px; bottom: 84px; }
  .toast { min-width: 0; max-width: none; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal:not(.week) .cal-event, .cal:not(.week) .cal-more { display: none; }
  .cal-num { min-width: 22px; height: 22px; font-size: 0.7rem; }
  .cal-dow { padding: 8px 4px; text-align: center; font-size: 0.6rem; }
  .cal.week { grid-template-columns: minmax(0, 1fr); }
  .cal.week .cal-dow { display: none; }
  .cal.week .cal-day { min-height: 0; border-inline-end: 0; }
  .cal.week .cal-wd { display: inline; }
  .cal:not(.week) .cal-day-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cal:not(.week) .cal-load { padding-inline-start: 4px; }
  .cal-load i { width: 5px; height: 5px; }
  .roadmap { --rm-label: 150px !important; }
  .hbar-row { grid-template-columns: 84px minmax(0, 1fr) 36px; }
  .health-row { grid-template-columns: minmax(0, 1fr) 70px 46px; }
  .table .t-title { max-width: 220px; }
}

@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .k-value { font-size: 1.5rem; }
  .page-head { align-items: flex-start; }
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .topbar-title .crumb { gap: 0; }
  .topbar-title .crumb > i, .project-switch .project-name, .project-switch .project-caret { display: none; }
  .project-switch .mobile-project-icon { display: inline; }
  .project-switch { min-width: 30px; min-height: 40px; justify-content: center; }
  .topbar .icon-btn { width: 36px; height: 40px; }
}

/* ------------------------------------------------------------------ tooltip */

.tooltip {
  position: fixed; z-index: 400; pointer-events: none; padding: 5px 9px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-size: 0.74rem; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-md); animation: fade 0.12s var(--ease);
}
.tooltip kbd { margin-inline-start: 6px; height: 17px; min-width: 17px; font-size: 0.66rem; background: transparent; color: inherit; border-color: color-mix(in srgb, var(--bg) 40%, transparent); opacity: 0.75; }

/* ------------------------------------------------------------------ page identity
 * Each page gets an accent and an icon tile next to its title (set by the shell on .page-host),
 * mirroring Charlotte's per-section hero. The active nav item shares the same accent.
 */

.page-host[data-glyph] .page-head > div:first-child,
.page-host[data-glyph] .cal-title {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: center;
}
.page-host[data-glyph] .page-head > div:first-child > *,
.page-host[data-glyph] .cal-title > * { grid-column: 2; }
.page-host[data-glyph] .page-head > div:first-child::before,
.page-host[data-glyph] .cal-title::before {
  content: var(--page-glyph); grid-column: 1; grid-row: 1 / span 3; align-self: center;
  width: 30px; height: 30px; display: grid; place-items: center;
  font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 1.35rem; color: var(--page-accent);
}
.nav-item.active i { color: var(--brand); }
.nav-item.active::before { background: var(--brand); }

/* Home keeps its original compact dashboard layout. */
.page-host[data-page="home"] { --r-panel: 12px; --r-card: 10px; --r-control: 8px; }
.page-host[data-page="home"] .page { gap: 20px; }
.page-host[data-page="home"] .grid { gap: 16px; }
.page-host[data-page="home"] .grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
.page-host[data-page="home"] .panel { box-shadow: none; }
.page-host[data-page="home"] .panel-head { min-height: 48px; padding: 8px 12px 8px 16px; }
.page-host[data-page="home"] .panel-body { padding: 16px; }
.page-host[data-page="home"] .panel-body.flush { padding: 4px 0; }
.page-host[data-page="home"] .kpi { gap: 6px; padding: 16px; box-shadow: none; }
.page-host[data-page="home"] .kpi .k-value { font-size: 1.75rem; letter-spacing: -0.03em; }
.page-host[data-page="home"] .btn:not(.sm):not(.xs) { min-height: 34px; padding-inline: 12px; }
.page-host[data-page="home"] .page-actions > .btn:not(.primary) { background: var(--surface-2); }
.page-host[data-page="home"] .btn.primary { background: var(--brand); }
.page-host[data-page="home"] .btn:hover:not(:disabled) { background: var(--surface-4); }
.page-host[data-page="home"] .btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 90%, var(--text)); }
@media (max-width: 1180px) {
  .page-host[data-page="home"] .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .page-host[data-page="home"] .kpi .k-value { font-size: 1.5rem; }
}

/* ------------------------------------------------------------------ team space */

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }

/* Home hero: greeting on the left, one-tap check-in on the right. */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 28px; align-items: center;
  padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--r-panel);
  background:
    radial-gradient(520px 220px at 0% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
    radial-gradient(420px 220px at 100% 100%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.hero-main { display: grid; gap: 8px; min-width: 0; }
.hero-main p { color: var(--muted); font-size: 0.9rem; }
.hero-main .page-actions { margin-top: 8px; }
.hero-chips { margin-top: 4px; }
.hero-chips .chip { text-decoration: none; }
.chip-btn { cursor: pointer; font: inherit; font-size: 0.72rem; }
.chip-btn:hover, .hero-chips a.chip:hover { border-color: var(--line-strong); color: var(--text); }
.hero-checkin {
  display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 75%, transparent); backdrop-filter: blur(6px); min-width: 0;
}
.hero-checkin .ci-q { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.ci-done { display: grid; gap: 8px; }
.ci-plan-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.streak {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); white-space: nowrap;
}

/* Mood picker */
.mood-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mp {
  display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--input-bg); cursor: pointer; transition: transform 0.18s var(--spring), border-color 0.14s, background 0.14s;
}
.mp span { font-size: 1.45rem; line-height: 1.1; filter: grayscale(0.35); transition: filter 0.14s, transform 0.18s var(--spring); }
.mp small { font-size: 0.66rem; font-weight: 600; color: var(--muted); }
.mp:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.mp:hover span { filter: none; transform: scale(1.1); }
.mp.on { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: var(--brand-soft); }
.mp.on span { filter: none; transform: scale(1.12); }
.mp.on small { color: var(--brand); }
.checkin-editor { display: grid; gap: 10px; }
.ci-fields textarea { min-height: 60px; }
.ci-hint { text-align: center; }
.mood-face { font-size: 1.25rem; line-height: 1; }
.mood-face.lg { font-size: 2rem; }

/* Team-space check-in cards */
.checkin-hero { background: radial-gradient(420px 160px at 100% 0%, color-mix(in srgb, var(--warn) 8%, transparent), transparent 70%), var(--surface); }
.checkins { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.checkin {
  display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface-2); min-width: 0;
}
.checkin.has-blocker { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.ci-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ci-head b { font-size: 0.88rem; }
.ci-plan { color: var(--text-soft); }
.ci-plan p { margin: 0; }
.ci-blocker, .ci-win { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; font-size: 0.8rem; }
.ci-blocker { background: var(--danger-soft); color: var(--danger); }
.ci-blocker i { margin-top: 3px; }
.ci-win { background: var(--success-soft); color: var(--text-soft); }
.waiting { gap: 6px; }

/* Reactions: the add button stays quiet until the item is hovered, or there are reactions already. */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.rx {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--chip); font-size: 0.78rem; transition: transform 0.16s var(--spring), border-color 0.14s, background 0.14s, opacity 0.14s;
}
.rx span { font-size: 0.9rem; line-height: 1; }
.rx b { font-size: 0.72rem; color: var(--muted); }
.rx:hover { border-color: var(--line-strong); }
.rx:active { transform: scale(0.9); }
.rx.on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.rx.on b { color: var(--accent); }
.rx.add { color: var(--muted); gap: 2px; opacity: 0; padding: 0 7px; }
.rx.add .fa-plus { font-size: 0.5rem; margin-top: -8px; }
.reactions:has(.rx:not(.add)) .rx.add { opacity: 0.7; }
.comment:hover .rx.add, .kudos:hover .rx.add, .checkin:hover .rx.add, .rx.add:focus-visible { opacity: 1; }
@media (hover: none) { .rx.add { opacity: 0.75; } }
.comment .reactions { margin-top: 6px; }
.emoji-pop { display: flex; gap: 2px; padding: 6px; }
.emoji-pop.wide { display: grid; grid-template-columns: repeat(8, 1fr); width: auto; }
.emoji-btn { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 1.15rem; transition: transform 0.16s var(--spring), background 0.12s; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--hover); transform: scale(1.18); }

/* Kudos */
.kudos {
  --kc: var(--love); position: relative; display: grid; gap: 10px; align-content: start; padding: 14px 16px; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--kc) 28%, var(--line)); border-radius: var(--r-card);
  background: linear-gradient(150deg, color-mix(in srgb, var(--kc) 11%, var(--surface)), var(--surface) 60%);
}
.kudos.compact { padding: 12px 14px; gap: 8px; }
.k-top { display: flex; align-items: center; gap: 8px; }
.k-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 4px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  color: color-mix(in srgb, var(--kc) 75%, var(--text)); background: color-mix(in srgb, var(--kc) 16%, transparent);
}
.k-emoji { width: 20px; height: 20px; display: grid; place-items: center; font-size: 0.9rem; }
.k-people { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.k-msg { font-size: 0.88rem; color: var(--text-soft); }
.k-msg p { margin: 0; }
.k-task { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.k-del { opacity: 0; transition: opacity 0.14s; }
.kudos:hover .k-del, .k-del:focus-visible { opacity: 1; }
.k-thank { justify-self: start; }
.kudos-wall { columns: 2 280px; column-gap: 12px; }
.kudos-wall > .kudos { break-inside: avoid; margin-bottom: 12px; }
.kudos-panel .panel-head h3 span { font-size: 1rem; }

.people-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pp {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--input-bg); font-size: 0.82rem; font-weight: 600; transition: border-color 0.14s, background 0.14s;
}
.pp:hover { border-color: var(--line-strong); }
.pp.on { border-color: color-mix(in srgb, var(--love) 55%, transparent); background: var(--love-soft); }
.pp .fa-check { color: var(--love); font-size: 0.72rem; }
.badge-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.bp {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 11px; cursor: pointer; text-align: start;
  border: 1px solid var(--line); background: var(--input-bg); font-size: 0.82rem; font-weight: 600; transition: border-color 0.14s, background 0.14s, transform 0.16s var(--spring);
}
.bp span { font-size: 1.1rem; }
.bp:hover { border-color: color-mix(in srgb, var(--kc) 40%, var(--line)); }
.bp.on { border-color: color-mix(in srgb, var(--kc) 60%, transparent); background: color-mix(in srgb, var(--kc) 14%, transparent); color: color-mix(in srgb, var(--kc) 70%, var(--text)); transform: translateY(-1px); }

/* Team mood, week tiles, shipped list */
.mood-summary { display: flex; align-items: center; gap: 14px; }
.mood-big { font-size: 2.6rem; line-height: 1; }
.muted-emoji { opacity: 0.6; }
.mood-avg { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -0.03em; }
.mood-bars { display: grid; gap: 6px; }
.mb-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; align-items: center; gap: 8px; }
.mb-row b { color: var(--muted); text-align: end; }
.spark { width: 100%; height: 56px; display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--accent-soft); }
.spark-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.week-tiles { display: grid; gap: 6px; }
.wt { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--wc) 7%, var(--surface-2)); }
.wt i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--wc); background: color-mix(in srgb, var(--wc) 14%, transparent); font-size: 0.78rem; }
.wt span { flex: 1; font-size: 0.82rem; color: var(--text-soft); font-weight: 600; }
.wt b { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.03em; }
.wt.zero { background: var(--surface-2); }
.wt.zero b { color: var(--muted-2); }
.list-item.shipped { cursor: pointer; }
.ship-check { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 0.6rem; background: var(--success-soft); color: var(--success); }
.cheer { white-space: nowrap; }
.list-item:hover .cheer, .cheer:focus-visible { opacity: 1; }
.around { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: inherit; text-decoration: none; min-width: 0; }
.around:hover { text-decoration: none; }
.around:hover b { color: var(--text); text-decoration: underline; }

/* Status */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: var(--chip); color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.status-pill span { overflow: hidden; text-overflow: ellipsis; }
.avatar { position: relative; }
.av-status {
  position: absolute; inset-inline-end: -5px; bottom: -4px; width: 46%; height: 46%; min-width: 15px; min-height: 15px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 1.5px var(--surface); font-size: 0.58rem; line-height: 1;
}
.avatar.xl .av-status { font-size: 0.95rem; }
.avatar.lg .av-status { font-size: 0.7rem; }
.avatar.anon { --ac: var(--muted); }
.status-input { display: flex; gap: 8px; }
.status-emoji { flex: 0 0 auto; width: 44px; border-radius: var(--r-control); border: 1px solid var(--line); background: var(--input-bg); font-size: 1.2rem; cursor: pointer; }
.status-emoji:hover { border-color: var(--line-strong); }
.preset { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: start; font-size: 0.86rem; }
.preset:hover, .preset:focus-visible { background: var(--hover); }
.preset .pe { font-size: 1.05rem; width: 22px; text-align: center; }

.nav-item { position: relative; }
.nav-dot { margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
body.sidebar-collapsed .nav-dot { position: absolute; top: 8px; inset-inline-end: 10px; }

.anon-switch { align-items: flex-start; }
.anon-switch .track { margin-top: 2px; flex: 0 0 auto; }
.anon-switch > span:last-child { display: grid; gap: 2px; font-weight: 600; }
.anon-switch .hint { font-weight: 500; font-size: 0.74rem; color: var(--muted); }

.accent-pick { gap: 6px; flex-wrap: wrap; }
.accent-swatch {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--input-bg); font-size: 0.8rem; font-weight: 600;
}
.accent-swatch span { width: 16px; height: 16px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.accent-swatch.on { border-color: var(--sw); background: color-mix(in srgb, var(--sw) 14%, transparent); }

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .hero { padding: 20px 16px; gap: 18px; }
  .mp small { display: none; }
  .mp span { font-size: 1.35rem; }
  .kudos-wall { columns: 1; }
  .checkins { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ page-by-page redesign */

/* Each page's colour carries into its panel icons and empty states, so pages feel distinct but related. */
.page-host[data-glyph] .panel-head h3 > i:first-child { color: var(--page-accent); }
.empty .e-icon {
  color: var(--page-accent, var(--muted));
  background: transparent;
  border: 0;
}
.empty span.small { max-width: 44ch; }
.card.clickable:hover { transform: translateY(-2px); }
.panel { transition: border-color 0.16s; }
.btn.primary { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent); }

/* Tasks: quieter empty columns and a coloured top edge per status. */
.column { border-top: 2px solid color-mix(in srgb, var(--sc) 55%, var(--line)); }
.col-add.empty { min-height: 64px; flex-direction: row; gap: 8px; }
.col-add.empty > i { margin-bottom: 0; width: 24px; height: 24px; }
.col-add.empty span { display: none; }

/* Ideas */
.idea-stat { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.idea-stat > span { font-size: 1.5rem; }
.idea-stat b { display: block; font-family: var(--font-display); font-size: 1.3rem; line-height: 1; }
.pitch {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-panel); border: 1px solid var(--line);
  background: radial-gradient(520px 160px at 0% 0%, color-mix(in srgb, var(--warn) 9%, transparent), transparent 70%), var(--surface);
  box-shadow: var(--shadow-sm); transition: border-color 0.16s, box-shadow 0.16s;
}
.pitch:focus-within { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); box-shadow: 0 0 0 4px var(--warn-soft); }
.pitch.is-anon { background: radial-gradient(520px 160px at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--surface); }
.pitch > .avatar { margin-top: 4px; width: 34px; height: 34px; }
.pitch-main { flex: 1; min-width: 0; display: grid; gap: 10px; }
.pitch-input {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); padding: 6px 0;
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em;
}
.pitch-input::placeholder { color: var(--muted-2); }
.pitch-opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pills { gap: 4px; }
.pill {
  height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 0.74rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.14s;
}
.pill:hover { color: var(--text); border-color: var(--line-strong); }
.pill.on { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.pill.anon.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }

.vote { gap: 1px; width: 48px; padding: 7px 0 6px; }
.vote b { font-size: 0.92rem; line-height: 1; }
.vote:hover:not(.on) { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--brand); }
.vote:hover:not(.on) i { color: var(--brand); transform: translateY(-1px); }
.vote i { transition: transform 0.16s var(--spring); }
.vote.big { width: 64px; padding: 12px 0 10px; border-radius: 16px; }
.vote.big i { font-size: 1.1rem; }
.vote.big b { font-size: 1.25rem; font-family: var(--font-display); }

.spotlight {
  position: relative; display: grid; gap: 12px; padding: 20px 22px; border-radius: var(--r-panel); cursor: pointer; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 12%, var(--surface)), var(--surface) 55%, color-mix(in srgb, var(--accent) 7%, var(--surface)));
  transition: transform 0.16s var(--ease), box-shadow 0.16s;
}
.spotlight:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sp-label { display: inline-flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); }
.sp-body { display: flex; gap: 18px; align-items: flex-start; }
.spotlight h3 { font-size: 1.35rem; letter-spacing: -0.025em; }
.spotlight .idea-body { margin-top: 6px; }

.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.idea {
  display: flex; gap: 14px; padding: 16px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; min-width: 0; transition: border-color 0.16s, transform 0.16s var(--ease), box-shadow 0.16s;
}
.idea:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.idea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.idea.implemented { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 60%); }
.idea.rejected { opacity: 0.7; }
.idea-main { flex: 1; min-width: 0; display: grid; gap: 8px; align-content: start; }
.idea-main h4 { font-size: 0.98rem; line-height: 1.35; overflow-wrap: anywhere; }
.idea-body { color: var(--muted); font-size: 0.84rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea-tags { gap: 5px; }
.idea-foot { display: flex; align-items: center; gap: 10px; padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line); }

/* Bugs */
.sev-strip { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--surface); }
.sev-bar { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; }
.sev-bar span { min-width: 8px; border-radius: 3px; }
.sev-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.sev-pill {
  --sv: var(--muted); display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--sv) 30%, var(--line)); background: color-mix(in srgb, var(--sv) 8%, transparent); color: var(--text-soft);
  font-size: 0.8rem; font-weight: 600; transition: all 0.14s;
}
.sev-pill i { color: var(--sv); }
.sev-pill b { font-family: var(--font-display); color: var(--sv); }
.sev-pill.zero { opacity: 0.55; }
.sev-pill.on { background: color-mix(in srgb, var(--sv) 18%, transparent); border-color: var(--sv); color: var(--text); }
.sev-critical { --sv: var(--danger); }
.sev-high { --sv: var(--warn); }
.sev-medium { --sv: var(--info); }
.sev-low { --sv: var(--muted); }
.sev-bar .sev-critical { background: var(--danger); }
.sev-bar .sev-high { background: var(--warn); }
.sev-bar .sev-medium { background: var(--info); }
.sev-bar .sev-low { background: var(--muted-2); }
.bugs-clear { margin: 0; padding: 18px 20px; }
.bc-emoji { font-size: 1.8rem; }
.bug-row td:first-child { box-shadow: inset 3px 0 0 var(--sv); }
.bug-row.resolved td:first-child { box-shadow: inset 3px 0 0 var(--line); }
.bug-row.resolved .t-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* Reports */
.rhythm-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rhythm-person {
  display: grid; justify-items: center; gap: 4px; padding: 14px 8px 12px; border-radius: 14px; color: inherit; text-decoration: none; text-align: center;
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.14s, transform 0.16s var(--ease);
}
.rhythm-person:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-2px); }
.rhythm-person.shared { border-color: color-mix(in srgb, var(--success) 30%, var(--line)); background: color-mix(in srgb, var(--success) 6%, var(--surface-2)); }
.rp-av { position: relative; margin-bottom: 4px; }
.rp-av .avatar { width: 40px; height: 40px; font-size: 0.85rem; }
.rhythm-person:not(.shared) .rp-av .avatar { filter: saturate(0.4); opacity: 0.75; }
.rp-check { position: absolute; inset-inline-end: -4px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: var(--brand-ink); font-size: 0.55rem; box-shadow: 0 0 0 2px var(--surface-2); }
.rp-name { font-weight: 700; font-size: 0.84rem; }
.rp-meta { font-size: 0.7rem; color: var(--muted); }

.report-list { display: grid; gap: 10px; }
.report-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; cursor: pointer;
  border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); transition: border-color 0.16s, transform 0.16s var(--ease), box-shadow 0.16s;
}
.report-row:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.report-row:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.report-row.st-pending { border-inline-start: 3px solid var(--accent); }
.report-row.st-changes { border-inline-start: 3px solid var(--warn); }
.rr-kind { --kc: var(--accent); width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); }
.rr-kind.k-daily { --kc: var(--warn); }
.rr-kind.k-weekly { --kc: var(--info); }
.rr-kind.k-deliverable { --kc: var(--success); }
.rr-main { display: grid; gap: 5px; min-width: 0; }
.rr-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rr-title b { font-size: 0.94rem; }
.rr-body { color: var(--text-soft); font-size: 0.84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rr-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: var(--warn-soft); color: var(--text-soft); font-size: 0.8rem; }
.rr-note i { color: var(--warn); margin-top: 3px; }
.rr-side { display: grid; gap: 8px; justify-items: end; min-width: 110px; }
.rr-progress { display: grid; grid-template-columns: auto 80px; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 700; color: var(--text-soft); }
.rr-facts { display: flex; gap: 10px; color: var(--muted); font-size: 0.76rem; }
.rr-facts span { display: inline-flex; align-items: center; gap: 4px; }

/* Activity timeline */
.timeline { display: grid; gap: 22px; }
.tl-label { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tl-label span { padding: 1px 7px; border-radius: 999px; background: var(--chip); letter-spacing: 0; }
.tl-list { list-style: none; margin: 0; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); position: relative; }
.tl-list::before { content: ""; position: absolute; top: 18px; bottom: 18px; inset-inline-start: 31px; width: 2px; border-radius: 2px; background: var(--line); }
.tl-item { --tc: var(--muted); position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 9px 16px; }
.tl-item.linked { cursor: pointer; }
.tl-item.linked:hover { background: var(--hover); }
.tl-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tl-dot { position: relative; z-index: 1; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, var(--surface)); box-shadow: 0 0 0 4px var(--surface); }
.tl-item.linked:hover .tl-dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--surface) 92%, var(--text)); }
.tl-body { flex: 1; min-width: 0; padding-top: 4px; }
.tl-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; }
.tl-target { color: var(--text-soft); font-weight: 600; }
.tl-detail { margin-top: 3px; font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.tl-item time, .tl-item .project-icon { margin-top: 7px; }
.tl-item.tone-good { --tc: var(--success); }
.tl-item.tone-bad { --tc: var(--danger); }
.tl-item.tone-love { --tc: var(--love); background: color-mix(in srgb, var(--love) 5%, transparent); }
.tl-item.tone-idea { --tc: var(--warn); }
.tl-item.tone-talk { --tc: var(--info); }
.tl-item.tone-plain { --tc: var(--accent); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.profile-preview { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 10px; }
.pp-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pp-card { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 6px; padding: 0 20px 20px; text-align: center; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md); }
.pp-banner { width: calc(100% + 40px); height: 72px; margin-bottom: -34px; background: linear-gradient(120deg, color-mix(in srgb, var(--ac) 45%, var(--surface)), color-mix(in srgb, var(--ac) 12%, var(--surface))); }
.pp-card .avatar.xl { box-shadow: 0 0 0 4px var(--surface); }
.pp-card h3 { margin-top: 6px; font-size: 1.2rem; }
.pp-hint { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); width: 100%; }
.swatches { gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--sw); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: transform 0.16s var(--spring), box-shadow 0.14s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }

@media (max-width: 1180px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-preview { position: static; order: -1; max-width: 420px; }
}
@media (max-width: 720px) {
  .report-row { grid-template-columns: auto minmax(0, 1fr); }
  .rr-side { grid-column: 2; justify-items: start; }
  .idea-grid { grid-template-columns: minmax(0, 1fr); }
  .sp-body { gap: 12px; }
  .pitch { padding: 14px; gap: 10px; }
  .pitch > .avatar { display: none; }
  .pitch-opts .btn.ghost { display: none; }
}

/* Fixes from the visual pass. */
.form-grid { align-items: start; }
.all-clear .bc-emoji { font-size: 1.8rem; color: inherit; line-height: 1; }
.column-body .col-add.empty { display: flex; padding: 0 10px; min-height: 56px; flex-direction: row; justify-content: center; gap: 8px; }
.tcard.closed { padding-block: 10px; gap: 6px; }
.tcard.closed .tc-tags { display: none; }
.tcard.closed .tc-foot { padding-top: 6px; min-height: 28px; }
.tcard.closed .tc-title { font-weight: 600; -webkit-line-clamp: 2; }
.idea > .vote { align-self: flex-start; }
.idea-foot > .row:first-child { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; min-width: 0; }
.idea-foot > .small:last-child { white-space: nowrap; }
.rr-main .li-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 0.76rem; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; white-space: nowrap; }
.idea-main, .rr-main, .tl-body { grid-template-columns: minmax(0, 1fr); }
.idea-foot > .row:first-child > span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .rhythm-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 108px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
}
.hint-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; }
.hint-line i { color: var(--info); }
/* Side-by-side panels that should match heights (e.g. Insights charts). */
.grid-main.equal { align-items: stretch; }
.grid-main.equal > .panel { display: flex; flex-direction: column; }
.grid-main.equal > .panel > .panel-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.grid-main.equal > .panel > .panel-body.spread { justify-content: space-between; gap: 20px; }
.flow-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.fs { --ft: var(--text); display: grid; gap: 3px; align-content: start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.fs-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fs b { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.03em; color: var(--ft); }
.fs b i { font-size: 0.85rem; }
.fs b small { font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.fs-hint { font-size: 0.72rem; color: var(--muted); }
.fs .bar { margin-top: 4px; }

/* Phones: the task toolbar becomes an even two-column grid instead of ragged wrapping. */
@media (max-width: 600px) {
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
  .toolbar > .search, .toolbar > .switch { grid-column: 1 / -1; }
  .toolbar > .grow { display: none; }
  .toolbar > .fbtn, .toolbar > .btn { width: 100%; min-width: 0; height: 38px; justify-content: flex-start; }
  .toolbar .fbtn .fb-caret { margin-inline-start: auto; }
  .toolbar .fbtn .fb-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .toolbar > .switch { padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  /* An odd button out stretches across instead of leaving a hole. */
  .toolbar > button:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ app-level polish */

/* Installed (home-screen) mode on notched phones: keep the top bar clear of the status bar. */
.topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }

.mobile-tabbar button { position: relative; }
.tab-dot { position: absolute; top: 5px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.tab-dot.danger { background: var(--danger); }

/* Up for grabs */
.grabs .list-item { cursor: pointer; }
.take { flex: 0 0 auto; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--brand); background: var(--brand-soft); }
.take:hover:not(:disabled) { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
@media (max-width: 520px) { .grabs .due { display: none; } }

/* What's new tour */
.modal.whatsnew { width: min(460px, 100%); }
.modal.whatsnew .modal-head h3 { font-size: 0.72rem; font-family: var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.wn-slide { display: grid; justify-items: center; gap: 10px; padding: 6px 4px 2px; text-align: center; animation: enter 0.3s var(--ease) both; }
.wn-emoji {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; font-size: 2.6rem; margin-bottom: 6px;
  background: transparent;
  border: 0;
}
.wn-slide h3 { font-size: 1.35rem; letter-spacing: -0.025em; }
.wn-slide p { color: var(--text-soft); font-size: 0.9rem; line-height: 1.6; max-width: 38ch; }
.wn-dots { display: flex; gap: 6px; margin-top: 10px; }
.wn-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: var(--surface-4); cursor: pointer; transition: width 0.2s var(--ease), background 0.2s; }
.wn-dots button.on { width: 22px; background: var(--wt); }
.modal.whatsnew .modal-foot { align-items: center; }

/* Phones: Home shows four tiles in a 2×2 grid. "Due today" is the one to drop: the greeting
   already counts it and My focus lists today's tasks right below. */
@media (max-width: 600px) {
  .page-host[data-page="home"] .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-host[data-page="home"] .kpis > .kpi:nth-child(2) { display: none; }
}

/* ------------------------------------------------------------------ profile photos */

.avatar { overflow: visible; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.has-photo { color: transparent; background: var(--surface-3); border-color: color-mix(in srgb, var(--ac) 35%, var(--line)); }
.avatars .avatar.has-photo { border: 2px solid var(--ring, var(--surface)); }
.av-status { z-index: 1; }
.photo-row { display: flex; align-items: center; gap: 16px; }
.pp-card .avatar.has-photo { border: 0; }

.cropper { display: grid; justify-items: center; gap: 14px; }
.crop-stage {
  position: relative; overflow: hidden; border-radius: 18px; cursor: grab; touch-action: none; user-select: none;
  background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface-2) 0 50%) 0 0 / 20px 20px;
}
.crop-stage.dragging { cursor: grabbing; }
.crop-stage img { position: absolute; left: 50%; top: 50%; max-width: none; pointer-events: none; }
/* Dim everything outside the circle so you see exactly what teammates will see. */
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55); outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: -2px; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 260px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--brand); }

/* ------------------------------------------------------------------ micro-animations */

@keyframes bar-grow { from { transform: scaleX(0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes strike { from { background-size: 0 2px; } to { background-size: 100% 2px; } }

/* Progress bars fill in when they appear. */
.bar > span, .sev-bar > span, .summary-bar > span { transform-origin: left center; animation: bar-grow 0.8s var(--ease) both; }
.page .bar > span { animation-delay: 0.08s; }

/* Ticking something off: the box pops and the title gets struck through. */
.check input:checked + .box, .tc-check.on { animation: pop 0.35s var(--spring); }
.list-item.completing { opacity: 0.55; transition: opacity 0.4s 0.35s; }
.list-item.completing .li-title {
  background: linear-gradient(currentColor, currentColor) no-repeat left 55% / 100% 2px;
  animation: strike 0.35s var(--ease) both;
}

/* A reaction or vote you just made gives a little bounce. */
.rx.bump, .vote.bump { animation: pop 0.38s var(--spring); }
.vote.bump b { color: var(--brand); }

/* Hover lift for the main tiles. */
.kpi, .wt, .fs, .rhythm-person { transition: transform 0.18s var(--ease), border-color 0.16s, background 0.16s; }
.kpi[data-href]:hover { transform: translateY(-2px); }
.list-item.completing .li-title { width: fit-content; max-width: 100%; }

/* ------------------------------------------------------------------ home, redesigned */

/* The hero takes on the time of day: warm morning, bright midday, sunset, deep night. */
/* A slim greeting bar: who and when on the left, the two quick actions on the right. */
.hero { --t1: var(--brand); --t2: var(--accent); grid-template-columns: minmax(0, 1fr) minmax(240px, 400px); align-items: center; gap: 24px; min-height: 248px; padding: 34px 40px; isolation: isolate; border: 0;
  background:
    radial-gradient(720px 300px at 0% 0%, color-mix(in srgb, var(--t1) 18%, transparent), transparent 70%),
    radial-gradient(460px 280px at 82% 40%, color-mix(in srgb, var(--t3, var(--t1)) 12%, transparent), transparent 70%),
    radial-gradient(560px 280px at 100% 100%, color-mix(in srgb, var(--t2) 14%, transparent), transparent 70%),
    var(--surface); }
/* Each time of day borrows its colours from its own scene. */
.hero[data-time="morning"] { --t1: #f6c64f; --t2: #fb8fa0; --t3: #f8d48a; --ti: #f2a93b; }
.hero[data-time="day"] { --t1: #57c7ff; --t2: #8fb7d6; --t3: #fbd977; --ti: #f5b731; }
.hero[data-time="evening"] { --t1: #fb923c; --t2: #b9a0ff; --t3: #f9b27a; --ti: #f0844b; }
.hero[data-time="night"] { --t1: #6366f1; --t2: #b9a0ff; --t3: #f4dfad; --ti: #8b7cf6; }
/* The time-of-day scene sits just before the quick actions, gently alive. */
/* Text and actions on the left; the right side belongs to the scene. */
.hero-sky { grid-column: 2; grid-row: 1; width: 100%; height: auto; margin-block: -18px -24px; pointer-events: none; overflow: visible; }
.hero-sky .sky-rays { animation: sky-spin 60s linear infinite; }
.hero-sky .sky-drift { animation: sky-drift 9s ease-in-out infinite alternate; }
.hero-sky .sky-drift.d2 { animation-duration: 12s; animation-delay: -4s; }
.hero-sky .sky-twinkle { transform-box: fill-box; transform-origin: center; animation: sky-twinkle 3.2s ease-in-out infinite; }
.hero-sky .sky-twinkle.d2 { animation-delay: -1.1s; }
.hero-sky .sky-twinkle.d3 { animation-delay: -2.2s; }
.hero-sky .sky-bird { animation: sky-drift 7s ease-in-out infinite alternate; }
@keyframes sky-spin { to { transform: rotate(360deg); } }
@keyframes sky-drift { from { transform: translateX(-6px); } to { transform: translateX(8px); } }
@keyframes sky-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .hero-sky * { animation: none !important; } }
[dir="rtl"] .hero-sky { transform: scaleX(-1); }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; }
.hero-kicker i { color: var(--ti, var(--t1)); font-size: 0.95rem; }
.greeting h2 { font-size: clamp(1.7rem, 2.8vw, 2.3rem); letter-spacing: -0.035em; }
.hero .hero-main { gap: 8px; }
.hero .hero-chips { gap: 8px; margin-top: 2px; }
.hero .hero-chips p { margin: 0; margin-inline-end: 4px; }
.hero .hero-main .page-actions { margin-top: 14px; }

/* Two halves: your work on the left, the people around it in a rail on the right. */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 360px); gap: 16px; align-items: start; }
.home-rail .ts-row { flex-wrap: wrap; overflow: visible; gap: 10px 8px; }
@media (max-width: 1100px) {
  /* One column: check-in and team come first, then work, then the rest of the rail. */
  .home-layout { grid-template-columns: minmax(0, 1fr); }
  .home-main, .home-rail { display: contents; }
  .home-rail > .hero-checkin, .home-rail > .team-strip { order: -1; }
}

/* Work panel: tabs across the top, a quiet row of counts under My focus. */
.work-head { display: flex; align-items: center; gap: 8px; padding-inline: 8px 12px; border-bottom: 1px solid var(--line); }
.work-tabs { flex: 1; min-width: 0; border-bottom: 0; }
.work-tabs .tab { display: inline-flex; align-items: center; gap: 7px; padding: 15px 12px 14px; }
.work-tabs .tab i { font-size: 0.78rem; color: var(--muted-2); }
.work-tabs .tab.on i { color: var(--brand); }
.work-tabs .tab .count { margin-inline-start: 0; }
.work-tabs .tab .count.hot { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.work-link { flex: 0 0 auto; }
.work-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.wstat {
  --wc: var(--muted); display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 0.78rem; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap;
}
.wstat b { font-size: 0.86rem; }
.wstat.danger { --wc: var(--danger); }
.wstat.warn { --wc: var(--warn); }
.wstat.violet { --wc: var(--accent); }
.wstat:not(.zero) { color: var(--wc); background: color-mix(in srgb, var(--wc) 10%, transparent); border-color: color-mix(in srgb, var(--wc) 30%, transparent); }
.wstat.zero b { color: var(--muted-2); }
.wstat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--wc) 55%, var(--line)); }
.work-note { margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line); }

/* This week: seven day columns with your deadlines and milestones. */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 12px; }
.wk-day { display: grid; grid-template-rows: auto 1fr; gap: 8px; min-width: 0; min-height: 132px; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; }
.wk-day.weekend { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.wk-day.today { border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: color-mix(in srgb, var(--brand) 7%, var(--surface-2)); }
.wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; padding-inline: 2px; }
.wk-name { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.wk-day.today .wk-name { color: var(--brand); }
.wk-num { font-family: var(--font-display); font-size: 1.05rem; }
.wk-day.free .wk-num { color: var(--muted-2); }
.wk-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wk-task, .wk-ms {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 7px; border-radius: 7px; font-size: 0.72rem; font-weight: 600; line-height: 1.25;
  cursor: pointer; text-decoration: none; transition: background 0.14s;
}
.wk-task { color: var(--text-soft); background: var(--surface); box-shadow: inset 3px 0 0 var(--pc); }
[dir="rtl"] .wk-task { box-shadow: inset -3px 0 0 var(--pc); }
.wk-task:hover { background: var(--hover); color: var(--text); }
.wk-task.blocked { color: var(--danger); }
.wk-ms span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Task names get two lines so they stay readable in narrow day columns. */
.wk-task span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wk-ms { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.wk-ms:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 20%, transparent); }
.wk-ms i { font-size: 0.62rem; }
.wk-more { font-size: 0.7rem; font-weight: 600; color: var(--muted); padding-inline: 7px; }
.wk-free { margin: auto; font-size: 0.7rem; color: var(--muted-2); }
@media (max-width: 760px) {
  /* Swipe through the days instead of squeezing seven columns. */
  .week-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 128px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .week-grid::-webkit-scrollbar { display: none; }
  .wk-day { scroll-snap-align: start; }
}

/* Quick actions: four one-tap shortcuts. */
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-width: 0; text-align: start; font: inherit; color: var(--text); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); transition: transform 0.18s var(--ease), border-color 0.14s;
}
.quick:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.quick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.q-icon { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.q-text { display: grid; gap: 1px; min-width: 0; }
.q-text b { font-size: 0.84rem; }
.q-text b, .q-text .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1440px) { .quick { flex-direction: column; align-items: flex-start; gap: 10px; } }
@media (max-width: 600px) { .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick { flex-direction: row; align-items: center; padding: 12px; } .q-icon { width: 32px; height: 32px; } .q-text .tiny { display: none; } }

/* What's happening keeps a fixed height and scrolls, fading out at the bottom. */
.feed-scroll { max-height: 380px; overflow-y: auto; scrollbar-width: thin; mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.feed-scroll .feed { padding-bottom: 26px; }
@media (max-width: 600px) {
  .work-head { padding-inline: 4px 8px; }
  .work-link { display: none; }
  .work-stats { padding: 10px 14px; }
  .work-stats .focus-progress { display: none; }
}

.home-card { display: grid; align-content: start; gap: 14px; padding: 18px 20px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--shadow-sm); }
.home-card.hero-checkin { backdrop-filter: none; }

/* Your team today */
.team-strip { gap: 12px; }
.ts-head { display: flex; align-items: center; gap: 10px; }
.ts-head b { font-size: 0.86rem; }
.ts-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 2px; }
.ts-row::-webkit-scrollbar { display: none; }
.ts-person { display: grid; justify-items: center; gap: 6px; flex: 0 0 auto; width: 64px; color: var(--muted); text-decoration: none; font-size: 0.74rem; font-weight: 600; transition: transform 0.18s var(--ease); }
.ts-person:hover { text-decoration: none; color: var(--text); transform: translateY(-2px); }
.ts-person .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px transparent; outline: 2px dashed var(--line-strong); outline-offset: 2px; transition: box-shadow 0.2s, outline-color 0.2s; }
.ts-person.in .avatar { outline: 0; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--success); }
.ts-person:not(.in) .avatar { opacity: 0.7; }
.ts-person.in { color: var(--text-soft); }
.ts-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-load { margin-top: -4px; font-size: 0.66rem; font-weight: 600; color: var(--muted-2); white-space: nowrap; }
.ts-load.late { color: var(--danger); }
.ts-load.blocked { color: var(--warn); }

/* Later and undated tasks fold away under one quiet row. */
.focus-more > summary { display: flex; align-items: center; gap: 8px; padding: 12px 20px; cursor: pointer; list-style: none; color: var(--muted); font-size: 0.8rem; font-weight: 600; border-top: 1px solid var(--line); }
.focus-more > summary::-webkit-details-marker { display: none; }
.focus-more > summary:hover { color: var(--text); background: var(--hover); }
.focus-more > summary i { font-size: 0.65rem; transition: transform 0.18s var(--ease); }
.focus-more[open] > summary i { transform: rotate(90deg); }
[dir="rtl"] .focus-more:not([open]) > summary i { transform: rotate(180deg); }
.focus-more .when-open, .focus-more[open] .when-closed { display: none; }
.focus-more[open] .when-open { display: inline; }

/* Milestone rows: project icon, name and date on one line. */
.ms-head { gap: 8px; min-width: 0; }
.ms-head b { min-width: 0; }

/* My focus */
.focus-progress { margin-inline-start: auto; gap: 8px; }
.focus-progress .ring { width: 22px; height: 22px; }
.focus-progress .ring::before { content: ""; width: 14px; height: 14px; }
.all-clear-card { display: grid; justify-items: center; gap: 6px; padding: 34px 20px 30px; text-align: center; }
.acc-emoji { font-size: 2.4rem; line-height: 1; margin-bottom: 4px; }
.all-clear-card b { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -0.02em; }
.all-clear-card .btn { margin-top: 8px; }

/* What's happening: the Activity page's colour-coded markers, compact. */
.feed { list-style: none; margin: 0; padding: 8px 0; position: relative; }
.feed::before { content: ""; position: absolute; top: 22px; bottom: 22px; inset-inline-start: 34px; width: 2px; background: var(--line); }
.feed-item { --tc: var(--accent); display: flex; gap: 12px; padding: 7px 20px; align-items: flex-start; }
.feed-item .tl-dot { box-shadow: 0 0 0 4px var(--surface); }
.feed-body { display: grid; gap: 1px; min-width: 0; padding-top: 3px; }
.feed-body .small { overflow-wrap: anywhere; }
.feed-item.tone-good { --tc: var(--success); }
.feed-item.tone-bad { --tc: var(--danger); }
.feed-item.tone-love { --tc: var(--love); }
.feed-item.tone-idea { --tc: var(--warn); }
.feed-item.tone-talk { --tc: var(--info); }

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(200px, 300px); min-height: 220px; padding: 30px 30px; }
}
@media (max-width: 600px) {
  .hero { padding: 22px 16px 16px; }
  .ts-person { width: 56px; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; }
  /* The scene takes its own corner beside the date and greeting, so chips and buttons below never run into it. */
  .hero { min-height: 0; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 8px; }
  .hero .hero-main { display: contents; }
  .hero-main > * { grid-column: 1 / -1; }
  .hero-main > .hero-kicker, .hero-main > h2 { grid-column: 1; }
  .hero-main > .hero-kicker { align-self: end; }
  .hero-main > h2 { align-self: start; }
  .hero-sky { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 170px; margin: -10px -8px -4px 0; }
}
@media (max-width: 600px) { .hero-sky { width: 112px; } }

/* ------------------------------------------------------------------ mood picker, refined */

/* One soft track with five emoji buttons, no boxes. The picked mood takes on its own colour. */
.mood-pick { gap: 2px; padding: 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.mp { --mc: var(--brand); gap: 4px; padding: 10px 2px 8px; border: 0; border-radius: 12px; background: transparent; transition: background 0.16s, box-shadow 0.16s; }
.mp[data-mood="1"] { --mc: var(--danger); }
.mp[data-mood="2"] { --mc: var(--warn); }
.mp[data-mood="3"] { --mc: var(--info); }
.mp[data-mood="4"] { --mc: var(--success); }
.mp[data-mood="5"] { --mc: var(--accent); }
.mp span { font-size: 1.7rem; line-height: 1; filter: none; transition: transform 0.2s var(--spring); }
.mp small { font-size: 0.7rem; font-weight: 600; color: var(--muted); transition: color 0.16s; }
.mp:hover { transform: none; border: 0; background: var(--hover); }
.mp:hover span { transform: scale(1.14); }
.mp:hover small { color: var(--text-soft); }
.mp:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.mp.on { background: color-mix(in srgb, var(--mc) 15%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--mc) 55%, transparent); }
.mp.on span { transform: scale(1.14); }
.mp.on small { color: var(--mc); }
/* Once one is picked, the others step back. */
.mood-pick:has(.mp.on) .mp:not(.on):not(:hover) span { opacity: 0.55; }

.ci-top { display: flex; align-items: center; gap: 10px; }
.ci-top .ci-q { flex: 1; }
.ci-private { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.ci-private i { font-size: 0.6rem; }
.hero-checkin .ci-hint { display: none; }
.hero-checkin { gap: 14px; padding: 18px; }

@media (max-width: 520px) {
  .mp span { font-size: 1.5rem; }
  .mp small { display: block; font-size: 0.62rem; }
}
/* The hero already shows a "Private" tag, so the form's own privacy line would repeat it. */
.hero-checkin .ci-fields .row.between > span { display: none; }
.hero-checkin .ci-fields .row.between { justify-content: flex-end; }
@media (max-width: 520px) { .hero-checkin .ci-q { font-size: 0.95rem; } }
/* Check-in form: even, roomier spacing between the fields and the footer. */
.checkin-editor { gap: 16px; }
.ci-fields.stack.tight { gap: 12px; }
.ci-fields .form-grid { gap: 12px; }
.ci-fields .row.between { margin-top: 4px; }

/* ------------------------------------------------------------------ polls */

.poll { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface-2); }
.poll.closed { background: transparent; }
.poll-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poll-q { font-size: 1.02rem; letter-spacing: -0.015em; }
.poll-options { display: grid; gap: 6px; }
.poll-opt {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; text-align: start;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--text-soft);
  transition: border-color 0.14s, background 0.14s;
}
.poll-opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--info) 45%, var(--line)); color: var(--text); }
.poll-opt:disabled { cursor: default; }
.poll-opt > * { position: relative; }
.po-fill { position: absolute !important; inset: 0 auto 0 0; background: color-mix(in srgb, var(--info) 14%, transparent); border-radius: 9px 0 0 9px; transform-origin: left; animation: bar-grow 0.7s var(--ease) both; }
.po-mark { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 0.55rem; color: transparent; }
.poll-opt[role="checkbox"] .po-mark { border-radius: 5px; }
.po-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.po-pct { font-family: var(--font-display); font-size: 0.86rem; color: var(--muted); min-width: 36px; text-align: end; }
.poll-opt.mine { border-color: color-mix(in srgb, var(--info) 55%, transparent); color: var(--text); }
.poll-opt.mine .po-mark { background: var(--info); border-color: var(--info); color: var(--surface); }
.poll-opt.mine .po-fill { background: color-mix(in srgb, var(--info) 24%, transparent); }
.poll-opt.mine .po-pct { color: var(--info); }
.poll-opt.winner { border-color: color-mix(in srgb, var(--success) 50%, transparent); }
.poll-opt.winner .po-fill { background: color-mix(in srgb, var(--success) 20%, transparent); }
.poll-opt.winner .po-text::after { content: " 🏆"; }
.poll-opt.bump { animation: pop 0.38s var(--spring); }
.poll-foot { display: flex; gap: 4px; flex-wrap: wrap; }
.poll-empty { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
.poll-empty > span { font-size: 1.9rem; }
.poll-empty > div { flex: 1; }
.past-polls summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.past-polls summary:hover { color: var(--text); }
.past-polls[open] summary { margin-bottom: 10px; }
.poll-opt-edit .po-num { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--chip); font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.poll-opt-edit .input { flex: 1; }
@media (max-width: 520px) { .poll-empty { flex-wrap: wrap; } }

/* ------------------------------------------------------------------ retro */

.retro-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--surface); }
.retro-bar h3 { font-size: 1.1rem; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.retro-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.retro-col { display: grid; gap: 12px; padding: 14px; border-radius: var(--r-panel); border: 1px solid var(--line); border-top: 3px solid var(--rc); background: color-mix(in srgb, var(--rc) 4%, var(--bg-soft)); }
.retro-col header { display: flex; align-items: center; gap: 10px; }
.retro-col header .rc-emoji { font-size: 1.4rem; }
.retro-col h4 { font-size: 0.95rem; }
.rcard-add { display: grid; gap: 8px; padding: 10px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--rc) 40%, var(--line)); background: var(--surface); }
.rcard-add textarea { min-height: 52px; border: 0; background: transparent; padding: 4px; box-shadow: none !important; }
.rcards { display: grid; gap: 8px; }
.rcard { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.rcard.mine { border-color: color-mix(in srgb, var(--rc) 35%, var(--line)); }
.rcard p { font-size: 0.88rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.rcard-foot { display: flex; align-items: center; gap: 6px; }
.rcard-foot .avatar.xs { width: 18px; height: 18px; }
.rcard-menu { opacity: 0; }
.rcard:hover .rcard-menu, .rcard-menu:focus-visible { opacity: 1; }
.rvote { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 0.74rem; font-weight: 700; cursor: pointer; }
.rvote i { font-size: 0.6rem; }
.rvote:hover:not(:disabled) { border-color: color-mix(in srgb, var(--rc) 50%, var(--line)); color: var(--text); }
.rvote.on { border-color: color-mix(in srgb, var(--rc) 60%, transparent); background: color-mix(in srgb, var(--rc) 15%, transparent); color: var(--text); }
.rvote.bump { animation: pop 0.38s var(--spring); }
.rcard.card-in { animation: pop 0.35s var(--spring); }
.rc-none { padding: 4px 2px; }
@media (max-width: 980px) { .retro-cols { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ weekly recap */

.recap-card { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: color-mix(in srgb, var(--warn) 5%, var(--surface)); }
.recap-card .panel-head h3 span { font-size: 1rem; }
.recap-body { display: grid; gap: 16px; }
.rc-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rc-tile { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.rc-tile .rc-emoji { font-size: 1.3rem; }
.rc-tile b { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1.2; }
.rc-tile span:last-child { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.rc-tile.zero { opacity: 0.55; }
.rc-row { display: flex; align-items: center; gap: 10px; }
.rc-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rc-section { display: grid; gap: 6px; }
.rc-section .list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rc-idea { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 9%, var(--surface-2)); color: inherit; text-decoration: none; }
.rc-idea:hover { text-decoration: none; background: color-mix(in srgb, var(--warn) 14%, var(--surface-2)); }
.rc-idea b { flex: 1; }
.rc-mood { display: flex; align-items: center; gap: 12px; }
.rc-mood-face { font-size: 2rem; }
.rc-mood b { font-family: var(--font-display); font-size: 1.3rem; }
.rc-up { color: var(--success); font-weight: 700; font-size: 0.8rem; margin-inline-start: 6px; }
.rc-down { color: var(--warn); font-weight: 700; font-size: 0.8rem; margin-inline-start: 6px; }
@media (max-width: 600px) { .rc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ Persian / right-to-left */

/* Persian is a connected script: letter-spacing pulls letters apart, so it's off everywhere. */
:root[lang="fa"] body, :root[lang="fa"] body * { letter-spacing: 0 !important; }
:root[lang="fa"] { --font-sans: "Vazirmatn", "Manrope", system-ui, sans-serif; --font-display: "Vazirmatn", "Space Grotesk", system-ui, sans-serif; }
:root[lang="fa"] body { line-height: 1.7; }
:root[lang="fa"] .kicker, :root[lang="fa"] .nav-section, :root[lang="fa"] .list-group-title, :root[lang="fa"] .tl-label, :root[lang="fa"] .rc-label, :root[lang="fa"] .sp-label, :root[lang="fa"] .pp-label { text-transform: none; }

/* Arrows and chevrons point along the reading direction. */
[dir="rtl"] :is(.fa-arrow-right, .fa-arrow-left, .fa-chevron-right, .fa-chevron-left, .fa-arrow-right-long, .fa-arrow-left-long, .fa-arrow-right-from-bracket, .fa-reply, .fa-arrow-up-right-from-square, .fa-arrow-trend-up, .fa-arrow-trend-down) { transform: scaleX(-1); }

/* Bars and fills grow from the start edge, which is the right in Persian. */
[dir="rtl"] :is(.bar > span, .sev-bar > span, .summary-bar > span, .po-fill, .tc-progress span) { transform-origin: right center; }
[dir="rtl"] .po-fill { inset: 0 0 0 auto; border-radius: 0 9px 9px 0; }
[dir="rtl"] .tooltip kbd { margin-inline-start: 8px; }

/* ------------------------------------------------------------------ telegram */

.tg-row { gap: 14px; }
.tg-row > .small { flex: 1 1 280px; }
.tg-waiting { gap: 8px; }
.tg-who { gap: 6px; }
