/* Shared by every page: the carved-stone pull-down menu, and the look of the content pages. */
:root {
  --night: #0f1d24;
  --deep: #0a151b;
  --slate: #22343d;
  --stone: #1a2a31;
  --bone: #e9e0cc;
  --lichen: #a3b5a0;
  --jade: #9dc2ae;
  --neon: #2fc9ed;
  --neon-soft: rgba(47, 201, 237, 0.45);
  --neon-glow: 0 0 6px rgba(47, 201, 237, 0.9), 0 0 18px rgba(47, 201, 237, 0.55);
  --ember: #e38a6d;
  --serif: 'Alegreya', Georgia, serif;
  --display: 'Cinzel', 'Alegreya', Georgia, serif;
  --runic: 'Noto Sans Runic', 'Segoe UI Historic', sans-serif;
  color-scheme: dark;
}

/* ================= the menu ================= */
.rm-toggle {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem 0.5rem 0.75rem;
  font: 500 1rem/1 var(--serif);
  color: var(--bone);
  background: linear-gradient(160deg, #2a3d46, #16252c 70%);
  border: 1px solid rgba(47, 201, 237, 0.45);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 0 #0b161b, 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 16px rgba(47, 201, 237, 0.18);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.rm-toggle:hover { border-color: var(--neon); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 0 #0b161b, 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 22px rgba(47, 201, 237, 0.35); }
.rm-toggle:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 3px 0 #0b161b, 0 5px 14px rgba(0, 0, 0, 0.5); }
.rm-toggle:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.rm-toggle .rm-glyph { font-family: var(--runic); font-size: 1.25rem; color: var(--neon); text-shadow: var(--neon-glow); transition: transform 0.5s; }
.rm-open .rm-toggle .rm-glyph { transform: rotate(180deg); }

.rm-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(120% 90% at 100% 0%, rgba(6, 14, 19, 0.2), rgba(4, 10, 14, 0.72));
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0s linear 0.5s;
}
.rm-open .rm-veil { opacity: 1; visibility: visible; transition: opacity 0.5s; }

/* The panel slides in from the right: plain, quick and easy to read. */
.rm-stage {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 65;
  width: min(360px, 100vw);
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}
.rm-open .rm-stage { pointer-events: auto; visibility: visible; transition: none; }
.rm-panel {
  position: absolute;
  inset: 0;
  padding: calc(max(14px, env(safe-area-inset-top)) + 64px) 14px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #16262e, #0e1a20);
  border-left: 1px solid rgba(47, 201, 237, 0.3);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.rm-open .rm-panel { transform: none; }

.rm-heading { margin: 0 8px 10px; font-family: var(--runic); font-size: 0.8rem; letter-spacing: 0.4em; color: var(--neon); opacity: 0.7; }

.rm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rm-list a {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 10px 10px;
  color: var(--bone);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.rm-list a:hover, .rm-list a:focus-visible { background: rgba(47, 201, 237, 0.08); border-color: rgba(47, 201, 237, 0.3); outline: none; }
.rm-list a[aria-current="page"] { background: rgba(47, 201, 237, 0.12); border-color: var(--neon-soft); }
.rm-list .g { grid-row: 1 / 3; display: grid; place-items: center; font-family: var(--runic); font-size: 1.3rem; color: var(--neon); text-shadow: 0 0 8px rgba(47, 201, 237, 0.5); }
.rm-list .t { font-family: var(--display); font-weight: 600; font-size: 1.02rem; line-height: 1.2; }
.rm-list .s { font-size: 0.84rem; color: var(--lichen); line-height: 1.3; }

@media (max-width: 520px) {
  .rm-stage { width: 100vw; }
  .rm-toggle .rm-label { display: none; }
  .rm-toggle { padding: 0.5rem 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rm-panel { transition-duration: 0.01ms !important; }
}

/* ================= content pages ================= */
.page [hidden] { display: none !important; }
body.page {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.page *, .page *::before, .page *::after { box-sizing: border-box; }
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(90% 55% at 70% -10%, rgba(47, 201, 237, 0.16), transparent 60%),
    radial-gradient(70% 40% at 15% 0%, rgba(80, 200, 160, 0.12), transparent 60%),
    linear-gradient(180deg, #102531 0%, #0d1b22 45%, #0a151b 100%);
}
.sky::before { content: ''; position: absolute; inset: 0; background: url(/img/stars.svg) 0 0 / 480px 480px repeat; opacity: 0.85; }
.sky::after {
  /* A still aurora: soft coloured light baked into gradients (no live blur, which repaints every frame). */
  content: '';
  position: absolute;
  inset: 0 0 45% 0;
  background:
    radial-gradient(60% 55% at 35% 0%, rgba(90, 220, 170, 0.1), transparent 70%),
    radial-gradient(55% 50% at 70% 5%, rgba(47, 201, 237, 0.09), transparent 70%);
}

.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.page-head { padding: clamp(84px, 12vh, 130px) 0 28px; max-width: 760px; }
.home-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--lichen); text-decoration: none; font-size: 0.95rem; position: absolute; top: max(18px, env(safe-area-inset-top)); left: 16px; z-index: 5; }
.home-link:hover { color: var(--bone); }
.home-link .g { font-family: var(--runic); color: var(--neon); text-shadow: var(--neon-glow); }
.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  line-height: 1.02;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 26px rgba(47, 201, 237, 0.25);
}
.page-head .runes {
  margin: 0.6rem 0 0;
  font-family: var(--runic);
  letter-spacing: 0.3em;
  color: var(--neon);
  text-shadow: var(--neon-glow);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.page-head .lede { margin: 1rem 0 0; font-size: 1.15rem; color: #cfd8d2; max-width: 60ch; }

.section-title { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 2.2rem 0 0.9rem; }
.muted { color: var(--lichen); }
.small { font-size: 0.9rem; }

/* Stone cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  position: relative;
  border-radius: 16px;
  padding: 18px 18px 16px;
  background:
    repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 6px),
    linear-gradient(165deg, rgba(43, 62, 71, 0.92), rgba(24, 38, 45, 0.94));
  border: 1px solid rgba(233, 224, 204, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 30px rgba(0, 0, 0, 0.35);
}
button.card, a.card { text-align: left; font: inherit; color: inherit; cursor: pointer; text-decoration: none; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s; }
button.card:hover, a.card:hover, button.card:focus-visible, a.card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(47, 201, 237, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(47, 201, 237, 0.15);
  outline: none;
}
.card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.2; }
.card .sub { margin: 0.2rem 0 0; color: var(--lichen); font-style: italic; font-size: 0.95rem; line-height: 1.35; }
.card p { margin: 0.6rem 0 0; }
.tag {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 201, 237, 0.35);
  color: #bfeefa;
  background: rgba(47, 201, 237, 0.07);
  white-space: nowrap;
}
.tag.ember { border-color: rgba(227, 138, 109, 0.5); color: #f3c3b3; background: rgba(227, 138, 109, 0.08); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.7rem; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; }
.chip {
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(233, 224, 204, 0.2);
  background: rgba(15, 29, 36, 0.6);
  color: var(--bone);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--neon-soft); }
.chip[aria-pressed="true"] { border-color: var(--neon); background: rgba(47, 201, 237, 0.14); color: #fff; box-shadow: 0 0 12px rgba(47, 201, 237, 0.2); }
.chip:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.search {
  flex: 1 1 220px;
  max-width: 320px;
  font: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(233, 224, 204, 0.2);
  background: rgba(15, 29, 36, 0.7);
  color: var(--bone);
}
.search:focus { outline: none; border-color: var(--neon); }

/* Buttons and fields (same language as the home page) */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font: 700 1.02rem var(--serif);
  color: #04212b;
  background: linear-gradient(180deg, #5fd8f3, var(--neon));
  box-shadow: 0 0 0 1px rgba(47, 201, 237, 0.5), 0 6px 24px rgba(47, 201, 237, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: progress; transform: none; }
.btn.ghost { background: none; color: var(--bone); box-shadow: none; border: 1px solid rgba(233, 224, 204, 0.3); font-weight: 500; }
.btn.ghost:hover { border-color: var(--neon); color: var(--neon); }
.btn.small { padding: 0.4rem 1rem; font-size: 0.92rem; }
.btn:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field label, .label { font-style: italic; color: var(--lichen); font-size: 0.98rem; }
.input, .textarea {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--bone);
  background: rgba(34, 52, 61, 0.55);
  border: 1px solid rgba(163, 181, 160, 0.3);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}
.textarea { resize: vertical; min-height: 5em; line-height: 1.5; }
.input:focus, .textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(47, 201, 237, 0.15); }
.error { color: #f3b3a0; margin: 0.4rem 0 0; }
.error:empty { display: none; }

/* The oracle's answers */
.ask-box { padding: 20px; margin: 0 0 8px; }
.ask-box .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.answer { margin-top: 16px; }
.answer p { margin: 0 0 0.8em; }
.answer ul, .answer ol { margin: 0 0 0.9em; padding-left: 1.3em; }
.answer li { margin: 0.2em 0; }
.answer .safety { border-left: 3px solid var(--ember); padding: 0.5rem 0.9rem; background: rgba(227, 138, 109, 0.08); border-radius: 0 8px 8px 0; }
.thinking { display: flex; align-items: center; gap: 0.7rem; color: var(--lichen); font-style: italic; }
.thinking .g { font-family: var(--runic); color: var(--neon); text-shadow: var(--neon-glow); letter-spacing: 0.3em; animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }
.disclaimer { font-size: 0.9rem; color: var(--lichen); border: 1px dashed rgba(227, 138, 109, 0.4); border-radius: 10px; padding: 0.6rem 0.9rem; margin: 12px 0 0; }

/* Detail dialogs */
.sheet {
  width: min(720px, 100vw - 24px);
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid rgba(47, 201, 237, 0.35);
  border-radius: 18px;
  color: var(--bone);
  background: linear-gradient(170deg, #1e3139, #111e24);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(47, 201, 237, 0.12);
}
.sheet::backdrop { background: rgba(4, 10, 14, 0.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-rise 0.45s cubic-bezier(0.2, 0.9, 0.2, 1); }
@keyframes sheet-rise { from { opacity: 0; transform: perspective(900px) rotateX(-12deg) translateY(30px); } }
.sheet-body { padding: 26px 28px 30px; overflow-y: auto; max-height: min(88vh, 900px); }
.sheet .close { position: sticky; top: 0; float: right; margin: -8px -10px 0 0; }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.1; }
.sheet h3 { margin: 1.3rem 0 0.4rem; font-size: 1rem; font-weight: 500; color: var(--neon); letter-spacing: 0.02em; }
.sheet ul { margin: 0; padding-left: 1.2em; }
.sheet li { margin: 0.2em 0; }

.signin-note { padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

.site-foot { padding: 60px 0 40px; color: var(--lichen); font-size: 0.9rem; }

@media (max-width: 600px) {
  body.page { font-size: 17px; }
  .sheet-body { padding: 22px 18px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .page *, .page *::before, .page *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================= gods ================= */
.filters .filters { margin: 0; }
.week-note { margin: -0.4rem 0 12px; max-width: 70ch; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day {
  appearance: none;
  display: grid;
  align-content: start;
  gap: 6px;
  text-align: left;
  font: inherit;
  color: var(--bone);
  padding: 12px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(233, 224, 204, 0.1);
  background: linear-gradient(170deg, rgba(43, 62, 71, 0.85), rgba(22, 36, 42, 0.9));
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.week-day:hover { transform: translateY(-2px); border-color: var(--neon-soft); }
.week-day[aria-pressed="true"] { border-color: var(--neon); box-shadow: 0 0 18px rgba(47, 201, 237, 0.2); }
.week-day.today { background: linear-gradient(170deg, rgba(34, 70, 82, 0.9), rgba(20, 42, 50, 0.92)); }
.week-day .wd { font-family: var(--display); font-size: 1.05rem; }
.week-day .tag { justify-self: start; }
.week-day .who { font-size: 0.86rem; color: var(--lichen); line-height: 1.35; }
.week-day:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.pantheon-mark { margin: 0 0 0.35rem; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--neon); display: block; }
.god-card { display: block; width: 100%; }
.sub-title { margin: 0.4rem 0 0.2rem; font-style: italic; color: var(--jade); font-size: 1.1rem; }
.journal-add { margin-top: 1.6rem; display: grid; gap: 8px; justify-items: start; }
@media (max-width: 900px) {
  .week-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .week-day { scroll-snap-align: start; }
}

/* ================= holidays ================= */
.soon-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.soon-card { border-color: rgba(47, 201, 237, 0.3); }
.month { margin: 0 0 22px; }
.month-name { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--jade); margin: 1.4rem 0 0.7rem; }
.holiday-card, .soon-card { display: block; width: 100%; }
.god-links a, .sheet a { color: #9fe6f8; }

/* ================= journal ================= */
.week-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 20px; }
.week-head .section-title { margin: 1.4rem 0 0.4rem; }
.week-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.planner { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.day {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(233, 224, 204, 0.09);
  background:
    repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 6px),
    linear-gradient(165deg, rgba(43, 62, 71, 0.9), rgba(22, 36, 42, 0.94));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}
.day.today { border-color: var(--neon-soft); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3), 0 0 24px rgba(47, 201, 237, 0.15); }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.day-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.3rem; display: flex; gap: 8px; align-items: center; }
.day-head .date { margin: 0; color: var(--lichen); font-size: 0.95rem; }
.moon { margin: 0; font-size: 0.8rem; color: var(--lichen); text-align: right; display: grid; justify-items: end; line-height: 1.2; max-width: 7em; }
.moon-g { font-size: 1.3rem; color: #e9f6f8; text-shadow: 0 0 10px rgba(233, 246, 248, 0.5); }
.day-gods { margin: 0; font-size: 0.92rem; color: #cfd8d2; }
.day-gods a, .day a.tag { color: #9fe6f8; text-decoration: none; }
.day-gods a:hover { text-decoration: underline; }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.entries li { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(10, 21, 27, 0.45); }
.entries label { flex: 1; display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.entries input[type="checkbox"] { accent-color: var(--neon); margin-top: 0.2em; width: 1.05em; height: 1.05em; flex: none; }
.entries li.done span { text-decoration: line-through; color: var(--lichen); }
.entries .remove { background: none; border: 0; color: var(--lichen); font-size: 1.2rem; line-height: 1; padding: 0 4px; cursor: pointer; }
.entries .remove:hover { color: var(--ember); }
.add-entry { display: flex; gap: 6px; }
.add-entry .input { padding: 0.45rem 0.7rem; font-size: 0.95rem; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.small-chip { font-size: 0.82rem; padding: 0.25rem 0.65rem; }
.signin-note[hidden] { display: none; }

/* ================= herbs ================= */
.tabs { margin-top: 26px; }
.herb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.herb-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 10px 14px;
  text-align: left;
  font: inherit;
  color: var(--bone);
  border-radius: 16px;
  border: 1px solid rgba(233, 224, 204, 0.1);
  background: linear-gradient(170deg, #1d3038, #121f25);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transform: perspective(700px) rotateX(0) rotateY(0);
  transition: transform 0.35s, box-shadow 0.35s, border-color 0.35s;
}
.herb-card:hover, .herb-card:focus-visible { transform: perspective(700px) rotateX(4deg) rotateY(-5deg) translateY(-4px); border-color: rgba(47, 201, 237, 0.55); box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(47, 201, 237, 0.18); outline: none; }
.herb-card.owned { border-color: rgba(47, 201, 237, 0.4); }
.herb-card .herb-art { width: 100%; height: auto; display: block; border-radius: 10px; }
.herb-name { font-family: var(--display); font-size: 1.2rem; line-height: 1.15; margin-top: 6px; }
.herb-latin { font-style: italic; color: var(--lichen); font-size: 0.88rem; }
.herb-card .tags { margin-top: 4px; }
.owned-mark { position: absolute; top: 16px; right: 16px; font-family: var(--runic); color: var(--neon); text-shadow: var(--neon-glow); }
.herb-preview { margin-top: 12px; }
.herb-preview .herb-card { max-width: 240px; }
.herb-detail { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.herb-detail .close { grid-column: 1 / -1; justify-self: end; float: none; margin: -8px -10px -14px 0; }
.herb-detail-art .herb-art { width: 100%; height: auto; border-radius: 12px; }
@media (max-width: 640px) {
  .herb-detail { grid-template-columns: 1fr; }
  .herb-detail-art { max-width: 240px; }
  .herb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ================= ask ================= */
.answer .asked { font-style: italic; color: var(--jade); }
.examples { margin: 4px 0 0; }

/* ================= account ================= */
.account-form { max-width: 460px; padding: 22px; }
.account-form .filters { margin-bottom: 16px; }
.account-me { max-width: 560px; padding: 22px; }
.me-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 2rem; }
.account-me .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.danger { max-width: 560px; margin-top: 16px; padding: 16px 20px; }
.danger summary { cursor: pointer; color: #f3b3a0; }
.danger .btn { margin-top: 4px; }

/* ================= legal links ================= */
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0.4rem 0 0; font-size: 0.88rem; }
.legal-links a { color: var(--lichen); text-decoration: none; }
.legal-links a:hover { color: var(--bone); text-decoration: underline; }
.rm-legal { margin: 18px 4px 0; }
.consent { font-size: 0.86rem; color: var(--lichen); margin: 0.6rem 0 0; }
.consent a { color: #9fe6f8; }

/* ================= credits badge and quick top-up ================= */
.rm-credits {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 136px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 42px;
  padding: 0 0.85rem 0 0.7rem;
  font: 500 0.95rem/1 var(--serif);
  color: var(--bone);
  background: linear-gradient(160deg, #2a3d46, #16252c 70%);
  border: 1px solid rgba(233, 184, 119, 0.4);
  border-radius: 12px;
  box-shadow: 0 5px 0 #0b161b, 0 8px 22px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.rm-credits[hidden] { display: none; }
.rm-credits .g { font-family: var(--runic); color: #e9b877; text-shadow: 0 0 8px rgba(233, 184, 119, 0.6); }
.rm-credits.low { border-color: rgba(227, 138, 109, 0.8); }
.rm-credits:hover { border-color: #e9b877; }
.rm-credits:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }
.rm-open .rm-credits { opacity: 0; pointer-events: none; }
@media (max-width: 520px) { .rm-credits { right: 74px; padding: 0 0.7rem; } }

.rm-topup {
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  color: var(--bone);
  font-family: var(--serif);
  background: linear-gradient(170deg, #2a2119, #15110d);
  border: 1px solid rgba(233, 184, 119, 0.35);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.rm-topup::backdrop { background: rgba(4, 10, 14, 0.6); }
.rm-topup[open] { animation: sheet-rise 0.35s ease; }
.rm-topup-body { position: relative; padding: 24px 24px 20px; }
.rm-topup h2 { margin: 0 32px 0.3rem 0; font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: #fff1dc; }
.rm-topup-sub { margin: 0 0 1rem; color: #d9c7ad; font-size: 0.95rem; }
.rm-topup-close { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: #d9c7ad; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.rm-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rm-pack {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 6px 12px;
  font: inherit;
  color: #fff1dc;
  border-radius: 14px;
  border: 1px solid rgba(233, 184, 119, 0.3);
  background: linear-gradient(170deg, #5a3b24, #2d1d12);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.rm-pack:hover { transform: translateY(-2px); border-color: var(--neon); }
.rm-pack:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.rm-pack:disabled { opacity: 0.6; cursor: progress; }
.rm-pack .c { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.rm-pack .l { font-size: 0.8rem; color: #d9c7ad; }
.rm-pack .p { margin-top: 6px; padding: 0.2rem 0.7rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; color: #04212b; background: linear-gradient(180deg, #5fd8f3, var(--neon)); }
.rm-topup-status { min-height: 1.2em; margin: 10px 0 0; font-size: 0.9rem; color: #bfeefa; }
.rm-topup-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; font-size: 0.88rem; }
.rm-topup-links a { color: #e9b877; }
.rm-topup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rm-topup-actions .btn { text-decoration: none; }

.rm-toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 80;
  transform: translateX(-50%);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font: 0.95rem var(--serif);
  color: #fff1dc;
  background: rgba(40, 30, 22, 0.95);
  border: 1px solid rgba(233, 184, 119, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s ease both;
  transition: opacity 0.5s, transform 0.5s;
}
.rm-toast a { color: #9fe6f8; }
.rm-toast.out { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ================= account: billing ================= */
.account-billing { max-width: 560px; margin-top: 16px; padding: 22px; }
.billing-title { margin: 0 0 0.4rem; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.billing-balance { margin: 0 0 12px; font-size: 1.1rem; }
.billing-balance strong { font-family: var(--display); font-size: 2rem; font-weight: 400; color: #fff1dc; }
.account-billing .row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.account-billing .btn { text-decoration: none; }
.account-billing a:not(.btn) { color: #9fe6f8; }
.btn-cost { font-family: var(--serif); font-weight: 500; font-size: 0.85em; opacity: 0.85; text-transform: none; letter-spacing: 0; }

/* Cinzel is wide: keep big headings comfortable on small screens. */
.page-head h1 { font-weight: 600; letter-spacing: 0.01em; font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.08; overflow-wrap: break-word; }
.section-title, .card h3, .sheet h2, .rm-list .t { font-weight: 600; letter-spacing: 0.01em; }

.ro-unlimited .btn-cost, .ro-unlimited .send-cost, .ro-unlimited .credit-note { display: none !important; }

/* ================= saved spells, recipes and answers ================= */
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 14px; }
.save-msg { font-size: 0.88rem; opacity: 0.85; }
.save-msg a, .saved-note a { color: inherit; text-decoration: underline; }
.saved-shelf { margin: 30px 0; padding: 20px 22px; border-radius: 16px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(233, 224, 204, 0.12); position: relative; z-index: 1; }
.saved-title { margin: 0 0 6px; font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
.saved-note { margin: 0; font-style: italic; opacity: 0.8; }
.saved-note:empty { display: none; }
.saved-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.saved-item { all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 0.55rem 0.8rem; border-radius: 10px; background: rgba(255, 255, 255, 0.04); cursor: pointer; }
.saved-item:hover, .saved-item:focus-visible { background: rgba(255, 255, 255, 0.09); outline: 1px solid var(--neon-soft); }
.saved-item .t { font-weight: 500; }
.saved-item .d { font-size: 0.85rem; opacity: 0.7; white-space: nowrap; }
.saved-reader .saved-when { margin: 0 0 4px; font-size: 0.85rem; color: var(--lichen); }
.saved-reader .answer { margin-top: 12px; }
.saved-reader .answer ul, .saved-reader .answer ol { padding-left: 1.2em; }
.saved-actions { display: flex; gap: 10px; margin-top: 18px; }
.saved-counts { margin: 0; padding-left: 1.1em; }
.saved-counts a { color: #9fe6f8; }

/* ================= performance: kind to every computer ================= */
/* Long lists aren't laid out or painted until they're scrolled near. */
.seo-index, .kt-cards > li, .deck > li { content-visibility: auto; contain-intrinsic-size: auto 420px; }
/* Low-powered devices (few CPU cores, little memory, or data saver): no looping decoration, no live blur. */
html.ro-lite *, html.ro-lite *::before, html.ro-lite *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.ro-lite .sky::after, html.ro-lite .ap-embers, html.ro-lite .pool-ring, html.ro-lite .pool-ring::before { animation: none !important; }
html.ro-lite .ap-embers { display: none; }
/* After a while with no input, decorative loops pause until you move, scroll, tap or type. */
html.ro-still *, html.ro-still *::before, html.ro-still *::after { animation-play-state: paused !important; }
html.ro-still .thinking *, html.ro-still .dots i, html.ro-still .pulse, html.ro-still .loading .glyph, html.ro-still .reading-wait * { animation-play-state: running !important; }
