/* Daily Comprehensive Bible Study — parchment light theme, warm dark theme */
:root {
  --scale: 1.15;
  --bg: #f6efdf;
  --bg2: #efe4cc;
  --paper: #fffaf0;
  --ink: #2b2118;
  --ink-soft: #5b4a3a;
  --muted: #85715c;
  --rule: #e2d3b4;
  --accent: #7a2e2a;
  --accent-ink: #fffaf0;
  --gold: #b48a46;
  --gold-soft: #ead9b2;
  --tag-rab: #2f5d62;
  --tag-nc: #7a5a1e;
  --tag-ph: #5a4a7a;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 18px rgba(60, 40, 20, .07);
  --shadow-lift: 0 2px 4px rgba(60, 40, 20, .08), 0 14px 32px rgba(60, 40, 20, .14);
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display: "Cormorant Garamond", "Iowan Old Style", Garamond, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#1a1613; --bg2:#221c18; --paper:#26201b; --ink:#efe6d6; --ink-soft:#d3c5ae; --muted:#a8977e; --rule:#3d342b; --accent:#e0a878; --accent-ink:#1a1613; --gold:#d4ad6a; --gold-soft:#4a3d2a; --tag-rab:#8cc5c9; --tag-nc:#e2bf78; --tag-ph:#b9a8e0; --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 18px rgba(0,0,0,.25); --shadow-lift:0 2px 4px rgba(0,0,0,.35),0 14px 32px rgba(0,0,0,.4); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg:#1a1613; --bg2:#221c18; --paper:#26201b; --ink:#efe6d6; --ink-soft:#d3c5ae; --muted:#a8977e; --rule:#3d342b; --accent:#e0a878; --accent-ink:#1a1613; --gold:#d4ad6a; --gold-soft:#4a3d2a; --tag-rab:#8cc5c9; --tag-nc:#e2bf78; --tag-ph:#b9a8e0; --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 18px rgba(0,0,0,.25); --shadow-lift:0 2px 4px rgba(0,0,0,.35),0 14px 32px rgba(0,0,0,.4); color-scheme: dark; }

* { box-sizing: border-box; }
html { font-size: calc(100% * var(--scale)); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); line-height: 1.65; font-size: 1rem;
  background-image: radial-gradient(ellipse at top, var(--bg2), var(--bg) 60%);
  background-attachment: fixed; min-height: 100vh;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }
h1, h2, h3, h4, .brand-name, .tile .t, .dayrow .n, .scripture .vn.ch { font-variant-numeric: lining-nums; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.2; color: var(--ink); letter-spacing: .005em; }
h1 { font-size: 2.3rem; margin: .2em 0 .3em; }
h2 { font-size: 1.75rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.4rem; margin: 1.2em 0 .4em; }
h4 { font-family: var(--sans); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 1.6em 0 .6em; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: .55rem max(1rem, env(safe-area-inset-left)); padding-top: max(.55rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 9px; box-shadow: var(--shadow); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.brand-sub { font-family: var(--sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mainnav { display: flex; gap: .2rem; margin-left: auto; font-family: var(--sans); font-size: .85rem; }
.mainnav a { padding: .4rem .75rem; border-radius: 999px; text-decoration: none; color: var(--ink-soft); transition: background .2s var(--ease), color .2s; }
.mainnav a:hover { background: var(--gold-soft); color: var(--ink); }
.mainnav a.active { background: var(--accent); color: var(--accent-ink); }
.tools { display: flex; gap: .3rem; }
.iconbtn {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; min-width: 2.4rem; height: 2.4rem;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.iconbtn:hover { transform: translateY(-1px); border-color: var(--gold); box-shadow: var(--shadow); }
.iconbtn .minus, .iconbtn .plus { font-size: .7em; margin-left: 1px; }
.iconbtn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }

/* layout */
main { max-width: 52rem; margin: 0 auto; padding: 1.4rem 1.1rem 3rem; outline: none; }
main.wide { max-width: 64rem; }
.loading { color: var(--muted); text-align: center; padding: 4rem 0; }
.fade-in { animation: fade .45s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; }
.eyebrow { font-family: var(--sans); font-size: .72rem; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0; }
.lede { color: var(--ink-soft); font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* hero */
.hero {
  position: relative; overflow: hidden; padding: 2rem 1.6rem 1.6rem; border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, var(--paper), color-mix(in srgb, var(--gold-soft) 55%, var(--paper)));
  border: 1px solid var(--rule); box-shadow: var(--shadow);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 30%, transparent), transparent 70%); pointer-events: none; }
.hero h1 { margin-top: .3rem; }
.keyverse { margin: 1.2rem 0 .4rem; padding: 0 0 0 1.1rem; border-left: 3px solid var(--gold); font-size: 1.2rem; font-style: italic; line-height: 1.6; }
.keyverse cite, blockquote cite { display: block; font-style: normal; font-family: var(--sans); font-size: .78rem; color: var(--muted); margin-top: .5rem; letter-spacing: .02em; }
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .8rem 1.4rem; margin: 1.3rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--rule); }
.props dt { font-family: var(--sans); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.props dd { margin: .1rem 0 0; font-size: .95rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem; font-family: var(--sans); font-size: .9rem; font-weight: 600;
  padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: .9rem; margin: 1rem 0; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.05rem 1.1rem 1.1rem;
  box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--gold); }
.tile.current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.tile .ic { width: 2.3rem; height: 2.3rem; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--accent); transition: transform .3s var(--ease), background .25s; }
.tile:hover .ic { transform: rotate(-6deg) scale(1.06); }
.tile .ic svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile .t { font-family: var(--display); font-size: 1.3rem; font-weight: 700; line-height: 1.15; }
.tile .d { font-size: .82rem; color: var(--ink-soft); line-height: 1.5; }
.tile .go { position: absolute; right: 1rem; top: 1.1rem; color: var(--gold); opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .25s var(--ease); font-family: var(--sans); }
.tile:hover .go { opacity: 1; transform: none; }

/* day list */
.daylist { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .6rem; }
.dayrow {
  display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 1rem; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: .75rem 1rem; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
a.dayrow:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: var(--gold); }
.dayrow .dl { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--accent); line-height: 1.15; }
.dayrow .r { display: block; font-size: 1rem; }
.dayrow .st { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .06em; color: var(--muted); margin-top: .1rem; }
.dayrow.is-soon .dl { color: var(--ink-soft); }
.mk { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.mk.ok { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--gold-soft); }
.mk.soon { border: 1.5px dashed var(--rule); background: var(--bg2); }
.mk svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend .mk { width: 1.3rem; height: 1.3rem; } .legend .mk svg { width: .8rem; height: .8rem; }
.pill { font-family: var(--sans); font-size: .68rem; font-weight: 650; letter-spacing: .06em; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--accent); color: var(--accent-ink); }
.pill.soon { background: var(--bg2); color: var(--muted); border: 1px solid var(--rule); }
.pill.today { background: var(--gold); color: #fff; }
.h1-sub { display: block; font-size: .55em; font-weight: 600; color: var(--ink-soft); margin-top: .25rem; letter-spacing: .01em; }
.hero-note { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin: 1rem 0 0; }

/* books */
.bookcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .8rem; margin: .8rem 0; }
.bookcard { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--rule);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.bookcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--gold); }
.bookcard .bt { font-family: var(--display); font-size: 1.45rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.bookcard .bs { font-family: var(--sans); font-size: .74rem; color: var(--muted); }
.bookcard .bar { height: 5px; border-radius: 9px; background: var(--bg2); overflow: hidden; margin-top: .35rem; }
.bookcard .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 9px; }
.chapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: .55rem; margin: 1rem 0 1.5rem; }
.chap { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .7rem .4rem; border-radius: 12px; text-decoration: none; border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.chap .cn { font-family: var(--display); font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--accent); }
.chap .cd { font-family: var(--sans); font-size: .64rem; letter-spacing: .03em; color: var(--muted); text-align: center; }
.chap.ok:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); }
.chap.soon { background: var(--bg2); border-style: dashed; }
.chap.soon .cn { color: var(--muted); }
.chap.soon .cd::after { content: " · soon"; }

/* plan */
.plan-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; }
.search { flex: 1 1 14rem; font: inherit; font-size: .95rem; padding: .65rem 1rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); }
.month { margin-top: 1.8rem; }
.month h3 { position: sticky; top: var(--topbar-h, 3.6rem); background: var(--bg); padding: .3rem 0; z-index: 2; margin: 0 0 .4rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.plan-grid .dayrow { grid-template-columns: 1.9rem 1fr; padding: .55rem .8rem; gap: .7rem; }
.plan-grid .dayrow .dl { font-size: 1.08rem; }
.plan-grid .dayrow .r { font-size: .92rem; }
.plan-grid .dayrow.is-current { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent); }
.plan-grid .dayrow.is-soon { background: color-mix(in srgb, var(--bg2) 60%, var(--paper)); }

/* study */
.daynav { display: flex; justify-content: space-between; gap: .6rem; margin: 1.2rem 0; font-family: var(--sans); font-size: .85rem; }
.daynav a, .daynav span { padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); text-decoration: none; color: var(--ink-soft); }
.daynav span { opacity: .45; }
.daynav a:hover { border-color: var(--gold); color: var(--ink); }
.viewbar { position: sticky; top: var(--topbar-h, 3.5rem); z-index: 10; margin: 2rem -.3rem 1rem; padding: .5rem .3rem; background: var(--bg); border-bottom: 1px solid var(--rule); }
.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: thin; padding-bottom: .2rem; }
.chip { flex: 0 0 auto; font-family: var(--sans); font-size: .8rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.view-title { margin-top: .5rem; }
.toc { columns: 2 16rem; column-gap: 1.6rem; padding: 0; list-style: none; margin: .4rem 0 1.4rem; font-size: .92rem; }
.toc li { break-inside: avoid; margin: .2rem 0; }
.passage { margin: 2.2rem 0; scroll-margin-top: calc(var(--topbar-h, 3.5rem) + 4rem); }
.passage > h2 { margin-top: 0; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.scripture { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.4rem; font-size: 1.1rem; line-height: 1.85; box-shadow: var(--shadow); }
.scripture .vn { font-family: var(--sans); font-size: .62em; font-weight: 700; color: var(--accent); vertical-align: super; line-height: 0; margin: 0 .15em 0 .35em; }
.scripture .vn.ch { font-family: var(--display); font-size: 1.6em; vertical-align: baseline; margin-left: 0; margin-right: .25em; }
.scripture cite { display: block; font-family: var(--sans); font-style: normal; font-size: .75rem; color: var(--muted); margin-top: .7rem; }
ul.bul { padding-left: 1.2rem; margin: .4rem 0; } ul.bul li { margin: .35rem 0; } ul.bul li::marker { color: var(--gold); }
ol.qs li { margin: .8rem 0; padding-left: .3rem; } ol.qs li::marker { font-family: var(--display); font-weight: 700; color: var(--accent); }
.src { margin: 1rem 0 1.2rem; }
.src blockquote { margin: 0; padding: .9rem 1.1rem; background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; }
.src blockquote p { margin: 0; font-style: italic; }
.src .who { font-family: var(--sans); font-size: .82rem; font-weight: 650; color: var(--ink); margin: 0 0 .35rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.tag { font-family: var(--sans); font-size: .64rem; font-weight: 650; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 999px; border: 1px solid currentColor; text-transform: uppercase; }
.tag.rabbinic { color: var(--tag-rab); } .tag.noncanonical { color: var(--tag-nc); } .tag.philosopher { color: var(--tag-ph); } .tag.summary { color: var(--muted); }
.summary-text { margin: 0; padding: .9rem 1.1rem; background: var(--bg2); border: 1px dashed var(--rule); border-radius: 12px; }
.connection { margin: .5rem 0 0; padding: .75rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--gold-soft) 60%, var(--paper)); font-size: .92rem; }
.connection b { font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: .2rem; }
.note { margin: 1.2rem 0; padding: 1rem 1.2rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--gold); position: relative; }
.note::before { content: "✦"; color: var(--gold); margin-right: .5rem; }
details.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: .2rem 1.2rem; margin: 1.2rem 0; }
details.panel > summary { cursor: pointer; font-family: var(--display); font-size: 1.3rem; font-weight: 700; padding: .7rem 0; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "›"; display: inline-block; margin-right: .6rem; color: var(--gold); transition: transform .25s var(--ease); }
details.panel[open] > summary::before { transform: rotate(90deg); }
.links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; margin: .6rem 0 1rem; }
.links a { display: block; height: 100%; padding: .75rem .9rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.links a:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--shadow); }
.links .lt { display: block; font-size: .9rem; line-height: 1.4; }
.links .ls { display: block; font-family: var(--sans); font-size: .7rem; color: var(--muted); margin-top: .25rem; }
.notice { font-size: .8rem; color: var(--muted); }

.install { display: none; margin-top: 1.4rem; }
.install.show { display: block; }

.footer { max-width: 52rem; margin: 0 auto; padding: 2rem 1.1rem 5.5rem; border-top: 1px solid var(--rule); font-size: .78rem; color: var(--muted); text-align: center; }
.footer .verse { font-family: var(--display); font-size: 1.15rem; font-style: italic; color: var(--ink-soft); max-width: 36rem; margin: 0 auto 1rem; }
.footer .verse cite { display: block; font-style: normal; font-family: var(--sans); font-size: .72rem; margin-top: .3rem; }
.totop { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); width: 3rem; height: 3rem; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--paper); color: var(--accent); box-shadow: var(--shadow-lift); cursor: pointer; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease); z-index: 30; }
.totop.show { opacity: 1; transform: none; pointer-events: auto; }
.totop svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Ask Grok */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ask-fab { position: fixed; left: 1.1rem; bottom: 1.1rem; z-index: 40; display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.1rem .7rem .9rem;
  border-radius: 999px; border: 1px solid var(--gold); background: var(--paper); color: var(--accent); font-family: var(--sans); font-size: .85rem; font-weight: 650;
  letter-spacing: .02em; box-shadow: var(--shadow-lift); cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; }
.ask-fab:hover { transform: translateY(-2px); }
.ask-fab[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ask-fab svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ask-panel { position: fixed; left: 1.1rem; bottom: 4.7rem; z-index: 41; width: min(25rem, calc(100vw - 2.2rem)); padding: 1rem 1.1rem 1.1rem;
  border-radius: 18px; background: var(--paper); border: 1px solid var(--gold); box-shadow: 0 20px 50px rgba(40,20,10,.28);
  opacity: 0; transform: translateY(12px) scale(.98); transform-origin: bottom left; transition: opacity .22s, transform .22s var(--ease); }
.ask-panel.open { opacity: 1; transform: none; }
.ask-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 18px 18px 0 0; background: linear-gradient(90deg, var(--gold), var(--accent)); }
.ask-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.ask-head h2 { margin: .1rem 0 0; font-size: 1.6rem; }
.ask-head .iconbtn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ask-ctx { font-family: var(--sans); font-size: .74rem; color: var(--muted); margin: .5rem 0; }
.ask-panel textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; line-height: 1.5; padding: .7rem .85rem; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink); resize: vertical; min-height: 6rem; }
.ask-panel textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ask-row { display: flex; justify-content: flex-end; margin-top: .6rem; }
.ask-note { font-family: var(--sans); font-size: .7rem; line-height: 1.45; color: var(--muted); margin: .7rem 0 0; }
.toast { position: fixed; left: 50%; bottom: 1.4rem; z-index: 60; transform: translate(-50%, 20px); max-width: calc(100vw - 2rem); padding: .7rem 1.1rem;
  border-radius: 12px; background: var(--ink); color: var(--bg); font-family: var(--sans); font-size: .84rem; box-shadow: var(--shadow-lift);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.comments-hook { display: none; }

@media (max-width: 640px) {
  .ask-fab { left: .8rem; bottom: .8rem; padding: .6rem .95rem .6rem .75rem; font-size: .8rem; }
  .ask-panel { left: .6rem; right: .6rem; bottom: 4rem; width: auto; }
  .plan-grid .dayrow { grid-template-columns: 1.9rem 1fr; }
  html { font-size: calc(100% * var(--scale) * .95); }
  .brand-sub { display: none; }
  .brand-name { font-size: 1.12rem; line-height: 1.15; }
  .brand { min-width: 0; flex: 1 1 0; }
  .topbar { flex-wrap: wrap; gap: .5rem; }
  .mainnav { order: 3; width: 100%; margin: 0; justify-content: space-around; }
  .tools { margin-left: auto; }
  h1 { font-size: 1.9rem; }
  .hero { padding: 1.5rem 1.1rem 1.2rem; }
  .dayrow { grid-template-columns: 2.1rem 1fr; }
  .dayrow .pill { grid-column: 2; justify-self: start; }
  .chapgrid { grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); }
}
@media print { .ask-fab, .ask-panel, .toast, .topbar, .viewbar, .totop, .tiles, .daynav { display: none; } body { background: #fff; } }
