/* Japo site pages. Tokens are the home page's: Haldi (light) and Brahma Muhurta (dark), from docs/DESIGN.md. */
:root {
  --canvas: #FBF6EA;
  --surface: #FFFCF3;
  --raised: #F4EBD6;
  --track: #EADCB8;
  --hairline: #EADFC4;
  --ink: #241C0E;
  --muted: #6E6250;
  --mustard: #D9A21B;
  --accent: #7A560A;
  --wash: #F6E6B4;
  --on-mustard: #241C0E;
  --thread: #D6C49B;
  --knot: #BFA979;
  --glow: rgba(217, 162, 27, 0.55);
  --badge-bg: #241C0E;
  --badge-fg: #FBF6EA;
  --mala-thread: #A3241C;
  --shadow: 0 1px 2px rgba(70, 48, 12, 0.06), 0 10px 26px -14px rgba(70, 48, 12, 0.16);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --sacred: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --gutter: clamp(16px, 5vw, 56px);
  --max: 1160px;
  --head-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #15120D;
    --surface: #221D14;
    --raised: #2C2518;
    --track: #3A3020;
    --hairline: #3A3222;
    --ink: #F3ECDD;
    --muted: #B5A88F;
    --mustard: #E8B84A;
    --accent: #E8B84A;
    --wash: #3A2E12;
    --on-mustard: #15120D;
    --thread: #BCA97F;
    --knot: #8F7D57;
    --glow: rgba(232, 184, 74, 0.45);
    --badge-bg: #F3ECDD;
    --badge-fg: #15120D;
    --mala-thread: #D9524A;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 26px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #15120D;
  --surface: #221D14;
  --raised: #2C2518;
  --track: #3A3020;
  --hairline: #3A3222;
  --ink: #F3ECDD;
  --muted: #B5A88F;
  --mustard: #E8B84A;
  --accent: #E8B84A;
  --wash: #3A2E12;
  --on-mustard: #15120D;
  --thread: #BCA97F;
  --knot: #8F7D57;
  --glow: rgba(232, 184, 74, 0.45);
  --badge-bg: #F3ECDD;
  --badge-fg: #15120D;
  --mala-thread: #D9524A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 26px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sacred { font-family: var(--sacred); font-weight: 400; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
[data-reveal] { transition: opacity 900ms var(--ease), transform 900ms var(--ease); transition-delay: var(--d, 0ms); }
[data-reveal].pre { opacity: 0; transform: translateY(24px); }

/* ---------- Header (same as the home page) ---------- */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  border-bottom: 1px solid transparent; transition: border-color 300ms ease-out, background-color 300ms ease-out;
}
.site-head.scrolled { border-bottom-color: var(--hairline); background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--head-h); gap: 16px; }
.wordmark {
  display: block; width: 84px; height: 33px; background: var(--ink);
  -webkit-mask: url("/assets/japo-wordmark.png") center / contain no-repeat;
  mask: url("/assets/japo-wordmark.png") center / contain no-repeat;
}
.head-nav { display: flex; align-items: center; gap: 4px; }
.head-nav a:not(.head-cta) {
  color: var(--muted); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 999px;
  transition: color 200ms ease-out, background-color 200ms ease-out;
}
.head-nav a:not(.head-cta):hover, .head-nav a[aria-current="page"] { color: var(--ink); background: var(--raised); }
.head-cta {
  font-size: 15px; font-weight: 500; text-decoration: none; padding: 10px 16px; border-radius: 999px;
  background: var(--mustard); color: var(--on-mustard); margin-left: 8px;
  transition: transform 200ms var(--spring), filter 200ms ease-out;
}
.head-cta:hover { transform: translateY(-1px); filter: brightness(0.95); }
.theme-btn {
  width: 44px; height: 44px; margin-left: 4px; border-radius: 999px; border: 1px solid var(--hairline);
  background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer;
  transition: transform 400ms var(--spring), background-color 200ms ease-out;
}
.theme-btn:hover { background: var(--raised); transform: rotate(-20deg); }
.theme-btn svg { width: 20px; height: 20px; grid-area: 1 / 1; transition: transform 500ms var(--spring), opacity 300ms ease-out; }
.theme-btn .moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
  :root:not([data-theme="light"]) .theme-btn .moon { opacity: 1; transform: none; }
}
:root[data-theme="dark"] .theme-btn .sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
:root[data-theme="dark"] .theme-btn .moon { opacity: 1; transform: none; }
.sub-nav { display: none; }

/* ---------- Store badges ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 22px 8px 18px;
  border-radius: 14px; background: var(--badge-bg); color: var(--badge-fg); text-decoration: none;
  transition: transform 250ms var(--spring), filter 200ms ease-out;
}
.badge:hover { transform: translateY(-3px); filter: brightness(1.12); }
.badge svg { width: 26px; height: 26px; flex: none; fill: currentColor; }
.badge span { display: flex; flex-direction: column; line-height: 1.12; }
.badge small { font-size: 11.5px; font-weight: 400; opacity: 0.85; }
.badge strong { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.badge.soon { background: transparent; color: var(--muted); border: 1px dashed var(--track); cursor: default; }
.badge.soon:hover { transform: none; filter: none; }

/* ---------- Buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 0; background: var(--mustard); color: var(--on-mustard); font: 500 15.5px var(--sans);
  text-decoration: none; cursor: pointer; transition: transform 200ms var(--spring), filter 200ms ease-out, background-color 200ms;
}
.btn:hover { transform: translateY(-1px); filter: brightness(0.96); }
.btn:active { transform: scale(0.97); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline); }
.btn-ghost:hover { background: var(--raised); filter: none; }
.btn-large { min-height: 54px; padding-inline: 28px; font-size: 16.5px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; }
select, input[type="number"], input[type="date"], input[type="text"] {
  font: 500 16px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--track);
  border-radius: 12px; padding: 11px 12px; min-height: 46px; width: 100%;
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- Page skeleton ---------- */
.page-wrap { width: 100%; max-width: calc(760px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); padding-top: clamp(20px, 3vw, 40px); }
.page-wrap.wide { max-width: calc(1040px + 2 * var(--gutter)); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "·"; margin-right: 8px; color: var(--knot); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-head { margin: clamp(22px, 3vw, 36px) 0 clamp(26px, 3vw, 40px); }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.page-head h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem); line-height: 1.04; letter-spacing: -0.04em; font-weight: 580; margin: 0; text-wrap: balance;
  animation: rise 900ms var(--ease) both;
}
.lede { color: var(--muted); font-size: clamp(1.08rem, 1.5vw, 1.22rem); margin: 18px 0 0; max-width: 40rem; text-wrap: pretty; animation: rise 900ms var(--ease) 120ms both; }
.byline { font-size: 14px; color: var(--muted); margin: 18px 0 0; animation: rise 900ms var(--ease) 200ms both; }
.byline a { color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* The quick answer: a ledger line with a mustard edge. */
.quick-answer { margin: 0 0 clamp(32px, 4vw, 48px); padding: 4px 0 4px 20px; box-shadow: inset 3px 0 0 var(--mustard); animation: rise 900ms var(--ease) 260ms both; }
.quick-answer .qa-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.quick-answer p:last-child { margin: 0; font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.5; letter-spacing: -0.01em; }

/* ---------- Article: the body hangs on a red thread, one bead per section ---------- */
.prose > * { max-width: 680px; }
.prose h2 { position: relative; font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.15; letter-spacing: -0.03em; font-weight: 580; margin: clamp(44px, 5vw, 60px) 0 14px; text-wrap: balance; scroll-margin-top: calc(var(--head-h) + 20px); }
.prose h3 { font-size: 1.15rem; letter-spacing: -0.015em; font-weight: 600; margin: 30px 0 8px; scroll-margin-top: calc(var(--head-h) + 20px); }
.prose p, .prose li { text-wrap: pretty; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 36px 0; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--raised); padding: 1px 6px; border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 22px 0 26px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; font-size: 13.5px; color: var(--muted); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--track); vertical-align: bottom; }
td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
tbody tr:hover td { background: color-mix(in srgb, var(--wash) 45%, transparent); }
.box { margin: 24px 0; padding: 18px 20px; border-radius: 18px; background: var(--raised); }
.box-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px !important; }
.box p:last-child { margin-bottom: 0; }
.box-verdict { background: var(--wash); }
.box-note { background: transparent; border: 1px dashed var(--track); }

.sources { margin: 44px 0 0; font-size: 14.5px; color: var(--muted); }
.sources h2 { font-size: 13px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--muted); margin: 0 0 10px; }
.sources ul { margin: 0; padding-left: 18px; }
.sources a { color: var(--muted); }

/* ---------- Inline CTA ---------- */
.cta-inline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 30px 0; padding: 18px 20px; border-radius: 20px; background: var(--wash); }
.cta-inline img { width: 44px; height: 44px; animation: spin-slow 14s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.cta-inline p { margin: 0 !important; font-size: 15px; color: var(--muted); }
.cta-inline .cta-inline-title { color: var(--ink); font-weight: 600; font-size: 16px; }

/* ---------- Closing: a mala that fills as it arrives ---------- */
.cta-end {
  margin: clamp(56px, 7vw, 96px) 0 0; border-radius: clamp(24px, 3vw, 40px); background: var(--mustard); color: var(--on-mustard);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 4vw, 56px); box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.45); overflow: hidden;
}
.cta-ring { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1; margin-inline: auto; }
.cta-ring i { position: absolute; width: 3.4%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--on-mustard) 18%, transparent); transform: translate(-50%, -50%) scale(0.7); transition: background-color 250ms, transform 300ms var(--spring); }
.cta-ring i.on { background: var(--on-mustard); transform: translate(-50%, -50%); }
.cta-ring .ring-sumeru { position: absolute; left: 50%; top: 4%; width: 8%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: url("/assets/beads/sumeru.png") center / cover; }
.cta-ring.done { animation: breathe 2.4s var(--ease) 1; }
@keyframes breathe { 50% { transform: scale(1.03); } }
.cta-end-count { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; margin: 0 0 10px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.cta-end h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 580; margin: 0; }
.cta-end-copy > p:not(.cta-end-count) { margin: 16px 0 24px; max-width: 32rem; color: color-mix(in srgb, var(--on-mustard) 78%, transparent); }
.cta-end .badge { background: var(--on-mustard); color: var(--mustard); }
.cta-end .badge.soon { background: transparent; color: var(--on-mustard); border-color: color-mix(in srgb, var(--on-mustard) 45%, transparent); }

/* ---------- Lists of pages: strung like beads ---------- */
.related { margin-top: clamp(56px, 7vw, 88px); }
.related > h2, .hub-group > h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); letter-spacing: -0.03em; font-weight: 580; margin: 0 0 8px; }
.strand-list { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; }
.strand-list::before { content: ""; position: absolute; left: 8px; top: 14px; bottom: 14px; width: 2px; background: var(--thread); }
.strand-list li { position: relative; }
.strand-list li::before { content: ""; position: absolute; left: -30px; top: 24px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--knot); transition: background-color 250ms, border-color 250ms, transform 300ms var(--spring); }
.strand-list li:hover::before { background: var(--mustard); border-color: var(--mustard); transform: scale(1.15); }
.strand-list a { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--hairline); text-decoration: none; color: var(--ink); }
.sl-kind { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.sl-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; transition: color 200ms; }
.strand-list a:hover .sl-title { color: var(--accent); }
.sl-desc { color: var(--muted); font-size: 15px; }
.hub-group { margin-top: clamp(36px, 4vw, 56px); }
.hub-group > p { color: var(--muted); margin: 0 0 8px; }
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px; }
.sitemap-grid h2 { font-size: 1.05rem; margin: 0 0 8px; }
.sitemap-grid ul { margin: 0; padding-left: 18px; font-size: 15px; }
.sitemap-grid li { margin-bottom: 6px; }

/* ---------- Tools ---------- */
.tool { margin: 0 0 clamp(36px, 4vw, 52px); padding: clamp(18px, 3vw, 28px); border-radius: 28px; background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.tool-note { font-size: 14px; color: var(--muted); margin: 16px 0 0; }
@keyframes tick { 0% { transform: translateY(-5px); opacity: 0.6; } 100% { transform: none; opacity: 1; } }
.planner { display: grid; gap: 14px; }
.planner .btn { justify-self: start; }
.planner-out { margin-top: 18px; }
.ledger { margin: 0; }
.ledger .row { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; }
.ledger dt { font-size: 16.5px; flex: 0 1 auto; }
.ledger dt small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.ledger .dots { flex: 1; border-bottom: 2px dotted var(--track); min-width: 24px; align-self: center; }
.ledger dd { margin: 0; font-weight: 600; font-size: 17px; flex: none; font-variant-numeric: tabular-nums; }

/* ---------- Mantra pages ---------- */
.mantra-card { margin: 0 0 clamp(32px, 4vw, 48px); padding: clamp(24px, 4vw, 40px); border-radius: 28px; background: var(--wash); text-align: center; }
.mantra-text { font-family: var(--sacred); font-size: clamp(1.5rem, 4.4vw, 2.6rem); line-height: 1.55; color: var(--ink); margin: 0; white-space: pre-line; }
.mantra-text .w { display: inline-block; animation: w-in 760ms ease both; animation-delay: calc(120ms + var(--i) * 70ms); }
@keyframes w-in { from { opacity: 0; transform: translateY(0.12em); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.mantra-latin { margin: 16px 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); white-space: pre-line; }
.mantra-native { margin: 12px 0 0; font-size: 1.2rem; color: var(--accent); }
.mantra-meta { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.mantra-card .btn { margin-top: 20px; }
.written { margin: 22px 0 28px; border: 1px solid var(--hairline); border-radius: 18px; background: var(--surface); }
.written summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.written summary::-webkit-details-marker { display: none; }
.written summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 1.3rem; line-height: 1; transition: transform 300ms var(--spring); }
.written[open] summary::after { transform: rotate(45deg); }
.written ol { margin: 0; padding: 4px 20px 20px 52px; columns: 2 260px; column-gap: 36px; font-family: var(--sacred); font-size: 1.05rem; }
.written li { break-inside: avoid; margin-bottom: 8px; white-space: pre-line; }
.written li::marker { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
/* ---------- Mantras hub: search, deity portraits and painted cards ---------- */
.mg-tools { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--mg-top, var(--head-h))); z-index: 20; background: var(--canvas); padding-block: 8px 6px; margin-inline: -4px; padding-inline: 4px; }
.mg-row { display: flex; align-items: center; gap: 14px; }
.mg-search { flex: 1; min-width: 0; flex-direction: row; align-items: center; gap: 10px; height: 54px; padding: 0 8px 0 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; color: var(--muted); transition: border-color 200ms, box-shadow 200ms; }
.mg-search:focus-within { border-color: var(--mustard); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mustard) 22%, transparent); }
.mg-search svg { flex: none; }
.mg-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: 400 16.5px var(--sans); color: var(--ink); -webkit-appearance: none; appearance: none; }
.mg-search input::-webkit-search-cancel-button { display: none; }
.mg-search input::placeholder { color: var(--muted); opacity: 0.85; }
.mg-clear { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--raised); color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.mg-count { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mg-rail { display: flex; gap: 12px; overflow-x: auto; padding: 14px 4px 8px; scrollbar-width: none; }
.mg-rail::-webkit-scrollbar { display: none; }
.mg-rail button { flex: none; width: 72px; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--muted); font: 500 12.5px var(--sans); }
.mg-rail button[aria-pressed="true"] { color: var(--ink); }
.mg-disc { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; overflow: hidden; background: var(--raised); box-shadow: 0 0 0 2px var(--canvas), 0 0 0 3px var(--hairline); transition: box-shadow 250ms, transform 350ms var(--spring); }
.mg-disc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-disc.glyph, .mg-pic.glyph { background: radial-gradient(circle at 50% 45%, var(--wash), var(--raised) 75%); color: var(--accent); font-family: var(--sacred), "Noto Sans Gurmukhi", "Noto Serif Tibetan", "Noto Serif TC", serif; line-height: 1; }
.mg-disc.glyph { font-size: 26px; }
.mg-rail button:hover .mg-disc { transform: translateY(-2px); }
.mg-rail button[aria-pressed="true"] .mg-disc { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4.5px var(--mustard); transform: scale(1.06); }
.mg-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.mg-card { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--mg-top, var(--head-h)) + 150px); background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px; overflow: hidden; transition: transform 300ms var(--ease), box-shadow 300ms var(--ease); animation: mg-rise 500ms var(--ease) both; animation-delay: calc(min(var(--n, 0), 16) * 28ms); }
.mg-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
@keyframes mg-rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.mg-open { width: 100%; display: flex; flex-direction: column; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.mg-pic { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3.4; overflow: hidden; background: var(--raised); }
.mg-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; transition: transform 900ms var(--ease); }
.mg-card:hover .mg-pic img { transform: scale(1.05); }
.mg-pic.glyph { font-size: 64px; }
.mg-tag { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--ink); font: 500 12px/1.5 var(--sans); }
.mg-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.mg-first { font-family: var(--sacred); font-size: 1.22rem; line-height: 1.4; color: var(--accent); }
.mg-name { font-weight: 600; letter-spacing: -0.01em; }
.mg-sub { font-size: 13.5px; color: var(--muted); }
.mg-more { padding: 0 16px 18px; }
.mg-js .mg-more { display: none; }
.mg-eyebrow { margin: 0; font-size: 13px; color: var(--muted); }
.mg-title { margin: 2px 0 10px; font-size: 1.5rem; letter-spacing: -0.03em; font-weight: 600; }
.mg-full { margin: 0; font-family: var(--sacred); font-size: 1.4rem; line-height: 1.5; white-space: pre-line; }
.mg-native { margin: 6px 0 0; font-size: 1.2rem; color: var(--accent); }
.mg-latin { margin: 10px 0 0; color: var(--muted); white-space: pre-line; }
.mg-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.mg-credit { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.mg-empty { padding: 32px 0; color: var(--muted); max-width: 32rem; }
.mg-empty b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 4px; }
.mg-sheet { width: min(720px, 100%); max-width: 100%; max-height: 88vh; margin: auto auto 0; padding: 26px max(22px, env(safe-area-inset-left, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink); overflow-y: auto; }
.mg-sheet[open] { animation: mg-up 500ms var(--spring); }
.mg-sheet::backdrop { background: rgba(20, 14, 4, 0.5); animation: mg-fade 300ms ease; }
@keyframes mg-up { from { transform: translateY(100%); } }
@keyframes mg-fade { from { opacity: 0; } }
.mg-x { position: absolute; right: 16px; top: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 18px; z-index: 1; }
.mg-sheet-in { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
.mg-sheet-art .mg-pic { aspect-ratio: 4 / 5; border-radius: 20px; }
.mg-sheet-art .mg-pic.glyph { font-size: 84px; }
.mg-sheet-text .mg-title { padding-right: 40px; }
@media (max-width: 720px) {
  .mg-count { display: none; }
  .mg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mg-card { border-radius: 18px; }
  .mg-body { padding: 12px; }
  .mg-first { font-size: 1.05rem; }
  .mg-name { font-size: 14.5px; }
  .mg-sub { display: none; }
  .mg-sheet-in { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .mg-sheet-art .mg-pic { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-card, .mg-sheet[open], .mg-sheet::backdrop { animation: none; }
}

/* ---------- Footer ---------- */
.site-foot { margin-top: clamp(64px, 8vw, 112px); border-top: 1px solid var(--hairline); padding-block: clamp(40px, 5vw, 64px) 36px; font-size: 14.5px; color: var(--muted); }
.sf-top { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.1fr); gap: clamp(32px, 5vw, 72px); }
.sf-brand p { margin: 16px 0 20px; max-width: 22rem; }
.sf-brand .badge { min-height: 50px; padding: 6px 18px 6px 14px; }
.sf-brand .badge strong { font-size: 16.5px; }
.sf-brand .sf-maker { margin-top: 18px; }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 24px; }
.sf-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sf-col a { color: var(--muted); text-decoration: none; transition: color 200ms; }
.sf-col a:hover, .sf-brand a:not(.badge):hover, .sf-base a:hover { color: var(--ink); }
.sf-title { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.sf-title a { color: var(--ink) !important; }
.sf-brand a:not(.badge), .sf-base a { color: var(--muted); }
.sf-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; margin-top: clamp(36px, 4vw, 56px); padding-top: 22px; border-top: 1px solid var(--hairline); font-size: 13.5px; }

/* ---------- Home page FAQ (the home page loads this file too) ---------- */
.home-faq { padding-block: clamp(44px, 5vw, 72px); }
.home-faq.panel { --pbg: var(--surface); }
.home-faq .hf-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.home-faq h2 { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 560; margin: 0; }
.home-faq .hf-side p { color: var(--muted); margin: 18px 0 0; max-width: 24rem; }
.qa { border-top: 1px solid var(--hairline); }
.qa:last-child { border-bottom: 1px solid var(--hairline); }
.qa summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px 0; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: ""; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; background: url("/assets/beads/rudraksha_0.png") center / cover; filter: grayscale(0.7) opacity(0.6); transition: filter 400ms, transform 500ms var(--spring); }
.qa[open] summary::before { filter: drop-shadow(0 0 5px var(--glow)); transform: rotate(120deg); }
.qa .qa-a { padding: 0 0 18px 36px; color: var(--muted); }
.qa .qa-a p { margin: 0 0 10px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 880px) {
  .head-nav a:not(.head-cta) { display: none; }
  .sub-nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 var(--gutter) 10px; scrollbar-width: none; }
  .sub-nav::-webkit-scrollbar { display: none; }
  .sub-nav a { flex: none; font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hairline); }
  .sub-nav a[aria-current="page"] { color: var(--ink); background: var(--raised); border-color: transparent; }
  .cta-end { grid-template-columns: minmax(0, 1fr); }
  .cta-ring { max-width: 200px; }
  .sf-top { grid-template-columns: minmax(0, 1fr); }
  .home-faq .hf-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .cta-inline { grid-template-columns: auto minmax(0, 1fr); }
  .cta-inline .btn { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .head-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
}

/* ---------- Figures: photos, app screens and diagrams ---------- */
.prose figure { margin: 30px 0; }
.prose figure img { width: 100%; height: auto; border-radius: 20px; background: var(--raised); }
.prose figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.prose figcaption a { color: var(--muted); }
.prose figure.tall { max-width: 360px; }
.prose figure.screen { max-width: 280px; margin-inline: auto; }
.prose figure.screen img { border-radius: 30px; box-shadow: var(--shadow), 0 0 0 1px var(--hairline); background: #0E0C0A; }
.prose figure.screen figcaption { text-align: center; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; margin: 30px 0; align-items: start; }
.fig-row figure { margin: 0; max-width: none; }
.prose .fig-row.screen-row { max-width: 600px; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--sans); }
.dg-bead { fill: var(--knot); }
.dg-hi { fill: var(--mustard); }
.dg-thread { fill: none; stroke: var(--mala-thread); stroke-width: 1.4; opacity: 0.7; }
.dg-sumeru { fill: var(--mala-thread); }
.dg-band { fill: var(--mustard); }
.dg-tassel { fill: none; stroke: var(--mustard); stroke-width: 2.2; stroke-linecap: round; }
.dg-arrow, .dg-lead { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 4; }
.dg-headfill { fill: var(--muted); }
.dg-t { font-size: 15px; font-weight: 600; fill: var(--ink); }
.dg-s { font-size: 13px; fill: var(--muted); }
.dg-n { font-size: 13px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.dg-finger, .dg-thumb, .dg-head { fill: var(--raised); stroke: var(--track); stroke-width: 1.5; }
.dg-crease { stroke: var(--track); stroke-width: 1.5; }
.dg-joint { fill: var(--surface); stroke: var(--knot); stroke-width: 1.2; }
.dg-wave { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.dg-inner { fill: var(--mustard); opacity: 0.85; }
.dg-inner2 { fill: none; stroke: var(--mustard); stroke-width: 1.5; opacity: 0.5; }
.diagram .dg-bead, .diagram .dg-hi { transition: transform 400ms var(--spring); }
@media (max-width: 620px) {
  .diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-right: calc(-1 * var(--gutter)); }
  .diagram svg { min-width: 540px; }
  .diagram figcaption { margin-right: var(--gutter); }
}

/* ---------- Strand: the article layout ---------- */
.art-wrap { width: 100%; max-width: calc(1120px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); padding-top: clamp(20px, 3vw, 40px); }
.art-head { max-width: 760px; margin: clamp(12px, 3vw, 32px) auto clamp(24px, 3vw, 32px); }
.art-head h1 { font-size: clamp(2.3rem, 6vw, 4.1rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 600; margin: 16px 0 0; text-wrap: balance; animation: rise 900ms var(--ease) both; }
.art-head h1 em { font-style: normal; font-weight: 400; color: var(--muted); }
.art-head .byline { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.art-hero { margin: 0 0 8px; }
.art-hero img { width: 100%; height: auto; max-height: 540px; object-fit: cover; border-radius: clamp(20px, 3vw, 30px); display: block; background: var(--raised); animation: rise 1000ms var(--ease) 200ms both; }
.art-hero figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.art-hero figcaption a { color: var(--muted); }
.art-layout { display: grid; grid-template-columns: 190px minmax(0, 720px); gap: 56px; justify-content: center; margin-top: clamp(36px, 5vw, 56px); }
.art-layout.no-aside { grid-template-columns: minmax(0, 720px); }
.art-mala { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--head-h) + 20px); align-self: start; display: flex; gap: 16px; }
.art-strand { position: relative; width: 22px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; padding-block: 4px; }
.art-strand::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--mala-thread); opacity: 0.6; }
.art-strand i { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--track); transition: background-color 300ms, transform 300ms var(--spring); }
.art-strand i.on { background: var(--knot); }
.art-strand i.now { background: var(--mustard); transform: scale(1.35); }
.art-strand b { position: relative; width: 20px; height: 20px; border-radius: 50%; margin-top: 4px; background: url("/assets/beads/sumeru.png") center / cover; }
.art-side { min-width: 0; }
.art-toc { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 1.35; display: grid; gap: 10px; }
.art-toc a { color: var(--muted); text-decoration: none; transition: color 200ms; }
.art-toc a:hover { color: var(--ink); }
.art-toc a.here { color: var(--ink); font-weight: 600; }
.art-count { font-family: var(--mono); font-size: 12px; color: var(--accent); margin: 18px 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.article .cta-end { margin-top: clamp(56px, 7vw, 80px); }
.prose h2 small { display: block; font-family: var(--sacred); font-weight: 400; font-size: 0.62em; color: var(--accent); letter-spacing: 0; margin-bottom: 6px; }
.prose blockquote { margin: 40px 0; padding: 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.3; letter-spacing: -0.03em; font-weight: 500; color: var(--ink); max-width: 30ch; text-wrap: balance; }
.prose blockquote::before { content: ""; display: block; width: 40px; height: 2px; background: var(--mala-thread); margin-bottom: 16px; }
.prose blockquote p { margin: 0; }
@media (max-width: 900px) {
  .art-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .art-mala { position: fixed; top: auto; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); transform: translateX(-50%); z-index: 25; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow); }
  .art-strand { flex-direction: row; width: auto; height: 14px; gap: 3px; padding: 0; }
  .art-strand::before { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 2px; margin: -1px 0 0; }
  .art-strand i { width: 7px; height: 7px; }
  .art-strand b { width: 12px; height: 12px; margin: 0 0 0 4px; }
  .art-toc { display: none; }
  .art-count { margin: 0; }
}

/* ---------- Comparison tables: our row, and yes / no cells ---------- */
tbody tr.ours td { background: var(--wash); font-weight: 500; }
tbody tr.ours td:first-child { box-shadow: inset 3px 0 0 var(--mustard); padding-left: 12px; border-radius: 10px 0 0 10px; }
tbody tr.ours td:last-child { border-radius: 0 10px 10px 0; }
tbody tr.ours:hover td { background: var(--wash); }
td.yes, td.no { white-space: nowrap; font-weight: 500; }
td.yes::before, td.no::before { display: inline-block; width: 1.3em; font-weight: 700; }
td.yes::before { content: "✓"; color: var(--accent); }
td.no::before { content: "✕"; color: var(--muted); }
td.no { color: var(--muted); }
.box-ours { background: var(--wash); box-shadow: inset 3px 0 0 var(--mustard); border-radius: 0 18px 18px 0; }
.box-ours p { font-size: 1.08rem; }

/* ---------- The likhita page (the online japa counter) ----------
   Controls on the left, a notebook page on the right. The paper stays light in both themes. */
.lk { --paper: #FFFDF5; --paper-edge: #EFE4C8; --rule: #E2D3AE; --pen: #2A2116; --red: #B3261E;
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; margin: 0 0 clamp(40px, 5vw, 64px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lk { --paper: #F1E8D2; --paper-edge: #CDBE9A; --rule: #D6C59E; --red: #A8231B; } }
:root[data-theme="dark"] .lk { --paper: #F1E8D2; --paper-edge: #CDBE9A; --rule: #D6C59E; --red: #A8231B; }
.lk > *, .lk-sec { min-width: 0; }
.lk-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--head-h) + 16px); display: grid; gap: 20px; }
.lk-sec h2 { margin: 0 0 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.lk-names { display: grid; gap: 2px; }
.lk-names button { display: grid; grid-template-columns: 4.4em minmax(0, 1fr); align-items: baseline; gap: 10px; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 12px; cursor: pointer; color: var(--ink); font: inherit; }
.lk-names button b { font-family: var(--sacred); font-weight: 400; font-size: 1.25rem; line-height: 1.2; }
.lk-names button span { font-size: 13px; color: var(--muted); }
.lk-names button[aria-pressed="true"] { background: var(--wash); }
.lk-names button[aria-pressed="true"] b { color: var(--accent); }
.lk-pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lk-pics button { border: 1px solid var(--hairline); background: var(--surface); border-radius: 14px; padding: 6px 6px 8px; cursor: pointer; text-align: left; display: grid; gap: 6px; color: var(--ink); font: inherit; transition: border-color 200ms, transform 250ms var(--spring); }
.lk-pics button:hover { transform: translateY(-2px); }
.lk-pics button[aria-pressed="true"] { border-color: var(--mustard); box-shadow: 0 0 0 1px var(--mustard); }
.lk-pics b { font-size: 13px; font-weight: 600; padding-inline: 2px; line-height: 1.2; }
.lk-pics small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.lk-mini { display: block; width: 100%; height: auto; border-radius: 9px; background: var(--paper); }
.lk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lk-btn { border: 1px solid var(--hairline); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 14px; }
.lk-status { font-size: 14px; color: var(--muted); }
.lk-status b { color: var(--ink); font-weight: 600; }
.lk-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lk-thumb { position: relative; border-radius: 4px 7px 7px 4px; overflow: hidden; background: var(--paper); box-shadow: 0 1px 0 var(--paper-edge), 0 6px 14px -8px rgba(0, 0, 0, 0.35); animation: lk-arrive 700ms var(--spring) both; }
.lk-thumb .lk-mini { border-radius: 0; }
.lk-thumb b { position: absolute; right: 3px; top: 3px; font-family: var(--mono); font-size: 10px; font-weight: 500; background: var(--ink); color: var(--canvas); border-radius: 999px; padding: 0 5px; }
.lk-thumb.empty { box-shadow: none; background: transparent; border: 1.5px dashed var(--track); aspect-ratio: 1.49; display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; padding: 4px; animation: none; grid-column: 1 / -1; }
@keyframes lk-arrive { from { transform: translateX(80px) rotate(6deg) scale(1.4); opacity: 0; } }
.lk-page { position: relative; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; background: var(--paper); color: var(--pen); border-radius: 6px 18px 18px 6px; padding: clamp(16px, 3vw, 28px) clamp(14px, 3vw, 28px) clamp(16px, 3vw, 24px) clamp(40px, 5vw, 56px); box-shadow: 0 1px 0 var(--paper-edge), 0 2px 0 var(--paper), 0 3px 0 var(--paper-edge), 0 24px 50px -30px rgba(40, 28, 8, 0.6); transform-origin: 0 50%; outline: none; }
.lk-page:focus-visible { box-shadow: 0 0 0 2px var(--mustard), 0 24px 50px -30px rgba(40, 28, 8, 0.6); }
.lk-page::before { content: ""; position: absolute; left: clamp(18px, 2.4vw, 26px); top: 18px; bottom: 18px; width: 1.5px; background: var(--red); opacity: 0.55; }
.lk-hole { position: absolute; left: clamp(8px, 1.2vw, 12px); width: 10px; height: 10px; border-radius: 50%; background: var(--canvas); box-shadow: inset 0 0 0 1.5px var(--paper-edge); }
.lk-page.out { animation: lk-out 650ms var(--ease) forwards; }
.lk-page.in { animation: lk-in 500ms var(--ease) both; }
@keyframes lk-out { to { transform: translateX(-45%) rotate(-5deg) scale(0.35); opacity: 0; } }
@keyframes lk-in { from { transform: translateY(12px); opacity: 0; } }
.lk-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: end; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--red); }
.lk-title { font-family: var(--sacred); font-size: clamp(1.3rem, 3vw, 1.9rem); color: var(--red); line-height: 1.2; }
.lk-date { font-size: 12.5px; color: #6E6250; text-align: right; }
.lk-date b { display: block; font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--pen); }
.lk-grid { position: relative; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.lk-grid span { position: relative; aspect-ratio: 1.12; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.lk-grid span.next { background: color-mix(in srgb, var(--mustard) 20%, transparent); }
.lk-grid span.next::before { content: ""; position: absolute; left: 50%; bottom: 18%; width: 30%; height: 2px; margin-left: -15%; background: var(--mustard); animation: lk-blink 1.1s steps(2) infinite; }
@keyframes lk-blink { 50% { opacity: 0; } }
.lk-grid span.fill { background: var(--fc); border-color: color-mix(in srgb, var(--fc) 70%, #000 8%); }
.lk-grid span.fill em { color: var(--tc); text-shadow: none; }
.lk-grid span.fill.w { animation: lk-dye 520ms var(--ease) both; }
@keyframes lk-dye { from { background: var(--paper); } }
.lk-grid em { font-style: normal; font-family: var(--sacred); font-size: var(--fs); line-height: 1; white-space: nowrap; color: var(--pen); transform: rotate(var(--r)) translate(var(--x), var(--y)); }
.lk-grid em.w { animation: lk-write 420ms var(--ease) both; }
@keyframes lk-write { from { clip-path: inset(0 100% 0 0); opacity: 0.4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.lk-grid span.erase em { animation: lk-erase 260ms var(--ease) forwards; }
@keyframes lk-erase { to { opacity: 0; filter: blur(3px); transform: scale(0.8); } }
.lk-say { margin: 12px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.lk-kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--track); background: var(--surface); }
.lk-writebar { display: none; }
.lk-done { display: none; margin-top: 18px; padding: 16px 18px; border-radius: 18px; background: var(--wash); align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.lk-done.show { display: flex; animation: lk-in 500ms var(--ease) both; }
.lk-done p { margin: 0; max-width: 40rem; font-size: 15px; }
.lk-done b { display: block; }
.art-tool { max-width: 1120px; margin: clamp(8px, 2vw, 20px) auto 0; }
@media (max-width: 820px) {
  .lk { grid-template-columns: minmax(0, 1fr); }
  .lk-side { position: static; gap: 14px; }
  .lk-names { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .lk-names button { flex: none; grid-template-columns: auto; gap: 0; text-align: center; }
  .lk-pics { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .lk-pics button { flex: none; width: 130px; }
  .lk-stack-sec { order: 9; }
  .lk-stack { grid-template-columns: repeat(auto-fill, 76px); }
  .lk-writebar { display: flex; position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 5; gap: 10px; margin-top: 14px; }
  .lk-writebar button { flex: 1; border: 0; border-radius: 18px; padding: 16px; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; }
  .lk-wbtn { background: var(--mustard); color: var(--on-mustard); }
  .lk-ubtn { flex: 0 0 auto !important; background: var(--surface); color: var(--ink); border: 1px solid var(--hairline) !important; padding-inline: 20px !important; }
  .lk-keys { display: none; }
}
/* On phones the likhita page's write bar takes the bottom of the screen, so the reading pill steps aside. */
@media (max-width: 900px) { body:has(.lk) .art-mala { display: none; } }
