/* ═══════════════════════════════════════════════════════════════
   Office Ops — Design system v2 ("Soft Aurora")
   Fresh, minimalist surfaces: cool light canvas, borderless white
   cards with generous radii, pill controls, and blurred gradient
   graphics reserved for data moments (stat tiles, avatar, login).
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Surfaces */
  --bg-root: #F1F1F3;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F4F4F6;
  --bg-hover: rgba(17, 17, 19, 0.04);
  --bg-active: rgba(17, 17, 19, 0.07);

  /* Nav */
  --nav-bg: transparent;
  --nav-text: #6E6E73;
  --nav-text-hover: #111113;
  --nav-active: #111113;
  --nav-accent: #EB6C49;
  --nav-collapsed: 72px;
  --nav-expanded: 248px;

  /* Text */
  --text-primary: #111113;
  --text-secondary: #6E6E73;
  --text-tertiary: #A1A1A6;

  /* Brand accent (used sparingly) + highlighter chip */
  --accent: #EB6C49;
  --accent-soft: rgba(235, 108, 73, 0.10);
  --accent-hover: rgba(235, 108, 73, 0.14);
  --lime: #DCF86A;
  --lime-text: #2B3600;

  /* MARK-OS context & semantic — schedule markers, do not change */
  --consulting: #0071e3;
  --consulting-bg: #EAF2FF;
  --startup: #30D158;
  --startup-bg: #E8F9EE;
  --others: #FF9F0A;
  --others-bg: #FFF4E3;
  --focus: #0071e3;
  --focus-bg: #EAF2FF;
  --urgent: #ff3b30;
  --urgent-bg: #FFECEB;
  --success: #34c759;
  --warning: #ff9f0a;
  --danger: #ff3b30;

  /* Gradient graphics (data tiles, avatar, login backdrop) */
  --grad-consulting: radial-gradient(70% 70% at 12% 8%, #C6E3FF 0%, rgba(198,227,255,0) 60%), radial-gradient(80% 80% at 95% 95%, #1A4FC4 0%, rgba(26,79,196,0) 65%), linear-gradient(135deg, #5EA6F5 0%, #2C74E2 100%);
  --grad-startup: radial-gradient(70% 70% at 12% 8%, #D6FAE0 0%, rgba(214,250,224,0) 60%), radial-gradient(80% 80% at 95% 95%, #0E8F49 0%, rgba(14,143,73,0) 65%), linear-gradient(135deg, #5CDD8E 0%, #22B35F 100%);
  --grad-others: radial-gradient(70% 70% at 12% 8%, #FFEBCB 0%, rgba(255,235,203,0) 60%), radial-gradient(80% 80% at 95% 95%, #E8650F 0%, rgba(232,101,15,0) 65%), linear-gradient(135deg, #FFB64F 0%, #F7871F 100%);
  --grad-brand: linear-gradient(135deg, #FFB199 0%, #EB6C49 50%, #D94C7A 100%);

  /* Mesh + grain (allocation tiles) — luminous corner glow, deep tonal anchor, hue-shift accent */
  --mesh-consulting: radial-gradient(55% 75% at 92% 6%, rgba(173,214,255,0.95) 0%, rgba(173,214,255,0) 62%), radial-gradient(45% 60% at 20% 20%, rgba(129,140,248,0.55) 0%, rgba(129,140,248,0) 70%), radial-gradient(75% 95% at 2% 104%, rgba(23,37,120,0.95) 0%, rgba(23,37,120,0) 64%), linear-gradient(155deg, #4F8EF7 0%, #2459D9 55%, #1E3FAE 100%);
  --mesh-startup: radial-gradient(55% 75% at 92% 6%, rgba(190,248,212,0.95) 0%, rgba(190,248,212,0) 62%), radial-gradient(45% 60% at 20% 20%, rgba(45,212,191,0.5) 0%, rgba(45,212,191,0) 70%), radial-gradient(75% 95% at 2% 104%, rgba(6,78,59,0.95) 0%, rgba(6,78,59,0) 64%), linear-gradient(155deg, #34D399 0%, #10A36B 55%, #047857 100%);
  --mesh-others: radial-gradient(55% 75% at 92% 6%, rgba(254,240,190,0.95) 0%, rgba(254,240,190,0) 62%), radial-gradient(45% 60% at 20% 20%, rgba(251,113,133,0.45) 0%, rgba(251,113,133,0) 70%), radial-gradient(75% 95% at 2% 104%, rgba(154,52,18,0.9) 0%, rgba(154,52,18,0) 64%), linear-gradient(155deg, #FDBA4D 0%, #F98A2B 55%, #E5560F 100%);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

  /* Hairlines & elevation — borderless by default, soft diffuse lift */
  --border: rgba(17, 17, 19, 0.06);
  --border-strong: rgba(17, 17, 19, 0.14);
  --border-light: rgba(17, 17, 19, 0.045);
  --ring: 0 0 0 1px rgba(17, 17, 19, 0.06);
  --shadow-sm: 0 1px 2px rgba(17, 17, 19, 0.04);
  --shadow-md: 0 1px 2px rgba(17, 17, 19, 0.03), 0 6px 16px -4px rgba(17, 17, 19, 0.08);
  --shadow-lg: 0 2px 4px rgba(17, 17, 19, 0.04), 0 16px 40px -12px rgba(17, 17, 19, 0.14);
  --shadow-xl: 0 4px 8px rgba(17, 17, 19, 0.04), 0 32px 80px -16px rgba(17, 17, 19, 0.22);
  --shadow-card: 0 1px 2px rgba(17, 17, 19, 0.02), 0 8px 24px -10px rgba(17, 17, 19, 0.07);

  /* Radii — generous, Apple-like */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.25s;
  --duration-slow: 0.4s;
  --ease: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* ── Layout Shell ─────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--nav-expanded) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
}

/* ── Sidebar — floats on the canvas, no divider ───────── */
.sidebar {
  background: var(--nav-bg);
  width: var(--nav-expanded);
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  overflow: hidden;
  border-right: none;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
}

.sidebar-brand {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
  gap: var(--space-3);
  border-bottom: none;
  flex-shrink: 0;
}

img.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(235, 108, 73, 0.25));
}

.brand-text {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--nav-active);
  white-space: nowrap;
}

.nav-section {
  padding: var(--space-4) 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--nav-text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  position: relative;
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  color: var(--nav-text-hover);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--nav-active);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  font-weight: 500;
}

.nav-item.active::before { content: none; }

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.6; }

.nav-text {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.nav-badge {
  margin-left: auto;
  background: var(--lime);
  color: var(--lime-text);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  line-height: 1.4;
}

.nav-badge.w { background: var(--lime); color: var(--lime-text); }

.nav-item.ceo-only-nav {
  margin-top: var(--space-3);
  box-shadow: var(--ring);
  color: var(--nav-active);
  background: var(--bg-surface);
}

.nav-item.ceo-only-nav[hidden] { display: none !important; }

.sidebar-footer {
  padding: var(--space-3) 0 0;
  border-top: none;
  flex-shrink: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-fast) ease;
}

.user-pill:hover { box-shadow: var(--shadow-md); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-brand);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.user-info {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.user-name { font-size: 0.8rem; font-weight: 600; color: var(--nav-active); letter-spacing: -0.01em; }
.user-role { font-size: 0.68rem; color: var(--nav-text); }

.logout-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--nav-text);
  flex-shrink: 0;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
  margin-left: auto;
}

.logout-btn svg { width: 15px; height: 15px; stroke-width: 1.75; }
.logout-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Main & Topbar ─────────────────────────────────────── */
.main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-root);
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-7);
  background: var(--bg-root);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: var(--space-4); }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; }
.breadcrumb-item { color: var(--text-tertiary); }
.breadcrumb-sep { color: var(--text-tertiary); font-size: 0.7rem; }
.breadcrumb-current { color: var(--text-secondary); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: var(--space-2); }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow var(--duration-fast) ease;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.search-trigger:hover { box-shadow: var(--shadow-md); }
.search-trigger svg { width: 14px; height: 14px; stroke: var(--text-tertiary); }

.search-shortcut {
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--bg-surface-alt);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
  border: none;
}

.topbar-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration-fast) ease;
  position: relative;
}

.topbar-btn:hover { background: var(--bg-surface); box-shadow: var(--shadow-card); color: var(--text-primary); }
.topbar-btn svg { width: 18px; height: 18px; }

/* ── Page content area ─────────────────────────────────── */
#page-content.page {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-7) var(--space-8);
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

#page-content.page::-webkit-scrollbar { width: 8px; }
#page-content.page::-webkit-scrollbar-track { background: transparent; }
#page-content.page::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#page-content.page:hover::-webkit-scrollbar-thumb { background: var(--border-strong); background-clip: padding-box; }

#sched-content.day-grid-host::-webkit-scrollbar { width: 6px; }
#sched-content.day-grid-host::-webkit-scrollbar-track { background: transparent; }
#sched-content.day-grid-host::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
#sched-content.day-grid-host:hover::-webkit-scrollbar-thumb { background: var(--border-strong); }

.page-loading {
  padding: var(--space-7);
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.page-title { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.035em; color: var(--text-primary); }
.page-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 4px; font-weight: 400; }

/* ── Page header (ph) ──────────────────────────────────── */
.ph { margin-bottom: var(--space-5); display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.ph h2 { font-size: 2.25rem; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.ph-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  background: var(--bg-surface);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}

/* ── Card ──────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease);
}

.card:hover { border-color: transparent; box-shadow: var(--shadow-card); }

.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); gap: var(--space-3); }
.card-t { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; text-transform: none; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.card-body { padding: 0; }

/* Card with segmented tabs */
.card--tabs { padding: var(--space-4) var(--space-5) var(--space-4); }
.card--tabs .tabs { margin: 0 0 var(--space-2); padding: 0; }
.card--tabs .todo-panel { padding-top: var(--space-2); }

/* ── Buttons & tags ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 34px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, transform var(--duration-fast) ease;
  border: none;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn svg { width: 15px; height: 15px; }
.btn-primary, .btn-p { background: var(--text-primary); color: #fff; }
.btn-primary:hover, .btn-p:hover { background: #2C2C30; }
.btn-secondary, .btn-g { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--ring), var(--shadow-sm); }
.btn-secondary:hover, .btn-g:hover { background: var(--bg-surface-alt); }
.btn-s { padding: 0 12px; height: 28px; font-size: 0.75rem; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.4;
}

.tag.consulting { background: var(--consulting-bg); color: var(--consulting); }
.tag.startup { background: var(--startup-bg); color: #1E9E4A; }
.tag.others { background: var(--others-bg); color: #D97B00; }

/* ── Tabs — segmented control ──────────────────────────── */
.tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-pill);
  border-bottom: none;
}
.tab {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  position: relative;
  border-radius: var(--radius-pill);
  transition: color var(--ease), background var(--ease), box-shadow var(--ease);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); font-weight: 600; background: var(--bg-surface); box-shadow: 0 1px 2px rgba(17, 17, 19, 0.06), 0 2px 6px rgba(17, 17, 19, 0.04); }
.tab.active::after { content: none; }

.tc {
  margin-left: 7px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(17, 17, 19, 0.06);
  color: var(--text-secondary);
  line-height: 1.4;
}

.tab.active .tc { background: var(--lime); color: var(--lime-text); }

.sub-tabs { display: flex; gap: 4px; padding: var(--space-2) 0 var(--space-2); margin-bottom: 2px; }
.sub-tab {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: all var(--ease);
}

.sub-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.sub-tab.active { color: var(--text-primary); background: var(--bg-active); }

a.sub-tab.sub-tab-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}
.mark-today-submenu { flex-wrap: wrap; align-items: center; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }

/* ── Day nav & pills ───────────────────────────────────── */
.day-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.day-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg-surface);
  box-shadow: var(--ring), var(--shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--ease);
  flex-shrink: 0;
}

.day-nav-btn:hover { background: var(--bg-surface-alt); color: var(--text-primary); }

.day-pills { display: flex; gap: 4px; flex: 1; justify-content: center; }
.day-pill {
  padding: 6px 0 7px;
  width: 44px;
  text-align: center;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  transition: all var(--ease);
  line-height: 1.3;
}

.day-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.day-pill.active { background: var(--text-primary); color: #fff; box-shadow: 0 6px 14px -6px rgba(17, 17, 19, 0.5); }
.day-pill.today { position: relative; }
.day-pill.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.day-pill.active.today::after { background: var(--lime); }
.day-pill .dp-day { font-size: 10px; font-weight: 500; display: block; opacity: 0.8; }
.day-pill .dp-num { font-size: 14px; font-weight: 600; display: block; letter-spacing: -0.02em; }

.sched-day { display: none; }
.sched-day.active { display: block; animation: slideIn 0.2s ease; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Day grid (8am–10pm operating hours) ───────────────── */
#sched-content.day-grid-host {
  max-height: min(68vh, 740px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 4px;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
}

.day-grid { position: relative; padding: 4px 4px 20px 52px; }
.day-grid-inner { position: relative; width: 100%; }

.dg-hour {
  position: absolute;
  left: -48px;
  right: 0;
  height: 56px;
  border-top: 1px solid var(--border-light);
  pointer-events: none;
}

.dg-hour-half {
  position: absolute;
  left: -48px;
  right: 0;
  border-top: 1px dashed rgba(17, 17, 19, 0.035);
  pointer-events: none;
}

.dg-hour-label {
  position: absolute;
  left: 0;
  top: -7px;
  width: 44px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

.dg-event {
  position: absolute;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  border: none;
  background: var(--bg-surface-alt);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.04);
  transition: box-shadow var(--ease), transform var(--ease), filter var(--ease);
}

.dg-event:hover {
  box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.06), var(--shadow-md);
  transform: translateY(-1px);
  filter: none;
}

.dg-event-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  line-height: 1.3;
  margin-bottom: 1px;
  letter-spacing: 0.01em;
}

.dg-event-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.dg-event-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-event--focus {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0.05));
  border-color: transparent;
  border-left: none;
}

.dg-event--focus .dg-event-title { color: #0A5CC2; }
.dg-event--focus .dg-event-time { color: rgba(10, 92, 194, 0.7); }

.dg-event--meeting { border-left-width: 0; }

.dg-event.dg-ctx-consulting {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0.05));
}
.dg-event.dg-ctx-consulting .dg-event-title { color: #0A5CC2; }
.dg-event.dg-ctx-consulting .dg-event-time { color: rgba(10, 92, 194, 0.7); }

.dg-event.dg-ctx-startup {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.2), rgba(48, 209, 88, 0.06));
}
.dg-event.dg-ctx-startup .dg-event-title { color: #178A3E; }
.dg-event.dg-ctx-startup .dg-event-time { color: rgba(23, 138, 62, 0.7); }

.dg-event.dg-ctx-others {
  background: linear-gradient(135deg, rgba(255, 159, 10, 0.22), rgba(255, 159, 10, 0.06));
}
.dg-event.dg-ctx-others .dg-event-title { color: #B86A00; }
.dg-event.dg-ctx-others .dg-event-time { color: rgba(184, 106, 0, 0.7); }

.dg-event--cancelled { opacity: 0.45; }
.dg-event--cancelled .dg-event-title { text-decoration: line-through; }

.dg-now {
  position: absolute;
  left: -6px;
  right: 0;
  height: 1.5px;
  background: var(--urgent, #ff3b30);
  z-index: 8;
  pointer-events: none;
}

.dg-now-dot {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--urgent, #ff3b30);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.18);
}

/* ── Timeline (legacy list items still used elsewhere) ── */
.tl-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--ease);
}

.tl-clickable { cursor: pointer; }
.tl-item:hover {
  background: var(--bg-hover);
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
}

.tl-item:last-child { border-bottom: none; }

.tl-time {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  padding-top: 1px;
}

.tl-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
#sched-content .tl-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
#sched-content .tl-title-main {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.tl-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}

.dot.ok { background: var(--success); }
.dot.warn { background: var(--warning); }
.dot.bad { background: var(--urgent); }

.tl-fb {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 10px 8px;
  margin: 2px -8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--ease);
  background: var(--focus-bg);
}

.tl-fb.tl-clickable:hover { background: var(--bg-hover); }

.fb-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
}

.fb-tasks { font-size: 11px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.fb-tasks span { display: block; }

.now {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 4px 0;
  align-items: center;
}

.now-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--urgent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.now-line { height: 1px; background: linear-gradient(90deg, var(--urgent), transparent); }

.empty-day { padding: 30px 0; text-align: center; color: var(--text-tertiary); font-size: 13px; }

/* ── Todo items ────────────────────────────────────────── */
.cb {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--ease);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
}

.cb:hover { border-color: var(--text-primary); }
.cb.checked { background: var(--text-primary); border-color: var(--text-primary); }
.cb.checked::after {
  content: '';
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-1px);
}

.ti {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--ease), opacity 0.3s ease;
}

.ti:hover { background: var(--bg-hover); }
.ti:last-child { border-bottom: none; }

.ti-c { flex: 1; min-width: 0; }
.ti-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.ti-t {
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.005em;
}
.ti-t.done { text-decoration: line-through; color: var(--text-tertiary); }
.ti-m {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-tertiary);
}
.ti-m .ti-block { flex-shrink: 0; }
.ti-a { display: flex; gap: 2px; opacity: 0; transition: opacity var(--ease); flex-shrink: 0; }
.ti:hover .ti-a { opacity: 1; }
.ti--active { background: var(--bg-active); }
.ti--active:hover .ti-a { opacity: 1; }

.ti-block {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.ib {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--ease);
}

.ib:hover { background: var(--bg-surface); box-shadow: var(--ring); color: var(--text-primary); }
.ib.mv:hover { background: var(--consulting-bg); color: var(--consulting); box-shadow: none; }
.ib.notes-icon { color: var(--text-tertiary); }
.ib.notes-icon.has-notes { color: var(--consulting); }

.sd {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sd::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }
.sd:first-child { margin-top: 6px; }

.ar { display: flex; gap: 8px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border-light); align-items: center; }
.ai-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.ai-input:focus { border-color: transparent; background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 4px rgba(17, 17, 19, 0.05); }
.ai-input::placeholder { color: var(--text-tertiary); }
.ar .btn.btn-s { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 0.85rem; }

/* ── Analysis — gradient stat tiles ────────────────────── */
.analysis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: var(--space-4);
  align-items: stretch;
  margin-top: var(--space-2);
  padding: 0;
  background: transparent;
  border: none;
  border-top: none;
  border-radius: 0;
}

.a-stat {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 18px 20px 20px;
  min-height: 156px;
  border-right: none;
  border-radius: var(--radius-lg);
  background: var(--tile-base, #2459D9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 1px 2px rgba(17, 17, 19, 0.06),
    0 18px 36px -18px var(--tile-glow, rgba(36, 89, 217, 0.55));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1), box-shadow 260ms ease;
}

/* Layer 1 — mesh gradient (drifts subtly on hover) */
.a-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--tile-mesh, var(--mesh-consulting));
  background-size: 130% 130%;
  background-position: 0% 0%;
  z-index: -2;
  transition: background-position 900ms cubic-bezier(.2, .8, .2, 1);
}

/* Layer 2 — film grain + top sheen, blended into the mesh */
.a-stat::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain), linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 45%);
  background-size: 180px 180px, 100% 100%;
  mix-blend-mode: overlay;
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

.a-stat:hover { transform: translateY(-2px); }
.a-stat:hover::before { background-position: 100% 100%; }

.a-stat:last-of-type { border-right: none; }
.a-stat--consulting { --tile-mesh: var(--mesh-consulting); --tile-base: #2459D9; --tile-glow: rgba(36, 89, 217, 0.55); }
.a-stat--startup { --tile-mesh: var(--mesh-startup); --tile-base: #10A36B; --tile-glow: rgba(16, 163, 107, 0.5); }
.a-stat--others { --tile-mesh: var(--mesh-others); --tile-base: #F98A2B; --tile-glow: rgba(229, 86, 15, 0.45); }

.a-val {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}
.a-unit {
  font-size: 0.52em;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 2px;
  opacity: 0.72;
}
/* Label sits top-left as an eyebrow; value + target anchor the bottom */
.a-label {
  order: -1;
  margin-bottom: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.94);
  letter-spacing: 0.01em;
}
.a-label::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
.a-target {
  align-self: flex-start;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  .a-stat, .a-stat::before { transition: none; }
  .a-stat:hover { transform: none; }
  .a-stat:hover::before { background-position: 0% 0%; }
}

.a-note {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: none;
  padding: 22px 22px 20px;
  border-left: none;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-end;
  position: relative;
}

.a-note::before {
  content: 'Insight';
  position: absolute;
  top: 18px;
  left: 22px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ── Focus block picker ────────────────────────────────── */
.day-row { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 4px; display: flex; align-items: center; gap: 6px; }
.day-row:first-child { margin-top: 0; }
.day-badge { font-weight: 400; color: var(--text-tertiary); font-size: 10px; }

.bslot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--ease);
  margin-bottom: 4px;
  border: none;
  background: var(--bg-surface-alt);
}

.bslot:hover { background: var(--bg-active); }
.bslot-color { width: 5px; height: 28px; border-radius: var(--radius-pill); flex-shrink: 0; }
.bslot-info { flex: 1; }
.bslot-time { font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.bslot-ctx { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.bslot-cap { font-size: 11px; font-weight: 600; color: var(--text-tertiary); }

/* ── Email ─────────────────────────────────────────────── */
.em {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--ease);
}

.em:hover { background: var(--bg-hover); margin: 0 -8px; padding: 14px 8px; border-radius: var(--radius-sm); }
.em-from { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.em-subj { font-size: 13px; margin-bottom: 3px; }
.em-prev { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.em-time { font-family: var(--font-sans); font-size: 11px; color: var(--text-tertiary); }
.em-act { display: flex; gap: 5px; margin-top: 8px; }

/* ── Modals — frosted overlay, floating sheet ──────────── */
.mo {
  position: fixed;
  inset: 0;
  background: rgba(241, 241, 243, 0.55);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.mo.active { display: flex; }

.md {
  background: var(--bg-surface);
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6);
  animation: mdIn 0.25s var(--ease-out);
}

.md.md--sched { width: min(520px, 94vw); }
.md.md--add { width: min(560px, 94vw); }

@keyframes mdIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.md h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 3px; letter-spacing: -0.025em; }
.md-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.md-s { margin-bottom: 16px; }
.md-s-t { font-size: 10.5px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.md-s p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }
.md-s p.md-empty { color: var(--text-tertiary); font-style: italic; }
.md-s-decision p { color: var(--text-primary); font-weight: 500; }
.md-s-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg-surface-alt); color: var(--text-secondary); border: none; }
.md-s-badge.md-s-badge-alert { background: rgba(255, 82, 82, 0.1); color: #E03E3E; border-color: transparent; }
.md-link { color: var(--consulting); text-decoration: none; word-break: break-all; font-size: 13px; }
.md-link:hover { text-decoration: underline; }
.md-a { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.md-a.md-a--split { justify-content: space-between; flex-wrap: wrap; align-items: center; }

/* Schedule cancel (meeting / focus) — uses img/icon-delete-schedule.svg */
.md-cancel-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background var(--ease), opacity var(--ease);
}
.md-cancel-entry:hover { background: var(--urgent-bg); }
.md-cancel-entry:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }
.md-cancel-entry__img { display: block; width: 10px; height: 10px; pointer-events: none; user-select: none; }

.badge-cancelled {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger, #dc2626);
}

.md-sched--cancelled .jmed,
.md-focus--cancelled .focus-list { opacity: 0.85; pointer-events: none; }

.tl-entry--cancelled { opacity: 0.55; }
.tl-entry--cancelled .tl-title,
.tl-entry--cancelled .tl-title-main,
.tl-entry--cancelled .tl-title-row { text-decoration: line-through; }
.tl-entry--cancelled .tl-time { text-decoration: line-through; }

.cal-pill.cal-pill--cancelled { opacity: 0.5; text-decoration: line-through; }
.cal-pill.cal-pill--cancelled .cal-pill-txt::before {
  content: '✕ ';
  font-weight: 700;
  text-decoration: none;
  display: inline;
}

.ib.del-task { color: var(--text-tertiary); }
.ib.del-task:hover { color: var(--danger, #dc2626); background: var(--urgent-bg); box-shadow: none; }

/* Add calendar block modal */
.add-tabs {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 16px;
  padding: 4px;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-pill);
  border-bottom: none;
}
.add-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--ease);
}
.add-tab:hover { color: var(--text-primary); }
.add-tab.active {
  border-color: transparent;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.06), 0 2px 6px rgba(17, 17, 19, 0.04);
}
.add-panel { margin-bottom: 6px; }
.add-field .ai-input,
.add-field textarea.ai-input { display: block; width: 100%; box-sizing: border-box; }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-grid .add-field { min-width: 0; }
.add-field { margin-bottom: 10px; }
.add-end-time { font-family: var(--font-sans); font-size: 12px; color: var(--text-secondary); margin: -4px 0 10px; }
.add-textarea { min-height: 74px; resize: vertical; line-height: 1.45; }
.add-file-label { display: block; cursor: pointer; }
.add-file-label input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.add-file-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-tertiary);
  background: transparent;
  transition: border-color var(--ease), background var(--ease);
}
.add-file-label:hover .add-file-zone { border-color: var(--text-tertiary); background: var(--bg-surface-alt); }
.add-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.add-file-item {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-alt);
  border: none;
  color: var(--text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.add-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.add-task-list { display: flex; flex-direction: column; gap: 5px; }
.add-task-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.add-task-check input { margin: 0; width: 14px; height: 14px; accent-color: var(--text-primary); }

/* Add-meeting modal: rich agenda / goal / pre-read */
.add-cal-modal .add-field-rich { margin-bottom: 12px; }
.add-cal-modal .add-panel[data-panel="meeting"] .md-rt.add-md-rt { margin-bottom: 8px; }
.add-cal-modal .add-panel[data-panel="meeting"] .md-seg-internal .md-jmed-tb { margin-top: 4px; }

/* Meeting detail: agenda may contain HTML from rich editor */
.md-agenda-body { font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); margin: 0; }
.md-agenda-body p:first-child { margin-top: 0; }
.md-agenda-body p:last-child { margin-bottom: 0; }
.md-agenda-body ul,
.md-agenda-body ol { margin: 6px 0; padding-left: 18px; }

/* Meeting modal: public vs internal */
.md-seg { margin-bottom: 16px; }
.md-seg-public { padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.md-seg-internal { padding-top: 2px; }

.md-seg-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.md-seg-title::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.md-seg-title--public { color: var(--accent); }
.md-seg-title--internal { color: #1E9E4A; }

.md-attach-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.md-attach-list li { margin-bottom: 3px; }

.md-attendees-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.md-attendees-list li { margin-bottom: 4px; }

.md-jmed-tb .ntb-btn { width: 26px; height: 26px; font-size: 12px; }

.md-rt {
  margin-bottom: 6px;
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface-alt);
}
.md-rt-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style: none;
  background: transparent;
  color: var(--text-secondary);
  border-bottom: none;
}
.md-rt-sum::-webkit-details-marker { display: none; }
.md-rt-lab {
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  font-weight: 600;
}
.md-rt[open] .md-rt-sum .md-rt-lab { color: var(--text-primary); }

.md-rt .ned.jmed {
  min-height: 48px;
  max-height: none;
  height: auto;
  margin: 0;
  border: none;
  border-top: 1px solid var(--border-light);
  border-radius: 0;
  padding: 8px 12px 10px;
  font-size: 13.5px;
  line-height: 1.5;
  overflow: visible;
  overflow-y: visible;
  box-sizing: border-box;
  background: var(--bg-surface);
}
.md-rt .ned.jmed:focus { border-top-color: var(--border-light); outline: none; }
.md-rt .ned.jmed:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); font-style: italic; }

/* Notes modal */
.nmo {
  position: fixed;
  inset: 0;
  background: rgba(241, 241, 243, 0.55);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  z-index: 105;
  display: none;
  align-items: center;
  justify-content: center;
}

.nmo.active { display: flex; }

.nmd {
  background: var(--bg-surface);
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  width: 500px;
  padding: var(--space-6);
  animation: mdIn 0.2s var(--ease-out);
}

.nmd.nmd-notes {
  width: min(520px, calc(100vw - 32px));
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.nmd.nmd-notes .tasks-notes-body { flex: 1; min-height: 0; }
.nmd.nmd-notes .tasks-notes-footer.nmd-notes-ft {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.nmd h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.02em; }
.nmd-sub { font-size: 12px; color: var(--text-tertiary); margin-bottom: 14px; }
.ntb { display: flex; gap: 3px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.ntb.md-jmed-tb { border-bottom: none; padding-bottom: 0; margin-bottom: 6px; }
.ntb-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ntb-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.ntb-sep { width: 1px; height: 18px; background: var(--border-light); margin: 5px 3px; }

.ned {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.7;
  color: var(--text-primary);
  outline: none;
  transition: box-shadow var(--ease), background var(--ease);
}

.ned:focus { border-color: transparent; background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 4px rgba(17, 17, 19, 0.05); }
.ned:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); font-style: italic; }
.ned ul, .ned ol { margin-left: 18px; padding: 0; }
.ned li { margin-bottom: 2px; }
.nmd-ft { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }

/* Tag modal */
.tmo {
  position: fixed;
  inset: 0;
  background: rgba(241, 241, 243, 0.55);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
}

.tmo.active { display: flex; }

.tmd {
  background: var(--bg-surface);
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  width: 340px;
  padding: var(--space-6);
  animation: mdIn 0.2s var(--ease-out);
}

.tmd h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.02em; }
.tmd-sub { font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px; }

.topt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--ease);
  border: none;
  background: var(--bg-surface-alt);
  margin-bottom: 6px;
}

.topt:hover { background: var(--bg-active); }
.topt-c { width: 10px; height: 34px; border-radius: var(--radius-pill); flex-shrink: 0; }
.topt-i { flex: 1; }
.topt-n { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.topt-d { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.topt-k {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  box-shadow: var(--ring);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(17, 17, 19, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  border: none;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Command Palette ───────────────────────────────────── */
.cmd-palette-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(241, 241, 243, 0.55);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  z-index: 1000;
  place-items: center;
}

.cmd-palette-overlay.open { display: grid; }

.cmd-palette {
  width: min(580px, 90vw);
  background: var(--bg-surface);
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: cmdIn 0.2s var(--ease-out);
}

@keyframes cmdIn {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}

.cmd-input-wrap svg { width: 18px; height: 18px; stroke: var(--text-tertiary); flex-shrink: 0; }

.cmd-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: transparent;
}

.cmd-input::placeholder { color: var(--text-tertiary); }

.cmd-results { padding: 8px; max-height: 320px; overflow-y: auto; }

.cmd-group-label {
  padding: 8px 14px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.cmd-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) ease;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.cmd-result:hover, .cmd-result.selected { background: var(--bg-surface-alt); }
.cmd-result svg { width: 16px; height: 16px; stroke: var(--text-secondary); flex-shrink: 0; }

.cmd-result-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmd-result-title { font-size: 0.85rem; color: var(--text-primary); }
.cmd-result-sub { font-size: 0.72rem; color: var(--text-tertiary); }

.cmd-empty { padding: 20px 22px; font-size: 0.85rem; color: var(--text-tertiary); text-align: center; }
.cmd-more { padding: 8px 14px 10px; font-size: 0.72rem; color: var(--text-tertiary); }

.cmd-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  border-top: 1px solid var(--border-light);
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.cmd-footer kbd {
  background: var(--bg-surface-alt);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  border: none;
}

/* Compact category pill: schedule, Today / Tasks todo rows, notes headers */
#sched-content .tag.task-card-tag,
.ti-m .tag.task-card-tag,
.tasks-notes-head .tag.task-card-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
}
.tasks-notes-head .tag.task-card-tag { margin-top: 3px; }

/* ── Task Queue: two-column layout + inline notes ──────── */
.tasks-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 480px);
  gap: var(--space-5);
  align-items: start;
}
.tasks-list-col { min-width: 0; }
.tasks-list-card { margin-bottom: 0; }
.tasks-notes-col {
  position: sticky;
  top: 24px;
  min-width: 0;
  max-width: 480px;
  width: 100%;
  justify-self: start;
}
.tasks-notes-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  margin-bottom: 0;
  max-width: 480px;
  width: 100%;
}
.tasks-notes-empty {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  padding: 8px 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.tasks-notes-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.tasks-notes-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  letter-spacing: -0.02em;
}
.tasks-notes-body { display: flex; flex-direction: column; gap: 0; width: 100%; }
.tasks-ned-wrap { flex: 1; min-height: 160px; margin-bottom: 0; width: 100%; }
.tasks-changelog-section { margin-top: 14px; padding-top: 0; border: none; }
.tasks-changelog-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.tasks-changelog { list-style: none; margin: 0; padding: 0; font-size: 0.72rem; color: var(--text-tertiary); line-height: 1.4; }
.tasks-changelog li { margin-bottom: 6px; padding-left: 10px; border-left: 2px solid var(--border); }
.tasks-changelog li:last-child { margin-bottom: 0; }
.tasks-changelog-empty { border-left: none; padding-left: 0; color: var(--text-tertiary); font-size: 0.7rem; }
.tasks-changelog .tcl-time { display: block; color: var(--text-tertiary); font-size: 0.72rem; opacity: 0.9; margin-bottom: 1px; }
.tasks-ned { min-height: 140px; max-height: min(50vh, 420px); overflow-y: auto; }
.tasks-notes-footer { display: flex; justify-content: flex-end; padding-top: 12px; border-top: none; margin-top: auto; width: 100%; }

.tasks-list-card .ti-c { cursor: pointer; }
.tasks-list-card .notes-icon.ib { color: var(--text-tertiary); }
.tasks-list-card .notes-icon.ib svg { width: 13px; height: 13px; flex-shrink: 0; }
.tasks-list-card .notes-icon.ib.has-notes { color: var(--consulting); }

/* ── Focus block modal ─────────────────────────────────── */
.md.md--focus { width: min(480px, 94vw); }

.focus-list { display: flex; flex-direction: column; gap: 4px; }

.focus-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-surface-alt);
  transition: background var(--ease);
}

.focus-task:hover { background: var(--bg-active); }
.focus-task--done { opacity: 0.58; }

.focus-task-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.4; min-width: 0; }
.focus-task-name.done { text-decoration: line-through; color: var(--text-tertiary); }

.focus-task-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity var(--ease); }
.focus-task:hover .focus-task-actions { opacity: 1; }

.focus-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition: all var(--ease);
  flex-shrink: 0;
}

.focus-icon-btn:hover { background: var(--bg-surface); box-shadow: var(--ring); color: var(--text-primary); }
.focus-icon-btn.has-notes { color: var(--consulting); }
.focus-icon-btn.btn-remove:hover { background: var(--urgent-bg); color: var(--urgent); box-shadow: none; }

.focus-empty { padding: 20px 0; text-align: center; font-size: 13px; color: var(--text-tertiary); font-style: italic; }

.focus-footer { flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.focus-footer .focus-footer-progress { margin-right: auto; }
.focus-footer-progress { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.focus-footer-text { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.focus-pie { width: 16px; height: 16px; border-radius: 50%; position: relative; flex-shrink: 0; }
.focus-pie::after { content: ''; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--bg-surface); }

/* ── Calendar grid — floating day tiles ────────────────── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cal-title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.025em; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.cal-weekday {
  padding: 4px 8px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  background: transparent;
  text-align: center;
}
.cal-day {
  position: relative;
  min-height: 98px;
  padding: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: box-shadow var(--ease);
}

.cal-day.other-month { color: var(--text-tertiary); opacity: 1; background: rgba(255, 255, 255, 0.45); box-shadow: none; }
.cal-day.today { outline: none; box-shadow: var(--shadow-card), inset 0 0 0 1.5px var(--text-primary); z-index: 1; }
.cal-day.cal-week-current { background: var(--bg-surface); }
.cal-day.cal-week-current::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.05), rgba(48, 209, 88, 0.05));
  pointer-events: none;
}
.cal-day-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
  position: relative;
}
.cal-day-num {
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-pill);
  padding: 0 6px;
  margin: -2px -4px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}
.cal-day-num:hover { background: var(--bg-surface-alt); }
.cal-day.today .cal-day-num { background: var(--text-primary); color: #fff; }
.cal-day.other-month .cal-day-num { color: var(--text-tertiary); font-weight: 500; }
.cal-day-add {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cal-day:hover .cal-day-add { opacity: 1; }
.cal-day-add:hover { background: var(--text-primary); color: #fff; border-color: transparent; }
.cal-day-events { display: flex; flex-direction: column; gap: 3px; position: relative; }
.cal-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-align: left;
}
.cal-pill-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; }
.cal-pill-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-pill.consulting { background: var(--consulting-bg); color: #0A5CC2; }
.cal-pill.startup { background: var(--startup-bg); color: #178A3E; }
.cal-pill.others { background: var(--others-bg); color: #B86A00; }
.cal-pill.focus { background: var(--focus-bg); color: #0A5CC2; }
.cal-pill.cal-pill-more { background: var(--bg-surface-alt); color: var(--text-secondary); justify-content: center; font-weight: 600; }

.cal-overflow-md { max-width: 360px; }
.cal-overflow-md h3 { margin: 0 0 4px; }
.cal-overflow-list { display: flex; flex-direction: column; gap: 6px; max-height: min(60vh, 320px); overflow-y: auto; margin: 12px 0 0; }
.cal-overflow-row {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.cal-overflow-row:hover { background: var(--bg-active); border-color: transparent; }

/* ── Status badge ──────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 600;
}

.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-active { background: rgba(52, 199, 89, 0.1); color: #248a3d; }
.status-active::before { background: var(--success); }
.status-pending { background: rgba(255, 159, 10, 0.1); color: #c77c0a; }
.status-pending::before { background: var(--warning); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1200px) {
  .two-col { grid-template-columns: 1fr; }
  .analysis { grid-template-columns: 1fr 1fr; }
  .a-note { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
  .tasks-layout { grid-template-columns: 1fr; }
  .tasks-notes-col { position: static; }
}

@media (max-width: 768px) {
  #page-content.page { padding: var(--space-2) var(--space-4) var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
  .search-trigger span { display: none; }
  .analysis { grid-template-columns: 1fr; }
  .ph { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
}

/* ── Rules page (governance & report policy) ───────────── */
.rules-intro {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 52rem;
}

.rules-section { margin-bottom: 32px; }

.rules-section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  padding: 8px 0 14px;
  margin: 0 0 4px;
  border: none;
  border-bottom: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color var(--ease);
}

.rules-section-title:hover { border-bottom-color: transparent; }
.rules-section-title:hover .rules-section-label { color: var(--text-secondary); }

.rules-section-label {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  transition: color var(--ease);
}

.rules-section-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  margin-left: auto;
}

.rules-section-collapsed .rules-section-chevron { transform: rotate(-90deg); }
.rules-section-collapsed .rules-section-body { display: none; }

.rules-card-h { flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; }
.rules-card-h-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; flex: 1 1 auto; }
.rules-card-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }

.rule-purpose {
  font-size: 0.82rem;
  font-style: normal;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: -6px 0 14px;
}

.rule-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rule-toolbar[hidden] { display: none !important; }

.rule-editor {
  min-height: 120px;
  padding: 16px 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-surface-alt);
  border: none;
  border-radius: var(--radius-md);
  outline: none;
  transition: box-shadow var(--ease), background var(--ease);
}

.rule-editor:focus { border-color: transparent; box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 4px rgba(17, 17, 19, 0.05); }
.rule-editor--editing { min-height: 180px; background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-strong); }
.rule-editor ul,
.rule-editor ol { margin: 0.5em 0; padding-left: 1.35em; }
.rule-editor p { margin: 0 0 0.65em; }
.rule-editor p:last-child { margin-bottom: 0; }

.rule-meta { font-size: 0.7rem; color: var(--text-tertiary); margin: 10px 0 0; line-height: 1.4; }
.rule-meta:empty { display: none; margin: 0; }

/* ── Login page — aurora backdrop, floating sheet ──────── */
body.login-body { overflow: auto; min-height: 100vh; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5);
  background: var(--bg-root);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  pointer-events: none;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}

.login-page::before {
  width: 62vmax;
  height: 62vmax;
  left: -18vmax;
  top: -22vmax;
  background:
    radial-gradient(closest-side, rgba(255, 170, 61, 0.55), transparent 70%),
    radial-gradient(closest-side at 70% 70%, rgba(235, 108, 73, 0.45), transparent 70%);
}

.login-page::after {
  width: 66vmax;
  height: 66vmax;
  right: -22vmax;
  bottom: -26vmax;
  background:
    radial-gradient(closest-side, rgba(74, 151, 240, 0.5), transparent 70%),
    radial-gradient(closest-side at 30% 30%, rgba(70, 217, 126, 0.45), transparent 70%);
  animation-delay: -9s;
}

@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); }
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  padding: var(--space-7) var(--space-6) var(--space-6);
  text-align: center;
}

.login-brand { margin-bottom: var(--space-6); }

img.brand-mark.login-brand-mark { margin: 0 auto 18px; width: 56px; height: 56px; }

.login-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-sub { font-size: 0.875rem; color: var(--text-secondary); font-weight: 400; }

.login-form { text-align: left; display: flex; flex-direction: column; gap: var(--space-4); }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label { font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0; padding-left: 4px; }

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  background: rgba(17, 17, 19, 0.05);
  color: var(--text-primary);
  transition: background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.login-input:focus { border-color: transparent; background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 4px rgba(17, 17, 19, 0.05); }
.login-input::placeholder { color: var(--text-tertiary); }

.login-error { font-size: 0.8rem; color: var(--danger); margin: -4px 0 0; min-height: 1.2em; padding-left: 4px; }

.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-2);
  padding: 0 18px;
  height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 20px -8px rgba(17, 17, 19, 0.5);
}

/* Empty publication placeholder */
.pub-empty { text-align: center; padding: var(--space-8) var(--space-5); }

/* ═══════════════════════════════════════════════════════════════
   Location — where Mark is on a given day (one tag per date)
   Quiet by default (HQ), named when travelling, accent-tinted when
   he is in another time zone. Surfaces: Today header chip, calendar
   day tag, and the in-person meeting notice.
   ═══════════════════════════════════════════════════════════════ */
.card-h-lead { display: flex; align-items: center; gap: 10px; min-width: 0; }

.loc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 8px;
  border: none; border-radius: var(--radius-pill);
  background: var(--bg-surface-alt); color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; line-height: 1; letter-spacing: -0.005em;
  cursor: pointer; max-width: 260px; white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.loc-chip[hidden] { display: none; }
.loc-chip:hover { background: var(--bg-active); color: var(--text-primary); }
.loc-chip svg { flex-shrink: 0; }
.loc-chip-txt { overflow: hidden; text-overflow: ellipsis; }
.loc-chip-tz { font-weight: 500; opacity: 0.8; padding-left: 5px; border-left: 1px solid rgba(17, 17, 19, 0.12); }
.loc-chip--away { background: var(--accent-soft); color: #B9472A; }
.loc-chip--away:hover { background: var(--accent-hover); color: #9E3A20; }
.loc-chip--away .loc-chip-tz { border-left-color: rgba(185, 71, 42, 0.25); }

.cal-day-lead { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.cal-day-loc {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px 0 5px; min-width: 0; max-width: 100%;
  border: none; border-radius: var(--radius-pill);
  background: var(--bg-surface-alt); color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cal-day-loc svg { flex-shrink: 0; }
.cal-day-loc-txt { overflow: hidden; text-overflow: ellipsis; }
.cal-day-loc:hover { background: var(--bg-active); color: var(--text-primary); }
.cal-day-loc--default { width: 20px; padding: 0; justify-content: center; background: transparent; opacity: 0; }
.cal-day:hover .cal-day-loc--default { opacity: 1; }
.cal-day-loc--default:hover { background: var(--bg-surface-alt); }
.cal-day-loc--away { background: var(--accent-soft); color: #B9472A; }
.cal-day-loc--away:hover { background: var(--accent-hover); color: #9E3A20; }

.loc-notice {
  display: flex; align-items: flex-start; gap: 7px;
  margin: -2px 0 10px; padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt); color: var(--text-secondary);
  font-size: 12px; line-height: 1.45;
}
.loc-notice svg { flex-shrink: 0; margin-top: 2px; color: var(--text-tertiary); }
.loc-notice b { color: var(--text-primary); font-weight: 600; }
.loc-notice--away { background: var(--accent-soft); color: #7A3A28; }
.loc-notice--away svg { color: #B9472A; }
.loc-notice--away b { color: #9E3A20; }
.md-s .loc-notice { margin: 8px 0 0; }

.loc-modal { width: 100%; }
/* Searchable city list — picking a city sets its time zone */
.loc-search-wrap { position: relative; margin-bottom: 8px; }
.loc-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.loc-search.ai-input { display: block; width: 100%; padding-left: 34px; }
.loc-list { max-height: min(264px, 36vh); overflow-y: auto; margin: 0 -6px 12px; padding: 0 6px; border-radius: var(--radius-sm); }
.loc-group { font-size: 10.5px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 10px 4px; }
.loc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 10px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-primary); text-align: left;
  font-family: var(--font-sans); cursor: pointer;
  transition: background var(--ease);
}
.loc-row:hover { background: var(--bg-hover); }
.loc-row.selected { background: var(--bg-active); }
.loc-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.loc-row-name { font-size: 13.5px; font-weight: 500; }
.loc-row.selected .loc-row-name { font-weight: 600; }
.loc-row-sub { font-size: 11.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-row--away .loc-row-sub { color: #B9472A; }
.loc-row-check { flex-shrink: 0; color: var(--text-primary); opacity: 0; transition: opacity var(--ease); }
.loc-row.selected .loc-row-check { opacity: 1; }
.loc-empty { padding: 18px 10px; font-size: 13px; color: var(--text-tertiary); text-align: center; }
.loc-hint { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; }
.loc-through { margin-top: 2px; }


/* ═══════════════════════════════════════════════════════════════
   Travel — Mark moving between cities (one row per Manila day)
   Graphite + hatched band so transit reads differently from work.
   ═══════════════════════════════════════════════════════════════ */
:root { --travel: #3A3A3F; --travel-ink: #2C2C30; --travel-bg: #ECECEF; }

.dg-event--travel {
  background: repeating-linear-gradient(135deg, rgba(17, 17, 19, 0.055) 0 5px, rgba(17, 17, 19, 0.015) 5px 11px), var(--travel-bg);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.07);
  border-left: 3px solid var(--travel);
}
.dg-event--travel:hover { box-shadow: inset 0 0 0 1px rgba(17, 17, 19, 0.1), var(--shadow-md); }
.dg-event--travel .dg-event-time { color: var(--text-secondary); }
.dg-event--travel .dg-event-title { color: var(--travel-ink); display: flex; align-items: center; gap: 6px; }
.dg-event--travel .dg-event-title svg { flex-shrink: 0; color: var(--travel); }
.dg-event--travel .dg-event-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dg-event--travel.dg-event--cancelled { opacity: 0.4; }

.cal-pill.travel { background: var(--travel-bg); color: var(--travel-ink); }
.cal-pill-ic { display: inline-flex; flex-shrink: 0; color: var(--travel); }

/* Trip form */
.travel-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.travel-mode {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 10px;
  border: none; border-radius: var(--radius-pill);
  background: var(--bg-surface-alt); color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.travel-mode:hover { background: var(--bg-active); color: var(--text-primary); }
.travel-mode.active { background: var(--text-primary); color: #fff; font-weight: 600; }
.travel-dt { display: grid; grid-template-columns: 1fr; gap: 6px; }
.travel-tz { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-tertiary); }
.travel-summary.is-error { color: var(--danger); }
.city-combo { position: relative; }
.city-combo .ai-input { display: block; width: 100%; box-sizing: border-box; }
.city-combo-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  margin: 0; padding: 4px; max-height: 220px; overflow-y: auto;
  background: var(--bg-surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg), var(--ring);
}
.city-combo-panel[hidden] { display: none; }
.city-combo-panel .loc-row { padding: 7px 9px; }
.city-combo-panel .loc-row-name { font-size: 13px; }
.city-combo-panel .loc-row-sub { font-size: 11px; }

/* Trip modal */
.md-travel h3 { display: flex; align-items: center; gap: 8px; }
.md-travel h3 svg { flex-shrink: 0; color: var(--travel); }
.travel-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; margin: 6px 0 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-surface-alt); }
.travel-leg { min-width: 0; }
.travel-leg-main { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.35; }
.travel-leg-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.35; }
.travel-leg-arrow { color: var(--text-tertiary); font-size: 16px; padding-top: 20px; }


/* ── Traceable moves: date on every edit form, Move actions ── */
.add-grid.add-grid--3 { grid-template-columns: 1.2fr 1fr 1fr; }
.focus-icon-btn.btn-move { color: var(--text-secondary); }
.focus-icon-btn.btn-move:hover { color: var(--text-primary); background: var(--bg-active); }
.tcl-by { color: var(--text-tertiary); }
