:root {
  /* Colors come from themes.css (generated from the design system). */
  --read: "Newsreader", Georgia, serif;
  --ui: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font: 400 18px/1.6 var(--read);
  overflow-x: hidden;
}
a { color: var(--text); }
/* The top bar (patterns.md "Top bar"): 56 px, wordmark left, tools then the `menu` button right.
   Every screen; on a walk day or study the page puts its own back link in place of the wordmark (walk.css). */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 6px 0 20px;
  font-family: var(--ui); position: sticky; top: 0; background: var(--ground); z-index: 20;
}
.brand { text-decoration: none; font: 500 20px/1.2 var(--read); color: var(--text); }
.top-end { display: flex; align-items: center; gap: 4px; }

/* The menu sheet (patterns.md "Menu sheet"): full width under the bar, rows 52 px. */
.nav-sheet {
  position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 19;
  background: var(--panel); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; padding-top: 8px; overflow-y: auto;
  font: 400 16px/1.3 var(--ui);
}
.nav-sheet[hidden] { display: none; }
body.nav-open { overflow: hidden; }
.nav-row {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 20px;
  color: var(--text); text-decoration: none;
}
.nav-row .i { color: var(--muted); }
.nav-row:hover { background: var(--raised); }
.nav-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.nav-row[aria-current="page"] { background: var(--keywash); }
.nav-row[aria-current="page"] .i { color: var(--gold); }
.nav-note { margin-left: auto; font-size: 12px; color: var(--muted); }
/* Sign out (login): a button that looks like the rows above it. */
button.nav-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.nav-divider { height: 1px; background: var(--line); margin: 8px 20px; }
/* On a day or study: the This day / This study group on top (day-page.md "Shape"; board "CHOSEN · 2 · Theme
   study · menu open"): every section with the passages it uses, the current one gold on keywash, then Key. */
.nav-group { padding: 8px 20px 4px; font: 600 11px/1.4 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
button.nav-row, .nav-sec {
  width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--text);
}
.nav-sec { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 6px 20px; }
.nav-sec:hover { background: var(--raised); }
.nav-sec:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.nav-sec-n { flex: none; width: 18px; padding-top: 2px; font: 600 12px/1.4 var(--ui); color: var(--muted); }
.nav-sec-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-sec-name { font: 400 14.5px/1.35 var(--ui); color: var(--text); }
.nav-sec-refs { font: 400 12px/1.4 var(--ui); color: var(--muted); }
.nav-sec[aria-current] { background: var(--keywash); }
.nav-sec[aria-current] .nav-sec-n { color: var(--gold); }
.nav-sec[aria-current] .nav-sec-name { color: var(--gold); font-weight: 600; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 80px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 8px 0 4px; font-weight: 500; }
h2.label, .label {
  font: 600 12px/1.4 var(--ui); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 6px;
}
.muted { color: var(--muted); font-family: var(--ui); font-size: 14px; }
.back { font: 500 14px var(--ui); color: var(--muted); text-decoration: none; }
.msg { margin-top: 20vh; text-align: center; font-family: var(--ui); color: var(--muted); }
.msg-retry { display: block; margin: 12px auto 0; }

/* interface icons (js/icons.js): color comes from the text; gold only for the current menu item */
.i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.icon-btn {
  width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center;
  border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: var(--raised); }
.icon-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[aria-current="page"] .i, .i.current { color: var(--gold); }

/* days list */
.days { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.days a {
  display: block; text-decoration: none; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px;
}
.days a:hover { background: var(--raised); }
.days .t { font-size: 1.1rem; display: flex; gap: 8px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; }
.pill { font: 500 11px var(--ui); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 99px; padding: 1px 8px; }

/* day sections */
.sec { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.sec p { margin: 0 0 .6em; }
.sec p:last-child { margin-bottom: 0; }
.kv { margin: 6px 0; }
.kv > .k { font: 500 12px var(--ui); color: var(--muted); }
.item { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.item:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.sample-note { font: 400 13px var(--ui); color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px 10px; }
.xref { color: var(--red); font-family: var(--ui); font-weight: 500; }
.quote-text { font-style: italic; }
[data-quote] { font-style: italic; }
.hl {
  color: var(--blue); background: none; border: 0; padding: 0; font: inherit; font-style: inherit;
  border-bottom: 1px dotted var(--blue); cursor: pointer;
}
.verse { margin: 6px 0; }
.verse .vn { color: var(--muted); font: 500 11px var(--ui); margin-right: 2px; }
.html p { margin: 0 0 10px; }
.html p:last-child { margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip {
  color: var(--blue); background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: 99px; padding: 2px 10px; font: 400 15px var(--ui); cursor: pointer;
}
.card {
  background: var(--raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-family: var(--ui); font-size: 15px;
}
.card .lemma { color: var(--blue); font-size: 1.6rem; line-height: 1.3; }
.card .lemma.greek { font-family: "Noto Serif", serif; }
.card .lemma.hebrew { font-family: "Noto Serif Hebrew", serif; direction: rtl; text-align: left; }
.card .meta { color: var(--muted); font-size: 13px; }
.card .note { margin-top: 6px; color: var(--muted); }

/* toolbar */
select, button, textarea { font-family: var(--ui); color: var(--text); }
select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; font-size: 14px;
}
.btn {
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 7px 12px; font-size: 14px; cursor: pointer;
}
.btn:hover { border-color: var(--gold); }
.tr-line { font: 400 13px var(--ui); color: var(--muted); margin: 6px 0; }

/* saved data */
textarea {
  width: 100%; min-height: 110px; background: var(--ground); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 10px; font-size: 16px; line-height: 1.5; resize: vertical;
}
textarea.hand { font-family: "Caveat", cursive; font-size: 22px; line-height: 1.3; }
.saved { font: 400 12px var(--ui); color: var(--muted); height: 16px; opacity: 0; transition: opacity .4s; }
.saved.on { opacity: 1; }

/* assets */
.asset { margin: 12px 0; }
.asset .box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.asset svg { display: block; width: 100%; height: auto; }
.asset .bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }

@media (min-width: 760px) {
  body { font-size: 19px; }
  .top { padding: 0 12px 0 24px; }
}

/* html visuals (js/frame.js): a sealed frame in a box the width of the content column, rounded like the cards.
   The frame itself is never wider than 390 px (centered in the box on a wider screen): the save check renders
   each visual at 390 px (VisualChecker.Width), and a visual that scales with its width would pass there and
   then be cut off at the frame's 900 px on a desktop. Keep the two numbers the same. */
.asset .sub { font-size: 13px; color: var(--muted); margin: -2px 0 6px; }
.dw-frame-box { overflow: hidden; }
.asset .dw-frame-box { background: var(--visual-ground); }
.dw-frame { display: block; width: 100%; max-width: 390px; margin: 0 auto; border: 0; background: var(--visual-ground); }
