@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #100d16;
  --surface: #191321;
  --surface-elevated: #211827;
  --text: #f7edf1;
  --muted: #b9a8be;
  --accent: #e9c29e;
  --accent-light: #f6d9bd;
  --accent-ink: #2b1723;
  --lavender: #c9b3df;
  --line: #382c3f;
  --line-bright: #675068;
  --focus: #f2cfae;
  --success: #b5d6b0;
  --danger: #f1aeb4;
  --warning: #e9c29e;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 60px #07040cc0;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px));
  --gutter: clamp(16px, 5vw, 48px);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 18% -18%, #422238 0, transparent 48%),
    radial-gradient(ellipse at 92% 42%, #24172d 0, transparent 47%),
    var(--bg);
}
body.dialog-open { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button, a, summary { touch-action: manipulation; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { cursor: progress; opacity: .65; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.07; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 9vw, 5.1rem); letter-spacing: -.068em; }
h2 { font-size: clamp(1.62rem, 6vw, 2.1rem); letter-spacing: -.04em; }
h3 { font-size: clamp(1.32rem, 5vw, 1.8rem); letter-spacing: -.035em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
main:focus, [tabindex="-1"]:focus { outline: none; }
a, button, summary, input, textarea, select { scroll-margin: 8px; }
::selection { color: #211426; background: #e5bdd3; }

.app {
  width: min(100%, 1280px);
  min-height: 100vh;
  margin-inline: auto;
  padding:
    var(--safe-top) max(var(--gutter), var(--safe-right))
    calc(110px + var(--safe-bottom)) max(var(--gutter), var(--safe-left));
}
.masthead {
  min-height: 75px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d4a8c02b;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  min-width: 0;
  color: var(--text);
  font: 400 clamp(1.28rem, 5.5vw, 1.73rem)/1 var(--serif);
  letter-spacing: -.04em;
  white-space: nowrap;
}
.brand img { flex: 0 0 auto; width: clamp(32px, 9vw, 39px); height: auto; }
.access-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent-light);
  padding: 6px 11px;
  border: 1px solid #9b6e6c60;
  border-radius: 100px;
  background: #301e30;
  font-size: .78rem;
  line-height: 1.17;
  text-align: center;
}
.access-link .icon { width: 13px; height: 13px; }
.icon { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.eyebrow {
  color: var(--accent);
  font-size: .72rem;
  line-height: 1.4;
  letter-spacing: .13em;
  font-weight: 600;
  text-transform: uppercase;
}
.page-heading { margin: 26px 0 22px; }
.page-heading .eyebrow { margin-bottom: 7px; }
.page-intro { margin-top: 10px; color: var(--muted); max-width: 46ch; }
.muted { color: var(--muted); }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 17px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  transition: background .18s, border-color .18s, color .18s, transform .17s;
}
.button:active, .icon-button:active, .spread-tile:active, .diary-entry:active { transform: translateY(1px); }
.button .icon { width: 17px; height: 17px; }
.button--outline { background: #2b1f32; border-color: #725671; color: var(--text); }
.button--quiet { background: transparent; border-color: transparent; color: var(--accent-light); padding-inline: 0; }
.button--danger { background: #331e29; color: var(--danger); border-color: #754654; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #2c2034;
  color: var(--accent-light);
  transition: background .18s, border-color .18s;
}
.tag {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid #68506b;
  border-radius: 100px;
  background: #301f37;
  color: var(--lavender);
  font-size: .72rem;
  line-height: 1.2;
}
.tag .icon { width: 13px; height: 13px; }
.mode-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--lavender);
  font-size: .88rem;
}
.mode-notice .icon { width: 16px; height: 16px; }
.signal { display: inline-block; width: 7px; height: 7px; background: var(--lavender); border-radius: 50%; flex: none; }

.navigation {
  position: fixed;
  z-index: 5;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 7px max(8px, var(--safe-right)) calc(7px + var(--safe-bottom)) max(8px, var(--safe-left));
  border-top: 1px solid #79597570;
  background: #1a1322f7;
  box-shadow: 0 -10px 38px #09060d99;
  backdrop-filter: blur(16px);
}
.navigation a {
  display: grid;
  grid-template-rows: 21px auto;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 51px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #bfacc8;
  font-size: .74rem;
  line-height: 1.2;
  transition: color .18s, background .18s;
}
.navigation a .icon { width: 21px; height: 21px; }
.navigation a[aria-current] { color: var(--accent-light); background: #35243a; border-color: #5c3f55; }

.today-layout { display: grid; min-width: 0; gap: 15px; }
.today-layout > *, .today-aside > * { min-width: 0; }
.day-hero {
  --hero-tint: #1d1325;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(205px, 60vw) auto;
  min-width: 0;
  overflow: clip;
  border: 1px solid #a46f7d63;
  border-radius: var(--radius-lg);
  background: var(--hero-tint);
  box-shadow: 0 20px 52px #0a061080;
}
.hero-art {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  background-image:
    linear-gradient(180deg, #1f13292b 0%, #26193228 62%, var(--hero-tint) 100%),
    url("/art/hero.webp"),
    radial-gradient(ellipse at 57% 48%, #724457, #352039 51%, #1d1325 79%);
  background-position: center, 70% 42%, center;
  background-size: cover;
}
.hero-art::before, .hero-art::after {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid #f5bd9a33;
  width: min(72%, 252px);
  aspect-ratio: 1;
  pointer-events: none;
}
.hero-art::after { width: min(81%, 281px); border-style: dashed; border-color: #f5bd9a26; }
.tarot-card {
  position: relative;
  display: block;
  isolation: isolate;
  flex: none;
  overflow: hidden;
  aspect-ratio: 3 / 5;
  width: 100%;
  border: 1px solid #baa283a6;
  border-radius: 7px;
  background: #26142c;
}
.tarot-card img, .tarot-fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.tarot-card img { object-fit: cover; }
.tarot-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-light);
  background:
    radial-gradient(ellipse at center, #b37e8e60, transparent 48%),
    radial-gradient(ellipse at 42% 60%, transparent 26%, #ce9b7844 27%, transparent 28% 34%, #ce9b7830 35%, transparent 36%),
    linear-gradient(160deg, #6e3b54, #35203f 45%, #281a36);
}
.tarot-fallback::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid #dcb48b80;
  border-radius: 3px;
  pointer-events: none;
}
.tarot-fallback .icon { width: 31%; height: 31%; }
.tarot-card--face .tarot-fallback { background-color: #5b3d58; }
.hero-card {
  z-index: 1;
  width: clamp(100px, 35vw, 146px);
  transform: rotate(-10deg) translate(-13%, 1%);
  box-shadow: 1px 14px 38px #08040fd9, 0 0 23px #98708f50;
}
.day-hero--open .hero-card {
  transform: rotate(-5deg) translate(-13%, 1%);
  animation: card-open .52s ease both;
}
@keyframes card-open {
  from { opacity: .4; transform: rotate(-12deg) scale(.88); }
  to { opacity: 1; transform: rotate(-5deg) translate(-13%, 1%); }
}
.hero-content { position: relative; align-self: center; padding: 8px 20px 24px; z-index: 1; }
.hero-sigil {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 9px;
  color: var(--accent);
}
.hero-sigil .icon { width: 18px; height: 18px; }
.hero-content h2 { max-width: 14ch; font-size: clamp(2.27rem, 9vw, 4.24rem); letter-spacing: -.066em; }
.hero-content p { color: #ded0df; max-width: 39ch; margin: 12px 0 19px; overflow-wrap: anywhere; }
.hero-content .button { min-width: min(100%, 206px); }
.day-hero--open .hero-content h2 { font-size: clamp(2.08rem, 7.85vw, 3.68rem); }
.today-aside { display: grid; align-content: start; gap: 12px; }
.aside-feature, .aside-journal, .reflection {
  border: 1px solid var(--line);
  background: #1b1424dd;
  border-radius: var(--radius);
}
.aside-feature {
  padding: 19px;
  background: radial-gradient(ellipse at 94% 1%, #5c3b5370, transparent 65%), #21172b;
}
.aside-icon {
  display: inline-grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #855b7777;
  border-radius: 50%;
  color: var(--accent);
  background: #372638;
}
.aside-feature h2 { margin: 12px 0 7px; }
.aside-feature p, .aside-journal p { color: var(--muted); }
.aside-feature .button { margin-top: 6px; }
.aside-journal { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px; }
.aside-journal h2 { font-size: 1.25rem; margin-bottom: 4px; }
.aside-journal p { font-size: .83rem; overflow-wrap: anywhere; }
.aside-journal .icon-button { color: var(--lavender); }
.today-footnote { margin-top: 20px; color: #af9db5; font-size: .81rem; }
.reflection { margin-top: 15px; padding: 19px; }
.reflection h2 { font-size: 1.5rem; }
.reflection-grid { display: grid; gap: 11px; margin-top: 13px; }
.reflection-grid > div { border-left: 1px solid #8e6a83; padding-left: 11px; }
.reflection-grid p { margin-top: 4px; color: #e6dbe8; overflow-wrap: anywhere; }

.spread-grid { display: grid; gap: 12px; }
.spread-tile {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  min-height: 190px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #58415d;
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  background: radial-gradient(ellipse at 100% 0%, #472b4e99, transparent 70%), #21162a;
  transition: border-color .18s, background .18s, transform .18s;
}
.spread-tile:nth-child(3n + 2) { background: radial-gradient(ellipse at 100% 0%, #4e344c99, transparent 70%), #2c1b2c; }
.spread-tile:nth-child(3n + 3) { background: radial-gradient(ellipse at 100% 0%, #4d325e99, transparent 70%), #241a32; }
.spread-tile__top, .spread-tile__bottom { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.spread-tile__title { display: block; margin-top: 3px; font: 400 clamp(1.49rem, 5vw, 1.94rem)/1.12 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.spread-tile__description { color: #cbbacf; font-size: .9rem; overflow-wrap: anywhere; }
.spread-tile__bottom { color: var(--accent); font-size: .79rem; padding-top: 4px; }
.spread-tile__bottom .icon { width: 18px; }
.spread-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #a67b9790;
  border-radius: 50%;
  background: #49304999;
  color: var(--accent-light);
}

.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.filters button {
  min-height: 44px;
  background: #281f31;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  padding: 7px 11px;
  font-size: .86rem;
  transition: color .18s, border-color .18s, background .18s;
}
.filters button[aria-pressed="true"] {
  background: #39273e;
  color: var(--accent-light);
  border-color: #7d586d;
}
.diary-list { display: grid; gap: 10px; }
.diary-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  text-align: left;
  min-width: 0;
  min-height: 88px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  transition: color .18s, border-color .18s, background .18s;
}
.diary-entry > .icon { color: var(--accent); }
.diary-card { width: 41px; border-radius: 4px; }
.diary-entry__content { display: grid; gap: 3px; min-width: 0; }
.diary-entry__content .eyebrow { font-size: .64rem; }
.diary-entry__title { font: 400 1.38rem/1.15 var(--serif); overflow-wrap: anywhere; }
.diary-entry__note { color: var(--muted); font-size: .84rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.empty-state, .loading-state {
  display: grid;
  justify-items: center;
  justify-content: center;
  align-content: center;
  gap: 13px;
  min-height: 270px;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 50% 0%, #40264699, transparent 75%), var(--surface);
  text-align: center;
}
.empty-state p, .loading-state p { color: var(--muted); max-width: 38ch; }
.empty-state .button { margin-top: 5px; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: var(--accent);
  border-radius: 50%;
  border: 1px solid #795e76;
  background: #36263d;
}
.empty-icon .icon { width: 28px; height: 28px; }
main > .loading-state:first-child, main > .empty-state:first-child { margin-top: 25px; }
.spinner {
  display: block;
  width: 28px;
  height: 28px;
  border: 1px solid #a87a91;
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.return-state h1 { font-size: clamp(2rem, 8.5vw, 3.5rem); }

.profile-layout, .edit-list { display: grid; gap: 12px; }
.profile-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.profile-panel h2 { font-size: 1.6rem; overflow-wrap: anywhere; }
.profile-panel > p { margin-block: 8px; color: var(--muted); }
.identity-panel { display: flex; align-items: center; gap: 14px; }
.identity-panel p, .owner-panel p { color: var(--muted); margin-top: 4px; }
.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 57px;
  height: 57px;
  border: 1px solid #8e6784;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, #653e60, #36273c);
  color: var(--accent-light);
  font: 400 1.32rem/1 var(--serif);
}
.access-panel { background: radial-gradient(ellipse at 100% 0%, #48344e80, transparent 70%), var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.panel-heading > .icon { color: var(--lavender); }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.panel-actions:empty { display: none; }
.trial-terms { color: var(--muted); font-size: .88rem; flex: 0 0 100%; }
.owner-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.form { display: grid; gap: 12px; margin-top: 13px; }
.form > .button { justify-self: start; }
.form label { display: grid; gap: 5px; min-width: 0; color: #e4d6e7; font-size: .9rem; }
.form input:not([type="checkbox"]), .form textarea, .form select {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid #644b68;
  border-radius: 7px;
  color: var(--text);
  background: #15101d;
  padding: 8px 11px;
  font-size: 1rem;
}
.form textarea { resize: vertical; }
.form input::placeholder { color: #9e8aa9; }
.form input[type="file"] { padding: 8px; font-size: .86rem; }
.form input::file-selector-button {
  min-height: 29px;
  border: 1px solid #6d5371;
  border-radius: 4px;
  color: var(--text);
  background: #31213a;
  margin-right: 8px;
}
.field-hint { color: var(--muted); font-size: .78rem; }
.form .switch-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}
.switch-row input {
  position: absolute;
  width: 44px;
  height: 44px;
  right: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-row .switch {
  width: 43px;
  height: 25px;
  border: 1px solid #887292;
  border-radius: 100px;
  background: #302438;
  pointer-events: none;
  transition: background .18s;
}
.switch::after {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  margin: 3px;
  border-radius: 50%;
  background: #e2cde7;
  transition: transform .18s, background .18s;
}
.switch-row input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .switch::after { background: #38233f; transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--focus); outline-offset: 3px; }
.payment-list, .audit-list { display: grid; margin: 0; padding: 0; list-style: none; }
.payment-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.payment-list li:last-child { border-bottom: none; }
.payment-list li > div { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.payment-list li > div + div { justify-items: end; }
.payment-list strong { font-weight: 620; }
.payment-list .muted, .payment-state, .user-list li > span { font-size: .79rem; }
.payment-state { color: var(--warning); text-align: right; }
.payment-state--paid { color: var(--success); }
.payment-state--failed, .payment-state--refunded, .payment-state--chargeback { color: var(--danger); }
.ticket-list { display: grid; gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.ticket-list li {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15101e;
}
.ticket-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-caption .eyebrow { overflow-wrap: anywhere; }
.ticket-list p { overflow-wrap: anywhere; white-space: pre-wrap; }
.ticket-reply { border-left: 1px solid #856681; padding-left: 10px; color: var(--muted); }
.ticket-list .form { margin-top: 4px; }

dialog {
  position: fixed;
  z-index: 10;
  inset: auto max(0px, var(--safe-right)) 0 max(0px, var(--safe-left));
  width: calc(100% - var(--safe-left) - var(--safe-right));
  max-width: none;
  max-height: min(90vh, calc(100dvh - var(--safe-top) - 12px));
  margin: 0;
  padding: 0;
  border: 1px solid #725671;
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
  scroll-padding-block: 16px 75px;
}
dialog[open] { animation: sheet-in .22s ease; }
dialog::backdrop { background: #0a060dd0; backdrop-filter: blur(5px); }
@keyframes sheet-in { from { opacity: .5; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.sheet { padding: 15px 16px calc(17px + var(--safe-bottom)); }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sheet-header h2 { overflow-wrap: anywhere; text-wrap: balance; }
.sheet-header .eyebrow { margin-bottom: 5px; }
.sheet-body { margin-top: 12px; }
.sheet-intro { color: #d1bfd6; margin-bottom: 14px; overflow-wrap: anywhere; }
.sheet-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.sheet-actions p { flex: 0 0 100%; }
.sheet-actions .button { min-width: min(100%, 143px); }
.position-list {
  display: grid;
  gap: 8px;
  padding-left: 23px;
  color: #eadcea;
}
.position-list li { padding-left: 4px; overflow-wrap: anywhere; }
.position-list li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }
.reading-list { display: grid; gap: 9px; }
.reading-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #57405d;
  border-radius: 9px;
  background: #191221;
}
.reading-card p:not(.eyebrow) { color: #cabbd0; overflow-wrap: anywhere; font-size: .89rem; }
.reading-card h3 { margin: 3px 0 7px; overflow-wrap: anywhere; }
.reading-card .eyebrow { font-size: .68rem; overflow-wrap: anywhere; }
.reading-card .reading-prompt { margin-top: 7px; font-style: italic; }
.reading-art { width: 50px; border-radius: 4px; align-self: start; }
.reading-card--open { border-color: #80617d; }
.reading-actions {
  position: sticky;
  bottom: calc(-1 * var(--safe-bottom));
  margin-inline: -16px;
  padding: 9px 16px;
  background: var(--surface-elevated);
  border-top: 1px solid var(--line);
}
.offer-list { display: grid; gap: 8px; }
.offer-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 59px;
  color: var(--text);
  border: 1px solid #6b4d70;
  border-radius: 9px;
  background: #2c2035;
  padding: 11px;
  text-align: left;
}
.offer-choice > span:first-child { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.offer-choice > span:first-child span { color: var(--muted); font-size: .85rem; }
.offer-price { display: flex; flex: none; align-items: center; gap: 5px; color: var(--accent-light); }
.price-large { margin-bottom: 8px; color: var(--accent-light); font: 400 2.2rem/1 var(--serif); }
.price-large ~ p { margin-bottom: 9px; }

.return-link { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; margin-top: 8px; color: var(--accent); }
.return-link .icon { transform: rotate(180deg); }
.return-link + .page-heading { margin-top: 7px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 12px; }
.metrics div { padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.metrics dt { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.metrics dd { font: 400 2rem/1.15 var(--serif); margin: 5px 0 0; color: var(--accent-light); }
.audit-panel { margin-top: 12px; }
.audit-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: .86rem;
  overflow-wrap: anywhere;
}
.audit-list time { color: var(--muted); }
.edit-list details { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.edit-list details summary {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px;
  list-style: none;
  overflow-wrap: anywhere;
}
.edit-list summary::-webkit-details-marker { display: none; }
.edit-list summary > .icon { color: var(--accent); transition: transform .18s; }
.edit-list details[open] summary > .icon { transform: rotate(90deg); }
.editor-card { width: 28px; border-radius: 4px; }
.summary-icon { color: var(--accent); }
.edit-list .form { padding: 0 12px 12px; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(75px + var(--safe-bottom));
  width: max-content;
  max-width: min(420px, calc(100% - 24px));
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast span {
  display: block;
  padding: 10px 14px;
  color: var(--success);
  border: 1px solid #758971;
  border-radius: 8px;
  background: #231b2a;
  box-shadow: 0 7px 25px #0d0814bb;
  font-size: .9rem;
}
.toast.status--error span { color: var(--danger); border-color: #9d6278; }
.dialog-status.is-visible {
  position: sticky;
  z-index: 3;
  top: 5px;
  margin-top: 8px;
  padding: 7px 10px;
  color: var(--success);
  border: 1px solid #758971;
  border-radius: 8px;
  background: #231b2a;
  font-size: .9rem;
}
.dialog-status.status--error { color: var(--danger); border-color: #9d6278; }
.dialog-status.status--assistive {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) {
  .button:not([aria-busy]):hover { background: var(--accent-light); }
  .button.button--outline:hover, .icon-button:hover { background: #422e48; border-color: #947191; }
  .button.button--quiet:hover { background: transparent; color: var(--text); }
  .button.button--danger:hover { background: #4b2836; }
  .access-link:hover, .navigation a:not([aria-current]):hover { background: #3b2440; color: var(--accent-light); }
  .spread-tile:hover, .diary-entry:hover, .offer-choice:hover { border-color: #a2789c; }
  .filters button:hover { border-color: #916d8e; }
}

@media (min-width: 560px) {
  .app { padding-bottom: calc(109px + var(--safe-bottom)); }
  .masthead { min-height: 84px; }
  .access-link { padding-inline: 14px; }
  .page-heading { margin-top: 34px; margin-bottom: 23px; }
  .day-hero { grid-template-rows: minmax(225px, 42vw) auto; }
  .hero-content { padding: 12px 25px 25px; }
  .hero-card { width: 152px; }
  .spread-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spread-tile { padding: 18px; }
  .profile-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .identity-panel, .owner-panel, .user-list, .support-panel { grid-column: 1 / -1; }
  .reflection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .navigation {
    bottom: max(14px, var(--safe-bottom));
    left: 50%;
    right: auto;
    width: min(552px, calc(100% - 32px - var(--safe-left) - var(--safe-right)));
    transform: translateX(-50%);
    border: 1px solid #7558748c;
    border-radius: 16px;
    padding: 6px;
  }
  .navigation a { min-height: 55px; }
  dialog {
    inset: 0;
    margin: auto;
    max-height: min(83vh, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px));
    width: min(520px, calc(100% - 36px));
    border-radius: var(--radius);
    border-bottom: 1px solid #725671;
  }
  .sheet { padding: 19px; }
  .reading-actions { margin-inline: -19px; padding-inline: 19px; bottom: 0; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 720px) {
  .day-hero { grid-template-rows: none; min-height: 360px; }
  .hero-art {
    position: absolute;
    inset: 0;
    place-items: center end;
    padding-inline-end: 9%;
    background-image:
      linear-gradient(90deg, #20152a 0%, #28192c 29%, #291829b5 48%, #29182912 88%),
      url("/art/hero.webp"),
      radial-gradient(ellipse at 80% 42%, #73455e, #37213b 42%, #24182b 76%);
    background-position: center, center, center;
  }
  .hero-art::before, .hero-art::after { left: auto; right: 4.4%; translate: 0 -50%; }
  .hero-art::before { right: 6.3%; }
  .hero-content { max-width: 66%; padding: 25px 30px; }
  .hero-content p { max-width: 34ch; }
  .hero-card { width: clamp(130px, 22vw, 191px); transform: rotate(-10deg) translate(0, 0); }
  .today-aside { grid-template-columns: 1.2fr 1fr; align-items: stretch; }
  .aside-feature, .aside-journal, .reflection { padding: 19px; }
  .reflection { margin-top: 15px; }
  .profile-panel { padding: 21px; }
}

@media (min-width: 980px) {
  .today-layout { grid-template-columns: minmax(0, 2.45fr) minmax(250px, 1fr); gap: 16px; }
  .today-aside { grid-template-columns: none; }
  .day-hero { min-height: 415px; }
  .hero-content { padding: 33px; }
  .hero-content p { margin-block: 14px 22px; }
  .aside-feature { min-height: 255px; padding: 23px; }
  .aside-feature h2 { margin-top: 18px; }
  .aside-feature .button { margin-top: 12px; }
  .aside-journal { min-height: 97px; }
  .spread-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .spread-tile { min-height: 218px; }
  .diary-list { max-width: 850px; }
  .page-heading { margin-top: 39px; }
}

@media (max-width: 370px) {
  .masthead { min-height: 63px; }
  .hero-content { padding-inline: 16px; }
  .reflection, .profile-panel { padding-inline: 13px; }
  .sheet-actions .button { flex: 1 1 100%; }
}

@media (max-width: 420px) and (max-height: 760px) {
  .page-heading { margin-top: 19px; margin-bottom: 16px; }
  .day-hero { grid-template-rows: 190px auto; }
  .hero-card { width: 103px; }
  .hero-content { padding-bottom: 16px; }
  .hero-content p { margin-block: 8px 13px; }
  .hero-sigil { height: 21px; margin-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
