:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1d2432;
  background: #fff;
  --border: #d5d9de;
  --soft: #f4f5f7;
  --secondary: #58616d;
  --accent: #244db4;
}
* { box-sizing: border-box; }
body { margin: 0; }
header, main, nav { width: min(100%, 640px); margin-inline: auto; }
header {
  padding: calc(16px + env(safe-area-inset-top)) 20px 14px;
  font-weight: 650;
  border-bottom: 1px solid var(--border);
}
main { padding: 20px 20px calc(92px + env(safe-area-inset-bottom)); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: clamp(25px, 5vw, 31px); }
h2 { font-size: 21px; margin-top: 24px; }
h3 { font-size: 18px; margin-top: 18px; }
p, figcaption, strong, h1, h2 { overflow-wrap: anywhere; }
p { margin: 10px 0 16px; }
small, .item span, .daily-tile span { color: var(--secondary); font-size: 14px; }
small { display: block; margin: 10px 0; }
button, a.primary, input, textarea { font: inherit; }
button, a.primary {
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}
main > button, a.primary, .pages button { display: block; width: 100%; margin: 8px 0; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
a.primary { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; text-align: center; }
button:disabled { background: var(--soft); border-color: var(--border); color: var(--secondary); cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #3170cd; outline-offset: 2px; }
.quiet { background: none; color: var(--accent); border: 0; padding: 8px 0; text-align: left; }
main > .quiet:first-child { width: auto; margin-top: -6px; }
.item, .daily-tile { text-align: left; }
.item strong, .daily-tile strong { display: block; font-weight: 600; }
.item span, .daily-tile span { display: block; }
/* Home */
header { display:flex; align-items:center; min-height:54px; padding:calc(12px + env(safe-area-inset-top)) 20px 12px; font-size:14px; letter-spacing:.075em; font-weight:750; }
main[data-screen=home] { padding-top:16px; }
.icon { display:block; flex:none; width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.feature { position:relative; isolation:isolate; overflow:hidden; background:#202c47; color:#fff; border-radius:18px; padding:23px 19px 18px; }
.feature .feature-symbol { position:absolute; z-index:-1; right:14px; top:21px; width:70px; height:70px; transform:rotate(8deg); color:#92a9db; stroke-width:1.15; }
.feature h1 { max-width:calc(100% - 72px); margin:0; font-size:clamp(24px,6.5vw,31px); line-height:1.15; letter-spacing:-.035em; font-weight:680; }
.feature p { max-width:calc(100% - 68px); margin:8px 0 18px; color:#dbe4f4; font-size:15px; line-height:1.4; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.start { display:flex; align-items:center; justify-content:center; gap:10px; min-height:48px; border:0; width:100%; border-radius:10px; font-weight:650; background:#fff; color:#202c47; }
.start .icon { width:17px; height:17px; }
.shortcuts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.shortcut { background:#f2f5f9; border:0; border-radius:14px; text-align:left; padding:14px; display:grid; justify-items:start; align-content:start; line-height:1.25; }
.shortcut:nth-child(2) { background:#f4f2f8; }
.shortcut .icon { color:#3a5c82; height:24px; width:24px; margin:0 0 12px; }
.shortcut:nth-child(2) .icon { color:#605582; }
.shortcut strong { font-size:16px; font-weight:620; }
.shortcut small { margin:4px 0 0; font-size:13px; }
.group-title { font-weight:660; font-size:18px; margin:22px 0 9px; letter-spacing:-.02em; }
.service-list { border:1px solid #e0e4eb; border-radius:14px; overflow:hidden; }
.service-row { display:grid; grid-template-columns:23px minmax(0,1fr) 15px; gap:12px; width:100%; align-items:center; text-align:left; padding:12px 14px; min-height:52px; border:0; border-radius:0; background:#fff; font-size:15px; font-weight:500; }
.service-row + .service-row { border-top:1px solid #e8ebef; }
.service-row .icon { color:#485871; width:21px; height:21px; }
.service-row .chevron { color:#768192; width:14px; height:14px; }
nav {
  position:fixed; z-index:2; bottom:0; left:50%; transform:translateX(-50%);
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
  background:#fff; border-top:1px solid #e2e6ec;
  padding:4px max(6px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
}
nav button { position:relative; display:grid; justify-items:center; align-content:center; gap:4px; min-height:51px; min-width:0; font-size:12px; line-height:1.2; font-weight:550; padding:5px 2px; border:0; border-radius:8px; color:#606a78; }
nav [aria-current=page] { color:var(--accent); font-weight:700; }
nav [aria-current=page]::before { content:""; position:absolute; top:4px; height:25px; width:42px; background:#e9f0ff; border-radius:12px; }
nav .icon { position:relative; width:21px; height:21px; }
nav [aria-current=page] .icon { stroke-width:2; }
button:active:not(:disabled) { filter:brightness(.94); }
@media (max-width:355px) {
  header { padding-inline:14px; }
  main { padding-inline:14px; }
  .feature { padding:19px 15px 15px; }
  .service-row { gap:9px; }
  .shortcut { padding:12px; }
}
@media (max-height:700px) {
  .feature { padding-block:16px; }
  .feature p { margin-bottom:12px; }
  .shortcut .icon { margin-bottom:6px; }
  .group-title { margin-top:16px; }
}
textarea, input[type=search] { display: block; width: 100%; margin: 8px 0; padding: 12px; color: inherit; background: white; border: 1px solid #a7afb9; border-radius: 6px; }
textarea { resize: vertical; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 3px 1px; margin: 9px 0; }
.filters button { flex: none; font-size: 14px; padding: 7px 12px; }
.filters [aria-pressed=true] { color: var(--accent); border-color: var(--accent); background: #edf4ff; }
.card-list, .arcana-shelf, .faces { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.card-list button, .arcana-shelf button { background: none; border: 0; padding: 4px; }
figure { margin: 0; }
.face { width: 100%; aspect-ratio: 112/197; background-size: 600% 100%; border-radius: 4px; }
figcaption { margin-top: 6px; text-align: center; font-size: 14px; }
.arcana-shelf, .faces { margin: 18px 0; }
.arcana-shelf button { width: min(100%, 104px); justify-self: center; }
.pages { display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; }
.pages section { flex: 0 0 100%; min-width: 0; padding: 4px; scroll-snap-align: start; }
.pages h2 { margin-top: 6px; }
.solo, .card-back { max-width: 150px; margin: 18px auto; }
.card-back { aspect-ratio: 112/197; display: grid; place-items: center; border: 2px solid #a6afbc; border-radius: 6px; color: #4c596b; background: var(--soft); font-size: 32px; }
@media (min-width: 540px) { .card-list { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
main > .club-link { display:grid; grid-template-columns:24px 1fr 16px; align-items:center; gap:12px; padding:12px 14px; min-height:62px; margin:12px 0 0; border-radius:14px; border-color:#e0e4eb; text-align:left; }
.club-link .icon { color:#495d80; }
.club-link small { margin:1px 0 0; font-size:13px; }
.club-link .chevron { width:14px; height:14px; }
.club-plans .item { display:block; width:100%; margin:8px 0; }
.club-plans .plan { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:52px; }
.club-plans .plan span { color:var(--accent); font-weight:650; }
.support-link { display:inline-flex; min-height:44px; align-items:center; color:var(--accent); }
.lesson-steps { padding-left:1.5em; }
.lesson-steps li { margin-bottom:16px; }
.reading-tabs { display:flex; padding:3px; gap:3px; border-radius:12px; background:#f1f3f7; }
.reading-tabs button { width:50%; border:0; border-radius:9px; color:var(--secondary); background:transparent; font-weight:600; }
.reading-tabs [aria-pressed=true] { background:#fff; color:var(--accent); box-shadow:0 1px 3px #202c471a; }
.reading-body [hidden],.clarify [hidden] { display:none; }
.reading-body .primary,.clarify .primary { width:100%; }
.reading-body figure small { text-align:center; line-height:1.35; margin:4px 0; }
.reading-article { margin:22px 0 26px; }
.reading-article h2 { margin-top:6px; }
.reading-article h3 { margin:22px 0 6px; }
.reading-article p { line-height:1.62; }
.reading-article + .reading-article { border-top:1px solid var(--border); padding-top:18px; }
.clarify { margin-top:18px; }
.chat-handoff { padding:12px; border:1px solid var(--border); border-radius:12px; }
