:root {
  --bg: #F3EFDD;
  --bg-2: #E8E1C4;
  --paper: #FFFDF6;
  --card-bg: #FFFDF6;
  --track-bg: #E1DBB9;
  --border: #D3CBA0;
  --text: #262A1C;
  --muted: #7C7A5C;
  --accent: #5C6B3F;
  --accent-2: #2E3620;
  --danger: #B23B2E;
  --tab-dashboard: #5C6B3F;
  --tab-journal: #3F5B4A;
  --tab-mood: #A98B3E;
  --tab-goals: #4B5A63;
  --tab-insights: #6B4B5E;
  --tab-calendar: #8A5636;
  --tab-capsules: #A85D4D;
  --tab-basis: #3E4E6B;
  --tab-checkin: #A98B3E;
  --shadow-soft: 0 1px 2px rgba(34, 38, 24, 0.06), 0 8px 24px -8px rgba(34, 38, 24, 0.16);
  --shadow-lifted: 0 1px 2px rgba(34, 38, 24, 0.07), 0 18px 42px -14px rgba(34, 38, 24, 0.26);
  --font-display: "Unbounded", "Segoe UI", sans-serif;
  --bg-glow-1: #ECE7CC;
  --bg-glow-2: #DFDBAF;
}

:root[data-theme="dark"] {
  --bg: #1C2016;
  --bg-2: #242A1C;
  --paper: #262C1E;
  --card-bg: #262C1E;
  --track-bg: #333A26;
  --border: #3D4530;
  --text: #EBE5D0;
  --muted: #97906F;
  --accent: #93A186;
  --accent-2: #566349;
  --danger: #D0574A;
  --tab-dashboard: #93A186;
  --tab-journal: #5C9782;
  --tab-mood: #CDA84E;
  --tab-goals: #7793AD;
  --tab-insights: #A5789D;
  --tab-calendar: #BD8459;
  --tab-capsules: #CB8676;
  --tab-basis: #7D93C2;
  --tab-checkin: #CDA84E;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lifted: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 42px -14px rgba(0, 0, 0, 0.65);
  --bg-glow-1: #2A311F;
  --bg-glow-2: #232A1A;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1100px 560px at 12% -8%, var(--bg-glow-1) 0%, transparent 58%),
    radial-gradient(900px 480px at 100% 0%, var(--bg-glow-2) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-lifted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.theme-toggle:active { transform: scale(0.92); }

.hidden { display: none !important; }

a { color: var(--accent); }

/* ---------- auth / loading / link states (centered, narrow) ---------- */

.state-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image: linear-gradient(180deg, rgba(20, 24, 14, 0.5), rgba(18, 22, 13, 0.82)), var(--scene, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#screen-auth { --scene: url("assets/forest-valley.jpg"); }
#screen-link { --scene: url("assets/forest-vista.jpg"); }

#screen-loading {
  background-image: radial-gradient(1100px 640px at 50% 32%, #3a4429 0%, #1b2013 72%);
}

.vinyl {
  position: relative;
  width: clamp(260px, 62vmin, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: spin 3.2s linear infinite;
}
.vinyl-surface { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(0.82) contrast(1.02) saturate(0.95); }
.vinyl-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center, transparent 0, transparent 8.2%, rgba(255, 255, 255, 0.07) 8.2%, rgba(255, 255, 255, 0.07) 8.8%);
  pointer-events: none;
}
.vinyl-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34%; height: 34%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.5);
}
.vinyl-label-logo {
  position: absolute;
  width: 164%;
  height: 164%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  display: block;
}
.vinyl-spindle {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #1b1f14;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
  z-index: 5;
}

.badge-wrap { text-align: center; padding: 8px 0 4px; }
.logo-badge {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 4px #fff, 0 0 0 5px var(--border);
  transition: transform 0.15s ease;
}
.logo-badge:active { transform: scale(0.96); }

.header { text-align: center; margin-bottom: 20px; }
.header h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: 0.03em; margin: 12px 0 0; color: #F5F1DE; }
.header .tagline { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: rgba(245, 241, 222, 0.78); text-transform: uppercase; margin-top: 6px; }

.wordmark-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  margin: 0 9px;
  position: relative;
  top: -2px;
}

.auth-card { width: 100%; max-width: 380px; }

.card {
  background: var(--card-bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(150, 150, 90, 0.09) 27px 28px);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.card-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: 0.01em; margin: 0 0 14px; }
.panel-subtitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 10px;
}

.muted { color: var(--muted); font-size: 14px; }

input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="date"], textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  margin-bottom: 10px;
  transition: border-color 0.15s ease;
}

input:focus, textarea:focus { outline: none; border-color: var(--accent); }

textarea { resize: vertical; }

button { font-family: inherit; cursor: pointer; }

.btn-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 8px 18px -6px rgba(46, 54, 32, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary:active { transform: translateY(1px) scale(0.99); box-shadow: 0 4px 10px -4px rgba(46, 54, 32, 0.5); }
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }

.btn-secondary {
  display: block;
  width: 100%;
  background: none;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
}

.form-error { color: var(--danger); font-size: 13px; margin: -4px 0 10px; }

/* ---------- open notebook app shell ---------- */

.book-spread {
  position: relative;
  display: flex;
  width: min(94vw, 1500px, 188vh);
  aspect-ratio: 2 / 1;
  margin: 26px auto;
  padding: 26px;
  background: linear-gradient(155deg, #4a5636 0%, #2e3620 100%);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.bookmark {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 64px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.pencil {
  position: absolute;
  left: 5px;
  top: 8%;
  width: 16px;
  height: 84%;
  transform: rotate(-18deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 15;
  pointer-events: none;
  filter: drop-shadow(2px 5px 7px rgba(0, 0, 0, 0.4));
}
.pencil-eraser { width: 100%; height: 22px; flex: 0 0 auto; background: linear-gradient(90deg, #d98a86, #f0a9a4); border-radius: 6px 6px 2px 2px; }
.pencil-ferrule { width: 100%; height: 12px; flex: 0 0 auto; background: linear-gradient(90deg, #a8a8a0, #f0eee2 45%, #a8a8a0); }
.pencil-shaft { width: 100%; flex: 1 1 auto; background: linear-gradient(90deg, #c98a28 0%, #f3bd53 22%, #f3bd53 78%, #c98a28 100%); }
.pencil-tip {
  position: relative;
  width: 100%;
  height: 24px;
  flex: 0 0 auto;
  background: linear-gradient(90deg, #c98a28 0%, #f3bd53 50%, #c98a28 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.pencil-tip::after {
  content: "";
  position: absolute;
  bottom: 0; left: 38%;
  width: 24%; height: 40%;
  background: #3a3630;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.binder-clip {
  position: absolute;
  right: -6px;
  top: 12%;
  width: 20px;
  height: 46px;
  background: linear-gradient(90deg, #8a6a2a, #d9b055 40%, #f0d896 55%, #b9924a 100%);
  border-radius: 4px;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.4);
  z-index: 16;
}
.clip-loop {
  position: absolute;
  top: 50%;
  right: -9px;
  width: 18px; height: 24px;
  transform: translateY(-50%);
  border: 3px solid #c9a355;
  border-radius: 50%;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.page-left {
  flex: 1 1 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--card-bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(150, 150, 90, 0.09) 27px 28px);
  border-radius: 18px 6px 6px 18px;
  box-shadow: var(--shadow-lifted);
  padding: 40px 26px;
  overflow-y: auto;
}

.page-left-sticky {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.spine {
  position: relative;
  flex: 0 0 20px;
  background: linear-gradient(
    90deg,
    rgba(38, 42, 28, 0.1) 0%,
    rgba(38, 42, 28, 0.22) 40%,
    rgba(38, 42, 28, 0.28) 50%,
    rgba(38, 42, 28, 0.22) 60%,
    rgba(38, 42, 28, 0.1) 100%
  );
}
.spine::before {
  content: "";
  position: absolute;
  inset: 6% 0;
  background-image: radial-gradient(circle, transparent 0 2px, rgba(18, 21, 13, 0.6) 2px 4px, transparent 4px 100%);
  background-size: 100% 26px;
  background-repeat: repeat-y;
  background-position: center top;
}

.page-right {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  background: var(--card-bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(150, 150, 90, 0.09) 27px 28px);
  border-radius: 6px 18px 18px 6px;
  box-shadow: var(--shadow-lifted);
  overflow-y: auto;
}

.page-right-inner {
  padding: 34px 30px 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 720px;
  margin: 0 auto;
}

.logo-frame-md {
  display: block;
  position: relative;
  width: 136px; height: 136px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lifted), 0 0 0 4px #fff, 0 0 0 5px var(--border);
  transition: transform 0.15s ease;
}
.logo-frame-md:active { transform: scale(0.95); }
.logo-zoom {
  position: absolute;
  width: 326%;
  height: 326%;
  top: -101%;
  left: -113%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}

.page-left h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: 0.05em; margin: 18px 0 0; }
.page-left .tagline { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin-top: 6px; }

.toc { margin: 28px 0; text-align: left; width: 100%; }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 8px 6px;
  margin: 0 -6px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--card-bg);
  border: none;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
  text-align: left;
}
.toc-item:last-child { border-bottom: none; }
.toc-item.active { font-weight: 700; background: var(--track-bg); border-bottom-color: transparent; }
.toc-dot {
  width: 22px;
  height: 24px;
  border-radius: 3px 9px 9px 3px;
  background: var(--dot, var(--accent));
  flex: 0 0 auto;
  box-shadow: 1px 2px 4px rgba(38, 42, 28, 0.4), inset -2px 0 3px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.toc-item.active .toc-dot { box-shadow: 0 0 0 2px rgba(92, 107, 63, 0.35), 1px 2px 4px rgba(38, 42, 28, 0.4), inset -2px 0 3px rgba(0, 0, 0, 0.15); }

.panel-dashboard { width: 100%; }

.page-left-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; margin-top: 20px; }
.page-left-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 1px 2px rgba(38, 42, 28, 0.06);
  transition: box-shadow 0.15s ease;
}
.page-left-links a:hover { box-shadow: 0 3px 8px -2px rgba(38, 42, 28, 0.2); }

.page-left .link-btn { margin-top: auto; padding-top: 22px; }

@media (max-width: 900px) {
  .book-spread { flex-direction: column; height: auto; padding: 16px; border-radius: 18px; }
  .pencil, .binder-clip, .bookmark { display: none; }

  /* Drop page-left's own box so its children (sticky header, dashboard, links) become
     direct flex children of .book-spread — that's what lets the sticky header span
     the whole scroll, not just page-left's slice of it. */
  .page-left { display: contents; }

  .logo-frame-md { width: 96px; height: 96px; display: block; margin: 0 auto; }

  .spine { display: none; }
  .page-right { overflow: visible; border-radius: 16px; }
  .page-right-inner { padding: 24px 18px 40px; max-width: none; }

  /* Logo + title + tagline + TOC pin together as one static header, instead of the
     logo scrolling away first while only the TOC stayed put. */
  .page-left-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0 -16px 22px;
    padding: 14px 18px 10px;
    background: var(--card-bg);
    background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(150, 150, 90, 0.09) 27px 28px);
    box-shadow: var(--shadow-soft);
    border-radius: 0 0 16px 16px;
  }

  .toc { margin: 14px 0 0; }

  .page-left .link-btn { align-self: center; }

  .install-btn { display: block; }
}

.install-btn {
  display: none;
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(46, 54, 32, 0.5);
}
.install-btn:active { transform: translateY(1px); }

.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 14, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.install-modal-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lifted);
}
.install-step {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.install-step b { flex: 0 0 auto; color: var(--accent); }

.panel-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 4px 16px 16px 16px;
  padding: 26px 22px 22px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.panel-card::before {
  content: attr(data-label);
  position: absolute;
  top: -13px;
  left: 22px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--tab-color, var(--accent));
  padding: 5px 14px 6px;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 4px 10px -4px rgba(38, 42, 28, 0.45);
  white-space: nowrap;
}

.panel-card:hover { box-shadow: var(--shadow-lifted); transform: translateY(-2px); }

.panel-scroll { overflow-y: auto; max-height: 340px; }

.panel-dashboard { --tab-color: var(--tab-dashboard); }
.panel-checkin { --tab-color: var(--tab-checkin); }
.panel-goals { --tab-color: var(--tab-goals); }
.panel-insights { --tab-color: var(--tab-insights); }
.panel-calendar { --tab-color: var(--tab-calendar); }
.panel-capsules { --tab-color: var(--tab-capsules); }
.panel-basis { --tab-color: var(--tab-basis); }

/* ---------- shared widgets ---------- */

.streak-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(46, 54, 32, 0.68), rgba(20, 24, 14, 0.88)),
    url("assets/forest-dark.jpg") center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 32px 18px 28px;
  border-radius: 4px 16px 16px 16px;
  margin-bottom: 14px;
  box-shadow: 0 16px 34px -14px rgba(38, 42, 28, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.streak-card::before {
  content: "";
  position: absolute;
  top: -60%; left: -20%;
  width: 140%; height: 140%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 55%);
  pointer-events: none;
}

.streak-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 22px 22px 0;
  border-color: transparent rgba(255, 255, 255, 0.28) transparent transparent;
  filter: drop-shadow(-1px 1px 1px rgba(38, 42, 28, 0.25));
}

.streak-number { font-family: var(--font-display); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: 0; position: relative; }
.streak-label { font-size: 13px; color: rgba(255, 255, 255, 0.9); margin-top: 6px; position: relative; }
.streak-sub { font-size: 11px; color: rgba(255, 255, 255, 0.74); margin-top: 10px; position: relative; }

.engagement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg);
  border-radius: 12px;
}
.engagement-icon { font-size: 26px; }
.engagement-text { font-size: 13px; color: var(--muted); }
.engagement-text b { color: var(--text); }

.mood-avg-row { display: flex; gap: 8px; margin-bottom: 12px; }
.mood-avg-item {
  flex: 1;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 4px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(38, 42, 28, 0.07);
}
.mood-avg-num { font-size: 19px; font-weight: 800; color: var(--accent); }
.mood-avg-caption { font-size: 11px; color: var(--muted); margin-top: 2px; }

.win-row, .goal-row, .entry-row { padding: 10px 0; border-bottom: 1px solid var(--track-bg); font-size: 14px; }
.win-row:last-child, .goal-row:last-child, .entry-row:last-child { border-bottom: none; }
.entry-date, .win-date { font-size: 11px; color: var(--muted); margin-bottom: 3px; }

.goal-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.progress-track { background: var(--track-bg); border-radius: 6px; height: 8px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); height: 100%; border-radius: 6px; }
.goal-progress-row { display: flex; align-items: center; justify-content: space-between; }
.goal-progress-caption { font-size: 12px; color: var(--muted); }
.goal-step-btn { background: var(--track-bg); border: none; border-radius: 8px; width: 28px; height: 28px; font-size: 15px; font-weight: 700; color: var(--accent); }

.goal-add-row { display: flex; gap: 8px; }
.goal-add-row input { flex: 1; }

.mood-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.mood-btn {
  background: var(--bg);
  border: none;
  border-radius: 12px;
  padding: 13px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  box-shadow: inset 0 1px 3px rgba(38, 42, 28, 0.07);
  transition: transform 0.1s ease;
}
.mood-btn.selected { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 14px -6px rgba(46, 54, 32, 0.6); transform: translateY(-1px); }

.tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag-toggle { background: var(--bg); border: none; border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--text); box-shadow: inset 0 1px 2px rgba(38, 42, 28, 0.06); }
.tag-toggle.selected { background: var(--accent); color: #fff; box-shadow: none; }

.insight-row { padding: 11px 0; border-bottom: 1px solid var(--track-bg); font-size: 13px; line-height: 1.55; }
.insight-row:last-child { border-bottom: none; }
.insight-diff { font-weight: 700; color: var(--accent); }
.insight-diff.negative { color: var(--danger); }
.insight-tag { font-weight: 600; }

.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-nav-btn { background: var(--bg); border: none; border-radius: 8px; width: 32px; height: 32px; font-size: 16px; font-weight: 700; color: var(--accent); cursor: pointer; }
.calendar-month-label { font-weight: 700; font-size: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.calendar-weekday { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding-bottom: 4px; }
.calendar-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  color: var(--text);
}
.calendar-cell.empty { background: transparent; cursor: default; }
.calendar-cell.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.calendar-cell.selected { background: var(--accent); color: #fff; }
.calendar-dots { display: flex; gap: 2px; }
.calendar-dot { width: 4px; height: 4px; border-radius: 50%; }
.calendar-day-detail { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; }
.calendar-day-detail .cdd-line { padding: 3px 0; }

.item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--track-bg); font-size: 14px; }
.item-row:last-child { border-bottom: none; }
.item-delete { background: none; border: none; color: var(--danger); font-size: 18px; line-height: 1; cursor: pointer; flex: 0 0 auto; padding: 0 4px; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--track-bg);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
#screen-loading .spinner { border-color: rgba(255, 255, 255, 0.25); border-top-color: #E8E2C0; }
@keyframes spin { to { transform: rotate(360deg); } }
