:root {
  color-scheme: light; /* native controls (time/date pickers, checkboxes, scrollbars) match the app's own theme */
  --accent: #2e6b46;
  --accent-2: color-mix(in srgb, var(--accent) 70%, #ffffff);   /* lighter green */
  --accent-3: color-mix(in srgb, var(--accent) 55%, #000000);   /* deep green */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --hero: linear-gradient(160deg, color-mix(in srgb, var(--accent) 85%, #3a8a5c), var(--accent-3));
  --bg: #e7e9e7;
  --panel: #f3f4f3;
  --surface: #ffffff;
  --surface-2: #f2f4f2;
  --text: #141a16;
  --muted: #6c7670;
  --line: #e3e7e4;
  --hatch: #9aa29d;
  --danger: #d6463a;
  --warn: #c98a16;
  --radius: 22px;

  /* Motion: strong ease-out for entrances, ease-in-out for on-screen moves, iOS-like drawer curve */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-1: 120ms;  /* press feedback */
  --dur-2: 150ms;  /* hover, color, small popovers, exits */
  --dur-3: 200ms;  /* toggles, dialogs, toasts */
  --dur-4: 300ms;  /* drawer, view transitions */
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f0d;
  --panel: #111613;
  --surface: #181f1b;
  --surface-2: #202923;
  --text: #e9efea;
  --muted: #8d9a92;
  --line: #29332d;
  --hatch: #4f5a54;
  --accent-2: color-mix(in srgb, var(--accent) 75%, #ffffff);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
svg { display: block; }
[data-icon] { display: inline-grid; place-items: center; }
[data-icon] svg { width: 20px; height: 20px; }

.app { display: grid; grid-template-columns: 252px 1fr; gap: 16px; padding: 16px; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 16px; height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  padding: 24px 20px 20px; background: var(--panel); border-radius: var(--radius);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; color: var(--accent); }
.brand-mark svg { width: 38px; height: 38px; }
.brand-name { font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 24px 12px 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 12px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 16px;
  background: none; border: 0; cursor: pointer; text-align: left; border-radius: 12px;
  transition: color var(--dur-2) ease, background var(--dur-2) ease;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); font-weight: 700; }
.nav a.active::before {
  content: ""; position: absolute; left: -18px; top: 6px; bottom: 6px; width: 4px;
  border-radius: 0 8px 8px 0; background: var(--accent);
}
.nav a.active [data-icon] { color: var(--accent); }
.badge {
  margin-left: auto; min-width: 26px; height: 20px; padding: 0 8px; border-radius: 8px;
  background: var(--accent-3); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.badge:empty { display: none; }

.app-card {
  margin-top: auto; padding: 20px; border-radius: 16px; color: #fff; position: relative; overflow: hidden;
  background:
    repeating-radial-gradient(circle at 110% 120%, transparent 0 16px, rgba(255,255,255,.06) 16px 17px),
    linear-gradient(160deg, #1f3a2b, #0f1f17);
}
.app-card-icon { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #0f1f17; margin-bottom: 16px; }
.app-card-icon svg { width: 16px; height: 16px; }
.app-card strong { display: block; font-weight: 600; font-size: 18px; line-height: 1.25; }
.app-card p { opacity: .75; font-size: 13px; margin: 8px 0 16px; }
.btn-app { width: 100%; background: var(--accent); color: #fff; }

/* ---------- Topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  background: var(--panel); border-radius: var(--radius);
}
.search {
  flex: 1; min-width: 0; max-width: 380px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px 0 16px; height: 50px; border-radius: 999px; background: var(--surface); cursor: text;
}
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.search input::placeholder { color: var(--muted); }
kbd { font: 600 11px/1 inherit; padding: 8px 8px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  position: relative; width: 50px; height: 50px; border-radius: 50%; border: 0;
  background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 13px; right: 13px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}
.menu-btn { display: none; }
.me { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-left: 4px; }
.me-text { display: flex; flex-direction: column; line-height: 1.3; }
.me-text strong { font-weight: 600; font-size: 16px; }
.me-text small { color: var(--muted); font-size: 13px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--c, var(--accent)); color: var(--t, #fff); font-weight: 700; font-size: 13px;
}
.avatar-lg { width: 52px; height: 52px; font-size: 16px; }

/* ---------- View ---------- */
.view {
  flex: 1; padding: 32px 24px 24px; outline: none; background: var(--panel); border-radius: var(--radius);
}
.view.entering { animation: page-in var(--dur-3) var(--ease-out); }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 16px; }
.head-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-2) ease, background-color var(--dur-2) ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm svg { width: 15px; height: 15px; }
.round-btn svg { width: 20px; height: 20px; }
.move-btn svg, .icon-btn svg { flex: none; }
.cal-head .icon-btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--hero); color: #fff; }
.btn-primary:hover { opacity: .92; }
.btn-outline { background: transparent; border: 1.5px solid var(--accent-3); color: var(--text); padding: 12px 20px; }
[data-theme="dark"] .btn-outline { border-color: var(--accent-2); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-lg { padding: 16px 24px; font-size: 16px; }
.btn-lg.btn-outline { padding: 12px 24px; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-head h3, .card > h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.card > h3 { margin-bottom: 20px; }
.card-head small { color: var(--muted); }

/* ---------- Dashboard grid ---------- */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }

.stat { display: flex; flex-direction: column; min-height: 186px; }
.stat .card-head h3 { font-size: 18px; font-weight: 500; }
.stat .value { font-size: 54px; font-weight: 700; letter-spacing: -.04em; line-height: 1; margin: 20px 0 20px; }
.stat .delta { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; height: 17px; padding: 0 4px; border-radius: 8px;
  border: 1px solid currentColor; font-size: 10px; font-weight: 600;
}
.stat .delta.good { color: var(--accent); }
[data-theme="dark"] .stat .delta.good { color: var(--accent-2); }
.stat.hero { background: var(--hero); color: #fff; box-shadow: 0 10px 24px -12px var(--accent-3); }
.stat.hero .delta { color: rgba(255,255,255,.85); }
.arrow-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--text); background: none;
  display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none;
  transition: transform var(--dur-3) var(--ease-out), background var(--dur-2) ease;
}
.arrow-btn svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .arrow-btn:hover { transform: rotate(45deg); } }
.stat.hero .arrow-btn { background: #fff; border-color: #fff; color: var(--accent-3); }

/* Weekly analytics bars */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; align-items: end; height: 220px; padding-top: 32px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; justify-content: flex-end; }
.bar {
  position: relative; width: 100%; max-width: 76px; border-radius: 999px; min-height: 40px;
  transform-origin: bottom;
}
.view.entering .bar { animation: grow 400ms var(--ease-out) both; }
@keyframes grow { from { transform: scaleY(.15); opacity: 0; } }
.bar.l1 { background: var(--accent-2); }
.bar.l2 { background: var(--accent); }
.bar.l3 { background: var(--accent-3); }
.bar.hatch {
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 7.5px);
  border: 1.5px solid var(--hatch);
}
.bar-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.bar-tip::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 8px; background: var(--muted); }
.bar-day { color: var(--muted); font-size: 13px; }
.bar[title] { cursor: default; }

/* Reminder */
.reminder { display: flex; flex-direction: column; }
.reminder h4 { margin: 8px 0 12px; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; color: var(--accent-3); }
[data-theme="dark"] .reminder h4 { color: var(--accent-2); }
.reminder p { color: var(--muted); }
.reminder .btn { margin-top: auto; width: 100%; }

/* Project list */
.proj-list { display: flex; flex-direction: column; gap: 20px; }
.proj { display: flex; align-items: center; gap: 16px; }
.proj svg { width: 30px; height: 30px; flex: none; }
.proj strong { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj small { color: var(--muted); font-size: 13px; }
.proj > div { min-width: 0; }

/* Team collaboration */
.collab { display: flex; flex-direction: column; gap: 20px; }
.collab-row { display: flex; align-items: center; gap: 16px; }
.collab-row .grow { flex: 1; min-width: 0; }
.collab-row strong { display: block; font-weight: 500; font-size: 16px; }
.collab-row small { color: var(--muted); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collab-row small b { color: var(--text); font-weight: 600; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 8px; border: 1px solid currentColor; white-space: nowrap; }
.pill.completed { color: var(--accent); background: var(--accent-soft); }
.pill.active { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill.pending { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
[data-theme="dark"] .pill.completed { color: var(--accent-2); }

/* Gauge */
.gauge { position: relative; max-width: 300px; margin: 8px auto 0; }
.gauge svg { width: 100%; height: auto; overflow: visible; }
.gauge-label { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge-label b { display: block; font-size: 54px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.gauge-label small { color: var(--muted); }
.legend { display: flex; justify-content: center; gap: 20px; margin-top: 20px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 13px; height: 13px; border-radius: 50%; background: var(--c); }
.legend i.hatch { background: repeating-linear-gradient(135deg, transparent 0 2.5px, var(--hatch) 2.5px 4px); border: 1px solid var(--hatch); }

/* Time tracker */
.tracker {
  color: #fff; display: flex; flex-direction: column;
  background:
    repeating-radial-gradient(circle at 120% 130%, transparent 0 20px, rgba(255,255,255,.06) 20px 21px),
    linear-gradient(160deg, #1f3a2b, #0d1a13);
}
.tracker h3 { font-weight: 500; }
.clock { font-size: 54px; font-weight: 600; letter-spacing: -.01em; text-align: center; margin: 4px 0 20px; font-variant-numeric: tabular-nums; }
.tracker-ctrls { display: flex; justify-content: center; gap: 16px; margin-top: auto; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; transition: transform var(--dur-1) var(--ease-out); }
.round-btn:active { transform: scale(.92); }
.round-btn.play { background: #fff; color: #0d1a13; }
.round-btn.stop { background: #d6463a; color: #fff; }

/* ---------- Shared form controls ---------- */
.field { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); gap: 12px; }
.field:last-child { border-bottom: 0; }
.field small { display: block; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; cursor: pointer; z-index: 1; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background var(--dur-3) ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--dur-3) var(--ease-out); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.input { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }
.empty .btn { margin-top: 12px; }

/* ---------- Dialogs + toast ---------- */
/* Dialogs fade and settle in; they leave faster than they arrive.
   `display` is transitioned discretely so the exit can play before [hidden] removes the box. */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 50; padding: 16px;
  opacity: 1; transition: opacity var(--dur-3) var(--ease-out), display var(--dur-2) allow-discrete;
}
.modal[hidden] { display: none; opacity: 0; transition-duration: var(--dur-2); }
.modal-card {
  background: var(--surface); border-radius: var(--radius); padding: 24px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px;
  transition: transform var(--dur-3) var(--ease-out);
}
.modal[hidden] .modal-card { transform: scale(.98); }
@starting-style {
  .modal:not([hidden]) { opacity: 0; }
  .modal:not([hidden]) .modal-card { transform: translateY(6px) scale(.97); }
}
.modal-card h3 { font-size: 18px; font-weight: 700; }
.modal-card label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 13px; }
.modal-card input, .modal-card select { height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.modal-card input[type="time"] { font-size: 16px; letter-spacing: .02em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }


/* Gated Feature Visual Locks */
.is-gated-locked { opacity: 0.65; cursor: pointer !important; position: relative; }
.is-gated-locked::after {
  content: '🔒';
  font-size: 10px;
  margin-left: 4px;
  vertical-align: super;
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--surface); padding: 12px 20px; border-radius: 12px; font-weight: 600;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out); z-index: 60; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .dash { grid-template-columns: repeat(6, 1fr); }
  .c3, .c4 { grid-column: span 3; }
  .c5, .c6 { grid-column: span 6; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  /* The drawer only animates on an explicit open/close, so crossing this breakpoint never slides it */
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 40; width: 270px; border-radius: 0 var(--radius) var(--radius) 0; transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.25); transition: transform var(--dur-4) var(--ease-drawer); }
  .sidebar.closing { transition: transform var(--dur-3) var(--ease-drawer); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .38); opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease-out); }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px; gap: 8px; }
  .search { height: 46px; }
  .icon-btn { width: 46px; height: 46px; }
  kbd, .me-text, .top-actions .icon-btn:not(#themeBtn) { display: none; }
  .view { padding: 24px 16px; }
  .page-head h1 { font-size: 34px; }
}
@media (max-width: 620px) {
  .dash { grid-template-columns: 1fr; }
  .c3, .c4, .c5, .c6 { grid-column: span 1; }
  .bars { gap: 8px; }
  .head-actions, .head-actions .btn { width: 100%; }
  .me .avatar-lg { width: 46px; height: 46px; }
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.btn:focus-visible, .icon-btn:focus-visible, .arrow-btn:focus-visible, .round-btn:focus-visible { border-radius: 999px; }

/* ---------- Tasks board ---------- */
.task-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 24px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); max-width: 100%; overflow-x: auto; }
.seg button {
  border: 0; background: none; padding: 12px 20px; border-radius: 999px; cursor: pointer; color: var(--muted);
  font-weight: 500; white-space: nowrap; min-height: 40px; transition: color var(--dur-2) ease, background var(--dur-2) ease;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--hero); color: #fff; font-weight: 600; }
.shown { color: var(--muted); }
.shown b { color: var(--text); }

.kboard { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 200px; transition: background var(--dur-2) ease, border-color var(--dur-2) ease; }
[data-theme="light"] .kcol { background: #f7f8f7; }
.kcol.over { background: var(--accent-soft); border-color: var(--accent); border-style: dashed; }
.kcol h4 { display: flex; align-items: center; gap: 12px; margin: 2px 2px 16px; font-size: 16px; font-weight: 600; }
.kcol h4 > i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.kcol .count {
  margin-left: auto; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; display: grid; place-items: center;
}
.kempty { color: var(--muted); text-align: center; padding: 32px 0; font-size: 13px; }

.kcard {
  background: var(--surface); border-radius: 16px; padding: 16px; margin-bottom: 12px; cursor: grab;
  box-shadow: 0 1px 2px rgba(20, 40, 30, .04); transition: box-shadow var(--dur-2) ease, opacity var(--dur-2) ease;
}
.kcard:last-child { margin-bottom: 0; }
@media (hover: hover) and (pointer: fine) { .kcard:hover { box-shadow: 0 6px 18px -8px rgba(20, 40, 30, .25); } }
.kcard.dragging { opacity: .4; transform: rotate(1.5deg); }
.kcard-top { display: flex; align-items: center; gap: 12px; }
.team-tag { font-size: 13px; font-weight: 500; padding: 4px 8px; border-radius: 999px; --h: #2f8a57; color: var(--h); background: color-mix(in srgb, var(--h) 12%, transparent); }
.team-tag[data-team="Backend"] { --h: #3b5bdb; }
.team-tag[data-team="Design"] { --h: #c2255c; }
.team-tag[data-team="QA"] { --h: #7048e8; }
.team-tag[data-team="Marketing"] { --h: #c46a12; }
[data-theme="dark"] .team-tag { color: color-mix(in srgb, var(--h) 60%, #fff); }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.flag svg { width: 13px; height: 13px; }
.flag.high { color: var(--danger); }
.flag.med { color: var(--warn); }
.flag.low { color: var(--muted); }

.kmenu { position: relative; margin-left: auto; }
.kmenu-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.kmenu-btn:hover, .kmenu-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.kmenu-btn svg { width: 18px; height: 18px; }
.kmenu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.22); transform-origin: top right; animation: pop var(--dur-2) var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.kmenu-list[hidden] { display: none; }
.kmenu-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: left; font-size: 13px;
}
.kmenu-list button:hover, .kmenu-list button:focus-visible { background: var(--surface-2); outline: none; }
.kmenu-list button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin: 0 4px; }
.kmenu-list button svg { width: 15px; height: 15px; }
.kmenu-list .danger { color: var(--danger); }
.kmenu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 4px; }

.kcard-title { font-size: 16px; font-weight: 600; margin: 16px 0 16px; line-height: 1.35; }
.kcard-title.is-done { text-decoration: line-through; color: var(--muted); }
.kcard-open { all: unset; cursor: pointer; border-radius: 8px; }
.kcard-open:hover { color: var(--accent-2); }
.kcard-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kbar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.kbar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.kcard-foot { display: flex; align-items: center; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.kcard-foot > span:not(.stack) { display: inline-flex; align-items: center; gap: 4px; }
.kcard-foot svg { width: 14px; height: 14px; }
.kcard-foot .late { color: var(--danger); font-weight: 600; }
.stack { margin-left: auto; display: flex; }
.avatar-xs { width: 30px; height: 30px; font-size: 10px; border: 2px solid var(--surface); }
.stack .avatar-xs + .avatar-xs { margin-left: -8px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 620px) {
  .kboard { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .task-toolbar { flex-direction: column; align-items: stretch; }
}

/* ---------- Calendar page ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
.cal-card { padding: 24px 24px; }
.cal-title { font-size: 22px !important; font-weight: 600; letter-spacing: -.02em; }
.cal-nav { display: flex; gap: 8px; }
.nav-circle { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.nav-circle:hover { background: var(--line); }
.nav-circle svg { width: 18px; height: 18px; }

.cgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cdow { text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 0 8px; }
.cday {
  min-height: 96px; border-radius: 12px; background: var(--surface-2); border: 2px solid transparent;
  padding: 12px 8px 8px; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  text-align: left; cursor: pointer; min-width: 0; transition: background var(--dur-2) ease, border-color var(--dur-2) ease;
}
.cday:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); }
.cday.other { background: transparent; }
.cday.other .cnum { color: var(--muted); opacity: .6; }
.cnum { font-weight: 600; font-size: 14px; padding-left: 8px; height: 28px; display: flex; align-items: center; margin-bottom: 4px; }
.cday.today { border-color: var(--accent); background: var(--surface); }
.cday.today .cnum { width: 28px; padding: 0; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; margin-left: 4px; }
.cday.sel:not(.today) { border-color: var(--text); }
.chip-ev {
  display: block; font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 8px;
  color: var(--h); background: color-mix(in srgb, var(--h) 13%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] .chip-ev { color: color-mix(in srgb, var(--h) 55%, #fff); }
.more-ev { font-size: 11px; color: var(--muted); padding-left: 8px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 24px; color: var(--muted); font-size: 13px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

.cal-side { display: flex; flex-direction: column; gap: 16px; }
.kicker { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
[data-theme="dark"] .kicker { color: var(--accent-2); }
.day-title { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin: 4px 0 20px; }
.day-list { display: flex; flex-direction: column; gap: 12px; }
.day-ev {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface-2); border-left: 3px solid var(--h);
}
.day-time b { display: block; font-weight: 500; font-size: 13px; }
.day-time small { color: var(--muted); font-size: 11px; }
.day-body { min-width: 0; }
.day-body strong { display: block; font-weight: 600; font-size: 16px; }
.day-type { display: block; font-size: 13px; color: var(--h); margin: 2px 0 8px; }
[data-theme="dark"] .day-type { color: color-mix(in srgb, var(--h) 55%, #fff); }
.day-body .stack { margin-left: 0; }
.day-empty { color: var(--muted); padding: 12px 0 4px; }

.upcoming { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.up-item {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 8px 8px; border: 0; border-radius: 12px;
  background: none; cursor: pointer; text-align: left;
}
.up-item:hover { background: var(--surface-2); }
.up-item strong { display: block; font-weight: 500; font-size: 16px; }
.up-item small { color: var(--muted); font-size: 13px; }
.datebox {
  width: 46px; height: 52px; border-radius: 12px; background: var(--accent-soft); flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.datebox small { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.datebox b { font-size: 18px; color: var(--accent); }
[data-theme="dark"] .datebox b { color: var(--accent-2); }

@media (max-width: 1280px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .cal-card { padding: 16px 12px; }
  .cgrid { gap: 4px; }
  .cday { min-height: 54px; padding: 8px 2px; align-items: center; border-radius: 8px; }
  .cnum { padding: 0; margin: 0; }
  .cday.today .cnum { margin-left: 0; }
  .chip-ev { width: 6px; height: 6px; padding: 0; font-size: 0; border-radius: 50%; background: var(--h); display: inline-block; }
  .cday { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
  .cnum { flex-basis: 100%; justify-content: center; }
  .more-ev { display: none; }
  .day-ev { grid-template-columns: 64px 1fr; }
}

/* ---------- Analytics page ---------- */
.head-actions { align-items: center; }
.an-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.an-wide { grid-column: span 3; }
.an-side { grid-column: span 1; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.kpi { position: relative; overflow: hidden; padding-bottom: 0; display: flex; flex-direction: column; }
.kpi-label { color: var(--muted); font-size: 16px; }
.kpi-value { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin: 12px 0 8px; }
.kpi-delta { font-size: 13px; color: var(--muted); }
.kpi-delta span { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin-right: 4px; }
.kpi-delta svg { width: 13px; height: 13px; }
.kpi-delta.good span { color: var(--accent); }
.kpi-delta.bad span { color: var(--danger); }
[data-theme="dark"] .kpi-delta.good span { color: var(--accent-2); }
.spark { display: block; width: calc(100% + 44px); height: 56px; margin: 12px -24px 0; }

.line-legend { display: flex; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.line-legend span, .tp-tip span { display: inline-flex; align-items: center; gap: 8px; }
.line-legend i, .tp-tip i { width: 16px; height: 0; border-top: 2.5px solid var(--accent); }
.line-legend i.dash, .tp-tip i.dash { border-top: 2px dashed var(--muted); }

.tp-wrap { position: relative; }
.tp { width: 100%; height: auto; display: block; touch-action: pan-y; }
.tp .grid { stroke: var(--line); }
.tp .axis { fill: var(--muted); font-size: 11px; }
.tp-rule { stroke: var(--muted); stroke-dasharray: 3 3; }
.tp-dot.cur { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.tp-dot.prev { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.tp-hit { cursor: crosshair; }
.tp-tip {
  position: absolute; pointer-events: none; display: flex; flex-direction: column; gap: 4px;
  background: var(--text); color: var(--surface); padding: 8px 12px; border-radius: 8px; font-size: 13px; white-space: nowrap;
}
.tp-tip[hidden] { display: none; }
.tp-tip i { border-top-color: var(--accent-2); }
.tp-tip i.dash { border-top-color: currentColor; opacity: .7; }

.donut { position: relative; max-width: 230px; margin: 4px auto 24px; }
.donut svg { width: 100%; height: auto; }
.donut circle { transition: opacity var(--dur-2) ease; }
.donut circle:hover { opacity: .8; }
.donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-label b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.donut-label small { color: var(--muted); font-size: 13px; }
.donut-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.donut-list li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.donut-list i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.donut-list span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-list b { font-weight: 600; }

.heat-legend { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.heat span { aspect-ratio: 1.15; border-radius: 8px; min-width: 0; }
.l0 { background: var(--surface-2); }
.l1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.l2 { background: color-mix(in srgb, var(--accent) 50%, var(--surface)); }
.l3 { background: var(--accent); }
.l4 { background: var(--accent-3); }

.contrib { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.contrib li { display: flex; align-items: center; gap: 12px; }
.contrib li > div { flex: 1; min-width: 0; }
.contrib p { display: flex; justify-content: space-between; margin-bottom: 8px; }
.contrib strong { font-weight: 600; }
.contrib p span { color: var(--muted); font-size: 13px; }

@media (max-width: 1280px) {
  .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-wide, .an-side { grid-column: span 2; }
}
@media (max-width: 620px) {
  .an-grid { grid-template-columns: 1fr; }
  .an-wide, .an-side { grid-column: span 1; }
  .heat { gap: 2px; }
  .heat span { border-radius: 3px; }
}

/* ---------- Team page ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 20px 20px; }
.person-avatar { position: relative; display: inline-block; margin-bottom: 16px; }
.person-avatar .avatar { width: 76px; height: 76px; font-size: 22px; font-weight: 600; }
.presence { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--surface); background: #9aa29d; }
.presence.online { background: #3fae6a; }
.presence.away { background: #e0a43a; }
.person h3 { font-size: 16px; font-weight: 600; }
.person-role { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.dept-tag { font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .dept-tag { color: var(--accent-2); }
.person-stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.person-stats b { display: block; font-size: 18px; font-weight: 700; }
.person-stats small { color: var(--muted); font-size: 13px; }
.workload { display: flex; justify-content: space-between; width: 100%; color: var(--muted); font-size: 13px; margin: 20px 0 8px; }
.person .kbar { width: 100%; }
.kbar.hot i { background: var(--warn); }
.person-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 20px; }
.person-actions .btn { padding: 12px 12px; }
.person-actions .btn-outline { padding: 8px 12px; }
.card.empty { padding: 40px 20px; }

.profile-card { width: min(460px, 100%); }
.profile-top { display: flex; align-items: center; gap: 16px; }
.profile-top .person-avatar { margin: 0; }
.profile-top h3 { font-size: 18px; }
.profile-top .person-role { margin: 2px 0 8px; }
.presence-text { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.presence-text .presence { position: static; width: 9px; height: 9px; border: 0; }
.profile-card .person-stats { text-align: center; margin-bottom: 8px; }
.profile-card h4 { margin: 12px 0 8px; font-size: 14px; }
.profile-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.profile-tasks li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 12px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.profile-tasks small { color: var(--muted); white-space: nowrap; }

/* ---------- Settings page ---------- */
.settings-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.settings-nav button {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-radius: 12px;
  background: none; cursor: pointer; color: var(--muted); font-size: 16px; text-align: left;
  transition: background var(--dur-2) ease, color var(--dur-2) ease;
}
.settings-nav button svg { width: 18px; height: 18px; }
.settings-nav button:hover { background: var(--surface-2); color: var(--text); }
.settings-nav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent-3); font-weight: 600; }
[data-theme="dark"] .settings-nav button[aria-current="page"] { color: var(--accent-2); }
.settings-panel { padding: 32px; min-height: 460px; }
.settings-panel h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.panel-sub { color: var(--muted); margin: 8px 0 24px; font-size: 14px; }
.panel-note { color: var(--muted); font-size: 13px; margin-top: 16px; }
.settings-panel .label { font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 24px 0 12px; }
.settings-panel .panel-sub + .label { margin-top: 0; }

.accent-row { display: flex; flex-wrap: wrap; gap: 12px; }
.accent-chip {
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 12px;
  border: 2px solid transparent; background: var(--surface-2); cursor: pointer; font-size: 16px; min-height: 48px;
  transition: border-color var(--dur-2) ease, background var(--dur-2) ease;
}
.accent-chip:hover { background: var(--line); }
.accent-chip i { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 80%, #fff), color-mix(in srgb, var(--c) 75%, #000)); }
.accent-chip[aria-checked="true"] { border-color: var(--c, var(--accent-3)); background: var(--surface); border-color: var(--accent-3); }
[data-theme="dark"] .accent-chip[aria-checked="true"] { border-color: var(--accent-2); }

.pill-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pill-group button {
  padding: 12px 20px; border-radius: 999px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px;
  min-height: 44px; transition: background var(--dur-2) ease, color var(--dur-2) ease;
}
.pill-group button:hover { background: var(--line); }
.pill-group button[aria-checked="true"] { background: var(--accent); color: #fff; }

.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.profile-row .avatar { width: 64px; height: 64px; font-size: 18px; }
.profile-row strong { display: block; font-size: 16px; font-weight: 600; }
.profile-row small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 640px; }
.form-grid label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .input { height: 46px; font-size: 16px; font-weight: 400; }
.danger-btn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent) !important; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
  .settings-nav button { white-space: nowrap; }
  .settings-panel { padding: 20px; min-height: 0; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Help page ---------- */
.help-hero {
  border-radius: var(--radius); padding: 32px 32px 32px; color: #fff; margin-bottom: 16px;
  background:
    repeating-radial-gradient(circle at 95% -20%, transparent 0 22px, rgba(255,255,255,.05) 22px 23px),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 80%, #000), color-mix(in srgb, var(--accent) 40%, #000));
}
.help-hero h2 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }
.help-hero > p { opacity: .8; margin: 8px 0 24px; }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.topic {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 12px; text-align: left; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); transition: background var(--dur-2) ease, border-color var(--dur-2) ease;
}
.topic:hover { background: rgba(255,255,255,.12); }
.topic[aria-pressed="true"] { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.6); }
.topic svg { width: 22px; height: 22px; flex: none; }
.topic strong { display: block; font-weight: 600; font-size: 16px; }
.topic small { opacity: .75; font-size: 13px; }
.topic:focus-visible { outline-color: #fff; }

.help-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
.help-side { display: flex; flex-direction: column; gap: 16px; }
.faq2 details { border-bottom: 1px solid var(--line); }
.faq2 details:last-child { border-bottom: 0; }
.faq2 summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 2px; font-weight: 600; font-size: 16px; border-radius: 8px;
}
.faq2 summary::-webkit-details-marker { display: none; }
.plus { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); flex: none; transition: background var(--dur-2) ease; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.8px; background: var(--text); transform: translate(-50%, -50%); border-radius: 2px; }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform var(--dur-3) var(--ease-out); }
.faq2 details[open] .plus { background: var(--accent-soft); }
.faq2 details[open] .plus::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq2 summary:hover .plus { background: var(--line); }
.faq2 details p { color: var(--muted); line-height: 1.65; padding: 0 44px 20px 2px; margin-top: -8px; }

.shortcuts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.shortcuts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shortcuts li > span:first-child { display: flex; gap: 8px; }
.shortcuts li > span:last-child { color: var(--muted); font-size: 14px; text-align: right; }
.shortcuts kbd {
  min-width: 26px; height: 26px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1.5px 0 var(--line); color: var(--text); font-size: 13px;
}

.stuck {
  color: #fff;
  background:
    repeating-radial-gradient(circle at 110% 120%, transparent 0 18px, rgba(255,255,255,.06) 18px 19px),
    linear-gradient(160deg, #1f3a2b, #0d1a13);
}
.stuck-icon { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #0d1a13; display: grid; place-items: center; margin-bottom: 24px; }
.stuck-icon svg { width: 17px; height: 17px; }
.stuck h3 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.stuck p { opacity: .8; margin: 12px 0 24px; }
.stuck-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stuck-actions .btn { padding: 16px; font-size: 16px; }
.stuck .btn-light { background: #eef5f0; color: #0d1a13; }
.btn-ghost-light { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.55); padding: 12px !important; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); }
.stuck .btn:focus-visible { outline-color: #fff; }

.kcard:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 16px; }

@media (max-width: 1280px) {
  .help-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .help-hero { padding: 24px 20px; }
  .help-hero h2 { font-size: 28px; }
  .topic-grid { grid-template-columns: 1fr; }
}

/* ---------- Task card move (View Transitions) ---------- */
/* Only the moved card animates; the rest of the board swaps instantly */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(moving-card) { animation-duration: var(--dur-4); animation-timing-function: var(--ease-in-out); }

/* ---------- Reduced motion ---------- */
/* Fewer and gentler, not none: fades and colour changes stay, movement goes */
@media (prefers-reduced-motion: reduce) {
  .view.entering { animation-name: fade-in; }
  .view.entering .bar { animation: none; }
  .kmenu-list { animation-name: fade-in; }
  @keyframes fade-in { from { opacity: 0; } }
  .btn:active, .round-btn:active { transform: none; }
  .arrow-btn:hover { transform: none; }
  .toast, .toast.show { transform: translate(-50%, 0); }
  .switch i::after, .plus::after, .sidebar.open, .sidebar.closing, .modal-card { transition: none; }
  @starting-style { .modal:not([hidden]) .modal-card { transform: none; } }
  .modal[hidden] .modal-card { transform: none; }
}

/* ---------- Sidebar: pinned logo, scrolling list, folding Finance group ---------- */
.sidebar { overflow: hidden; }
.sidebar-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -20px; padding: 0 20px 8px;   /* full-width scroll area; the active-item bar still reaches the edge */
  scrollbar-width: none;
}
.sidebar-scroll::-webkit-scrollbar { display: none; }
/* Scroll edge effect: a soft fade where there's more, never a hard cut */
.sidebar-scroll[data-fade="bottom"] { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.sidebar-scroll[data-fade="top"] { -webkit-mask-image: linear-gradient(transparent, #000 28px); mask-image: linear-gradient(transparent, #000 28px); }
.sidebar-scroll[data-fade="both"] { -webkit-mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent); }

.nav-disclosure {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 4px; margin: -2px -4px;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; border-radius: 8px;
}
.nav-disclosure:hover { color: var(--text); }
.nav-disclosure .chev { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur-2) var(--ease-out); margin-left: 2px; }
.nav-disclosure[aria-expanded="true"] .chev { transform: rotate(45deg) translate(-1px, -1px); }
.nav-finance .nav-sub, .nav-fitness .nav-sub { display: none; }
.nav-finance.open .nav-sub, .nav-fitness.open .nav-sub { display: flex; }

/* Shorter windows: a little tighter so the whole menu usually fits */
@media (max-height: 880px) {
  .nav a, .nav button { padding-top: 8px; padding-bottom: 8px; }
  .nav .nav-sub { padding-top: 8px; padding-bottom: 8px; }
  .nav-label { margin: 16px 12px 8px; }
  .brand { padding-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) { .nav-disclosure .chev, .sidebar-scrim { transition: none; } }

/* A setting that needs something Sprout does not have yet */
.field.is-off { opacity: .55; }

/* The drawer's backdrop only exists on narrow screens */
.sidebar-scrim { display: none; }
@media (max-width: 900px) { .sidebar-scrim { display: block; } }

/* ---------- Landing Pricing Grid & Cards ---------- */
.pricing-band {
  padding: 60px 0 40px;
}
.pricing-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}
.pricing-head h2 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 8px 0 12px;
}
.landing-plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 1024px) {
  .landing-plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .landing-plans-grid {
    grid-template-columns: 1fr;
  }
}

.landing-plan-card {
  position: relative;
  background: var(--surface, #141b16);
  border: 1px solid var(--line, #232e26);
  border-radius: 24px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.landing-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 222, 128, 0.4);
}
.landing-plan-highlight {
  border: 2px solid var(--accent, #4ade80);
  background: var(--surface-2, #18221b);
  box-shadow: 0 12px 32px rgba(74, 222, 128, 0.12);
}
.l-pill-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent, #4ade80);
  color: #0d120f;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.l-plan-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted, #86a390);
  margin-bottom: 12px;
}
.l-plan-badge.accent {
  background: rgba(74, 222, 128, 0.15);
  color: var(--accent, #4ade80);
}
.l-plan-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.l-plan-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  line-height: 1;
}
.l-plan-price small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #86a390);
  letter-spacing: 0;
}
.l-plan-desc {
  font-size: 13px;
  color: var(--muted, #86a390);
  line-height: 1.45;
  margin-bottom: 20px;
  min-height: 38px;
}
.l-plan-features {
  list-style: none;
  padding: 16px 0 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--line, #232e26);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
.l-plan-features li {
  position: relative;
  padding-left: 20px;
  line-height: 1.4;
  color: var(--text, #f0fdf4);
}
.l-plan-features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #4ade80);
}
.l-plan-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;
  margin-top: auto;
}
.l-btn-accent {
  background: var(--accent, #4ade80);
  color: #0d120f;
}
.l-btn-accent:hover {
  opacity: 0.9;
}
.l-btn-outline {
  background: transparent;
  color: var(--text, #f0fdf4);
  border: 1px solid var(--line, #232e26);
}
.l-btn-outline:hover {
  background: var(--surface-2, #1b261f);
  border-color: var(--accent, #4ade80);
}
.pricing-foot-terms {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--muted, #86a390);
  margin-top: 16px;
}

/* ==========================================================================
   Admin Console & Founder Privileges Styles
   ========================================================================== */
.badge-admin {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(74, 222, 128, 0.2)) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line, #232e26);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.admin-stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text, #f0fdf4);
  line-height: 1.1;
  margin-bottom: 4px;
}

.admin-stat-val.accent {
  color: var(--accent, #4ade80);
}

.admin-stat-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #86a390);
}

.admin-grant-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line, #232e26);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.admin-grant-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.admin-grant-form input,
.admin-grant-form select {
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface, #121a15);
  border: 1px solid var(--line, #232e26);
  color: var(--text, #f0fdf4);
  font-size: 14px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #232e26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.admin-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #86a390);
  font-weight: 600;
  border-bottom: 1px solid var(--line, #232e26);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text, #f0fdf4);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-tier-free {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
}

.badge-tier-plus {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
}

.badge-tier-community {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
}

.badge-tier-max {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
}
