/* ============================================================
   Mynd V3 — UI styles
   Design tokens → primitives → components → views → utilities.
   Light/dark via `color-scheme` + prefers-color-scheme.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --fs-11: 0.6875rem;   /* 11 */
  --fs-12: 0.75rem;     /* 12 */
  --fs-13: 0.8125rem;   /* 13 */
  --fs-14: 0.875rem;    /* 14 */
  --fs-15: 0.9375rem;   /* 15 */
  --fs-16: 1rem;        /* 16 */
  --fs-18: 1.125rem;    /* 18 */
  --fs-20: 1.25rem;     /* 20 */
  --fs-24: 1.5rem;      /* 24 */
  --fs-30: 1.875rem;    /* 30 */
  --fs-36: 2.25rem;     /* 36 */
  --fs-48: 3rem;        /* 48 */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.5;

  /* Spacing — 4px grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-10: 56px;
  --sp-12: 80px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Color — semantic tokens, light theme */
  --c-bg: oklch(98% 0.005 90);          /* warm off-white */
  --c-surface: #ffffff;
  --c-surface-2: oklch(96% 0.005 90);   /* hover / subtle wells */
  --c-overlay: oklch(20% 0.01 90 / 0.45);
  --c-border: oklch(88% 0.006 90);
  --c-border-strong: oklch(80% 0.008 90);
  --c-text: oklch(22% 0.01 90);         /* near-black */
  --c-text-muted: oklch(48% 0.012 90);  /* secondary */
  --c-text-subtle: oklch(60% 0.012 90); /* tertiary, meta */
  --c-accent: oklch(48% 0.13 158);      /* refined forest green */
  --c-accent-hover: oklch(42% 0.14 158);
  --c-accent-fg: #ffffff;
  --c-accent-bg: oklch(95% 0.04 158);   /* light tint behind active nav, etc. */
  --c-accent-bg-strong: oklch(88% 0.07 158);
  --c-danger: oklch(54% 0.21 25);
  --c-danger-bg: oklch(96% 0.03 25);
  --c-warning: oklch(72% 0.16 78);
  --c-warning-bg: oklch(96% 0.05 78);
  --c-info-bg: oklch(96% 0.03 230);

  /* Shadows — built on the same hue as the bg, very subtle. */
  --shadow-xs: 0 1px 2px oklch(20% 0.01 90 / 0.06);
  --shadow-sm: 0 1px 3px oklch(20% 0.01 90 / 0.08),
               0 1px 2px oklch(20% 0.01 90 / 0.04);
  --shadow-md: 0 4px 12px oklch(20% 0.01 90 / 0.08),
               0 2px 4px oklch(20% 0.01 90 / 0.05);
  --shadow-lg: 0 12px 32px oklch(20% 0.01 90 / 0.12),
               0 4px 12px oklch(20% 0.01 90 / 0.08);
  --shadow-focus: 0 0 0 3px oklch(95% 0.04 158);

  /* Motion */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container: 1040px;
  --container-narrow: 720px;
  --nav-h: 56px;
  --mobile-tab-h: 64px;
}

/* Auto-dark removed by user preference — light only. A user-toggleable
   theme could come back later; for now this is a light-mode product. */

/* ---------- 2. Reset + base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-15);
  line-height: var(--lh-normal);
  font-feature-settings: "ss01", "cv11", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-30); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-20); }
h3 { font-size: var(--fs-16); }

p { line-height: var(--lh-normal); }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }

::selection { background: var(--c-accent-bg-strong); color: var(--c-text); }

/* ---------- 3. App frame ---------- */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 224px 1fr;
  grid-template-rows: 1fr;
}
@media (max-width: 720px) {
  #app { grid-template-columns: 1fr; }
}

/* The HTML `hidden` attribute needs to beat the layout rules below — when
   the user isn't authenticated, the sidebar + mobile tabs should be gone. */
#app-header[hidden],
#mobile-tabs[hidden] { display: none !important; }
/* Signed-out routes also drop the sidebar column entirely. */
#app:has(#app-header[hidden]) { grid-template-columns: 1fr; }

/* Sidebar (was top header) — vertical nav on the left at desktop widths.
   Hidden on mobile; mobile uses the bottom tab bar. */
#app-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-3);
  border-right: 1px solid var(--c-border);
  background: oklch(95% 0.01 90);     /* distinct warm band, not the main bg */
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 20;
}
@media (max-width: 720px) {
  #app-header { display: none; }
}
#app-header .logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-16);
  color: var(--c-text);
  letter-spacing: -0.02em;
  padding: 0 var(--sp-2) var(--sp-2);
}
#app-header .logo::before {
  content: "";
  width: 22px; height: 22px;
  background: var(--c-accent);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V8l5 7 5-7v12'/><circle cx='18' cy='8' r='3'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V8l5 7 5-7v12'/><circle cx='18' cy='8' r='3'/></svg>") center / contain no-repeat;
}
#app-header nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
#app-header nav a {
  color: var(--c-text-muted);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transition: background var(--t-fast), color var(--t-fast);
}
#app-header nav a::before {
  content: "";
  width: 16px; height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  opacity: 0.7;
  -webkit-mask: var(--icon, none) center / contain no-repeat;
  mask: var(--icon, none) center / contain no-repeat;
}
#app-header nav a[data-nav="today"]    { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>"); }
#app-header nav a[data-nav="plan"]     { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='8' y1='6' x2='21' y2='6'/><line x1='8' y1='12' x2='21' y2='12'/><line x1='8' y1='18' x2='21' y2='18'/><line x1='3' y1='6' x2='3.01' y2='6'/><line x1='3' y1='12' x2='3.01' y2='12'/><line x1='3' y1='18' x2='3.01' y2='18'/></svg>"); }
#app-header nav a[data-nav="capture"]  { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 20h9'/><path d='M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4z'/></svg>"); }
#app-header nav a[data-nav="settings"] { --icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/></svg>"); }
#app-header nav a:hover {
  color: var(--c-text);
  background: color-mix(in oklch, var(--c-surface) 70%, transparent);
  text-decoration: none;
}
#app-header nav a:hover::before { opacity: 1; }
#app-header nav a[aria-current="page"] {
  color: var(--c-accent);
  background: var(--c-accent-bg);
  font-weight: var(--fw-semibold);
}
#app-header nav a[aria-current="page"]::before { opacity: 1; }

#app-header #signout-btn {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--c-border);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
#app-header #signout-btn:hover {
  color: var(--c-text);
  background: var(--c-surface);
  border-color: var(--c-border-strong);
}

/* Main view — full-bleed inside its column, generous padding. */
main#view {
  width: 100%;
  max-width: 1100px;
  margin: 0;
  padding: var(--sp-8) clamp(var(--sp-6), 5vw, var(--sp-10)) var(--sp-10);
}
@media (max-width: 720px) {
  main#view {
    padding: var(--sp-5) var(--sp-4) calc(var(--mobile-tab-h) + var(--sp-5));
  }
}

h1 { margin-bottom: var(--sp-5); }
h2 { margin: var(--sp-7) 0 var(--sp-3); }

/* Cards — the default elevated surface */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
}

/* ---------- 4. Buttons ---------- */
button {
  font-family: inherit;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: 0.5; }

button.primary, .btn {
  background: var(--c-accent);
  color: var(--c-accent-fg);
  border: 1px solid transparent;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  letter-spacing: 0.005em;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  box-shadow: var(--shadow-xs);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
button.primary:hover, .btn:hover {
  background: var(--c-accent-hover);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
button.primary:active, .btn:active { transform: translateY(1px); box-shadow: none; }

button.secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  transition: border-color var(--t-fast), background var(--t-fast);
}
button.secondary:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-strong);
}
button.secondary.small { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-12); }

button.danger {
  background: var(--c-danger);
  color: white;
  border: 1px solid transparent;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
}

/* ---------- 5. Inputs ---------- */
input[type="text"], input[type="email"], input[type="time"],
input[type="date"], input[type="search"], input[type="password"],
textarea, select {
  width: 100%;
  padding: var(--sp-3) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-14);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:hover, textarea:hover, select:hover { border-color: var(--c-border-strong); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: var(--shadow-focus);
}
input::placeholder, textarea::placeholder { color: var(--c-text-subtle); }
textarea { min-height: 6.5rem; resize: vertical; line-height: var(--lh-normal); }

label {
  display: block;
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.01em;
}

form .field { margin-bottom: var(--sp-4); }

/* ---------- 6. Pills + badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--c-surface-2);
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  margin-right: var(--sp-1);
  letter-spacing: 0.01em;
}
.deferred-badge {
  background: var(--c-warning-bg);
  color: oklch(40% 0.12 78);
}

/* ---------- 7. Utility text ---------- */
.muted { color: var(--c-text-muted); }
.muted.small { font-size: var(--fs-13); }
.danger { color: var(--c-danger); }

/* ---------- 8. Mobile nav (bottom tabs) ---------- */
#mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: color-mix(in oklch, var(--c-surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--c-border);
  justify-content: space-around;
  padding: var(--sp-2) 0 calc(var(--sp-2) + env(safe-area-inset-bottom));
  z-index: 20;
}
#mobile-tabs a {
  flex: 1;
  text-align: center;
  color: var(--c-text-muted);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
#mobile-tabs a[aria-current="page"] { color: var(--c-accent); }

@media (max-width: 720px) {
  #mobile-tabs { display: flex; }
  h1 { font-size: var(--fs-24); }
}

/* ---------- 9. Sign-in landing ---------- */
.signin-shell {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--c-bg);
}
@media (min-width: 880px) {
  .signin-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.signin-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-10) clamp(var(--sp-6), 6vw, var(--sp-12));
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.signin-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-10);
  font-size: var(--fs-15);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
}
.signin-brand::before {
  content: "";
  width: 24px; height: 24px;
  background: var(--c-accent);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V8l5 7 5-7v12'/><circle cx='18' cy='8' r='3'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V8l5 7 5-7v12'/><circle cx='18' cy='8' r='3'/></svg>") center / contain no-repeat;
}
.signin-content h1 {
  font-size: clamp(2.25rem, 4.4vw, 3.5rem);
  letter-spacing: -0.035em;
  margin-bottom: var(--sp-5);
  line-height: 1.05;
  font-weight: var(--fw-bold);
  max-width: 14ch;
}
.signin-content h1 .accent { color: var(--c-accent); }
.signin-tagline {
  color: var(--c-text-muted);
  font-size: var(--fs-18);
  margin-bottom: var(--sp-8);
  max-width: 44ch;
  line-height: var(--lh-snug);
}
.signin-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 44ch;
}
.signin-features li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  font-size: var(--fs-15);
  color: var(--c-text);
  line-height: var(--lh-snug);
}
.signin-features li::before {
  content: "";
  flex: 0 0 18px;
  width: 18px; height: 18px;
  margin-top: 2px;
  background: var(--c-accent);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
}
.signin-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  align-self: flex-start;
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-15);
  font-weight: var(--fw-semibold);
  border-radius: var(--r-md);
  background: var(--c-text);
  color: var(--c-bg);
  border: 1px solid var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.signin-cta:hover {
  text-decoration: none;
  background: oklch(32% 0.01 90);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.signin-cta:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.signin-cta::before {
  content: "";
  flex: 0 0 18px;
  width: 18px; height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/><path d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/><path d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/><path d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/><path d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/><path d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/><path d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/></svg>") center / contain no-repeat;
}
.signin-footnote {
  margin-top: var(--sp-5);
  font-size: var(--fs-12);
  color: var(--c-text-subtle);
}

/* Right-side decorative panel — full-bleed warm gradient with a single
   oversized brand mark. Intentionally abstract; no fake mock cards
   pretending to be product previews. Hidden on small screens. */
.signin-preview {
  display: none;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 70% 20%, oklch(94% 0.06 158 / 0.75), transparent 55%),
    radial-gradient(ellipse at 10% 85%, oklch(95% 0.05 78 / 0.6), transparent 50%),
    linear-gradient(135deg, oklch(98% 0.008 90) 0%, oklch(96% 0.012 158) 100%);
}
@media (min-width: 880px) {
  .signin-preview { display: block; }
}
.signin-preview::before {
  /* Oversized brand mark, off-center, low contrast. */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c-accent);
  opacity: 0.07;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V8l5 7 5-7v12'/><circle cx='18' cy='8' r='3'/></svg>") center / 70% no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 20V8l5 7 5-7v12'/><circle cx='18' cy='8' r='3'/></svg>") center / 70% no-repeat;
}
.signin-preview::after {
  /* Subtle inscribed quote, bottom of pane. */
  content: "“Every task traces to the values that give it meaning.”";
  position: absolute;
  bottom: var(--sp-8);
  left: var(--sp-8);
  right: var(--sp-8);
  font-size: var(--fs-15);
  font-style: italic;
  color: var(--c-text-muted);
  max-width: 28ch;
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
}

/* ---------- 10. Onboarding ---------- */
.onboarding {
  max-width: 560px;
  margin: var(--sp-10) auto var(--sp-5);
  padding: var(--sp-7);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.onboarding h1 { font-size: var(--fs-30); margin-bottom: var(--sp-3); }
.onboarding > p { color: var(--c-text-muted); margin-bottom: var(--sp-6); }
.onboarding form { margin-top: var(--sp-4); }
.onboarding ul[data-test="onboarding-values"] {
  list-style: none;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  border: 1px dashed var(--c-border);
}
.onboarding ul[data-test="onboarding-values"] li {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
}

/* ---------- 11. Today view ---------- */
.today-view .today-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-7);
  flex-wrap: wrap;
}
.today-view .today-header-titles {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.today-view .today-header h1 {
  margin: 0;
  font-size: var(--fs-36);
  letter-spacing: -0.03em;
}
.today-view .today-header p {
  margin: 0;
  font-size: var(--fs-15);
  color: var(--c-text-subtle);
}
.today-view .plan-my-day-btn {
  white-space: nowrap;
  align-self: flex-end;
}
.today-view .ai-summary {
  color: var(--c-text-muted);
  font-size: var(--fs-14);
  max-width: 60ch;
}
.today-view .ai-summary p { margin: 0 0 var(--sp-2); }
.today-view .ai-summary p:last-child { margin-bottom: 0; }

/* AI-picked focus suggestions ----------------------------------------- */
.today-view .ai-picks {
  margin-bottom: var(--sp-6);
  /* tint the card subtly so it reads as a suggestion, not the user's own list */
  background: color-mix(in oklch, var(--c-surface) 92%, var(--c-accent) 8%);
  border-left: 3px solid var(--c-accent);
}
.today-view .ai-picks-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.today-view .ai-picks-header h2 {
  margin: 0;
  font-size: var(--fs-14);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-subtle);
  font-weight: var(--fw-semibold);
}
.today-view .ai-picks-list { display: flex; flex-direction: column; }
.today-view .ai-pick-row { gap: var(--sp-3); }
.today-view .ai-pick-row .task-name { font-weight: var(--fw-medium); }
.today-view .ai-pick-row .primary.small {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-13);
}
.today-view .ai-picks-empty {
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
}
.today-view .ai-picks-empty h2 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-18);
}
.today-view .ai-picks-empty p { max-width: 50ch; margin: 0 auto; }

/* Today: Focus pane as a hero band at the top; schedule below as a clean
   list. The previous equal two-column split left a vast empty right side
   whenever the user had few pinned items. */
.today-split {
  display: flex;
  flex-direction: column-reverse;     /* Focus pane is in the second slot in JS but should render first */
  gap: var(--sp-7);
}
@media (max-width: 720px) { .today-split { gap: var(--sp-5); } }
.today-schedule-col h2, .today-focus-col h2 {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-13);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-subtle);
  font-weight: var(--fw-semibold);
}
.today-schedule-col .card, .today-focus-col .card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}
/* Inner section labels inside Schedule (all-day / scheduled / ical) are
   smaller than the top-level eyebrow and only spaced when they're a
   subsequent grouping. The first group has no inner label (it's already
   under the SCHEDULE eyebrow). */
.today-schedule-col .card h3, .today-focus-col .card h3 {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  color: var(--c-text-subtle);
  margin: var(--sp-6) 0 var(--sp-2);
  text-transform: none;
}
.today-schedule-col .card:first-child h3 {
  /* The very first group is redundant with the SCHEDULE eyebrow. */
  display: none;
}

/* Schedule rows */
.task-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border);
}
.task-row:last-child { border-bottom: none; }
.task-row .task-name { flex: 1; font-size: var(--fs-14); }
.task-row .task-meta { color: var(--c-text-subtle); font-size: var(--fs-12); }

.schedule-row { gap: var(--sp-3); }
.schedule-pin-btn {
  background: transparent;
  border: none;
  width: 22px; height: 22px;
  flex: 0 0 22px;
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  opacity: 0.35;
  transition: opacity var(--t-fast), background var(--t-fast), transform var(--t-fast);
  /* Pin glyph via mask so we can recolor via background. */
  background-color: var(--c-text-muted);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 17v5'/><path d='M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 17v5'/><path d='M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z'/></svg>") center / contain no-repeat;
}
.task-row:hover .schedule-pin-btn,
.schedule-pin-btn:focus-visible { opacity: 0.75; }
.schedule-pin-btn:hover {
  opacity: 1;
  background-color: var(--c-accent);
  transform: scale(1.05);
}
.schedule-row.is-pinned .schedule-pin-btn,
.schedule-pin-btn[aria-pressed="true"] {
  opacity: 1;
  background-color: var(--c-accent);
}
.schedule-row-deadline .task-name { font-weight: var(--fw-semibold); }
.ical-row {
  border-left: 3px solid var(--c-border-strong);
  padding-left: var(--sp-3);
  margin-left: -3px;
}
.ical-row .task-name { font-style: italic; color: var(--c-text-muted); }
.done-row .strike { text-decoration: line-through; color: var(--c-text-subtle); }

/* Focus pane — pinned cards as a hero treatment when there's one task,
   or a 2-column grid when there are multiple. */
.pinned-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, max-content));
  gap: var(--sp-4);
  justify-content: start;
}
.pinned-stack .pinned-card { min-width: 360px; max-width: 560px; }
.pinned-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-6) var(--sp-5);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.pinned-card::before {
  /* A single thin accent bar at the top — visual signal "this is your focus"
     without surrounding the whole card in green. */
  content: "";
  position: absolute;
  top: 0; left: var(--sp-6); right: var(--sp-6);
  height: 3px;
  background: var(--c-accent);
  border-radius: 0 0 3px 3px;
}
.pinned-card h3 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-24);
  color: var(--c-text);
  text-transform: none;
  letter-spacing: -0.02em;
  font-weight: var(--fw-semibold);
}
.pinned-card-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  flex-wrap: wrap;
  align-items: center;
}
.pinned-card-actions button.primary { padding: var(--sp-2) var(--sp-5); }
.pinned-card-actions button.secondary { padding: var(--sp-2) var(--sp-4); }

/* When the Focus pane is empty (no pinned tasks), show a quiet hint
   instead of nothing. */
.focus-empty {
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  color: var(--c-text-muted);
  font-size: var(--fs-14);
  text-align: center;
}

/* Park split-button */
.park-split { position: relative; display: inline-flex; gap: 2px; }
.park-chevron { padding: var(--sp-2) var(--sp-2); }
.park-menu {
  position: absolute;
  top: calc(100% + var(--sp-1));
  right: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-1);
  flex-direction: column;
  gap: 2px;
  z-index: 5;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  /* Closed by default; .park-split.is-open .park-menu is shown via flex. */
  display: none;
}
.park-split.is-open .park-menu {
  display: flex;
  animation: scale-in var(--t-base);
}
.park-menu button {
  background: transparent;
  border: none;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: var(--fs-13);
  color: var(--c-text);
}
.park-menu button:hover { background: var(--c-surface-2); }

.done-anyway-toast {
  background: var(--c-warning-bg);
  border: 1px solid color-mix(in oklch, var(--c-warning) 50%, var(--c-border));
  margin-top: var(--sp-3);
}
.done-anyway-toast .toast-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  align-items: center;
}
.done-anyway-link { color: var(--c-accent); }

@media (max-width: 720px) {
  .today-split { grid-template-columns: 1fr; }
  .pinned-card { min-width: 100%; }
}

/* ---------- 12. Plan view ---------- */
.plan-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-7);
}
.plan-header h1 {
  margin: 0;
  flex: 1;
  font-size: var(--fs-36);
  letter-spacing: -0.03em;
}
.lens-toggle, .zoom-toggle {
  display: inline-flex;
  background: var(--c-surface-2);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  gap: 0;
}
.lens-toggle button, .zoom-toggle button {
  background: transparent;
  border: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.lens-toggle button:hover, .zoom-toggle button:hover { color: var(--c-text); }
.lens-toggle button[aria-pressed="true"],
.zoom-toggle button[aria-pressed="true"] {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-xs);
}

/* Recently-touched — a horizontal-scroll row of compact pills instead of
   a card grid. Less visual weight. */
.card-row {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-7);
  scrollbar-width: thin;
}
.plan-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 280px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.plan-card:hover {
  border-color: var(--c-border-strong);
  background: var(--c-surface-2);
}
.plan-card-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-14);
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-card-breadcrumb {
  font-size: var(--fs-12);
  color: var(--c-text-subtle);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-card-hint {
  font-size: var(--fs-12);
  color: var(--c-accent);
  margin-top: var(--sp-1);
  font-weight: var(--fw-medium);
}

/* Section headings on Plan + Today: small uppercase eyebrows, paired
   with their content visually. */
section[aria-labelledby="recently-heading"] h2,
section[aria-labelledby="structure-tree-heading"] h2 {
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-subtle);
  font-weight: var(--fw-semibold);
  margin: 0 0 var(--sp-3);
}
/* The tree no longer lives in a card. */
section[aria-labelledby="structure-tree-heading"] > .card,
section[aria-labelledby="structure-tree-heading"] > div.card {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

/* Tree */
.tree-node { padding: 2px 0; }
.tree-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.tree-row:hover { background: var(--c-surface-2); }
.tree-toggle {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--c-text-subtle);
  cursor: pointer;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.tree-toggle[hidden] { visibility: hidden; }
.tree-name-btn {
  background: transparent;
  border: none;
  padding: 0;
  font-size: var(--fs-15);
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-weight: var(--fw-medium);
  transition: color var(--t-fast);
}
.tree-name-btn:hover { color: var(--c-accent); }
/* Root values get a bolder treatment as section anchors. */
.tree-node[data-type="value"] > .tree-row > .tree-name-btn {
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  letter-spacing: -0.01em;
}
.tree-due {
  font-size: var(--fs-12);
  color: var(--c-text-subtle);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.tree-children {
  padding-left: var(--sp-5);
  border-left: 1px solid var(--c-border);
  margin-left: var(--sp-3);
  margin-top: var(--sp-1);
}

/* Breakdown panel */
.breakdown-card { margin-top: var(--sp-4); }
.breakdown-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}
.inline-dialog { margin-top: var(--sp-2); }
.dialog-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); justify-content: flex-end; }

/* Time lens */
.time-nav { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-2);
  background: var(--c-surface);
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.time-day-col {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  min-height: 220px;
  background: var(--c-bg);
}
.time-day-col[data-today="true"] {
  border-color: var(--c-accent);
  background: var(--c-accent-bg);
}
.time-day-label {
  font-size: var(--fs-12);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.deadlines-strip {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-height: 1.5rem;
}
.deadline-pill {
  background: var(--c-accent);
  color: var(--c-accent-fg);
  border: none;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: var(--fs-12);
  text-align: left;
  font-weight: var(--fw-medium);
}
.hour-bands { display: flex; flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-2); }
.scheduled-block {
  background: var(--c-accent);
  color: var(--c-accent-fg);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-12);
  font-weight: var(--fw-medium);
}
.ical-event {
  border: 1.5px dashed var(--c-border-strong);
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-12);
  font-style: italic;
}
.overdue-stack {
  background: var(--c-danger-bg);
  border: 1px solid color-mix(in oklch, var(--c-danger) 30%, var(--c-border));
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.overdue-stack h2 { color: var(--c-danger); margin-top: 0; }

@media (max-width: 720px) {
  .week-grid { grid-template-columns: 1fr; }
  .time-day-col { min-height: 120px; }
  .plan-header { flex-direction: column; align-items: stretch; }
  .lens-toggle, .zoom-toggle { justify-content: center; }
}

/* ---------- 13. Capture view ---------- */
section[aria-labelledby="capture-heading"] {
  max-width: 760px;
  margin: 0 auto;
}
section[aria-labelledby="capture-heading"] h1 {
  font-size: var(--fs-36);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-3);
}
section[aria-labelledby="capture-heading"] > p.muted {
  font-size: var(--fs-15);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-7);
}
section[aria-labelledby="capture-heading"] form {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
section[aria-labelledby="capture-heading"] .field {
  margin-bottom: var(--sp-5);
}
section[aria-labelledby="capture-heading"] textarea {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  background: var(--c-surface);
  font-size: var(--fs-18);
  line-height: 1.55;
  min-height: 36vh;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
section[aria-labelledby="capture-heading"] textarea:hover { border-color: var(--c-border-strong); }
section[aria-labelledby="capture-heading"] textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px oklch(95% 0.04 158);
  outline: none;
}
section[aria-labelledby="capture-heading"] form button[type="submit"] {
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-15);
}

/* ---------- 14. Modal overlays ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--c-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
  z-index: 200;
  animation: fade-in var(--t-base);
}
.modal-backdrop > .inline-dialog {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  min-width: 320px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--shadow-lg);
  animation: scale-in var(--t-base);
}

#plan-search-overlay,
#task-picker-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--sp-4) var(--sp-4);
  z-index: 100;
  animation: fade-in var(--t-base);
}
.search-overlay-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  min-width: 420px;
  max-width: 620px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  box-shadow: var(--shadow-lg);
  animation: scale-in var(--t-base);
}
.search-overlay-card h2 {
  margin: 0;
  font-size: var(--fs-16);
  letter-spacing: -0.01em;
}
.search-overlay-card input[type="search"] {
  width: 100%;
  padding: var(--sp-3) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-15);
}
#plan-search-results ul, #task-picker-results ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#plan-search-results li, #task-picker-results li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
#plan-search-results li:hover, #task-picker-results li:hover { background: var(--c-surface-2); }

/* ---------- 15. Flash + thinking + undo chips ---------- */
#flash-tray {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  max-width: 360px;
}
#flash-tray .flash-banner {
  pointer-events: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-accent);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-md);
  margin: 0;
  animation: slide-up var(--t-base);
  font-size: var(--fs-14);
}
#flash-tray .flash-banner.danger { border-color: var(--c-danger); }

@media (max-width: 720px) {
  #flash-tray {
    bottom: calc(var(--mobile-tab-h) + var(--sp-3));
    right: var(--sp-3);
    left: var(--sp-3);
    max-width: none;
  }
}

.thinking-indicator[hidden] { display: none !important; }
.thinking-indicator {
  background: var(--c-info-bg);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: var(--fs-13);
  color: var(--c-text-muted);
}
.thinking-indicator::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.undo-chip {
  display: inline-flex;
  gap: var(--sp-3);
  align-items: center;
  margin-top: var(--sp-3);
  background: var(--c-accent-bg);
  border: 1px solid var(--c-accent);
  border-radius: var(--r-pill);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-13);
  animation: slide-up var(--t-base);
}

/* Offline indicator */
#offline-indicator {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--c-warning);
  color: oklch(20% 0.05 78);
  text-align: center;
  padding: var(--sp-2);
  font-size: var(--fs-13);
  font-weight: var(--fw-medium);
  z-index: 30;
  animation: slide-down var(--t-base);
}

/* Boot status */
#boot-status {
  padding: var(--sp-7);
  text-align: center;
  color: var(--c-text-muted);
  font-size: var(--fs-14);
}

/* ---------- 16. Animations ---------- */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
