/* ==========================================================================
   Haiku Grove — design system
   Sumi ink + washi paper, vermilion hanko accent.
   Display: Cormorant Garamond · UI: Inter
   ========================================================================== */

:root {
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Times New Roman', serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-seal: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', 'Songti SC', serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --z-nav: 30;
  --z-float: 40;
  --z-modal: 50;
  --z-toast: 60;

  /* Sumi (dark) — default */
  --bg: #0D0C0B;
  --bg-2: #141210;
  --surface: #181513;
  --surface-2: #221E1A;
  --border: rgba(244, 239, 230, .09);
  --border-strong: rgba(244, 239, 230, .2);
  --text: #F4EFE6;
  --text-2: #CFC7BB;
  --muted: #9E968B;
  --accent: #EF5E40;
  --accent-hover: #FF7356;
  --accent-ink: #1A0B07;
  --accent-soft: rgba(239, 94, 64, .13);
  --gold: #E3B65C;
  --gold-soft: rgba(227, 182, 92, .13);
  --moss: #A3BA8E;
  --moss-soft: rgba(163, 186, 142, .13);
  --seal-ink: #FFF4EC;
  --glass: rgba(20, 18, 16, .72);
  --glow-1: rgba(239, 94, 64, .13);
  --glow-2: rgba(227, 182, 92, .07);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
  --shadow-sm: 0 14px 40px -22px rgba(0, 0, 0, .7);
  --grain: .22;
  --show-sun: block;
  --show-moon: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F3EDE2; --bg-2: #EDE6D9; --surface: #FBF8F2; --surface-2: #F0E9DD;
    --border: rgba(28, 25, 23, .1); --border-strong: rgba(28, 25, 23, .22);
    --text: #1C1917; --text-2: #3F3A35; --muted: #675F56;
    --accent: #C23B1F; --accent-hover: #A8311A; --accent-ink: #FFFFFF; --accent-soft: rgba(194, 59, 31, .09);
    --gold: #8A600C; --gold-soft: rgba(166, 120, 24, .12); --moss: #47672F; --moss-soft: rgba(71, 103, 47, .11);
    --glass: rgba(251, 248, 242, .8); --glow-1: rgba(194, 59, 31, .09); --glow-2: rgba(166, 120, 24, .08);
    --shadow: 0 30px 70px -34px rgba(70, 45, 20, .38); --shadow-sm: 0 14px 34px -22px rgba(70, 45, 20, .32);
    --grain: .32; --show-sun: none; --show-moon: block;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F3EDE2; --bg-2: #EDE6D9; --surface: #FBF8F2; --surface-2: #F0E9DD;
  --border: rgba(28, 25, 23, .1); --border-strong: rgba(28, 25, 23, .22);
  --text: #1C1917; --text-2: #3F3A35; --muted: #675F56;
  --accent: #C23B1F; --accent-hover: #A8311A; --accent-ink: #FFFFFF; --accent-soft: rgba(194, 59, 31, .09);
  --gold: #8A600C; --gold-soft: rgba(166, 120, 24, .12); --moss: #47672F; --moss-soft: rgba(71, 103, 47, .11);
  --glass: rgba(251, 248, 242, .8); --glow-1: rgba(194, 59, 31, .09); --glow-2: rgba(166, 120, 24, .08);
  --shadow: 0 30px 70px -34px rgba(70, 45, 20, .38); --shadow-sm: 0 14px 34px -22px rgba(70, 45, 20, .32);
  --grain: .32; --show-sun: none; --show-moon: block;
  color-scheme: light;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 88% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 560px at -12% 18%, var(--glow-2), transparent 60%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.modal-open { overflow: hidden; }
img, svg { display: block; }
a { color: inherit; }
p a, .muted a, .after-note a, .tl-tip a, figcaption a, .thread-empty a, .empty a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (min-width: 768px) { .container { padding-left: 32px; padding-right: 32px; } }
#view { padding-top: 108px; min-height: 70vh; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -64px; z-index: 100; height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; transition: top .2s; }
.skip:focus { top: 16px; }

/* ---------------------------------------------------------------- type */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 7.4vw, 108px);
  line-height: .94;
  letter-spacing: -.025em;
  margin: 22px 0 26px;
}
.display em { font-style: italic; font-weight: 400; color: var(--accent); }
.h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(42px, 5.4vw, 72px); line-height: .98; letter-spacing: -.02em; margin: 10px 0 0; }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.04; letter-spacing: -.01em; margin: 0 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1.1; margin: 6px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.eyebrow .ic { width: 15px; height: 15px; }
.lede { font-size: clamp(17px, 1.45vw, 19px); line-height: 1.65; color: var(--text-2); max-width: 36em; margin: 14px 0 0; }
.muted { color: var(--muted); }
.sm { font-size: 14px; }
.sub { margin: -8px 0 18px; }
.center { text-align: center; justify-content: center; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font: 600 12px/1 var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ---------------------------------------------------------------- icons + buttons */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.logo { width: 30px; height: 30px; color: var(--accent); fill: none; stroke: var(--text); stroke-width: 2.1; stroke-linecap: round; }
.logo .logo-dot { fill: var(--accent); stroke: none; }
.ic-sun { display: var(--show-sun); }
.ic-moon { display: var(--show-moon); }

.btn {
  --h: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--h);
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: 600 15px/1 var(--font-ui);
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, opacity .2s;
}
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -14px var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { border-color: var(--border-strong); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.btn.ghost:hover:not(:disabled) { border-color: var(--text-2); background: var(--surface-2); }
.btn.ghost.is-on { border-color: var(--moss); color: var(--moss); }
.btn.sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn.lg { --h: 56px; padding: 0 28px; font-size: 16px; }
.btn.full { width: 100%; margin-top: 10px; }
.btn.icon-only { width: 48px; padding: 0; flex: none; }
.btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }

.icon-btn { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none; transition: background-color .2s, color .2s, border-color .2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.bordered { border-color: var(--border-strong); width: 52px; height: 52px; border-radius: 16px; }
.linkish { background: none; border: 0; padding: 4px 2px; color: var(--text-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--text); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-2); font-weight: 600; font-size: 15px; text-decoration: none; transition: color .2s; }
.link-arrow:hover { color: var(--accent); }
.link-arrow .ic { width: 18px; height: 18px; transition: transform .2s var(--ease-out); }
.link-arrow:hover .ic { transform: translateX(3px); }

/* ---------------------------------------------------------------- nav */
.nav { position: fixed; top: 16px; left: 16px; right: 16px; z-index: var(--z-nav); display: flex; justify-content: center; pointer-events: none; }
.nav-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow-sm);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: 27px; font-weight: 600; font-style: italic; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.nav-links { display: flex; gap: 2px; margin-left: 18px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s, background-color .2s; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-me { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; color: var(--text-2); border: 1px solid var(--border); text-decoration: none; transition: border-color .2s; }
.nav-me:hover, .nav-me.active { border-color: var(--accent); }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 7px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 11px/1 var(--font-ui); }
.badge[hidden] { display: none; }

.tabbar {
  display: none;
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: var(--z-nav);
  padding: 6px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: space-around;
}
.tabbar a, .tabbar button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 4px; border: 0; border-radius: 20px; background: none; color: var(--muted); font: 500 11px/1 var(--font-ui); text-decoration: none; cursor: pointer; }
.tabbar a.active { color: var(--text); background: var(--surface-2); }
.tabbar .badge.dot { position: absolute; top: 6px; right: calc(50% - 20px); margin: 0; min-width: 17px; height: 17px; font-size: 10px; }
.tb-plus { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px var(--accent); }
.tb-plus .ic { width: 22px; height: 22px; stroke-width: 2.2; }

@media (max-width: 860px) {
  .nav-links, .nav-plant { display: none; }
  .tabbar { display: flex; }
  #view { padding-top: 96px; padding-bottom: 96px; }
  .nav-inner { padding-left: 16px; }
}
@media (max-width: 400px) {
  .nav-inner { gap: 8px; padding-left: 14px; }
  .brand { gap: 8px; font-size: 23px; }
  .brand .logo { width: 26px; height: 26px; }
  .nav-right { gap: 4px; }
}

/* ---------------------------------------------------------------- shared layout */
.section { padding-top: 72px; padding-bottom: 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head .h2 { margin: 8px 0 0; }
.section-aside { margin: 0; max-width: 26em; color: var(--muted); }
.page { padding-top: 28px; padding-bottom: 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid.narrow { max-width: 460px; }
.grid.mb { margin-bottom: 48px; }
.more-row { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; }
.empty { grid-column: 1 / -1; margin: 0; padding: 44px 24px; border: 1px dashed var(--border-strong); border-radius: 24px; color: var(--muted); text-align: center; list-style: none; }
.empty-card { max-width: 560px; margin: 40px auto; padding: 48px 32px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.empty-card .h2 { justify-content: center; margin: 6px 0 0; }
.empty-card p { margin: 0 0 8px; }
.after-note { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------------------------------------------------------------- chips */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
.chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-bloom { color: var(--gold); background: var(--gold-soft); border-color: transparent; }
.chip-open { color: var(--moss); background: var(--moss-soft); border-color: transparent; }
.chip-grace { color: var(--gold); background: var(--gold-soft); border-color: transparent; }
.chip-mine { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip-yours { color: var(--text-2); }
.chip-stage { background: transparent; }

/* ---------------------------------------------------------------- hero */
.hero { display: grid; gap: 56px; align-items: center; padding-top: 28px; padding-bottom: 24px; min-height: min(840px, calc(100vh - 108px)); }
@media (min-width: 1000px) { .hero { grid-template-columns: 1.08fr .92fr; } }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); animation: live 2.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--moss) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0 44px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 20px 44px; margin: 0; padding-top: 26px; border-top: 1px solid var(--border); }
.hero-stats dt { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.hero-stats dd { margin: 6px 0 0; font-family: var(--font-display); font-size: 42px; font-weight: 500; line-height: 1; }

.hero-art { display: grid; place-items: center; padding: 24px 8px 40px; }
.hp { position: relative; width: min(100%, 470px); margin: 0; }
.hp-stack { position: absolute; inset: 0; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); }
.hp-stack.s1 { transform: rotate(-7deg) translate(-22px, 14px); opacity: .45; }
.hp-stack.s2 { transform: rotate(4deg) translate(18px, -8px); opacity: .75; }
.hp-card { position: relative; padding: 34px 34px 26px; border-radius: 30px; border: 1px solid var(--border-strong); background: linear-gradient(170deg, var(--surface-2), var(--surface) 70%); box-shadow: var(--shadow); cursor: pointer; }
.hp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hp-places { font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.hp-lines { list-style: none; margin: 30px 0 28px; padding: 0; display: grid; gap: 22px; }
.hp-lines li { opacity: 0; animation: ink-in 1.2s var(--ease-out) forwards; animation-delay: calc(.35s + var(--d) * .95s); }
.hp-lines p { margin: 0; font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 40px); font-style: italic; font-weight: 500; line-height: 1.1; letter-spacing: -.005em; }
.hp-credit { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.hp-credit i { font-family: var(--font-display); font-size: 15px; color: var(--accent); min-width: 18px; }
.hp-credit b { color: var(--text-2); font-weight: 600; }
.hp-credit span::before { content: '·'; margin-right: 8px; }
.hp-foot { display: flex; align-items: center; gap: 18px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); font-weight: 600; }
.hp-foot span { display: inline-flex; align-items: center; gap: 6px; }
.hp-foot .ic { width: 15px; height: 15px; }
.hp-foot a { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; min-height: 32px; }
.hp-foot a:hover { color: var(--accent); }
.hp-seal { position: absolute; right: -16px; top: -18px; opacity: 0; animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) forwards; animation-delay: 3.3s; }
@media (max-width: 600px) {
  .hp-stack.s1 { transform: rotate(-5deg) translate(-4px, 12px); }
  .hp-stack.s2 { transform: rotate(3deg) translate(2px, -6px); }
  .hp-card { padding: 28px 24px 22px; }
  .hp-seal { right: -4px; }
}
@keyframes ink-in { from { opacity: 0; filter: blur(10px); transform: translateY(10px); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.9); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }

.seal { width: 56px; height: 56px; display: grid; place-items: center; flex: none; border-radius: 12px; background: var(--accent); color: var(--seal-ink); font-family: var(--font-seal); font-size: 30px; line-height: 1; transform: rotate(-8deg); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--seal-ink) 22%, transparent), 0 10px 24px -12px var(--accent); user-select: none; }
.seal.sm { width: 34px; height: 34px; font-size: 18px; border-radius: 8px; }
.seal-lg { width: 70px; height: 70px; font-size: 38px; }

/* ---------------------------------------------------------------- how it works */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.step { position: relative; overflow: hidden; padding: 30px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); }
.step-num { position: absolute; right: 18px; top: -6px; font-family: var(--font-display); font-style: italic; font-size: 128px; line-height: 1; color: var(--text); opacity: .055; pointer-events: none; }
.step-ic { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 16px; }
.step-ic .ic { width: 24px; height: 24px; }
.step h3 { margin: 10px 0 8px; font-family: var(--font-display); font-size: 32px; font-weight: 500; line-height: 1.05; }
.step > p:last-child { margin: 0; color: var(--text-2); }
.tone-moss .step-ic { background: var(--moss-soft); color: var(--moss); }
.tone-gold .step-ic { background: var(--gold-soft); color: var(--gold); }
.tone-accent .step-ic { background: var(--accent-soft); color: var(--accent); }

.rule { margin-top: 16px; padding: 32px; display: grid; gap: 32px; }
@media (min-width: 920px) { .rule { grid-template-columns: 300px 1fr; align-items: center; } }
.rule-copy .muted { margin: 10px 0 0; }
.track { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.track::before { content: ''; position: absolute; left: 8px; right: 8px; top: 8px; height: 2px; background: linear-gradient(90deg, var(--moss), var(--gold) 55%, var(--accent)); opacity: .7; }
.tk { position: relative; padding-top: 34px; }
.tk::before { content: ''; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--c); box-shadow: 0 0 0 5px var(--surface); }
.tk b { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 500; line-height: 1; color: var(--c); }
.tk span { display: block; margin-top: 8px; font-size: 14px; color: var(--text-2); }
@media (max-width: 640px) {
  .track { grid-template-columns: 1fr; gap: 22px; }
  .track::before { left: 8px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; background: linear-gradient(180deg, var(--moss), var(--gold) 55%, var(--accent)); }
  .tk { padding: 0 0 0 38px; }
}

/* ---------------------------------------------------------------- poem cards */
.poem-card, .grow-card { display: flex; flex-direction: column; gap: 18px; padding: 24px 24px 16px; transition: border-color .25s, box-shadow .25s; }
.poem-card { cursor: pointer; }
.poem-card:hover, .grow-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pc-head time { font-size: 13px; color: var(--muted); white-space: nowrap; }

.haiku { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hl { display: flex; align-items: flex-start; gap: 12px; transition: opacity .2s; }
.hl.dim { opacity: .36; }
.hl.dim:hover { opacity: .85; }
.hl-main { flex: 1; min-width: 0; }
.hl-text, .gl-text { margin: 0; font-family: var(--font-display); font-size: 27px; font-weight: 500; line-height: 1.14; letter-spacing: -.005em; overflow-wrap: anywhere; }
.hl-by { display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; min-height: 24px; color: var(--muted); font-size: 12.5px; font-weight: 500; text-decoration: none; transition: color .2s; }
.hl-by:hover { color: var(--text); }
.hl-num { min-width: 16px; font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--accent); }

.pop .ic { animation: pop .45s var(--ease-out); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.4) rotate(-14deg); } 100% { transform: scale(1); } }

.pc-foot, .gc-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.gc-foot { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px 0 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: 600 14px/1 var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer; transition: color .2s, background-color .2s, border-color .2s; }
.vote-btn .ic { width: 18px; height: 18px; }
.vote-btn em { font-style: normal; font-weight: 500; opacity: .8; }
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vote-btn.on .ic { fill: currentColor; }
.vote-btn.big { height: 54px; padding: 0 24px 0 18px; font-size: 16px; }
.vote-btn.big .ic { width: 22px; height: 22px; }
.icon-text { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; transition: color .2s, background-color .2s; }
.icon-text:hover { color: var(--text); background: var(--surface-2); }
.icon-text .ic { width: 18px; height: 18px; }
.pc-foot .icon-btn { width: 40px; height: 40px; color: var(--muted); }
.pc-foot .icon-btn .ic { width: 18px; height: 18px; }
.pc-open { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px 0 8px; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; transition: color .2s; }
.pc-open .ic { width: 16px; height: 16px; transition: transform .2s var(--ease-out); }
.pc-open:hover { color: var(--accent); }
.pc-open:hover .ic { transform: translateX(3px); }

.garden-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gl.ghost { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px dashed var(--border-strong); }
.gl-hint { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.gl-hint .ic { width: 14px; height: 14px; }
.gl-hint b { color: var(--moss); font-weight: 600; }
.gl.writing { border-style: solid; border-color: var(--border); background: var(--surface-2); }
.redacted { position: relative; min-width: 0; overflow: hidden; white-space: nowrap; font-family: var(--font-display); font-size: 23px; font-style: italic; filter: blur(5px); opacity: .5; user-select: none; }
.ink-shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 25%, color-mix(in srgb, var(--text) 9%, transparent) 50%, transparent 75%); background-size: 220% 100%; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.grow-card.is-locked .gl-text { opacity: .72; }
.grow-card.is-mine { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.gc-wait { font-size: 13px; color: var(--muted); }
.flash { animation: flash 2.2s var(--ease-out); }
@keyframes flash { 0%, 30% { border-color: var(--moss); box-shadow: 0 0 0 4px var(--moss-soft), var(--shadow-sm); } 100% { border-color: var(--border); box-shadow: none; } }

/* ---------------------------------------------------------------- toolbars */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.tabs, .seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab, .seg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 600 14px/1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .2s, background-color .2s; }
.tab .ic, .seg-btn .ic { width: 17px; height: 17px; }
.tab small { font-weight: 500; font-size: 12px; color: var(--muted); }
.tab:hover, .seg-btn:hover { color: var(--text); }
.tab.on, .seg-btn.on { background: var(--text); color: var(--bg); }
.tab.on small { color: inherit; opacity: .65; }
.tab.on .count { background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; }
@media (max-width: 560px) { .tab small { display: none; } .tab, .seg-btn { padding: 0 14px; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px; flex: 0 1 340px; min-width: 0; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: border-color .2s; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 400 16px var(--font-ui); outline: none; }
.search input::placeholder { color: var(--muted); }
@media (max-width: 640px) { .search { flex-basis: 100%; } }

/* ---------------------------------------------------------------- poem page */
.poem-page { max-width: 1000px; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; transition: color .2s; }
.back:hover { color: var(--text); }
.back .ic { width: 18px; height: 18px; }
.poem-hero { position: relative; margin: 12px 0 64px; padding: clamp(28px, 5.5vw, 68px); border-radius: 34px; border: 1px solid var(--border); background: radial-gradient(760px 420px at 100% 0%, var(--accent-soft), transparent 62%), var(--surface); box-shadow: var(--shadow); }
.poem-hero .seal-lg { position: absolute; right: clamp(20px, 4vw, 44px); top: clamp(20px, 4vw, 44px); }
.poem-hero > .eyebrow { padding-right: 80px; }
.big-haiku { list-style: none; margin: 34px 0 40px; padding: 0; display: grid; gap: 30px; }
.bh-line { display: grid; grid-template-columns: 44px 1fr; column-gap: 10px; }
.bh-num { padding-top: .55em; font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--accent); }
.bh-text { margin: 0; font-family: var(--font-display); font-size: clamp(36px, 5.8vw, 68px); font-weight: 500; line-height: 1.03; letter-spacing: -.015em; overflow-wrap: anywhere; }
.bh-meta { grid-column: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.poet-chip { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 16px 0 5px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none; transition: color .2s, background-color .2s; }
.poet-chip:hover { color: var(--text); }
.bh-meta .star-btn { margin: 0; height: 38px; }
.poem-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 30px; border-top: 1px solid var(--border); }
.pa-hint { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 0 auto; color: var(--muted); font-size: 13px; }
.pa-hint .ic { width: 15px; height: 15px; color: var(--gold); }
@media (max-width: 640px) { .bh-line { grid-template-columns: 28px 1fr; } .pa-hint { margin-left: 0; } }
.growing-note { margin: 18px 0 26px; }
.growing-note .h2 { margin: 8px 0 6px; }

.reviews { max-width: 760px; }
.review-form { display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 18px; transition: border-color .2s; }
.review-form:focus-within { border-color: var(--accent); }
.review-form textarea { width: 100%; min-height: 84px; resize: vertical; border: 0; background: transparent; color: var(--text); font: 400 16px/1.6 var(--font-ui); outline: none; }
.review-form textarea::placeholder { color: var(--muted); }
.rf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 20px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); }
.review-meta { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.review-meta a { color: var(--text); font-weight: 600; text-decoration: none; }
.review-meta a:hover { color: var(--accent); }
.review-meta time { color: var(--muted); font-size: 13px; }
.review p { margin: 4px 0 0; color: var(--text-2); }

/* ---------------------------------------------------------------- avatars */
.av { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--av); color: #17120E; font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; line-height: 1; }
.av-me { color: var(--accent-ink); }
.av-xs { width: 22px; height: 22px; font-size: 10px; }
.av-sm { width: 30px; height: 30px; font-size: 13px; }
.av-md { width: 42px; height: 42px; font-size: 17px; }
.av-lg { width: 68px; height: 68px; font-size: 27px; }
.av-xl { width: 108px; height: 108px; font-size: 44px; box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--border-strong); }

/* ---------------------------------------------------------------- leaderboard */
.split { display: grid; gap: 16px; padding-bottom: 24px; }
@media (min-width: 920px) { .split { grid-template-columns: 1fr 1fr; } }
.ranks-card { padding: 24px; }
.rc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mini-ranks { list-style: none; margin: 0; padding: 0; }
.mini-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; text-decoration: none; transition: background-color .2s; }
.mini-row:hover { background: var(--surface-2); }
.mr-name { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.mr-name b, .rr-poet b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-name small, .rr-poet small { color: var(--muted); font-size: 13px; }
.mr-score { font-family: var(--font-display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mr-score small { margin-left: 4px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.rr-n { min-width: 24px; font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--muted); }

.cta-card { position: relative; overflow: hidden; padding: clamp(28px, 4vw, 48px); border-radius: 24px; border: 1px solid var(--border); background: radial-gradient(520px 320px at 100% 100%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), var(--surface-2); }
.cta-card h2 { position: relative; margin: 14px 0 0; font-family: var(--font-display); font-size: clamp(38px, 4.4vw, 58px); font-weight: 500; line-height: .98; letter-spacing: -.015em; }
.cta-card .lede { position: relative; margin-bottom: 28px; }
.cta-card .btn { position: relative; }
.cta-kanji { position: absolute; right: -10px; bottom: -70px; font-family: var(--font-seal); font-size: 280px; line-height: 1; color: var(--text); opacity: .05; pointer-events: none; user-select: none; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 16px; margin-bottom: 20px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 24px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); text-align: center; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.pod:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.pod.p1 { padding-top: 46px; padding-bottom: 34px; border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: radial-gradient(400px 220px at 50% 0%, var(--gold-soft), transparent 70%), var(--surface); }
.pod-rank { font-family: var(--font-display); font-style: italic; font-size: 50px; line-height: 1; color: var(--gold); }
.pod.p2 .pod-rank, .pod.p3 .pod-rank { color: var(--muted); font-size: 40px; }
.pod-who { display: grid; gap: 2px; }
.pod-name { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.pod-city { font-size: 13px; color: var(--muted); }
.pod-score { font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pod-score small { margin-left: 6px; font-family: var(--font-ui); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
@media (max-width: 640px) {
  .podium { grid-template-columns: 1fr; gap: 10px; }
  .pod, .pod.p1 { flex-direction: row; padding: 14px 18px; text-align: left; gap: 14px; }
  .pod.p1 { order: -1; }
  .pod-rank, .pod.p2 .pod-rank, .pod.p3 .pod-rank { font-size: 32px; min-width: 24px; }
  .pod .av-lg { width: 48px; height: 48px; font-size: 20px; }
  .pod-who { flex: 1; min-width: 0; }
  .pod-name { font-size: 22px; }
  .pod-score { font-size: 24px; }
}

.ranks { list-style: none; margin: 0; padding: 0; overflow: hidden; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); }
.rank-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 90px 90px 100px; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--border); text-decoration: none; transition: background-color .2s; }
.rank-head { border-top: 0; padding-top: 16px; padding-bottom: 12px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
a.rank-row:hover { background: var(--surface-2); }
.rank-row.me { background: var(--accent-soft); }
.rr-poet { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rr-poet > span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.rr-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.rr-score { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--text); }
.you { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 10px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .1em; font-style: normal; vertical-align: middle; }
@media (max-width: 640px) { .rank-row { grid-template-columns: 30px minmax(0, 1fr) 76px; padding: 12px 16px; } .rr-hide { display: none; } }

/* ---------------------------------------------------------------- profile */
.profile-head { display: grid; gap: 28px; margin-bottom: 28px; padding: clamp(24px, 4vw, 42px); background: radial-gradient(620px 320px at 0% 0%, var(--accent-soft), transparent 70%), var(--surface); }
@media (min-width: 920px) { .profile-head { grid-template-columns: 1fr auto; align-items: start; } .ph-stats { grid-column: 1 / -1; } }
.ph-id { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.ph-id > div { min-width: 0; flex: 1 1 260px; }
.ph-bio { margin: 12px 0 0; max-width: 40em; color: var(--text-2); }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ph-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; margin: 0; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); background: var(--border); }
.ph-stats div { padding: 16px 18px; background: var(--surface); }
.ph-stats dt { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ph-stats dd { margin: 6px 0 0; font-family: var(--font-display); font-size: 36px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.best-line { margin: 0 0 52px; padding: 30px 32px; border-left: 3px solid var(--gold); border-radius: 0 24px 24px 0; background: linear-gradient(90deg, var(--gold-soft), transparent 80%); }
.best-line .eyebrow { color: var(--gold); }
.best-line blockquote { margin: 12px 0 12px; font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 40px); font-style: italic; font-weight: 500; line-height: 1.06; }
.best-line figcaption { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- messages */
.msgs-page { padding-bottom: 32px; }
.msgs { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 160px); min-height: 520px; overflow: hidden; }
.thread-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.tl-head { padding: 24px 24px 14px; }
.thread-list ul { flex: 1; list-style: none; margin: 0; padding: 0 10px; overflow-y: auto; }
.ti { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; text-decoration: none; transition: background-color .2s; }
.ti:hover, .ti.on { background: var(--surface-2); }
.ti-body { flex: 1; min-width: 0; }
.ti-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ti-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti-top time { flex: none; font-size: 12px; color: var(--muted); }
.ti-prev { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti.unread .ti-prev { color: var(--text); font-weight: 500; }
.tl-tip { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.tl-tip .ic { width: 16px; height: 16px; }
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.th-head { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.th-back { display: none; }
.th-who { display: flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; }
.th-who span { display: grid; line-height: 1.3; }
.th-who small { color: var(--muted); font-size: 13px; }
.bubbles { flex: 1; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 24px; overflow-y: auto; list-style: none; }
.bubble { max-width: min(80%, 520px); padding: 12px 16px; border-radius: 20px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; animation: rise .3s var(--ease-out); }
.bubble time { display: block; margin-top: 4px; font-size: 11px; opacity: .65; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--surface-2); }
.bubble.me { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.bubbles-empty { margin: auto; color: var(--muted); text-align: center; }
.typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-of-type(2) { animation-delay: .15s; }
.typing i:nth-of-type(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.compose { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.compose input { flex: 1; min-width: 0; height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font: 400 16px var(--font-ui); transition: border-color .2s; }
.compose input:focus { outline: none; border-color: var(--accent); }
.thread-empty { margin: auto; display: grid; justify-items: center; gap: 16px; padding: 32px; text-align: center; color: var(--muted); }
@media (max-width: 860px) {
  .msgs { grid-template-columns: 1fr; height: calc(100vh - 210px); height: calc(100dvh - 210px); min-height: 440px; }
  .thread-list { border-right: 0; }
  .msgs.has-active .thread-list { display: none; }
  .msgs:not(.has-active) .thread { display: none; }
  .th-back { display: inline-grid; }
}

/* ---------------------------------------------------------------- writing room */
body.in-room .nav, body.in-room .tabbar, body.in-room .site-foot { display: none; }
body.in-room #view { padding: 0; }
.room { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 20px 20px 96px; background: radial-gradient(1000px 520px at 50% -10%, var(--accent-soft), transparent 70%); }
.room-gone { justify-content: center; }
.room-top { width: 100%; max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.private-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; }
.private-chip .ic { width: 16px; height: 16px; color: var(--moss); }
.private-chip .short { display: none; }
@media (max-width: 600px) { .private-chip .long { display: none; } .private-chip .short { display: inline; } }

.timer { position: relative; flex: none; width: 84px; height: 84px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-track { fill: none; stroke: var(--border-strong); stroke-width: 4; }
.t-fill { fill: none; stroke: var(--moss); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .5s linear, stroke .4s; }
.timer.low .t-fill { stroke: var(--accent); }
.timer.grace .t-fill { stroke: var(--gold); }
.t-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.t-text b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.t-text small { margin-top: 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.room-stage { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 24px; }
.room-lines { list-style: none; margin: 30px 0 40px; padding: 0; display: grid; gap: 30px; }
.rl { display: grid; grid-template-columns: 46px 1fr; column-gap: 8px; align-items: start; }
.rl-num { padding-top: .6em; font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--accent); }
.rl-text { margin: 0; font-family: var(--font-display); font-size: clamp(36px, 5.6vw, 62px); font-weight: 500; line-height: 1.05; letter-spacing: -.015em; overflow-wrap: anywhere; }
.rl-by { font-size: 13px; color: var(--muted); }
.rl-field { min-width: 0; }
.line-input { width: 100%; padding: 4px 0 12px; border: 0; border-bottom: 1.5px solid var(--border-strong); border-radius: 0; background: transparent; color: var(--text); font-family: var(--font-display); font-size: clamp(36px, 5.6vw, 62px); font-style: italic; font-weight: 500; line-height: 1.12; letter-spacing: -.01em; caret-color: var(--accent); outline: none; transition: border-color .25s; }
.line-input:focus { border-bottom-color: var(--accent); }
.line-input::placeholder { color: var(--muted); opacity: .55; }
.line-input.md { font-size: clamp(30px, 4vw, 40px); margin-top: 20px; }
.rl-future p { margin: 0; padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 14px; }
.rl-future .rl-num { padding-top: 12px; opacity: .45; }
.room-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-tip { display: flex; align-items: center; gap: 8px; margin: 26px 0 0; color: var(--muted); font-size: 14px; }
.room-tip .ic { width: 16px; height: 16px; }
@media (max-width: 600px) { .rl { grid-template-columns: 30px 1fr; } .timer { width: 70px; height: 70px; } .t-text b { font-size: 16px; } }

.meter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 22px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--border-strong); transition: background-color .2s, border-color .2s; }
.dots i.on { background: var(--moss); border-color: var(--moss); }
.dots i.over { background: var(--accent); border-color: var(--accent); }
.meter.ok .meter-label { color: var(--moss); font-weight: 600; }
.meter.over .meter-label { color: var(--accent); }

.demo-chip { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: var(--z-float); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 5px 5px 5px 16px; border-radius: 999px; border: 1px dashed var(--border-strong); background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--muted); font-size: 13px; white-space: nowrap; }
.demo-chip .ic { width: 16px; height: 16px; }
.demo-chip button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--text); font: 600 13px/1 var(--font-ui); cursor: pointer; transition: background-color .2s; }
.demo-chip button:hover { background: var(--border-strong); }
@media (max-width: 480px) { .demo-chip > span { display: none; } }

/* ---------------------------------------------------------------- modal */
#modal-root[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(8, 7, 6, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .25s; }
.modal-backdrop.show { opacity: 1; }
.modal { position: relative; width: 100%; max-width: 540px; padding: clamp(26px, 4.5vw, 40px); border-radius: 30px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .75); transform: translateY(14px) scale(.98); transition: transform .35s var(--ease-out); }
.modal-backdrop.show .modal { transform: none; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-title { margin: 12px 0 10px; font-family: var(--font-display); font-size: clamp(32px, 4.4vw, 42px); font-weight: 500; line-height: 1.02; letter-spacing: -.01em; }
.modal > .muted, .modal p.muted { margin: 0; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.modal-actions.center { justify-content: center; }
.field-label { display: block; margin: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pen-row { display: flex; gap: 8px; }
.text-input { flex: 1; min-width: 0; height: 52px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: 500 24px/1 var(--font-display); transition: border-color .2s, box-shadow .2s; }
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pen-sugg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sugg { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: 500 14px/1 var(--font-ui); cursor: pointer; transition: border-color .2s, color .2s; }
.sugg:hover { border-color: var(--text-2); color: var(--text); }
.form-error { min-height: 1.4em; margin: 10px 0 0; color: var(--accent); font-size: 14px; }
.form-error:empty { min-height: 0; margin: 0; }

.sw { text-align: center; }
.sw .timer { width: 104px; height: 104px; margin: 0 auto 6px; }
.sw .modal-actions { justify-content: center; }
.sw .modal-title { font-size: clamp(38px, 5vw, 50px); }
.demo-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 22px 0 0; color: var(--muted); font-size: 13px; }
.demo-note .ic { width: 15px; height: 15px; }

.bloom-cele { text-align: center; }
.bloom-cele .seal { margin: 4px auto 18px; width: 68px; height: 68px; font-size: 36px; }
.stamp { animation: stamp .6s cubic-bezier(.2, 1.6, .4, 1) both .15s; }
.bc-lines { display: grid; gap: 14px; margin: 24px 0 4px; }
.bc-lines p { margin: 0; font-family: var(--font-display); font-size: 30px; font-style: italic; font-weight: 500; line-height: 1.1; opacity: 0; animation: ink-in 1s var(--ease-out) forwards; animation-delay: calc(.45s + var(--d) * .45s); }
.bc-lines small { display: block; margin-top: 4px; font-family: var(--font-ui); font-size: 12px; font-style: normal; color: var(--muted); }

.share-card { position: relative; margin: 22px 0 18px; padding: 28px 28px 22px; overflow: hidden; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .08); background: radial-gradient(400px 220px at 100% 0%, rgba(239, 94, 64, .22), transparent 70%), linear-gradient(165deg, #1E1A16, #0D0C0B); color: #F4EFE6; }
.sc-lines p { margin: 0 0 6px; font-family: var(--font-display); font-size: 28px; font-style: italic; font-weight: 500; line-height: 1.15; }
.sc-by { margin: 16px 0 0; font-size: 12px; color: #A39B90; letter-spacing: .03em; }
.sc-brand { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-family: var(--font-display); font-size: 21px; font-style: italic; font-weight: 600; }
.sc-brand .seal { background: #EF5E40; color: #FFF4EC; }
.share-url { display: flex; gap: 8px; margin-bottom: 4px; }
.share-url input { flex: 1; min-width: 0; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); font: 400 14px var(--font-ui); }
.modal .muted.sm { margin-top: 14px; }

/* ---------------------------------------------------------------- toasts + holding pill */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast); transform: translateX(-50%); display: grid; gap: 10px; width: min(560px, calc(100% - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; border-radius: 18px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; line-height: 1.45; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .6); pointer-events: auto; opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .35s var(--ease-out); }
.toast.show { opacity: 1; transform: none; }
.toast-act { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--bg); color: var(--text); font-weight: 600; text-decoration: none; }
body.in-room .toasts { bottom: 84px; }
@media (max-width: 860px) { .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); } }

.holding { position: fixed; top: 92px; right: 24px; z-index: var(--z-float); display: flex; align-items: center; gap: 12px; max-width: min(440px, calc(100% - 48px)); padding: 6px 6px 6px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: var(--surface-2); box-shadow: var(--shadow-sm); animation: rise .35s var(--ease-out); }
.holding[hidden] { display: none; }
.h-ic { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.h-ic .ic { width: 16px; height: 16px; }
.h-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.h-text b { color: var(--accent); font-variant-numeric: tabular-nums; }
body.in-room .holding { display: none; }
@media (max-width: 860px) { .holding { top: auto; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: none; } }

/* ---------------------------------------------------------------- footer */
.site-foot { margin-top: 80px; border-top: 1px solid var(--border); }
.foot-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 48px; }
.foot-brand p { max-width: 30em; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.foot-links { display: flex; align-items: center; gap: 6px 22px; flex-wrap: wrap; font-size: 14px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.foot-links .linkish { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .site-foot { padding-bottom: 90px; } }

/* ---------------------------------------------------------------- motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .hp-lines li, .bc-lines p, .hp-seal { opacity: 1; }
}

/* ---------------------------------------------------------------- live site: sign in, loading, safety */
.ic-fill { fill: currentColor; stroke: none; }
.nav-signin[hidden] { display: none; }
@media (max-width: 860px) { .nav-signin { --h: 40px; padding: 0 14px; } }
.auth { display: grid; gap: 10px; margin-top: 22px; }
.auth form .field-label { margin-top: 4px; }
.btn.apple { background: #FFFFFF; color: #000000; }
.btn.apple:hover { opacity: .9; }
:root[data-theme="light"] .btn.apple { background: #000000; color: #FFFFFF; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn.apple { background: #000000; color: #FFFFFF; } }
.or-rule { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.or-rule::before, .or-rule::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.code-input { width: 100%; text-align: center; letter-spacing: .4em; font-size: 24px; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check-row input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.optional { margin-left: 6px; font-weight: 500; color: var(--muted); }
.field-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.modal .text-input { width: 100%; }
.modal .pen-row .text-input { width: auto; }
textarea.text-input { height: auto; padding: 14px 18px; resize: vertical; font: inherit; line-height: 1.5; color: var(--text); background: var(--surface-2); }
.mode-seg { margin: 18px 0 14px; }
.kind-note { margin: 10px 0 0; color: var(--accent); font-size: 14px; }
.kind-note:empty { display: none; }
.compose { flex-wrap: wrap; }
.compose-note { flex-basis: 100%; margin: 0 6px; }
.compose-locked { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; text-align: center; }
.compose-locked .ic { width: 16px; height: 16px; }
.loading-card { display: grid; justify-items: center; gap: 14px; padding: 96px 24px; color: var(--muted); text-align: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip-free { color: var(--text-2); background: transparent; }
.chip-sample { height: 22px; padding: 0 9px; font-size: 11px; letter-spacing: .04em; text-transform: none; color: var(--muted); background: transparent; vertical-align: 1px; }
.pc-head .chip + .chip { margin-left: -4px; }
.follows-you { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--moss); }
.follows-you .ic { width: 15px; height: 15px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--border); }
.account-row p { margin: 0; }
.linkish.danger, .danger { color: var(--accent); }
.btn.primary.danger-btn { background: var(--accent); }
.menu-list { display: grid; gap: 8px; margin-top: 22px; }
.menu-list .btn.full { margin-top: 0; justify-content: flex-start; }
.send-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.send-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: 500 14px var(--font-ui); cursor: pointer; transition: border-color .2s, background-color .2s; }
.send-chip:hover { border-color: var(--text-2); background: var(--surface-2); }
.send-chip.sent { border-color: var(--moss); color: var(--moss); }
.social-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.signin-prompt { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; }
.signin-prompt p { margin: 0; }
.tl-sep { padding: 16px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tl-empty { padding: 16px 12px; color: var(--muted); font-size: 14px; }
.bubble-poem { display: grid; gap: 2px; margin: 2px 0 8px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 30%, transparent); font-family: var(--font-display); font-size: 18px; font-style: italic; line-height: 1.35; text-decoration: none; }
.bubble-poem b { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font: 600 12px var(--font-ui); font-style: normal; }
.bubble-poem .ic { width: 14px; height: 14px; }
.prose { max-width: 760px; }
.prose .h2 { margin-top: 44px; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 10px 0; color: var(--text-2); }
.prose .h3 { margin-top: 28px; font-size: 24px; }
.poem-quote { margin: 28px 0; padding: 22px 26px; border-left: 3px solid var(--accent); border-radius: 0 16px 16px 0; background: var(--surface); }
.poem-quote p { margin: 0; font-family: var(--font-display); font-size: 26px; font-style: italic; line-height: 1.35; color: var(--text); }
.poem-quote footer { margin-top: 12px; font-size: 14px; color: var(--muted); }
.after-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 44px; }
.seo-intro { padding-top: 40px; padding-bottom: 40px; }
.prose li b { color: var(--text); }
.prose p { color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
@media (max-width: 560px) { .seg-btn .ic { display: none; } .seg-btn { padding: 0 12px; } }
/* Sign-in buttons in each provider's own style */
.ic-brand { stroke: none; }
.btn.google { background: #FFFFFF; color: #1F1F1F; border-color: #747775; }
.btn.google:hover { background: #F2F2F2; }
.btn.facebook { background: #1877F2; color: #FFFFFF; }
.btn.facebook:hover { background: #166FE5; }
.auth .btn .ic { width: 20px; height: 20px; }
/* Teen safeguards: birth month, moderation */
.dob-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
select.text-input { width: 100%; appearance: none; -webkit-appearance: none; padding-right: 40px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239E968B' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center; color: var(--text); font: 500 16px var(--font-ui); cursor: pointer; }
#city-wrap[hidden] { display: none; }
.paused-note { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 16px 20px; border-color: var(--gold); color: var(--gold); }
.paused-note .ic { width: 18px; height: 18px; flex: none; }
.compose-locked span { min-width: 0; }
.mod-card { display: grid; gap: 12px; padding: 22px; align-content: start; }
.mod-card.urgent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.mod-card .h3 { margin: 0; }
.mod-card .h3 a { text-decoration: none; }
.mod-lines { margin: 0; font-family: var(--font-display); font-size: 22px; font-style: italic; line-height: 1.35; }
.mod-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-card p { margin: 0; }
.mod-note { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text-2); font-size: 14px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip-ai { height: 22px; padding: 0 9px; font-size: 11px; color: var(--moss); background: var(--moss-soft); border-color: transparent; vertical-align: 1px; }

/* ================================================================ poem styles
   The first poet picks a background and a font. Keys match ios/Poetree/UI/PoemStyle.swift. */
.styled { position: relative; overflow: hidden; isolation: isolate; background: var(--pbg); border-color: transparent; }
.font-serif { --poem-font: var(--font-display); }
.font-sans { --poem-font: var(--font-ui); }
.font-hand { --poem-font: 'Caveat', 'Bradley Hand', cursive; }
.font-typewriter { --poem-font: 'Courier Prime', 'American Typewriter', 'Courier New', monospace; }
[class*="font-"] .hl-text, [class*="font-"] .gl-text, [class*="font-"] .bh-text, [class*="font-"] .rl-text,
[class*="font-"] .line-input, [class*="font-"] .poem-title, .style-preview[class*="font-"] p { font-family: var(--poem-font, var(--font-display)); }
.font-sans .hl-text, .font-sans .gl-text, .font-sans .bh-text, .font-sans .rl-text { font-weight: 600; letter-spacing: -.02em; }
.font-typewriter .hl-text, .font-typewriter .gl-text { font-size: 22px; }
.font-typewriter .bh-text, .font-typewriter .rl-text, .font-typewriter .line-input { font-size: clamp(28px, 4.4vw, 46px); }
.font-hand .hl-text, .font-hand .gl-text { font-size: 31px; }
.poem-title { margin: 0; font-family: var(--poem-font, var(--font-display)); font-size: 22px; font-style: italic; font-weight: 600; color: var(--text); }
.poem-hero .poem-title { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 4px; }

/* Text colours follow the background: dark ink on light backgrounds, light ink on dark ones. */
.styled.on-light { --text: #1C1917; --text-2: #3A332D; --muted: #5C534A; --border: rgba(28, 25, 23, .16); --border-strong: rgba(28, 25, 23, .3); --surface: rgba(255, 255, 255, .5); --surface-2: rgba(255, 255, 255, .42); --accent: #B5361C; color: var(--text); }
.styled.on-dark { --text: #F7F2EA; --text-2: #E7DFD3; --muted: #CFC6BA; --border: rgba(255, 255, 255, .16); --border-strong: rgba(255, 255, 255, .3); --surface: rgba(0, 0, 0, .28); --surface-2: rgba(0, 0, 0, .22); color: var(--text); }
.styled .chip { background: var(--surface-2); }

/* Solid colours */
.bg-ink { --pbg: #141210; }
.bg-paper { --pbg: #F3EDE2; }
.bg-sage { --pbg: #A9BE95; }
.bg-dusk { --pbg: #1E2A44; }
.bg-blush { --pbg: #F2CDC4; }
.bg-sky { --pbg: #CFE3F0; }
/* Colour fades */
.bg-sunrise { --pbg: linear-gradient(160deg, #FFD9A8 0%, #FBA6A0 100%); }
.bg-twilight { --pbg: linear-gradient(160deg, #3B2366 0%, #1B2453 100%); }
.bg-seaglass { --pbg: linear-gradient(160deg, #DDF4EC 0%, #8ACDBE 100%); }
.bg-ember { --pbg: linear-gradient(160deg, #F39C3D 0%, #B8322A 100%); }
.bg-aurora { --pbg: linear-gradient(160deg, #0E3B30 0%, #3A2160 100%); }
.bg-mist { --pbg: linear-gradient(160deg, #EEF1F3 0%, #C3CCD4 100%); }
/* Animated scenes: these colours are also their still versions (cards, reduced motion) */
.bg-rain { --pbg: linear-gradient(180deg, #33434F 0%, #1A242D 100%); }
.bg-desert { --pbg: linear-gradient(180deg, #FBE3B6 0%, #F2B76E 62%, #D9954F 100%); }
.bg-beach { --pbg: linear-gradient(180deg, #C9EAF6 0%, #EAF7FB 52%, #45A9CB 53%, #2E8DB4 82%, #F1DDB0 83%); }
.bg-snow { --pbg: linear-gradient(180deg, #0E1A2B 0%, #263A57 100%); }
.bg-fireflies { --pbg: linear-gradient(180deg, #0A1A12 0%, #1D2E20 100%); }

/* Behind the content but inside the card: .styled isolates, so z-index -1 stays within it. */
.scene { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.scene i { position: absolute; display: block; }

/* Rain on a window: slanted streaks falling, still droplets on the glass, and a soft fog. */
.scene-rain::before { content: ''; position: absolute; inset: -200px 0 0; background-image:
    repeating-linear-gradient(104deg, transparent 0 22px, rgba(220, 235, 245, .16) 22px 23px, transparent 23px 47px),
    repeating-linear-gradient(98deg, transparent 0 37px, rgba(220, 235, 245, .10) 37px 38px, transparent 38px 71px);
  background-size: 220px 200px, 310px 260px; animation: rain-fall .7s linear infinite; }
.scene-rain::after { content: ''; position: absolute; inset: 0; background-image:
    radial-gradient(4px 5px at 12% 22%, rgba(255, 255, 255, .45), transparent 70%), radial-gradient(3px 4px at 28% 64%, rgba(255, 255, 255, .4), transparent 70%),
    radial-gradient(5px 6px at 46% 34%, rgba(255, 255, 255, .38), transparent 70%), radial-gradient(3px 4px at 63% 78%, rgba(255, 255, 255, .42), transparent 70%),
    radial-gradient(4px 5px at 81% 18%, rgba(255, 255, 255, .4), transparent 70%), radial-gradient(3px 3px at 90% 55%, rgba(255, 255, 255, .45), transparent 70%),
    radial-gradient(120% 70% at 50% 110%, rgba(180, 200, 215, .22), transparent 60%); }
@keyframes rain-fall { to { background-position: -40px 200px, -50px 260px; } }

/* Desert heat: a low sun, two dunes and a shimmering haze over the sand. */
.scene-desert .sun { width: 120px; height: 120px; right: 12%; top: 10%; border-radius: 50%; background: radial-gradient(circle, #FFF6D8 0 45%, rgba(255, 236, 170, .55) 46% 60%, transparent 72%); animation: sun-pulse 5s ease-in-out infinite alternate; }
.scene-desert .dune1 { left: -20%; right: -20%; bottom: -12%; height: 42%; border-radius: 50% 50% 0 0 / 60% 60% 0 0; background: #E0A15A; }
.scene-desert .dune2 { left: 30%; right: -40%; bottom: -18%; height: 38%; border-radius: 50% 50% 0 0 / 70% 70% 0 0; background: #CB8945; }
.scene-desert .haze { left: 0; right: 0; top: 46%; height: 30%; background: repeating-linear-gradient(180deg, transparent 0 7px, rgba(255, 248, 225, .16) 7px 9px); filter: blur(1.5px); animation: heat-haze 2.8s ease-in-out infinite alternate; }
@keyframes sun-pulse { to { transform: scale(1.06); filter: brightness(1.06); } }
@keyframes heat-haze { 0% { transform: translateY(0) skewX(0); opacity: .7; } 100% { transform: translateY(-6px) skewX(3deg); opacity: 1; } }

/* Beach: rolling waves at the shoreline. */
.scene-beach .sun { width: 90px; height: 90px; right: 12%; top: 12%; border-radius: 50%; background: radial-gradient(circle, #FFFBEA 0 50%, rgba(255, 246, 200, .5) 51% 64%, transparent 74%); }
.scene-beach .wave { left: 0; right: 0; height: 64px; background-repeat: repeat-x; background-size: 900px 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 64' preserveAspectRatio='none'%3E%3Cpath d='M0 32 C112 52 225 12 337 32 C450 52 562 12 675 32 C787 52 900 12 900 32 V64 H0 Z' fill='%23ffffff'/%3E%3C/svg%3E"); }
.scene-beach .w1 { top: 50%; opacity: .32; animation: wave-roll 9s linear infinite; }
.scene-beach .w2 { top: 60%; opacity: .22; animation: wave-roll 6s linear infinite reverse; }
.scene-beach .w3 { top: 76%; opacity: .5; height: 44px; animation: wave-roll 4.5s linear infinite; }
@keyframes wave-roll { to { background-position-x: -900px; } }

/* Snow: two layers of flakes drifting down at different speeds. */
.scene-snow::before, .scene-snow::after { content: ''; position: absolute; inset: -240px 0 0; }
.scene-snow::before { background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(2px 2px at 90px 120px, #fff, transparent), radial-gradient(3px 3px at 160px 60px, rgba(255, 255, 255, .9), transparent), radial-gradient(2px 2px at 210px 170px, #fff, transparent);
  background-size: 240px 240px; animation: snow-fall 9s linear infinite; }
.scene-snow::after { background-image: radial-gradient(4px 4px at 50px 80px, rgba(255, 255, 255, .85), transparent), radial-gradient(3px 3px at 180px 20px, rgba(255, 255, 255, .8), transparent), radial-gradient(5px 5px at 260px 150px, rgba(255, 255, 255, .7), transparent);
  background-size: 320px 320px; animation: snow-fall-near 6s linear infinite; filter: blur(.4px); }
@keyframes snow-fall { to { background-position: 40px 240px; } }
@keyframes snow-fall-near { to { background-position: -60px 320px; } }

/* Fireflies: soft glowing points that drift and blink. */
.scene-fireflies::before, .scene-fireflies::after { content: ''; position: absolute; inset: 0; background-repeat: repeat; }
.scene-fireflies::before { background-image: radial-gradient(4px 4px at 40px 60px, rgba(255, 238, 150, .95), transparent), radial-gradient(3px 3px at 150px 140px, rgba(255, 238, 150, .9), transparent), radial-gradient(5px 5px at 230px 40px, rgba(255, 225, 120, .8), transparent);
  background-size: 280px 220px; animation: firefly-drift 14s ease-in-out infinite alternate, firefly-blink 2.4s ease-in-out infinite alternate; }
.scene-fireflies::after { background-image: radial-gradient(3px 3px at 90px 30px, rgba(255, 238, 150, .9), transparent), radial-gradient(4px 4px at 200px 180px, rgba(255, 230, 140, .85), transparent);
  background-size: 340px 260px; animation: firefly-drift 18s ease-in-out infinite alternate-reverse, firefly-blink 3.1s ease-in-out infinite alternate-reverse; }
@keyframes firefly-drift { to { background-position: 60px -50px; } }
@keyframes firefly-blink { 0%, 30% { opacity: .35; } 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .scene::before, .scene::after, .scene i { animation: none !important; }
}

/* Style picker in the plant dialog */
.style-preview { margin: 18px 0 6px; padding: 22px 22px 20px; border-radius: 20px; min-height: 150px; display: grid; align-content: center; gap: 6px; }
.style-preview p { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 500; overflow-wrap: anywhere; }
.style-preview .pv-title { font-size: 16px; font-style: italic; font-weight: 600; color: var(--text-2); }
.style-preview .pv-ghost { opacity: .45; font-size: 20px; }
.picker-label { margin: 16px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.swatch { position: relative; aspect-ratio: 1; min-height: 40px; border-radius: 12px; border: 2px solid var(--border-strong); background: var(--pbg, var(--surface-2)); cursor: pointer; padding: 0; overflow: hidden; }
.swatch.bg-default { background: radial-gradient(circle at 80% 10%, var(--accent-soft), transparent 70%), var(--surface-2); border-color: var(--border); }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch .ic { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.scene-names { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.scene-names .swatch { aspect-ratio: auto; min-height: 56px; display: grid; place-items: end start; padding: 6px 8px; font: 600 11px var(--font-ui); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); text-align: left; }
.fonts-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fonts-seg button { min-height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; font-size: 17px; }
.fonts-seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.fonts-seg .f-serif { font-family: var(--font-display); } .fonts-seg .f-sans { font-family: var(--font-ui); font-size: 15px; }
.fonts-seg .f-hand { font-family: 'Caveat', cursive; font-size: 20px; } .fonts-seg .f-typewriter { font-family: 'Courier Prime', monospace; font-size: 14px; }
@media (max-width: 520px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } .scene-names { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Writing room on a styled poem: the scene fills the room. */
.room.styled { background: var(--pbg); }
.room.styled.on-light .private-chip, .room.styled.on-light .room-tip { color: var(--text-2); }

/* Trolling report */
.troll-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted); font: 600 12px var(--font-ui); cursor: pointer; }
.troll-btn:hover { color: var(--accent); border-color: var(--accent); }
.troll-btn .ic { width: 13px; height: 13px; }
.troll-quote { margin: 14px 0 10px; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0; background: var(--surface-2); font-family: var(--font-display); font-size: 22px; font-style: italic; }
.notice-list { display: grid; gap: 10px; margin-top: 16px; }
.notice-item { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); font-size: 15px; }
.notice-item.warn { border-left: 3px solid var(--gold); }
.notice-item.ban { border-left: 3px solid var(--accent); }
.mod-section-title { margin: 44px 0 14px; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
