:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f4f3ef;
  --ink: #161513;
  --ink-2: #3a3835;
  --muted: #74716c;
  --muted-2: #a09c95;
  --line: #e7e4dd;
  --line-2: #efece5;
  --accent: oklch(0.62 0.17 38);
  --accent-soft: oklch(0.96 0.04 50);
  --accent-ink: oklch(0.38 0.13 35);
  --danger: oklch(0.58 0.20 25);
  --success: oklch(0.55 0.13 150);

  /* category colors */
  --cat-practice: oklch(0.55 0.16 250);
  --cat-game: oklch(0.58 0.20 25);
  --cat-travel: oklch(0.66 0.16 70);
  --cat-skill: oklch(0.55 0.18 300);
  --cat-sc: oklch(0.55 0.14 150);
  --cat-class: oklch(0.60 0.10 200);
  --cat-exam: oklch(0.50 0.14 200);
  --cat-meeting: oklch(0.50 0.02 60);
  --cat-staff: oklch(0.45 0.04 280);
  --cat-recruit: oklch(0.60 0.18 340);
  --cat-comms: oklch(0.55 0.14 280);
  --cat-deadline: oklch(0.62 0.18 60);
  --cat-team: oklch(0.55 0.14 180);
  --cat-vocational: oklch(0.55 0.10 100);
  --cat-reminder: oklch(0.68 0.14 90);

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 0 rgba(20,18,15,0.04), 0 1px 2px rgba(20,18,15,0.04);
  --shadow-md: 0 4px 16px -4px rgba(20,18,15,0.10), 0 2px 6px rgba(20,18,15,0.06);
  --shadow-lg: 0 24px 48px -16px rgba(20,18,15,0.18), 0 8px 16px rgba(20,18,15,0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-feature-settings: "ss02"; }

button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ───── App shell ───── */
.app {
  display: grid;
  grid-template-rows: 52px 1fr;
  height: 100vh;
  overflow: hidden;
}

.app-loading {
  grid-template-rows: 1fr;
  place-items: center;
  background: var(--bg);
}
.app-loading-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink);
}
.app-loading-card h1 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 600;
}
.app-loading-card p {
  margin: 0;
  color: var(--muted);
}
.topbar {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 16px 0 18px;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 14px;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--ink);
  color: white; display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  letter-spacing: 0;
}
.brand-mark::before { content: "C"; transform: translateY(-0.5px); }
.brand-tail { color: var(--muted); font-weight: 400; }

.tool-switcher {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
}
.tool-switcher button {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.tool-switcher button.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.tool-switcher button.soon { color: var(--muted-2); cursor: default; }
.tool-switcher button.soon::after {
  content: "soon"; font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted-2); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  width: 240px;
  color: var(--muted);
  font-size: 12px;
}
.search kbd {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-left: auto;
  background: white;
  color: var(--muted);
}
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--ink-2);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-sizing: content-box;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.65 0.12 35), oklch(0.45 0.10 35));
  color: white; display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
}

/* ───── Body grid ───── */
.body {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  min-height: 0;
  height: 100%;
}
.body.assistant-collapsed { grid-template-columns: 240px 1fr 0px; }

/* ───── Left rail ───── */
.rail {
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 24px;
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0;
}
.rail-section { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rail-section h4 {
  margin: 0 6px 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.rail-section h4 .count { color: var(--muted-2); font-weight: 500; }
.rail-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 4px;
  padding: 0 6px;
  height: 18px;
  border-radius: 5px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rail-section-toggle:hover { background: var(--surface-2); color: var(--ink-2); }
.rail-section-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-weight: 500;
}
.rail-section-body { display: flex; flex-direction: column; gap: 6px; }

.new-event-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 12px;
  background: var(--ink); color: white;
  border-radius: 8px;
  font-weight: 500; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.new-event-btn .plus {
  width: 18px; height: 18px; border-radius: 5px;
  background: rgba(255,255,255,0.12);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 500;
}
.new-event-btn .shortcut { color: rgba(255,255,255,0.5); font-size: 11px; font-family: "Geist Mono", monospace; }

.nav-item, .filter-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}
.nav-item:hover, .filter-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.nav-item .icon, .filter-item .swatch {
  width: 16px; height: 16px; display: grid; place-items: center; flex-shrink: 0;
}
.filter-item .swatch {
  width: 10px; height: 10px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.06);
}
.filter-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-item .num { font-family: "Geist Mono", monospace; color: var(--muted-2); font-size: 11px; }
.filter-item.off { color: var(--muted-2); }
.filter-item.off .swatch { background: transparent !important; border: 1px dashed var(--muted-2); }

.mini-cal {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px;
}
.mini-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px; font-weight: 500;
}
.mini-cal-head button { color: var(--muted); padding: 2px 5px; border-radius: 4px; }
.mini-cal-head button:hover { background: white; color: var(--ink); }
.mini-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  gap: 1px;
}
.mini-cal-grid .dow { color: var(--muted-2); text-align: center; padding: 3px 0; font-size: 9px; }
.mini-cal-grid .d {
  text-align: center; padding: 4px 0; border-radius: 4px; cursor: pointer;
  color: var(--ink-2);
  position: relative;
}
.mini-cal-grid .d:hover { background: white; }
.mini-cal-grid .d.muted { color: var(--muted-2); }
.mini-cal-grid .d.today { background: var(--ink); color: white; font-weight: 600; }
.mini-cal-grid .d.selected:not(.today) { background: white; box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink); }
.mini-cal-grid .d.has-events::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--accent);
}
.mini-cal-grid .d.today.has-events::after { background: white; }

/* ───── Main panel ───── */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--bg);
}
.main-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.date-nav { display: flex; align-items: center; gap: 8px; }
.today-btn {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  background: white;
  font-weight: 500;
}
.today-btn:hover { background: var(--surface-2); }
.nav-arrow {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.nav-arrow:hover { background: var(--surface-2); }
.date-label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
}
.date-label .year { font-weight: 400; color: var(--muted); }
.week-of { font-size: 11px; color: var(--muted); margin-left: 4px; font-family: "Geist Mono", monospace; }

.view-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 2px;
}
.view-toggle button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.view-toggle button.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.toolbar-right { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.chip .swatch { width: 8px; height: 8px; border-radius: 2px; }

.main-content {
  flex: 1;
  overflow: auto;
  min-height: 0;
  position: relative;
}

/* ───── Week view ───── */
.week {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  background: var(--surface);
}
.week-head {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 4;
  background: var(--surface);
}
.week-head .gutter { border-right: 1px solid var(--line); }
.week-head .col {
  padding: 8px 10px 10px;
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 2px;
}
.week-head .col:last-child { border-right: 0; }
.week-head .dow {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.week-head .date {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
}
.week-head .col.today .date { color: var(--accent); }
.week-head .col.today .dow { color: var(--accent); }
.week-head .col.weekend .dow,
.week-head .col.weekend .date { color: var(--muted); }
.week-head .meta {
  font-size: 10px; color: var(--muted);
  font-family: "Geist Mono", monospace;
  display: flex; gap: 6px;
  margin-top: 2px;
}
.week-head .meta .pill {
  padding: 1px 4px; border-radius: 3px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.week-head .meta .pill.away { background: oklch(0.95 0.04 25); color: var(--cat-game); }

.week-allday {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  min-height: 28px;
}
.week-allday .label {
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  padding: 6px 8px 0 0;
  border-right: 1px solid var(--line);
}
.week-allday .cell {
  border-right: 1px solid var(--line-2);
  padding: 3px 4px;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 28px;
}
.week-allday .cell:last-child { border-right: 0; }

.allday-event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--cat-game);
  color: white;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.allday-event.travel {
  background: oklch(0.95 0.05 70);
  color: var(--cat-travel);
  border: 1px dashed oklch(0.85 0.08 70);
}
.allday-event.deadline {
  background: oklch(0.97 0.05 60);
  color: var(--cat-deadline);
  border-left: 3px solid var(--cat-deadline);
  border-radius: 3px;
}

.week-grid {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  overflow: hidden;
}
.time-col {
  border-right: 1px solid var(--line);
}
.time-row {
  height: 48px;
  position: relative;
  padding-right: 8px;
  text-align: right;
  border-top: 1px solid var(--line-2);
}
.time-row:first-child { border-top: 0; }
.time-row .time-label {
  position: absolute; right: 8px; top: -7px;
  font-size: 10px; font-family: "Geist Mono", monospace;
  color: var(--muted-2);
  background: var(--surface); padding: 0 2px;
}
.time-row:first-child .time-label { top: 4px; }

.day-cols {
  display: grid; grid-template-columns: repeat(7, 1fr);
  position: relative;
}
.day-col {
  border-right: 1px solid var(--line-2);
  position: relative;
}
.day-col:last-child { border-right: 0; }
.day-col.today { background: oklch(0.99 0.01 60); }
.day-col.weekend { background: oklch(0.985 0.005 60); }

.hour-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px solid var(--line-2);
  pointer-events: none;
}
.half-hour-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px dashed var(--line-2);
  opacity: 0.5;
  pointer-events: none;
}

.now-line {
  position: absolute; left: 0; right: 0;
  border-top: 1.5px solid var(--accent);
  z-index: 3;
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute; left: -4px; top: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.now-label {
  position: absolute; left: -52px; top: -8px;
  font-family: "Geist Mono", monospace; font-size: 10px;
  color: var(--accent); font-weight: 600;
  background: var(--surface);
  padding: 1px 4px; border-radius: 3px;
}

/* Event blocks */
.event {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid transparent;
  background: white;
  transition: box-shadow 120ms, transform 120ms;
}
.event:hover {
  box-shadow: var(--shadow-md);
  z-index: 5;
}
.event .e-title { font-weight: 600; color: var(--ink); }
.event .e-meta { color: var(--muted); font-family: "Geist Mono", monospace; font-size: 10px; }
.event .e-sub { color: var(--ink-2); font-size: 10px; }
.event.tentative { border-style: dashed; background: var(--surface); }

/* category styles */
.event[data-cat="practice"] {
  background: oklch(0.97 0.03 250);
  border-left: 3px solid var(--cat-practice);
}
.event[data-cat="practice"] .e-title { color: var(--cat-practice); }
.event[data-cat="game"] {
  background: var(--cat-game); border-color: var(--cat-game);
}
.event[data-cat="game"] .e-title,
.event[data-cat="game"] .e-meta,
.event[data-cat="game"] .e-sub { color: white; }
.event[data-cat="travel"] {
  background: oklch(0.97 0.04 70);
  border-left: 3px solid var(--cat-travel);
}
.event[data-cat="travel"] .e-title { color: var(--cat-travel); }
.event[data-cat="skill"] {
  background: oklch(0.97 0.04 300);
  border-left: 3px solid var(--cat-skill);
}
.event[data-cat="skill"] .e-title { color: var(--cat-skill); }
.event[data-cat="sc"] {
  background: oklch(0.96 0.05 150);
  border-left: 3px solid var(--cat-sc);
}
.event[data-cat="sc"] .e-title { color: var(--cat-sc); }
.event[data-cat="class"] {
  background: oklch(0.97 0.025 200);
  border-left: 3px solid var(--cat-class);
}
.event[data-cat="class"] .e-title { color: var(--cat-class); }
.event[data-cat="exam"] {
  background: oklch(0.94 0.04 200);
  border-left: 3px solid var(--cat-exam);
}
.event[data-cat="exam"] .e-title { color: var(--cat-exam); }
.event[data-cat="meeting"] {
  background: var(--surface-2);
  border-left: 3px solid var(--cat-meeting);
}
.event[data-cat="meeting"] .e-title { color: var(--ink); }
.event[data-cat="staff"] {
  background: oklch(0.96 0.015 280);
  border-left: 3px solid var(--cat-staff);
}
.event[data-cat="staff"] .e-title { color: var(--cat-staff); }
.event[data-cat="recruit"] {
  background: oklch(0.97 0.04 340);
  border-left: 3px solid var(--cat-recruit);
}
.event[data-cat="recruit"] .e-title { color: var(--cat-recruit); }
.event[data-cat="comms"] {
  background: oklch(0.97 0.035 280);
  border-left: 3px solid var(--cat-comms);
}
.event[data-cat="comms"] .e-title { color: var(--cat-comms); }
.event[data-cat="team"] {
  background: oklch(0.96 0.04 180);
  border-left: 3px solid var(--cat-team);
}
.event[data-cat="team"] .e-title { color: var(--cat-team); }
.event[data-cat="vocational"] {
  background: oklch(0.96 0.04 100);
  border-left: 3px solid var(--cat-vocational);
}
.event[data-cat="vocational"] .e-title { color: var(--cat-vocational); }

.event-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; padding: 1px 4px;
  border-radius: 3px; font-weight: 500;
  background: rgba(255,255,255,0.5);
}
.event[data-cat="game"] .event-badge { background: rgba(255,255,255,0.18); color: white; }

.conflict-indicator {
  position: absolute;
  top: 3px; right: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700;
  border: 2px solid white;
  box-sizing: content-box;
  z-index: 2;
}

/* ───── Month view ───── */
.month {
  background: var(--surface);
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}
.month-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.month-head .dow {
  padding: 8px 10px;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  border-right: 1px solid var(--line-2);
}
.month-head .dow:last-child { border-right: 0; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  min-height: 100%;
}
.month-cell {
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 6px 8px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface);
  min-height: 110px;
  overflow: hidden;
}
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.muted { background: var(--surface-2); }
.month-cell.muted .day-num { color: var(--muted-2); }
.month-cell .day-num {
  font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  font-family: "Geist Mono", monospace;
  align-self: flex-start;
  padding: 1px 5px;
  border-radius: 4px;
}
.month-cell.today .day-num { background: var(--ink); color: white; }
.month-cell.weekend { background: oklch(0.99 0.005 60); }
.m-event {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.m-event .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.m-event .t { font-family: "Geist Mono", monospace; color: var(--muted); font-size: 10px; margin-right: 2px; }
.m-event:hover { background: var(--surface-2); }
.m-event.game { background: var(--cat-game); color: white; font-weight: 500; }
.m-event.game .t { color: rgba(255,255,255,0.8); }
.m-event.game .dot { background: white; }
.m-more { font-size: 10px; color: var(--muted); padding: 1px 5px; cursor: pointer; }
.m-more:hover { color: var(--ink); }

/* ───── Day view ───── */
.day-view {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: 100%;
  background: var(--surface);
}
.day-main {
  display: grid; grid-template-rows: auto 1fr;
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: hidden;
}
.day-banner {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.day-banner .big {
  font-size: 36px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1;
}
.day-banner .big .num { color: var(--accent); }
.day-banner .summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  font-size: 11px;
}
.day-banner .summary .item { display: flex; flex-direction: column; }
.day-banner .summary .label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.day-banner .summary .val { font-weight: 600; font-size: 14px; }
.day-banner .summary .val.warn { color: var(--accent); }

.day-timeline {
  overflow: auto;
  display: grid;
  grid-template-columns: 56px 1fr;
  position: relative;
}
.day-side {
  border-left: 1px solid var(--line);
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 16px;
}
.day-side h5 {
  margin: 0;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.deadline-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px;
}
.deadline-card .due {
  font-family: "Geist Mono", monospace; font-size: 10px;
  color: var(--cat-deadline); font-weight: 600;
  white-space: nowrap;
}
.deadline-card .title { font-weight: 500; }
.deadline-card .sub { font-size: 11px; color: var(--muted); }
.deadline-card.overdue .due { color: var(--danger); }

/* ───── Agenda view ───── */
.agenda {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 32px 80px;
  display: flex; flex-direction: column; gap: 28px;
}
.agenda-day {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
}
.agenda-day .day-stamp {
  position: sticky; top: 0;
  display: flex; flex-direction: column;
  font-size: 11px; color: var(--muted);
  padding-top: 2px;
}
.agenda-day .day-stamp .num {
  font-size: 32px; font-weight: 700; line-height: 1;
  color: var(--ink); letter-spacing: -0.02em;
}
.agenda-day .day-stamp .dow {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px;
  font-weight: 600; color: var(--ink-2);
  margin-top: 2px;
}
.agenda-day.is-today .day-stamp .num { color: var(--accent); }
.agenda-day .events { display: flex; flex-direction: column; gap: 6px; }
.agenda-row {
  display: grid;
  grid-template-columns: 80px 4px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.agenda-row:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.agenda-row .time {
  font-family: "Geist Mono", monospace; font-size: 11px;
  display: flex; flex-direction: column; color: var(--ink-2);
}
.agenda-row .time .end { color: var(--muted); }
.agenda-row .stripe { width: 4px; height: 32px; border-radius: 2px; }
.agenda-row .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agenda-row .info .t { font-weight: 600; }
.agenda-row .info .s { font-size: 11px; color: var(--muted); }
.agenda-row .right { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }

/* ───── Right rail (assistant) ───── */
.assistant {
  border-left: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.assistant-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.assistant-head .title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px;
}
.assistant-head .badge {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-ink);
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
}
.assistant-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.assistant-greeting {
  font-size: 12px; color: var(--muted);
}
.assistant-greeting strong { color: var(--ink); font-weight: 600; }

.assistant-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface);
}
.assistant-block .head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600;
}
.assistant-block .body {
  font-size: 12.5px; color: var(--ink-2);
}
.assistant-block strong { color: var(--ink); font-weight: 600; }
.assistant-block ul { margin: 4px 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.assistant-block li { color: var(--ink-2); }

.assistant-action {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
  width: 100%;
  background: var(--surface);
}
.assistant-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.assistant-action .icon { color: var(--accent); width: 16px; }

.assistant-suggestion {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, white, var(--accent-soft));
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.assistant-suggestion .label {
  font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 700;
  display: flex; align-items: center; gap: 4px;
}
.assistant-suggestion .text { font-size: 12.5px; }
.assistant-suggestion .actions { display: flex; gap: 6px; margin-top: 2px; }
.assistant-suggestion .actions button {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 5px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 500;
}
.assistant-suggestion .actions button.primary {
  background: var(--ink); color: white; border-color: var(--ink);
}

.assistant-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assistant-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.35;
  background: var(--surface);
}
.assistant-message-user {
  align-self: flex-end;
  max-width: 92%;
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.assistant-message-status {
  color: var(--muted);
  background: var(--surface-2);
}
.assistant-message-question {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.assistant-message-error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, white);
}
.assistant-message-result {
  background: var(--surface);
}
.assistant-message-title {
  font-weight: 650;
  margin-bottom: 5px;
}
.assistant-message-item + .assistant-message-item {
  margin-top: 3px;
}
.assistant-message-warning {
  margin-top: 5px;
  color: var(--danger);
}
.assistant-undo {
  margin-top: 8px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.assistant-undo:disabled {
  opacity: 0.55;
  cursor: default;
}
.assistant-input {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface);
}
.assistant-input-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
}
.assistant-input-box:focus-within { border-color: var(--ink); }
.assistant-input-box textarea {
  width: 100%; resize: none;
  border: 0; outline: 0; background: transparent;
  font-size: 12.5px;
  min-height: 36px;
  padding: 0;
}
.assistant-input-box .row {
  display: flex; align-items: center; justify-content: space-between;
}
.assistant-input-box .pills { display: flex; gap: 4px; }
.assistant-input-box .pill {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2); color: var(--muted);
}
.assistant-input-box .send {
  width: 26px; height: 26px;
  background: var(--ink); color: white;
  border-radius: 6px; display: grid; place-items: center;
}
.assistant-input-box .send:disabled { opacity: 0.3; }

.assistant-toggle-btn {
  position: fixed;
  right: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--ink); color: white;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: 12px; font-weight: 500;
  z-index: 10;
}

/* ───── Event modal ───── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,18,15,0.35);
  display: grid; place-items: center;
  z-index: 50;
  padding: 32px;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  max-height: 88vh;
  overflow: hidden;
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-close { color: var(--muted); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body {
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field textarea, .field select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--surface);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0; border-color: var(--ink);
}
.form-error {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: oklch(0.96 0.05 25);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.category-picker {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
}
.cat-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  background: var(--surface);
  cursor: pointer;
}
.cat-chip:hover { background: var(--surface-2); }
.cat-chip.active { border-color: var(--ink); background: var(--surface-2); font-weight: 600; }
.cat-chip .swatch { width: 8px; height: 8px; border-radius: 2px; }

.pill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.select-pill, .person-chip {
  display: flex; align-items: center; gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}
.select-pill.active, .person-chip.active {
  border-color: var(--ink);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}
.select-pill .swatch { flex: 0 0 auto; }
.person-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 2px;
}

.visibility-picker {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px;
}
.vis-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.vis-row .label { display: flex; align-items: center; gap: 8px; }
.vis-row .label .icon { width: 14px; color: var(--muted); }
.vis-row select { font-size: 11px; padding: 3px 6px; background: white; border: 1px solid var(--line); border-radius: 5px; }
.vis-row .count { font-family: "Geist Mono", monospace; font-size: 10px; color: var(--muted); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--line-2);
}
.toggle {
  width: 32px; height: 18px; border-radius: 999px;
  background: var(--line); position: relative;
  cursor: pointer;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; transition: 120ms;
}
.toggle.on { background: var(--ink); }
.toggle.on::after { left: 16px; }

.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
}
.modal-foot .ai-suggest {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--accent-ink);
  padding: 5px 8px; border-radius: 6px; background: var(--accent-soft);
  cursor: pointer;
}
.btn-row { display: flex; gap: 8px; }
.btn {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: white;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: white; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.danger { color: var(--danger); border-color: oklch(0.86 0.08 25); }
.btn.danger:hover { background: oklch(0.96 0.05 25); }

/* event detail popover */
.popover-backdrop {
  position: fixed; inset: 0; z-index: 40;
}
.popover {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 320px;
  z-index: 41;
  overflow: hidden;
}
.popover-head {
  padding: 12px 14px 10px;
  border-left: 4px solid var(--cat-meeting);
}
.popover-head .cat-label {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.popover-head h4 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.popover-head .time { font-family: "Geist Mono", monospace; font-size: 11px; color: var(--muted); margin-top: 4px; }
.popover-body {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12px;
}
.popover-body .row { display: flex; align-items: flex-start; gap: 8px; }
.popover-body .row .ico { width: 14px; color: var(--muted); margin-top: 1px; flex-shrink: 0; }
.popover-body .row .v { color: var(--ink-2); }
.popover-foot {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  display: flex; justify-content: space-between;
  background: var(--surface-2);
}
.popover-foot button {
  font-size: 11px; padding: 4px 8px; border-radius: 5px; color: var(--ink-2);
}
.popover-foot button:hover { background: white; }

/* attendee chips */
.attendees { display: flex; flex-wrap: wrap; gap: 4px; }
.att {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.att.role { background: var(--ink); color: white; }
.att .av {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-size: 8px; font-weight: 600;
}

/* ───── Plan view ───── */
.plan {
  max-width: 940px;
  margin: 0 auto;
  padding: 40px 48px 96px;
  font-size: 14px;
  line-height: 1.65;
}
.plan h1 { font-size: 32px; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 4px; }
.plan .lede { color: var(--muted); font-size: 16px; margin: 0 0 32px; max-width: 60ch; }
.plan h2 {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  margin: 36px 0 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.plan h3 { font-size: 18px; margin: 20px 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.plan p { margin: 6px 0 14px; max-width: 70ch; color: var(--ink-2); }
.plan ul { margin: 4px 0 16px; padding-left: 18px; }
.plan li { margin: 3px 0; color: var(--ink-2); }
.plan li::marker { color: var(--muted-2); }
.plan code, .plan .mono { background: var(--surface-2); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.plan .role-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin: 12px 0 16px;
}
.plan .role-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
}
.plan .role-card .name { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.plan .role-card .tag { font-size: 9px; padding: 2px 5px; border-radius: 3px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.plan .role-card .desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.plan .scope-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 12px 0;
}
.plan .scope-table th, .plan .scope-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.plan .scope-table th {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.plan .scope-table td.cat { font-weight: 600; white-space: nowrap; }
.plan .pill {
  display: inline-block;
  font-size: 10px; padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-weight: 500;
}
.plan .pill.mvp { background: oklch(0.95 0.08 150); color: var(--cat-sc); }
.plan .pill.v1 { background: oklch(0.95 0.06 250); color: var(--cat-practice); }
.plan .pill.v2 { background: oklch(0.95 0.06 300); color: var(--cat-skill); }
.plan .pill.future { background: var(--surface-2); color: var(--muted); }

.plan .data-model {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 12px 0;
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}
.plan .data-model .entity { font-weight: 700; color: var(--ink); }
.plan .data-model .field { color: var(--ink-2); padding-left: 16px; display: block; }
.plan .data-model .field .key { color: var(--cat-practice); }
.plan .data-model .field .type { color: var(--muted); }
.plan .data-model .field .note { color: var(--accent); font-style: italic; }

.plan .arch {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 12px 0;
}
.plan .arch .layer {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}
.plan .arch .layer .title { font-weight: 600; font-size: 12px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.plan .arch .layer .title .dot { width: 8px; height: 8px; border-radius: 2px; }
.plan .arch .layer ul { padding-left: 16px; margin: 0; font-size: 11.5px; }

.plan .perm-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
  font-size: 12px;
}
.plan .perm-grid table { width: 100%; border-collapse: collapse; }
.plan .perm-grid th, .plan .perm-grid td {
  padding: 8px 10px; border-bottom: 1px solid var(--line-2);
  text-align: center;
}
.plan .perm-grid th { background: var(--surface-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.plan .perm-grid td:first-child, .plan .perm-grid th:first-child { text-align: left; }
.plan .perm-grid .y { color: var(--success); font-weight: 600; }
.plan .perm-grid .n { color: var(--muted-2); }
.plan .perm-grid .c { color: var(--accent); font-weight: 600; font-size: 10px; letter-spacing: 0.04em; }

/* tweak panel */
.tweaks-fab {
  position: fixed; left: 14px; bottom: 14px;
  background: white; border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px; padding: 5px 9px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 6px;
  z-index: 10;
}

/* helper */
.hide { display: none !important; }

/* scrollbars */
.assistant-body::-webkit-scrollbar, .rail::-webkit-scrollbar, .main-content::-webkit-scrollbar { width: 8px; height: 8px; }
.assistant-body::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 4px;
}
.assistant-body::-webkit-scrollbar-track, .rail::-webkit-scrollbar-track, .main-content::-webkit-scrollbar-track {
  background: transparent;
}

/* Event Modal v2  (.evm-*) */
.evm-backdrop { position: fixed; inset: 0; background: rgba(20,18,15,0.4); display: grid; place-items: center; z-index: 50; padding: 32px; }
.evm-shell { width: 100%; max-width: 720px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 92vh; }
.evm-shell-confirm { max-width: 420px; }
.evm { --evm-row-pad: 6px; --evm-label-w: 116px; display: flex; flex-direction: column; font-family: "Geist", ui-sans-serif, system-ui, sans-serif; font-size: 13px; color: var(--ink); background: var(--surface); border-radius: 12px; min-height: 0; max-height: 92vh; }
.evm-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); background: var(--surface); }
.evm-cat-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); position: relative; }
.evm-cat-pill:hover { background: var(--surface-2); }
.evm-cat-pill select { appearance: none; border: 0; background: transparent; font: inherit; color: inherit; padding: 0 2px; max-width: 190px; cursor: pointer; }
.evm-cat-pill select:focus { outline: 0; }
.evm-cat-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--cat-meeting)); flex: 0 0 auto; }
.evm-top-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.evm-top-meta .evm-dot-sep { color: var(--muted-2); }
.evm-top-actions { display: flex; align-items: center; gap: 2px; }
.evm-icon-btn { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.evm-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.evm-body { padding: 14px 18px 4px; overflow-y: auto; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.evm-title { position: relative; margin-bottom: 6px; }
.evm-title input { width: 100%; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 20px; font-weight: 600; letter-spacing: -0.012em; color: var(--ink); padding: 2px 0 4px; line-height: 1.3; }
.evm-title input::placeholder { color: var(--muted-2); font-weight: 500; }
.evm-title.has-error input { color: var(--danger); }
.evm-field-error { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--danger); margin-top: 2px; background: oklch(0.97 0.04 25); padding: 2px 8px; border-radius: 4px; }
.evm-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 4px; }
.evm-hero-time { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.evm-hero-ico { display: inline-flex; color: var(--muted); margin-right: 2px; }
.evm-inline-edit { font-family: inherit; font-size: 14px; font-weight: 500; padding: 4px 8px; border-radius: 5px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); position: relative; }
.evm-inline-edit:hover { background: var(--surface-2); }
.evm-inline-edit input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.evm-inline-edit.evm-inline-edit-small { font-size: 12px; font-weight: 500; padding: 2px 6px; color: var(--ink-2); }
.evm-inline-strong { font-weight: 600; }
.evm-inline-sep, .evm-inline-arrow { color: var(--muted-2); }
.evm-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.evm-toggle-thumb { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--line); transition: background 120ms; }
.evm-toggle-thumb::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: white; transition: 120ms transform; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.evm-toggle.on .evm-toggle-thumb { background: var(--ink); }
.evm-toggle.on .evm-toggle-thumb::after { transform: translateX(12px); }
.evm-repeat-row { display: flex; align-items: center; gap: 6px; padding: 0 0 4px; font-size: 12px; }
.evm-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; margin: 8px 0 4px; border: 1px solid; }
.evm-banner-conflict { background: oklch(0.97 0.04 25); border-color: oklch(0.88 0.08 25); color: var(--danger); }
.evm-banner-ai { background: oklch(0.97 0.04 50); border-color: oklch(0.88 0.06 50); color: var(--accent-ink); }
.evm-banner-ico { display: inline-flex; margin-top: 1px; }
.evm-banner-body { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.evm-banner-title { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.evm-banner-conflict .evm-banner-title { color: var(--danger); }
.evm-banner-ai .evm-banner-title { color: var(--accent-ink); }
.evm-banner-detail { color: var(--ink-2); margin-top: 2px; }
.evm-banner-who { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.evm-pill-soft { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: rgba(255,255,255,0.7); color: var(--ink-2); }
.evm-banner-actions { display: flex; align-items: center; gap: 4px; }
.evm-ai-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-right: 4px; }
.evm-rows { border-top: 1px solid var(--line-2); margin-top: 10px; }
.evm-row { display: grid; grid-template-columns: var(--evm-label-w) 1fr; gap: 14px; min-height: 40px; padding: var(--evm-row-pad) 0; border-bottom: 1px solid var(--line-2); }
.evm-row-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; padding-top: 5px; }
.evm-row-icon { width: 16px; display: inline-flex; justify-content: center; color: var(--muted-2); }
.evm-row-value { min-width: 0; display: flex; align-items: center; }
.evm-input-bare { width: 100%; border: 0; background: transparent; font-family: inherit; font-size: 13px; color: var(--ink); outline: 0; padding: 6px 8px; border-radius: 5px; margin-left: -6px; }
.evm-input-bare::placeholder { color: var(--muted-2); }
.evm-input-bare:hover { background: var(--surface-2); }
.evm-input-bare:focus { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.evm-textarea { width: 100%; border: 1px solid transparent; background: transparent; font-family: inherit; font-size: 13px; color: var(--ink); outline: 0; padding: 6px 8px; border-radius: 5px; resize: vertical; min-height: 48px; margin-left: -8px; }
.evm-textarea::placeholder { color: var(--muted-2); }
.evm-textarea:hover { background: var(--surface-2); }
.evm-textarea:focus { background: var(--surface-2); border-color: var(--line); }
.evm-chip-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.evm-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 11.5px; line-height: 1.35; cursor: pointer; user-select: none; }
.evm-chip:hover { background: var(--surface-2); }
.evm-chip.is-active { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); font-weight: 500; }
.evm-chip.is-dashed { border-style: dashed; color: var(--muted); background: transparent; }
.evm-chip.is-muted { color: var(--muted); }
.evm-chip-dot { width: 7px; height: 7px; border-radius: 50%; }
.evm-chip-label { white-space: nowrap; }
.evm-chip-count { font-family: "Geist Mono", monospace; font-size: 10px; background: rgba(0,0,0,0.06); padding: 0 4px; border-radius: 3px; margin-left: 2px; }
.evm-chip-x { width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); margin-left: 2px; margin-right: -2px; }
.evm-chip-x:hover { background: rgba(0,0,0,0.08); color: var(--ink); }
.evm-avatar { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35)); color: white; display: inline-grid; place-items: center; font-size: 8px; font-weight: 600; flex-shrink: 0; }
.evm-group-ico { display: inline-flex; color: var(--muted); margin-right: 2px; }
.evm-select { position: relative; display: inline-flex; align-items: center; }
.evm-select select { appearance: none; font-family: inherit; font-size: 12.5px; padding: 4px 22px 4px 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; color: var(--ink); cursor: pointer; }
.evm-select select:hover { background: var(--surface-2); }
.evm-select-chev { position: absolute; right: 6px; color: var(--muted); pointer-events: none; display: inline-flex; }
.evm-vis-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evm-vis-hint { font-size: 11px; color: var(--muted); }
.evm-attendees { display: flex; flex-direction: column; gap: 6px; }
.evm-attendee-quick { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evm-quick-add { font-size: 11px; padding: 1px 6px; border-radius: 4px; color: var(--ink-2); border: 1px dashed var(--line); background: transparent; }
.evm-quick-add:hover { background: var(--surface-2); border-style: solid; }
.evm-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.evm-foot-left { display: flex; align-items: center; gap: 2px; }
.evm-foot-right { display: flex; align-items: center; gap: 6px; }
.evm-foot-hint { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.evm-foot-hint kbd { font-family: "Geist Mono", monospace; font-size: 10px; padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; background: white; }
.evm-btn { font-family: inherit; font-size: 12px; font-weight: 500; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: white; color: var(--ink); }
.evm-btn:hover { background: var(--surface-2); }
.evm-btn-primary { background: var(--ink); color: white; border-color: var(--ink); }
.evm-btn-primary:hover { background: #000; }
.evm-btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.evm-btn-danger:hover { filter: brightness(0.95); }
.evm-btn-warn { background: oklch(0.62 0.17 38); color: white; border-color: oklch(0.62 0.17 38); }
.evm-text-btn { display: inline-flex; align-items: center; gap: 4px; font-family: inherit; font-size: 11.5px; color: var(--ink-2); padding: 4px 7px; border-radius: 5px; }
.evm-text-btn:hover { background: white; color: var(--ink); }
.evm-text-btn-strong { font-weight: 600; color: var(--accent-ink); }
.evm-text-btn-warn { color: var(--accent-ink); }
.evm-text-btn-danger { color: var(--danger); }
.evm-confirm { padding: 24px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.evm-confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; background: oklch(0.96 0.05 25); border-radius: 8px; }
.evm-confirm-title { font-size: 16px; font-weight: 600; margin: 4px 0 0; letter-spacing: -0.01em; }
.evm-confirm-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.evm-confirm-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 6px; border: 1px solid var(--line-2); }
.evm-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

�───────────────
   Reminders & Deadlines  (.rmd-*)
   Feature 2 — used in Day side panel + assistant
   ───────────────────────────────────────────── */

.rmd-panel {
  display: flex; flex-direction: column;
  gap: 14px;
  font-size: 13px;
}

/* ── Section ── */
.rmd-section {
  display: flex; flex-direction: column;
}
.rmd-section-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 4px 6px 2px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 4px;
}
.rmd-section-arrow {
  display: inline-flex;
  color: var(--muted-2);
  width: 12px;
}
.rmd-section-title {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  flex: 1;
}
.rmd-section-count {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 500;
}
.rmd-section-count.is-warn {
  background: oklch(0.96 0.06 50);
  color: var(--accent-ink);
}
.rmd-section-count.is-danger {
  background: oklch(0.96 0.07 25);
  color: var(--danger);
}
.rmd-section.is-danger .rmd-section-title { color: var(--danger); }
.rmd-section-action {
  font-size: 10px;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 4px;
}
.rmd-section-action:hover { color: var(--ink); background: var(--surface-2); }
.rmd-section-body {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 2px 0 6px;
}

/* ── Card ── */
.rmd-card {
  --stripe: transparent;
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 100ms, box-shadow 100ms;
}
.rmd-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.rmd-card.is-menu-open { border-color: var(--ink-2); box-shadow: var(--shadow-md); }

.rmd-card-stripe {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: var(--stripe);
}

.rmd-card-overdue {
  background: oklch(0.99 0.015 25);
}
.rmd-card-completed {
  background: oklch(0.99 0.01 150);
}
.rmd-card-snoozed {
  opacity: 0.78;
}
.rmd-card-escalated {
  background: oklch(0.99 0.015 25);
  border-color: oklch(0.86 0.06 25);
}

.rmd-check {
  margin-top: 1px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--muted-2);
}
.rmd-check:hover { color: var(--ink); background: var(--surface-2); }
.rmd-check.is-done { color: var(--success); }
.rmd-check.is-done:hover { background: oklch(0.95 0.06 150); }

.rmd-card-main {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 1px;
}
.rmd-card-row1 {
  display: flex; align-items: center;
  gap: 6px;
  min-width: 0;
}
.rmd-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rmd-card-title.is-done {
  text-decoration: line-through;
  text-decoration-color: var(--muted-2);
  text-decoration-thickness: 1px;
  color: var(--muted);
}
.rmd-prio {
  color: var(--accent);
  display: inline-flex;
}

.rmd-card-row2 {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  display: flex; align-items: center; gap: 4px;
}
.rmd-card-row2 svg { margin-right: 2px; }

.rmd-card-row3 {
  display: flex; align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  flex-wrap: wrap;
}
.rmd-card-meta {
  display: inline-flex; align-items: center;
  gap: 5px;
}
.rmd-card-meta-related { color: var(--muted-2); }
.rmd-avatar {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: inline-grid; place-items: center;
  font-size: 7px; font-weight: 700;
  letter-spacing: 0;
}

.rmd-escalation {
  margin-top: 4px;
  padding: 4px 8px;
  background: oklch(0.97 0.04 25);
  border-radius: 4px;
  font-size: 11px;
  color: var(--danger);
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-start;
}

.rmd-card-right {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 1px;
}

.rmd-card-menu {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--muted-2);
  opacity: 0.5;
}
.rmd-card:hover .rmd-card-menu { opacity: 1; }
.rmd-card-menu:hover { background: var(--surface-2); color: var(--ink); }
.rmd-card.is-menu-open .rmd-card-menu { background: var(--surface-2); color: var(--ink); opacity: 1; }

/* ── Pills ── */
.rmd-pill {
  display: inline-flex; align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-family: "Geist", sans-serif;
}
.rmd-pill-accent {
  background: oklch(0.95 0.07 50);
  color: var(--accent-ink);
}
.rmd-pill-danger {
  background: oklch(0.94 0.09 25);
  color: var(--danger);
  letter-spacing: 0.04em;
}
.rmd-pill-success {
  background: oklch(0.95 0.07 150);
  color: var(--success);
}
.rmd-pill-muted {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
}
.rmd-pill-neutral {
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  padding: 1px 5px;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
}

/* ── Action Menu ── */
.rmd-menu {
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: "Geist", sans-serif;
}
.rmd-menu-list { display: flex; flex-direction: column; padding: 4px; }
.rmd-menu-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--ink);
  text-align: left;
  width: 100%;
}
.rmd-menu-item:hover { background: var(--surface-2); }
.rmd-menu-item.is-danger { color: var(--danger); }
.rmd-menu-item.is-danger:hover { background: oklch(0.97 0.04 25); }
.rmd-menu-ico { display: inline-flex; color: var(--muted); }
.rmd-menu-item:hover .rmd-menu-ico { color: var(--ink); }
.rmd-menu-item.is-danger .rmd-menu-ico { color: var(--danger); }
.rmd-menu-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmd-menu-kbd {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--muted-2);
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  letter-spacing: 0.02em;
}
.rmd-menu-sep {
  height: 1px;
  background: var(--line-2);
  margin: 4px 6px;
}
.rmd-menu-foot {
  padding: 6px 10px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--muted-2);
  background: var(--surface-2);
}
.rmd-menu-foot kbd {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--ink-2);
  margin-right: 4px;
}

/* ── Log Row ── */
.rmd-log {
  display: flex; flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.rmd-log-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-2);
  font-size: 11.5px;
}
.rmd-log-row:last-child { border-bottom: 0; }
.rmd-log-row:hover { background: var(--surface-2); }
.rmd-log-channel {
  display: inline-flex; align-items: center;
  gap: 4px;
  color: var(--muted);
}
.rmd-log-channel-label {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.rmd-log-body {
  display: flex; flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.rmd-log-msg {
  font-size: 11.5px;
  color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rmd-log-recipient {
  font-size: 10.5px;
  color: var(--muted);
}
.rmd-log-time {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--muted-2);
  white-space: nowrap;
}
.rmd-log-result {
  font-size: 10px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── Assistant Card ── */
.rmd-asst {
  border: 1px solid;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex; flex-direction: column;
  gap: 5px;
  font-size: 12px;
}
.rmd-asst-accent {
  background: linear-gradient(180deg, white, oklch(0.97 0.04 50));
  border-color: oklch(0.88 0.05 50);
}
.rmd-asst-danger {
  background: linear-gradient(180deg, white, oklch(0.97 0.04 25));
  border-color: oklch(0.88 0.06 25);
}
.rmd-asst-head {
  display: flex; align-items: center; justify-content: space-between;
}
.rmd-asst-label {
  font-size: 9px; letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 4px;
}
.rmd-asst-danger .rmd-asst-label { color: var(--danger); }
.rmd-asst-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.rmd-asst-detail {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.rmd-asst-actions {
  display: flex; gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.rmd-asst-btn {
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 4px;
}
.rmd-asst-btn:hover { background: var(--surface-2); }
.rmd-asst-btn.is-primary {
  background: var(--ink); color: white; border-color: var(--ink);
}
.rmd-asst-btn.is-primary:hover { background: #000; }
.rmd-asst-btn.is-danger {
  background: var(--danger); color: white; border-color: var(--danger);
}

/* ── Empty State ── */
.rmd-empty {
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.rmd-empty-ico {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}
.rmd-empty-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.rmd-empty-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* ── Summary Strip (narrow / mobile) ── */
.rmd-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  align-items: stretch;
}
.rmd-strip-item {
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border: 1px solid transparent;
}
.rmd-strip-item:hover { background: var(--line-2); }
.rmd-strip-item.is-danger {
  background: oklch(0.97 0.05 25);
  color: var(--danger);
  border-color: oklch(0.88 0.06 25);
}
.rmd-strip-item.is-warn {
  background: oklch(0.97 0.05 50);
  color: var(--accent-ink);
  border-color: oklch(0.88 0.05 50);
}
.rmd-strip-num {
  font-family: "Geist", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1px;
}
.rmd-strip-item.is-danger .rmd-strip-num { color: var(--danger); }
.rmd-strip-item.is-warn .rmd-strip-num { color: var(--accent-ink); }
.rmd-strip-label { font-size: 9px; }
.rmd-strip-expand {
  background: var(--ink); color: white;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.rmd-strip-expand:hover { background: #000; }



   Search Dropdown  (.srch-*)
   Command-palette-style search panel.
   ───────────────────────────────────────────── */

/* ── Input bar (also usable in topbar) ── */
.srch-input-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px 6px 10px;
  min-width: 0;
  position: relative;
  transition: background 100ms, border-color 100ms, box-shadow 100ms;
}
.srch-input-bar.is-focused {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 0 0 3px oklch(0.97 0.005 60);
}
.srch-input-ico {
  color: var(--muted);
  display: inline-flex;
}
.srch-input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  padding: 0;
}
.srch-input::placeholder { color: var(--muted); }
.srch-input-clear {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  background: rgba(0,0,0,0.05);
}
.srch-input-clear:hover { background: rgba(0,0,0,0.10); color: var(--ink); }
.srch-input-kbd {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── Dropdown panel ── */
.srch-dropdown {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(20,18,15,0.18), 0 6px 12px rgba(20,18,15,0.06);
  overflow: hidden;
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  max-height: 520px;
}
.srch-dropdown.has-preview {
  /* host typically sets width=760 */
}
.srch-dropdown-top {
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--line-2);
}
.srch-dropdown-body {
  display: flex;
  flex: 1; min-height: 0;
  overflow: hidden;
}
.srch-list-pane {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 4px 6px 6px;
}
.srch-list { display: flex; flex-direction: column; }

/* ── Filter tabs ── */
.srch-tabs {
  display: flex;
  gap: 2px;
  padding: 2px 4px 8px;
  font-size: 11.5px;
}
.srch-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.srch-tab:hover { background: var(--surface-2); color: var(--ink-2); }
.srch-tab.is-active {
  background: var(--ink);
  color: white;
}
.srch-tab.is-active .srch-tab-count {
  background: rgba(255,255,255,0.15);
  color: white;
}
.srch-tab-count {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 5px;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.3;
}

/* ── Section header ── */
.srch-section-head {
  display: flex; align-items: center;
  padding: 8px 10px 4px;
  gap: 6px;
}
.srch-section-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.srch-section-count {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  color: var(--muted-2);
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: 3px;
}
.srch-section-action {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.srch-section-action:hover { color: var(--ink); }

/* ── Result row ── */
.srch-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  min-height: 44px;
}
.srch-row:hover { background: var(--surface-2); }
.srch-row.is-focused {
  background: oklch(0.97 0.02 50);
  box-shadow: inset 3px 0 0 var(--accent);
}
.srch-row.has-conflict { background: oklch(0.99 0.015 25); }
.srch-row.has-conflict.is-focused { background: oklch(0.97 0.04 25); box-shadow: inset 3px 0 0 var(--danger); }

.srch-row-ico-wrap {
  position: relative;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
}
.srch-row-ico { display: inline-flex; }
.srch-row-cat-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--surface);
}
.srch-row.is-focused .srch-row-cat-dot { border-color: oklch(0.97 0.02 50); }

.srch-row-cat-tile {
  width: 18px; height: 18px;
  border-radius: 4px;
  display: inline-block;
}
.srch-row-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0;
}

.srch-row-body {
  display: flex; flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.srch-row-title {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.srch-row-title-main {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srch-row-type-tag {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1px 5px;
  background: var(--surface-2);
  border-radius: 3px;
  font-weight: 600;
  font-family: "Geist", sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}
.srch-row-jersey {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}
.srch-row-sub {
  font-size: 11.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 4px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.srch-row-sub > span { display: inline-flex; align-items: center; }
.srch-row-sep { color: var(--muted-2); margin: 0 2px; }
.srch-row-mini-av {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: inline-grid; place-items: center;
  font-size: 7px; font-weight: 700;
  margin-right: 4px;
}

.srch-row-meta {
  display: flex; align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.srch-row-enter {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  letter-spacing: 0.02em;
}
.srch-row-when {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

.srch-hl {
  background: oklch(0.94 0.10 90);
  color: var(--ink);
  padding: 0 1px;
  border-radius: 2px;
}

/* Badges */
.srch-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.srch-badge-danger { background: oklch(0.94 0.09 25); color: var(--danger); }
.srch-badge-accent { background: oklch(0.95 0.07 50); color: var(--accent-ink); font-family: "Geist Mono", monospace; letter-spacing: 0.02em; }

/* Recent rows */
.srch-row-recent { min-height: 36px; }
.srch-row-recent-text { color: var(--ink-2); font-weight: 400; }
.srch-recent-remove {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted-2);
  opacity: 0;
}
.srch-row-recent:hover .srch-recent-remove { opacity: 1; }
.srch-recent-remove:hover { background: rgba(0,0,0,0.08); color: var(--ink); }

/* ── Empty state ── */
.srch-empty { display: flex; flex-direction: column; }
.srch-empty-note {
  padding: 8px 12px;
  color: var(--muted-2);
  font-size: 12px;
  font-style: italic;
}
.srch-suggest-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px 10px 8px;
}
.srch-suggest-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  color: var(--ink-2);
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid transparent;
}
.srch-suggest-chip:hover { border-color: var(--line); background: white; }
.srch-operators {
  display: flex; flex-direction: column;
  gap: 0;
  padding: 2px 6px 8px;
}
.srch-operator {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 4px 6px;
  font-size: 11.5px;
  color: var(--muted);
  border-radius: 4px;
}
.srch-operator:hover { background: var(--surface-2); }
.srch-operator .mono {
  color: var(--ink-2);
  font-size: 11px;
}

/* ── No results ── */
.srch-no-results {
  padding: 28px 24px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
}
.srch-no-results-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--muted-2);
  margin-bottom: 4px;
}
.srch-no-results-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
}
.srch-no-results-sub {
  font-size: 12px; color: var(--muted);
  max-width: 32ch;
  line-height: 1.5;
}
.srch-no-results-actions {
  display: flex; gap: 6px; margin-top: 8px;
}
.srch-pill-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 5px;
  color: var(--ink-2);
  font-weight: 500;
}
.srch-pill-btn:hover { background: var(--surface-2); border-color: var(--ink-2); }

/* ── Footer ── */
.srch-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 10px;
  color: var(--muted);
}
.srch-footer-left {
  display: flex; align-items: center; gap: 12px;
}
.srch-footer-left > span {
  display: inline-flex; align-items: center; gap: 4px;
}
.srch-footer kbd {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--ink-2);
}
.srch-footer-right { font-family: "Geist Mono", monospace; }

/* ── Preview pane ── */
.srch-preview {
  width: 280px;
  flex-shrink: 0;
  border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  background: var(--surface);
}
.srch-preview-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  gap: 6px;
}
.srch-preview-empty-ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--muted-2);
}
.srch-preview-empty-text { font-size: 12px; }

.srch-preview-head {
  padding: 12px 14px 10px;
  border-left: 3px solid;
  border-bottom: 1px solid var(--line-2);
}
.srch-preview-cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 6px;
}
.srch-preview-cat-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.srch-preview-title {
  margin: 0; font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.srch-preview-time {
  margin-top: 4px;
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}
.srch-preview-body {
  padding: 10px 14px;
  flex: 1;
  display: flex; flex-direction: column;
  gap: 8px;
  font-size: 12px;
  overflow-y: auto;
}
.srch-preview-row {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2);
}
.srch-preview-ico {
  width: 14px; display: inline-flex; color: var(--muted);
  flex-shrink: 0;
}
.srch-preview-att {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.srch-att {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.srch-att-group {
  background: var(--ink); color: white;
}
.srch-att-av {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: inline-grid; place-items: center;
  font-size: 7px; font-weight: 700;
}
.srch-preview-conflict {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 10px;
  background: oklch(0.96 0.05 25);
  border-radius: 6px;
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.45;
}
.srch-preview-conflict strong { display: block; font-weight: 600; margin-bottom: 2px; }
.srch-preview-foot {
  padding: 8px 10px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  display: flex; gap: 6px;
}

/* ── Mobile sheet ── */
.srch-mobile {
  width: 100%;
  height: 100%;
  background: var(--surface);
  display: flex; flex-direction: column;
}
.srch-mobile-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.srch-mobile-back {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.srch-mobile-back:hover { background: var(--surface-2); }
.srch-mobile-tabs {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line-2);
  overflow-x: auto;
}
.srch-mobile-body {
  flex: 1; overflow-y: auto;
}
.srch-mobile .srch-row { min-height: 52px; }    /* bigger touch targets */
.srch-mobile .srch-row-enter { display: none; }
.srch-mobile .srch-row-avatar { width: 32px; height: 32px; font-size: 11px; }
.srch-mobile .srch-row-ico-wrap { width: 32px; height: 32px; }

/* ── Anchored layout helper (used in showcase + integration) ── */
.srch-anchor {
  position: relative;

  display: inline-block;
}
.srch-anchor-drop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
}

.top-actions .srch-input-bar {
  width: 240px !important;
}

@media (max-width: 1180px) {
  .top-actions .srch-input-bar {
    width: 220px !important;
  }
  .srch-anchor-drop {
    right: -74px;
  }
}

/* Responsive shell fit: keep the full app visible at normal browser zoom. */
.app {
  width: 100vw;
  max-width: 100vw;
}
.topbar,
.body {
  width: 100%;
  min-width: 0;
}
.topbar {
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) auto;
}
.topbar > *,
.body > * {
  min-width: 0;
}
.brand {
  overflow: hidden;
  white-space: nowrap;
}
.brand-tail {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-switcher {
  min-width: 0;
  overflow: hidden;
}
.tool-switcher button {
  flex: 0 1 auto;
}
.body {
  grid-template-columns: minmax(210px, 220px) minmax(0, 1fr) minmax(280px, 300px);
}
.body.assistant-collapsed {
  grid-template-columns: minmax(210px, 220px) minmax(0, 1fr) 0px;
}

@media (max-width: 1420px) {
  .topbar {
    grid-template-columns: 210px minmax(0, 1fr) auto;
    gap: 12px;
    padding-right: 12px;
  }
  .tool-switcher button:nth-of-type(n+4) {
    display: none;
  }
  .tool-switcher button {
    padding-left: 10px;
    padding-right: 10px;
  }
  .body {
    grid-template-columns: 210px minmax(0, 1fr) 280px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 210px minmax(0, 1fr) 0px;
  }
  .rail {
    padding-left: 10px;
    padding-right: 10px;
  }
  .assistant {
    width: auto;
  }
  .main-header {
    gap: 10px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .toolbar-right .chip:nth-child(2) {
    display: none;
  }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 190px minmax(0, 1fr) auto;
  }
  .tool-switcher button:nth-of-type(n+3) {
    display: none;
  }
  .top-actions .srch-input-bar {
    width: 200px !important;
  }
  .body {
    grid-template-columns: 200px minmax(0, 1fr) 270px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 200px minmax(0, 1fr) 0px;
  }
}

/* Comfortable 100% zoom layout for laptop-width browser windows. */
@media (max-width: 1420px) {
  .topbar {
    grid-template-columns: 180px minmax(0, 1fr) auto;
  }
  .tool-switcher button.soon {
    display: none;
  }
  .top-actions .srch-input-bar {
    width: 190px !important;
  }
  .body {
    grid-template-columns: 190px minmax(0, 1fr) 260px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 190px minmax(0, 1fr) 0px;
  }
  .rail {
    gap: 14px;
    padding: 12px 8px 20px;
  }
  .nav-item,
  .filter-item {
    gap: 7px;
    padding: 5px 7px;
    font-size: 12px;
  }
  .assistant-action {
    padding: 8px 9px;
  }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 160px minmax(0, 1fr) auto;
  }
  .brand-tail {
    display: none;
  }
  .top-actions .srch-input-bar {
    width: 170px !important;
  }
  .body {
    grid-template-columns: 180px minmax(0, 1fr) 250px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 180px minmax(0, 1fr) 0px;
  }
  .mini-cal {
    padding: 8px;
  }
  .main-header {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Assistant panel must stay wide enough for chat controls at 100% zoom. */
@media (max-width: 1420px) {
  .body {
    grid-template-columns: 180px minmax(0, 1fr) 300px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 180px minmax(0, 1fr) 0px;
  }
  .assistant-body {
    padding-left: 12px;
    padding-right: 12px;
  }
  .assistant-input {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 1280px) {
  .body {
    grid-template-columns: 170px minmax(0, 1fr) 300px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 170px minmax(0, 1fr) 0px;
  }
}

@media (max-width: 1120px) {
  .body {
    grid-template-columns: 160px minmax(0, 1fr) 300px;
  }
  .body.assistant-collapsed {
    grid-template-columns: 160px minmax(0, 1fr) 0px;
  }
  .top-actions .srch-input-bar {
    width: 150px !important;
  }
}

/* Vertical fit: grid children must not force the app taller than the viewport. */
.body > * {
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
.rail,
.main,
.assistant {
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
.assistant {
  overflow: hidden;
}
.assistant-head,
.assistant-input {
  flex: 0 0 auto;
}
.assistant-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

   Filters Panel  (.flt-*)
   Dropdown anchored to the toolbar Filters button.
   ───────────────────────────────────────────── */

/* ── Button ── */
.flt-btn {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.flt-btn:hover { background: var(--surface-2); }
.flt-btn.is-open {
  background: var(--surface-2);
  border-color: var(--ink-2);
  color: var(--ink);
}
.flt-btn.has-active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.flt-btn.has-active:hover { background: #000; }
.flt-btn-ico { display: inline-flex; }
.flt-btn-chev { color: var(--muted-2); display: inline-flex; }
.flt-btn-badge {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* ── Panel ── */
.flt-panel {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(20,18,15,0.18), 0 6px 12px rgba(20,18,15,0.06);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  max-height: 600px;
  flex-shrink: 0;
}

/* ── Header ── */
.flt-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.flt-head-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.flt-head-title svg { color: var(--muted); }
.flt-head-count {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-left: 4px;
}
.flt-head-actions {
  display: flex; align-items: center; gap: 4px;
}

.flt-text-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  font-weight: 500;
  cursor: pointer;
}
.flt-text-btn:hover { background: var(--surface-2); color: var(--ink); }
.flt-text-btn.is-strong { color: var(--accent-ink); font-weight: 600; }

.flt-icon-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.flt-icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── Clear confirm strip ── */
.flt-clear-confirm {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: oklch(0.97 0.04 50);
  border-bottom: 1px solid oklch(0.88 0.05 50);
  font-size: 12px;
  color: var(--accent-ink);
}
.flt-clear-confirm-body {
  display: flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.flt-clear-confirm-actions { display: flex; gap: 2px; }
.flt-clear-confirm .flt-text-btn { padding: 3px 8px; font-size: 11px; }
.flt-clear-confirm .flt-text-btn:hover { background: rgba(255,255,255,0.5); }

/* ── Quick actions ── */
.flt-quick-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
}
.flt-quick-actions {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.flt-quick-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.flt-quick-chip:hover { background: var(--surface-2); }
.flt-quick-chip.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.flt-quick-chip.is-danger { color: var(--danger); border-color: oklch(0.88 0.06 25); }
.flt-quick-chip.is-danger:hover { background: oklch(0.97 0.04 25); }
.flt-quick-chip.is-danger.is-active {
  background: var(--danger); color: white; border-color: var(--danger);
}

/* ── Body (scrollable) ── */
.flt-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
  min-height: 0;
}

/* ── Section ── */
.flt-section {
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--line-2);
}
.flt-section:last-child { border-bottom: 0; }
.flt-section-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 4px;
  cursor: pointer;
  user-select: none;
}
.flt-section-arrow {
  display: inline-flex;
  color: var(--muted-2);
  width: 12px;
}
.flt-section-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  flex: 1;
}
.flt-section-count {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.flt-section-action {
  font-family: inherit;
  font-size: 10px;
  padding: 2px 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.flt-section-action:hover { color: var(--ink-2); background: var(--surface-2); }
.flt-section-body {
  padding: 0 0 8px 4px;
  display: flex; flex-direction: column;
  gap: 6px;
}

/* ── List ── */
.flt-list {
  display: flex; flex-direction: column;
  gap: 0;
}
.flt-list-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 6px;
}

/* ── Check row ── */
.flt-check-row {
  display: flex; align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  min-height: 26px;
  font-size: 12px;
}
.flt-check-row:hover { background: var(--surface-2); }
.flt-check-row.is-checked { background: oklch(0.98 0.005 60); }
.flt-check-row.is-checked:hover { background: var(--surface-2); }
.flt-check-row.is-danger.is-checked .flt-check-main { color: var(--danger); }

.flt-check {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: inline-grid; place-items: center;
  color: white;
  flex-shrink: 0;
  transition: background 80ms, border-color 80ms;
}
.flt-check.is-on {
  background: var(--ink);
  border-color: var(--ink);
}
.flt-check-row.is-danger .flt-check.is-on {
  background: var(--danger);
  border-color: var(--danger);
}
.flt-check-row:hover .flt-check:not(.is-on) {
  border-color: var(--muted);
}

.flt-swatch {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.flt-check-label {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.flt-check-main {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flt-check-row.is-checked .flt-check-main {
  color: var(--ink);
  font-weight: 500;
}
.flt-check-sub {
  font-size: 10px;
  color: var(--muted);
}
.flt-check-hint {
  font-family: "Geist", sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  font-weight: 600;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  white-space: nowrap;
}
.flt-check-count {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 500;
}

/* Person row inside check row */
.flt-person-row {
  display: inline-flex; align-items: center;
  gap: 6px;
}
.flt-person-avatar {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: inline-grid; place-items: center;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0;
}
.flt-person-jersey {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

/* ── Date scope ── */
.flt-date-scope {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 2px;
  border-radius: 6px;
  flex-wrap: wrap;
}
.flt-date-btn {
  flex: 1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.flt-date-btn:hover { color: var(--ink-2); }
.flt-date-btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20,18,15,0.06), 0 0 0 1px var(--line);
}
.flt-date-btn-custom {
  flex: 0 1 auto;
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 64px;
}
.flt-date-btn-custom svg { color: var(--muted); }
.flt-date-btn-custom.is-active svg { color: var(--ink); }

/* ── Search (section-local) ── */
.flt-search {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid transparent;
}
.flt-search:focus-within {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 0 0 3px oklch(0.97 0.005 60);
}
.flt-search-ico { color: var(--muted); display: inline-flex; }
.flt-search input {
  flex: 1;
  border: 0; outline: 0; background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  padding: 0;
  min-width: 0;
}
.flt-search input::placeholder { color: var(--muted); }
.flt-search-clear {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.06);
  color: var(--muted);
  border: 0;
  cursor: pointer;
}
.flt-search-clear:hover { background: rgba(0,0,0,0.10); color: var(--ink); }

/* ── No results (within a filter section) ── */
.flt-no-results {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.flt-no-results > svg { color: var(--muted-2); margin-top: 1px; flex-shrink: 0; }
.flt-no-results-title {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.flt-no-results-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* ── Footer ── */
.flt-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
  gap: 8px;
}
.flt-foot-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.flt-foot-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px oklch(0.95 0.07 150);
}
.flt-foot-hint {
  font-size: 11px;
  color: var(--muted);
}
.flt-btn-apply {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  background: var(--ink);
  color: white;
  border: 1px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
}
.flt-btn-apply:hover { background: #000; }

/*
   Reminder Bell Popover  (.rbp-*)
   Compact notification center anchored to topbar bell.
   ---------------------------------------------------------------------------
*/

/* ── Bell button ── */
.rbp-bell {
  position: relative;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  cursor: pointer;
}
.rbp-bell:hover { background: var(--surface-2); }
.rbp-bell.is-open {
  background: var(--surface-2);
  color: var(--ink);
}
.rbp-bell.has-count.is-urgent { color: var(--danger); }

.rbp-bell-badge {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-sizing: content-box;
}
.rbp-bell.is-urgent .rbp-bell-badge { background: var(--danger); }
.rbp-bell-badge-num {
  position: absolute;
  top: 1px; right: -2px;
  width: auto; height: auto;
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  border: 2px solid var(--surface);
  font-family: "Geist", sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: center;
}
.rbp-bell.is-urgent .rbp-bell-badge-num { background: var(--danger); }

/* ── Panel ── */
.rbp-panel {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(20,18,15,0.18), 0 6px 12px rgba(20,18,15,0.06);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  max-height: 560px;
  flex-shrink: 0;
}

/* ── Header ── */
.rbp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}
.rbp-head-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.rbp-head-title svg { color: var(--muted); }
.rbp-head-count {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-left: 4px;
}
.rbp-head-actions { display: flex; align-items: center; gap: 2px; }

.rbp-icon-btn {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.rbp-icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.rbp-text-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  font-weight: 500;
  cursor: pointer;
}
.rbp-text-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── Tabs ── */
.rbp-tabs {
  display: flex;
  gap: 0;
  padding: 6px 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.rbp-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  top: 1px;
}
.rbp-tab:hover { color: var(--ink-2); }
.rbp-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.rbp-tab-count {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.rbp-tab.is-active .rbp-tab-count {
  background: var(--ink); color: white;
}
.rbp-tab-count.is-active-count {
  background: var(--accent); color: white;
}

/* ── Body ── */
.rbp-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 8px;
  min-height: 0;
}

/* ── Group header ── */
.rbp-group { display: flex; flex-direction: column; }
.rbp-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 6px 4px;
}
.rbp-group-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.rbp-group-count {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-weight: 500;
}
.rbp-group-count.is-danger { background: oklch(0.96 0.07 25); color: var(--danger); }
.rbp-group-count.is-accent { background: oklch(0.95 0.07 50); color: var(--accent-ink); }
.rbp-group.is-danger .rbp-group-label { color: var(--danger); }
.rbp-group-body { display: flex; flex-direction: column; gap: 4px; }

/* ── Reminder row ── */
.rbp-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 80ms, box-shadow 80ms, background 80ms;
}
.rbp-row:hover {
  border-color: var(--ink-2);
}
.rbp-row.is-menu-open {
  border-color: var(--ink);
  box-shadow: 0 2px 6px rgba(20,18,15,0.08);
}

.rbp-row-stripe {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: transparent;
}
.rbp-row-overdue   { background: oklch(0.99 0.015 25); }
.rbp-row-overdue   .rbp-row-stripe { background: var(--danger); }
.rbp-row-escalated { background: oklch(0.99 0.015 25); border-color: oklch(0.86 0.06 25); }
.rbp-row-escalated .rbp-row-stripe { background: var(--danger); }
.rbp-row-due_today .rbp-row-stripe { background: var(--accent); }
.rbp-row-snoozed   { opacity: 0.82; }
.rbp-row-snoozed   .rbp-row-stripe { background: var(--muted-2); }
.rbp-row-open      .rbp-row-stripe { background: var(--line); }

.rbp-row-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 1px;
}
.rbp-row-overdue   .rbp-row-icon,
.rbp-row-escalated .rbp-row-icon {
  background: oklch(0.95 0.07 25);
  color: var(--danger);
}
.rbp-row-due_today .rbp-row-icon {
  background: oklch(0.95 0.07 50);
  color: var(--accent-ink);
}
.rbp-row-snoozed .rbp-row-icon {
  background: var(--surface-2);
  color: var(--muted-2);
}

.rbp-row-body {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rbp-row-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rbp-row-prio { color: var(--accent); display: inline-flex; }
.rbp-row-meta {
  display: flex; align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.rbp-row-owner {
  display: inline-flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.rbp-row-av {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: inline-grid; place-items: center;
  font-size: 7px; font-weight: 700;
}
.rbp-row-sep { color: var(--muted-2); }
.rbp-row-related {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted-2);
}
.rbp-row-escalation {
  margin-top: 4px;
  padding: 3px 7px;
  background: oklch(0.97 0.04 25);
  border-radius: 4px;
  font-size: 10.5px;
  color: var(--danger);
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
}

.rbp-row-right {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* Time chip — top right of each row */
.rbp-time-chip {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}
.rbp-time-chip.is-danger { background: oklch(0.94 0.09 25); color: var(--danger); }
.rbp-time-chip.is-accent { background: oklch(0.95 0.07 50); color: var(--accent-ink); }
.rbp-time-chip.is-muted  { background: var(--surface-2); color: var(--muted); }

.rbp-row-actions {
  display: flex; align-items: center; gap: 4px;
}
.rbp-row-primary {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.rbp-row-primary:hover { background: var(--surface-2); border-color: var(--ink-2); }
.rbp-row-primary.is-danger {
  background: var(--danger); color: white; border-color: var(--danger);
}
.rbp-row-primary.is-danger:hover { background: oklch(0.50 0.20 25); }
.rbp-row-primary.is-accent {
  background: var(--ink); color: white; border-color: var(--ink);
}
.rbp-row-primary.is-accent:hover { background: #000; }
.rbp-row-menu-btn {
  width: 22px; height: 22px;
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--muted-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
}
.rbp-row:hover .rbp-row-menu-btn { opacity: 1; }
.rbp-row-menu-btn:hover { background: var(--surface-2); color: var(--ink); }
.rbp-row.is-menu-open .rbp-row-menu-btn { opacity: 1; background: var(--surface-2); color: var(--ink); }

/* ── Inline menu ── */
.rbp-menu {
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 28px -8px rgba(20,18,15,0.20), 0 4px 8px rgba(20,18,15,0.06);
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 4px;
}
.rbp-menu.is-anchored { position: absolute; z-index: 50; }
.rbp-menu-item {
  display: flex; align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.rbp-menu-item:hover { background: var(--surface-2); }
.rbp-menu-item.is-danger { color: var(--danger); }
.rbp-menu-item.is-danger:hover { background: oklch(0.97 0.04 25); }
.rbp-menu-ico { display: inline-flex; color: var(--muted); }
.rbp-menu-item:hover .rbp-menu-ico { color: var(--ink); }
.rbp-menu-item.is-danger .rbp-menu-ico { color: var(--danger); }
.rbp-menu-label { white-space: nowrap; }

/* ── Success feedback ── */
.rbp-row-success {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  border-style: dashed;
  cursor: default;
}
.rbp-row-success.is-success { background: oklch(0.97 0.05 150); border-color: oklch(0.85 0.06 150); }
.rbp-row-success.is-success .rbp-row-stripe { background: var(--success); }
.rbp-row-success.is-success .rbp-row-success-ico { color: var(--success); }
.rbp-row-success.is-muted   { background: var(--surface-2); }
.rbp-row-success.is-muted .rbp-row-stripe { background: var(--muted); }
.rbp-row-success.is-muted .rbp-row-success-ico { color: var(--muted); }
.rbp-row-success.is-accent  { background: oklch(0.97 0.04 50); border-color: oklch(0.88 0.05 50); }
.rbp-row-success.is-accent .rbp-row-stripe { background: var(--accent); }
.rbp-row-success.is-accent .rbp-row-success-ico { color: var(--accent-ink); }
.rbp-row-success.is-danger  { background: oklch(0.97 0.04 25); border-color: oklch(0.86 0.06 25); }
.rbp-row-success.is-danger .rbp-row-stripe { background: var(--danger); }
.rbp-row-success.is-danger .rbp-row-success-ico { color: var(--danger); }
.rbp-row-success-ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
}
.rbp-row-success .rbp-row-title {
  text-decoration: line-through;
  text-decoration-color: var(--muted-2);
  color: var(--muted);
}
.rbp-row-success.is-accent .rbp-row-title,
.rbp-row-success.is-muted .rbp-row-title { text-decoration: none; color: var(--ink-2); }
.rbp-row-success.is-danger .rbp-row-title { text-decoration: none; color: var(--ink); }

/* ── Log row ── */
.rbp-log-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.rbp-log-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-2);
  font-size: 11.5px;
}
.rbp-log-row:last-child { border-bottom: 0; }
.rbp-log-row:hover { background: var(--surface-2); }
.rbp-log-channel { color: var(--muted); display: inline-flex; }
.rbp-log-body {
  display: flex; flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.rbp-log-recipient {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rbp-log-msg {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rbp-log-right {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.rbp-log-result {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rbp-log-time {
  font-size: 10px;
  color: var(--muted-2);
}

/* ── Empty state ── */
.rbp-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 36px 24px;
  text-align: center;
  gap: 6px;
}
.rbp-empty-ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--muted);
  margin-bottom: 4px;
}
.rbp-empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.rbp-empty-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  max-width: 30ch;
  line-height: 1.45;
}

/* ── Footer ── */
.rbp-foot {
  padding: 6px 8px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  display: flex;
  gap: 6px;
}
.rbp-foot-btn {
  flex: 1;
  width: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
}
.rbp-foot-btn:hover { background: var(--surface); color: var(--ink); }
.rbp-foot-btn svg { color: var(--muted); }
.rbp-foot-arrow {
  margin-left: auto;
  display: inline-flex;
  color: var(--muted-2);
}
.rbp-foot-btn:hover .rbp-foot-arrow { color: var(--ink-2); transform: translateX(2px); transition: transform 100ms; }

/* tweak panel */
.tweaks-fab {
  position: fixed; left: 14px; bottom: 14px;
  background: white; border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px; padding: 5px 9px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 6px;
  z-index: 10;
}

/* helper */
.hide { display: none !important; }

/* scrollbars */
.assistant-body::-webkit-scrollbar, .rail::-webkit-scrollbar, .main-content::-webkit-scrollbar { width: 8px; height: 8px; }
.assistant-body::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 4px;
}
.assistant-body::-webkit-scrollbar-track, .rail::-webkit-scrollbar-track, .main-content::-webkit-scrollbar-track {
  background: transparent;
}

/*
   Reminder Detail / Edit Modal  (.rdm-*)
   Opens from the bell popover or day reminders panel.
   ---------------------------------------------------------------------------
*/

.rdm-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,18,15,0.4);
  display: grid; place-items: center;
  z-index: 50;
  padding: 32px;
}
.rdm-shell {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 24px 56px -16px rgba(20,18,15,0.24), 0 8px 16px rgba(20,18,15,0.08);
  overflow: hidden;
  max-height: 92vh;
  display: flex; flex-direction: column;
}
.rdm-shell.is-confirm { max-width: 420px; }

.rdm {
  display: flex; flex-direction: column;
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 92vh;
}

/* ── Status strip ── */
.rdm-strip {
  display: flex; align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--line-2);
}
.rdm-strip.is-overdue,
.rdm-strip.is-escalated {
  background: oklch(0.97 0.04 25);
  color: var(--danger);
}
.rdm-strip.is-due_today {
  background: oklch(0.97 0.04 50);
  color: var(--accent-ink);
}
.rdm-strip.is-completed {
  background: oklch(0.95 0.07 150);
  color: var(--success);
}
.rdm-strip.is-snoozed {
  background: var(--surface-2);
  color: var(--muted);
}
.rdm-strip-ico { display: inline-flex; }

/* ── Header ── */
.rdm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 8px;
  gap: 12px;
}
.rdm-head-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.rdm-head-id {
  font-size: 10px; color: var(--muted-2);
  letter-spacing: 0.02em;
}
.rdm-head-prio {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--accent-ink);
  background: oklch(0.95 0.07 50);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.rdm-head-actions {
  display: flex; align-items: center; gap: 4px;
}

/* ── Status pill ── */
.rdm-status-pill {
  display: inline-flex; align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.rdm-status-pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.rdm-status-pill.is-open      { background: var(--surface-2);          color: var(--ink-2);   }
.rdm-status-pill.is-open      .rdm-status-pill-dot { background: var(--muted-2); }
.rdm-status-pill.is-due_today { background: oklch(0.95 0.07 50);       color: var(--accent-ink); }
.rdm-status-pill.is-due_today .rdm-status-pill-dot { background: var(--accent); }
.rdm-status-pill.is-overdue   { background: oklch(0.94 0.09 25);       color: var(--danger);  }
.rdm-status-pill.is-overdue   .rdm-status-pill-dot { background: var(--danger); }
.rdm-status-pill.is-completed { background: oklch(0.95 0.07 150);      color: var(--success); }
.rdm-status-pill.is-completed .rdm-status-pill-dot { background: var(--success); }
.rdm-status-pill.is-snoozed   { background: var(--surface-2);          color: var(--muted);   }
.rdm-status-pill.is-snoozed   .rdm-status-pill-dot { background: var(--muted-2); }
.rdm-status-pill.is-escalated { background: oklch(0.94 0.09 25);       color: var(--danger);  }
.rdm-status-pill.is-escalated .rdm-status-pill-dot { background: var(--danger); }

/* ── Buttons ── */
.rdm-text-btn {
  font-family: inherit;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.rdm-text-btn:hover { background: var(--surface-2); color: var(--ink); }
.rdm-text-btn.rdm-text-btn-strong { color: var(--ink); font-weight: 600; }
.rdm-text-btn.rdm-text-btn-warn { color: var(--accent-ink); }
.rdm-text-btn.rdm-text-btn-warn:hover { background: oklch(0.97 0.04 50); }
.rdm-text-btn.rdm-text-btn-danger { color: var(--danger); }
.rdm-text-btn.rdm-text-btn-danger:hover { background: oklch(0.97 0.04 25); }

.rdm-icon-btn {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}
.rdm-icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.rdm-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.rdm-btn:hover { background: var(--surface-2); }
.rdm-btn-primary { background: var(--ink); color: white; border-color: var(--ink); }
.rdm-btn-primary:hover { background: #000; }
.rdm-btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.rdm-btn-danger:hover { filter: brightness(0.95); }

/* ── Body ── */
.rdm-body {
  padding: 4px 18px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column;
}

/* ── Title ── */
.rdm-title {
  padding: 4px 0 12px;
  position: relative;
}
.rdm-title-text {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--ink);
}
.rdm-title-input {
  width: 100%;
  border: 0; outline: 0; background: transparent;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--ink);
  padding: 2px 0;
}
.rdm-title-input::placeholder { color: var(--muted-2); font-weight: 500; }
.rdm-title.has-error .rdm-title-input { color: var(--danger); }
.rdm-field-error {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px;
  color: var(--danger);
  margin-top: 4px;
  background: oklch(0.97 0.04 25);
  padding: 2px 7px;
  border-radius: 4px;
  align-self: flex-start;
}

/* ── Fields ── */
.rdm-fields {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-2);
}
.rdm-field {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-2);
  min-height: 30px;
}
.rdm-field:last-child { border-bottom: 0; }
.rdm-field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  padding-top: 4px;
  align-self: flex-start;
}
.rdm-field-ico { color: var(--muted-2); display: inline-flex; }
.rdm-field-value {
  display: flex; flex-direction: column;
  gap: 4px;
  min-width: 0;
  align-self: center;
}
.rdm-field.has-error .rdm-field-label { color: var(--danger); }

.rdm-readonly {
  font-size: 13px;
  color: var(--ink);
  padding: 3px 0;
}
.rdm-readonly-strong { font-weight: 500; }
.rdm-readonly-muted { color: var(--muted); }
.rdm-readonly-flag {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent-ink);
  font-weight: 500;
}

.rdm-input {
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 5px;
  outline: 0;
  margin-left: -8px;
  width: 100%;
}
.rdm-input::placeholder { color: var(--muted-2); }
.rdm-input:hover { background: var(--surface-2); }
.rdm-input:focus { background: var(--surface-2); border-color: var(--line); }

.rdm-due-edit { display: flex; align-items: center; gap: 4px; }
.rdm-due-edit .rdm-input:first-child { flex: 1; }

/* ── Segmented control ── */
.rdm-segment {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.rdm-segment-btn {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.rdm-segment-btn:hover { color: var(--ink-2); }
.rdm-segment-btn.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20,18,15,0.06), 0 0 0 1px var(--line);
}
.rdm-segment-status { flex-wrap: wrap; }

/* ── Owner chip ── */
.rdm-owner-chip {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.rdm-owner-chip:hover { background: var(--line-2); }
.rdm-owner-chip.is-readonly { background: transparent; cursor: default; }
.rdm-owner-av {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.10 35), oklch(0.5 0.10 35));
  color: white;
  display: inline-grid; place-items: center;
  font-size: 9px; font-weight: 700;
}
.rdm-owner-name { font-weight: 500; color: var(--ink); }
.rdm-owner-chev { color: var(--muted); display: inline-flex; }

/* ── Inline check (for the "send email" row) ── */
.rdm-check-inline {
  display: inline-flex; align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.rdm-check {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: inline-grid; place-items: center;
  color: white;
}
.rdm-check.is-on {
  background: var(--ink);
  border-color: var(--ink);
}

/* ── Timing pill picker ── */
.rdm-timing {
  display: flex; flex-wrap: wrap;
  gap: 4px;
}
.rdm-timing-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
}
.rdm-timing-pill:hover { background: var(--surface-2); }
.rdm-timing-pill.is-on {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.rdm-timing-pill.is-readonly { cursor: default; }
.rdm-timing-pill.is-readonly:hover { background: var(--surface); }
.rdm-timing-pill.is-readonly.is-on:hover { background: var(--ink); }

/* ── Section ── */
.rdm-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}
.rdm-section-head {
  margin-bottom: 6px;
}
.rdm-section-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.rdm-section-body {
  display: flex; flex-direction: column;
  gap: 4px;
}
.rdm-section-body .rdm-field {
  border-bottom: 0;
  padding: 4px 0;
}

/* ── Linked event ── */
.rdm-linked {
  display: flex; align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.rdm-linked-ico {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--cat-practice);
}
.rdm-linked-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  line-height: 1.3;
}
.rdm-linked-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rdm-linked-meta {
  font-size: 11px;
  color: var(--muted);
}

.rdm-link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border: 1px dashed var(--line);
  background: transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}
.rdm-link-btn:hover { background: var(--surface-2); border-style: solid; color: var(--ink-2); }

/* ── Notes ── */
.rdm-notes-text {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.rdm-textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 6px;
  outline: 0;
  resize: vertical;
  min-height: 56px;
  line-height: 1.55;
}
.rdm-textarea:focus { border-color: var(--ink-2); }
.rdm-textarea::placeholder { color: var(--muted-2); }

/* ── Saved toast ── */
.rdm-saved-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: oklch(0.95 0.07 150);
  border: 1px solid oklch(0.85 0.06 150);
  border-radius: 7px;
  font-size: 12px;
  color: var(--success);
  margin-bottom: 12px;
}
.rdm-saved-toast strong { color: var(--success); font-weight: 600; }
.rdm-saved-toast-ico {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: oklch(0.85 0.10 150);
  display: grid; place-items: center;
  color: white;
}
.rdm-saved-toast-body { color: var(--ink-2); }
.rdm-saved-toast-actions { display: flex; align-items: center; gap: 2px; }

/* ── Footer ── */
.rdm-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  gap: 12px;
}
.rdm-foot-left { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rdm-foot-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ── Confirm delete ── */
.rdm-confirm {
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.rdm-confirm-ico {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: oklch(0.95 0.07 25);
  color: var(--danger);
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.rdm-confirm-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 4px 0 0;
}
.rdm-confirm-body {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.rdm-confirm-meta {
  font-size: 11px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.rdm-confirm-actions {
  display: flex; justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* tweak panel */
.tweaks-fab {
  position: fixed; left: 14px; bottom: 14px;
  background: white; border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px; padding: 5px 9px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 6px;
  z-index: 10;
}

/* helper */
.hide { display: none !important; }

/* scrollbars */
.assistant-body::-webkit-scrollbar, .rail::-webkit-scrollbar, .main-content::-webkit-scrollbar { width: 8px; height: 8px; }
.assistant-body::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 4px;
}
.assistant-body::-webkit-scrollbar-track, .rail::-webkit-scrollbar-track, .main-content::-webkit-scrollbar-track {
  background: transparent;
}


.rdm-head-create-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.rdm-head-create-label svg { color: var(--muted); }
.rdm-head-source {
  font-size: 11px;
  color: var(--muted);
}
.rdm-head-source strong {
  color: var(--ink-2);
  font-weight: 500;
}
.rdm-foot-hint {
  font-size: 10.5px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 5px;
  padding-left: 4px;
}
.rdm-foot-hint kbd {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--ink-2);
}


/* ─────────────────────────────────────────────
   Roles & Permissions  (.role-*)
   Role switcher, visibility badges, permission panel,
   role-aware previews, People & Roles admin module.
   ───────────────────────────────────────────── */

/* ── Avatar tints ── */
.role-av {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}
.role-av-ink    { background: linear-gradient(135deg, #2a2a2a, #0a0a0a); }
.role-av-blue   { background: linear-gradient(135deg, oklch(0.62 0.14 250), oklch(0.42 0.14 250)); }
.role-av-purple { background: linear-gradient(135deg, oklch(0.58 0.14 290), oklch(0.42 0.14 290)); }
.role-av-teal   { background: linear-gradient(135deg, oklch(0.62 0.12 180), oklch(0.42 0.12 180)); }
.role-av-pink   { background: linear-gradient(135deg, oklch(0.62 0.16 350), oklch(0.45 0.14 350)); }
.role-av-amber  { background: linear-gradient(135deg, oklch(0.68 0.14 70), oklch(0.48 0.13 70)); }
.role-av-slate  { background: linear-gradient(135deg, oklch(0.58 0.04 240), oklch(0.40 0.04 240)); }

/* ── Switcher ── */
.role-switcher {
  display: flex; align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.role-switcher:hover { background: var(--surface-2); }
.role-switcher.is-open {
  background: var(--surface-2);
  border-color: var(--ink-2);
}
.role-switcher.is-restricted {
  border-color: oklch(0.86 0.06 25);
  background: oklch(0.99 0.015 25);
}
.role-switcher-meta {
  display: flex; flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  align-items: flex-start;
}
.role-switcher-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.role-switcher-role {
  font-size: 10.5px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.role-switcher-sep { color: var(--muted-2); }
.role-switcher-chev { color: var(--muted-2); display: inline-flex; flex-shrink: 0; }
.role-switcher-lock {
  color: var(--danger);
  display: inline-flex;
  flex-shrink: 0;
}

/* ── Switcher dropdown ── */
.role-switcher-dropdown {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(20,18,15,0.18), 0 6px 12px rgba(20,18,15,0.06);
  width: 360px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.role-switcher-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  gap: 2px;
}
.role-switcher-header-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.role-switcher-header-hint {
  display: inline-flex; align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--accent-ink);
  background: oklch(0.97 0.04 50);
  padding: 3px 7px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 2px;
}
.role-switcher-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  max-height: 440px;
}
.role-switcher-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  align-items: center;
}
.role-switcher-row:hover { background: var(--surface-2); }
.role-switcher-row.is-active {
  background: oklch(0.97 0.005 60);
  box-shadow: inset 3px 0 0 var(--accent);
}
.role-switcher-row.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.role-switcher-row.is-disabled:hover { background: transparent; }
.role-switcher-row-body {
  display: flex; flex-direction: column;
  gap: 1px;
  line-height: 1.3;
  min-width: 0;
}
.role-switcher-row-top {
  display: flex; align-items: baseline;
  gap: 5px;
}
.role-switcher-row-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.role-switcher-row-role { font-size: 10px; color: var(--muted); }
.role-switcher-row-blurb {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.role-switcher-row-right {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.role-switcher-access {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.role-switcher-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
}
.role-switcher-footer svg { color: var(--muted-2); }

/* ── Role badges ── */
.role-badge {
  display: inline-flex; align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.role-badge.is-sm {
  font-size: 9px;
  padding: 1px 5px;
  letter-spacing: 0.03em;
}
.role-badge svg { opacity: 0.85; }
.role-badge-neutral  { background: var(--surface-2);            color: var(--ink-2);    }
.role-badge-team     { background: oklch(0.96 0.04 180);        color: var(--cat-team); }
.role-badge-staff    { background: oklch(0.96 0.02 280);        color: var(--cat-staff); }
.role-badge-selected { background: oklch(0.96 0.06 250);        color: var(--cat-practice); }
.role-badge-admin    { background: oklch(0.95 0.025 240);       color: var(--cat-staff); border-color: var(--line); }
.role-badge-muted    { background: var(--surface-2);            color: var(--muted);    }
.role-badge-warn     { background: oklch(0.97 0.04 50);         color: var(--accent-ink); }
.role-badge-ok       { background: oklch(0.95 0.07 150);        color: var(--success); }

/* ── Permissions panel (event modal extension) ── */
.role-perm-panel {
  display: flex; flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.role-perm-panel.is-readonly { background: var(--surface-2); }
.role-perm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.role-perm-head-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.role-perm-head-label svg { color: var(--muted-2); }
.role-perm-body {
  padding: 12px;
  display: flex; flex-direction: column;
  gap: 12px;
}
.role-perm-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

/* Visibility grid */
.role-vis-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
@media (max-width: 640px) {
  .role-vis-grid { grid-template-columns: repeat(2, 1fr); }
}
.role-vis-card {
  position: relative;
  display: flex; flex-direction: column;
  gap: 3px;
  padding: 8px 9px 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 76px;
}
.role-vis-card:hover { background: var(--surface-2); }
.role-vis-card.is-active {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.role-vis-card.is-readonly { cursor: not-allowed; opacity: 0.8; }
.role-vis-card.is-readonly:hover { background: var(--surface); }
.role-vis-card-ico { display: inline-flex; }
.role-vis-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 2px;
}
.role-vis-card-desc {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.4;
}
.role-vis-card-check {
  position: absolute; top: 6px; right: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: grid; place-items: center;
}

/* Edit access segmented */
.role-segment {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.role-segment-btn {
  flex: 1;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.role-segment-btn:hover:not(:disabled) { color: var(--ink-2); }
.role-segment-btn.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20,18,15,0.06), 0 0 0 1px var(--line);
}
.role-segment-btn:disabled { cursor: not-allowed; }

/* Visible-to summary */
.role-perm-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 6px;
  flex-wrap: wrap;
}
.role-perm-summary-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.role-perm-summary-chips {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.role-perm-summary-chip {
  display: inline-flex; align-items: center;
  font-size: 11px;
  padding: 2px 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
}

/* Attendee override */
.role-attendee-override { display: flex; flex-direction: column; gap: 6px; }
.role-attendee-list {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.role-attendee-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 4px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-2);
}
.role-attendee-chip-role {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  font-weight: 600;
}
.role-attendee-chip-x {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  color: var(--muted);
  border: 0;
  display: inline-grid; place-items: center;
  cursor: pointer;
}
.role-attendee-chip-x:hover { background: rgba(0,0,0,0.10); color: var(--ink); }
.role-attendee-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.role-attendee-add:hover { background: var(--surface-2); border-style: solid; color: var(--ink-2); }

/* Warnings */
.role-perm-warnings { display: flex; flex-direction: column; gap: 6px; }
.role-vis-warning {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  align-items: flex-start;
}
.role-vis-warning-warn {
  background: oklch(0.97 0.04 50);
  border: 1px solid oklch(0.88 0.05 50);
  color: var(--accent-ink);
}
.role-vis-warning-danger {
  background: oklch(0.97 0.04 25);
  border: 1px solid oklch(0.86 0.06 25);
  color: var(--danger);
}
.role-vis-warning-ico {
  display: inline-flex;
  margin-top: 1px;
}
.role-vis-warning-title {
  font-weight: 600;
  font-size: 11.5px;
}
.role-vis-warning-detail {
  font-size: 11px;
  margin-top: 1px;
  color: var(--ink-2);
}
.role-vis-warning-danger .role-vis-warning-detail { color: var(--ink-2); }
.role-text-btn {
  font-family: inherit;
  font-size: 11px;
  padding: 3px 8px;
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.role-text-btn:hover { background: rgba(255,255,255,0.5); }

/* ── Calendar preview ── */
.role-cal-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; flex-direction: column;
  overflow: hidden;
  width: 100%;
}
.role-cal-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.role-cal-preview-head-left {
  display: flex; align-items: center; gap: 8px;
}
.role-cal-preview-head-meta { display: flex; flex-direction: column; line-height: 1.2; }
.role-cal-preview-head-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.role-cal-preview-head-role { font-size: 10px; color: var(--muted); }
.role-cal-preview-head-right { display: flex; align-items: center; gap: 8px; }
.role-cal-preview-date { font-size: 10px; color: var(--muted); }
.role-cal-preview-hidden {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px;
  padding: 1px 6px;
  background: oklch(0.97 0.04 50);
  color: var(--accent-ink);
  border-radius: 999px;
  font-weight: 600;
}

.role-cal-preview-body {
  padding: 6px;
  display: flex; flex-direction: column;
  gap: 3px;
  min-height: 220px;
}
.role-cal-slot {
  display: grid;
  grid-template-columns: 44px 6px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line-2);
}
.role-cal-slot-time {
  font-size: 10px;
  color: var(--muted);
}
.role-cal-slot-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  justify-self: center;
}
.role-cal-slot-title {
  font-size: 12px;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.role-restricted-event {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--surface-2) 6px 12px);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
}
.role-restricted-ico {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted);
  grid-column: 1;
  justify-self: end;
}
.role-restricted-text {
  display: flex; align-items: center; gap: 8px;
  font-style: italic;
}
.role-restricted-time {
  font-style: normal;
  color: var(--muted-2);
}

/* Empty state */
.role-empty {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.role-empty-ico {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: grid; place-items: center;
}
.role-empty-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.role-empty-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* ── Restricted action button ── */
.role-restricted-action {
  position: relative;
  display: inline-block;
}
.role-restricted-action button.is-disabled,
button.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.role-restricted-action-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms;
  z-index: 10;
}
.role-restricted-action:hover .role-restricted-action-tooltip { opacity: 1; }
.role-restricted-action-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}

/* ── People & Roles panel ── */
.role-panel {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}
.role-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px;
  gap: 16px;
  border-bottom: 1px solid var(--line-2);
}
.role-panel-title {
  margin: 0; font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.role-panel-sub {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.role-panel-head-right { display: flex; align-items: center; gap: 8px; }
.role-text-hint { font-size: 11px; color: var(--muted); }
.role-text-hint strong { color: var(--ink-2); font-weight: 500; }

.role-panel-section {
  padding: 16px 18px;
  border-top: 1px solid var(--line-2);
}
.role-panel-section:first-of-type { border-top: 0; }
.role-panel-section-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.role-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.role-role-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.role-role-card:hover { background: var(--surface-2); }
.role-role-card.is-active {
  background: var(--surface-2);
  border-color: var(--ink);
}
.role-role-card-body {
  display: flex; flex-direction: column;
  gap: 1px;
  line-height: 1.35;
  min-width: 0;
}
.role-role-card-name {
  font-size: 12.5px;
  font-weight: 600;
}
.role-role-card-desc {
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.role-role-card-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Access matrix table */
.role-perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  table-layout: fixed;
}
.role-perm-table th,
.role-perm-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line-2);
}
.role-perm-table th {
  background: var(--surface-2);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.role-perm-table th:first-child,
.role-perm-table td:first-child { text-align: left; }
.role-perm-table-cal {
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
}
.role-perm-table-cell {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.role-perm-table-cell.is-edit    { color: var(--success); font-weight: 600; }
.role-perm-table-cell.is-view    { color: var(--ink-2); }
.role-perm-table-cell.is-own     { color: var(--accent-ink); font-weight: 600; }
.role-perm-table-cell.is-invited { color: var(--accent); font-weight: 600; }
.role-perm-table-cell.is-scope   { color: var(--cat-staff); font-weight: 600; }
.role-perm-dash { color: var(--muted-2); }
.role-perm-table tr.is-dim { opacity: 0.35; }

.role-perm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--muted);
}
.role-perm-legend-chip {
  display: inline-block;
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-2);
  margin-right: 4px;
  font-weight: 600;
}
.role-perm-legend-chip.is-edit    { color: var(--success); }
.role-perm-legend-chip.is-view    { color: var(--ink-2); }
.role-perm-legend-chip.is-own     { color: var(--accent-ink); }
.role-perm-legend-chip.is-invited { color: var(--accent); }
.role-perm-legend-chip.is-scope   { color: var(--cat-staff); }

/* tweak panel */
.tweaks-fab {
  position: fixed; left: 14px; bottom: 14px;
  background: white; border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px; padding: 5px 9px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 6px;
  z-index: 10;
}

/* helper */
.hide { display: none !important; }

/* scrollbars */
.assistant-body::-webkit-scrollbar, .rail::-webkit-scrollbar, .main-content::-webkit-scrollbar { width: 8px; height: 8px; }
.assistant-body::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 4px;
}
.assistant-body::-webkit-scrollbar-track, .rail::-webkit-scrollbar-track, .main-content::-webkit-scrollbar-track {
  background: transparent;
}


.role-rail-drop { left: 0; right: auto; width: 360px; z-index: 80; }
.role-context-chip strong { margin-left: 4px; }

/* Chat-first assistant rail */
.chat-shell {
  height: 100%;
  background: var(--surface);
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  flex-shrink: 0;
}
.chat-head-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.chat-head-ico { color: var(--accent); display: inline-flex; }
.chat-head-actions { display: flex; align-items: center; gap: 2px; }
.chat-head-link {
  font-family: inherit;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 550;
  cursor: pointer;
}
.chat-head-link:hover { background: var(--surface-2); color: var(--ink); }
.chat-head-icon-btn {
  width: 24px; height: 24px;
  border-radius: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.chat-head-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  min-height: 0;
}
.chat-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  height: 100%;
  padding: 32px 24px;
  gap: 6px;
}
.chat-empty-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: oklch(0.97 0.04 50);
  color: var(--accent);
  margin-bottom: 8px;
}
.chat-empty-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
}
.chat-empty-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 32ch;
}
.chat-thread {
  display: flex; flex-direction: column;
  gap: 10px;
}
.chat-msg {
  display: flex;
  width: 100%;
}
.chat-msg-user { justify-content: flex-end; }
.chat-msg-bot { justify-content: flex-start; }
.chat-bubble {
  max-width: 86%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-bubble-user {
  background: var(--ink);
  color: white;
  border-bottom-right-radius: 3px;
}
.chat-bubble-bot {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-bottom-left-radius: 3px;
}
.chat-bubble-error {
  background: color-mix(in srgb, var(--danger) 8%, white);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}
.chat-text { white-space: pre-wrap; }
.chat-error-detail {
  margin-top: 4px;
  color: var(--danger);
  font-size: 12px;
}
.chat-bubble-thinking {
  display: inline-flex; align-items: center;
  gap: 4px;
  padding: 10px 14px;
}
.chat-think-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chat-think-bounce 1.2s infinite ease-in-out;
}
.chat-think-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-think-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes chat-think-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.chat-action {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.chat-action.is-done {
  background: oklch(0.97 0.06 150);
  border-color: oklch(0.85 0.06 150);
}
.chat-action.is-undone {
  background: var(--surface-2);
  border-color: var(--line);
  opacity: 0.7;
}
.chat-action-head {
  display: flex; align-items: center; gap: 6px;
}
.chat-action-ico {
  display: inline-flex;
  color: var(--accent);
}
.chat-action.is-done .chat-action-ico { color: var(--success); }
.chat-action-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}
.chat-action.is-done .chat-action-title { color: var(--success); }
.chat-action-detail {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.chat-action-detail.is-warning { color: var(--danger); }
.chat-action-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
}
.chat-action-undo {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: inherit;
  font-size: 11px;
  padding: 3px 8px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 550;
}
.chat-action-undo:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-2);
}
.chat-action-undone-label {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.chat-input-wrap {
  flex-shrink: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line-2);
  background: var(--surface);
}
.chat-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 6px 6px 12px;
  transition: border-color 100ms, box-shadow 100ms, background 100ms;
}
.chat-input-wrap.is-dragging-file .chat-input-shell {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.95 0.04 50);
}.chat-input-shell:focus-within {
  background: var(--surface);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px oklch(0.97 0.005 60);
}
.chat-input-area {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
  padding: 4px 0;
  resize: none;
  max-height: 140px;
  min-height: 22px;
}
.chat-input-area::placeholder { color: var(--muted); }
.chat-input-send {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 0;
  background: var(--ink);
  color: white;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-input-send:hover:not(:disabled) { background: #000; }
.chat-input-send:disabled {
  background: var(--line);
  color: var(--muted-2);
  cursor: not-allowed;
}
.chat-input-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 7px;
}
.chat-input-hint-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
  white-space: nowrap;
}
.chat-input-hint-item + .chat-input-hint-item::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--muted-2);
  opacity: 0.55;
}
.chat-input-hint kbd {
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--ink-2);
}
.chat-bullets {
  margin: 6px 0 0;
  padding-left: 18px;
  display: flex; flex-direction: column;
  gap: 2px;
}
.chat-bullets li {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.45;
}
.chat-bullets li::marker { color: var(--muted-2); }

.role-dir-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-dir-search {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.role-dir-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.role-dir-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.role-dir-tabs button {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
}
.role-dir-tabs button:hover,
.role-dir-tabs button.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.role-dir-tabs span {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  opacity: 0.75;
}
.role-dir-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line-2);
}
.role-dir-form,
.role-dir-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.role-dir-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  align-self: start;
}
.role-dir-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.role-dir-field span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.role-dir-field input,
.role-dir-field select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 0 9px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
}
.role-dir-error {
  padding: 7px 9px;
  border-radius: 7px;
  background: oklch(0.97 0.05 25);
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 600;
}
.role-dir-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.role-dir-primary,
.role-dir-secondary {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}
.role-dir-primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: white;
}
.role-dir-secondary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.role-dir-list {
  min-width: 0;
  overflow: hidden;
}
.role-dir-group + .role-dir-group {
  border-top: 1px solid var(--line-2);
}
.role-dir-group-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.role-dir-group-head strong {
  color: var(--ink);
}
.role-dir-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line-2);
}
.role-dir-row:first-of-type {
  border-top: 0;
}
.role-dir-row.is-editing {
  background: oklch(0.98 0.015 250);
}
.role-dir-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 700;
}
.role-dir-person {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.role-dir-person-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.role-dir-person-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}
.role-dir-person-top span {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.role-dir-person-sub {
  display: flex;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
}
.role-dir-person-sub span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-dir-actions {
  display: flex;
  gap: 4px;
}
.role-dir-actions button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
}
.role-dir-actions button:hover {
  background: var(--surface-2);
  color: var(--ink);
}
@media (max-width: 860px) {
  .role-dir-layout {
    grid-template-columns: 1fr;
  }
}

.evm-schedule-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 12px; margin: 8px 0 6px; }
.evm-schedule-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.evm-schedule-head strong { font-size: 12px; font-weight: 650; color: var(--ink); }
.evm-schedule-head .evm-toggle { margin-left: auto; }
.evm-schedule-grid { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(110px, 1fr) minmax(110px, 1fr); gap: 8px; }
.evm-schedule-grid.is-all-day { grid-template-columns: minmax(150px, 220px); }
.evm-schedule-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.evm-schedule-field span { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.evm-schedule-field input { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 0 9px; font: inherit; font-size: 13px; color: var(--ink); color-scheme: light; }
.evm-schedule-field input:focus { outline: 0; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.evm-schedule-summary { margin-top: 8px; color: var(--muted); font-size: 11.5px; }
@media (max-width: 720px) {
  .evm-schedule-grid { grid-template-columns: 1fr; }
  .evm-schedule-head { align-items: flex-start; flex-wrap: wrap; }
  .evm-schedule-head .evm-toggle { margin-left: 0; }
}

.evm-schedule-field { cursor: pointer; }
.evm-schedule-field input { cursor: pointer; }

.settings-page {
  padding: 18px;
  min-height: 100%;
  background: var(--surface-2);
}
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.settings-kicker,
.settings-panel-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.settings-head h1,
.settings-panel h2 {
  margin: 0;
  color: var(--ink);
}
.settings-head h1 {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}
.settings-head p,
.settings-copy,
.settings-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.settings-icon-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink-2);
}
.settings-icon-action:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}
.settings-panel-wide {
  grid-column: 1 / -1;
}
.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.settings-panel h2 {
  font-size: 17px;
  line-height: 1.2;
}
.settings-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
}
.settings-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.settings-status.success { color: var(--success); background: oklch(0.98 0.035 150); }
.settings-status.accent { color: var(--accent); background: oklch(0.98 0.035 250); }
.settings-status.danger { color: var(--danger); background: oklch(0.98 0.035 25); }
.settings-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.settings-metrics.compact {
  grid-template-columns: minmax(0, 1fr);
}
.settings-metrics div {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 9px 10px;
}
.settings-metrics strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}
.settings-metrics span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}
.settings-env-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.settings-env-list code {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}
.settings-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.settings-field > span {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}
.settings-field select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12.5px;
}
.settings-field select:focus {
  outline: 2px solid rgba(37, 99, 235, .18);
  border-color: var(--accent);
}
.settings-note.danger { color: var(--danger); }
.settings-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
}
.settings-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.settings-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.settings-btn:not(:disabled):hover {
  border-color: var(--ink);
  color: var(--ink);
}
.settings-btn.primary:not(:disabled):hover {
  color: white;
  filter: brightness(1.08);
}
@media (max-width: 860px) {
  .settings-page { padding: 12px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-metrics { grid-template-columns: 1fr; }
}

.settings-connected-banner {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.settings-connected-banner > svg {
  margin-top: 2px;
}
.settings-connected-banner strong,
.settings-toggle-row strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.25;
}
.settings-connected-banner span,
.settings-toggle-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.settings-connected-banner.success { border-color: oklch(0.86 0.08 150); background: oklch(0.98 0.025 150); }
.settings-connected-banner.accent { border-color: oklch(0.86 0.08 250); background: oklch(0.98 0.025 250); }
.settings-connected-banner.danger { border-color: oklch(0.88 0.07 25); background: oklch(0.98 0.025 25); }
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: white;
}
.settings-segmented {
  flex-shrink: 0;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.settings-segmented button {
  min-width: 62px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.settings-segmented button.is-active {
  background: var(--ink);
  color: white;
}
.settings-btn.danger {
  border-color: oklch(0.84 0.08 25);
  color: var(--danger);
}
.settings-btn.danger:not(:disabled):hover {
  border-color: var(--danger);
  color: var(--danger);
}
@media (max-width: 720px) {
  .settings-toggle-row {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-segmented {
    width: 100%;
  }
  .settings-segmented button {
    flex: 1;
  }
}

.popover-backdrop {
  pointer-events: none;
}
.popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
}
.popover-close:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.popover-head {
  position: relative;
  padding-right: 42px;
}

.calendar-click-shield {
  position: absolute;
  inset: 0;
  z-index: 39;
}
.main {
  position: relative;
}

/* Scouting */
.scout-page {
  min-height: 100%;
  padding: 16px;
  background: var(--surface-2);
}
.scout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.scout-kicker,
.scout-panel-title span,
.scout-card-head span,
.scout-side-head span,
.scout-report-head span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scout-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}
.scout-header p {
  margin: 6px 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.scout-primary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.scout-primary:hover { filter: brightness(1.08); }
.scout-shell {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(360px, 1fr) minmax(300px, 360px);
  gap: 12px;
  align-items: start;
}
.scout-opponents,
.scout-card,
.scout-side-panel,
.scout-report {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.scout-opponents { overflow: hidden; }
.scout-panel-title {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.scout-panel-title strong {
  font-family: "Geist Mono", monospace;
  color: var(--ink);
  font-size: 11px;
}
.scout-opponent-list { display: flex; flex-direction: column; }
.scout-opponent {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-2);
  color: var(--muted);
  text-align: left;
}
.scout-opponent:last-child { border-bottom: 0; }
.scout-opponent:hover,
.scout-opponent.is-active { background: var(--surface-2); }
.scout-opponent.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.scout-opponent-top,
.scout-opponent-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.scout-opponent strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
}
.scout-opponent em {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 5px;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.scout-opponent > span { font-size: 11.5px; }
.scout-opponent-bottom { justify-content: flex-start; flex-wrap: wrap; }
.scout-opponent-bottom b {
  padding: 2px 6px;
  border-radius: 5px;
  background: white;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
}
.scout-workspace,
.scout-preview,
.scout-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.scout-card { padding: 13px; }
.scout-summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(5, minmax(90px, 1fr));
  gap: 8px;
}
.scout-summary-grid label,
.scout-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.scout-summary-grid span,
.scout-field span,
.scout-player-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scout-summary-grid input,
.scout-summary-grid select,
.scout-field textarea,
.scout-player-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}
.scout-summary-grid input,
.scout-summary-grid select,
.scout-player-row input {
  height: 34px;
  padding: 0 9px;
}
.scout-field textarea {
  min-height: 82px;
  padding: 8px 9px;
  resize: vertical;
  line-height: 1.45;
}
.scout-summary-grid input:focus,
.scout-summary-grid select:focus,
.scout-field textarea:focus,
.scout-player-row input:focus {
  outline: 0;
  border-color: var(--ink-2);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.scout-card-head,
.scout-report-head,
.scout-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.scout-card-head h2,
.scout-report-head h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}
.scout-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.scout-tabs button {
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.scout-tabs button.is-active { background: var(--ink); color: white; }
.scout-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.scout-field:last-child:nth-child(odd) { grid-column: 1 / -1; }
.scout-player-head,
.scout-player-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(180px, 1.5fr);
  gap: 8px;
  align-items: center;
}
.scout-player-head {
  margin-bottom: 6px;
  padding: 0 1px;
}
.scout-player-row + .scout-player-row { margin-top: 7px; }
.scout-side-panel { padding: 12px; }
.scout-side-head {
  align-items: center;
  margin-bottom: 9px;
}
.scout-side-head strong {
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: 12px;
}
.scout-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.scout-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}
.scout-checks,
.scout-focus-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}
.scout-checks div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.scout-checks div.is-done { color: var(--ink); }
.scout-checks div.is-done svg { color: var(--success); }
.scout-focus-list div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-2);
}
.scout-focus-list strong { color: var(--ink); font-size: 12px; }
.scout-focus-list span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.scout-report { overflow: hidden; }
.scout-report-head {
  margin: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line-2);
}
.scout-report-meta {
  flex-shrink: 0;
  text-align: right;
}
.scout-report-meta strong,
.scout-report-meta span { display: block; }
.scout-report-meta strong { color: var(--ink); font-size: 13px; }
.scout-report-meta span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.scout-report-alert {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: flex-start;
  margin: 12px;
  padding: 9px 10px;
  border: 1px solid oklch(0.86 0.08 50);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 1.4;
}
.scout-report-alert svg { margin-top: 1px; }
.scout-report-section {
  padding: 11px 12px;
  border-top: 1px solid var(--line-2);
}
.scout-report-section h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}
.scout-report-section p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.48;
}
.scout-report-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scout-report-players div {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-2);
}
.scout-report-players strong { color: var(--ink); font-size: 12px; }
.scout-report-players span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.scout-report-players p { margin-top: 2px; }
@media (max-width: 1180px) {
  .scout-shell { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); }
  .scout-preview {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    align-items: start;
  }
  .scout-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .scout-page { padding: 12px; }
  .scout-header { flex-direction: column; }
  .scout-primary { width: 100%; }
  .scout-shell,
  .scout-preview { grid-template-columns: 1fr; }
  .scout-fields,
  .scout-summary-grid,
  .scout-player-head,
  .scout-player-row { grid-template-columns: 1fr; }
  .scout-card-head { flex-direction: column; }
  .scout-tabs { width: 100%; }
  .scout-tabs button { flex: 1; }
  .scout-player-head { display: none; }
}

@media (max-width: 1400px) {
  .scout-shell { grid-template-columns: minmax(210px, 250px) minmax(0, 1fr); }
  .scout-preview {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    align-items: start;
  }
  .scout-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 0 10px;
  }
  .topbar .search { display: none; }
  .brand-tail { display: none; }
  .body,
  .body.assistant-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: auto;
  }
  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    gap: 10px;
    overflow: visible;
  }
  .rail .mini-cal,
  .rail-section.is-collapsed,
  .rail-section:has(.srch-anchor) {
    display: none;
  }
  .new-event-btn { min-height: 34px; }
  .assistant,
  .assistant-toggle-btn {
    display: none;
  }
  .main {
    min-height: 0;
  }
  .main-content {
    overflow: visible;
  }
}

@media (max-width: 700px) {
  .topbar .top-actions .search,
  .topbar .search {
    display: none !important;
  }
  .scout-shell,
  .scout-preview,
  .scout-fields,
  .scout-summary-grid,
  .scout-player-row {
    grid-template-columns: 1fr !important;
  }
  .scout-preview {
    display: grid;
  }
  .scout-opponents,
  .scout-workspace,
  .scout-preview {
    min-width: 0;
  }
}

.scout-copy-btn {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}
.scout-copy-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
@media (max-width: 700px) {
  .scout-report-meta {
    text-align: left;
  }
  .scout-copy-btn {
    width: 100%;
  }
}

.body.workspace-no-rail {
  grid-template-columns: minmax(0, 1fr) 320px;
}
.body.workspace-no-rail.assistant-collapsed {
  grid-template-columns: minmax(0, 1fr) 0px;
}
@media (max-width: 700px) {
  .body.workspace-no-rail,
  .body.workspace-no-rail.assistant-collapsed {
    grid-template-columns: 1fr;
  }
}

/* Scouting layout refresh */
.scout-layout-page {
  padding: 18px;
  background: var(--surface-2);
}
.scout-layout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.scout-layout-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}
.scout-layout-header p {
  margin: 7px 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.scout-layout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.scout-ghost-btn,
.scout-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
}
.scout-ghost-btn {
  min-height: 34px;
  padding: 0 11px;
}
.scout-ghost-btn.compact {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}
.scout-icon-btn {
  width: 30px;
  height: 30px;
}
.scout-ghost-btn:hover,
.scout-icon-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.scout-command-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.scout-command-strip div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px 13px;
}
.scout-command-strip strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}
.scout-command-strip span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scout-layout-grid {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(480px, 1fr) minmax(250px, 310px);
  gap: 14px;
  align-items: start;
}
.scout-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-width: 0;
  overflow: hidden;
}
.scout-panel-head {
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.scout-panel-head span,
.scout-report-titlebar span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scout-panel-head h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}
.scout-queue-list {
  display: flex;
  flex-direction: column;
}
.scout-queue-card {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--muted);
  text-align: left;
}
.scout-queue-card:last-child {
  border-bottom: 0;
}
.scout-queue-card:hover,
.scout-queue-card.is-active {
  background: var(--surface-2);
}
.scout-queue-card.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}
.scout-queue-top,
.scout-queue-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.scout-queue-top {
  justify-content: space-between;
}
.scout-queue-top strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scout-status {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-2);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}
.scout-status.ready {
  color: var(--success);
  background: oklch(0.98 0.025 150);
  border-color: oklch(0.86 0.07 150);
}
.scout-status.review {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: oklch(0.86 0.08 50);
}
.scout-queue-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.scout-queue-foot {
  flex-wrap: wrap;
}
.scout-queue-foot b {
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: white;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
}
.scout-canvas-panel {
  min-height: 620px;
}
.scout-canvas-head {
  align-items: center;
}
.scout-stepper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}
.scout-stepper span {
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}
.scout-stepper span.is-done {
  background: var(--ink);
}
.scout-report-frame {
  padding: 14px;
}
.scout-report-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.scout-report-titlebar strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}
.scout-blank-report {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.scout-section-tile {
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.scout-section-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: white;
  border: 1px solid var(--line);
  color: var(--accent-ink);
}
.scout-section-tile h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}
.scout-section-tile p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.scout-empty-board {
  min-height: 275px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, white 0%, var(--surface-2) 100%);
}
.scout-empty-lines {
  display: grid;
  gap: 10px;
  max-width: 72%;
}
.scout-empty-lines span {
  height: 10px;
  border-radius: 999px;
  background: var(--line-2);
}
.scout-empty-lines span:nth-child(2) {
  width: 86%;
}
.scout-empty-lines span:nth-child(3) {
  width: 58%;
}
.scout-empty-callout {
  max-width: 520px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.scout-empty-callout svg {
  margin-top: 2px;
  color: var(--accent);
}
.scout-empty-callout strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
}
.scout-empty-callout span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.scout-side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.scout-action-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}
.scout-action-list div {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.scout-action-list svg {
  color: var(--success);
}
.scout-film-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}
.scout-film-grid div {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
}
.scout-film-grid strong {
  color: var(--ink);
  font-size: 12px;
}
.scout-film-grid span {
  color: var(--muted);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
}
@media (max-width: 1180px) {
  .scout-layout-grid {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  }
  .scout-side-stack {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .scout-layout-page {
    padding: 12px;
  }
  .scout-layout-header,
  .scout-layout-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .scout-layout-actions,
  .scout-command-strip,
  .scout-layout-grid,
  .scout-side-stack,
  .scout-blank-report,
  .scout-film-grid {
    grid-template-columns: 1fr;
  }
  .scout-layout-grid {
    display: grid;
  }
  .scout-canvas-panel {
    min-height: 0;
  }
  .scout-empty-lines {
    max-width: 100%;
  }
}
