/* Team Work — dark executive theme (slate / navy).
   Vanilla CSS, no build step. Mirrors the Work PWA's component vocabulary:
   KPI cards, domain filter chips, task cards with badges + context + next
   steps, timeline, radar panels, monthly completions. */

:root {
  color-scheme: dark;
  --bg: #0a0f1c;
  --bg-2: #0d1424;
  --panel: #111a2e;
  --panel-2: #172238;
  --panel-3: #1c2740;
  --ink: #e9eef7;
  --muted: #93a0b8;
  --faint: #64748f;
  --line: #233151;
  --line-soft: #1a2540;
  --accent: #2dd4bf;
  --accent-deep: #0d9488;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-ink: #5eead4;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --shadow: 0 18px 48px rgba(2, 6, 16, 0.55);
  --bg-glow: #14203c;
  --topbar-bg: rgba(10, 15, 28, 0.88);
  --subnav-bg: rgba(13, 20, 36, 0.7);
  --chip-hover-border: #2e4066;
  --banner-bg: #101d3d;
  --radius: 16px;
}

/* ---------------------------------------------------------------- light theme
   Activated via [data-theme="light"] on <html>. Every color flows through
   variables so the whole app re-skins. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-2: #e9eef7;
  --panel: #ffffff;
  --panel-2: #eef2f9;
  --panel-3: #e2e9f5;
  --ink: #17233a;
  --muted: #5a6b87;
  --faint: #8b98b0;
  --line: #d8e0f0;
  --line-soft: #e6ecf7;
  --accent: #0d9488;
  --accent-deep: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.10);
  --accent-ink: #0f766e;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.10);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.10);
  --shadow: 0 18px 48px rgba(23, 35, 58, 0.10);
  --bg-glow: #d9e6fb;
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --subnav-bg: rgba(255, 255, 255, 0.72);
  --chip-hover-border: #b9c6de;
  --banner-bg: #dbe7fb;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, var(--bg-glow) 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::placeholder { color: var(--faint); }
.hidden { display: none !important; }

#app { flex: 1; display: flex; flex-direction: column; max-width: 1280px; width: 100%; margin: 0 auto; min-height: 100dvh; }

/* ---------------------------------------------------------------- topbar */

#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(14px, 4vw, 30px);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; font-size: 17px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  box-shadow: 0 4px 14px rgba(45, 212, 191, 0.35);
}
#primary-nav { display: flex; gap: 4px; margin-right: auto; }
#primary-nav a {
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
}
#primary-nav a:hover { color: var(--ink); background: var(--panel-2); }
#primary-nav a.active { color: var(--accent-ink); background: var(--accent-soft); border-color: rgba(45,212,191,0.25); }
.userbox { display: flex; align-items: center; gap: 10px; }
.user-menu { display: contents; }
.more-btn { display: none; }
#user-name { color: var(--muted); font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- subnav */

#subnav {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 10px clamp(14px, 4vw, 30px);
  border-bottom: 1px solid var(--line-soft);
  background: var(--subnav-bg);
}
#subnav::-webkit-scrollbar { display: none; }
/* #93 (QA): a visible scroll cue. When tabs overflow, the clipped side(s)
   fade out (classes set by updateSubnavCue in app.js), so it's obvious
   there's more to swipe to. */
#subnav.cue-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
#subnav.cue-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
#subnav.cue-left.cue-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
#subnav a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 11px; border: 1px solid transparent;
}
#subnav a svg { width: 16px; height: 16px; }
#subnav a:hover { color: var(--ink); background: var(--panel-2); }
#subnav a.active { color: var(--ink); background: var(--panel-3); border-color: var(--line); }
#subnav a.active svg { color: var(--accent); }

/* ---------------------------------------------------------------- teams nav */
/* Persistent team switcher: sits below the topbar, above the section subnav.
   "Teams" section listing each membership as a pill with a pending-items
   badge; "+ New" opens the create-team dialog. */

#teams-nav {
  display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none;
  padding: 8px clamp(14px, 4vw, 30px);
  border-bottom: 1px solid var(--line-soft);
  background: var(--subnav-bg);
}
#teams-nav::-webkit-scrollbar { display: none; }
.teams-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); margin-right: 4px; white-space: nowrap;
}
.team-pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-soft);
  background: var(--panel-2); cursor: pointer; font-family: inherit;
}
.team-pill:hover { color: var(--ink); border-color: var(--line); }
.team-pill.active { color: var(--ink); background: var(--panel-3); border-color: var(--accent); }
.pill-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.team-pill.team-add { border-style: dashed; color: var(--faint); background: transparent; }
.team-pill.team-add:hover { color: var(--accent-ink); border-color: var(--accent); }
.teams-empty { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

/* ---------------------------------------------------------------- teams view */

.team-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 8px; }
.team-card h4 { margin: 0 0 4px; font-size: 15.5px; color: var(--ink); }
.team-card .desc { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 6px 0 10px; }
.team-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge-privacy-open { color: var(--accent-ink); }
.badge-privacy-request { color: var(--warn); }
.badge-privacy-invite_only { color: var(--muted); }
.role-badge { text-transform: capitalize; }

/* ---------------------------------------------------------------- layout */

#view { flex: 1; padding: 20px clamp(14px, 4vw, 30px) 30px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 2px 0 16px; }
.view-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.view-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 22px 2px 12px; }
.section-heading h3 { margin: 0; font-size: 17px; letter-spacing: -0.015em; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.link-btn { border: 0; background: transparent; color: var(--accent-ink); font-weight: 700; font-size: 13px; padding: 8px 4px; }

/* ---------------------------------------------------------------- footer */

#footer {
  border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 12px; text-align: center;
  padding: 16px; letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------- buttons / forms */

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  border-radius: 11px; padding: 10px 16px; font-weight: 700; font-size: 13px;
}
.btn:hover { background: var(--panel-3); border-color: #2e4066; }
.btn-primary { background: var(--accent-deep); border-color: transparent; color: #04120f; }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn-danger { background: var(--danger-soft); border-color: rgba(248,113,113,0.3); color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; white-space: nowrap; }

input, select, textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(45,212,191,0.15); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.form-grid .full { grid-column: 1 / -1; }

.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.error-box {
  background: var(--danger-soft); border: 1px solid rgba(248,113,113,0.35); color: var(--danger);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 10px 0;
}
.loading { color: var(--muted); padding: 26px; text-align: center; font-size: 13px; }
.empty { color: var(--muted); padding: 30px 20px; text-align: center; font-size: 13.5px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------------------------------------------------------------- badges */

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 3px 9px;
  border-radius: 7px; background: var(--panel-3); color: var(--muted);
  border: 1px solid var(--line); font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
}
.badge.domain { color: var(--accent-ink); border-color: rgba(45,212,191,0.3); background: var(--accent-soft); }
.badge.status-active { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.badge.status-waiting { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.status-blocked { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.status-completed { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.status-parked, .badge.status-inbox { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge.p1 { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.p2 { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.p3 { color: var(--muted); background: var(--panel-3); border-color: transparent; }
.badge.overdue { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.due { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

/* ---------------------------------------------------------------- today */

.hero { display: grid; gap: 14px; margin-bottom: 8px; }
.brief-card { background: var(--panel); }
.brief-card h1 { font-size: 26px; letter-spacing: -0.03em; margin: 0 0 6px; }
.brief-card > p { color: var(--muted); margin: 0 0 4px; font-size: 13.5px; }
.pulse { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.pulse-item { padding: 0 14px; border-right: 1px solid var(--line-soft); }
.pulse-item:first-child { padding-left: 0; }
.pulse-item:last-child { border-right: 0; }
.pulse-value { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pulse-item.alert .pulse-value { color: var(--warn); }
.pulse-label { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.clock-list { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 4px 16px; }
.clock-item { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.clock-item:last-child { border-bottom: 0; }
.clock-time { color: var(--accent-ink); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-title { font-size: 13.5px; line-height: 1.4; }

.nudge {
  display: flex; gap: 12px; align-items: center; margin-top: 14px;
  background: var(--warn-soft); border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer; width: 100%; text-align: left; color: var(--ink);
}
.nudge strong { display: block; font-size: 13.5px; }
.nudge span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.priority-list { display: grid; gap: 10px; grid-template-columns: 1fr; }
.priority-card {
  display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 12px; align-items: start;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 15px; text-align: left; width: 100%; color: var(--ink);
}
.priority-card:hover { border-color: rgba(45,212,191,0.4); }
.rank {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
.priority-title { display: block; font-weight: 700; line-height: 1.3; font-size: 14.5px; margin-top: 4px; }
.priority-detail { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.45; }
.priority-next { display: block; margin-top: 8px; font-size: 12.5px; }
.priority-next strong { color: var(--accent-ink); }

/* ---------------------------------------------------------------- top 10 */

.top10-list { display: grid; gap: 12px; }
.top10-card {
  display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 14px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px; cursor: pointer; text-align: left; width: 100%; color: var(--ink);
}
.top10-card:hover { border-color: rgba(45,212,191,0.4); }
.top10-rank { font-size: 24px; font-weight: 700; color: var(--accent); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.top10-card h3 { font-size: 15.5px; margin: 0; line-height: 1.3; }
.top10-card .detail { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.top10-card .next-line { margin: 10px 0 0; font-size: 13px; }
.top10-card .next-line strong { color: var(--accent-ink); }
.top10-meta { display: flex; gap: 10px; align-items: center; color: var(--faint); font-size: 12px; margin-bottom: 14px; }
.badge.acuity-chip { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; font-variant-numeric: tabular-nums; }
.badge.rank-source { color: var(--muted); background: var(--panel-3); border-color: transparent; }
.badge.rank-source-llm { color: var(--info); background: var(--info-soft); }
.badge.wait-age { color: var(--muted); background: var(--panel-3); border-color: transparent; font-variant-numeric: tabular-nums; }
.badge.wait-age.warn { color: var(--warn); background: var(--warn-soft); }
.badge.wait-age.overdue { color: var(--danger); background: var(--danger-soft); }

/* ------------------------------------------------- manual Top 10 (019) */
.top10-card { position: relative; }
.t10-grip { display: block; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; color: var(--faint); font-size: 14px; line-height: 1; padding: 2px 0 6px; letter-spacing: 2px; }
.t10-grip:active { cursor: grabbing; }
.t10-ctl-wrap { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; }
.t10-ctl { cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1; padding: 6px 7px; border-radius: 6px; user-select: none; -webkit-user-select: none; }
.t10-ctl:hover { color: var(--ink); background: var(--panel-3); }
.t10-remove:hover { color: var(--danger); }
.t10-off { opacity: 0.25; pointer-events: none; }
.t10-pin { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.t10-hint { color: var(--faint); font-size: 12px; line-height: 1.5; margin: -6px 0 14px; }
.t10-src-dim { opacity: 0.35; }
.t10-drag-clone { position: fixed; z-index: 9999; pointer-events: none; opacity: 0.94; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); margin: 0; }
.t10-drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.t10-drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.t10-panel { margin-top: 24px; }
.t10-panel h3 { font-size: 15.5px; margin: 0 0 4px; }
.t10-panel-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.t10-search { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.t10-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 8px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; }
.t10-row-grip { padding: 2px 0; }
.t10-row-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t10-row-meta { color: var(--faint); font-size: 12px; white-space: nowrap; }
.t10-add { margin-left: auto; font-size: 16px; padding: 4px 9px; }
.t10-row-empty { color: var(--faint); font-size: 13px; padding: 10px 2px; }

/* ---------------------------------------------------------------- tasks */

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box svg { position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; color: var(--faint); }
.search-box input { padding-left: 40px; }
.filter-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.filter-strip::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px;
  background: var(--panel); font-size: 12px; font-weight: 600; color: var(--muted);
}
.chip:hover { color: var(--ink); border-color: var(--chip-hover-border); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { opacity: 0.65; font-variant-numeric: tabular-nums; }

.task-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .task-list { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1100px) { .task-list { grid-template-columns: repeat(3, minmax(0,1fr)); } }

/* Needs me groups: two columns on desktop so the section doesn't run one
   long column; single column below the app's 720px breakpoint (same
   pattern as .task-list). The grid flows in DOM order. */
.needs-me-groups { display: grid; gap: 4px 24px; grid-template-columns: minmax(0,1fr); align-items: start; }
@media (min-width: 720px) { .needs-me-groups { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.needs-me-group { min-width: 0; }
.task-row {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 14px 15px; cursor: pointer; text-align: left; width: 100%; color: var(--ink);
}
.task-row:hover { border-color: rgba(45,212,191,0.4); }
.task-row h3 { font-size: 15px; margin: 0; line-height: 1.35; }
.task-row .nextline { color: var(--muted); font-size: 12.5px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .row-actions { display: flex; gap: 8px; margin-top: 4px; }
.task-count { color: var(--faint); font-size: 12px; margin: 0 2px 10px; }

/* ---------------------------------------------------------------- detail popup */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 7, 16, 0.7);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  backdrop-filter: blur(3px);
}
.modal {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px 22px 0 0;
  padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { font-size: 21px; line-height: 1.25; letter-spacing: -0.02em; margin: 10px 0 4px; }
.modal .meta-line { color: var(--faint); font-size: 12px; margin-bottom: 4px; }
.detail-section { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 16px; }
.detail-section h4 {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px;
  color: var(--faint); margin: 0 0 9px; font-weight: 700;
}
.detail-section p { font-size: 14px; line-height: 1.6; margin: 0; color: var(--ink); white-space: pre-wrap; }
.next-box { background: var(--accent-soft); border: 1px solid rgba(45,212,191,0.25); color: var(--ink); border-radius: 13px; padding: 13px 14px; font-size: 14px; line-height: 1.5; }
.next-box strong { color: var(--accent-ink); display: block; font-size: 11px; letter-spacing: 0.06em; margin-bottom: 4px; }
.wait-box { background: var(--warn-soft); border: 1px solid rgba(251,191,36,0.25); border-radius: 13px; padding: 13px 14px; font-size: 13.5px; }
.block-box { background: var(--danger-soft); border: 1px solid rgba(248,113,113,0.3); border-radius: 13px; padding: 13px 14px; font-size: 13.5px; }

.subtask { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.subtask:last-child { border-bottom: 0; }
.subtask input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); flex: 0 0 auto; }
.subtask span { flex: 1; font-size: 13.5px; }
.subtask.done span { text-decoration: line-through; color: var(--faint); }
.subtask .del { border: 0; background: transparent; color: var(--faint); font-size: 16px; line-height: 1; padding: 6px; }
.subtask .del:hover { color: var(--danger); }
.addrow { display: flex; gap: 8px; margin-top: 10px; }

.note { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; }
.note p { font-size: 13.5px; margin: 0; line-height: 1.5; white-space: pre-wrap; }
.note .who { color: var(--faint); font-size: 11.5px; margin-top: 6px; }

.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.modal-actions .spacer { flex: 1; }

/* ---------------------------------------------------------------- focus */

.focus-workspace { display: grid; gap: 16px; }
.focus-count { color: var(--accent-ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.focus-stack { display: grid; gap: 12px; }
.focus-card { background: var(--panel); }
.focus-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.focus-label { color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.focus-card h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.02em; margin: 8px 0 0; }
.focus-copy { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.focus-copy h4, .focus-next strong { text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; color: var(--faint); font-weight: 700; }
.focus-copy p { font-size: 14px; line-height: 1.55; margin: 7px 0 0; white-space: pre-wrap; }
.focus-next { margin-top: 14px; background: var(--accent-soft); border: 1px solid rgba(45,212,191,0.25); border-radius: 13px; padding: 13px 14px; font-size: 13.5px; }
.focus-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.focus-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 34px 22px; text-align: center; color: var(--muted); }
.focus-empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.focus-empty p { font-size: 13px; line-height: 1.5; margin: 0 auto 16px; max-width: 44ch; }

.focus-rail { display: grid; gap: 14px; align-content: start; }
.rail-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.rail-card h3 { font-size: 14px; margin: 0 0 6px; }
.rail-card .hint { color: var(--faint); font-size: 12px; margin: 0 0 10px; }
.timer-display { font-size: clamp(44px, 7vw, 58px); font-weight: 700; letter-spacing: -0.05em; text-align: center; margin: 14px 0; font-variant-numeric: tabular-nums; }
.timer-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.timer-preset { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-size: 11.5px; font-weight: 700; padding: 9px 4px; color: var(--muted); }
.timer-preset.active { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(45,212,191,0.35); }
.timer-controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.timer-primary { min-height: 44px; border: 0; border-radius: 11px; font-weight: 700; background: var(--accent-deep); color: #04120f; }
.timer-reset { width: 46px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 11px; font-size: 17px; color: var(--muted); }

.calendar-event { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.calendar-event:first-child { border-top: 0; padding-top: 2px; }
.calendar-time { color: var(--accent-ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.calendar-title { font-size: 12.5px; line-height: 1.4; }
.calendar-empty { color: var(--faint); font-size: 12.5px; line-height: 1.5; }

/* ---------------------------------------------------------------- timeline */

.timeline-list { position: relative; margin: 4px 0 0 8px; }
.timeline-list:before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 12px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 20px 36px; }
.timeline-item:before {
  content: ""; position: absolute; left: 1px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--panel); border: 4px solid var(--accent-deep);
}
.timeline-item.kind-milestone:before { border-color: var(--info); }
.timeline-item.kind-event:before { border-color: var(--warn); }
.timeline-item.overdue h3 { color: var(--danger); }
.timeline-date { font-size: 11.5px; color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline-item h3 { font-size: 15px; margin: 6px 0 0; line-height: 1.4; }

/* ---------------------------------------------------------------- dashboard */

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px; cursor: pointer; text-align: left; width: 100%; color: var(--ink);
}
.kpi:hover { border-color: rgba(45,212,191,0.4); }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpi .value.danger { color: var(--danger); }
.kpi .value.warn { color: var(--warn); }
.kpi .label { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }

.radar-grid { display: grid; gap: 14px; }
.radar-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.radar-item { padding: 11px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.radar-item:last-child { border-bottom: 0; }
.radar-item .rtitle { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.radar-item .rmeta { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.radar-item .rmeta strong { color: var(--warn); font-weight: 700; }
.radar-item.blocked .rmeta strong { color: var(--danger); }

.pressure-row {
  display: grid; grid-template-columns: 84px minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.pressure-row:last-child { border-bottom: 0; }
.pressure-date { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.pressure-row.overdue .pressure-date { color: var(--danger); }
.pressure-row .ptitle { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.pressure-row .psub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.bar-row { display: grid; grid-template-columns: 150px minmax(0,1fr) 40px; gap: 10px; align-items: center; margin-bottom: 10px; }
.bar-label { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--panel-3); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.bar-count { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.accordion { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.accordion-head {
  width: 100%; border: 0; background: transparent; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 700; font-size: 14px; text-align: left;
}
.accordion-head .count { color: var(--faint); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.accordion-body { display: none; padding: 0 12px 12px; }
.accordion.open .accordion-body { display: grid; gap: 9px; }
.full-card { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 13px; padding: 14px; cursor: pointer; }
.full-card:hover { border-color: rgba(45,212,191,0.4); }
.full-card h3 { font-size: 14px; margin: 0 0 8px; line-height: 1.35; }
.full-card p { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 8px 0 0; }
.full-card p strong { color: var(--ink); }

.track-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 15px; margin-bottom: 10px; }
.track-card h3 { font-size: 14px; margin: 0 0 6px; }
.track-card p { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.track-card .owner { color: var(--accent-ink); font-weight: 700; font-size: 12px; }

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

.member-grid { display: grid; gap: 12px; }
.member-card h4 { margin: 0; font-size: 16px; }
.member-card .email { color: var(--faint); font-size: 12px; margin-top: 3px; }
.stat-row { display: flex; gap: 18px; margin: 12px 0; flex-wrap: wrap; }
.stat-row span { color: var(--muted); font-size: 12.5px; }
.stat-row b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; margin-left: 4px; }
.stat-row b.risk { color: var(--warn); }
.focus-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.attn-wrap { overflow-x: auto; }
table.attn { width: 100%; border-collapse: collapse; font-size: 13px; }
table.attn th { text-align: left; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.attn td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.attn tr[data-id] { cursor: pointer; }
table.attn tr[data-id]:hover td { background: rgba(45,212,191,0.05); }
table.attn tr:last-child td { border-bottom: 0; }

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

.login-wrap { min-height: 70dvh; display: grid; place-items: center; padding: 30px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 20px; padding: 30px 26px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }

/* ---------------------------------------------------------------- toast */

#toast-root { position: fixed; z-index: 200; left: 50%; bottom: 30px; transform: translateX(-50%); pointer-events: none; }
.toast {
  background: var(--panel-3); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 18px; border-radius: 13px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); max-width: 88vw; text-align: center; margin-top: 8px;
}
.toast.error { border-color: rgba(248,113,113,0.5); color: var(--danger); }

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

@media (min-width: 700px) {
  .hero { grid-template-columns: minmax(0,1.25fr) minmax(280px,0.75fr); align-items: start; }
  .top10-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .radar-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .modal-backdrop { align-items: center; padding: 28px; }
  .modal { border-radius: 22px; }
  .focus-workspace { grid-template-columns: minmax(0,1.45fr) minmax(280px,0.55fr); align-items: start; }
  .focus-rail { position: sticky; top: 120px; }
  .member-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .top10-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .priority-card { grid-template-columns: 32px minmax(0,1fr); }
  .pressure-row { grid-template-columns: 72px minmax(0,1fr); }
  .pressure-row .row-actions { display: none; }
  .bar-row { grid-template-columns: 104px minmax(0,1fr) 34px; }
  .userbox #user-name { display: none; }
}
/* Phones (Alex uses one): the top bar used to be a single non-wrapping row.
   The user box (bell, + New task, Settings, Password, Sign out) plus the
   nav made the page 813px wide at 375px, so fixed/centered panels like the
   task popup were laid out off-screen. On narrow screens the bar wraps:
   brand, then the user box (its buttons wrap, all visible) and the nav
   (scrolls sideways inside its row) each get a full-width row, so the
   page never gets wider than the screen.
   DON'T add a min-width or nowrap to these rows without re-checking 375px. */
@media (max-width: 720px) {
  /* #93: on phones the bar must not be wider than the screen (it was 813px
     at 375px and pushed the task popup off-screen). Two compact rows that
     stay sticky (Chief): row 1 = brand mark + actions, row 2 = nav. Both
     rows scroll sideways instead of widening the page. The user name is
     hidden; it's in Settings. */
  #topbar { flex-wrap: wrap; row-gap: 6px; column-gap: 8px; padding-top: 8px; padding-bottom: 6px; }
  #topbar > * { min-width: 0; }
  .brand-name, #user-name { display: none; }
  .userbox {
    order: 2; flex: 1 1 0; flex-wrap: nowrap; gap: 4px;
    overflow-x: auto; scrollbar-width: none;
  }
  .userbox::-webkit-scrollbar { display: none; }
  .userbox > * { flex: 0 0 auto; }
  /* Right-align with an auto margin, not justify-content:flex-end: with
     flex-end the overflow spills off the LEFT edge, where it can never be
     scrolled to (the bell became unreachable at 375px). */
  .userbox > :first-child { margin-left: auto; }
  .userbox .btn { padding: 6px 9px; font-size: 13px; }
  #primary-nav {
    order: 3; flex: 1 1 100%; margin-right: 0;
    overflow-x: auto; scrollbar-width: none;
  }
  #primary-nav::-webkit-scrollbar { display: none; }
  #primary-nav a { flex: 0 0 auto; padding: 6px 12px; }
  /* #93 (QA, 375/390px): Sign out ran off-screen. The user box no longer
     scrolls; Settings/Password/Sign out sit in a "More" dropdown, so row 1
     is just brand, bell, + New task and More, which always fit. The
     header stays two rows, well under the 195px budget. */
  .userbox { overflow: visible; position: relative; }
  .more-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 !important; font-size: 20px; line-height: 1; }
  .user-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
    flex-direction: column; align-items: stretch; gap: 2px; min-width: 170px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 6px; box-shadow: var(--shadow);
  }
  .user-menu.open { display: flex; }
  .user-menu .btn { min-height: 44px; justify-content: flex-start; text-align: left; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- privacy-first team model */

.badge.escalated { color: var(--info); background: var(--info-soft); border-color: transparent; }

/* Settings: membership radio cards */
.radio-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 15px; cursor: pointer; margin: 0;
}
.radio-card:hover { border-color: #2e4066; }
.radio-card.disabled { opacity: 0.5; cursor: default; }
.radio-card input[type="radio"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.radio-card strong { display: block; font-size: 14px; color: var(--ink); }
.radio-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.5; font-weight: 400; }

/* Team view: visually distinct blue treatment */
.team-banner {
  background: var(--banner-bg);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 6px;
  box-shadow: var(--shadow);
}
.team-banner h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.team-banner h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  background: var(--info); margin-right: 10px; box-shadow: 0 0 12px rgba(96,165,250,0.8);
}
.team-banner p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.team-card { border-color: rgba(96, 165, 250, 0.18); }
.team-card:hover { border-color: rgba(96, 165, 250, 0.45); }
.team-row:hover { border-color: rgba(96, 165, 250, 0.45); }

/* Completed tab: weekly completion chart */
.week-chart { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; }
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.week-count { font-size: 12px; font-weight: 700; color: var(--ink); min-height: 16px; font-variant-numeric: tabular-nums; }
.week-fill { width: 100%; max-width: 44px; border-radius: 6px 6px 3px 3px; background: var(--accent); opacity: 0.85; }
.week-bar:nth-child(odd) .week-fill { opacity: 0.55; }
.week-label { font-size: 10.5px; color: var(--faint); white-space: nowrap; }

/* CMO Team issue tracker: 3-column cards + escalator tags */
.issue-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .issue-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1100px) { .issue-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.issue-card { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.issue-card:hover { border-color: var(--accent); }
.issue-card h4 { margin: 0; font-size: 16px; line-height: 1.35; }
.escalator-tag {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--tag, var(--accent)); background: color-mix(in srgb, var(--tag, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag, var(--accent)) 40%, transparent);
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.escalator-tag:hover { background: color-mix(in srgb, var(--tag, var(--accent)) 28%, transparent); }
.tag-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag-filter {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-soft);
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.tag-filter .dot { width: 8px; height: 8px; border-radius: 50%; }
.tag-filter:hover { border-color: var(--accent); color: var(--ink); }
.tag-filter.active { border-color: var(--accent); color: var(--ink); background: var(--bg-2); }

/* Global new task modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; z-index: 1000; overflow-y: auto;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; width: 100%; max-width: 560px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-card label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.modal-card input, .modal-card select, .modal-card textarea {
  width: 100%; margin-top: 4px; padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--line-soft); background: var(--bg-2);
  color: var(--ink); font-size: 14px; font-family: inherit;
}
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus {
  outline: none; border-color: var(--accent);
}
.modal-actions { display: flex; gap: 10px; align-items: center; }

/* Timeline calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekdays { margin-bottom: 6px; }
.cal-weekday { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; padding: 4px; }
.cal-day {
  min-height: 92px; background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 6px; overflow: hidden;
}
.cal-day.cal-empty { background: transparent; border: none; }
.cal-day.cal-today { border-color: var(--accent); border-width: 2px; }
.cal-date { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-today .cal-date { color: var(--accent); }
.cal-tag {
  font-size: 10.5px; line-height: 1.3; padding: 2px 6px; border-radius: 6px;
  margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; border-left: 3px solid;
}
.cal-tag.deadline { background: rgba(239,68,68,0.14); border-color: #ef4444; color: var(--ink); }
.cal-tag.milestone { background: rgba(139,92,246,0.14); border-color: #8b5cf6; color: var(--ink); }
.cal-tag.event { background: rgba(14,165,233,0.14); border-color: #0ea5e9; color: var(--ink); }
.cal-tag:hover { filter: brightness(1.2); }
.cal-more { font-size: 10px; color: var(--faint); padding: 2px 6px; }
@media (max-width: 720px) {
  .cal-day { min-height: 64px; }
  .cal-tag { font-size: 9px; }
}

/* Timeline 2-column layout: calendar left, items right */
.timeline-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .timeline-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

/* Dashboard two-column: critical+blocked left, waiting right */
.dash-two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .dash-two-col { grid-template-columns: 1.3fr 1fr; align-items: start; }
}

/* Complete button: very light green for better contrast */
.btn-complete {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--ink);
}
.btn-complete:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.55);
}

/* Tag editing in task detail */
.tag-editable { position: relative; padding-right: 8px; }
.tag-remove {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 0 0 4px; opacity: 0.6;
}
.tag-remove:hover { opacity: 1; }
/* Alex's bug (#83): wrapped chip rows sat 6px apart, so the × on one row
   was easy to hit by mistake from the row above/below. Keep >= 14px. */
#m-tags, #m-badges { display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 14px; }
.badge-remove {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 15px; line-height: 1; margin-left: 4px; padding: 4px 6px;
  min-width: 28px; min-height: 28px; opacity: 0.7;
}
.badge-remove:hover, .badge-remove:focus-visible { opacity: 1; }
.toast.toast-undo { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.toast-undo-btn {
  background: none; border: 1px solid currentColor; border-radius: 6px; color: inherit;
  cursor: pointer; font-weight: 700; padding: 4px 10px; min-height: 32px;
}

/* Timeline two-month calendar */
.cal-nav-row { display: flex; justify-content: space-between; margin-bottom: 12px; }
.cal-two-month { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .cal-two-month { grid-template-columns: 1fr 1fr; }
}
.cal-two-month .card { margin: 0; }

/* New Task modal: force top overlay positioning */
#nt-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  background: rgba(0,0,0,0.55) !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 60px 16px 16px !important;
  overflow-y: auto !important;
}
#nt-modal-backdrop .modal-card {
  margin: 0 !important;
  width: 100%;
  max-width: 560px;
}

/* Tag picker in New Task modal */
.badge-clickable { cursor: pointer; opacity: 0.7; transition: opacity 0.15s; }
.badge-clickable:hover { opacity: 1; background: var(--accent-soft); }

/* Clickable pulse items in 60-second brief */
.pulse-link {
  background: none; border: none; cursor: pointer; font: inherit;
  color: inherit; text-align: center; padding: 0;
  border-radius: 8px; transition: background 0.15s;
}
.pulse-link:hover { background: rgba(255,255,255,0.05); }
.tpk{margin-top:8px}.tpk-panel{display:none;margin-top:8px;padding:10px;background:var(--bg-2);border:1px solid var(--line-soft);border-radius:8px}.tpk-hint{font-size:11px;color:var(--muted);margin-bottom:6px}.tpk-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.tpk-new{display:none;margin-bottom:8px}.tpk-actions{display:flex;gap:8px;justify-content:flex-end}.tpk-sel{border-color:var(--accent);background:var(--accent-soft)}.tpk-dash{border-style:dashed}

/* ---------------------------------------------------------------- Phase 2: escalation, triage, notifications, mentions */

/* Notification bell in the topbar. */
.notif-bell { position: relative; padding: 9px 10px; }
.notif-bell svg { width: 19px; height: 19px; display: block; }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
}

/* Pending-count badge on the Triage subnav item. */
.subnav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 800;
}

/* Open-escalation status block on the task detail modal. */
.esc-status {
  background: var(--warn-soft); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 13px; padding: 13px 14px; font-size: 13px; line-height: 1.5;
}
.esc-status strong { color: var(--warn); }
.esc-status .esc-reason { margin-top: 8px; font-style: italic; color: var(--muted); }

/* @mention highlight in rendered notes, and the autocomplete picker. */
.mention { color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 0 4px; font-weight: 700; }
.mention-picker { border: 1px solid var(--line); border-radius: 11px; background: var(--panel); margin-top: 6px; overflow: hidden; }
.mention-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 9px 12px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 13px; cursor: pointer; font-family: inherit;
}
.mention-item:last-child { border-bottom: 0; }
.mention-item.sel, .mention-item:hover { background: var(--panel-3); }
.mention-name { font-weight: 700; }
.mention-email { color: var(--faint); font-size: 12px; }

/* Team triage queue. */
.triage-list { display: grid; gap: 12px; }
.triage-card.decided { opacity: 0.75; }
.triage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.triage-head .link-btn { font-size: 15px; padding: 0; text-align: left; }
.triage-reason { font-size: 13.5px; margin: 8px 0; line-height: 1.55; white-space: pre-wrap; }
.triage-action { font-size: 13px; color: var(--accent-ink); margin: 0 0 8px; }
.triage-meta { color: var(--faint); font-size: 12px; margin-top: 8px; }
.triage-actions { display: flex; gap: 8px; margin-top: 12px; }
.triage-triage-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.triage-triage-row select { width: auto; flex: 1; min-width: 0; }

/* Notification inbox. */
.inbox-row {
  display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--line-soft);
  border-radius: 13px; background: var(--panel); margin-bottom: 8px; cursor: pointer;
}
.inbox-row.unread { border-color: var(--accent); background: var(--accent-soft); }
.inbox-icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-3); color: var(--muted);
}
.inbox-icon svg { width: 17px; height: 17px; }
.inbox-icon.kind-mention { color: var(--accent-ink); background: var(--accent-soft); }
.inbox-icon.kind-assignment { color: var(--info); background: var(--info-soft); }
.inbox-icon.kind-escalation { color: var(--warn); background: var(--warn-soft); }
.inbox-icon.kind-comment { color: var(--muted); background: var(--panel-3); }
.inbox-body { flex: 1; min-width: 0; }
.inbox-body p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.5; }
.inbox-time { color: var(--faint); font-size: 11.5px; }
.inbox-task { padding: 0; font-size: 12.5px; }

/* Phase 3: cross-team sharing + initiatives */
.badge.shared { color: var(--info); background: var(--info-soft); border-color: transparent; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.share-row:last-child { border-bottom: none; }
.share-row .who { font-size: 14px; }
.share-row .access { color: var(--muted); font-size: 12.5px; }
.share-radio-row { display: flex; gap: 10px; margin-top: 8px; }
.share-radio-row .radio-card { flex: 1; }
.initiatives-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.initiative-card { text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.initiative-card:hover { border-color: var(--accent); }
.initiative-card h3 { margin: 0 0 6px; font-size: 16px; }
.initiative-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.initiative-meta { color: var(--faint); font-size: 12.5px; }
.task-pick-list { max-height: 320px; overflow-y: auto; margin-top: 12px; }
.task-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.task-pick-row:last-child { border-bottom: none; }
.task-pick-row .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Kanban (#100) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kb-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 0.8fr); gap: 12px; align-items: start; }
.kb-col { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px; min-height: 120px; }
.kb-col.kb-over { border-color: var(--accent, #60a5fa); }
.kb-col.kb-collapsed { min-height: 0; }
.kb-col-head { font-size: 13px; font-weight: 600; margin: 2px 4px 10px; color: var(--muted, inherit); }
.kb-toggle { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: left; width: 100%; min-height: 44px; margin: 0; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { display: flex; gap: 8px; align-items: flex-start; background: var(--bg, transparent); border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.kb-card:focus { outline: 2px solid var(--accent, #60a5fa); outline-offset: 1px; }
.kb-card.kb-alert { border-left-color: var(--danger, #f87171); }
/* Idea 3: priority edges (p1 red, p2 amber; p3+ none). Color only — the
   3px edge comes from .kb-card; kb-alert is re-asserted last on purpose. */
.kb-card.kb-p1 { border-left-color: var(--danger); }
.kb-card.kb-p2 { border-left-color: var(--warn); }
.kb-card.kb-alert { border-left-color: var(--danger, #f87171); }
.kb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kb-chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.kb-chip-overdue { color: var(--danger); background: var(--danger-soft); }
.kb-chip-due { color: var(--warn); background: var(--warn-soft); }
.kb-chip-acuity { color: var(--info); background: var(--info-soft); }
.kb-progress { height: 5px; border-radius: 999px; background: var(--panel-3); margin-top: 6px; overflow: hidden; }
.kb-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.kb-wip-warn { color: var(--warn); font-size: 11px; font-weight: 700; white-space: nowrap; }
.kb-card.kb-dragging { opacity: 0.5; }
.kb-card-main { flex: 1; min-width: 0; }
.kb-title { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.kb-why { font-size: 12px; color: var(--faint); margin-top: 3px; }
.kb-move { flex: none; font-size: 12px; background: none; border: 1px solid var(--line); border-radius: 8px; color: inherit; padding: 4px 8px; cursor: pointer; }
.kb-empty { font-size: 12px; color: var(--faint); padding: 6px 4px; }
.kb-menu { display: flex; flex-direction: column; gap: 8px; }
.kb-menu-item { min-height: 44px; }
.kb-seg { display: flex; gap: 14px; margin-bottom: 10px; }
.kb-undo button { pointer-events: auto; margin-left: 8px; }
#toast-root .kb-undo { pointer-events: auto; }
@media (max-width: 1100px) { .kb-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phone: stacked sections, Backlog last, 44px Move targets, no drag (spec §4). */
@media (max-width: 640px) {
  .kb-board { grid-template-columns: 1fr; }
  .kb-move { min-width: 44px; min-height: 44px; }
  .kb-card { align-items: center; }
}

/* #92 QA should-fix: Revoke / Revoke all are destructive one-tap actions on
   phones and were ~30px tall. Hold them to the 44px minimum touch target
   (WCAG 2.5.5 / Apple HIG) so a near-miss doesn't hit the wrong row.
   DON'T shrink with btn-sm padding. */
.btn.touch-44 { min-height: 44px; min-width: 44px; }

/* Attention card (Today tab; web/attention.js, migration 018) */
.attn-card { margin-bottom: 14px; }
.attn-section { margin-top: 10px; }
.attn-section h4 { margin: 0 0 4px; font-size: .82em; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.attn-item { padding: 7px 0; border-top: 1px solid var(--line); }
.attn-label { font-weight: 600; }
.attn-detail { color: var(--muted); font-size: .92em; margin-top: 1px; }
.attn-next { font-size: .92em; margin-top: 2px; }
.attn-stale { color: #d97706; font-weight: 600; }
