/* ============================================================
   Taskify — Liquid Glass design tokens + components
   ============================================================ */

:root {
  --accent: #3478F6;
  --accent-soft: #3478F622;
  --accent-glow: #3478F655;

  /* Per-theme tokens (set via data-theme) */
  --fg: #0e0e10;
  --fg-soft: #525258;
  --gray-1: #76767e;
  --gray-2: #a3a3aa;
  --gray-3: #c9c9d0;
  --gray-4: #e6e6ec;
  --bg: #f3f4f7;

  --glass-bg: rgba(245, 246, 250, 0.62);
  --glass-bg-2: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-inner-hi: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 22px 60px rgba(20, 22, 40, 0.28),
                  0 2px 6px rgba(20, 22, 40, 0.12);

  --red: #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --green: #30d158;
  --teal: #40c8e0;
  --blue: #3478f6;
  --purple: #bf5af2;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --fg: #f4f4f8;
  --fg-soft: #c8c8d0;
  --gray-1: #a3a3aa;
  --gray-2: #80808a;
  --gray-3: #5a5a64;
  --gray-4: #2c2c34;
  --bg: #16161a;

  --glass-bg: rgba(28, 28, 36, 0.62);
  --glass-bg-2: rgba(42, 42, 52, 0.72);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-inner-hi: rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 24px 70px rgba(0, 0, 0, 0.55),
                  0 2px 6px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg);
  background: #0c0c10;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
input, textarea { font: inherit; color: inherit; }

#root, .taskify-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   Wallpaper backdrop
   ============================================================ */
.wallpaper {
  position: absolute; inset: 0;
  overflow: hidden;
  z-index: 0;
}
.wp-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%,
      oklch(72% 0.14 60 / 1) 0%,
      oklch(58% 0.16 30 / 1) 35%,
      oklch(36% 0.16 320 / 1) 70%,
      oklch(22% 0.12 280 / 1) 100%);
}
html[data-wp="ocean"] .wp-sky {
  background:
    radial-gradient(120% 80% at 50% -10%,
      oklch(78% 0.12 220 / 1) 0%,
      oklch(62% 0.14 240 / 1) 35%,
      oklch(38% 0.14 270 / 1) 70%,
      oklch(20% 0.10 260 / 1) 100%);
}
html[data-wp="forest"] .wp-sky {
  background:
    radial-gradient(120% 80% at 50% -10%,
      oklch(76% 0.13 140 / 1) 0%,
      oklch(58% 0.16 150 / 1) 35%,
      oklch(34% 0.14 170 / 1) 70%,
      oklch(18% 0.08 180 / 1) 100%);
}
.wallpaper.light .wp-sky {
  background:
    radial-gradient(120% 80% at 50% -10%,
      oklch(94% 0.06 80) 0%,
      oklch(86% 0.10 50) 35%,
      oklch(72% 0.12 30) 65%,
      oklch(58% 0.14 350) 100%);
}
html[data-wp="ocean"].wallpaper.light .wp-sky,
.wallpaper.light .wp-sky[data-wp="ocean"] { /* fallback */ }
html[data-wp="ocean"] .wallpaper.light .wp-sky {
  background:
    radial-gradient(120% 80% at 50% -10%,
      oklch(96% 0.04 220) 0%,
      oklch(86% 0.10 220) 35%,
      oklch(72% 0.14 240) 70%,
      oklch(54% 0.16 260) 100%);
}

.wp-ridge {
  position: absolute;
  left: -5%; right: -5%;
  bottom: 0;
  height: 60%;
  filter: blur(0.5px);
}
.wp-ridge-1 {
  height: 35%;
  background: linear-gradient(180deg,
    oklch(28% 0.05 30 / 0.9) 0%,
    oklch(10% 0.04 30 / 1) 100%);
  clip-path: polygon(0 35%, 8% 28%, 18% 38%, 30% 22%, 42% 32%, 55% 18%, 68% 30%, 80% 22%, 92% 30%, 100% 26%, 100% 100%, 0 100%);
}
.wp-ridge-2 {
  height: 45%;
  background: linear-gradient(180deg,
    oklch(38% 0.08 25 / 0.65) 0%,
    oklch(20% 0.06 25 / 0.85) 100%);
  clip-path: polygon(0 50%, 10% 38%, 22% 50%, 35% 28%, 50% 42%, 62% 30%, 75% 44%, 88% 32%, 100% 40%, 100% 100%, 0 100%);
}
.wp-ridge-3 {
  height: 55%;
  background: linear-gradient(180deg,
    oklch(56% 0.10 20 / 0.4) 0%,
    oklch(34% 0.08 20 / 0.65) 100%);
  clip-path: polygon(0 60%, 15% 50%, 30% 64%, 45% 46%, 60% 58%, 75% 44%, 90% 56%, 100% 50%, 100% 100%, 0 100%);
}
.wp-glow {
  position: absolute;
  top: 5%; left: 50%;
  width: 80vw; height: 30vh;
  transform: translateX(-50%);
  background: radial-gradient(closest-side,
    oklch(94% 0.12 80 / 0.45),
    transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

/* ============================================================
   Desktop layer + menu bar
   ============================================================ */
.desktop-layer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.menubar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  z-index: 20;
  background: linear-gradient(180deg,
    rgba(20, 20, 28, 0.42),
    rgba(20, 20, 28, 0.22));
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
html[data-theme="light"] .menubar {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.32));
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}
.menubar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.92);
}
html[data-theme="light"] .menubar-inner { color: rgba(0, 0, 0, 0.85); }
.menubar-left, .menubar-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
.menubar-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 8px;
  height: 22px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.menubar-item:hover { background: rgba(255, 255, 255, 0.12); }
html[data-theme="light"] .menubar-item:hover { background: rgba(0, 0, 0, 0.08); }
.menubar-item.bold { font-weight: 600; }
.menubar-item.logo { padding: 0 6px; }

.taskify-item.active { background: rgba(255, 255, 255, 0.22); }
html[data-theme="light"] .taskify-item.active { background: rgba(0, 0, 0, 0.10); }
.taskify-glyph {
  width: 15px; height: 15px;
  border-radius: 4.5px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
}
.taskify-glyph::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  border-radius: 3px;
  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0));
}
.taskify-glyph-tick {
  position: relative;
  z-index: 1;
  width: 7px; height: 7px;
  border: 1.4px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translateY(-1px);
  border-radius: 1px;
}
.taskify-count {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.96);
  min-width: 14px;
  text-align: center;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
}
html[data-theme="light"] .taskify-count {
  color: rgba(0, 0, 0, 0.78);
  background: rgba(0, 0, 0, 0.08);
}

.bat-pct {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.control-center { padding: 0 4px; }
.cc-pill {
  display: inline-block;
  width: 14px; height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.7);
  margin-right: 2px;
}
.cc-pill:last-child {
  background: rgba(255, 255, 255, 0.35);
  width: 14px;
}
html[data-theme="light"] .cc-pill { background: rgba(0, 0, 0, 0.55); }
html[data-theme="light"] .cc-pill:last-child { background: rgba(0, 0, 0, 0.25); }
.time-block {
  display: flex !important;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.time-day { opacity: 0.85; }
.time-now { font-weight: 500; }

/* ============================================================
   Dock
   ============================================================ */
.dock {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 18px;
  background: rgba(245, 245, 255, 0.18);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.dock-app {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s cubic-bezier(.3,.7,.4,1);
}
.dock-app:hover { transform: translateY(-6px) scale(1.08); }
.dock-sep {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

/* ============================================================
   Dropdown panel
   ============================================================ */
.dd-anchor {
  position: absolute;
  inset: 0;
  z-index: 30;
  padding-top: 34px;
  display: flex;
  justify-content: flex-end;
  padding-right: 12px;
  pointer-events: auto;
}
.dropdown {
  position: relative;
  isolation: isolate;
  max-height: calc(100vh - 60px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  animation: dd-pop 0.18s cubic-bezier(.3,.7,.4,1.2);
  transform-origin: top right;
}
@keyframes dd-pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-glass {
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border-radius: inherit;
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.dropdown-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 30%,
    transparent 100%);
  pointer-events: none;
}
html[data-theme="dark"] .dropdown-glass::before {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.10) 0%,
    transparent 30%,
    transparent 100%);
}

.dd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.dd-header-left { display: flex; align-items: baseline; gap: 10px; }
.dd-brand {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dd-sub {
  font-size: 12px;
  color: var(--gray-2);
  font-variant-numeric: tabular-nums;
}
.dd-header-actions { display: flex; gap: 4px; }

.iconbtn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 26px; height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-soft);
  cursor: default;
}
.iconbtn:hover { background: rgba(127, 127, 145, 0.16); color: var(--fg); }
.iconbtn.small { width: 22px; height: 22px; border-radius: 6px; }

.dd-search {
  margin: 4px 12px 8px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(127, 127, 145, 0.12);
  border: 0.5px solid rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .dd-search {
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
}
.dd-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
}
.dd-search input::placeholder { color: var(--gray-2); }

.tabbar {
  display: flex;
  gap: 2px;
  padding: 0 12px 8px;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-1);
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { background: rgba(127, 127, 145, 0.08); color: var(--fg); }
.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.35);
}
.tab-badge {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding: 0 5px;
  height: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  color: inherit;
}
.tab:not(.active) .tab-badge { background: rgba(127, 127, 145, 0.18); color: var(--fg-soft); }

.dd-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-3) transparent;
}
.dd-body::-webkit-scrollbar { width: 6px; }
.dd-body::-webkit-scrollbar-thumb { background: var(--gray-3); border-radius: 3px; }

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 8px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-2);
}
.section-label.muted { opacity: 0.6; }
.section-count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-2);
}

/* Task row */
.task-check {
  appearance: none;
  border: 1.5px solid;
  background: transparent;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
  transition: transform 0.12s, background 0.12s;
  padding: 0;
}
.task-check:hover { transform: scale(1.08); }
.task-check.done { border-color: var(--accent); background: var(--accent); }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: default;
  transition: background 0.12s;
}
.task-row:hover, .task-row.focused {
  background: rgba(127, 127, 145, 0.10);
}
.task-row.focused {
  background: var(--accent-soft);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.task-row.dense { padding: 5px 10px; gap: 8px; }
.task-row.completed .task-row-title {
  text-decoration: line-through;
  color: var(--gray-2);
}
.task-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 1px;
}
.task-row-title {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-row.dense .task-row-title { font-size: 12.5px; }
.task-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--gray-1);
  flex-wrap: wrap;
}
.task-row.dense .task-row-meta { gap: 8px; font-size: 10.5px; }
.meta-project, .meta-due, .meta-sub, .meta-est {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-due.overdue { color: var(--red); }
.meta-est {
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(127, 127, 145, 0.14);
  font-size: 10.5px;
}
.project-dot {
  display: inline-block;
  border-radius: 50%;
}
.task-row-keys { padding-top: 2px; opacity: 0.7; }

.tag-chip {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(127, 127, 145, 0.14);
  color: var(--fg-soft);
}

.dd-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 0.5px solid rgba(127, 127, 145, 0.22);
  font-size: 10.5px;
  color: var(--gray-2);
}
.dd-footer .hint { display: inline-flex; align-items: center; gap: 4px; }
.dd-footer .hint.right { margin-left: auto; }

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-soft);
  background: rgba(127, 127, 145, 0.12);
  border: 0.5px solid rgba(127, 127, 145, 0.18);
  border-radius: 4px;
  letter-spacing: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 8px;
}
.empty-illus {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.empty-illus.large { width: 76px; height: 76px; background: rgba(127, 127, 145, 0.14); }
.empty-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.empty-sub {
  font-size: 12px;
  color: var(--gray-1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   Calendar tab (dropdown)
   ============================================================ */
.cal-tab { padding: 0 4px 8px; }
.cal-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 10px 10px;
}
.cal-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.cal-sub {
  font-size: 11.5px;
  color: var(--gray-1);
  margin-top: 1px;
}
.cal-sources { display: flex; gap: 6px; opacity: 0.7; }

.cal-timeline {
  position: relative;
  margin: 4px 6px;
}
.cal-hours {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 40px;
  pointer-events: none;
}
.cal-hour {
  position: absolute;
  left: 0;
  font-size: 9.5px;
  color: var(--gray-2);
  transform: translateY(-50%);
  font-variant-numeric: tabular-nums;
}
.cal-grid {
  position: relative;
  margin-left: 40px;
  height: 100%;
}
.cal-grid-row {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(127, 127, 145, 0.12);
}
.cal-now {
  position: absolute;
  left: -4px;
  right: 0;
  height: 1.5px;
  background: var(--red);
  z-index: 3;
}
.cal-now-dot {
  position: absolute;
  left: -3px; top: -3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
}
.cal-event {
  position: absolute;
  left: 6px; right: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  overflow: hidden;
}
.cal-event-title {
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--fg-soft);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.cal-task {
  position: absolute;
  left: 4px; right: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  background: var(--glass-bg-2);
  border: 0.5px solid rgba(127, 127, 145, 0.18);
  border-radius: 6px;
  padding: 2px 6px;
  height: 20px;
}
.cal-task-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-task-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.cal-task-time { font-variant-numeric: tabular-nums; color: var(--gray-1); }

/* ============================================================
   Quick-add overlays
   ============================================================ */
.qa-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 12, 0.32);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  animation: qa-fade 0.16s ease-out;
}
.qa-backdrop.subtle { background: rgba(8, 8, 12, 0.12); }
@keyframes qa-fade { from { opacity: 0; } to { opacity: 1; } }

.qa-spotlight {
  position: relative;
  width: 640px;
  max-width: 92vw;
  border-radius: 16px;
  overflow: hidden;
  animation: qa-pop 0.18s cubic-bezier(.3,.7,.4,1.2);
}
@keyframes qa-pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.qa-glass {
  position: absolute; inset: 0; z-index: -1;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  backdrop-filter: blur(50px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  border-radius: inherit;
  box-shadow:
    0 1px 0 var(--glass-inner-hi) inset,
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.25);
}
.qa-input-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 0.5px solid rgba(127, 127, 145, 0.18);
}
.qa-input-row.tight {
  padding: 10px 12px;
  border-bottom: 0;
}
.qa-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.18);
}
.qa-icon.small { width: 22px; height: 22px; border-radius: 7px; }
.qa-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 20px;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.qa-input.small { font-size: 14px; }
.qa-input::placeholder { color: var(--gray-2); font-weight: 400; }
.qa-hint {
  font-size: 11px;
  color: var(--gray-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.qa-hint.right { margin-left: auto; }

.qa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 14px;
}
.qa-meta.tight { padding: 4px 12px 12px; gap: 4px; }
.qa-chip {
  appearance: none;
  border: 0.5px solid rgba(127, 127, 145, 0.22);
  background: rgba(127, 127, 145, 0.08);
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
  color: var(--fg-soft);
}
.qa-chip:hover { background: rgba(127, 127, 145, 0.14); color: var(--fg); }
.qa-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.qa-chip.subtle { background: transparent; border-style: dashed; }
.qa-chip.detected {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.qa-projlist {
  border-top: 0.5px solid rgba(127, 127, 145, 0.18);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
}
.qa-projitem {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
  font-size: 12.5px;
}
.qa-projitem:hover { background: var(--accent-soft); color: var(--accent); }

.qa-floating {
  position: fixed;
  top: 50px;
  width: 360px;
  border-radius: 14px;
  overflow: hidden;
}
.qa-inline-wrap {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 380px;
}
.qa-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--glass-bg);
  border-radius: 12px;
  border: 0.5px solid var(--glass-border);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--glass-shadow);
}

/* ============================================================
   Shortcuts panel
   ============================================================ */
.shortcuts-panel {
  position: relative;
  width: 720px;
  max-width: 92vw;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  animation: qa-pop 0.18s cubic-bezier(.3,.7,.4,1.2);
}
.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 0.5px solid rgba(127, 127, 145, 0.18);
}
.sc-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sc-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 18px 22px 4px;
}
.sc-col { display: flex; flex-direction: column; gap: 4px; }
.sc-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-2);
  margin-bottom: 6px;
}
.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 12.5px;
}
.sc-label { color: var(--fg-soft); }
.sc-keys { display: inline-flex; gap: 2px; }
.sc-footer {
  padding: 14px 22px 18px;
  font-size: 11.5px;
  color: var(--gray-2);
  border-top: 0.5px solid rgba(127, 127, 145, 0.18);
  margin-top: 12px;
}

/* ============================================================
   Fullscreen workspace
   ============================================================ */
.fs-shell {
  position: absolute;
  inset: 28px 16px 16px;
  z-index: 25;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(46px) saturate(180%);
  backdrop-filter: blur(46px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow), 0 1px 0 var(--glass-inner-hi) inset;
  animation: fs-pop 0.22s cubic-bezier(.3,.7,.4,1);
}
@keyframes fs-pop {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}
.fullscreen {
  display: flex;
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
}
.exit-fs {
  position: absolute;
  top: 12px; right: 14px;
  z-index: 50;
  appearance: none;
  border: 0;
  background: rgba(127, 127, 145, 0.18);
  color: var(--fg-soft);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}
.exit-fs:hover { background: rgba(127, 127, 145, 0.28); color: var(--fg); }

/* Sidebar */
.fs-sidebar {
  position: relative;
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  gap: 14px;
  border-right: 0.5px solid rgba(127, 127, 145, 0.18);
  overflow-y: auto;
}
.sidebar-glass {
  position: absolute; inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0));
}
html[data-theme="light"] .sidebar-glass {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.1));
}
.side-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px;
  border-bottom: 0.5px solid rgba(127, 127, 145, 0.18);
}
.side-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  flex: 1;
}
.side-header-actions { display: flex; gap: 2px; }

.side-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.side-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-2);
}
.side-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: default;
  color: var(--fg-soft);
  transition: background 0.1s;
}
.side-item:hover { background: rgba(127, 127, 145, 0.10); color: var(--fg); }
.side-item.active { color: var(--fg); }
.side-label { flex: 1; text-align: left; }
.side-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--gray-2);
}

.cal-source {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--fg-soft);
}
.cal-source span { flex: 1; }
.cal-status {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gray-3);
}
.cal-status.online { background: var(--green); }

/* List pane */
.fs-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 4px 0;
  overflow: hidden;
  border-right: 0.5px solid rgba(127, 127, 145, 0.18);
}
.list-header {
  padding: 0 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.list-title-row { display: flex; align-items: baseline; gap: 12px; }
.list-title-row h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.list-date {
  font-size: 13px;
  color: var(--gray-1);
  font-weight: 500;
}
.list-actions { display: flex; gap: 6px; align-items: center; }
.pillbtn {
  appearance: none;
  border: 0.5px solid rgba(127, 127, 145, 0.22);
  background: rgba(127, 127, 145, 0.08);
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-soft);
  cursor: default;
}
.pillbtn:hover { background: rgba(127, 127, 145, 0.14); color: var(--fg); }
.pillbtn.primary {
  color: white;
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 3px rgba(0,0,0,0.2);
}
.pillbtn.primary:hover { filter: brightness(1.08); color: white; }

.list-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-3) transparent;
}
.list-body::-webkit-scrollbar { width: 8px; }
.list-body::-webkit-scrollbar-thumb { background: var(--gray-3); border-radius: 4px; }
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 8px 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.group-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--gray-2);
  font-variant-numeric: tabular-nums;
}

.full-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: default;
  border-bottom: 0.5px solid rgba(127, 127, 145, 0.10);
}
.full-row:last-child { border-bottom: 0; }
.full-row:hover { background: rgba(127, 127, 145, 0.08); }
.full-row.selected {
  background: var(--accent-soft);
  border-bottom-color: transparent;
}
.full-row.completed .full-row-title {
  text-decoration: line-through;
  color: var(--gray-2);
}
.full-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}
.full-row-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.full-row-notes {
  font-size: 12.5px;
  color: var(--gray-1);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.full-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--gray-1);
  margin-top: 2px;
}

/* Detail pane */
.fs-detail {
  position: relative;
  width: 360px;
  flex-shrink: 0;
  overflow-y: auto;
}
.fs-detail.empty { display: flex; align-items: center; justify-content: center; }
.detail-glass {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0));
}
html[data-theme="light"] .detail-glass {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.3),
    rgba(255, 255, 255, 0.05));
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 0.5px solid rgba(127, 127, 145, 0.16);
}
.detail-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--gray-1);
  font-weight: 500;
}
.detail-actions { display: flex; gap: 2px; }
.detail-body {
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.detail-title-row h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  flex: 1;
}
.detail-title-row h2.strike {
  text-decoration: line-through;
  color: var(--gray-2);
}
.detail-fields {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px 14px;
  align-items: center;
}
.field { display: contents; }
.field label {
  font-size: 11.5px;
  color: var(--gray-1);
  font-weight: 500;
}
.field-btn {
  appearance: none;
  border: 0;
  background: rgba(127, 127, 145, 0.10);
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: flex-start;
  cursor: default;
  color: var(--fg);
}
.field-btn:hover { background: rgba(127, 127, 145, 0.18); }
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.add-tag {
  appearance: none;
  border: 0.5px dashed rgba(127, 127, 145, 0.4);
  background: transparent;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--gray-1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}
.detail-section { display: flex; flex-direction: column; gap: 8px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-2);
}
.detail-notes {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-soft);
  text-wrap: pretty;
}
.subtask-list { display: flex; flex-direction: column; gap: 2px; }
.subtask {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  cursor: default;
}
.subtask:hover { background: rgba(127, 127, 145, 0.08); }
.subtask-box {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--gray-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.subtask.done .subtask-box {
  background: var(--accent);
  border-color: var(--accent);
}
.subtask.done { color: var(--gray-2); text-decoration: line-through; }
.add-sub {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 5px 6px;
  font-size: 12px;
  color: var(--gray-1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-align: left;
  cursor: default;
}
.add-sub:hover { color: var(--accent); }

.link-list { display: flex; flex-direction: column; gap: 4px; }
.link-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  font-size: 12.5px;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
}

.detail-footer {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-2);
  padding-top: 12px;
  border-top: 0.5px solid rgba(127, 127, 145, 0.16);
}

/* Today peek (agenda variant) */
.fs-peek {
  position: relative;
  width: 320px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px 14px 22px;
}
.peek-glass {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0));
}
.peek-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.peek-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.peek-sub { font-size: 11.5px; color: var(--gray-1); margin-top: 2px; }
.peek-sources { display: flex; gap: 6px; opacity: 0.7; }

.peek-timeline { position: relative; }
.peek-hours {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
}
.peek-hour {
  position: absolute;
  font-size: 10px;
  color: var(--gray-2);
  transform: translateY(-50%);
  font-variant-numeric: tabular-nums;
}
.peek-grid {
  position: relative;
  margin-left: 32px;
  height: 100%;
}
.peek-grid-row {
  position: absolute;
  left: 0; right: 0; height: 1px;
  background: rgba(127, 127, 145, 0.10);
}
.peek-now {
  position: absolute;
  left: -4px; right: 0;
  height: 1.5px;
  background: var(--red);
  z-index: 3;
}
.peek-now-dot {
  position: absolute;
  left: -3px; top: -3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
}
.peek-event {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 6px;
  padding: 4px 8px;
  overflow: hidden;
  font-size: 11px;
}
.peek-event-title {
  font-weight: 600;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.peek-event-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--fg-soft);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.peek-task {
  position: absolute;
  left: 2px; right: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  background: var(--glass-bg-2);
  border: 0.5px solid rgba(127, 127, 145, 0.18);
  border-radius: 6px;
  padding: 2px 6px;
  height: 20px;
}
.peek-task-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.peek-task-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.peek-task-time { font-variant-numeric: tabular-nums; color: var(--gray-1); }

.fs-split { display: flex; flex: 1; min-width: 0; }
.fs-split .fs-detail { width: 60%; }
.fs-split .fs-peek { width: 40%; border-left: 0.5px solid rgba(127, 127, 145, 0.16); }

/* ============================================================
   Onboarding pointer
   ============================================================ */
.onboard-pointer {
  position: absolute;
  top: 38px;
  right: 220px;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  animation: bounce-pointer 2.4s ease-in-out infinite;
}
@keyframes bounce-pointer {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}
.op-arrow {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 9px solid rgba(255, 255, 255, 0.78);
  margin-top: -2px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.op-text {
  background: rgba(20, 20, 28, 0.7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: white;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
}
.op-text .kbd {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}
