/* מקראאל components. Values come from tokens.css.
   Rules: no text underlines anywhere (emphasis = weight, color, soft marker background, or the reading bracket);
   no gradients; restrained shadows only. */
@font-face { font-family: "Heebo"; font-weight: 100 900; font-display: swap; src: url("/static/fonts/Heebo.woff2") format("woff2"); }
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 300 900; font-display: swap; src: url("/static/fonts/FrankRuhlLibre.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("/static/fonts/Literata.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("/static/fonts/Literata-Italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("/static/fonts/Inter.woff2") format("woff2"); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--mk-paper); color: var(--mk-ink); font-family: var(--mk-font-ui-he); font-size: var(--mk-body-size); line-height: 1.65; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a, button, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--mk-ink); outline-offset: 3px; border-radius: 6px; }
.en, [lang="en"] { font-family: var(--mk-font-ui-en); }
.wrap { max-width: 1260px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--mk-muted); font-weight: 400; }
.plain { list-style: none; margin: 0; padding: 0; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--mk-ink); color: var(--mk-paper); padding: 10px 16px; border-radius: var(--mk-radius-pill); z-index: 20; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* ---------- Header ---------- */
.mk-header { background: var(--mk-surface); border-bottom: var(--mk-border); position: relative; z-index: 10; }
.mk-header-row { display: flex; align-items: center; gap: 24px; min-height: 84px; }
.mk-logo { display: inline-flex; flex: none; }
.mk-logo img { display: block; height: 60px; width: auto; }
.mk-menu { display: flex; align-items: center; gap: 24px; flex: 1; }
.mk-nav { display: flex; gap: 4px; }
.mk-nav a { white-space: nowrap; font-weight: 600; padding: 10px 14px; border-radius: var(--mk-radius-pill); min-height: var(--mk-touch); display: inline-flex; align-items: center; }
.mk-nav a:hover { background: var(--mk-paper); }
.mk-nav a[aria-current="page"] { background: var(--mk-marker-soft); }
.mk-menu-btn { display: none; }
.mk-chips { display: flex; gap: 6px; margin-inline-start: auto; }
.mk-chip { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: var(--mk-radius-pill); padding: 8px 14px; min-height: 40px;
  border: var(--mk-border); background: var(--mk-surface); color: var(--mk-ink); }
.mk-chip:hover { border-color: var(--mk-marker); }
.mk-chip[aria-pressed="true"] { background: var(--mk-ink); border-color: var(--mk-ink); color: var(--mk-paper); }

/* ---------- Type ---------- */
.mk-label { font-family: var(--mk-font-ui-en); font-size: var(--mk-label-size); font-weight: var(--mk-label-weight); letter-spacing: var(--mk-label-tracking); text-transform: uppercase; color: var(--mk-muted); }
.mk-label-he { font-size: 14px; font-weight: 600; color: var(--mk-muted); }
.mk-section-label, .section-title { font-weight: 800; font-size: 26px; line-height: 1.25; margin: 0; }
.mk-section-label { display: block; margin: 44px 0 16px; }
.mk-headline { font-size: clamp(36px, 5vw, var(--mk-headline-max)); font-weight: 800; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
.hl, .mk-headline .bar, .bar { background: var(--mk-marker-soft); border-radius: 10px; padding: 0 .18em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mk-sub, .lead { color: var(--mk-muted); margin: 12px 0 0; font-size: 18px; }
.hint { color: var(--mk-muted); font-size: 15px; margin: 6px 0 0; }
.crumbs { color: var(--mk-muted); font-size: 15px; margin: 28px 0 12px; }
.crumbs a { color: var(--mk-ink); font-weight: 600; }
.crumbs a:hover { color: var(--mk-muted); }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  min-height: var(--mk-touch); padding: 10px 18px; border-radius: var(--mk-radius-pill); border: var(--mk-border); background: var(--mk-surface); color: var(--mk-ink); }
.btn:hover { border-color: var(--mk-marker); }
.btn-primary { background: var(--mk-ink); border-color: var(--mk-ink); color: var(--mk-paper); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-quiet { border-color: transparent; background: transparent; padding-inline: 10px; }
.btn-quiet:hover { background: var(--mk-marker-soft); border-color: transparent; }
.btn.disabled { color: var(--mk-muted); pointer-events: none; }
.input { width: 100%; font: inherit; font-size: 17px; background: var(--mk-surface); border: var(--mk-border); border-radius: var(--mk-radius-pill); padding: 12px 16px; min-height: 52px; color: var(--mk-ink); }
.input:hover { border-color: var(--mk-marker); }
.input::placeholder { color: var(--mk-muted); }
select.input { padding-block: 8px; min-height: var(--mk-touch); }
.field-label { display: block; font-weight: 700; margin-bottom: 8px; }

/* ---------- Cards ---------- */
.card { background: var(--mk-surface); border: var(--mk-border); border-radius: var(--mk-radius-card); padding: 28px 32px; box-shadow: var(--mk-shadow-1); }
.card-sm { background: var(--mk-surface); border: var(--mk-border); border-radius: var(--mk-radius-card-sm); padding: 20px 22px; display: block; box-shadow: var(--mk-shadow-1); }
a.card-sm:hover, a.card:hover { border-color: var(--mk-marker); box-shadow: var(--mk-shadow-2); }
.card-sm .t { font-weight: 700; font-size: 19px; display: block; }
.card-sm .e { font-family: var(--mk-font-ui-en); font-size: 14px; color: var(--mk-muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pill { display: inline-block; background: var(--mk-marker); color: var(--mk-ink); font-family: var(--mk-font-ui-en); font-weight: 700; font-size: 12px; letter-spacing: var(--mk-label-tracking); text-transform: uppercase; border-radius: var(--mk-radius-pill); padding: 4px 12px; }
.pill.he { font-family: var(--mk-font-ui-he); letter-spacing: 0; text-transform: none; font-size: 14px; }

/* ---------- Reading mark: the mirrored open bracket on the Hebrew (right) edge ---------- */
.mark { position: relative; padding-right: calc(var(--mk-mark-arm) + 56px); }
.mark::before { content: ""; position: absolute; right: 30px; top: 28px; bottom: 28px; width: var(--mk-mark-arm); border: var(--mk-mark-stroke) solid var(--mk-marker); border-left: 0; }

/* ---------- Chapter reader (inner pages) ---------- */
.reader { padding: 8px 0; }
.verse { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; padding: 18px 28px 18px 24px; border-bottom: var(--mk-border); position: relative; }
.verse:last-child { border-bottom: 0; }
.verse .n { font-weight: 700; color: var(--mk-muted); font-size: 15px; padding-top: 8px; }
.verse .n a { display: inline-flex; min-width: 32px; min-height: 32px; align-items: center; }
.verse .n a:hover { color: var(--mk-ink); }
.verse.active::after { content: ""; position: absolute; right: 8px; top: 14px; bottom: 14px; width: var(--mk-mark-arm); border: var(--mk-mark-stroke) solid var(--mk-marker); border-left: 0; }
.verse.active .n { visibility: hidden; }
.he-text { font-family: var(--mk-font-scripture-he); font-size: var(--mk-passage-he); line-height: var(--mk-passage-leading); margin: 0; }
.en-text { font-family: var(--mk-font-scripture-en); font-size: var(--mk-passage-en); line-height: 1.6; direction: ltr; text-align: left; margin: 8px 0 0; }
.he-text big, .he-text strong { font-weight: 700; }
body[data-lang="he"] .en-text, body[data-lang="en"] .he-text { display: none; }
body[data-lang="en"] .en-text { margin-top: 0; }
.pager { display: flex; gap: 10px; margin: 24px 0; flex-wrap: wrap; }
.sections { display: flex; flex-wrap: wrap; gap: 10px; }
.sections a { min-width: 52px; min-height: var(--mk-touch); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mk-font-scripture-he); font-size: 19px; border: var(--mk-border); border-radius: var(--mk-radius-pill); padding: 6px 12px; background: var(--mk-surface); }
.sections a:hover { border-color: var(--mk-marker); background: var(--mk-marker-soft); }
.comm { margin-top: 16px; }
.comm h3 { margin: 0 0 8px; font-size: 18px; }
.comm .he-text { font-size: 20px; }
.conn { margin-top: 24px; }
.conn-group { border-top: var(--mk-border); }
.conn-group summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--mk-touch); cursor: pointer; list-style: none; font-weight: 800; font-size: 18px; }
.conn-group summary::-webkit-details-marker { display: none; }
.conn-group summary .count { font-size: 14px; font-weight: 500; color: var(--mk-muted); }
.conn-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.conn-list li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.conn-link { display: inline-flex; align-items: center; min-height: var(--mk-touch); padding: 6px 14px; border-radius: var(--mk-radius-pill); border: var(--mk-border); background: var(--mk-paper); font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.conn-link:hover { border-color: var(--mk-marker); background: var(--mk-marker-soft); }
.conn-kind { font-size: 13px; font-weight: 500; color: var(--mk-muted); margin-inline-start: 6px; }
.conn-more > summary { display: inline-flex; align-items: center; min-height: var(--mk-touch); cursor: pointer; list-style: none; font-weight: 700; padding: 0 4px; }
.conn-more > summary::-webkit-details-marker { display: none; }
.conn-more[open] > summary { display: none; }
.study .conn-list { margin-top: 6px; }
.attrib { color: var(--mk-muted); font-size: 14px; margin-top: 18px; line-height: 1.7; }
.attrib a { color: var(--mk-ink); font-weight: 600; }

/* ---------- Search ---------- */
.result { display: block; margin-top: 12px; }
.result .ref { font-weight: 700; }
.result mark { background: var(--mk-marker-soft); color: inherit; border-radius: 4px; padding: 0 2px; }
.status { color: var(--mk-muted); margin: 16px 0; }

/* ---------- Homepage ---------- */
.home-hero { padding: 64px 0 24px; max-width: 820px; }
.home-hero .lead { font-size: 20px; }
.home-search { margin-top: 32px; }
.search-row { display: flex; gap: 10px; }
.search-row .input { flex: 1; min-width: 0; box-shadow: var(--mk-shadow-1); }
.search-row .btn { min-height: 52px; padding-inline: 24px; }
.quick { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; min-height: var(--mk-touch); padding: 8px 16px; border-radius: var(--mk-radius-pill); background: var(--mk-surface); border: var(--mk-border); font-weight: 600; }
.chip-link:hover { border-color: var(--mk-marker); background: var(--mk-marker-soft); }

.home-browse, .home-read, .home-more { margin-top: 56px; }
.section-head { margin-bottom: 20px; }
.section-head .crumbs { margin: 0 0 6px; }
.groups { display: grid; grid-template-columns: 1fr 1.6fr 1.3fr; gap: 16px; align-items: start; }
.book-group { background: var(--mk-surface); border: var(--mk-border); border-radius: var(--mk-radius-card); padding: 20px; box-shadow: var(--mk-shadow-1); }
.group-title { margin: 0; font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--mk-touch); cursor: pointer; list-style: none; }
.group-title::-webkit-details-marker { display: none; }
.book-group[open] .group-title { margin-bottom: 12px; }
.toggle { display: none; }
.group-title .count { font-size: 14px; font-weight: 500; color: var(--mk-muted); }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.book-btn { display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 8px 12px; border-radius: var(--mk-radius-pill); border: var(--mk-border); background: var(--mk-paper); }
.book-btn:hover { border-color: var(--mk-marker); }
.book-btn[aria-expanded="true"] { background: var(--mk-marker-soft); border-color: var(--mk-marker); }
.book-btn .bn { font-weight: 700; font-size: 17px; line-height: 1.3; }
.book-btn .bc { font-size: 14px; color: var(--mk-muted); }
.chapter-picker { margin-top: 16px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.picker-title { margin: 0; font-size: 20px; font-weight: 800; }
.chapter-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.chapter-grid a { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: var(--mk-radius-pill); border: var(--mk-border); background: var(--mk-paper); font-family: var(--mk-font-scripture-he); font-size: 19px; }
.chapter-grid a:hover { background: var(--mk-marker-soft); border-color: var(--mk-marker); }

.read-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.reader-card { padding: 22px 24px; }
.reader-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tool-label { font-weight: 700; color: var(--mk-muted); font-size: 15px; }
.seg { display: inline-flex; border: var(--mk-border); border-radius: var(--mk-radius-pill); padding: 3px; background: var(--mk-paper); }
.seg-btn { font: inherit; font-size: 15px; font-weight: 600; border: 0; background: transparent; border-radius: 6px; padding: 8px 12px; min-height: 40px; cursor: pointer; color: var(--mk-ink); }
.seg-btn[aria-pressed="true"] { background: var(--mk-ink); color: var(--mk-paper); }
.preview { list-style: none; margin: 0; padding: 0; }
.pv { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; padding: 16px 30px 16px 0; border-bottom: var(--mk-border); }
.pv:last-child { border-bottom: 0; }
.pv-n { grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--mk-muted); font-weight: 700; }
.pv-n:hover { background: var(--mk-marker-soft); color: var(--mk-ink); }
.pv .he-text { font-size: 25px; line-height: 1.8; grid-column: 2; }
.pv .en-text { font-size: 18px; line-height: 1.6; grid-column: 2; margin: 0; }
.pv.is-active::after { content: ""; position: absolute; right: 0; top: 18px; bottom: 18px; width: 14px; border: var(--mk-mark-stroke) solid var(--mk-marker); border-left: 0; }
.pv.is-active .he-text { font-weight: 500; }
@media (min-width: 1000px) {
  .preview.layout-side .pv { grid-template-columns: 40px minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .preview.layout-side .pv .he-text { grid-column: 2; grid-row: 1; }
  .preview.layout-side .pv .en-text { grid-column: 3; grid-row: 1; padding-inline-end: 4px; padding-top: 6px; border-inline-end: 0; }
  .preview.layout-side .pv-n { grid-row: 1; }
}
.reader-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.study { position: sticky; top: 16px; padding: 22px; }
.study-title { margin: 0 0 12px; font-size: 20px; font-weight: 800; }
.tabs { display: flex; gap: 4px; background: var(--mk-paper); border: var(--mk-border); border-radius: var(--mk-radius-pill); padding: 3px; margin-bottom: 14px; }
.tabs [role="tab"] { flex: 1; font: inherit; font-weight: 700; font-size: 15px; border: 0; background: transparent; border-radius: 6px; min-height: var(--mk-touch); cursor: pointer; color: var(--mk-ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--mk-surface); box-shadow: var(--mk-shadow-1); }
.comm-list { list-style: none; margin: 0 0 8px; padding: 0; }
.comm-item { padding: 12px 0; border-bottom: var(--mk-border); }
.comm-item:last-child { border-bottom: 0; }
.comm-item h4 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.he-text.small { font-size: 18px; line-height: 1.7; }
.not-yet { color: var(--mk-muted); margin: 4px 0; }
.tag { display: inline-block; margin-inline-end: 8px; font-size: 13px; font-weight: 700; color: var(--mk-ink); background: var(--mk-paper); border: var(--mk-border); border-radius: var(--mk-radius-pill); padding: 2px 10px; }
.home-more .grid { margin-top: 16px; }

/* ---------- Footer ---------- */
.mk-footer { border-top: var(--mk-border); margin-top: 72px; padding: 28px 0 40px; color: var(--mk-muted); font-size: 15px; background: var(--mk-surface); }
.mk-footer a { color: var(--mk-ink); font-weight: 600; display: inline-flex; align-items: center; min-height: var(--mk-touch); }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .read-grid { grid-template-columns: 1fr; }
  .study { position: static; }
  .groups { grid-template-columns: 1fr 1fr; }
  .groups .book-group:first-child { grid-column: 1 / -1; }
}

/* ---------- Header collapses into the menu button when the 7 links + language chips no longer fit ---------- */
@media (max-width: 1240px) {
  .mk-menu-btn { display: inline-flex; align-items: center; margin-inline-start: auto; font: inherit; font-weight: 700; min-height: var(--mk-touch); padding: 8px 16px;
    border: var(--mk-border); border-radius: var(--mk-radius-pill); background: var(--mk-surface); color: var(--mk-ink); cursor: pointer; }
  .mk-menu-btn[aria-expanded="true"] { background: var(--mk-ink); color: var(--mk-paper); border-color: var(--mk-ink); }
  .mk-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 12px;
    background: var(--mk-surface); border-bottom: var(--mk-border); padding: 12px 16px 18px; box-shadow: var(--mk-shadow-2); }
  .mk-menu.open { display: flex; }
  .mk-nav { flex-direction: column; gap: 2px; }
  .mk-nav a { min-height: 48px; font-size: 18px; }
  .mk-chips { margin: 0; flex-wrap: wrap; }
  .mk-chip { min-height: var(--mk-touch); flex: 1 1 auto; }
}

/* ---------- Phone: designed as its own layout ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .mk-header-row { min-height: 68px; gap: 12px; }
  .mk-logo img { height: 46px; }
  .home-hero { padding: 32px 0 8px; }
  .home-hero .lead { font-size: 18px; }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
  .groups { grid-template-columns: 1fr; }
  .book-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book-group { padding: 12px 16px; }
  .toggle { display: inline-block; margin-inline-start: 10px; font-weight: 700; color: var(--mk-ink); background: var(--mk-paper); border: var(--mk-border); border-radius: var(--mk-radius-pill); padding: 4px 12px; }
  .toggle::after { content: "הצגה"; }
  .book-group[open] .toggle::after, .conn-group[open] > summary .toggle::after { content: "הסתרה"; }
  .crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--mk-touch); min-width: var(--mk-touch); padding: 0 2px; }
  .home-browse, .home-read, .home-more { margin-top: 40px; }
  .section-title, .mk-section-label { font-size: 23px; }
  .reader-tools { display: none; }               /* phones always read Hebrew first, English below */
  .reader-card { padding: 14px 16px; }
  .pv { padding: 14px 22px 14px 0; }
  .pv { grid-template-columns: 44px minmax(0, 1fr); }
  .pv-n { width: 44px; height: 44px; }
  .pv .he-text { font-size: 22px; }
  .pv .en-text { font-size: 17px; }
  .pv.is-active::after { width: 11px; }
  .reader-actions .btn { width: 100%; }
  .study { padding: 16px; }
  .card { padding: 20px 18px; }
  .verse { grid-template-columns: 32px 1fr; padding: 14px 16px; }
  :root { --mk-passage-he: 23px; --mk-passage-en: 18px; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .book-list { grid-template-columns: 1fr 1fr; }
  .book-btn .bn { font-size: 16px; }
  .chapter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

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

/* ---------- Games (v1.5) — existing tokens only ---------- */
.game-groups { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 16px; }
.game-groups .mk-chip { min-height: var(--mk-touch); }
.game { margin-top: 8px; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.game-score { font-weight: 700; }
.game-q { font-weight: 800; font-size: 20px; margin: 0 0 12px; }
.game-text { font-family: var(--mk-font-scripture-he); font-size: 22px; line-height: 1.8; margin: 0; }
.game-verse { margin: 0 0 20px; padding: 16px 20px; background: var(--mk-paper); border: var(--mk-border); border-radius: var(--mk-radius-card-sm); position: relative; }
.game-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.game-choice { font: inherit; font-weight: 700; font-size: 18px; text-align: start; min-height: 56px; padding: 12px 16px; cursor: pointer;
  background: var(--mk-surface); color: var(--mk-ink); border: var(--mk-border); border-radius: var(--mk-radius-card-sm); }
.game-choice.game-text { font-weight: 400; font-size: 20px; grid-column: 1 / -1; }
.game-choice:hover:not(:disabled) { border-color: var(--mk-marker); background: var(--mk-marker-soft); }
.game-choice:disabled { cursor: default; color: var(--mk-muted); }
.game-choice.is-right, .game-order-item.is-right { color: var(--mk-ink); background: var(--mk-marker-soft); border-color: var(--mk-marker); border-width: 2px; }
.game-choice.is-wrong, .game-order-item.is-wrong { color: var(--mk-ink); border-color: var(--mk-ink); border-width: 2px; }
.game-feedback { margin-top: 16px; font-size: 17px; }
.game-feedback .game-ref { font-weight: 700; }
.game-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.game-order.is-answer { margin-top: 12px; }
.game-order-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px;
  background: var(--mk-surface); border: var(--mk-border); border-radius: var(--mk-radius-card-sm); }
.game-order.is-answer .game-order-item { background: var(--mk-paper); grid-template-columns: 36px 1fr; }
.game-pos { font-weight: 800; font-size: 18px; text-align: center; }
.game-order-item .game-text { font-size: 20px; }
.game-move { display: flex; flex-direction: column; gap: 4px; }
.game-move .btn { min-width: var(--mk-touch); min-height: var(--mk-touch); font-size: 18px; padding: 0; }
.game-final { font-size: 40px; font-weight: 800; margin: 8px 0; }
.game-card .t { font-size: 20px; }
@media (max-width: 760px) {
  .game-choices { grid-template-columns: 1fr; }
  .game-text { font-size: 20px; }
  .game-order-item { grid-template-columns: 28px 1fr auto; padding: 10px; gap: 8px; }
  .game-order-item .game-text { font-size: 18px; }
}

/* ---------- Practice, simulation, my learning, assistant (v1.5) — existing tokens only ---------- */
.learn { margin-top: 8px; }
.q { display: grid; gap: 12px; }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-stem { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 0; }
.q-label { margin-top: 0; }
.q-choices .game-choice { grid-column: 1 / -1; font-weight: 600; }
.game-choice.is-chosen { border-color: var(--mk-ink); border-width: 2px; background: var(--mk-paper); }
.q-answer { min-height: 120px; resize: vertical; font-size: 17px; line-height: 1.6; }
.q-model, .q-ai { padding: 16px 18px; border: var(--mk-border); border-radius: var(--mk-radius-card-sm); background: var(--mk-paper); margin-top: 4px; }
.q-ai { background: var(--mk-surface); margin-bottom: 12px; }
.q-model p, .q-ai p { margin: 8px 0; line-height: 1.7; }
.q-verdict { font-weight: 800; font-size: 18px; }
.practice-book { padding: 12px 0; border-bottom: var(--mk-border); }
.practice-book:last-child { border-bottom: 0; }
.practice-cta { margin-top: 24px; }
.ask-link { margin: 16px 0 0; }
.sim-timer { position: sticky; top: 8px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; margin-bottom: 12px;
  background: var(--mk-surface); border: var(--mk-border); border-radius: var(--mk-radius-pill); box-shadow: var(--mk-shadow-1); font-weight: 800; font-size: 18px; }
.sim-timer.is-low { border-color: var(--mk-marker); background: var(--mk-marker-soft); }
.sim-q { padding: 18px 0; border-top: var(--mk-border); }
.sim-result { margin-bottom: 20px; outline: none; }
.my-list { list-style: none; margin: 8px 0 20px; padding: 0; }
.my-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; min-height: var(--mk-touch); padding: 8px 0; border-bottom: var(--mk-border); }
.my-row a { font-weight: 700; display: inline-flex; align-items: center; min-height: var(--mk-touch); }
.my-row span { color: var(--mk-muted); }
.learn .section-title { margin: 8px 0 8px; font-size: 22px; }
.notice { margin: 20px 0; }
.notice-list { margin: 8px 0 0; padding-inline-start: 20px; line-height: 1.8; }
.chat-log { display: grid; gap: 12px; margin-bottom: 16px; }
.chat-msg { padding: 14px 16px; border: var(--mk-border); border-radius: var(--mk-radius-card-sm); background: var(--mk-surface); }
.chat-msg.is-me { background: var(--mk-paper); margin-inline-start: 12%; }
.chat-msg p { margin: 8px 0 0; line-height: 1.75; }
.chat-src a { font-weight: 700; display: inline-flex; align-items: center; min-height: var(--mk-touch); }
.chat-form textarea { resize: vertical; font-size: 17px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; }
.check-row input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--mk-ink); }
@media (max-width: 760px) {
  .q-stem { font-size: 18px; }
  .chat-msg.is-me { margin-inline-start: 0; }
  .sim-timer { top: 4px; }
}
.game-feedback .game-ref { display: inline-flex; align-items: center; min-height: var(--mk-touch); }

/* ---------- Phone balance (v1.5.1): even button rows, full-size tap targets ---------- */
@media (max-width: 760px) {
  .verse .n a { min-width: var(--mk-touch); min-height: var(--mk-touch); justify-content: center; }
  .verse .n { min-width: var(--mk-touch); }
  .game-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .game-groups.seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-groups .mk-chip { width: 100%; padding-inline: 8px; }
  .practice-book .game-groups { grid-template-columns: 1fr 1fr; }
  .pager .btn { flex: 1 1 auto; }
}

/* ---------- Footer links and legal pages (v1.5) ---------- */
.mk-footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 8px; }
.mk-footer p { margin: 6px 0; }
.mk-footer-note { font-weight: 700; color: var(--mk-ink); }
.legal { margin-top: 24px; line-height: 1.8; }
.legal .legal-h { font-size: 21px; margin: 28px 0 6px; }
.legal .legal-h:first-child { margin-top: 0; }
.legal p, .legal li { font-size: 17px; }
.legal ul { padding-inline-start: 22px; margin: 6px 0; }
.legal a { font-weight: 700; }
@media (max-width: 760px) {
  .mk-footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
}

/* ---------- Beta welcome window (v1.5) — brand tokens only ---------- */
html.mk-beta-open, html.mk-beta-open body { overflow: hidden; }
.mk-beta { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.mk-beta-overlay { position: absolute; inset: 0; background: rgba(23, 23, 23, 0.42); opacity: 0; transition: opacity .2s ease; }
.mk-beta-dialog { position: relative; width: min(480px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--mk-surface); color: var(--mk-ink); border-radius: var(--mk-radius-card); box-shadow: var(--mk-shadow-2), 0 24px 60px rgba(23, 23, 23, 0.18);
  padding: 36px 36px 32px; text-align: center; display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .22s ease, transform .22s ease; }
.mk-beta.is-in .mk-beta-overlay, .mk-beta.is-in .mk-beta-dialog { opacity: 1; transform: none; }
.mk-beta-logo { width: 180px; height: auto; display: block; margin: 4px auto 18px; }
.mk-beta-pill { margin-bottom: 14px; }
.mk-beta-title { font-size: 30px; font-weight: 800; line-height: 1.25; margin: 0 0 14px; }
.mk-beta-text { color: var(--mk-ink); font-size: 17px; line-height: 1.75; }
.mk-beta-text p { margin: 0 0 6px; }
.mk-beta-text p:last-child { color: var(--mk-muted); margin-top: 12px; }
.mk-beta-ok { margin-top: 24px; width: 100%; min-height: 52px; font-size: 17px; }
.mk-beta-x { position: absolute; top: 12px; inset-inline-end: 12px; width: var(--mk-touch); height: var(--mk-touch); display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--mk-ink); border-radius: var(--mk-radius-pill); cursor: pointer; }
.mk-beta-x:hover { background: var(--mk-paper); }
.mk-beta-dialog:focus { outline: none; }
@media (max-width: 760px) {
  /* Phone: a bottom sheet, within thumb reach */
  .mk-beta { align-items: flex-end; padding: 0; }
  .mk-beta-dialog { width: 100%; max-height: 92vh; border-radius: var(--mk-radius-card) var(--mk-radius-card) 0 0;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(24px); }
  .mk-beta-logo { width: 150px; margin-bottom: 14px; }
  .mk-beta-title { font-size: 26px; }
  .mk-beta-text { font-size: 16px; }
  .mk-beta-x { top: 8px; inset-inline-end: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-beta-overlay, .mk-beta-dialog { transition: none; transform: none; }
}
