/* Forge layer, loaded last on every page: ink edges, hard offset shadows, heavy type (after forge.taiko.ac). */

body { font-family: var(--font-ui); background: var(--bg); color: var(--text); }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---- Type ---- */
h1, h2, h3, .title-main, .section-heading h2, .hero h1 { font-family: var(--font-ui); font-weight: 900; letter-spacing: -.01em; color: var(--text-strong); }
h1, .page-head h1, .dash-head .title-main { font-size: clamp(1.75rem, 2.6vw, 2.375rem); line-height: 1.25; letter-spacing: -.02em; }
.page-panel h2, .dash-section-title, .dash-panel h2 { font-weight: 900; }
main a:not([class]), .page-panel a:not([class]) { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.page-head .breadcrumbs, .page-head .content-meta, .dash-tile-label, .page-side h2, .cq-top span, .q-meta, .bank-code, .section-index {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary);
}
.page-head .breadcrumbs a { color: inherit; }
.page-panel h2::before { content: ''; display: inline-block; width: 12px; height: 12px; margin: 0 10px 0 0; vertical-align: .05em; background: var(--red); border: 2px solid var(--edge); border-radius: 50%; }
.page-side .page-panel h2::before { display: none; }

/* ---- Header bar and footer ---- */
.site-header { background: var(--bar); color: var(--bar-fg); border-bottom: 3px solid var(--red); }
.site-header .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--bar-fg); font-weight: 900; letter-spacing: -.01em; }
.site-header .brand::before { content: ''; width: 28px; height: 28px; flex: none; background: url('favicon.svg?v=9ef6ea11cd') center / contain no-repeat; }
.site-nav a { padding: 0 10px; border-radius: 8px; color: var(--bar-fg); font-weight: 600; }
.site-nav a:hover { color: var(--bar-fg); background: rgba(255, 255, 255, .1); }
.site-nav button, .site-nav button.menu-toggle { color: var(--bar-fg); background: transparent; border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px; font-weight: 600; }
.site-nav button:hover { background: rgba(255, 255, 255, .1); }
.site-header :focus-visible { outline-color: var(--yellow); }
@media (max-width: 760px) {
  .secondary-navigation { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); }
}
.site-footer { margin-top: 28px; padding-top: 18px; border-top: 2px solid var(--edge); font-size: .8125rem; }
.site-footer-links a { color: var(--text); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---- Cards: thick edge + hard shadow ---- */
.page-card, .page-panel, .dash-tile, .dash-panel, .dash-mode, .card:not(#screen-home), .cheat-quiz, .read-card, .dash-more {
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--hard);
}
.page-dash .page-card { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.page-side .page-panel, .dash-tile { box-shadow: 4px 4px 0 var(--hard); }
.page-body, .page-side, .dash-side { gap: 16px; }
.page-grid { gap: 22px; }
.dash-kpis, .dash-mode-grid { gap: 16px; }
.dash-mode.is-featured { background: var(--yellow); border-color: var(--edge); }
.dash-mode.is-featured h3, .dash-mode.is-featured p { color: var(--ink); }

/* Boxes inside cards: edge, no shadow. */
.info-box, .note-box, .question-card, .training-group, .dash-resume, .cq-resume, .cq-note, .cq-card, .cheat-toc, .read-opt {
  border: 2px solid var(--edge); border-radius: 10px;
}
.cq-note.is-right, .cq-card.is-right { border-left: 8px solid var(--success); }
.cq-note.is-wrong, .cq-card.is-wrong { border-left: 8px solid var(--danger); }
.cq-resume { border-left: 8px solid var(--red); }
.dash-resume { background: var(--accent-soft); }
.callout { padding: 14px 16px; background: var(--accent-soft); border: 2px solid var(--edge); border-left: 8px solid var(--red); border-radius: 10px; }
.read-correct { border: 2px solid var(--success); }

/* ---- Buttons, tabs, links-as-buttons ---- */
.btn, .cheat-tool, .pref-btn, .dash-tabs button, .cheat-tabs button, .article-nav a, .article-link, .resource-link {
  border: 2px solid var(--edge); border-radius: 10px; box-shadow: 3px 3px 0 var(--hard); font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:hover:not(:disabled), .cheat-tool:hover:not(:disabled), .pref-btn:hover, .dash-tabs button:hover, .cheat-tabs button:hover,
.article-nav a:hover, .article-link:hover, .resource-link:hover {
  transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hard); border-color: var(--edge);
}
.btn:active:not(:disabled), .cheat-tool:active:not(:disabled), .pref-btn:active, .dash-tabs button:active, .cheat-tabs button:active,
.article-nav a:active, .article-link:active, .resource-link:active {
  transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--hard);
}
.btn:disabled, .cheat-tool:disabled { opacity: .55; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-primary, .cq-primary { color: var(--on-primary); background: var(--button-bg); border-color: var(--edge); }
.btn-primary:hover:not(:disabled), .cq-primary:hover:not(:disabled) { background: var(--button-hover); }
.btn-outline, .cheat-tool:not(.cq-primary), .pref-btn, .dash-tabs button, .cheat-tabs button, .article-nav a { color: var(--text); background: var(--surface); }
.article-link, .resource-link { background: var(--surface); }
.article-link strong { color: var(--text-strong); }
.dash-tabs button[aria-pressed="true"], .cheat-tabs button[aria-selected="true"], .pref-btn[aria-pressed="true"], .cheat-tool[aria-pressed="true"] {
  color: var(--bg); background: var(--edge); border-color: var(--edge);
}
.dash-tabs button[aria-pressed="true"] small { color: inherit; }
.dash-link { color: var(--primary); font-weight: 700; text-decoration-thickness: 2px; }

/* ---- Answer options ---- */
.opt-label, .cq-option { border: 2px solid var(--edge); border-radius: 12px; box-shadow: 3px 3px 0 var(--hard); transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
@media (hover: hover) { .opt-label:hover:not(.disabled), .cq-option:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hard); border-color: var(--edge); background: var(--surface); } }
.opt-label:has(input:checked):not(.disabled) { color: var(--ink); background: var(--yellow); border-color: var(--edge); }
.opt-label input { accent-color: var(--red); }
.cq-option:disabled, .opt-label.disabled { box-shadow: none; transform: none; }
.is-correct, .is-wrong, .cq-option.is-right, .cq-option.is-wrong { border-width: 2px; box-shadow: 3px 3px 0 var(--hard) !important; }
.cq-key { color: var(--bg); background: var(--edge); border-radius: 6px; font-family: var(--font-mono); }
.q-text, .cq-stem { font-weight: 800; }

/* ---- Meters and badges ---- */
.dash-meter, .cheat-bar, .progress-bar-bg { height: 12px; background: var(--surface-soft); border: 2px solid var(--edge); border-radius: 999px; overflow: hidden; }
.dash-meter i, .cheat-bar i, .progress-bar-fill { background: var(--red); border-radius: 0; }
.dash-badge, .dash-pill { border: 2px solid var(--edge); }

/* ---- Sticker subtitle on the dashboard ---- */
.dash-head p { display: inline-block; margin-top: 8px; padding: 4px 12px; color: var(--ink); background: var(--yellow); border: 2px solid var(--edge); box-shadow: 3px 3px 0 var(--hard); font-weight: 800; transform: rotate(-1deg); }

/* ---- Tables ---- */
.table-wrap { border: 2px solid var(--edge); border-radius: 10px; }
.table-wrap table { margin: 0; }
th, td { border-color: var(--border); }
.table-wrap th { color: var(--bar-fg); background: var(--bar); border-color: var(--bar); }
.table-wrap tr > :first-child { border-left: 0; }
.table-wrap tr > :last-child { border-right: 0; }
.table-wrap thead tr:first-child > *, .table-wrap table > tbody:first-child tr:first-child > * { border-top: 0; }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }

/* ---- Inputs ---- */
.cheat-search input, input[type="search"], input[type="text"], select, textarea { border: 2px solid var(--edge); border-radius: 10px; background: var(--surface); color: var(--text); }

/* ---- Member account ---- */
.site-nav a.nav-account { order: 99; margin-left: 4px; color: var(--ink); background: var(--yellow); border: 2px solid var(--edge); font-weight: 800; }
.site-nav a.nav-account:hover { color: var(--ink); background: var(--yellow); filter: brightness(1.05); }
.acct { display: grid; gap: 14px; }
.acct h2 { margin: 0; }
.acct-tabs { display: flex; gap: 10px; }
.acct-tabs button { padding: 8px 18px; }
.acct-form { display: grid; gap: 14px; max-width: 420px; }
.acct-field { display: grid; gap: 6px; font-weight: 800; }
.acct-field input { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; font-size: max(1rem, 16px); font-weight: 600; color: var(--text); background: var(--surface); border: 2px solid var(--edge); border-radius: 10px; }
.acct-field input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
.acct-pw { position: relative; }
.acct-pw input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 2px; bottom: 2px; min-width: 64px; min-height: 40px; padding: 0 12px; font: inherit; font-size: .875rem; font-weight: 800; color: var(--text); background: var(--surface); border: 0; border-left: 2px solid var(--edge); border-radius: 0 8px 8px 0; cursor: pointer; }
.acct-code { max-width: 12ch; font-family: var(--font-mono); font-size: 1.375rem !important; letter-spacing: .3em; }
.acct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.acct-actions .btn { padding: 10px 18px; }
.acct-linkbtn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 6px; font: inherit; background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.acct-note { margin: 0; color: var(--text-muted, var(--text)); font-size: .875rem; }
.acct-msg { margin: 0; font-weight: 700; }
.acct-msg:empty { display: none; }
.acct-msg.is-error { color: var(--danger); }
.acct-msg.is-ok { color: var(--success); }
.acct-who { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin: 0; }
.acct-who span { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.acct-sync { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--edge); border-left: 8px solid var(--red); border-radius: 10px; }
.acct-sync p { margin: 0; }
.acct-sync strong { display: block; }
.acct-sync.is-synced { border-left-color: var(--success); }
.acct-sync.is-error, .acct-sync.is-conflict { border-left-color: var(--danger); }
.acct-more { padding: 10px 14px; border: 2px solid var(--edge); border-radius: 10px; background: var(--surface); }
.acct-more summary { font-weight: 800; cursor: pointer; }
.acct-more[open] summary { margin-bottom: 12px; }
.acct-perks { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--edge); }
html.dark-mode .btn-danger, html.dark-mode .bank-jump .bank-jump-start { color: #1d1a17; }
.acct-banner { position: fixed; z-index: 1000; left: 50%; bottom: 16px; width: min(640px, calc(100% - 24px)); transform: translateX(-50%); display: grid; gap: 12px; padding: 16px 18px; color: var(--text); background: var(--surface); border: 2px solid var(--edge); border-left: 8px solid var(--red); border-radius: 12px; box-shadow: 6px 6px 0 var(--hard); }
.acct-banner p { margin: 0; }
.acct-banner strong { display: block; margin-bottom: 4px; }
.acct-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.acct-banner-actions .btn, .acct-actions .btn { width: auto; flex: 0 0 auto; }
.acct-banner-actions .btn { padding: 8px 14px; }

/* ---- Plans ---- */
.plans-msg { margin: 0 0 16px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--edge); border-left: 8px solid var(--red); border-radius: 10px; }
.plans-msg.is-ok { border-left-color: var(--success); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.plan-card { display: flex; flex-direction: column; gap: 12px; }
.plan-card h2 { margin: 0; }
.plan-card.is-featured { border-width: 3px; box-shadow: 6px 6px 0 var(--red); }
.plan-price { margin: 0; font-family: var(--font-mono); }
.plan-price strong { font-size: 2.25rem; font-weight: 900; color: var(--text-strong); }
.plan-price span { margin-left: 4px; font-weight: 700; }
.plan-list { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.plan-action { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; }
.plan-action .btn { width: auto; padding: 10px 18px; }
.plan-action .acct-note { flex-basis: 100%; }
.plan-current { margin: 0; flex-basis: 100%; font-weight: 800; color: var(--success); }
.plan-tag { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: .7rem; font-weight: 800; color: var(--ink); background: var(--yellow); border: 2px solid var(--edge); border-radius: 6px; vertical-align: .1em; }
.acct-plan .btn { width: auto; }

/* ---- Hub (home) ---- */
.container.hub { max-width: 1248px; padding: 32px 32px 44px; display: grid; gap: 28px; }
@media (max-width: 760px) { .container.hub { padding: 20px 16px 32px; } }
.hub-hero { display: grid; gap: 14px; justify-items: start; }
.hub-hero h1 { margin: 0; font-size: clamp(1.875rem, 4.5vw, 2.75rem); line-height: 1.2; text-wrap: balance; }
.hub-hero .lead { max-width: 640px; margin: 0; font-size: 1.0625rem; color: var(--muted); }
.hub-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; margin: 0; padding: 0 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; box-shadow: 4px 4px 0 var(--hard); scroll-margin-top: 8px; }
.hub-search:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.hub-search svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--muted); }
.hub-search input { flex: 1; min-width: 0; padding: 14px 0; font: inherit; font-size: 1.0625rem; color: var(--text); background: transparent; border: 0; outline: 0; }
.hub-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .9375rem; }
.hub-popular span { color: var(--muted); font-weight: 700; }
.hub-popular a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; color: var(--text); font-weight: 700; text-decoration: none; background: var(--surface-soft); border-radius: 999px; }
.hub-popular a:hover { background: var(--accent-soft); color: var(--text); }
.hub-trust { margin: 0; max-width: 640px; font-size: .8125rem; color: var(--muted); }
.hub-trust a { color: inherit; font-weight: 700; }
.hub-resume { margin: 0; }
.hub-resume a { display: inline-block; padding: 8px 14px; font-weight: 800; color: var(--ink); background: var(--yellow); border: 2px solid var(--edge); border-radius: 10px; box-shadow: 3px 3px 0 var(--hard); }
.hub-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hub-features > * { display: grid; gap: 4px; padding: 14px 16px; color: var(--text); background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; text-decoration: none; }
.hub-features strong { font-size: 1rem; font-weight: 800; color: var(--text-strong); }
.hub-features span { font-size: .875rem; color: var(--muted); }
.hub-features span a { color: #b53a1d; font-weight: 700; }
html.dark-mode .hub-features span a { color: var(--red); }
.hub-features .is-cheat { background: var(--yellow); box-shadow: 4px 4px 0 var(--hard); transition: transform .12s ease, box-shadow .12s ease; }
.hub-features .is-cheat strong, .hub-features .is-cheat span { color: #1d1a17; }
.hub-features .is-cheat:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--hard); }
.hub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.hub-tabs button { padding: 8px 16px; min-height: 40px; font: inherit; font-weight: 800; color: var(--text); background: transparent; border: 2px solid var(--edge); border-radius: 999px; cursor: pointer; }
.hub-tabs button:hover { background: var(--surface-soft); }
.hub-tabs button[aria-pressed="true"] { color: #1d1a17; background: var(--yellow); }
.hub-count { margin-left: 4px; font-family: var(--font-mono); font-size: .8125rem; font-weight: 700; opacity: .7; }
.hub-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 10px; align-items: start; }
.hub-groups .hub-list { grid-template-columns: 1fr; }
.hub-groups.is-one { display: block; }
.hub-groups.is-one .hub-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.hub-group { margin-top: 18px; }
.hub-group[hidden] { display: none; }
.hub-group h3 { display: flex; align-items: baseline; margin: 0 0 10px; font-size: 1.125rem; font-weight: 900; }
.hub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hub-item { display: grid; gap: 2px; padding: 11px 14px; color: var(--text); text-decoration: none; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; transition: transform .12s ease, box-shadow .12s ease; }
.hub-item[hidden] { display: none; }
@media (hover: hover) { .hub-item:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hard); color: var(--text); } }
.hub-item { min-height: 56px; }
.hub-item:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.hub-item-text { display: grid; gap: 2px; min-width: 0; }
.hub-item-text strong { font-size: 1.0625rem; font-weight: 800; color: var(--text-strong); line-height: 1.35; }
.hub-item-text span { font-size: .8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-more { min-height: 44px; margin-top: 10px; padding: 8px 14px; font: inherit; font-weight: 800; color: var(--text); background: transparent; border: 2px dashed var(--edge); border-radius: 10px; cursor: pointer; }
.hub-more:hover { background: var(--surface-soft); }
.hub-more[hidden] { display: none; }
.hub-empty { margin: 8px 0 0; color: var(--muted); }
@media (max-width: 760px) {
  .hub-features { grid-template-columns: 1fr; gap: 8px; }
  .hub-features > * { padding: 10px 14px; }
  .hub-popular a { min-height: 44px; }
  .hub-tabs button, .admin-tabs button, .acct-tabs button, .site-nav .subject-menu a { min-height: 44px; }
  .q-page-more li a, .hub-picks li a { min-height: 44px; display: flex; align-items: center; }
  .hub-tabs button { flex: 1 1 auto; }
}

/* ---- Admin ---- */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.admin-head h1 { margin: 0; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-tabs button { padding: 8px 14px; }
#admin-app { display: grid; gap: 18px; }
#admin-app[aria-busy="true"] { opacity: .6; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.adm-kpis .dash-tile { display: grid; gap: 4px; padding: 14px 16px; }
.adm-kpis .dash-tile strong { font-size: 1.75rem; font-weight: 900; color: var(--text-strong); font-family: var(--font-mono); }
.adm-kpis .dash-tile small { color: var(--muted); }
.adm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.adm-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.adm-plot { position: relative; }
.adm-plot svg { display: block; width: 100%; height: auto; }
.adm-grid { stroke: var(--border); stroke-width: 1; }
.adm-axis { fill: var(--muted); font-size: 13px; font-family: var(--font-mono); }
.adm-bar path { fill: var(--red); }
.adm-bar .adm-hit { fill: transparent; }
.adm-bar.is-on .adm-hit { fill: var(--surface-soft); }
.adm-bar.is-on path { fill: var(--button-hover); }
.adm-tip[hidden] { display: none; }
.adm-tip { position: absolute; top: 0; display: grid; gap: 2px; padding: 8px 10px; font-size: .8125rem; color: var(--text); background: var(--surface); border: 2px solid var(--edge); border-radius: 8px; box-shadow: 3px 3px 0 var(--hard); pointer-events: none; white-space: nowrap; }
.adm-table { overflow-x: auto; }
.adm-table table { width: 100%; font-size: .875rem; }
.adm-table td, .adm-table th { padding: 6px 10px; vertical-align: top; }
.adm-wrap { max-width: 280px; overflow-wrap: anywhere; }
.adm-ua { max-width: 220px; color: var(--muted); font-size: .75rem; }
.adm-table tr.is-bot { opacity: .55; }
.adm-link { padding: 0; font: inherit; color: var(--primary, var(--red)); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.adm-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adm-filter input[type="search"], .adm-filter select { min-height: 40px; padding: 6px 10px; font: inherit; }
.adm-filter .btn { width: auto; padding: 8px 16px; }
.adm-check { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.adm-pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adm-pager .btn { width: auto; padding: 6px 12px; }
.adm-pill { display: inline-block; padding: 0 8px; font-size: .75rem; font-weight: 800; border: 2px solid var(--edge); border-radius: 999px; }
.adm-pill.is-ok { color: var(--success); }
.adm-pill.is-bad { color: var(--danger); }
.adm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.adm-dl dt { font-weight: 800; }
.adm-dl dd { margin: 0; }
.adm-member .acct-actions .btn { width: auto; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.page-grid:not(:has(> .page-side)) { grid-template-columns: minmax(0, 1fr); }
.article-link .plan-tag, .resource-link .plan-tag { display: inline-block; width: auto; margin: 0 0 0 8px; padding: 0 6px; }

/* ---- Cheat sheet: compact reference layout ---- */
.cheat-meta { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 14px; border: 2px solid var(--edge); border-radius: 10px; overflow: hidden; background: var(--surface); }
.cheat-meta > div { flex: 1 1 140px; padding: 8px 14px; border-right: 2px solid var(--edge); }
.cheat-meta > div:last-child { border-right: 0; }
.cheat-meta dt { font-family: var(--font-mono); font-size: .6875rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.cheat-meta dd { margin: 2px 0 0; font-weight: 800; color: var(--text-strong); }
.cheat-bars { margin: 0 0 14px; }
.cheat-rules li { line-height: 1.6; }
.cheat-stat { display: inline-block; margin-left: 6px; padding: 0 6px; font-family: var(--font-mono); font-size: .75rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; vertical-align: .1em; }
.cheat-group h3, .cheat-block h3 { margin-bottom: 8px; }
.cheat-block:has(> h3[id$="-traps"]) { padding: 12px 14px; border-left: 6px solid var(--red); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.cheat-mnemonic { margin-bottom: 10px; padding: 10px 14px; }
.cheat-mnemonic ul { margin: 4px 0 0; }
.cheat-table td, .cheat-table th { padding: 7px 12px; }
.cheat-source { margin-top: 24px; }
@media (max-width: 760px) { .cheat-meta > div { flex-basis: 45%; border-bottom: 2px solid var(--edge); } }

/* ---- Question figures (boat banks) ---- */
.q-figure { margin: 12px 0 4px; }
.q-figure[hidden] { display: none; }
.q-figure img { display: block; max-width: 100%; height: auto; max-height: 360px; padding: 8px; background: #fff; border: 2px solid var(--edge); border-radius: 10px; }

.pref-note { font-size: .875rem; font-weight: 700; color: var(--muted); }

/* ---- Subject switcher (nav) ---- */
.subject-switch { position: relative; order: -1; margin-right: 6px; }
.site-nav .subject-current { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink); background: var(--yellow); border: 2px solid var(--edge); }
.site-nav .subject-current:hover { background: var(--yellow); filter: brightness(1.05); }
.subject-kicker { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; opacity: .75; }
.subject-menu { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 160px; display: grid; padding: 6px; background: var(--surface); border: 2px solid var(--edge); border-radius: 10px; box-shadow: 4px 4px 0 var(--hard); }
.subject-menu[hidden] { display: none; }
.site-nav .subject-menu a { min-height: 40px; padding: 0 12px; color: var(--text); border-radius: 8px; font-weight: 700; }
.site-nav .subject-menu a:hover { color: var(--text); background: var(--surface-soft); }
.subject-menu a[aria-current] { color: #b53a1d; }
html.dark-mode .subject-menu a[aria-current] { color: var(--red); }
.subject-menu a[aria-current]::after { content: '　目前'; font-size: .75rem; color: var(--muted); }
.subject-menu .subject-all { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.subject-menu { width: min(280px, calc(100vw - 32px)); }
.subject-search { width: 100%; min-height: 40px; margin-bottom: 4px; padding: 0 10px; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface-soft); border: 2px solid var(--edge); border-radius: 8px; }
.subject-menu-list { display: grid; max-height: min(52vh, 420px); overflow-y: auto; }
.subject-menu-head { margin: 8px 12px 2px; font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; color: var(--muted); }
.subject-menu-empty { margin: 8px 12px; font-size: .875rem; color: var(--muted); }
.site-nav .subject-menu a { display: flex; align-items: center; }
.site-nav a.nav-cheat { color: var(--yellow); }
.site-nav a.nav-cheat::after { content: '重點'; margin-left: 6px; padding: 0 5px; font-size: .625rem; font-weight: 800; color: var(--ink); background: var(--yellow); border-radius: 4px; vertical-align: .15em; }
.secondary-navigation a.nav-cheat { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .btn, .cheat-tool, .pref-btn, .dash-tabs button, .cheat-tabs button, .article-nav a, .article-link, .resource-link, .opt-label, .cq-option, .hub-item, .hub-features .is-cheat { transition: none; }
  .dash-head p { transform: none; }
}
@media print {
  .page-card, .page-panel, .cheat-quiz, .btn, .article-nav a, .opt-label { box-shadow: none !important; }
  .site-header { border-bottom: 0; }
}

/* ── study tools: explanations, bookmark/report, dashboard forecast & exam date ── */
.explain, .q-explain { margin: 8px 0 0; padding: 10px 12px; font-size: .9375rem; line-height: 1.75; color: var(--text); background: var(--surface-2, rgba(127,127,127,.08)); border-left: 3px solid var(--success); border-radius: 0 8px 8px 0; }
.q-explain[hidden] { display: none; }
#screen-quiz .q-explain { font-size: 1.0625rem; scroll-margin-bottom: 96px; }
.q-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.q-tools .q-explain { flex-basis: 100%; order: -1; }
.q-tool { padding: 4px 12px; font-size: .875rem; font-weight: 700; color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.q-tool:hover { border-color: var(--edge); }
.q-tool[aria-pressed="true"] { background: var(--yellow); color: var(--ink); border-color: var(--edge); }
.q-report { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.q-report textarea { width: 100%; min-height: 80px; padding: 8px; font: inherit; font-size: max(1rem, 16px); border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
.q-report .dash-actions { margin: 0; }
.dash-weak { margin: 8px 0 0; font-weight: 700; }
.dash-date { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.dash-date input[type="date"] { min-height: 44px; padding: 6px 10px; font: inherit; font-size: max(1rem, 16px); border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; }
.dash-check { display: inline-flex; gap: 6px; align-items: center; font-size: .9375rem; }

/* ── bank pages: chapter notes and FAQ ── */
.bank-chapters { display: grid; grid-template-columns: minmax(7em, max-content) 1fr; gap: 6px 14px; margin: 14px 0 0; }
.bank-chapters dt { font-weight: 800; }
.bank-chapters dd { margin: 0; color: var(--muted); line-height: 1.7; }
@media (max-width: 560px) { .bank-chapters { grid-template-columns: 1fr; } .bank-chapters dd { margin-bottom: 8px; } }
.bank-faq details { border-top: 1px solid var(--border); padding: 10px 0; }
.bank-faq details:first-of-type { border-top: 0; }
.bank-faq summary { font-weight: 800; cursor: pointer; }
.bank-faq details p { margin: 8px 0 0; line-height: 1.75; }
#sec-prep { margin-top: 22px; }

/* ── question pages (/q/…) ── */
.q-page { max-width: 820px; margin-inline: auto; }
.q-page-meta { margin: 14px 0 6px; font-size: .875rem; font-weight: 700; color: var(--muted); }
.q-page-title { font-size: clamp(1.25rem, 3.2vw, 1.6rem); line-height: 1.55; margin: 0 0 16px; }
.q-page .option-list li { margin: 8px 0; padding: 10px 12px; border: 2px solid var(--border); border-radius: 10px; line-height: 1.6; list-style: none; }
.q-page .option-list { padding-left: 0; }
.q-page .option-list .correct { border-color: var(--success); background: var(--success-bg); }
.q-page-tag { display: inline-block; margin-left: 6px; padding: 0 8px; font-size: .75rem; font-weight: 800; color: var(--ink); background: var(--yellow); border: 1px solid var(--edge); border-radius: 999px; vertical-align: .1em; }
.q-page-explain { margin: 16px 0; padding: 12px 14px; border-left: 3px solid var(--success); background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 0 8px 8px 0; }
.q-page-explain h2 { margin: 0 0 4px; font-size: 1rem; }
.q-page-explain p { margin: 0; line-height: 1.8; }
.q-page-actions { margin: 18px 0; }
.q-page-actions a:first-child { color: var(--on-primary, #fff); background: var(--button-bg, var(--primary)); border-color: var(--edge); }
.q-page-pager { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; font-weight: 700; }
.q-page-pager a { display: flex; flex: 1 1 0; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; color: var(--text); background: var(--surface); border: 2px solid var(--edge); border-radius: 10px; text-decoration: none; text-align: center; }
.q-page-pager span { flex: 1 1 0; }
.q-page-more h2 { font-size: 1rem; margin: 22px 0 8px; }
.q-page-more ul { margin: 0; padding-left: 1.2em; line-height: 1.9; }
.q-page-more li a { display: block; padding: 8px 0; line-height: 1.6; }
.q-page-tag { white-space: nowrap; }
@media (max-width: 760px) { .q-page-explain p { font-size: 1rem; } }
.q-page-link { margin-left: 8px; font-size: .8125rem; font-weight: 700; }
/* ---- Ads (assets/js/ads.js; visitors and free members only) ---- */
.ad-slot { display: grid; gap: 4px; margin: 18px 0; min-height: 0; }
.ad-label { font-size: .75rem; color: var(--muted); }
.ad-label a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ad-preview { display: grid; place-items: center; height: 120px; color: var(--muted); font-weight: 700; background: var(--surface-soft); border: 2px dashed var(--border); border-radius: 12px; }

/* ---- Cheat-sheet free preview (tools/make-cheat-previews.js) ---- */
.cheat-lock { position: relative; margin: 8px 0 24px; padding: 22px 20px; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 4px 4px 0 var(--hard); }
.cheat-lock::before { content: ''; position: absolute; left: 0; right: 0; top: -90px; height: 88px; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.cheat-lock h2 { margin-top: 0; }
.cheat-lock-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.cheat-lock-cta { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; font-weight: 800; color: #1d1a17 !important; text-decoration: none; background: var(--yellow); border: 2px solid var(--edge); border-radius: 10px; box-shadow: 3px 3px 0 var(--hard); }
.cheat-lock-cta:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hard); }
.cheat-lock-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.cheat-lock-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.cheat-lock-list strong { flex-basis: 100%; }
.cheat-lock-list span { padding: 2px 8px; font-size: .875rem; color: var(--muted); background: var(--surface-soft); border-radius: 6px; }
.cheat-lock-list span::before { content: '🔒 '; font-size: .75rem; }

/* ---- Home: 今天的任務 ---- */
.hub-today { padding: 14px 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 4px 4px 0 var(--hard); }
.hub-today h2 { margin: 0 0 8px; font-size: 1.05rem; }
.hub-today ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hub-today a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 12px; color: var(--text); text-decoration: none; background: var(--surface-soft); border-radius: 8px; }
.hub-today a:hover { background: var(--yellow); color: #1d1a17; }
.hub-today strong { font-size: 1rem; }
.hub-today span { flex: 1; color: var(--muted); font-size: .9rem; }
.hub-today a:hover span { color: #1d1a17; }
.hub-today em { font-style: normal; font-weight: 800; }

/* ---- Home: 每日一題 ---- */
.hub-daily { padding: 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 4px 4px 0 var(--hard); }
.hub-daily h2 { margin: 0 0 6px; font-size: 1.05rem; }
.hub-daily h2 span { margin-left: 4px; font-size: .875rem; color: var(--muted); font-weight: 700; }
.hub-daily-q { margin: 0 0 10px; font-weight: 700; line-height: 1.6; }
.hub-daily-opts { display: grid; gap: 8px; }
.hub-daily-opts button { display: flex; gap: 10px; align-items: baseline; width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; text-align: left; color: var(--text); background: var(--surface-soft); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
@media (hover: hover) { .hub-daily-opts button:hover:not(:disabled) { border-color: var(--edge); } }
.hub-daily-opts button:not(:disabled):active { transform: translate(1px, 1px); }
@media (prefers-reduced-motion: reduce) { .hub-daily-opts button:not(:disabled):active { transform: none; } }
.hub-daily-opts button b { font-family: var(--font-mono); }
.hub-daily-opts button:disabled { cursor: default; }
.hub-daily-opts .is-right { border-color: var(--success, #2f7d32); background: color-mix(in srgb, var(--success, #2f7d32) 14%, var(--surface)); }
.hub-daily-opts .is-wrong { border-color: var(--danger, #b8361a); background: color-mix(in srgb, var(--danger, #b8361a) 12%, var(--surface)); text-decoration: line-through; }
.hub-daily-result { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-weight: 800; }
.hub-daily-result:empty { display: none; }
.hub-daily-result a { font-weight: 700; }

/* ---- Text size (theme.js / practice settings) ---- */
html[data-text="l"] { font-size: 112.5%; }
html[data-text="xl"] { font-size: 125%; }
.nav-text-size span[aria-hidden] { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 4px; font-weight: 900; border: 2px solid currentColor; border-radius: 4px; font-size: .8em; }

/* ---- Practice: confirm button within thumb reach on phones ---- */
@media (max-width: 760px) {
  #screen-quiz #q-btn { position: sticky; bottom: 10px; z-index: 5; width: 100%; min-height: 52px; box-shadow: 0 4px 0 var(--hard), 0 6px 18px rgba(0,0,0,.18); }
  #screen-quiz #q-btn:disabled { opacity: 1; color: var(--muted); background: var(--surface-soft); border-color: var(--border); }
  .q-tool { min-height: 44px; }
}

/* ---- Practice: 猜的 flag, read aloud, zoom ---- */
.q-guess { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 6px 10px; font-size: .9rem; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; cursor: pointer; width: fit-content; }
.q-guess input { width: 18px; height: 18px; accent-color: var(--red); }
.q-guess:has(input:checked) { color: var(--text); border-style: solid; border-color: var(--edge); background: var(--surface-soft); }
.q-guess[hidden] { display: none; }
.q-figure img, .read-card .q-figure img { cursor: zoom-in; }
.img-zoom { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 12px; margin: 0; width: auto; height: auto; max-width: none; max-height: none; border: 0; background: rgba(0,0,0,.86); }
.img-zoom:not([open]) { display: none; }
.img-zoom::backdrop { background: rgba(0,0,0,.86); }
.img-zoom img { width: min(94vw, 900px); height: auto; max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); object-fit: contain; background: #fff; border-radius: 8px; touch-action: pinch-zoom; }
.img-zoom button { position: fixed; top: 12px; right: 12px; left: auto; width: auto; min-width: 48px; min-height: 48px; margin: 0; font-size: 1.1rem; }

/* ---- Results / 錯題本: the cheat-sheet nudge ---- */
.cheat-nudge { margin: 18px 0 0; padding: 14px 16px; background: var(--surface-soft); border: 2px dashed var(--edge); border-radius: 12px; }
.cheat-nudge strong { display: block; margin-bottom: 4px; }
.cheat-nudge p { margin: 0 0 10px; color: var(--muted); font-size: .9375rem; }
.cheat-nudge ul { margin: 0 0 10px; padding-left: 1.2em; font-size: .9375rem; }

/* ---- Dashboard: streak and 4-week trend ---- */
.dash-streak { display: inline-flex; align-items: baseline; gap: 6px; margin: 0 0 12px; padding: 6px 12px; font-weight: 800; background: var(--yellow); color: #1d1a17; border: 2px solid var(--edge); border-radius: 999px; }
.dash-trend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; height: 150px; margin: 8px 0 4px; }
.dash-trend-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: .8125rem; color: var(--muted); }
.dash-trend-bar { width: 100%; max-width: 64px; min-height: 4px; background: var(--yellow); border: 2px solid var(--edge); border-radius: 6px 6px 0 0; }
.dash-trend-col strong { color: var(--text); font-size: .875rem; }
.dash-exam-report { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Home: streak line and popular questions ---- */
.hub-streak { margin: 0 0 8px; font-weight: 800; }
.hub-picks { padding: 14px 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 4px 4px 0 var(--hard); }
.hub-picks h2 { margin: 0 0 8px; font-size: 1.05rem; }
.hub-picks ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hub-picks li a { display: block; padding: 8px 10px; color: var(--text); text-decoration: none; background: var(--surface-soft); border-radius: 8px; line-height: 1.5; }
.hub-picks li a:hover { background: var(--yellow); color: #1d1a17; }
.hub-picks li small { display: block; color: var(--muted); font-size: .8125rem; }
.hub-picks-banks { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0 0; font-size: .9rem; }
.plan-trial { margin: -4px 0 10px; font-weight: 800; color: var(--danger); }
.plan-samples { margin: 12px 0 0; font-size: .9rem; color: var(--muted); }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 2000; padding: 10px 14px; color: #1d1a17; background: var(--yellow); border: 2px solid var(--edge); border-radius: 8px; font-weight: 800; }
.skip-link:focus { top: 8px; }
/* Sign-up banner sits above the sticky confirm button on phones. */
@media (max-width: 760px) { body:has(#screen-quiz[style*="block"]) .acct-banner, body:has(#screen-training-setup[style*="block"]) .acct-banner, body:has(.cheat-totop:not([hidden])) .acct-banner, body:has(.reading-join) .acct-banner { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.hub-welcome { padding: 14px 16px; background: var(--surface); border: 2px solid var(--edge); border-left: 8px solid var(--yellow); border-radius: 12px; box-shadow: 4px 4px 0 var(--hard); }
.hub-welcome h2 { margin: 0 0 6px; font-size: 1.05rem; }
.hub-welcome ol { margin: 0 0 10px; padding-left: 1.3em; line-height: 1.7; }
.hub-welcome .btn { width: auto; }
.cheat-totop { position: fixed; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; padding: 10px 14px; font-weight: 800; color: #1d1a17; text-decoration: none; background: var(--yellow); border: 2px solid var(--edge); border-radius: 999px; box-shadow: 3px 3px 0 var(--hard); }
.cheat-totop[hidden] { display: none; }
@media print { .cheat-totop { display: none; } }
.dash-mode[hidden] { display: none; }
.cheat-nudge h3 { margin: 0 0 4px; font-size: 1rem; }
.q-figure img:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.hub-daily-explain { flex-basis: 100%; font-weight: 400; color: var(--muted); line-height: 1.7; }
@media (min-width: 761px) { .cheat-totop { display: none; } /* desktop */ }
body:has(.cheat-quiz:not([hidden])) .cheat-totop { display: none; }
.cq-quick .cheat-tool { min-height: 44px; }
#screen-quiz .quiz-status { flex-wrap: wrap; align-items: center; gap: 6px 12px; }
@media (max-width: 760px) { #screen-quiz.card { padding: 16px; } #screen-quiz .q-meta { font-size: .8125rem; } #screen-quiz #q-btn { margin-top: 16px !important; } #q-handin { min-height: 44px; padding: 8px 14px; } .hub-item-text span { white-space: normal; } }
.reading-join { position: sticky; bottom: 10px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 16px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 4px 4px 0 var(--hard); }
.reading-join .btn { width: auto; }
.dash-extra { grid-column: 1 / -1; }
.dash-extra[open] { display: grid; grid-template-columns: inherit; gap: inherit; }
.dash-extra-summary { grid-column: 1 / -1; min-height: 44px; display: flex; align-items: center; padding: 10px 14px; font-weight: 800; cursor: pointer; background: var(--surface-soft); border: 2px dashed var(--border); border-radius: 12px; }
@media (max-width: 760px) { #training-start { position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 4px 0 var(--hard); } }
.plan-faq h3 { margin: 18px 0 4px; font-size: 1.05rem; }
.plan-faq p { margin: 0; line-height: 1.7; }
@page { margin: 15mm; }
@media print {
  .acct-banner, .reading-join, .bank-stick, .cheat-totop, #res-share, #q-home { display: none !important; }
  .read-card, .read-opt, #res-mistakes-list > * { break-inside: avoid; }
  #res-mistakes-title { break-after: avoid; }
  .read-correct { background: none !important; color: #000 !important; border: 2px solid #000 !important; }
  html.dark-mode { --text: #000; --text-strong: #000; --muted: #333; --surface: #fff; --surface-soft: #fff; --bg: #fff; }
  html.dark-mode body { color: #000; background: #fff; }
}
.hub-status { margin: 0; min-height: 1.4em; font-size: .875rem; font-weight: 700; color: var(--muted); }
@media (max-width: 760px) { .plan-samples a { display: inline-block; min-height: 44px; padding: 10px 0; } }
@keyframes ok-pop { 0% { transform: scale(.98); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
#q-options .opt-label.is-correct { animation: ok-pop .18s ease-out; }
@media (prefers-reduced-motion: reduce) { #q-options .opt-label.is-correct { animation: none; } }
@media (max-width: 760px) { .site-nav .subject-current, .subject-search { min-height: 44px; } }
.cheat-lock-top { margin: 12px 0 0; }
.acct-danger { border-style: dashed; border-color: var(--danger); }
.acct-who strong { overflow-wrap: anywhere; }
@media (max-height: 500px) and (orientation: landscape) { .acct-banner { bottom: 8px; max-height: 45vh; overflow-y: auto; } }
.cheat-table tbody tr:nth-child(even) > td { background: color-mix(in srgb, var(--text) 4%, transparent); }
@media (max-width: 760px) { .cheat-table td, .cheat-table th { padding: 9px 10px; } }
#hub-today-list:empty { display: none; }
.hub-today a { min-height: 48px; }
.opt-badge { display: inline-block; margin-left: auto; padding: 0 .4em; font-size: .8125rem; font-weight: 800; white-space: nowrap; text-decoration: none; border: 1px solid currentColor; border-radius: 6px; align-self: center; }
@media (max-width: 760px) { .site-header-inner { min-height: 0; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; } }
.hub-daily-src { margin: 0 0 4px; font-size: .8125rem; font-weight: 700; color: var(--muted); }
.hub-daily-next { flex-basis: 100%; font-weight: 400; color: var(--muted); }
#q-progress { white-space: nowrap; }
@media (max-width: 760px) {
  #screen-quiz .progress-bar-bg { height: 8px; margin: 8px 0 14px; }
  #screen-quiz .q-meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #screen-quiz .q-text { margin-bottom: 18px; }
}
.option-list .correct { box-shadow: inset 4px 0 0 var(--success); }
.question-item .answer { display: inline-block; margin-top: 8px; padding: 4px 10px; background: var(--success-bg); border-radius: 6px; }
@media (max-width: 760px) {
  .cheat-tools .cheat-tool { flex: 1 1 auto; }
  #screen-home.card { padding: 16px; }
}
@media (max-width: 760px) { .dash-head p { margin-top: 4px; padding: 2px 10px; } }
.dash-trend-bar.is-empty { min-height: 0; border-style: dashed; background: transparent; }
.dash-trend-col small { display: block; font-size: .75rem; color: var(--muted); }
.plan-action .btn { min-height: 44px; }
.plan-tag { font-size: .75rem; }
.cheat-teaser { display: grid; gap: 10px; margin: 8px 0 0; }
.cheat-teaser span { display: block; height: 14px; background: var(--muted); opacity: .3; border-radius: 6px; filter: blur(2px); }
.cheat-teaser span:nth-child(2) { width: 82%; }
.cheat-teaser span:nth-child(3) { width: 64%; }
@media print { .cheat-teaser { display: none !important; } }
.dash-extra-summary { list-style: none; }
.dash-extra-summary::-webkit-details-marker { display: none; }
.dash-extra-summary::after { content: "▾"; margin-left: auto; padding-left: 8px; }
.dash-extra[open] > .dash-extra-summary::after { content: "▴"; }
@media (max-width: 760px) {
  .q-page-actions { display: grid; gap: 8px; }
  .q-page-actions a:first-child { display: flex; align-items: center; justify-content: center; min-height: 48px; font-size: 1.0625rem; }
}
@media (max-width: 480px) { .q-page-pager { flex-direction: column; } }
.site-nav a.nav-account .acct-badge { margin-left: 6px; padding: 0 6px; font-size: .75em; color: var(--yellow); background: var(--ink); border-radius: 6px; }
@media (max-width: 760px) { .q-figure img { max-height: min(320px, 40svh); margin: 0 auto; object-fit: contain; } }
.cheat-group + .cheat-group { margin-top: 28px; }
@media (max-width: 760px) { .cheat-group > h3 { font-size: 1.2rem; padding-top: 10px; border-top: 3px solid var(--edge); } }
.cheat-meta dt { font-size: .8125rem; }
.dash-exam-confirm { margin-top: 10px; padding: 10px 12px; background: var(--surface-soft); border-radius: 10px; }
.dash-exam-confirm[hidden] { display: none; }
@media (max-width: 480px) { #q-options .opt-label { flex-wrap: wrap; } #q-options .opt-label .opt-badge { margin: 6px 0 0 auto; align-self: auto; } }
@media (max-width: 760px) { .hub-hero .lead { font-size: 1rem; } }
#q-home { background: none; border-color: transparent; box-shadow: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.acct-group { display: grid; gap: 10px; }
.acct-group > .acct-group-title { margin: 6px 0 0; font-size: 1.0625rem; }
.q-page .answer { display: inline-block; max-width: 100%; margin: 12px 0 4px; padding: 6px 12px; font-weight: 700; line-height: 1.5; color: var(--success); background: var(--success-bg); border-radius: 10px; }
.q-page-explain { padding: 14px 16px; }
.q-page-explain p { line-height: 1.85; }
.plan-faq details { border-top: 1px solid var(--border); }
.plan-faq details:first-of-type { border-top: 0; }
.plan-faq summary { display: flex; align-items: center; min-height: 44px; padding: 10px 0; cursor: pointer; list-style: none; }
.plan-faq summary::-webkit-details-marker { display: none; }
.plan-faq summary::after { content: "▾"; margin-left: auto; padding-left: 8px; }
.plan-faq details[open] > summary::after { content: "▴"; }
.plan-faq summary h3 { margin: 0; font-size: 1.05rem; }
.plan-faq details > p { margin: 0 0 12px; }
.question-item .option-list li { padding-left: 12px; }
.question-item .answer { color: var(--text-strong); background: var(--surface-soft); border: 2px solid var(--success); }
@media (max-width: 760px) { .question-item { margin: 18px 0; } }
@media (max-width: 760px) { .q-page-more li + li { border-top: 1px solid var(--border); } .q-page-more li a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; } }
@media (max-width: 760px) { .dash-tabs, .pref-group { gap: 8px; } }
