/* ================================================================
   TaskTrackr — Editorial Cream / Crazy Motion
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,200..900;1,9..144,200..900&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --cream:     #ece8de;
  --cream-2:   #e3dfd1;
  --cream-3:   #d8d3c2;
  --ink:       #0a0a0a;
  --ink-2:     #1f1f1f;
  --ink-3:     #3a3a3a;
  --muted:     #6b6b67;
  --muted-2:   #9a9a93;
  --accent:    #2a30ff;
  --accent-2:  #f5ff3d;
  --green:     #1a8f4f;
  --red:       #c42a1f;

  --serif:     'Fraunces', 'Times New Roman', serif;
  --mono:      'JetBrains Mono', 'Courier New', monospace;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--mono);
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, button { color: inherit; }

/* Custom selection */
::selection { background: var(--accent); color: var(--cream); }

/* ── Subtle paper grain ────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(rgba(10,10,10,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* ── Boot Screen ───────────────────────────────────────────────── */
.boot-screen {
  position: fixed; inset: 0;
  background: var(--cream);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  padding: 2rem 2.5rem;
  overflow: hidden;
}
.boot-screen.done { animation: bootOut 0.7s cubic-bezier(0.76,0,0.24,1) forwards; }
@keyframes bootOut {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-101%); }
}

.boot-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative; z-index: 2;
}
.boot-brand {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
  overflow: hidden;
}
.boot-brand span {
  display: inline-block;
  animation: charUp 0.7s cubic-bezier(0.65,0,0.35,1) backwards;
}
.boot-brand .dot { color: var(--accent); }
.boot-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-align: right;
  line-height: 1.6;
}

.boot-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.boot-counter {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 200;
  font-size: clamp(8rem, 24vw, 28rem);
  line-height: 0.82;
  letter-spacing: -0.06em;
  font-feature-settings: 'tnum' 1;
  display: flex;
  align-items: baseline;
}
.boot-counter::after {
  content: '%';
  font-size: 0.18em;
  font-style: italic;
  font-variation-settings: 'opsz' 14, 'wght' 400;
  color: var(--accent);
  margin-left: 0.15em;
}

.boot-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative; z-index: 2;
}
.boot-bar {
  height: 1px;
  background: rgba(10,10,10,0.18);
  position: relative;
  overflow: hidden;
}
.boot-bar span {
  position: absolute;
  left: 0; top: 0;
  height: 100%; width: 0%;
  background: var(--ink);
  animation: bootBar 1.4s cubic-bezier(0.65,0.05,0.36,1) forwards;
}
@keyframes bootBar { to { width: 100%; } }

.boot-status {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.boot-status .dot-live {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: blink 0.8s infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

/* Decorative cross marks on boot */
.boot-cross {
  position: absolute;
  width: 14px; height: 14px;
  z-index: 2;
}
.boot-cross::before, .boot-cross::after {
  content: ''; position: absolute; background: var(--ink);
}
.boot-cross::before { top: 50%; left: 0; right: 0; height: 1px; }
.boot-cross::after  { left: 50%; top: 0; bottom: 0; width: 1px; }
.boot-cross.tl { top: 1.5rem; left: 1.5rem; }
.boot-cross.tr { top: 1.5rem; right: 1.5rem; }
.boot-cross.bl { bottom: 1.5rem; left: 1.5rem; }
.boot-cross.br { bottom: 1.5rem; right: 1.5rem; }

/* ── Page Curtain (between-page transitions) ──────────────────── */
.curtain {
  position: fixed; inset: 0;
  background: var(--ink);
  z-index: 9998;
  transform: translateY(100%);
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.curtain.up    { animation: curtainUp 0.55s cubic-bezier(0.76,0,0.24,1) forwards; pointer-events: all; }
.curtain.down  { animation: curtainDown 0.5s cubic-bezier(0.76,0,0.24,1) forwards; pointer-events: all; }
@keyframes curtainUp   { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes curtainDown { from { transform: translateY(0); }    to { transform: translateY(-100%); } }
.curtain-mark {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 2.5rem;
  color: var(--cream);
  opacity: 0;
  animation: fadeQuick 0.3s 0.15s forwards;
}
.curtain-mark .dot { color: var(--accent-2); }
@keyframes fadeQuick { to { opacity: 1; } }

/* ── Layout ────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* ── Top Bar (authenticated) ───────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--ink);
  background: var(--cream);
  position: sticky; top: 0;
  z-index: 50;
}
.topbar-brand {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.topbar-brand .dot { color: var(--accent); }

.topbar-nav {
  display: flex;
  gap: 2rem;
}
.nav-link {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  padding: 0.35rem 0;
  position: relative;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--ink);
  transition: right 0.3s cubic-bezier(0.65,0,0.35,1);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { right: 0; }
.nav-link.active { color: var(--ink); }
.nav-link.active::after { right: 0; background: var(--accent); height: 2px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.user-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.user-chip-avatar {
  width: 22px; height: 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 0.7rem;
  background: var(--accent);
  color: var(--cream);
}

.signout-btn {
  background: transparent;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.4rem 0.75rem;
  color: var(--ink);
  transition: all 0.2s;
}
.signout-btn:hover { background: var(--ink); color: var(--cream); }

/* ── Main ──────────────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 4rem 2rem 5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  animation: pageIn 0.8s cubic-bezier(0.16,1,0.3,1);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Flash Messages ────────────────────────────────────────────── */
.flash-container { margin-bottom: 2rem; max-width: 480px; }
.flash {
  border-left: 3px solid;
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
  background: var(--cream-2);
  animation: slideRight 0.4s cubic-bezier(0.16,1,0.3,1);
}
.flash-error   { border-color: var(--red);   color: var(--red); }
.flash-success { border-color: var(--green); color: var(--green); }
@keyframes slideRight { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }

/* ── Reveal text (mask reveal) ─────────────────────────────────── */
.reveal { display: inline-block; overflow: hidden; vertical-align: bottom; }
.reveal > span {
  display: inline-block;
  transform: translateY(110%);
  animation: maskUp 0.9s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes maskUp { to { transform: translateY(0); } }

/* Stagger helpers */
.d-1 { animation-delay: 0.05s; }
.d-2 { animation-delay: 0.12s; }
.d-3 { animation-delay: 0.20s; }
.d-4 { animation-delay: 0.30s; }
.d-5 { animation-delay: 0.42s; }
.d-6 { animation-delay: 0.55s; }

/* ── Page Header ───────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: '';
  width: 30px; height: 1px;
  background: var(--ink);
  display: inline-block;
}

.display-h1 {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 350;
  font-size: clamp(3rem, 7.5vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}
.display-h1 em { font-style: italic; font-variation-settings: 'opsz' 144, 'wght' 250; color: var(--accent); }

.display-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 460px;
  letter-spacing: 0.02em;
}

.divider {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 3rem 0 2.5rem;
}
.divider-thin { border-top-color: rgba(10,10,10,0.18); margin: 1.5rem 0; }

/* ── Auth Page ─────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  position: relative;
}
.auth-left {
  background: var(--cream);
  padding: 2.5rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 320px; height: 320px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  opacity: 0.08;
  animation: orbit 60s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }

.auth-mark {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 1.4rem;
}
.auth-mark .dot { color: var(--accent); }

.auth-headline {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.auth-headline em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'wght' 250;
  color: var(--accent);
}

.auth-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.auth-meta-row .num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.auth-right {
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  position: relative;
}
.auth-form-wrap {
  width: 100%;
  max-width: 360px;
}
.auth-form-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.auth-form-eyebrow::before { content: '/'; color: var(--accent); }
.auth-form-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  line-height: 1;
}

.field {
  margin-bottom: 1.5rem;
  position: relative;
}
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.6rem 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-bottom-color: var(--accent); }
.field input::placeholder { color: var(--muted-2); font-family: var(--mono); font-size: 0.85rem; }

.btn-mega {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
  padding: 1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
  transition: color 0.4s;
}
.btn-mega::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.4s cubic-bezier(0.76,0,0.24,1);
  z-index: 0;
}
.btn-mega:hover::before { transform: translateY(0); }
.btn-mega > * { position: relative; z-index: 1; }
.btn-mega .arrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  text-transform: none;
  letter-spacing: 0;
  transition: transform 0.3s;
}
.btn-mega:hover .arrow { transform: translateX(4px); }

.auth-foot {
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.auth-foot a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  transition: color 0.2s, border-color 0.2s;
}
.auth-foot a:hover { color: var(--accent); border-color: var(--accent); }

/* ── Dashboard ─────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.dash-cell {
  padding: 2rem 0;
  border-right: 1px solid var(--ink);
}
.dash-cell:last-child { border-right: 0; padding-left: 2.5rem; }
.dash-cell:first-child { padding-right: 2.5rem; }

.giant-pct {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 200;
  font-size: clamp(8rem, 18vw, 16rem);
  line-height: 0.85;
  letter-spacing: -0.06em;
  display: flex;
  align-items: baseline;
}
.giant-pct .pct-sym {
  font-size: 0.18em;
  font-style: italic;
  font-variation-settings: 'opsz' 14, 'wght' 400;
  color: var(--accent);
  margin-left: 0.1em;
  align-self: flex-start;
  margin-top: 0.4em;
}

.dash-progress-bar {
  height: 1px;
  background: rgba(10,10,10,0.15);
  position: relative;
  margin: 1.5rem 0 1rem;
  overflow: hidden;
}
.dash-progress-bar > span {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--ink);
  transform-origin: left;
  animation: barFill 1.4s 0.5s cubic-bezier(0.76,0,0.24,1) backwards;
}
@keyframes barFill { from { width: 0; } }

.dash-cell .label-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
}
.stat-table tr { border-bottom: 1px solid rgba(10,10,10,0.15); }
.stat-table tr:last-child { border-bottom: 0; }
.stat-table td {
  padding: 1.1rem 0;
  vertical-align: baseline;
}
.stat-table .lbl {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  width: 50%;
}
.stat-table .num {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 250;
  font-size: 2.6rem;
  letter-spacing: -0.03em;
  text-align: right;
  font-feature-settings: 'tnum' 1;
}
.stat-table .num em { color: var(--accent); font-style: italic; }

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 3rem;
  border-top: 1px solid var(--ink);
}
.action-tile {
  padding: 2rem 1.75rem;
  border-right: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: color 0.4s;
}
.action-tile:last-child { border-right: 0; }
.action-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.45s cubic-bezier(0.76,0,0.24,1);
}
.action-tile:hover { color: var(--cream); }
.action-tile:hover::before { transform: translateY(0); }
.action-tile > * { position: relative; z-index: 1; }
.action-tile .lbl {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.action-tile .arrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.8rem;
  font-weight: 300;
  transition: transform 0.4s;
}
.action-tile:hover .arrow { transform: translateX(8px) rotate(-12deg); }

/* ── Tasks Page ────────────────────────────────────────────────── */
.add-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--ink);
  margin-bottom: 0;
  background: var(--cream);
}
.add-more-toggle {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--ink);
  padding: 0 1rem;
  font-size: 1.1rem;
  font-family: var(--mono);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.add-more-toggle:hover { color: var(--ink); background: var(--cream-2); }

.add-advanced {
  border: 1px solid var(--ink);
  border-top: 0;
  background: var(--cream);
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.76,0,0.24,1), padding 0.3s ease;
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.add-advanced.open {
  max-height: 280px;
  padding: 1rem 1.25rem 1.1rem;
}
.adv-field { display: flex; flex-direction: column; gap: 0.4rem; }
.adv-field > label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.adv-input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.4rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  outline: none;
  min-width: 140px;
}
.adv-input:focus { border-bottom-color: var(--accent); }

.prio-picker { display: flex; gap: 0; border: 1px solid var(--ink); }
.prio-picker input { display: none; }
.prio-picker .prio-opt {
  padding: 0.35rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-right: 1px solid var(--ink);
  transition: background 0.15s, color 0.15s;
  color: var(--muted);
}
.prio-picker .prio-opt:last-child { border-right: 0; }
.prio-picker input:checked + .prio-opt.prio-low  { background: var(--ink);   color: var(--cream); }
.prio-picker input:checked + .prio-opt.prio-med  { background: var(--accent); color: var(--cream); }
.prio-picker input:checked + .prio-opt.prio-high { background: var(--red);   color: var(--cream); }

/* ── Toolbar (filter + search) ─────────────────────────────────── */
.task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 2.5rem 0 1.25rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-pill {
  background: transparent;
  border: 1px solid rgba(10,10,10,0.25);
  padding: 0.4rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.filter-pill:hover { border-color: var(--ink); color: var(--ink); }
.filter-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.filter-pill .count {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  font-feature-settings: 'tnum' 1;
  opacity: 0.75;
}
.filter-pill.active .count { color: var(--accent-2); opacity: 1; }

.search-wrap {
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid var(--ink);
  padding: 0.25rem 0;
  min-width: 220px;
}
.search-wrap::before {
  content: '⌕';
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--muted);
}
#task-search {
  background: transparent;
  border: 0;
  outline: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  flex: 1;
  padding: 0.3rem 0;
}
#task-search::placeholder { color: var(--muted-2); }
.add-bar input[type=text] {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 1.1rem 1.25rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  outline: none;
}
.add-bar input[type=text]::placeholder { color: var(--muted-2); font-family: var(--mono); font-size: 0.9rem; }
.add-bar input[type=date] {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--ink);
  padding: 1rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink);
  outline: none;
  width: 160px;
}
.add-bar button {
  background: var(--ink);
  color: var(--cream);
  border: 0;
  padding: 0 1.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  position: relative;
  overflow: hidden;
  transition: color 0.3s;
}
.add-bar button::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.35s cubic-bezier(0.76,0,0.24,1);
}
.add-bar button:hover::before { transform: translateY(0); }
.add-bar button > span { position: relative; z-index: 1; }

.task-list { border-top: 1px solid var(--ink); }
.task-row {
  display: grid;
  grid-template-columns: 28px 32px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem 0.9rem 0.5rem;
  border-bottom: 1px solid rgba(10,10,10,0.18);
  position: relative;
  animation: fadeUp 0.5s cubic-bezier(0.16,1,0.3,1) backwards;
  transition: background 0.2s ease, padding-left 0.25s cubic-bezier(0.16,1,0.3,1);
}
.task-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.18s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
.task-row.prio-2::before { background: var(--red); }
.task-row.prio-1::before { background: var(--accent); }
.task-row.prio-0::before { background: rgba(10,10,10,0.15); }
.task-row.dragging { opacity: 0.4; }
.task-row:hover { background: var(--cream-2); padding-left: 1rem; }
.task-row > * { position: relative; z-index: 1; }

.drag-handle {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted-2);
  cursor: grab;
  user-select: none;
  letter-spacing: -2px;
  text-align: center;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
}
.task-row:hover .drag-handle { opacity: 1; color: var(--ink); }
.drag-handle:active { cursor: grabbing; }

.task-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.task-line {
  display: flex; align-items: baseline; gap: 0.6rem; min-width: 0;
}
.prio-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
}
.prio-dot-2 { background: var(--red); }
.prio-dot-1 { background: var(--accent); }
.prio-dot-0 { background: rgba(10,10,10,0.25); }

.recur-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  border: 1px solid rgba(10,10,10,0.22);
  padding: 1px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.task-meta {
  display: flex; align-items: center; gap: 0.6rem;
  flex-wrap: wrap;
}
.tag-pill {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  background: rgba(42,48,255,0.07);
  border: 1px solid rgba(42,48,255,0.3);
  padding: 1px 7px;
  border-radius: 2px;
}
.due-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 1px 7px;
  border: 1px solid rgba(10,10,10,0.22);
  color: var(--muted);
}
.due-label.due-overdue { color: var(--red); border-color: var(--red); background: rgba(196,42,31,0.07); font-weight: 700; }
.due-label.due-today   { color: var(--cream); background: var(--ink); border-color: var(--ink); }
.due-label.due-soon    { color: var(--accent); border-color: var(--accent); }
.due-label.due-future  { color: var(--muted); }

.task-check {
  width: 22px; height: 22px;
  background: var(--cream);
  border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: transparent;
  padding: 0;
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.task-check:hover { background: var(--accent); border-color: var(--accent); color: var(--cream); }
.task-check.checked { background: var(--accent); border-color: var(--accent); color: var(--cream); }
.task-check.checked::after { content: '✓'; }

.task-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 60, 'wght' 400;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.task-row.done .task-title {
  font-style: italic;
  font-variation-settings: 'opsz' 60, 'wght' 300;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.55;
}

.task-actions {
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s, transform 0.2s;
  position: relative;
  z-index: 2;
}
.task-row:hover .task-actions { opacity: 1; transform: translateX(0); }

.icon-btn {
  width: 28px; height: 28px;
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--accent); color: var(--cream); border-color: var(--accent); }
.icon-btn.delete:hover { background: var(--red); border-color: var(--red); color: var(--cream); }

.edit-row {
  background: var(--cream);
  border: 1px solid var(--accent);
  animation: fadeUp 0.25s cubic-bezier(0.16,1,0.3,1);
}
.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 130px 130px 95px 110px auto auto;
  align-items: stretch;
}
.edit-form-grid > * {
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(10,10,10,0.18);
  padding: 0.7rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  outline: none;
}
.edit-form-grid > *:first-child { border-left: 0; }
.edit-form-grid .edit-title { font-family: var(--serif); font-size: 1.05rem; }
.edit-form-grid select { cursor: pointer; }
.edit-form-grid button {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  cursor: pointer;
  padding: 0 1rem;
}
.edit-form-grid button.save { background: var(--ink); color: var(--cream); }
.edit-form-grid button.save:hover { background: var(--accent); }

.empty-filter {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

@media (max-width: 800px) {
  .edit-form-grid { grid-template-columns: 1fr 1fr; }
  .edit-form-grid > * { border-left: 0; border-bottom: 1px solid rgba(10,10,10,0.18); }
  .task-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { flex-wrap: wrap; }
  .search-wrap { width: 100%; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.empty-state {
  border: 1px dashed rgba(10,10,10,0.3);
  padding: 4rem 2rem;
  text-align: center;
}
.empty-state h3 {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-style: italic;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── Profile ───────────────────────────────────────────────────── */
.profile-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin-top: 2rem;
}
.profile-spread > div {
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--ink);
}
.profile-spread > div:last-child { border-right: 0; }

.profile-mono-id {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.profile-name-big {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 1rem;
}
.profile-name-big em { font-style: italic; color: var(--accent); }

.profile-stats { display: flex; flex-direction: column; gap: 1.5rem; }
.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(10,10,10,0.15);
  padding-bottom: 1rem;
}
.profile-stat-row .lbl {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.profile-stat-row .val {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 250;
  font-size: 2.4rem;
  letter-spacing: -0.03em;
}

/* ── Calendar ──────────────────────────────────────────────────── */
.cal-page-shell { padding: 2rem; }
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 0;
}
.cal-nav { display: flex; align-items: center; gap: 1.5rem; }
.cal-nav-btn {
  width: 38px; height: 38px;
  background: transparent;
  border: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cal-nav-btn:hover { background: var(--ink); color: var(--cream); }
.cal-month-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'wght' 300;
  font-size: 2rem;
  letter-spacing: -0.02em;
  min-width: 240px;
  text-align: center;
  font-style: italic;
}
.cal-toolbar-right {
  display: flex; align-items: center; gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.cal-legend { display: flex; align-items: center; gap: 0.4rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-left: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cal-day-header {
  padding: 0.6rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  border-right: 1px solid var(--ink);
  border-top: 1px solid var(--ink);
  background: var(--cream-2);
}
.cal-cell {
  min-height: 110px;
  border-right: 1px solid var(--ink);
  border-top: 1px solid var(--ink);
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.2s;
  position: relative;
}
.cal-cell:hover { background: var(--cream-2); }
.cal-empty { background: var(--cream-3); cursor: default; pointer-events: none; opacity: 0.4; }
.cal-date-num {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-variation-settings: 'opsz' 60, 'wght' 400;
  align-self: flex-start;
  line-height: 1;
}
.cal-today .cal-date-num {
  width: 30px; height: 30px;
  background: var(--accent);
  color: var(--cream);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-style: italic;
  font-size: 1rem;
}
.cal-has-holiday { background: rgba(196,42,31,0.05); }
.cal-holiday {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-task-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  background: var(--ink);
  color: var(--cream);
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}
.cal-task-pill.cal-prio-2 { background: var(--red); }
.cal-task-pill.cal-prio-1 { background: var(--ink); }
.cal-task-pill.cal-prio-0 { background: var(--muted); }
.cal-task-pill.done-pill { background: var(--accent) !important; opacity: 0.5; text-decoration: line-through; }
.cal-more {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

@keyframes slideInRight  { from { opacity:0; transform:translateX(20px);  } to { opacity:1; transform:none; } }
@keyframes slideInLeft   { from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:none; } }
@keyframes slideOutLeft  { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(-20px); } }
@keyframes slideOutRight { from { opacity:1; transform:none; } to { opacity:0; transform:translateX(20px); } }
.cal-grid.slide-in-right  { animation: slideInRight  0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.cal-grid.slide-in-left   { animation: slideInLeft   0.3s cubic-bezier(0.16,1,0.3,1) forwards; }
.cal-grid.slide-out-left  { animation: slideOutLeft  0.2s cubic-bezier(0.76,0,0.24,1) forwards; }
.cal-grid.slide-out-right { animation: slideOutRight 0.2s cubic-bezier(0.76,0,0.24,1) forwards; }

/* Calendar modal */
.cal-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.6);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}
.cal-modal-overlay.open { opacity: 1; pointer-events: all; }
.cal-modal {
  background: var(--cream);
  border: 1px solid var(--ink);
  width: 440px;
  max-width: 92vw;
  padding: 2rem;
  transform: scale(0.94) translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
}
.cal-modal-overlay.open .cal-modal { transform: scale(1) translateY(0); opacity: 1; }
.cal-modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ink); }
.cal-modal-date { font-family: var(--serif); font-style: italic; font-size: 1.4rem; font-variation-settings: 'opsz' 144,'wght' 350; line-height: 1.1; }
.cal-modal-holiday { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--red); margin-top: 0.4rem; }
.cal-modal-close {
  background: transparent;
  border: 1px solid var(--ink);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
}
.cal-modal-close:hover { background: var(--ink); color: var(--cream); }
.modal-task {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(10,10,10,0.15);
  font-family: var(--serif);
  font-size: 1rem;
}
.modal-task:last-child { border-bottom: 0; }
.modal-task.task-done { text-decoration: line-through; opacity: 0.45; font-style: italic; }
.modal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); flex-shrink: 0; }
.modal-dot.modal-dot-prio-2 { background: var(--red); }
.modal-dot.modal-dot-prio-1 { background: var(--accent); }
.modal-dot.modal-dot-prio-0 { background: rgba(10,10,10,0.3); }
.modal-dot.dot-done { background: var(--accent); }
.modal-task-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.modal-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  background: rgba(42,48,255,0.07);
  border: 1px solid rgba(42,48,255,0.3);
  padding: 1px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}
.modal-empty { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); padding: 1rem 0; letter-spacing: 0.05em; }
.cal-modal-footer { margin-top: 1.5rem; }
.cal-modal-footer .btn-mega { padding: 0.75rem 1rem; font-size: 0.7rem; }

/* Char-up keyframe */
@keyframes charUp {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { border-right: 0; border-bottom: 1px solid var(--ink); padding: 2rem 1.5rem; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-cell { border-right: 0; border-bottom: 1px solid var(--ink); padding: 1.5rem 0; }
  .dash-cell:first-child { padding-right: 0; }
  .dash-cell:last-child { padding-left: 0; padding-bottom: 0; border-bottom: 0; }
  .profile-spread { grid-template-columns: 1fr; }
  .profile-spread > div { border-right: 0; border-bottom: 1px solid var(--ink); }
  .profile-spread > div:last-child { border-bottom: 0; }
  .topbar-nav { gap: 1rem; }
  .topbar { padding: 0.85rem 1rem; }
  .main { padding: 2.5rem 1.25rem; }
}

/* ================================================================
   DARK MODE
   ================================================================ */
[data-theme="dark"] {
  --cream:    #141414;
  --cream-2:  #1d1d1d;
  --cream-3:  #262626;
  --ink:      #ece8de;
  --ink-2:    #d4cfc4;
  --ink-3:    #b0ab9e;
  --muted:    #7a7a72;
  --muted-2:  #4e4e48;
  --accent:   #5058ff;
  --accent-2: #f5ff3d;
  --green:    #2db870;
  --red:      #e04848;
}

/* Grain overlay — flip blend mode for dark bg */
[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  background-image: radial-gradient(rgba(236,232,222,0.04) 1px, transparent 1px);
}

/* Auth page right panel */
[data-theme="dark"] .auth-right { background: var(--cream-2); }

/* Borders that use hard-coded rgba() need dark overrides */
[data-theme="dark"] .filter-pill { border-color: rgba(236,232,222,0.2); }
[data-theme="dark"] .task-row { border-bottom-color: rgba(236,232,222,0.1); }
[data-theme="dark"] .stat-table tr { border-bottom-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .dash-progress-bar { background: rgba(236,232,222,0.12); }
[data-theme="dark"] .task-row.prio-0::before { background: rgba(236,232,222,0.18); }
[data-theme="dark"] .edit-form-grid > * { border-left-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .edit-row { background: var(--cream-2); border-color: var(--accent); }
[data-theme="dark"] .add-advanced { background: var(--cream); border-color: var(--ink); }
[data-theme="dark"] .add-bar { background: var(--cream); border-color: var(--ink); }
[data-theme="dark"] .add-bar input[type=date] { border-left-color: rgba(236,232,222,0.25); }
[data-theme="dark"] .prio-picker { border-color: var(--ink); }
[data-theme="dark"] .prio-picker .prio-opt { border-right-color: rgba(236,232,222,0.25); }
[data-theme="dark"] .profile-stat-row { border-bottom-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .divider-thin { border-top-color: rgba(236,232,222,0.15); }
[data-theme="dark"] .empty-state { border-color: rgba(236,232,222,0.2); }
[data-theme="dark"] .task-meta .due-label { border-color: rgba(236,232,222,0.22); }
[data-theme="dark"] .recur-badge { border-color: rgba(236,232,222,0.22); }
[data-theme="dark"] .tag-pill { background: rgba(80,88,255,0.12); border-color: rgba(80,88,255,0.4); }
[data-theme="dark"] .modal-tag { background: rgba(80,88,255,0.12); border-color: rgba(80,88,255,0.4); }
[data-theme="dark"] .cal-has-holiday { background: rgba(224,72,72,0.08); }
[data-theme="dark"] .cal-modal-overlay { background: rgba(0,0,0,0.75); }
[data-theme="dark"] .cal-modal { background: var(--cream); border-color: rgba(236,232,222,0.25); }
[data-theme="dark"] .cal-modal-header { border-bottom-color: rgba(236,232,222,0.2); }
[data-theme="dark"] .modal-task { border-bottom-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .modal-dot.modal-dot-prio-0 { background: rgba(236,232,222,0.3); }
[data-theme="dark"] .prio-dot-0 { background: rgba(236,232,222,0.25); }
[data-theme="dark"] .cal-cell { border-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .cal-day-header { background: var(--cream-2); border-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .cal-grid { border-color: rgba(236,232,222,0.12); }
[data-theme="dark"] .cal-empty { background: var(--cream-3); }
[data-theme="dark"] .flash { background: var(--cream-2); }
[data-theme="dark"] .task-check { background: var(--cream-2); }
[data-theme="dark"] .icon-btn { background: var(--cream-2); }
[data-theme="dark"] .task-notes-text { color: var(--muted); }
[data-theme="dark"] .edit-notes { border-top-color: rgba(236,232,222,0.15); }
[data-theme="dark"] .bulk-bar { background: var(--ink); border-top-color: rgba(236,232,222,0.15); }
[data-theme="dark"] .bulk-bar .bulk-bar-count { color: var(--cream); }
[data-theme="dark"] .bulk-btn { border-color: rgba(10,10,10,0.4); color: var(--cream); }
[data-theme="dark"] .bulk-check-input { background: var(--cream-2); border-color: rgba(236,232,222,0.3); }
[data-theme="dark"] .pw-section { border-top-color: rgba(236,232,222,0.15); }

/* ── Dark Mode Toggle Button ───────────────────────────────────── */
.theme-toggle {
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--ink); color: var(--cream); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Task Notes ────────────────────────────────────────────────── */
.task-notes-text {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.edit-form-wrap { display: flex; flex-direction: column; }
.edit-notes {
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(10,10,10,0.15);
  padding: 0.65rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  outline: none;
  resize: vertical;
  min-height: 56px;
  color: var(--ink);
  line-height: 1.5;
}
.edit-notes::placeholder { color: var(--muted-2); }
.adv-notes {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.4rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  outline: none;
  resize: none;
  min-height: 48px;
  color: var(--ink);
  line-height: 1.5;
}
.adv-notes::placeholder { color: var(--muted-2); }
.adv-field.adv-notes-wrap { flex: 1; min-width: 200px; }

/* ── Bulk Selection ────────────────────────────────────────────── */
.bulk-check {
  display: none;
  align-items: center;
  justify-content: center;
}
.task-list.bulk-mode .drag-handle { display: none; }
.task-list.bulk-mode .bulk-check  { display: flex; }

.bulk-check-input {
  width: 18px; height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--cream);
  border: 1px solid var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.bulk-check-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.bulk-check-input:checked::after {
  content: '✓';
  position: absolute;
  font-size: 0.7rem;
  color: var(--cream);
  font-family: var(--mono);
  font-weight: 700;
}

/* Floating bulk action bar */
.bulk-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--cream);
  border-top: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  gap: 1rem;
}
.bulk-bar.visible { transform: translateY(0); }
.bulk-bar-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.bulk-bar-count strong {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin-right: 0.2rem;
}
.bulk-bar-actions { display: flex; gap: 0.5rem; align-items: center; }
.bulk-btn {
  background: transparent;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.18s, color 0.18s;
}
.bulk-btn:hover { background: var(--ink); color: var(--cream); }
.bulk-btn.bulk-btn-del:hover { background: var(--red); border-color: var(--red); color: var(--cream); }
.bulk-btn.bulk-btn-cancel { color: var(--muted); border-color: rgba(10,10,10,0.25); }
.bulk-toggle-btn {
  background: transparent;
  border: 1px solid rgba(10,10,10,0.25);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.18s;
}
.bulk-toggle-btn:hover { border-color: var(--ink); color: var(--ink); }
.bulk-toggle-btn.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ── Sort & Export toolbar controls ───────────────────────────── */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.sort-select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(10,10,10,0.4);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 0.3rem 0.2rem;
  outline: none;
  cursor: pointer;
}
[data-theme="dark"] .sort-select { border-bottom-color: rgba(236,232,222,0.35); }
.export-btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  border: 1px solid rgba(10,10,10,0.25);
  padding: 0.4rem 0.85rem;
  transition: all 0.18s;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.export-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="dark"] .export-btn { border-color: rgba(236,232,222,0.2); }

/* ── Password Change Section (profile) ────────────────────────── */
.pw-section {
  border-top: 1px solid rgba(10,10,10,0.15);
  padding-top: 2rem;
  margin-top: 2rem;
}
.pw-section-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.pw-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 320px;
}
.pw-field { display: flex; flex-direction: column; gap: 0.3rem; }
.pw-field label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.pw-field input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  color: var(--ink);
}
.pw-field input:focus { border-bottom-color: var(--accent); }
.pw-submit {
  align-self: flex-start;
  margin-top: 0.5rem;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.pw-submit:hover { background: var(--accent); border-color: var(--accent); }
