/* GothMOM */
:root {
  --bg: #0b0a0c;
  --surface: #141217;
  --surface-2: #1b1820;
  --line: #2b2631;
  --bone: #ece4d6;
  --muted: #9d9488;
  --gold: #e8b45a;
  --violet: #a66bff;
  --danger: #d0645b;
  --on-accent: #111;
  --wax: #e9e0cf;
  --wax-shade: #d8ccb6;
  --wax-edge: transparent;
  --wick: #3d342c;
  --bat: #d7c9ff;
  --nav-bg: var(--bg);
  --font-display: "UnifrakturMaguntia";
  --font-body: "Atkinson Hyperlegible";
  --radius: 14px;
}

/* Themes live in public/themes/*.json and override the variables above (see README.md there). */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--bone); }
body {
  font: 400 17px/1.45 var(--font-body), "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gothic { font-family: var(--font-display), "UnifrakturMaguntia", var(--font-body), serif; font-weight: 400; letter-spacing: .01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.side { display: none; }
main { padding: 18px 16px 110px; max-width: 760px; width: 100%; margin: 0 auto; }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--nav-bg) 96%, transparent); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
.nav-btn {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0;
  color: var(--muted); font-size: 14px; border-radius: 10px;
}
.nav-btn .ico { font-size: 22px; line-height: 1; }
.nav-btn[aria-current="page"] { color: var(--gold); }
@media (min-width: 900px) {
  .app { grid-template-columns: 230px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh;
    padding: 24px 14px; border-right: 1px solid var(--line); background: var(--nav-bg);
  }
  .side .brand { font-size: 26px; padding: 0 10px 18px; line-height: 1.1; }
  .side .nav-btn { grid-template-columns: 28px 1fr; justify-items: start; align-items: center; font-size: 18px; padding: 10px 12px; }
  .side .nav-btn[aria-current="page"] { background: var(--surface); }
  .bottom { display: none; }
  main { padding: 32px 36px 60px; }
}

/* ---------- Header ---------- */
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 34px; line-height: 1; }
.head .date { color: var(--muted); font-size: 17px; margin-top: 4px; }
.head .spacer { flex: 1; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 20px; line-height: 1;
  background: var(--surface-2); border: 2px solid var(--gold); flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: 13px; border-width: 1.5px; }
.avatar.lg { width: 84px; height: 84px; font-size: 40px; border-width: 3px; }
.banner {
  background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); color: color-mix(in srgb, var(--violet) 45%, var(--bone));
  border-radius: 10px; padding: 8px 12px; font-size: 16px; margin-bottom: 14px;
}

/* ---------- Cards and rows ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 2px 8px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 24px; font-weight: 400; }
.section-title .when { color: var(--muted); font-size: 15px; }
.section-title .now { color: var(--gold); font-size: 14px; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 999px; padding: 0 8px; }

.row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 4px; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row .name { font-size: 19px; line-height: 1.25; }
.row .meta { color: var(--muted); font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.done .name { color: var(--muted); }
.room-ico { color: var(--gold); opacity: .85; }
.more { color: var(--muted); font-size: 22px; padding: 4px 8px; border-radius: 8px; }
.more:hover { color: var(--bone); background: var(--surface-2); }
.steps { grid-column: 2 / -1; display: grid; gap: 4px; margin: 2px 0 4px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 16px; text-align: left; padding: 2px 0; }
.step .box { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; display: grid; place-items: center; font-size: 12px; flex: none; }
.step.on { color: var(--bone); }
.step.on .box { border-color: var(--gold); background: var(--gold); color: var(--on-accent); }
.chip { font-size: 13px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.ess { border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold); }
.chip.post { border-color: color-mix(in srgb, var(--violet) 45%, transparent); color: color-mix(in srgb, var(--violet) 60%, var(--bone)); }
.counter { font-size: 15px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; }

/* ---------- Candle ---------- */
.candle { width: 40px; height: 48px; display: grid; place-items: end center; position: relative; border-radius: 10px; }
.candle svg { overflow: visible; }
.candle .flame { transform-origin: 50% 100%; opacity: 0; transition: opacity .25s; }
.candle.lit .flame { opacity: 1; animation: flicker 2.4s ease-in-out infinite; }
.candle .glow { opacity: 0; transition: opacity .3s; }
.candle.lit .glow { opacity: .55; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  25% { transform: scale(.94, 1.06) rotate(-2deg); }
  50% { transform: scale(1.04, .95) rotate(1.5deg); }
  75% { transform: scale(.97, 1.03) rotate(-1deg); }
}
.candle.sm { width: 26px; height: 32px; }
button.candle:disabled { cursor: default; }

.doses { display: flex; gap: 14px; flex-wrap: wrap; }
.dose { display: grid; justify-items: center; font-size: 13px; color: var(--muted); }
.dose .post { color: color-mix(in srgb, var(--violet) 60%, var(--bone)); }

.progress { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.progress .count { font-size: 17px; color: var(--muted); }
.progress .count b { color: var(--bone); font-weight: 600; }
.candle-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--muted); }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .2s, background .2s; }
.switch[aria-checked="true"] { background: color-mix(in srgb, var(--gold) 25%, transparent); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.switch[aria-checked="true"]::after { left: 20px; background: var(--gold); }

.upcoming .item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.upcoming .item:first-of-type { border-top: 0; }
.upcoming .due { color: var(--muted); font-size: 16px; white-space: nowrap; }

/* ---------- Forms ---------- */
label.f, .f { display: grid; gap: 6px; margin-bottom: 16px; font-size: 16px; color: var(--muted); }
.input {
  color: var(--bone); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; font-size: 18px;
}
.input:focus { border-color: var(--gold); outline: none; }
select.input { appearance: auto; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline .input { width: auto; flex: 1; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 16px; color: var(--muted); background: var(--surface-2); }
.seg button[aria-pressed="true"] { border-color: var(--gold); color: var(--bone); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.btn { border: 1px solid var(--gold); color: var(--on-accent); background: var(--gold); padding: 10px 18px; border-radius: 10px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(208,100,91,.5); }
.btn.small { padding: 6px 12px; font-size: 16px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.error { color: var(--danger); font-size: 16px; min-height: 1.2em; }
.list-edit { display: grid; gap: 6px; }
.list-edit .inline button { color: var(--muted); padding: 6px 10px; font-size: 20px; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; }
.swatch[aria-pressed="true"] { border-color: var(--bone); }
.emoji-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-pick button { font-size: 24px; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }

/* ---------- Login ---------- */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login h1 { font-size: 46px; text-align: center; margin: 0 0 6px; line-height: 1.05; }
.login .sub { text-align: center; color: var(--muted); margin-bottom: 24px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 16px; margin-bottom: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---------- Sheet, toast, bat ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; z-index: 40; }
.scrim.open { display: block; }
.sheet {
  position: fixed; left: 50%; bottom: 0; translate: -50% 100%; width: min(520px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); z-index: 41;
  visibility: hidden; transition: translate .25s ease, visibility 0s linear .25s;
  max-height: 85vh; overflow: auto;
}
.sheet.open { translate: -50% 0; visibility: visible; transition: translate .25s ease; }
.sheet h3 { margin: 0 0 6px; font-weight: 400; font-size: 24px; }
.sheet .opt { display: block; width: 100%; text-align: left; padding: 12px 10px; border-top: 1px solid var(--line); font-size: 19px; }
.toast {
  position: fixed; left: 50%; bottom: 96px; translate: -50% 0; max-width: calc(100% - 32px);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-size: 16px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; }
.bat { position: fixed; pointer-events: none; z-index: 60; width: 34px; height: 18px; animation: batfly 1.4s ease-out forwards; }
@keyframes batfly {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), -140px) scale(1); opacity: 0; }
}
.bat .wing { animation: flap .18s ease-in-out infinite alternate; transform-origin: 50% 60%; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }

/* ---------- Plans (calendar events) ---------- */
.event { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); align-items: start; }
.event:first-child { border-top: 0; }
.ev-time { color: var(--muted); font-size: 16px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.event .name { font-size: 19px; line-height: 1.25; }
.event .meta { color: var(--muted); font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Week ---------- */
.moon-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.scroll-x { overflow-x: auto; }
.week-grid { width: 100%; border-collapse: collapse; }
.week-grid th { font-weight: 500; color: var(--muted); font-size: 14px; padding: 4px 1px; text-align: center; line-height: 1.15; }
.week-grid th .dnum { font-size: 13px; opacity: .8; }
.week-grid th.today { color: var(--gold); }
.week-grid td { border-top: 1px solid var(--line); padding: 2px 1px; text-align: center; vertical-align: middle; }
.week-grid td.task { text-align: left; font-size: 16px; padding: 7px 6px 7px 2px; min-width: 120px; line-height: 1.2; }
.week-grid td.today { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.week-grid tr.sec td { color: var(--muted); font-size: 14px; letter-spacing: .04em; text-align: left; padding: 14px 2px 4px; border-top: 0; text-transform: uppercase; }
.week-grid .dash { color: var(--line); }
.week-grid .candle.sm { display: inline-grid; width: 24px; height: 30px; }
.week-grid .candle.future { opacity: .45; }
.week-grid .candle.overdue svg { filter: drop-shadow(0 0 3px var(--danger)); }
.week-grid td.target { text-align: left; padding-left: 6px; }
.target-candles { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 8px; }
.dots { display: inline-flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dots .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; color: var(--muted); font-size: 14px; padding-bottom: 4px; }
.cal .day {
  aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; align-content: space-between; padding: 5px; font-size: 16px; text-align: left; min-width: 0;
}
.cal .day.out { background: transparent; border-color: transparent; }
.cal .day.past { opacity: .55; }
.cal .day.today { border-color: var(--gold); }
.cal .day.sel { outline: 2px solid var(--violet); outline-offset: 1px; opacity: 1; }
.cal .dots { justify-content: flex-start; }
.cal .dot.task { background: transparent; border: 1.5px solid var(--gold); width: 7px; height: 7px; }
.cal .dot.task.done { background: var(--gold); }

/* ---------- Theme picker ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.theme-opt { border: 2px solid; border-radius: 12px; padding: 10px; text-align: left; font-size: 16px; display: grid; gap: 8px; }
.theme-opt[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--bone); }
.theme-swatches { display: flex; gap: 4px; }
.theme-swatches span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(128,128,128,.4); }

.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .candle.lit .flame { animation: none; }
  .bat { display: none; }
  .sheet { transition: none; }
}

/* ---------- Stage B2: one-offs, categories, task groups ---------- */
.chip.cat { border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); color: var(--bone); }
.tabs { margin: 0 0 12px; }
.tabs button { font-size: 18px; padding: 6px 18px; }
.cat-filter button { font-size: 15px; padding: 3px 11px; }
.section-title .chip { margin-left: 4px; }
.section-title .block-count { margin-left: auto; }
.card.block { border-left: 3px solid color-mix(in srgb, var(--gold) 55%, transparent); }
.group-card .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 15px; color: var(--muted); margin-top: 2px; align-items: center; }
.group-items { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 16px; }
.group-items li { color: var(--bone); }
.gitem { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface-2); }
.gitem button[data-act="remove-item"] { font-size: 22px; color: var(--muted); padding: 0 8px; }
.opt .chip { margin-left: 4px; }
.wgroup { font-size: 13px; white-space: nowrap; }

/* ---------- Stage C: notifications, reminders, clashes ---------- */
button.event { width: 100%; text-align: left; background: none; border-width: 1px 0 0; border-style: solid; border-color: var(--line); color: inherit; font: inherit; cursor: pointer; border-radius: 10px; }
button.event:hover { background: var(--surface-2); }
.ev-bell, .ev-watch { font-size: 13px; color: var(--gold); }
.rem-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.rem-chips:empty { display: none; }
.rem-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--bone); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); padding: 2px 4px 2px 10px; font-size: 15px; }
.rem-chip button { color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; background: none; border: 0; }
.rem-add { flex-wrap: wrap; }
.sheet { overflow-x: hidden; }
.card.clash { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.clash-title { color: var(--danger); font-weight: 600; margin-bottom: 4px; }
.clash-row { font-size: 16px; padding: 3px 0; }
.toggles { margin-top: 10px; display: grid; gap: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.row.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--gold) 22%, transparent); } 100% { background: transparent; } }

/* ---------- Stage D: texts editor ---------- */
.tx-list { padding-top: 4px; padding-bottom: 4px; }
.tx-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tx-row:last-child { border-bottom: 0; }
.tx-key { font-size: 13px; color: var(--muted); font-family: ui-monospace, monospace; margin-bottom: 4px; word-break: break-all; }
.tx-input { width: 100%; resize: vertical; min-height: 40px; font: inherit; line-height: 1.3; }
.tx-def { display: none; margin-top: 4px; font-size: 14px; align-items: center; gap: 8px; justify-content: space-between; }
.tx-row.changed .tx-def { display: flex; }
.tx-row.changed .tx-key::after { content: " ●"; color: var(--gold); }
input[type="range"] { accent-color: var(--gold); }

/* ---------- Checkbox styles (markers.js): parts shown when done / not done ---------- */
.candle .on { opacity: 0; transition: opacity .25s; }
.candle.lit .on { opacity: 1; }
.candle.lit .off { opacity: 0; }
.candle .flame.on { opacity: 0; }
.candle.lit .flame.on { opacity: 1; }

/* Checkbox style picker */
.marker-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-top: 4px; }
.mk-opt { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.1; }
.mk-opt[aria-pressed="true"] { border-color: var(--gold); color: var(--bone); background: color-mix(in srgb, var(--gold) 14%, var(--surface-2)); }
.mk-opt .candle { pointer-events: none; }
.mk-default { height: 32px; display: grid; place-items: center; font-size: 14px; color: var(--bone); }
.mk-name { min-height: 13px; }

/* Effects when something is ticked off */
.fx { position: fixed; pointer-events: none; z-index: 60; translate: -50% -50%; animation: fx-fly 1.1s ease-out forwards; font-weight: 700; }
.fx.spark { font-size: 13px; text-shadow: 0 0 6px currentColor; }
.fx.bubble { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; animation-duration: 1.2s; }
.fx.puff { width: 16px; height: 16px; border-radius: 50%; background: currentColor; opacity: .35; filter: blur(3px); animation-name: fx-puff; animation-duration: 1.4s; }
.fx.petal { width: 7px; height: 11px; border-radius: 60% 0; background: currentColor; animation-name: fx-fall; animation-duration: 1.4s; }
.fx.ring { width: 30px; height: 30px; border-radius: 50%; border: 2px solid currentColor; animation-name: fx-ring; animation-duration: .6s; }
.fx.rise { font: 700 16px/1 Georgia, serif; text-shadow: 0 0 8px currentColor; animation-name: fx-rise; animation-duration: 1.3s; }
.fx.rise.big { font-size: 22px; }
@keyframes fx-fly { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }
@keyframes fx-puff { 0% { transform: translate(0, 0) scale(.5); opacity: .5; } 100% { transform: translate(var(--dx), var(--dy)) scale(2.2); opacity: 0; } }
@keyframes fx-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }
@keyframes fx-ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes fx-rise { 0% { transform: translate(0, 4px) scale(.6); opacity: 0; } 20% { transform: translate(0, -10px) scale(1.15); opacity: 1; } 100% { transform: translate(0, var(--dy)) scale(1); opacity: 0; } }
.candle.stamped { animation: stamp .45s ease-out; }
@keyframes stamp { 0% { transform: scale(1.35); } 40% { transform: scale(.9); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .fx { display: none; } .candle.stamped { animation: none; } }

/* Text font chosen per person: readable (Atkinson Hyperlegible, default) or classic (EB Garamond) */
html[data-font="classic"] { --font-body: "EB Garamond"; }
html[data-font="classic"] body { font-size: 18px; line-height: 1.4; font-family: var(--font-body), "EB Garamond", Georgia, serif; }
.font-opt { display: grid; gap: 2px; text-align: left; }
.font-opt small { font-size: 13px; color: var(--muted); }

/* ---------- Stage F: the Grimoire, comments, install ---------- */
.bottom .nav-btn { font-size: 12px; min-width: 0; }
.bottom .nav-btn span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.new-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.note-card { display: block; width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.note-card:hover { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.note-head .name { font-size: 19px; flex: 1; min-width: 0; }
.note-ico { color: var(--gold); font-size: 18px; width: 22px; text-align: center; }
.note-card .meta { color: var(--muted); font-size: 15px; margin-top: 3px; padding-left: 30px; }
.note-links, .note-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.note-card .note-links { padding-left: 30px; }
.note-chip { cursor: pointer; color: var(--bone); background: var(--surface-2); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.comment { font-size: 15px; color: var(--muted); font-style: italic; margin-top: 3px; white-space: pre-wrap; }
.block-info { padding: 2px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.checklist { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 2px; color: var(--bone); font: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .box { width: 22px; height: 22px; flex: none; border: 1.5px solid var(--muted); border-radius: 6px; display: grid; place-items: center; color: var(--on-accent); font-size: 14px; }
.check.on .box { background: var(--gold); border-color: var(--gold); }
.check.on > span:nth-child(2) { color: var(--muted); text-decoration: line-through; }
.check .avatar { margin-left: auto; }
.pfields { display: grid; gap: 6px; }
.pfield { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 17px; }
.note-body { white-space: pre-wrap; line-height: 1.5; }
.install-steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 16px; }
.prefixes { display: grid; gap: 6px; margin: 4px 0; }
.cat-card .comment { margin-top: 0; }
[data-nitem-row] input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }

/* ---------- Stage G: statistics ---------- */
.week-tabs { margin-bottom: 12px; }
.stat-filters .inline select { flex: 1 1 140px; min-width: 0; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-bottom: 12px; }
.stat-grid .card { margin: 0; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stat-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.star { font-size: 22px; line-height: 1; color: var(--muted); padding: 2px 6px; background: none; border: 0; }
.star.on { color: var(--gold); }
.stat-cat { margin: 4px 0 10px; }
.stat-cat > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 22px; margin-bottom: 10px; }
.stat-cat > summary::-webkit-details-marker { display: none; }
.stat-cat > summary::after { content: "▾"; color: var(--muted); font-size: 16px; margin-left: 10px; transition: transform .2s; }
.stat-cat[open] > summary::after { transform: rotate(180deg); }
.stat-cat > summary .muted { margin-left: auto; font-size: 15px; }
.insights h3 { margin: 0 0 6px; font-size: 18px; color: var(--gold); font-weight: 600; }
.insights ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.small { font-size: 14px; }
.bigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 8px; }
.big { display: grid; gap: 2px; }
.big-n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.big-l { font-size: 13px; color: var(--muted); }
.big-n.good, .hb-fill.good, .vb-bar.good { color: var(--gold); }
.big-n.low { color: var(--danger); }
.hbar { display: grid; grid-template-columns: minmax(90px, 46%) 1fr auto; gap: 8px; align-items: center; font-size: 15px; padding: 3px 0; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.hb-fill { height: 100%; border-radius: 999px; background: var(--muted); }
.hb-fill.good { background: var(--gold); }
.hb-fill.mid { background: color-mix(in srgb, var(--gold) 55%, var(--muted)); }
.hb-fill.low { background: var(--danger); }
.hb-track.stack .hb-fill { border-radius: 0; }
.hb-fill.seg1, .legend .seg1 { background: var(--gold); }
.hb-fill.seg2, .legend .seg2 { background: var(--violet); }
.hb-fill.seg3, .legend .seg3 { background: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -6px; }
.hb-r { font-size: 13px; color: var(--muted); white-space: nowrap; }
.vbars { display: grid; gap: 3px; align-items: end; height: 110px; margin: 4px 0 6px; }
.vb { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 3px; }
.vb-bar { align-self: end; background: color-mix(in srgb, var(--gold) 70%, transparent); border-radius: 4px 4px 0 0; min-height: 2px; }
.vb-bar.good { background: var(--gold); }
.vb-bar.mid { background: color-mix(in srgb, var(--gold) 55%, var(--muted)); }
.vb-bar.low { background: var(--danger); }
.vb-l { font-size: 11px; color: var(--muted); text-align: center; min-height: 13px; }
.spark { width: 100%; height: 60px; display: block; }
.moons { display: flex; flex-wrap: wrap; gap: 6px; }
.moon-cell { display: grid; justify-items: center; font-size: 11px; color: var(--muted); }
.moon-cell.cur span { color: var(--gold); }
.share { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.pz + .pz { margin-top: 10px; }
.pz-name { font-weight: 600; margin-bottom: 2px; }
.pz-sub { margin: -2px 0 4px; }

/* ---------- Loading shimmer ---------- */
.skeleton { display: grid; gap: 12px; }
.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.sk-card span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 60%, var(--bone)) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-card span:nth-child(1) { width: 45%; height: 16px; } .sk-card span:nth-child(2) { width: 85%; } .sk-card span:nth-child(3) { width: 65%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Welcome screen ---------- */
.welcome { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-content: center; justify-items: center; gap: 22px; animation: wl-in .3s ease-out; }
.welcome.out { opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.wl-ring { position: relative; width: 150px; height: 150px; display: grid; place-items: center; filter: drop-shadow(0 0 18px var(--c)); }
.wl-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.wl-track { fill: none; stroke: var(--line); stroke-width: 3; }
.wl-arc { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 340; stroke-dashoffset: 340; animation: wl-arc 1.3s cubic-bezier(.4, 0, .2, 1) forwards; }
.welcome.calm .wl-arc { animation: none; stroke-dashoffset: 0; }
.welcome.calm .wl-ring { filter: drop-shadow(0 0 10px var(--c)); }
.avatar.xl { width: 112px; height: 112px; font-size: 54px; border-width: 0; }
.wl-text { font-size: 30px; text-align: center; padding: 0 20px; animation: wl-text .6s .25s ease-out both; }
.welcome.calm .wl-text { animation-delay: 0s; }
@keyframes wl-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wl-arc { to { stroke-dashoffset: 0; } }
@keyframes wl-text { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Gentle animations ---------- */
main.view-enter { animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.candle-row.cascade > * { animation: cascade .35s ease-out both; }
.candle-row.cascade > *:nth-child(n) { animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes cascade { from { opacity: 0; transform: translateY(4px) scale(.9); } to { opacity: 1; transform: none; } }
.row.sink { animation: sink .45s ease-out; }
@keyframes sink { from { opacity: .3; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.all-done-line { font-size: 15px; color: var(--gold); margin-top: 2px; }
.progress-card.flash { animation: all-done 1.6s ease-out; }
@keyframes all-done { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); } 30% { box-shadow: 0 0 28px 2px color-mix(in srgb, var(--gold) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Calm: soft fades only; nothing flies, nothing flickers */
html[data-anim="calm"] main.view-enter { animation: view-fade .15s ease-out; }
@keyframes view-fade { from { opacity: 0; } to { opacity: 1; } }
html[data-anim="calm"] .fx, html[data-anim="calm"] .bat { display: none; }
html[data-anim="calm"] .candle.lit .flame { animation: none; }
html[data-anim="calm"] .row.sink, html[data-anim="calm"] .candle.stamped { animation: none; }
/* Off: nothing moves */
html[data-anim="off"] *, html[data-anim="off"] *::before, html[data-anim="off"] *::after { animation: none !important; transition: none !important; }
html[data-anim="off"] .fx, html[data-anim="off"] .bat { display: none; }

/* ---------- Stage H: gates, wizard, people, rooms, 2FA ---------- */
.gate { min-height: 100vh; display: grid; place-items: start center; padding: 8vh 16px 40px; }
.gate-card { width: 100%; max-width: 560px; }
.gate-card h1 { font-size: 34px; margin: 0 0 12px; text-align: center; line-height: 1.1; }
.gate-card h2 { font-size: 24px; margin: 4px 0 10px; }
.gate .actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.code-input { font-size: 26px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.privacy { max-height: 46vh; overflow: auto; padding-right: 6px; color: var(--bone); font-size: 16px; line-height: 1.5; }
.privacy p { margin: 0 0 10px; }
.wz-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.wz-rooms .check, .wz-group .check { margin-bottom: 6px; }
.wz-group { margin-top: 10px; }
.wz-gh { color: var(--bone); font-weight: 600; margin-bottom: 4px; }
.wz-person { padding: 10px; margin-bottom: 8px; }
.wz-person .inline button, .room-row button { background: none; border: 0; color: var(--muted); font-size: 20px; padding: 6px 8px; cursor: pointer; }
.room-row button:disabled { opacity: .3; cursor: default; }
.wz-nav { border-top: 1px solid var(--line); padding-top: 12px; }
.otp { padding: 10px 12px; margin-bottom: 8px; }
.otp-pw { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.otp-pw code { font-size: 22px; letter-spacing: .05em; color: var(--gold); word-break: break-all; }
.qr { background: #fff; padding: 8px; border-radius: 10px; width: min(240px, 70vw); margin: 10px auto; }
.qr svg { display: block; width: 100%; height: auto; }
code.secret { word-break: break-all; color: var(--bone); }
.person.off { opacity: .6; }
.person .name { color: var(--bone); font-size: 18px; }
.rooms-edit .room-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rooms-edit .room-row .input { width: 100%; min-width: 0; }
.room-btns { display: flex; }
.room-btns button { padding: 6px 5px; }

/* ---------- Calm stage: home screen ---------- */
.dash-summary .dash-date { font-size: 15px; }
.dash-summary .dash-line { font-size: 20px; color: var(--bone); margin-top: 4px; line-height: 1.35; }
.dash-moon { display: flex; align-items: center; gap: 14px; color: var(--bone); }
.dash-foot { justify-content: center; margin-top: 18px; gap: 8px; }
.dash-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.dash-tpl { display: grid; gap: 4px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--bone); font: inherit; cursor: pointer; }
.dash-tpl[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.dash-list .dash-item { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--bone); }
.dash-list .dash-item:last-child { border-bottom: 0; }
.dash-item .grow { flex: 1; min-width: 0; }
.dash-item button { background: none; border: 0; color: var(--muted); font-size: 20px; padding: 6px 8px; cursor: pointer; }
.dash-item button:disabled { opacity: .3; cursor: default; }
.stat-grid.one { grid-template-columns: 1fr; }

/* ---------- Calm stage: task editor fold-outs ---------- */
.ed-more { display: flex; justify-content: flex-end; margin: -4px 0 8px; }
.ed-fold { border-top: 1px solid var(--line); }
.ed-fold:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ed-fold > summary { display: flex; align-items: center; gap: 10px; padding: 12px 2px; cursor: pointer; color: var(--bone); font-size: 17px; list-style: none; }
.ed-fold > summary::-webkit-details-marker { display: none; }
.ed-fold > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.ed-fold[open] > summary::before { transform: rotate(90deg); }
.ed-hint { margin-left: auto; color: var(--muted); font-size: 14px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.ed-body { padding: 2px 0 8px; }
html[data-anim="off"] .ed-fold > summary::before { transition: none; }

/* ---------- Heading font: gothic (default), classic, plain ---------- */
html[data-heading="classic"] .gothic { font-family: "EB Garamond", Georgia, serif; font-weight: 600; letter-spacing: 0; }
html[data-heading="plain"] .gothic { font-family: "Atkinson Hyperlegible", system-ui, sans-serif; font-weight: 700; letter-spacing: 0; }
html[data-heading="plain"] .head h1, html[data-heading="classic"] .head h1 { font-size: 30px; }

/* ---------- Who summoned, does and helps ---------- */
.avatar.xs { width: 20px; height: 20px; font-size: 11px; border-width: 1.5px; }
.pmarks { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pmark { position: relative; display: inline-flex; }
.pmark i { position: absolute; right: -5px; bottom: -4px; font-style: normal; font-size: 10px; line-height: 1; background: var(--surface, #15131a); border-radius: 50%; padding: 1px; }
a.btn { display: inline-block; text-decoration: none; }

/* ---------- Countdowns ---------- */
.card.cd { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; color: var(--bone); font: inherit; cursor: default; }
button.card.cd { cursor: pointer; }
.cd-icon { font-size: 28px; text-align: center; }
.cd-main { display: grid; gap: 2px; min-width: 0; }
.cd-title { font-size: 18px; overflow-wrap: anywhere; }
.cd-when { font-size: 14px; }
.cd-n { display: grid; justify-items: center; line-height: 1; min-width: 56px; }
.cd-n b { font-size: 30px; color: var(--gold); font-variant-numeric: tabular-nums; }
.cd-n small { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cd-since .cd-n b { color: var(--muted); }
.cd-today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.cd-today .cd-n { font-size: 30px; color: var(--gold); }
.chip.priv { border-color: var(--muted); }

/* ---------- Page width on PC ---------- */
html[data-width="narrow"] main { max-width: 600px; }
html[data-width="medium"] main { max-width: 760px; }
html[data-width="wide"] main { max-width: 1080px; }
html[data-width="full"] main { max-width: none; }
@media (max-width: 899px) { .wide-only { display: none; } }

/* ---------- Carve the day ---------- */
.cv-days { margin-bottom: 10px; }
.cv-hint { font-size: 15px; margin: 0 0 8px; }
.cv-busy, .cv-fixed { font-size: 15px; margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cv-fixed { margin: 0 4px 12px; }
.cv-slot-edit { gap: 6px; }
.cv-slot-edit input { max-width: 130px; }
.cv-slot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 17px; }
.cv-slot-head .muted { font-size: 14px; }
.cv-slot.over { border-color: var(--danger); }
.cv-warn { color: var(--danger); font-size: 15px; margin-top: 6px; }
.card.cv-warn { margin-top: 0; }
.cv-item { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.cv-item:first-of-type { border-top: 0; }
.cv-slot .cv-item { grid-template-columns: auto auto 1fr auto; }
.card > .cv-item:first-child { border-top: 0; }
.cv-item:not(:has(.cv-at)) { grid-template-columns: auto 1fr auto; }
.cv-item.done .cv-name { color: var(--muted); text-decoration: line-through; }
.cv-at { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 15px; }
.cv-name { overflow-wrap: anywhere; font-size: 17px; }
.cv-name small { font-size: 13px; }
.cv-move { width: auto; max-width: 140px; padding: 4px 8px; font-size: 14px; }
.cv-star { font-size: 20px; line-height: 1; color: var(--muted); padding: 2px 4px; min-width: 32px; min-height: 32px; }
.cv-star.on { color: var(--gold); }
.cv-open { justify-content: center; margin: 0 0 6px; }
.cv-today .cv-tl-slot { color: var(--gold); font-size: 15px; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.cv-today .cv-tl-slot:first-child { margin-top: 0; }
.cv-today .cv-tl-fixed { font-size: 15px; padding: 6px 0; border-top: 1px dashed var(--line); }
.cv-row { grid-template-columns: auto 1fr auto; }
.cv-left { margin-top: 10px; font-size: 15px; }
.cv-left summary { cursor: pointer; color: var(--muted); }
.cv-left div { padding: 3px 0 3px 14px; }

/* ---------- My week ---------- */
.bw-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: baseline; width: 100%; text-align: left; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; background: none; }
.bw-row:first-child, summary + .bw-row { border-top: 0; }
button.bw-row:hover .bw-what { color: var(--gold); }
.bw-time { font-variant-numeric: tabular-nums; color: var(--gold); }
.bw-what { display: grid; overflow-wrap: anywhere; }
.bw-what small { font-size: 14px; }
.bw-hint { font-size: 14px; margin-top: 8px; }
.bw-other summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.cv-energy { margin: 14px 0 4px; }
.cv-drop { padding: 3px 10px; font-size: 14px; }
.cv-rest { margin: 14px 0; }
.cv-rest > summary { cursor: pointer; color: var(--muted); font-size: 16px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--radius); list-style: none; text-align: center; }
.cv-rest > summary::-webkit-details-marker { display: none; }
.cv-rest[open] > summary { margin-bottom: 8px; }
.cv-leftfold > summary { cursor: pointer; font-size: 20px; padding: 2px 0; }
.cv-leftfold[open] > summary { margin-bottom: 6px; }
.cv-slot .cv-tl-fixed, .cv-today .cv-row + .cv-tl-fixed { padding-left: 4px; }
@media (max-width: 520px) {
  .cv-item, .cv-slot .cv-item { grid-template-columns: auto auto 1fr; row-gap: 4px; }
  .cv-item:not(:has(.cv-at)) { grid-template-columns: auto 1fr; }
  .cv-move, .cv-drop { grid-column: 2 / -1; justify-self: start; }
  .bw-row { grid-template-columns: 105px 1fr; }
}

/* ---------- Simple level ---------- */
.name-btn { display: block; text-align: left; width: 100%; padding: 0; background: none; border: 0; color: inherit; font: inherit; font-size: 19px; line-height: 1.25; cursor: pointer; }
.row.done .name-btn { color: var(--muted); }
[data-level="simple"] .row .meta { gap: 6px; }
.today-fold { margin: 10px 0; }
.today-fold > summary { cursor: pointer; list-style: none; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 20px; }
.today-fold > summary::-webkit-details-marker { display: none; }
.today-fold > summary .muted { font-size: 15px; font-family: var(--font-body); }
.today-fold[open] > summary { margin-bottom: 4px; border-style: dashed; background: none; }
.today-fold:not([data-tfold="blocks"]) > .section-title { display: none; }
.set-fold { margin: 0 0 10px; }
.set-fold > summary { cursor: pointer; list-style: none; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--bone); font-size: 18px; display: flex; justify-content: space-between; }
.set-fold > summary::after { content: '›'; color: var(--muted); transition: transform .15s; }
.set-fold[open] > summary::after { transform: rotate(90deg); }
.set-fold > summary::-webkit-details-marker { display: none; }
.set-fold[open] > summary { margin-bottom: 8px; }
.level-card .seg button { font-size: 17px; padding: 7px 16px; }
.ed-simple { margin: 6px 0 4px; }
.ed-simple > summary { cursor: pointer; color: var(--muted); padding: 10px 0; font-size: 16px; }
.ed-simple[open] > summary { margin-bottom: 8px; color: var(--bone); }

/* ---------- Focus ---------- */
.focus-main { max-width: 640px; margin: 0 auto; padding: 16px; min-height: 100vh; min-height: 100dvh; display: flex; }
.focus { display: flex; flex-direction: column; width: 100%; }
.focus-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.focus-x { font-size: 30px; line-height: 1; color: var(--muted); min-width: 44px; min-height: 44px; }
.focus-card { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 12px 4px 40px; }
.focus-room { font-size: 17px; }
.focus-name { font-family: var(--font-body); font-size: clamp(30px, 8vw, 44px); line-height: 1.15; margin: 0; overflow-wrap: anywhere; color: var(--bone); }
.focus-empty .focus-name { font-family: var(--font-display); text-align: center; }
.focus-meta { font-size: 17px; }
.focus-steps { margin-top: 4px; }
.focus-actions { display: grid; gap: 10px; margin-top: 18px; }
.focus-actions .btn { min-height: 52px; font-size: 18px; justify-content: center; }
.focus-done { display: inline-flex; align-items: center; gap: 8px; }
.focus-done svg { width: 22px; height: 22px; }
.focus-empty .focus-actions { justify-items: center; }

/* ---------- Theme editor ---------- */
.te-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; }
.te-color { display: flex; align-items: center; gap: 10px; font-size: 16px; cursor: pointer; }
.te-color input[type=color] { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; flex: none; }
.te-more { margin-top: 10px; }
.te-more > summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.te-contrast { margin-top: 10px; font-size: 15px; }
.te-contrast.warn { color: var(--danger); }
.te-contrast.ok { color: var(--muted); }
.te-sample-h { font-size: 26px; margin-bottom: 4px; }
.te-sample .candle { pointer-events: none; }
.te-edit { padding: 4px 10px; align-self: center; }
