/* ==========================================================================
   2 Month Hiatus Vision Board
   One stylesheet for every page. Each page sets its own accent colours
   through <body data-page="...">.
   ========================================================================== */

:root {
  --bg: #09090d;
  --fg: #f5f2ea;
  --muted: rgba(245, 242, 234, 0.64);
  --faint: rgba(245, 242, 234, 0.4);
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.035);
  --card-hi: rgba(255, 255, 255, 0.07);
  --accent: #f5d27a;
  --accent-2: #c084fc;
  --ink: #0b0b10;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 22px;
}

/* Page accents (kept close to the original colour per page) */
body[data-page="board"] { --accent: #e879f9; --accent-2: #818cf8; }
body[data-page="rules"] { --accent: #6ae872; --accent-2: #22d3ee; }
body[data-page="resources"] { --accent: #f7d56e; --accent-2: #fb923c; }
body[data-page="pledge"] { --accent: #ff9f6b; --accent-2: #f472b6; }
body[data-page="goals"] { --accent: #8ab4ff; --accent-2: #a78bfa; }
body[data-page="hardships"] { --accent: #ff6b81; --accent-2: #f59e0b; }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--ink); }

/* ---------- Animated aurora background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg::before,
.bg::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  animation: drift 24s ease-in-out infinite alternate;
}
.bg::before { background: var(--accent); top: -25vmax; left: -15vmax; }
.bg::after { background: var(--accent-2); bottom: -30vmax; right: -15vmax; animation-delay: -12s; }

@keyframes drift {
  to { transform: translate(12vmax, 10vmax) scale(1.2); }
}

/* ---------- Header + nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(9, 9, 13, 0.6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  transition: transform 0.3s;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.nav {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--fg); background: var(--card-hi); }
.nav a.active { color: var(--ink); background: var(--accent); font-weight: 500; }

kbd {
  font: 500 11px/1 var(--sans);
  padding: 3px 5px;
  border: 1px solid currentColor;
  border-radius: 5px;
  opacity: 0.6;
}

.day-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: border-color 0.2s;
}
.day-chip:hover { border-color: var(--accent); }
.day-chip b { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; }
  .day-chip { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav kbd { display: none; }
}
@media (max-width: 420px) {
  .brand-text { display: none; }
}

/* ---------- Layout ---------- */
main {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 7vw, 88px) clamp(16px, 4vw, 40px) 64px;
}

.hero {
  text-align: center;
  padding: 2vh 0 clamp(40px, 8vh, 80px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.quote {
  max-width: 17ch;
  margin: 0 auto;
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(36px, 6.4vw, 78px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.title-xl {
  margin: 0;
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(60px, 13vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.quote em,
.title-xl em,
.quote-preview em {
  font-style: italic;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

.cite {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.cite::before { content: "— "; }
.cite:empty { display: none; }

.lede {
  max-width: 46ch;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 19px);
}

/* ---------- Panels ---------- */
.panel {
  position: relative;
  margin-bottom: 24px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(6px);
}
.panel h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.panel .sub { margin: 0 0 26px; color: var(--muted); }

.step {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.split .panel { margin-bottom: 0; }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- Form controls ---------- */
input[type="text"],
input[type="url"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 48px; }
select option { background: #15151c; }
input::placeholder,
textarea::placeholder { color: var(--faint); }
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font: 600 15px var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -12px var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--accent); }
.btn:disabled { cursor: default; transform: none; }

/* ---------- Editable lists ---------- */
.add-form {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)) auto;
  align-items: start;
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .add-form { grid-template-columns: 1fr; }
}

.items {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: n;
}
.item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s, opacity 0.22s, transform 0.22s;
}
.item:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: rgba(255, 255, 255, 0.04); }
.item.new { animation: pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.item.leaving { opacity: 0; transform: translateX(16px); }

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.numbered .item::before {
  counter-increment: n;
  content: counter(n, decimal-leading-zero);
  min-width: 2ch;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--accent);
}

.item-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item-title { font-weight: 500; white-space: pre-line; }
.item-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item.done .item-title { color: var(--faint); text-decoration: line-through; }
a.item-title:hover { color: var(--accent); }

.meta { margin-top: 2px; font-size: 13px; color: var(--faint); }
.meta.overdue { color: #ff8a8a; }
.lesson {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  white-space: pre-line;
}

.tag {
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.del {
  margin-left: auto;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.2;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}
.item:hover .del,
.del:focus-visible { opacity: 1; }
.del:hover { background: var(--card-hi); color: var(--fg); }

.check {
  appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  border: 1.5px solid var(--faint);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.check:hover { border-color: var(--accent); }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: translate(0, -1px) rotate(45deg);
}

.empty {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--faint);
  text-align: center;
}

/* ---------- Progress ---------- */
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--muted);
}
.progress-head b { font-family: var(--serif); font-size: 28px; font-weight: 450; color: var(--fg); }
.progress {
  height: 10px;
  margin: 10px 0 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.progress > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Home: tracker ring ---------- */
.tracker {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 40px);
}
@media (max-width: 520px) {
  .tracker { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

.ring { position: relative; width: 180px; height: 180px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: rgba(255, 255, 255, 0.07); }
.ring .bar { stroke: url(#ring-grad); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring-big { font-family: var(--serif); font-size: 56px; line-height: 1; }
.ring-small { margin-top: 4px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

.stats-row { display: flex; flex-wrap: wrap; gap: 28px; margin: 18px 0 22px; }
@media (max-width: 520px) { .stats-row { justify-content: center; } }
.stat-num { font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.stat-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

.start-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.start-field input { width: auto; padding: 8px 12px; font-size: 14px; }
@media (max-width: 520px) { .start-field { justify-content: center; } }

/* ---------- Home: quote of the day ---------- */
.qotd { display: flex; flex-direction: column; }
.qotd blockquote {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.8vw, 30px);
  line-height: 1.25;
  text-wrap: balance;
}
.qotd .cite { margin: 0 0 24px; }
.qotd .btn { align-self: flex-start; margin-top: auto; }
.swap { animation: swap 0.5s ease both; }
@keyframes swap {
  from { opacity: 0; transform: translateY(8px); filter: blur(4px); }
}

/* ---------- Home: section cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
}
@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s, border-color 0.3s;
}
.card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  z-index: -1;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--c);
  filter: blur(50px);
  opacity: 0.22;
  transition: opacity 0.3s, transform 0.3s;
}
.card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.card:hover::after { opacity: 0.5; transform: scale(1.2); }
.card .k { font-size: 12px; color: var(--faint); }
.card .name { font-family: var(--serif); font-size: 25px; line-height: 1.15; }
.card .desc { font-size: 14px; color: var(--muted); }
.card .stat { margin-top: auto; padding-top: 14px; font-size: 14px; color: var(--muted); }
.card .stat b { color: var(--c); font-weight: 600; }
.card .arrow { position: absolute; top: 20px; right: 20px; color: var(--faint); transition: transform 0.3s, color 0.3s; }
.card:hover .arrow { transform: translate(3px, -3px); color: var(--c); }

/* ---------- Morning pledge ---------- */
.gratitude { display: grid; gap: 10px; counter-reset: g; }
.gratitude label { display: flex; align-items: center; gap: 14px; }
.gratitude label::before {
  counter-increment: g;
  content: counter(g);
  width: 1.2em;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--accent);
}
.save-state { min-height: 1.6em; margin: 12px 0 0; font-size: 13px; color: var(--faint); }

.history { margin-top: 20px; color: var(--muted); font-size: 14px; }
.history summary { cursor: pointer; color: var(--faint); }
.history summary:hover { color: var(--fg); }
.history ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.history li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.history li b { display: block; margin-bottom: 2px; color: var(--accent); font-weight: 500; }

.pledge-text {
  margin: 22px 0 30px;
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.5;
}
.pledge-text span {
  display: block;
  margin-bottom: 0.5em;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s, transform 0.9s;
}
.reveal.in .pledge-text span { opacity: 1; transform: none; }
.pledge-text span:nth-child(2) { transition-delay: 0.5s; }
.pledge-text span:nth-child(3) { transition-delay: 1s; }
.pledge-text span:nth-child(4) { transition-delay: 1.5s; }

.pledge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.streak { color: var(--muted); font-size: 14px; }
.streak b { color: var(--accent); font-family: var(--serif); font-size: 22px; font-weight: 450; }

.visualize { text-align: center; }
.visualize .sub { margin-inline: auto; max-width: 44ch; }
.orb-wrap { display: grid; place-items: center; height: 260px; }
.orb {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 42%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 90px -10px var(--accent);
  color: var(--ink);
  font-weight: 600;
  transform: scale(0.55);
  transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
}
.orb.inhale { transform: scale(1); box-shadow: 0 0 140px 0 var(--accent); }
.orb-label { transform: scale(1.4); transition: transform 4s ease-in-out; }
.orb.inhale .orb-label { transform: scale(1); }
.vis-left { margin: 6px 0 20px; font-family: var(--serif); font-size: 22px; color: var(--muted); }

/* ---------- Footer, toast, confetti ---------- */
.site-footer {
  padding: 0 16px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}
@media (hover: none) { .site-footer { display: none; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Daily check-in ---------- */
.checkin-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.checkin-head h2 { margin-bottom: 4px; }
.checkin-head .sub { margin: 0; }
.today-list { display: flex; flex-wrap: wrap; gap: 8px; }
.today-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
.today-pill:hover { border-color: var(--accent); color: var(--fg); }
.today-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.today-pill.ok { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.today-pill.ok .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.grid60 { display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; }
@media (max-width: 640px) {
  .grid60 { grid-template-columns: repeat(10, 1fr); }
}
.cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  color: var(--faint);
  transition: transform 0.2s;
}
.cell:hover { transform: scale(1.12); }
.cell.s1 { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--fg); }
.cell.s2 { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--ink); font-weight: 600; }
.cell.today { border-color: var(--fg); }
.cell.future { opacity: 0.35; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .cell { width: 14px; border-radius: 4px; }

/* ---------- Rule check-off + small buttons ---------- */
.item.kept {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.mini {
  margin-top: 10px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 500 12px var(--sans);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.mini:hover { border-color: var(--accent); color: var(--fg); }
.mini:disabled { opacity: 0.6; cursor: default; border-color: var(--line); color: var(--muted); }

/* ---------- Picture board ---------- */
body.dragging main { outline: 2px dashed var(--accent); outline-offset: -10px; border-radius: var(--radius); }
.board-meta { margin: -12px 0 18px; font-size: 13px; color: var(--faint); text-align: center; }

.board { columns: 3 260px; column-gap: 16px; }
.tile {
  position: relative;
  margin: 0 0 16px;
  break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow: hidden;
  cursor: zoom-in;
  animation: pop 0.4s both;
}
.tile img { display: block; width: 100%; height: auto; transition: transform 0.6s; }
.tile:hover img { transform: scale(1.03); }
.tile.dragging { opacity: 0.35; }
.tile.drag-over { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 32px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}
.tile .cap input {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-family: var(--serif);
  font-size: 18px;
  color: #fff;
}
.tile .cap input:focus { border: 0; box-shadow: none; }
.tile .cap input::placeholder { color: rgba(255, 255, 255, 0.5); }
.tile .x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(6px);
  transition: opacity 0.2s;
}
.tile:hover .x,
.tile .x:focus-visible { opacity: 1; }
@media (hover: none) {
  .tile .x { opacity: 1; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(16px, 5vw, 64px);
  background: rgba(5, 5, 8, 0.94);
  backdrop-filter: blur(10px);
  animation: fade 0.25s;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { max-width: 100%; max-height: 76vh; border-radius: 14px; box-shadow: 0 30px 80px -20px #000; }
.lightbox figcaption { margin-top: 18px; font-family: var(--serif); font-size: clamp(20px, 3vw, 30px); }
.lb-btn {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.lb-btn:hover { border-color: var(--accent); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-close { top: max(20px, env(safe-area-inset-top)); right: 20px; transform: none; }
@keyframes fade {
  from { opacity: 0; }
}

/* ---------- Pledge voice ---------- */
.pledge-text span.speaking { color: var(--accent); }
.voice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.voice-row audio { height: 40px; max-width: 100%; }
.rec-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.rec-state[hidden] { display: none; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; animation: blink 1s infinite; }
@keyframes blink {
  50% { opacity: 0.2; }
}

/* ---------- Money tracker ---------- */
.money-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.money-big { font-family: var(--serif); font-size: clamp(40px, 6vw, 64px); line-height: 1; }
.money-big small { font-size: 0.38em; color: var(--faint); }
.money-facts { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 8px; }
.money-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin-top: 8px; }
.money-form label { display: grid; gap: 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 640px) {
  .money-form { grid-template-columns: 1fr; }
}
.money-log { margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.money-log li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.up { color: #6ae872; }
.down { color: #ff8a8a; }

/* ---------- Review ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.stat-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.02); }
.stat-card .stat-num { color: var(--accent); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.two-col .panel { margin-bottom: 0; }
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
}
.plain-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plain-list li { display: flex; gap: 10px; }
.plain-list li::before { content: "✓"; color: var(--accent); }
.plain-list.open li::before { content: "○"; color: var(--faint); }
.list-label { margin: 22px 0 10px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.bars { display: grid; gap: 16px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 14px; }
.bar-label span:last-child { color: var(--faint); white-space: nowrap; }
.bars .progress { margin: 0; height: 8px; }
.lessons { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.lessons blockquote { margin: 0; font-family: var(--serif); font-size: clamp(19px, 2.2vw, 23px); line-height: 1.4; }
.lessons p { margin: 6px 0 0; font-size: 14px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.03); font-size: 14px; }
.reflect { display: grid; gap: 22px; }
.reflect label { display: grid; gap: 10px; font-family: var(--serif); font-size: 21px; }
.reflect textarea { min-height: 110px; font-family: var(--sans); }
.muted-note { margin: 0; color: var(--faint); }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent));
}
.banner h2 { margin: 0; }
.banner p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Install + backup ---------- */
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); }
@media (max-width: 760px) {
  .app-grid { grid-template-columns: 1fr; }
}
.app-grid .sub { margin-bottom: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
label.btn { cursor: pointer; }

/* ---------- Installed app: respect the notch / home bar ---------- */
.site-header { padding-top: max(14px, env(safe-area-inset-top)); }
.toast { bottom: max(28px, env(safe-area-inset-bottom)); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .pledge-text span { opacity: 1; transform: none; }
}

/* Review sections: room between heading and content */
#review-goals,
#review-rules,
#review-lessons,
#review-gratitude { margin-top: 20px; }
.money-facts { margin-bottom: 20px; }

/* ---------- Goals: money vs. steps ---------- */
.goal-form {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.goal-form .btn { justify-self: start; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.seg legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-size: 14px; color: var(--muted); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.seg label:hover span { border-color: var(--accent); }
.seg input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--fg); }
.seg input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.goal-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.field { display: grid; gap: 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.goal-preview { margin: 0; font-size: 14px; color: var(--accent); }

.item.goal .item-title .tag { margin-left: 6px; vertical-align: 2px; }
.goal-detail { margin-top: 12px; }
.goal-nums { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.goal-nums b { font-family: var(--serif); font-size: 22px; font-weight: 450; color: var(--fg); }
.progress.slim { height: 6px; margin: 8px 0 12px; }
.goal-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.goal-facts .stat-num { font-size: 24px; }
.goal-facts .behind .stat-num { color: #ff8a8a; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.hint b { font-weight: 500; color: var(--fg); }
.hint.overdue { color: #ff8a8a; }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1 1 180px; width: auto; padding: 9px 12px; font-size: 14px; }
.inline-form .mini,
.goal-ask .mini,
.edit-form .mini { margin-top: 0; }
.goal-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.edit-form { display: grid; gap: 10px; }

.steps { display: grid; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps label { display: flex; flex: 1; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 15px; cursor: pointer; }
.steps .check { width: 18px; height: 18px; border-radius: 6px; }
.steps .check:checked::after { width: 5px; height: 9px; }
.steps li.done span { color: var(--faint); text-decoration: line-through; }
.step-del { padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--faint); font-size: 18px; cursor: pointer; }
.step-del:hover { background: var(--card-hi); color: var(--fg); }
.pay-form { align-items: end; margin-top: 16px; }
.pay-form .field { flex: 1 1 200px; }
.pay-form .field input { width: 100%; }
.pay-form .btn { padding: 10px 18px; font-size: 14px; }
.pay-history { margin-top: 14px; }
.pay-history ul { gap: 6px; }
.pay-history li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.pay-history li span { flex: 1; }
.pay-history li b { display: inline; margin: 0; color: var(--fg); }

/* ---------- Admin ---------- */
.admin-link {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
.admin-link:hover,
.admin-link.active { border-color: var(--accent); color: var(--accent); }
.quote.long { max-width: 24ch; font-size: clamp(28px, 4.4vw, 52px); line-height: 1.15; }
.quote-preview { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.35; }

/* ---------- Board: collage ---------- */

.collage.polaroid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 0 30px;
}
.collage .pol {
  width: clamp(140px, 22%, 220px);
  margin: 6px -6px;
  padding: 10px 10px 0;
  border-radius: 4px;
  background: #f5f2ea;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8);
  transform: translateY(var(--y)) rotate(var(--r));
  cursor: zoom-in;
  transition: transform 0.35s, box-shadow 0.35s;
  animation: pop 0.5s both;
}
.collage .pol:hover { z-index: 2; transform: translateY(var(--y)) rotate(0) scale(1.08); box-shadow: 0 30px 60px -16px #000; }
.collage .pol img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.collage .pol figcaption {
  min-height: 2.6em;
  padding: 6px 2px 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.25;
  color: #1a1a22;
  text-align: center;
}
@media (max-width: 640px) {
  .collage .pol { width: 46%; margin: 6px -4px; }
}

/* ---------- Admin: board pictures ---------- */
.admin-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.admin-pic { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--card); }
.admin-pic img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.admin-pic figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-pic .x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.admin-pic .x:hover { background: #ff4d6a; }

/* ---------- Goals: compact add form ---------- */
.goal-add { margin-bottom: 20px; }
.goal-add-row { display: flex; gap: 10px; }
.goal-add-row input { flex: 1; min-width: 0; }
.goal-details { display: grid; gap: 14px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.02); animation: pop 0.3s both; }
.goal-details .btn-row .btn { padding: 10px 18px; font-size: 14px; }

/* ---------- Goals: net worth chart ---------- */
.money-chart-note { margin-top: 20px; }
.money-chart-wrap { position: relative; margin-top: 24px; }
.money-chart-wrap .list-label { margin-top: 0; }
.money-chart svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.money-chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-axis text { fill: var(--faint); font: 11px var(--sans); }
.chart-area { fill: var(--accent); opacity: 0.1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart-end { fill: var(--fg); font: 600 12px var(--sans); }
.chart-cross line { stroke: var(--faint); stroke-width: 1; }
.chart-tip {
  position: absolute;
  z-index: 3;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #16161d;
  box-shadow: 0 12px 30px -10px #000;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
}
.chart-tip b { display: block; font-size: 15px; font-weight: 600; color: var(--fg); }
.chart-tip span { color: var(--muted); }

/* ---------- Admin: goals ---------- */
.admin-goal-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.admin-goal-fields.money { grid-template-columns: 2fr 1fr 1fr; }
.admin-goal-fields input { padding: 9px 12px; font-size: 14px; }
.admin-goal .meta { margin-top: 8px; }
.admin-goal.done .meta { color: var(--accent); }
@media (max-width: 640px) {
  .admin-goal-fields,
  .admin-goal-fields.money { grid-template-columns: 1fr; }
}

.claude-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.claude-row .meta { margin: 0; }
.claude-row .btn:disabled { opacity: 0.45; }

/* ---------- Next section card ---------- */
.next-link {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: fit-content;
  min-width: 220px;
  margin: 28px auto 0;
  padding: 12px 20px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, transparent), color-mix(in srgb, var(--c) 4%, transparent));
  text-align: center;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.next-link:hover { border-color: var(--c); transform: translateY(-2px); box-shadow: 0 18px 40px -20px var(--c); }
.next-k { font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c); }
.next-name { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.next-name span { display: inline-block; color: var(--c); transition: transform 0.25s; }
.next-link:hover .next-name span { transform: translateX(6px); }
.next-desc { color: var(--muted); font-size: 13px; }
.next-link:not(.done-link) .next-desc { display: none; }
button.next-link { color: var(--fg); font: inherit; cursor: pointer; }
.done-link { --c: var(--accent); }
@media (max-width: 520px) {
  .stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; text-align: center; }
}

/* ---------- Rules: day by day ---------- */
.day-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.day-nav .mini { margin: 0; }
.day-prev { grid-column: 1; justify-self: start; }
.day-next { grid-column: 3; justify-self: end; }
.day-nav-label { grid-column: 2; display: grid; text-align: center; }
.day-nav-label b { font-family: var(--serif); font-size: 20px; font-weight: 450; }
.day-nav-label span { font-size: 12px; color: var(--faint); }
.past-note { margin: -6px 0 16px; text-align: center; }
.past .add-form,
.past .del { display: none; }

/* ---------- Rules: streaks, last 7 days, editing ---------- */
.week-dots { display: flex; gap: 7px; margin-top: 10px; }
.wd { display: grid; justify-items: center; gap: 3px; }
.wd i { width: 12px; height: 12px; border: 1.5px solid var(--faint); border-radius: 50%; }
.wd.on i { border-color: var(--accent); background: var(--accent); }
.wd.now i { border-color: var(--accent); border-style: dashed; }
.wd.na i { border-style: dashed; opacity: 0.3; }
.wd small { font-size: 10px; line-height: 1; color: var(--faint); }
.rule-edit { padding: 8px 12px; font-size: 15px; }
.past [data-action="edit"] { display: none; }

/* ---------- Goals: net worth milestones ---------- */
.milestones { display: flex; flex-wrap: wrap; gap: 6px; margin: -16px 0 8px; }
.ms { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--faint); }
.ms.hit { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--fg); }
.ms.next { border-color: var(--accent); border-style: dashed; color: var(--muted); }
.money-next { margin: 0 0 22px; }

/* ---------- Goals: pictures ---------- */
.goal-pic { float: right; width: 64px; height: 64px; margin: 0 0 8px 12px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: none; cursor: pointer; }
.goal-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.goal .goal-detail { clear: both; }
.goal-pic:hover img { transform: scale(1.03); }
.item.goal.done .goal-pic img { filter: saturate(1.15); }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 5, 8, 0.86);
  backdrop-filter: blur(10px);
  animation: fade 0.25s;
}
.sheet[hidden] { display: none; }
.sheet-card { width: min(560px, 100%); max-height: 85vh; overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: #121219; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head .lb-btn { position: static; flex: none; width: 40px; height: 40px; font-size: 20px; transform: none; }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pic-opt { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: none; cursor: pointer; }
.pic-opt img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.pic-opt:hover,
.pic-opt:focus-visible,
.pic-opt.on { border-color: var(--accent); }

.win-card { display: grid; justify-items: center; gap: 10px; width: min(300px, 100%); text-align: center; animation: pop 0.5s both; }
.win-card img { width: 100%; aspect-ratio: 4 / 3; max-height: 26vh; object-fit: cover; border-radius: 20px; box-shadow: 0 30px 80px -20px var(--accent); }
.win-card .eyebrow { margin: 14px 0 0; }
.win-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 6vw, 44px); line-height: 1.1; }
.win-sub { margin: 0 0 8px; color: var(--muted); }
.stat-note { font-family: var(--sans); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Board: toolbar + empty state ---------- */
body[data-page="board"] .hero { padding-bottom: clamp(20px, 4vh, 36px); }
.board-tools { display: grid; justify-items: center; gap: 10px; margin-bottom: 18px; }
.board-tools .seg { flex-wrap: nowrap; justify-content: center; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.board-tools .seg::-webkit-scrollbar { display: none; }
.board-tools .seg span { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.board-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.board-actions .mini { margin: 0; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.board-actions .add-photos { border-color: var(--accent); background: var(--accent); color: var(--ink); font-weight: 600; cursor: pointer; }
.board-actions .add-photos:hover { color: var(--ink); filter: brightness(1.08); }
.board-actions .mini[aria-pressed="true"] { border-color: var(--accent); color: var(--fg); }
.board-meta { margin: 0 0 14px; }
.board-empty { display: grid; justify-items: center; gap: 16px; cursor: pointer; }

/* ---------- Board: scrapbook ---------- */
.collage.scrapbook { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 26px 18px; padding: 18px 0 30px; }
.collage .scrap {
  position: relative;
  width: var(--w);
  margin: 0;
  padding: 6px;
  background: #f5f2ea;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.85);
  transform: rotate(var(--r));
  cursor: zoom-in;
  transition: transform 0.35s;
  animation: pop 0.5s both;
}
.collage .scrap:hover { z-index: 2; transform: rotate(0) scale(1.05); }
.collage .scrap::before {
  content: "";
  position: absolute;
  top: -12px;
  left: var(--tx);
  width: 74px;
  height: 22px;
  background: rgba(240, 228, 190, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%) rotate(var(--t));
}
.collage .scrap img { display: block; width: 100%; height: auto; }
.collage .scrap figcaption {
  position: absolute;
  left: 50%;
  bottom: -14px;
  max-width: 90%;
  padding: 3px 10px;
  background: #1a1a22;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: #f5f2ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%) rotate(-2deg);
}
@media (max-width: 640px) {
  .collage .scrap { width: calc(var(--w) + 10%); }
}

/* ---------- Board: gallery wall ---------- */
.collage.gallery { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 22px; padding: 16px 0 26px; }
.collage .frame { width: var(--w); margin: 0; cursor: zoom-in; animation: pop 0.5s both; }
.frame-art {
  padding: 8%;
  border: 9px solid var(--f);
  background: #f3efe6;
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 0.35s;
}
.collage .frame:hover .frame-art { transform: translateY(-4px); }
.frame-art img { display: block; width: 100%; height: auto; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.collage .frame figcaption {
  width: fit-content;
  max-width: 100%;
  margin: 10px auto 0;
  padding: 4px 10px;
  border-radius: 2px;
  background: #f3efe6;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #2a2a30;
  text-align: center;
}
@media (max-width: 640px) {
  .collage .frame { width: calc(var(--w) + 12%); }
}

/* ---------- Board: film strip ---------- */
.collage.film {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 34px 10px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(245, 242, 234, 0.85) 10px 22px, transparent 22px 34px) left 0 top 10px / 100% 13px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(245, 242, 234, 0.85) 10px 22px, transparent 22px 34px) left 0 bottom 10px / 100% 13px no-repeat,
    #101013;
  background-attachment: local;
  scrollbar-width: none;
}
.collage.film::-webkit-scrollbar { display: none; }
.collage .film-frame { flex: 0 0 auto; width: clamp(230px, 42%, 380px); margin: 0 6px; scroll-snap-align: center; cursor: zoom-in; }
.collage .film-frame img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; filter: saturate(1.05) contrast(1.03); }
.collage .film-frame figcaption { margin-top: 8px; font: 12px/1.3 ui-monospace, Menlo, monospace; color: #f7b267; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collage .film-frame figcaption span { opacity: 0.75; }

/* ---------- Board: slideshow ---------- */
.show { position: fixed; inset: 0; z-index: 75; overflow: hidden; background: #000; cursor: pointer; }
.show[hidden] { display: none; }
.show img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.show img.kb { animation: kenburns 6.2s ease-out both; }
@keyframes kenburns {
  from { opacity: 0; transform: scale(1.02) translate(0, 0); }
  12% { opacity: 1; }
  to { opacity: 1; transform: scale(1.14) translate(var(--kx), var(--ky)); }
}
.show-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 80px 24px max(36px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  text-align: center;
  pointer-events: none;
}
.show-cap { margin: 0 0 6px; font-family: var(--serif); font-size: clamp(26px, 5vw, 44px); color: #fff; }
.show-cap:empty { display: none; }
.show-line { margin: 0; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.show-close { top: max(20px, env(safe-area-inset-top)); right: 20px; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .show img.kb { animation: none; }
}

/* ---------- Hardships: tags, how hard, patterns ---------- */
#hardships-list .add-form { grid-template-columns: 1fr 1fr; }
#hardships-list .add-form .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 640px) {
  #hardships-list .add-form { grid-template-columns: 1fr; }
}
.hard-dots { letter-spacing: 2px; color: var(--accent); }
.hardship-patterns { margin: -8px 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.hardship-patterns b,
.review-hardship-summary b { color: var(--fg); font-weight: 500; }
.review-hardship-summary { margin: 0 0 18px; }
.item-body .mini + .mini { margin-left: 6px; }

/* ---------- Admin: tabs ---------- */
.admin-hero { padding-bottom: 28px; }
.admin-hero .title-xl { font-size: clamp(48px, 10vw, 96px); }
.admin-hero .lede { margin-top: 16px; }
.admin-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 18px; }
.admin-tab {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.admin-tab:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }
.admin-tab.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.admin-tab:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.tab-icon { font-size: 18px; line-height: 1.2; color: var(--accent); }
.tab-name { font-weight: 600; font-size: 14px; }
.tab-note { font-size: 12px; color: var(--faint); }
.tab-note:empty { display: none; }
@media (max-width: 520px) {
  .admin-tabs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .admin-tab { justify-items: center; padding: 10px 4px; text-align: center; }
  .tab-name { font-size: 12px; }
  .tab-note { display: none; }
}
.admin-panel { animation: pop 0.3s both; }

/* ---------- Admin: Claude ---------- */
.admin-h3 { margin: 26px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.admin-panel .admin-h3 + .sub { margin-bottom: 12px; }
.tone-presets,
.preview-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tone-presets .mini,
.preview-switch .mini { margin: 0; }
.tone-presets .mini[aria-pressed="true"],
.preview-switch .mini[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--fg); }
.prompt-preview {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  font: 13px/1.55 var(--sans);
  color: var(--muted);
  white-space: pre-wrap;
}
.saved-note { margin-left: 8px; color: var(--muted); letter-spacing: 0.06em; text-transform: none; }
