/* Vendored locally (not a CDN @import) — see vendor/fonts/special-elite/SOURCE.md */
@font-face {
  font-family: "Special Elite";
  src: url("../vendor/fonts/special-elite/special-elite-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- design tokens ---------- */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-sunken: #f1f2f4;
  --border: #e4e5e9;
  --border-strong: #d5d7dc;
  --text: #16181d;
  --text-muted: #6b7078;
  --text-faint: #9a9ea6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --danger: #dc4c4c;
  --danger-soft: #fdeeee;
  --success: #1a9c6d;
  --warn: #b8860b;

  --priority-low: #8a8f98;
  --priority-medium: #c98a1f;
  --priority-high: #dc4c4c;

  --status-todo: #6b7280;
  --status-progress: #b8860b;
  --status-done: #1a9c6d;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 18, 22, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 18, 22, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 18, 22, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --rail-bg: rgba(8, 9, 12, 0.55);
  --rail-border: rgba(255, 255, 255, 0.1);
  --rail-icon: #9295a0;
  --rail-icon-hover-bg: rgba(255, 255, 255, 0.08);
  --rail-icon-active-bg: var(--accent);
  --rail-icon-active: #ffffff;

  --glass-blur: blur(20px) saturate(180%);
  --bg-glass: rgba(247, 247, 248, 0.72);
  --surface-glass: rgba(255, 255, 255, 0.62);
  --overlay-glass: rgba(15, 16, 20, 0.35);

  --paper-bg: #f1efea;
  --paper-line: rgba(30, 25, 15, 0.1);
  --paper-text: #2c2620;
  --paper-text-muted: #6f6656;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d10;
    --surface: #17181c;
    --surface-sunken: #1e2025;
    --border: #2a2c32;
    --border-strong: #3a3d45;
    --text: #f2f3f5;
    --text-muted: #9a9ea6;
    --text-faint: #6b7078;
    --accent: #7c74f0;
    --accent-hover: #918af2;
    --accent-soft: #211f3a;
    --danger: #e77373;
    --danger-soft: #331f20;
    --success: #3ec98f;
    --warn: #d9a441;

    --priority-low: #8a8f98;
    --priority-medium: #d9a441;
    --priority-high: #e77373;

    --status-todo: #9a9ea6;
    --status-progress: #d9a441;
    --status-done: #3ec98f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

    --bg-glass: rgba(12, 13, 16, 0.7);
    --surface-glass: rgba(23, 24, 28, 0.58);
    --overlay-glass: rgba(4, 4, 6, 0.55);

    --paper-bg: #26221b;
    --paper-line: rgba(255, 248, 230, 0.08);
    --paper-text: #efe9db;
    --paper-text-muted: #a89d85;

    /* Rail must be visibly lighter than the near-black page background here —
       reusing the light-mode dark rail tone would blend rail into page. */
    --rail-bg: rgba(255, 255, 255, 0.055);
    --rail-border: rgba(255, 255, 255, 0.16);
  }
}

/* Explicit overrides for the rail's manual theme toggle — an attribute-qualified
   :root selector always outranks a plain :root (media-query-wrapped or not) in
   specificity, so these reliably win over the OS `prefers-color-scheme` default
   above regardless of source order. Values are intentionally duplicated rather
   than restructured to share a source, so the already-verified auto/OS behavior
   above is untouched by this addition. */
:root[data-theme="dark"] {
  --bg: #0c0d10;
  --surface: #17181c;
  --surface-sunken: #1e2025;
  --border: #2a2c32;
  --border-strong: #3a3d45;
  --text: #f2f3f5;
  --text-muted: #9a9ea6;
  --text-faint: #6b7078;
  --accent: #7c74f0;
  --accent-hover: #918af2;
  --accent-soft: #211f3a;
  --danger: #e77373;
  --danger-soft: #331f20;
  --success: #3ec98f;
  --warn: #d9a441;

  --priority-low: #8a8f98;
  --priority-medium: #d9a441;
  --priority-high: #e77373;

  --status-todo: #9a9ea6;
  --status-progress: #d9a441;
  --status-done: #3ec98f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

  --bg-glass: rgba(12, 13, 16, 0.7);
  --surface-glass: rgba(23, 24, 28, 0.58);
  --overlay-glass: rgba(4, 4, 6, 0.55);

  --paper-bg: #26221b;
  --paper-line: rgba(255, 248, 230, 0.08);
  --paper-text: #efe9db;
  --paper-text-muted: #a89d85;

  --rail-bg: rgba(255, 255, 255, 0.055);
  --rail-border: rgba(255, 255, 255, 0.16);
}

:root[data-theme="light"] {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-sunken: #f1f2f4;
  --border: #e4e5e9;
  --border-strong: #d5d7dc;
  --text: #16181d;
  --text-muted: #6b7078;
  --text-faint: #9a9ea6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --danger: #dc4c4c;
  --danger-soft: #fdeeee;
  --success: #1a9c6d;
  --warn: #b8860b;

  --priority-low: #8a8f98;
  --priority-medium: #c98a1f;
  --priority-high: #dc4c4c;

  --status-todo: #6b7280;
  --status-progress: #b8860b;
  --status-done: #1a9c6d;

  --shadow-sm: 0 1px 2px rgba(16, 18, 22, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 18, 22, 0.08);
  --shadow-lg: 0 12px 40px rgba(16, 18, 22, 0.14);

  --bg-glass: rgba(247, 247, 248, 0.72);
  --surface-glass: rgba(255, 255, 255, 0.62);
  --overlay-glass: rgba(15, 16, 20, 0.35);

  --paper-bg: #f1efea;
  --paper-line: rgba(30, 25, 15, 0.1);
  --paper-text: #2c2620;
  --paper-text-muted: #6f6656;

  --rail-bg: rgba(8, 9, 12, 0.55);
  --rail-border: rgba(255, 255, 255, 0.1);
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: relative;
  isolation: isolate;
}
/* Soft glow fixed behind everything so the glass rail's backdrop-blur has
   something to pick up — blurring a flat color is invisible. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(640px circle at 0% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  font-family: var(--font);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  color: var(--text-faint);
}

/* ---------- layout ---------- */
body { display: flex; }

.rail {
  flex: 0 0 76px;
  width: 76px;
  height: calc(100vh - 32px);
  position: sticky;
  top: 16px;
  margin: 16px 0 16px 16px;
  border-radius: 24px;
  background: var(--rail-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--rail-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 28px;
}
.rail-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.rail-logo:hover { opacity: 0.85; }
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--rail-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover { background: var(--rail-icon-hover-bg); color: #e4e5e9; }
.rail-btn.is-active { background: var(--rail-icon-active-bg); color: var(--rail-icon-active); }

.theme-toggle-btn {
  margin-top: auto;
}
.theme-toggle-btn .icon-moon { display: block; }
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn.is-dark .icon-moon { display: none; }
.theme-toggle-btn.is-dark .icon-sun { display: block; }

.main-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px 22px;
  margin: 0 -32px;
  position: sticky;
  top: 0;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.page-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  position: relative;
  width: 260px;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  padding: 8px 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-kbd {
  position: absolute;
  right: 10px;
  pointer-events: none;
}

.btn-cmdk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  font-size: 13px;
}
.btn-cmdk .search-kbd { position: static; }

/* ---------- stat pills ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat-pill-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-pill-icon svg { width: 16px; height: 16px; }
.stat-pill-text { display: flex; flex-direction: column; min-width: 0; }
.stat-pill-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-pill-label {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-pill-due-today .stat-pill-icon { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.stat-pill-overdue .stat-pill-icon { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.stat-pill-in-progress .stat-pill-icon { background: var(--accent-soft); color: var(--accent); }
.stat-pill-completed .stat-pill-icon { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.stat-pill-overdue .stat-pill-value { color: var(--danger); }

/* ---------- quick add ---------- */
.quick-add {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 16px;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.quick-add:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.quick-add-icon {
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.quick-add-icon:hover {
  background: var(--surface-sunken);
  color: var(--accent);
}
.quick-add input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-size: 14px;
}
.quick-add-priority,
.quick-add-date {
  border: none;
  outline: none;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- board ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.board-col {
  min-height: 120px;
}

.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.board-col-empty {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  padding: 18px 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.board-col-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
}
.count {
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface);
  border-radius: 999px;
  padding: 1px 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-todo { background: var(--status-todo); }
.dot-in-progress { background: var(--status-progress); }
.dot-done { background: var(--status-done); }

.board-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.board-col-body.is-drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  border-radius: var(--radius-md);
}

/* ---------- task card ---------- */
.task-card {
  position: relative;
  background: var(--paper-bg);
  color: var(--paper-text);
  border: none;
  border-radius: 3px;
  padding: 13px 14px 11px 32px;
  cursor: grab;
  filter: drop-shadow(2px 3px 6px rgba(0, 0, 0, 0.18));
  transition: transform 0.25s ease, filter 0.2s ease;

  /* Punch-hole left margin, notebook-style. Standard `mask` only — deliberately no
     -webkit-mask duplicate: legacy WebKit/Blink -webkit-mask defaults to luminance
     mode for plain gradients, so opaque black (meant as "fully visible" under alpha
     masking) reads as luminance 0 and hides the whole element instead. Forcing
     alpha mode explicitly on the standard property sidesteps that ambiguity. */
  mask:
    linear-gradient(#000, #000) no-repeat center / 100% 100%,
    radial-gradient(circle, #000 42%, transparent 0) repeat-y 11px 9px / 15px 28px;
  mask-mode: alpha, alpha;
  mask-composite: subtract;
}
/* ruled lines, purely decorative texture behind the content */
.task-card::before {
  content: "";
  position: absolute;
  inset: 8px 6px 6px 28px;
  background-image: repeating-linear-gradient(var(--paper-line) 0 1px, transparent 1px 21px);
  pointer-events: none;
}
.task-card > * {
  position: relative;
}
.task-card:nth-child(odd) { transform: rotate(-1deg); }
.task-card:nth-child(even) { transform: rotate(1deg); }
.task-card:hover {
  transform: rotate(0deg) translateY(-3px);
  filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.24));
}
.task-card.is-dragging {
  opacity: 0.4;
}
.task-card.is-done .task-title {
  text-decoration: line-through;
  color: var(--paper-text-muted);
}

.task-title {
  margin: 0 0 6px;
  font-family: "Special Elite", var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  word-break: break-word;
}
.task-notes {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--paper-text-muted);
  line-height: 1.5;
  word-break: break-word;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-priority-low { color: var(--priority-low); background: var(--surface-sunken); }
.badge-priority-medium { color: var(--priority-medium); background: color-mix(in srgb, var(--priority-medium) 14%, transparent); }
.badge-priority-high { color: var(--priority-high); background: color-mix(in srgb, var(--priority-high) 14%, transparent); }

.badge-status-todo { color: var(--status-todo); background: var(--surface-sunken); }
.badge-status-in-progress { color: var(--status-progress); background: color-mix(in srgb, var(--status-progress) 14%, transparent); }
.badge-status-done { color: var(--status-done); background: color-mix(in srgb, var(--status-done) 14%, transparent); }

.badge-due {
  color: var(--text-muted);
  background: var(--surface-sunken);
}
.badge-due.is-overdue {
  color: var(--danger);
  background: var(--danger-soft);
}
.badge-due.is-today {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}

/* ---------- reveal view ---------- */
.reveal-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.reveal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.reveal-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
}
.reveal-intro {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 640px;
}
.reveal-demo-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.reveal-demo-input:focus { border-color: var(--accent); }
.reveal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.reveal-col h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-faint);
}
.reveal-pre {
  margin: 0;
  padding: 14px;
  min-height: 140px;
  max-height: 320px;
  overflow: auto;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
.reveal-pre-wide { margin-top: 14px; max-height: 420px; }
.reveal-pre-compact { min-height: 100px; max-height: 180px; font-size: 11px; }
.add-reveal-intro { margin-top: 4px; }

/* ---------- list view ---------- */
/* List view: one continuous notebook page rather than a data table — same
   punch-hole/ruled-line/typewriter language as the board cards, applied once
   to the whole page instead of per-card. */
.list-view {
  position: relative;
  background: var(--paper-bg);
  border: none;
  border-radius: 3px;
  padding: 6px 10px 6px 34px;
  filter: drop-shadow(2px 3px 8px rgba(0, 0, 0, 0.16));

  mask:
    linear-gradient(#000, #000) no-repeat center / 100% 100%,
    radial-gradient(circle, #000 42%, transparent 0) repeat-y 11px 14px / 15px 32px;
  mask-mode: alpha, alpha;
  mask-composite: subtract;
}
.list-view::before {
  content: "";
  position: absolute;
  inset: 8px 8px 8px 30px;
  background-image: repeating-linear-gradient(var(--paper-line) 0 1px, transparent 1px 41px);
  pointer-events: none;
}
.list-head, .list-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 120px 110px 110px 70px;
  align-items: center;
  gap: 12px;
  padding: 11px 6px;
}
.list-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--paper-text-muted);
}
.list-row {
  cursor: pointer;
  color: var(--paper-text);
  transition: background-color 0.15s ease;
}
.list-row:hover { background: color-mix(in srgb, var(--paper-text) 6%, transparent); }
.list-row-title {
  font-family: "Special Elite", var(--font);
  font-size: 14.5px;
  font-weight: 400;
}
.list-row.is-done .list-row-title {
  text-decoration: line-through;
  color: var(--paper-text-muted);
}
.list-row-actions {
  display: flex;
  justify-content: flex-end;
}
.list-row-delete {
  border: none;
  background: transparent;
  color: var(--paper-text-muted);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.list-row-delete:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- empty states ---------- */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.empty-state-sub { margin: 0; font-size: 13px; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  width: 100%;
  max-width: 460px;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal h2 {
  margin: 0 0 16px;
  font-size: 16px;
}
.modal-wide { max-width: 620px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  padding: 9px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}
.field textarea { resize: vertical; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}
.modal-actions-right { display: flex; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-sunken); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

/* ---------- command palette ---------- */
.cmdk-overlay {
  align-items: flex-start;
  padding-top: 14vh;
}
.cmdk {
  width: 100%;
  max-width: 560px;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.cmdk-input-wrap {
  position: relative;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-wrap .search-icon { left: 16px; }
.cmdk-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 16px 16px 16px 44px;
  font-size: 15px;
}
.cmdk-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  cursor: pointer;
}
.cmdk-item.is-active { background: var(--surface-sunken); }
.cmdk-item-hint { font-size: 11px; color: var(--text-faint); }
.cmdk-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* [hidden] must win over any component's own `display` declaration —
   author-stylesheet specificity otherwise beats the UA default `[hidden]{display:none}`. */
[hidden] { display: none !important; }

/* ---------- responsive ---------- */
/* ---------- lock screen ---------- */
.lock-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lock-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  text-align: center;
}
.lock-logo {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
}
.lock-form { text-align: left; }
.lock-sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}
.lock-hint {
  margin: -6px 0 14px;
  font-size: 12px;
  color: var(--text-faint);
}
.lock-error {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--danger);
  min-height: 1em;
}
.lock-submit { width: 100%; padding: 11px; font-size: 14px; }
.lock-error.is-ok { color: var(--success); }
.sync-close-row { margin-top: 16px; }

.lock-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  text-decoration: underline;
}
.lock-link:hover { color: var(--accent); }

.recovery-code-box {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.03em;
  line-height: 1.7;
  text-align: center;
  word-break: break-all;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  user-select: all;
}
.recovery-copy-btn { width: 100%; margin-bottom: 18px; }
.recovery-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.recovery-confirm input { margin-top: 2px; }

@media (max-width: 860px) {
  body { flex-direction: column; }
  .rail {
    height: auto;
    margin: 12px;
    border-radius: 18px;
    top: 12px;
    flex-direction: row;
    padding: 10px 14px;
    gap: 16px;
  }
  .rail-nav { flex-direction: row; }
  .board { grid-template-columns: 1fr; }
  .page-header { flex-wrap: wrap; }
  .header-actions { width: 100%; }
  .search-field { flex: 1 1 auto; width: auto; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .reveal-columns { grid-template-columns: 1fr; }
  .list-head, .list-row { grid-template-columns: 1fr 90px 40px; }
  .list-head-due, .list-row-due, .list-head-priority ~ .list-head-due { display: none; }
}
