:root {
  --bg: #f5f4f0; --card: #ffffff; --ink: #23252c; --muted: #6b6f7c;
  --accent: #4a5fc1; --chip: #eef0fa; --line: #e3e2dc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161d; --card: #1e2130; --ink: #e8e8ea; --muted: #9aa0ad;
    --accent: #8fa2ff; --chip: #2a2e42; --line: #2a2d3a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* beat any display: flex/grid rules */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;   /* nothing may widen the canvas past the viewport */
}
.card {
  background: var(--card); border-radius: 12px; padding: 16px 18px;
  margin: 12px; max-width: 780px; box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}
#barwrap { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
#pct, .hint { color: var(--muted); font-size: .85rem; }

/* ------- top navigation (fixed; auto-hides on scroll down) ------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: var(--bg);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 4px;
  border-bottom: 1px solid var(--line);
  max-width: 820px; margin: 0 auto;
  transform: translateY(0); transition: transform .25s ease;
}
#topbar.bar-hidden { transform: translateY(-105%); }
#boot { margin-top: calc(12px + env(safe-area-inset-top, 0px)); }
.navrow { display: flex; gap: 6px; margin-bottom: 6px; }
select, .navrow button {
  font: inherit; font-size: .9rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--card); color: var(--ink);
  padding: 6px 8px; min-width: 0;
}
/* hide the ring for pointer taps only; keyboard focus keeps a visible ring */
select:focus:not(:focus-visible), .navrow button:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent, #4a7cc9); outline-offset: 2px; }
#locbtn { flex: 1; text-align: left; }
#textA, #textB { flex: 1; }
#swapbtn {
  flex: 0 0 2.2em; display: flex; align-items: center; justify-content: center;
  color: var(--muted); padding: 6px 0;
}
#swapbtn:active { color: var(--accent); }
.navrow button { flex: 0 0 2.4em; cursor: pointer; }
.navrow button:disabled { opacity: .35; }

/* ------- reader ------- */
#content {
  max-width: 820px; margin: 0 auto;
  padding: calc(var(--topbar-h, 60px) + 8px) 12px
           calc(var(--bottombar-h, 110px) + 20px);
}
.verse-row {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.vnum {
  flex: 0 0 1.8em; text-align: right; color: var(--muted);
  font-size: .78rem; padding-top: .35em;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; align-self: start;
}
.vnum:hover, .vnum:focus { color: var(--accent); }
.vcompare { margin: 8px 0; }
.cmp-row { padding: 5px 0; border-bottom: 1px solid var(--line); }
.vbody { flex: 1; min-width: 0; }
.textid {
  display: block; color: var(--muted); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .05em; margin-top: 6px;
}
.textid:first-child { margin-top: 0; }
.line { margin: 2px 0 4px; }
.lang-grc, .lang-hbo { font-size: 1.15rem; }
.lang-hbo { font-size: 1.3rem; }
.missing { color: var(--muted); }

/* tappable words: indistinguishable from plain text (no padding — selection
   highlights continuously); quick release acts as the button (tappable() in
   app.js). Hover cue on mouse devices only; focus ring for keyboard only, so
   nothing lingers after a touch long-press. */
.word, .eword {
  cursor: pointer; border-radius: 3px;
  -webkit-user-select: text; user-select: text;
  outline: none;
}
@media (hover: hover) {
  .word:hover, .eword:hover { background: var(--chip); }
}
.word:focus-visible, .eword:focus-visible { background: var(--chip); }
.lang-grc .word { font-size: 1.15rem; }
.lang-hbo .word { font-size: 1.3rem; }
.line-b { color: color-mix(in srgb, var(--ink) 72%, var(--muted)); }
.line-b .word, .line-b .eword { color: inherit; }

/* source formatting markers, rendered */
.added { font-style: italic; }                 /* translator-supplied words */
.redletter { color: #d95c5c; }                 /* words of Christ */
.line-b .redletter { color: #d95c5c; }
.otquote { font-style: italic; }               /* OT quotations */

/* ------- word panel bottom sheet ------- */
/* Capped at ~1/3 of the screen so the text being read stays visible; the
   sheet itself scrolls. .tall (AI history/settings) may use more. */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-height: 34vh; overflow-y: auto;
  background: var(--card); color: var(--ink);
  border-radius: 16px 16px 0 0; padding: 14px 18px 24px;
  box-shadow: 0 -4px 24px rgb(0 0 0 / 35%);
  max-width: 820px; margin: 0 auto;
}
.sheet.tall { max-height: 75vh; }
/* one scroll context inside the sheet — no nested scrolling lists */
.sheet .occlist { max-height: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; }
.sheet h3 { margin: 0 0 6px; }
.speakbtn {
  border: 0; background: transparent; color: var(--accent);
  cursor: pointer; padding: 0 6px; vertical-align: middle;
}
.speakbtn:active { color: var(--muted); }
.sheet .close {
  font: inherit; border: 0; background: var(--chip); color: var(--ink);
  border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
.sheet button {
  font: inherit; border: 0; border-radius: 8px; padding: 6px 10px;
  background: var(--chip); color: var(--ink); cursor: pointer;
}
dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 8px 0; }
dt { color: var(--muted); font-size: .85rem; }
dd { margin: 0; }
.def { margin: 8px 0 4px; }
.kjv { color: var(--muted); font-size: .9rem; }
.occlist { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.occ { padding: 3px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.occ a { color: var(--accent); text-decoration: none; }
.occlist.tall { max-height: none; }

/* ------- bottom navigation ------- */
#bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 15;
  background: var(--bg); border-top: 1px solid var(--line);
  max-width: 820px; margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(0); transition: transform .25s ease;
}
#bottombar.bar-hidden { transform: translateY(105%); }
.tabs { display: flex; }
.tab {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  padding: 6px 0 10px; cursor: pointer;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.pager {
  display: flex; gap: 6px; align-items: center; padding: 8px 10px 2px;
}
.pager button {
  font: inherit; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer;
}
#prev, #next { flex: 0 0 3em; font-size: 1.1rem; padding: 5px 0; }
#prev:disabled, #next:disabled { opacity: .35; }
#locbtn {
  flex: 1; padding: 7px 10px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ------- library: categories -> shelves of book spines ------- */
.shelf {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 4px 18px;
}
.bookspine {
  /* sized so a small phone fits 3 per row, no more */
  flex: 0 0 auto; width: 102px; height: 172px; font: inherit;
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: stretch; padding: 10px 8px 9px;
  border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: 3px 9px 9px 3px;        /* square binding, rounded fore-edge */
  background: var(--card); color: var(--ink); cursor: pointer;
  box-shadow: 1px 2px 5px rgb(0 0 0 / 18%);
}
.bookspine:active { background: var(--accent); color: #fff; }
.bookspine.here { border-color: var(--accent); color: var(--accent); }
.bookspine .btitle {
  font-size: .76rem; line-height: 1.3; text-align: left;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 7; -webkit-box-orient: vertical;
}
.bookspine .bid {
  align-self: center; margin-top: 7px;
  font-size: .66rem; letter-spacing: .05em; color: var(--muted);
  background: var(--chip); border-radius: 4px; padding: 2px 7px;
}
.bookspine.here .bid { color: var(--accent); }
.workbody {
  white-space: pre-wrap; font-size: .95rem; line-height: 1.65;
  padding-top: 6px;
  overflow-wrap: anywhere;   /* long tokens must wrap, never widen the page */
}
/* rich (ThML) pages */
.workbody h3.wsec {
  white-space: normal; font-size: 1.02rem; margin: 14px 0 4px;
}
.workbody a.vref { color: var(--accent); text-decoration: none; }
.workbody .notebtn {
  border: 0; background: transparent; color: var(--accent);
  cursor: pointer; padding: 0 2px; font-size: .7rem; vertical-align: super;
}
.workbody .notebtn::after { content: "[" attr(data-n) "]"; }
.notestoggle {
  display: flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: .82rem; white-space: nowrap;
}

/* ------- ask AI ------- */
/* The Ask page is a full chat screen: its own appbar on top, the composer
   pinned to the very bottom of the screen (the tab bar is hidden here). */
#askview {
  max-width: 820px; margin: 0 auto;
  padding: 0 12px calc(150px + env(safe-area-inset-bottom, 0px));
}
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  max-width: 820px; margin: 0 auto;
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
}
#askq {
  flex: 1; font: inherit; line-height: 1.4; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 10px 16px;
  resize: none; max-height: 120px; outline: none; min-width: 0;
}
#askgo {
  flex: 0 0 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#askgo:disabled { opacity: .4; }
.flexspace { flex: 1; }
.iconbtn {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px; cursor: pointer;
}
.iconbtn svg { width: 22px; height: 22px; display: block; }
.iconbtn:active { color: var(--accent); }
.chatrow { display: flex; align-items: center; gap: 8px; }
.chatrow a { flex: 1; color: var(--accent); text-decoration: none; }
.setrow { margin: 14px 0 4px; }
.setrow label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
/* Ask setup screen: hero + provider cards */
.setup { background: transparent; padding: 0; margin: 4px 0 10px; }
.setup-hero { text-align: center; padding: 26px 8px 18px; color: var(--accent); }
.setup-hero h2 { margin: 10px 0 6px; color: var(--ink); font-size: 1.25rem; }
.setup-hero p { margin: 0 auto; max-width: 34ch; }
.provider-card {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 14px 16px; margin: 10px 0;
  cursor: pointer; transition: border-color .15s;
}
.provider-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.provider-card.disabled { opacity: .55; }
.pchead { display: flex; align-items: center; gap: 12px; }
.pcicon {
  flex: 0 0 40px; height: 40px; display: flex; align-items: center;
  justify-content: center; border-radius: 10px;
  background: var(--chip); color: var(--accent);
}
.pctitle { flex: 1; min-width: 0; }
.pctitle h4 { margin: 0; font-size: .98rem; }
.pcsub { color: var(--muted); font-size: .78rem; }
.badge {
  display: none; font-size: .7rem; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 2px 9px;
}
.provider-card.active .badge { display: inline-block; }
.pcdesc { color: var(--muted); font-size: .85rem; margin: 10px 0 8px; }
.pcactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pcactions.column { flex-direction: column; align-items: stretch; }
.pcstatus { color: var(--muted); font-size: .85rem; }
.pcstatus.ok { color: var(--accent); }
.pcbtn {
  font: inherit; border: 0; border-radius: 10px; padding: 9px 16px;
  background: var(--accent); color: #fff; cursor: pointer;
}
.pcbtn:disabled { opacity: .6; }
.keyinput, .pcmodel {
  font: inherit; font-size: .9rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--ink);
  padding: 9px 12px; width: 100%;
}

.msg { border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.msg.q { background: var(--chip); margin-left: 15%; }
.msg.a { background: var(--card); white-space: pre-wrap; }
.asksources { margin: 0 0 14px; }
.asksources .occ.dim { opacity: .55; }

/* animated thinking indicator */
.thinking { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dots { display: inline-flex; gap: 4px; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: .3;
  animation: think 1.2s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes think {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ------- book/chapter picker ------- */
#bookpicker {
  max-width: 820px; margin: 0 auto;
  padding: 0 12px calc(var(--bottombar-h, 110px) + 20px);
}
.appbar {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  border-bottom: 1px solid var(--line); margin: 0 -12px 4px;
  transform: translateY(0); transition: transform .25s ease;
}
.appbar.bar-hidden { transform: translateY(-105%); }
.appbar h2 { font-size: 1.05rem; margin: 0; }
.backbtn {
  font: inherit; font-size: 1.4rem; line-height: 1; border: 0;
  background: transparent; color: var(--accent); cursor: pointer;
  padding: 4px 10px 6px 0;
}
.pickgroup {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 18px 0 4px;
}
.bookrow { border-bottom: 1px solid var(--line); }
.bookhead {
  display: block; width: 100%; text-align: left; font: inherit;
  font-size: .95rem; padding: 9px 4px; border: 0; background: transparent;
  color: var(--ink); cursor: pointer;
}
.bookhead:active { color: var(--accent); }
.bookhead.here-book {
  color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px;
}
.chgrid {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 14px;
}
.chbox {
  flex: 0 0 auto; width: 46px; height: 40px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer;
}
.chbox:active { background: var(--accent); color: #fff; }
.chbox.here { border-color: var(--accent); color: var(--accent); font-weight: 600; }
/* text-source tiles in the source picker: like chapter boxes, but sized
   to their labels */
.textbox {
  flex: 0 0 auto; height: 40px; font: inherit; font-size: .88rem;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); cursor: pointer;
}
.textbox:active { background: var(--accent); color: #fff; }
.textbox.here { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.textsel {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center; cursor: pointer;
}

/* ------- search ------- */
#searchview, #libraryview, #workview, #settingsview {
  max-width: 820px; margin: 0 auto;
  padding: 0 12px calc(var(--bottombar-h, 110px) + 20px);
}
#searchview .searchbar:first-child,
#searchview .appbar + .searchbar { margin-top: 10px; }
/* Ask empty-state starter chips */
.suggestions {
  display: flex; flex-direction: column; gap: 8px;
  max-width: 340px; margin: 0 auto;
}
.sugchip {
  font: inherit; font-size: .9rem; text-align: left;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  padding: 11px 14px; cursor: pointer;
}
.sugchip:active { border-color: var(--accent); color: var(--accent); }
.searchbar { display: flex; gap: 6px; margin-bottom: 8px; }
#q {
  flex: 1; font: inherit; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
#gobtn {
  font: inherit; border: 0; border-radius: 8px; padding: 8px 14px;
  background: var(--accent); color: #fff; cursor: pointer;
}
#ftstext { flex: 1; }
.snip { color: var(--muted); font-size: .85rem; margin: 1px 0 4px; }
.snip b { color: var(--ink); font-weight: 600; }   /* search hits pop */
mark.hitmark {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: inherit; border-radius: 3px; padding: 0 1px;
}
.result-card {
  background: var(--card); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px;
}
.result-card h3 { margin: 0 0 6px; }

/* verse highlight after navigation */
.verse-row.flash { animation: flash 2.2s ease-out; }
@keyframes flash {
  0%, 40% { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { background: transparent; }
}

/* transient error line for failures that escape a tap/page handler */
.errtoast {
  position: fixed; left: 12px; right: 12px; bottom: 72px; z-index: 50;
  padding: 10px 14px; border-radius: 8px;
  background: var(--card); color: var(--ink);
  border: 1px solid #b5453f; font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

/* scripture reference / note anchor a verse-sheet link jumped to */
.jumpref { background: color-mix(in srgb, var(--accent, #4a7cc9) 25%, transparent); border-radius: 3px; }

/* interlinear / reader's-edition layout for tagged originals */
.line.interlinear { line-height: 1.25; }
.iw {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: top; margin: 0 1px 6px; min-width: 1.2em;
}
.iw .gloss {
  font-size: .68rem; color: var(--muted); direction: ltr; text-align: center;
  max-width: 9em; white-space: normal; line-height: 1.15;
}
.lang-hbo .iw .gloss { font-size: .7rem; }
#settingsview label { display: block; margin: 8px 0; }
#settingsview label select { margin-left: 6px; max-width: 100%; }

/* full lexicon entries: collapsed sections under the Strong's gloss */
details.lexfull { margin: 6px 0; border-top: 1px solid var(--line); padding-top: 4px; }
details.lexfull summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.lexbody p { margin: 6px 0; font-size: .95rem; }

/* people, places, events */
.kindchip {
  display: inline-block; font-size: .65rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); background: var(--chip);
  border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: 1px;
}
.tlperiod { margin-top: 10px; font-weight: 600; }
.tlrow { display: flex; gap: 10px; }
.tlyear { flex: 0 0 9em; color: var(--muted); font-variant-numeric: tabular-nums; }

/* read aloud */
#readbtn { flex: 0 0 2.6em; display: flex; align-items: center; justify-content: center; color: var(--muted); }
#readbtn.playing { color: var(--accent); }
.verse-row.reading { background: var(--chip); border-radius: 6px; }
.word.variant { text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; }

/* parsing search */
.morphsearch { margin: 4px 12px 8px; }
.morphsearch summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.morphsearch .searchbar { margin-top: 6px; }
.morphsearch .hint { margin: 6px 0 0; }

/* offline map */
.mapwrap { width: 100%; touch-action: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mapcanvas { display: block; }

/* annotations: highlights, bookmarks, notes */
.verse-row.hl-yellow { background: color-mix(in srgb, #f5d547 32%, transparent); }
.verse-row.hl-green  { background: color-mix(in srgb, #63c77a 30%, transparent); }
.verse-row.hl-blue   { background: color-mix(in srgb, #5da4f0 30%, transparent); }
.verse-row.hl-pink   { background: color-mix(in srgb, #f08cb8 30%, transparent); }
.occ.hl-yellow { border-left: 4px solid #f5d547; padding-left: 6px; }
.occ.hl-green  { border-left: 4px solid #63c77a; padding-left: 6px; }
.occ.hl-blue   { border-left: 4px solid #5da4f0; padding-left: 6px; }
.occ.hl-pink   { border-left: 4px solid #f08cb8; padding-left: 6px; }
.vnum.bm::after { content: "★"; font-size: .6rem; color: var(--accent); margin-left: 1px; }
.vnum.hasnote { text-decoration: underline dotted; text-underline-offset: 3px; }
.annbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 8px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatch.on { border-color: var(--ink); }
.sw-yellow { background: #f5d547; } .sw-green { background: #63c77a; }
.sw-blue { background: #5da4f0; } .sw-pink { background: #f08cb8; }
.annbtn.on { color: var(--accent); }
.annnotewrap { flex-basis: 100%; display: flex; gap: 6px; align-items: flex-start; }
.annnote { flex: 1; min-height: 3.5em; font: inherit; font-size: .95rem; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; background: var(--bg); color: var(--ink); resize: vertical; }
.annshown { flex-basis: 100%; margin: 2px 0 0; white-space: pre-wrap; font-size: .95rem; }
.workann { max-width: 820px; margin: 0 auto; padding: 4px 12px 12px; }

/* Greek edition diff */
.eddiff .line { line-height: 1.7; }
.ed-ins { background: color-mix(in srgb, #63c77a 35%, transparent); border-radius: 3px; padding: 0 2px; }
.ed-del { text-decoration: line-through; color: var(--muted); }

/* data update offer (PWA) */
.updatebar {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; padding: 8px 12px; background: var(--chip); color: var(--ink);
  border-bottom: 1px solid var(--line); font-size: .9rem;
}

/* wide screens (tablet landscape / desktop): the two texts side by side
   instead of stacked, and a wider reading column */
@media (min-width: 900px) {
  #content, #topbar, #bottombar, .sheet, .workann, #workview, #libraryview,
  #searchview, #settingsview { max-width: 1100px; }
  .vbody.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: start; }
  .vbody.two .line-b { color: var(--ink); }
}

/* ------- Ask AI (beta) toggle + AI search data (Settings / Ask page) ------- */
.aitoggle {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 4px;
  cursor: pointer;
}
.aitoggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.aidata {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 4px;
}
.aidata.compact {
  justify-content: center; text-align: center; margin: 4px 0 12px;
}

/* ------- data packs: Downloads card, inline prompts, picker tags ------- */
.packlist { margin-top: 8px; }
.packrow { border-top: 1px solid var(--line); padding: 10px 0 6px; }
.packrow .hint { margin: 4px 0 6px; }
.packrow button { margin-right: 8px; }
.packhead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.packtitle { font-weight: 600; }
.packtag {
  display: inline-block; margin-left: 8px; font-size: .68rem; letter-spacing: .04em;
  color: var(--muted); background: var(--chip); border-radius: 4px; padding: 1px 6px;
  vertical-align: middle;
}
.textbox.needs-pack { opacity: .7; }
.packnotice { margin: 14px 0; }
