/* ============================================================
   VIDYA-ASHRAM · design system v2 — "Night Sanctum"
   Dark-first, lamplit. One stylesheet owns the whole app:
   tokens, shell, components, and every page's layout.
   Light ("day") mode = html.light overrides of the same tokens.
   ============================================================ */

/* ---------- fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400i-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400i-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500i-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500i-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400i-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400i-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/eb-garamond-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/eb-garamond-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-devanagari-400-devanagari.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-devanagari-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/noto-serif-devanagari-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/noto-serif-devanagari-600-devanagari.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/noto-serif-devanagari-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/noto-serif-devanagari-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ---------- tokens ---------- */
:root {
  /* night sanctum (default) */
  --bg:        #171109;
  --bg-raise:  #1f1810;
  --surface:   #251c11;
  --surface-2: #2d2316;
  --line:      #3d3120;
  --line-soft: #2e2517;
  --ink:       #efe5d0;
  --ink-soft:  #c9b791;
  --ink-dim:   #97815d;
  --flame:     #ffa040;
  --flame-hi:  #ffc073;
  --flame-deep:#e07b1f;
  --gold:      #d4a94e;
  --gold-dim:  #8a6f35;
  --user-bubble: #4a2413;
  --ok:        #7fb069;
  --warn:      #d9822b;
  --danger:    #c65b4e;
  --glow:      rgba(255, 160, 64, .10);
  --shadow:    0 10px 40px rgba(0,0,0,.45);
  --display: 'Cormorant Garamond', Georgia, serif;
  --body:    'EB Garamond', Georgia, serif;
  --sanskrit:'Noto Serif Devanagari', 'Cormorant Garamond', serif;
  --ui:      ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --shell-h: 60px;
  color-scheme: dark;
}

html.light {
  /* day courtyard — muted sand, not glaring cream */
  --bg:        #e8dbbf;
  --bg-raise:  #dfceac;
  --surface:   #f0e6cf;
  --surface-2: #e9d9b7;
  --line:      #c9b183;
  --line-soft: #d8c49a;
  --ink:       #2b2013;
  --ink-soft:  #4f3d27;
  --ink-dim:   #7a6344;
  --flame:     #a84c08;
  --flame-hi:  #c96a12;
  --flame-deep:#833a05;
  --gold:      #8f6b23;
  --gold-dim:  #ab8c4c;
  --user-bubble: #e6d1ab;
  --glow:      rgba(168, 76, 8, .06);
  --shadow:    0 8px 30px rgba(60, 40, 15, .16);
  color-scheme: light;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--shell-h);
}

/* lamplight scene behind everything */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60rem 34rem at 50% -8rem, var(--glow), transparent 70%),
    radial-gradient(42rem 30rem at 88% 110%, var(--glow), transparent 70%),
    var(--bg);
}

img, svg { max-width: 100%; display: block; }
a { color: var(--flame); text-decoration: none; }
a:hover { color: var(--flame-hi); }
::selection { background: var(--flame-deep); color: #fff8ec; }

/* keyboard focus — visible, warm, never on mouse clicks */
:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 2px;
  border-radius: 4px;
}

/* gentle loading shimmer for placeholder text */
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.25; color: var(--ink); }

.sanskrit { font-family: var(--sanskrit); }

/* eyebrow label */
.eyebrow {
  font-family: var(--ui);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ornament divider:  ──── ◆ ──── */
.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: .9rem; margin: 1.6rem auto;
  width: min(260px, 60%);
}
.ornament::before, .ornament::after {
  content: ''; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.ornament::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }
.ornament i {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: var(--gold); border-radius: 1px;
  box-shadow: 0 0 12px var(--glow);
}

/* ---------- shell: top bar ---------- */
.shell {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--shell-h);
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0 clamp(1rem, 4vw, 2.2rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.shell-brand {
  display: flex; align-items: center; gap: .6rem;
  color: var(--ink); white-space: nowrap;
}
.shell-brand:hover { color: var(--ink); }
.shell-brand .mark { width: 26px; height: 26px; color: var(--flame); }
.shell-brand .word {
  font-family: var(--display); font-size: 1.18rem; letter-spacing: .05em;
}
.shell-brand .word b { font-weight: 600; color: var(--gold); }

.shell-nav { display: flex; gap: .2rem; margin-left: 1rem; flex: 1; }
.shell-nav a {
  position: relative;
  padding: .42rem .85rem;
  color: var(--ink-dim);
  font-family: var(--display); font-size: 1.02rem; letter-spacing: .04em;
  border-radius: 999px;
  transition: color .2s;
}
.shell-nav a small {
  font-family: var(--ui); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; margin-left: .35rem; opacity: .65;
}
.shell-nav a:hover { color: var(--ink); }
.shell-nav a.active { color: var(--flame); }
.shell-nav a.active::after {
  content: ''; position: absolute; left: 1rem; right: 1rem; bottom: .05rem;
  height: 1px; background: var(--flame);
  box-shadow: 0 0 8px var(--flame);
}

.shell-actions { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.shell-btn {
  background: none; border: 1px solid var(--line); cursor: pointer;
  color: var(--ink-dim); border-radius: 999px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
}
.shell-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
.shell-btn svg { width: 17px; height: 17px; }
.shell-out {
  font-family: var(--ui); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-dim);
  padding: .4rem .6rem; border-radius: 8px;
}
.shell-out:hover { color: var(--ink-soft); }

/* ---------- shell: mobile bottom tabs ---------- */
.tabs { display: none; }
@media (max-width: 760px) {
  .shell-nav, .shell-out { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-soft);
  }
  .tabs a {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-dim);
    font-family: var(--ui); font-size: .6rem;
    letter-spacing: .1em; text-transform: uppercase;
  }
  .tabs a svg { width: 21px; height: 21px; }
  .tabs a.active { color: var(--flame); }
}

/* ---------- buttons / chips / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--display); font-size: 1.02rem; letter-spacing: .03em;
  padding: .62rem 1.5rem; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
  transition: all .22s ease;
}
.btn-flame {
  background: linear-gradient(160deg, var(--flame-hi), var(--flame-deep));
  color: #241102; font-weight: 600;
  box-shadow: 0 4px 18px rgba(224, 123, 31, .25);
}
.btn-flame:hover { filter: brightness(1.1); transform: translateY(-1px); color: #241102; }
.btn-flame:disabled { filter: saturate(.3) brightness(.8); cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent; color: var(--gold);
  border-color: var(--gold-dim);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--glow); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }

textarea, input[type="text"] {
  width: 100%;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-family: var(--body); font-size: 1.02rem; line-height: 1.7;
  padding: .85rem 1.05rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea:focus, input[type="text"]:focus {
  border-color: var(--flame-deep);
  box-shadow: 0 0 0 3px var(--glow);
}
textarea::placeholder, input::placeholder { color: var(--ink-dim); font-style: italic; }

/* panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* verse / theme chips */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--ui); font-size: .66rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); background: var(--glow);
  border: 1px solid var(--gold-dim);
  padding: .28rem .75rem; border-radius: 999px;
}
a.chip:hover { border-color: var(--gold); color: var(--gold); }

/* source tags (RAG citations) */
.sources { margin-top: .8rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.source-tag {
  font-family: var(--ui); font-size: .7rem; letter-spacing: .03em;
  color: var(--gold); background: transparent;
  border: 1px solid var(--gold-dim);
  padding: .26rem .7rem; border-radius: 999px;
  transition: all .2s;
}
.source-tag:hover { background: var(--glow); border-color: var(--gold); color: var(--gold); }

.muted { color: var(--ink-dim); font-style: italic; }

/* page container */
.page { max-width: 860px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.5rem) 1.2rem 4rem; }

/* path marker — Devanagari initial in a gold ring (section headers) */
.path-head { text-align: center; margin: 1.5rem 0 2.2rem; }
.path-head .ring {
  width: 58px; height: 58px; margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-dim); border-radius: 50%;
  font-family: var(--sanskrit); font-size: 1.5rem; color: var(--gold);
  box-shadow: 0 0 24px var(--glow), inset 0 0 14px var(--glow);
}
.path-head h1 { font-size: 2.1rem; letter-spacing: .04em; }
.path-head h1 small {
  display: block; font-family: var(--ui); font-size: .64rem; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase; color: var(--ink-dim);
  margin-top: .35rem;
}

/* ============================================================
   HOME — the sanctum
   ============================================================ */
.hero {
  text-align: center;
  padding: clamp(2rem, 7vh, 4.5rem) 1rem 1rem;
  max-width: 720px; margin: 0 auto;
}
.hero .diya { width: 54px; height: 54px; margin: 0 auto 1.1rem; color: var(--flame); }
.hero .diya .fl { animation: flicker 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  font-weight: 500; letter-spacing: .07em;
}
.hero-tag {
  font-family: var(--display); font-style: italic;
  color: var(--ink-dim); font-size: 1.08rem;
  margin: .15rem 0 1.4rem;
}
.hero-greet {
  font-family: var(--display); font-style: italic;
  color: var(--ink-dim); font-size: 1.02rem;
  margin-bottom: .5rem;
}
.hero-greet .sanskrit { font-style: normal; color: var(--gold-dim); margin-right: .4rem; }
.hero-day { margin-bottom: 1.6rem; }
.hero-sanskrit {
  font-family: var(--sanskrit);
  font-size: clamp(1.45rem, 4.2vw, 2.15rem);
  line-height: 1.85;
  color: var(--ink);
  text-shadow: 0 0 34px var(--glow);
  margin: 0 auto 1.1rem;
}
.hero-english {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.08rem, 2.6vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 34em; margin: 0 auto .6rem;
}
.hero-source { font-family: var(--ui); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }
.hero-teaching {
  max-width: 36em; margin: 1.8rem auto 0;
  text-align: left; color: var(--ink-soft); font-size: 1.06rem;
}
.hero-reflection {
  max-width: 34em; margin: 1.6rem auto 0;
  padding: 1rem 1.3rem;
  border-left: 2px solid var(--gold-dim);
  text-align: left;
  font-family: var(--display); font-style: italic; font-size: 1.08rem;
  color: var(--gold);
}
.hero-loading { padding: 3rem 0; }

/* continue strip */
.continue { max-width: 720px; margin: 2.6rem auto 0; display: grid; gap: .7rem; }
.continue a {
  display: flex; align-items: center; gap: 1rem;
  padding: .95rem 1.25rem;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px;
  color: var(--ink-soft);
  transition: border-color .22s, transform .22s;
}
.continue a:hover { border-color: var(--gold-dim); transform: translateY(-1px); color: var(--ink-soft); }
.continue .c-label {
  min-width: 150px;
}
.continue .c-label .en {
  font-family: var(--ui); font-size: .64rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
  display: block; line-height: 1.6;
}
.continue .c-label .devan { font-family: var(--sanskrit); color: var(--ink-dim); font-size: .92rem; }
.continue .c-body { flex: 1; font-size: .98rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue .c-go { color: var(--flame); font-family: var(--display); white-space: nowrap; }

/* the three paths */
.paths { max-width: 720px; margin: 3rem auto 0; display: grid; gap: 1rem; }
.paths-title {
  font-family: var(--ui); font-size: .66rem; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase; color: var(--ink-dim);
  text-align: center; margin-bottom: .2rem;
}
.path {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 1.2rem;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  color: var(--ink);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.path:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.path .p-icon {
  flex: none; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-dim); border-radius: 50%;
  color: var(--gold);
  box-shadow: inset 0 0 12px var(--glow);
}
.path .p-icon svg { width: 22px; height: 22px; }
.path .p-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.path .aksara {
  position: absolute; right: 4.8rem; top: 50%; transform: translateY(-50%);
  font-family: var(--sanskrit); font-size: 2.7rem; line-height: 1;
  color: var(--gold); opacity: .12; white-space: nowrap;
  transition: opacity .25s;
  pointer-events: none;
}
.path:hover .aksara { opacity: .22; }
.path h2 { font-size: 1.5rem; letter-spacing: .03em; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.path h2 small {
  font-family: var(--ui); font-size: .62rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
}
.path p { color: var(--ink-dim); font-size: .96rem; margin-top: .3rem; max-width: 26em; }
.path .go {
  flex: none; position: relative; z-index: 1;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-dim);
  background: var(--bg-raise);
  color: var(--flame); font-family: var(--display); font-size: 1.15rem;
  transition: all .25s;
}
.path:hover .go { background: var(--glow); border-color: var(--gold); transform: translateX(3px); }
@media (max-width: 560px) {
  .path { padding: 1.25rem 1.3rem; gap: .9rem; }
  .path .aksara { display: none; }
  .path p { display: none; }
  .path .p-icon { width: 40px; height: 40px; }
}

/* footer */
.site-footer {
  max-width: 720px; margin: 3.5rem auto 0; text-align: center;
  padding-top: 1.6rem; border-top: 1px solid var(--line-soft);
}
.site-footer .shanti { font-family: var(--sanskrit); color: var(--gold-dim); letter-spacing: .2em; margin-bottom: .8rem; }
.site-footer .disclaimer {
  font-family: var(--ui); font-size: .72rem; color: var(--ink-dim);
  max-width: 46em; margin: 0 auto .5rem; line-height: 1.6;
}
.site-footer .foot-links { font-family: var(--ui); font-size: .74rem; }
.site-footer .foot-links a { color: var(--ink-dim); }
.site-footer .foot-links a:hover { color: var(--gold); }

/* ============================================================
   VIDYA — the library & the manuscript
   ============================================================ */
.lessons { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.lesson-row {
  display: flex; align-items: baseline; gap: 1.3rem;
  padding: 1.05rem .6rem;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .2s, padding-left .2s;
}
.lesson-row:hover { background: var(--glow); padding-left: 1rem; }
.lesson-row .no {
  font-family: var(--display); font-size: 1.3rem; color: var(--gold);
  min-width: 2rem; text-align: right;
}
.lesson-row .t { flex: 1; }
.lesson-row .t .title { font-family: var(--display); font-size: 1.22rem; line-height: 1.35; }
.lesson-row .t .verse { font-family: var(--ui); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-top: .15rem; }
.lesson-row .arrow { color: var(--flame); opacity: .4; transition: opacity .2s; }
.lesson-row:hover .arrow { opacity: 1; }
.lesson-row .done { color: var(--gold); font-size: .85rem; visibility: hidden; }
.lesson-row.read .done { visibility: visible; }
.lesson-row.read .no { color: var(--gold-dim); }

/* "continue reading" chip above the library */
.continue-reading {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: 1.4rem; padding: .8rem 1.2rem;
  background: var(--surface); border: 1px solid var(--gold-dim); border-radius: 14px;
  color: var(--ink-soft); cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.continue-reading:hover { border-color: var(--gold); transform: translateY(-1px); }
.continue-reading .cr-label {
  font-family: var(--ui); font-size: .62rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
  white-space: nowrap;
}
.continue-reading .cr-title { flex: 1; font-family: var(--display); font-size: 1.08rem; }
.continue-reading .cr-go { color: var(--flame); }

/* reader */
.reader-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1.4rem;
  font-family: var(--ui); font-size: .78rem;
}
.reader-bar a { color: var(--ink-dim); letter-spacing: .06em; }
.reader-bar a:hover { color: var(--flame); }
.reader-bar .disabled { visibility: hidden; }

.reader { padding: clamp(1.6rem, 5vw, 3rem); }
.reader h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: .7rem; }
.reader .chip { margin-bottom: 1.8rem; }
.reader h2 { font-size: 1.35rem; color: var(--gold); margin: 2.2rem 0 .8rem; }
.reader h3 { font-size: 1.15rem; color: var(--gold); margin: 1.8rem 0 .6rem; }
.reader p { margin-bottom: 1.05rem; color: var(--ink-soft); }
.reader > p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 3.1em; line-height: .82;
  float: left; padding: .08em .12em 0 0;
  color: var(--flame);
}
.reader em { color: var(--gold); }
.reader strong { color: var(--flame); font-weight: 500; }
.reader hr { border: none; margin: 2rem auto; }
.reader hr::after {
  content: '◆'; display: block; text-align: center;
  color: var(--gold-dim); font-size: .6rem; letter-spacing: 1em;
}
.reader-loading { text-align: center; padding: 3.5rem 1rem; }

/* study panel */
.study { margin-top: 2.4rem; padding-top: 1.8rem; border-top: 1px solid var(--line-soft); }
.study-title {
  font-family: var(--ui); font-size: .66rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  margin: 1.6rem 0 .8rem;
}
.reflect-list { margin: .6rem 0 0 1.2rem; color: var(--ink-soft); }
.reflect-list li { margin-bottom: .6rem; }
.ask-row { display: flex; gap: .6rem; }
.ask-row input { flex: 1; border-radius: 999px; padding: .6rem 1.1rem; }
.ask-answer { margin-top: 1rem; white-space: pre-wrap; color: var(--ink-soft); }

/* ============================================================
   SĀDHANĀ — the ritual journal
   ============================================================ */
.seg {
  display: flex; justify-content: center; gap: 0;
  margin: 0 auto 2rem; width: fit-content;
  border: 1px solid var(--line); border-radius: 999px;
  padding: .25rem; background: var(--bg-raise);
}
.seg button {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--display); font-size: .98rem; letter-spacing: .03em;
  color: var(--ink-dim);
  padding: .45rem 1.2rem; border-radius: 999px;
  transition: all .2s;
}
.seg button:hover { color: var(--ink); }
.seg button.active {
  background: linear-gradient(160deg, var(--flame-hi), var(--flame-deep));
  color: #241102; font-weight: 600;
}

.ritual { padding: clamp(1.6rem, 5vw, 2.6rem); }
.ritual .prompt {
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.55; color: var(--ink);
  margin: .8rem 0 1.6rem;
}
.ritual textarea { min-height: 170px; resize: vertical; }
.ritual-actions { display: flex; gap: .7rem; margin-top: 1.2rem; flex-wrap: wrap; }
.saved-msg { color: var(--ok); font-style: italic; margin-top: 1rem; display: none; }
.reflect-answer { margin-top: 1.2rem; white-space: pre-wrap; color: var(--ink-soft); }

.weekly-intro {
  max-width: 38em; margin: 0 auto 1.8rem;
  padding-left: 1.2rem; border-left: 2px solid var(--gold-dim);
  font-family: var(--display); font-style: italic; font-size: 1.12rem;
  color: var(--gold);
}
.step { padding: 1.5rem 1.7rem; margin-bottom: 1rem; }
.step .step-no {
  font-family: var(--ui); font-size: .64rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.step h3 { font-size: 1.3rem; margin: .3rem 0 .5rem; }
.step .prompt { color: var(--ink-soft); margin-bottom: 1rem; }
.step textarea { min-height: 110px; resize: vertical; }

.past-list { display: grid; gap: .7rem; }
.past-item {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1rem 1.3rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px;
  transition: border-color .2s, transform .2s;
}
.past-item:hover { border-color: var(--gold-dim); transform: translateY(-1px); }
.past-item .p-body { flex: 1; min-width: 0; }
.past-item .p-preview {
  font-size: .98rem; line-height: 1.5; color: var(--ink-soft);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.past-item .p-date { font-family: var(--ui); font-size: .7rem; color: var(--ink-dim); margin-top: .25rem; letter-spacing: .06em; }
.past-detail {
  padding: clamp(1.6rem, 5vw, 2.4rem);
  white-space: pre-wrap; color: var(--ink-soft);
}
.empty-state { text-align: center; padding: 3rem 1rem; }

/* ============================================================
   SAHAYAK — the conversation
   ============================================================ */
.chat-app {
  height: calc(100dvh - var(--shell-h));
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 290px 1fr;
  overflow: hidden;
}
@media (max-width: 760px) {
  /* Pinned between the fixed top bar and bottom tabs (same pattern as
     .rail/.rail-backdrop below) instead of height-calc arithmetic, which
     silently breaks — and pushes the composer off-screen behind the tabs —
     on any browser without full dvh support or with a shifting toolbar. */
  .chat-app {
    position: fixed;
    top: var(--shell-h);
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0; right: 0;
    height: auto;
    grid-template-columns: 1fr;
  }
}

/* left rail */
.rail {
  border-right: 1px solid var(--line-soft);
  padding: 1.2rem 1rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: .4rem;
}
.rail-title {
  font-family: var(--ui); font-size: .64rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  margin: 1.2rem 0 .6rem;
}
.rail > .rail-title:first-of-type { margin-top: 0; }
.session-item {
  padding: .65rem .8rem; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s;
}
.session-item:hover { background: var(--glow); }
.session-item.active { background: var(--surface-2); border-color: var(--line); }
.session-preview {
  font-size: .9rem; line-height: 1.45; color: var(--ink-soft);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.session-date { font-family: var(--ui); font-size: .64rem; color: var(--ink-dim); margin-top: .2rem; letter-spacing: .08em; }
.empty-note { color: var(--ink-dim); font-style: italic; font-size: .86rem; padding: .5rem .3rem; }

.memory-item {
  display: flex; align-items: flex-start; gap: .45rem;
  padding: .55rem .7rem; border-radius: 10px;
  background: var(--bg-raise); border: 1px solid var(--line-soft);
  margin-bottom: .4rem;
}
.memory-text { flex: 1; font-size: .82rem; line-height: 1.45; color: var(--ink-soft); }
.memory-del {
  border: none; background: none; cursor: pointer;
  color: var(--ink-dim); font-size: 1rem; line-height: 1; padding: 0 .1rem;
}
.memory-del:hover { color: var(--danger); }

/* mobile drawer behaviour */
@media (max-width: 760px) {
  .rail {
    position: fixed; top: var(--shell-h); bottom: 0; left: 0; z-index: 90;
    width: min(84vw, 330px);
    background: var(--bg-raise);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform .28s ease;
    box-shadow: var(--shadow);
  }
  .rail.open { transform: translateX(0); }
}
.rail-backdrop {
  display: none;
  position: fixed; inset: var(--shell-h) 0 0 0; z-index: 85;
  background: rgba(0,0,0,.5);
}
.rail-backdrop.show { display: block; }

/* chat column */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .9rem 1.3rem;
  border-bottom: 1px solid var(--line-soft);
}
.chat-head .who { flex: 1; }
.chat-head .who h1 { font-size: 1.25rem; letter-spacing: .03em; }
.chat-head .who p { font-family: var(--ui); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }
.rail-toggle { display: none; }
@media (max-width: 760px) {
  .rail-toggle {
    display: inline-flex; align-items: center; gap: .4rem;
    background: none; border: 1px solid var(--line); border-radius: 999px;
    color: var(--ink-dim); cursor: pointer;
    font-family: var(--ui); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
    padding: .4rem .8rem;
  }
}

.messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 1.6rem clamp(1rem, 4vw, 2.2rem);
  display: flex; flex-direction: column; gap: 1.35rem;
}
.msg { display: flex; gap: .85rem; max-width: 92%; }
.msg .avatar {
  width: 30px; height: 30px; flex: none; margin-top: .2rem;
  color: var(--flame);
  border: 1px solid var(--gold-dim); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.msg .avatar svg { width: 15px; height: 15px; }
.msg .bubble { white-space: pre-wrap; line-height: 1.75; color: var(--ink-soft); min-width: 0; }
.msg.user { align-self: flex-end; }
.msg.user .bubble {
  background: var(--user-bubble);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  border-radius: 18px 18px 4px 18px;
  padding: .8rem 1.15rem;
}
.typing { color: var(--ink-dim); font-style: italic; padding-left: 2.7rem; font-size: .94rem; }

/* light formatting inside sahayak replies */
.msg .bubble strong { color: var(--flame); font-weight: 500; }
.msg .bubble em { color: var(--gold); }

/* starter prompts on a fresh conversation */
.starters {
  display: flex; flex-wrap: wrap; gap: .55rem;
  padding-left: 2.7rem; margin-top: -.4rem;
}
.starters button {
  background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-dim);
  font-family: var(--body); font-style: italic; font-size: .9rem;
  padding: .42rem 1rem;
  transition: all .2s;
}
.starters button:hover { border-color: var(--gold-dim); color: var(--gold); background: var(--glow); }

.composer { padding: .9rem clamp(1rem, 4vw, 2.2rem) 1.2rem; }
.composer-box {
  display: flex; align-items: flex-end; gap: .6rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: .55rem .55rem .55rem 1.2rem;
  transition: border-color .2s, box-shadow .2s;
}
.composer-box:focus-within { border-color: var(--flame-deep); box-shadow: 0 0 0 3px var(--glow); }
.composer-box textarea {
  flex: 1; border: none; background: transparent; box-shadow: none;
  padding: .35rem 0; max-height: 180px; min-height: 26px;
  resize: none; border-radius: 0;
}
.composer-box textarea:focus { border: none; box-shadow: none; }
.send {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(160deg, var(--flame-hi), var(--flame-deep));
  color: #241102;
  display: flex; align-items: center; justify-content: center;
  transition: filter .2s, transform .2s;
}
.send:hover { filter: brightness(1.1); transform: translateY(-1px); }
.send:disabled { filter: saturate(.3) brightness(.7); cursor: not-allowed; transform: none; }
.send svg { width: 17px; height: 17px; }

/* ============================================================
   LOGIN — the threshold
   ============================================================ */
body.login-scene {
  padding-top: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh;
}
.threshold { text-align: center; padding: 2rem 1.4rem; max-width: 400px; }
.threshold .diya { width: 74px; height: 74px; margin: 0 auto 1.6rem; color: var(--flame); }
.threshold .diya .fl { animation: flicker 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.threshold .devan { font-family: var(--sanskrit); font-size: 1.1rem; color: var(--gold); letter-spacing: .1em; margin-bottom: .4rem; }
.threshold h1 { font-size: 2.3rem; letter-spacing: .06em; margin-bottom: .5rem; }
.threshold .tag { font-family: var(--display); font-style: italic; color: var(--ink-dim); font-size: 1.05rem; margin-bottom: 2.2rem; }
.google-btn {
  display: inline-flex; align-items: center; gap: .75rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .8rem 1.7rem;
  font-family: var(--ui); font-size: .95rem; font-weight: 500;
  transition: all .22s;
}
.google-btn:hover { border-color: var(--gold-dim); transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.threshold .privacy-note { font-family: var(--ui); font-size: .74rem; color: var(--ink-dim); margin-top: 1.6rem; }
.threshold .consent { font-family: var(--ui); font-size: .7rem; color: var(--ink-dim); margin-top: .6rem; }
.threshold .consent a { color: var(--gold); }

/* ============================================================
   LEGAL DOCS — the scroll
   ============================================================ */
.doc { max-width: 680px; margin: 0 auto; padding: clamp(1.4rem, 4vw, 2.5rem) 1.2rem 4rem; }
.doc .backlink { font-family: var(--ui); font-size: .76rem; letter-spacing: .08em; color: var(--ink-dim); }
.doc .backlink:hover { color: var(--flame); }
.doc h1 { font-size: 2.1rem; margin: 1.2rem 0 .2rem; }
.doc .updated { font-family: var(--ui); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 2rem; }
.doc h2 { font-size: 1.3rem; color: var(--gold); margin: 2.2rem 0 .6rem; }
.doc p, .doc li { color: var(--ink-soft); margin-bottom: .7rem; }
.doc ul { margin-left: 1.3rem; }
.doc .callout, .doc .note {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 2px solid var(--gold);
  border-radius: 14px; padding: 1.1rem 1.3rem; margin: 1.5rem 0;
}
.doc .callout h2 { margin-top: 0; }
.doc .crisis {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 2px solid var(--danger);
  border-radius: 14px; padding: 1.1rem 1.3rem; margin: 1.5rem 0;
}
.doc .crisis h2 { margin-top: 0; color: var(--danger); }
.doc footer {
  margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft);
  font-family: var(--ui); font-size: .76rem; color: var(--ink-dim);
}
.doc footer a { color: var(--ink-dim); }
.doc footer a:hover { color: var(--gold); }

/* ============================================================
   HEALTH — the caretaker's lamp (admin status page)
   ============================================================ */
body.health-scene { padding-top: 0; display: flex; align-items: center; justify-content: center; min-height: 100dvh; }
.health { width: min(460px, 100%); padding: 2.2rem; }
.health .top { text-align: center; margin-bottom: 1.6rem; }
.health .top .om { font-family: var(--sanskrit); color: var(--gold-dim); font-size: 1.4rem; }
.health h1 { font-size: 1.5rem; letter-spacing: .05em; margin-top: .3rem; }
.overall {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--display); font-size: 1.12rem;
  padding: .85rem; border-radius: 14px; margin-bottom: 1.4rem;
  border: 1px solid var(--line-soft);
}
.overall.ok       { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.overall.degraded { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.overall.loading  { color: var(--ink-dim); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 60%, transparent); }
.dot.error { background: var(--danger); box-shadow: 0 0 10px color-mix(in srgb, var(--danger) 60%, transparent); }
.dot.loading { background: var(--gold-dim); }
.checks { display: flex; flex-direction: column; gap: .6rem; }
.check {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1rem;
  background: var(--bg-raise); border: 1px solid var(--line-soft); border-radius: 12px;
}
.check-name { display: flex; align-items: center; gap: .75rem; }
.check-label { font-family: var(--display); font-size: 1.05rem; }
.check-sub { font-family: var(--ui); font-size: .68rem; color: var(--ink-dim); }
.status-text { font-family: var(--ui); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.status-text.ok { color: var(--ok); } .status-text.error { color: var(--danger); }
.health .foot {
  text-align: center; margin-top: 1.4rem;
  font-family: var(--ui); font-size: .72rem; color: var(--ink-dim);
}
.health .foot a { color: var(--gold); }

/* ---------- motion ---------- */
@keyframes flicker {
  0%, 100% { transform: scaleY(1) rotate(0deg); opacity: 1; }
  30%       { transform: scaleY(1.06) rotate(-1.2deg); opacity: .92; }
  55%       { transform: scaleY(.96) rotate(1deg); opacity: 1; }
  75%       { transform: scaleY(1.04) rotate(-.6deg); opacity: .95; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise   { animation: rise .6s ease both; }
.rise-1 { animation: rise .6s .08s ease both; }
.rise-2 { animation: rise .6s .16s ease both; }
.rise-3 { animation: rise .6s .26s ease both; }

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

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
