/* Easy American Mahjong: site styles. Mobile first.
   Layout: phones get a sticky top bar and a slide-in menu; from 1024px the
   menu becomes a fixed side navigation and content sits to its right. */
:root {
  --page: #f5f9f4;
  --panel: #ffffff;
  --ink: #1c2a22;
  --muted: #55665c;
  --line: #dbe6dc;
  --nav: #ffffff;
  --nav-ink: #1c2a22;
  --nav-muted: #6d7f73;
  --nav-active: #e5f3e1;
  --bar: #2f7d32;
  --felt-a: #6fb25a;
  --felt-b: #4a913d;
  --rail: #c9955a;
  --rail-dark: #a8763f;
  --gold: #f2b631;
  --gold-ink: #2b2100;
  --jade: #2e7d32;
  --focus: #1d4f9c;
  --head: "Source Serif 4", Georgia, serif;
  --body: "Atkinson Hyperlegible", Verdana, system-ui, sans-serif;
  --side: 252px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #111a14; --panel: #19241c; --ink: #e8f0ea; --muted: #a7b9ad; --line: #2c3a30;
    --nav: #19241c; --nav-ink: #e8f0ea; --nav-muted: #9db1a3; --nav-active: #24402a; --bar: #1f5a23;
    --felt-a: #4f8f40; --felt-b: #356e2b; --jade: #7fd08a; --focus: #8fb4ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #111a14; --panel: #19241c; --ink: #e8f0ea; --muted: #a7b9ad; --line: #2c3a30;
  --nav: #19241c; --nav-ink: #e8f0ea; --nav-muted: #9db1a3; --nav-active: #24402a; --bar: #1f5a23;
  --felt-a: #4f8f40; --felt-b: #356e2b; --jade: #7fd08a; --focus: #8fb4ff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--body); font-size: 20px; line-height: 1.6; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; text-wrap: balance; margin: 0; }
a { color: var(--jade); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 12px; }
.small { font-size: 17px; }

/* ---------- tiles ---------- */
.tile { display: inline-block; flex: none; line-height: 0; width: 56px; }
.tile svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- top bar + navigation ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bar); color: #fff;
  padding-block: calc(8px + env(safe-area-inset-top, 0px)) 8px;
  padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--head); font-size: clamp(17px, 4.6vw, 20px); white-space: nowrap; line-height: 1.1; }
.brand b { color: #ffd76a; font-weight: 700; }
.brand-side { color: var(--ink) !important; }
.brand-side b { color: var(--jade); }
.logo-tile { width: 26px; display: inline-block; line-height: 0; }
.logo-tile svg { width: 100%; height: auto; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.ico { width: 26px; height: 26px; flex: none; }

.sidenav { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(82vw, var(--side)); overflow-y: auto;
  background: var(--nav); color: var(--nav-ink); transform: translateX(-102%); transition: transform .22s ease;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.sidenav { border-right: 1px solid var(--line); }
.sidenav.open { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.35); }
body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
.brand-side { display: none; }
.sidenav ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidenav a, .sidenav .soon { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: 10px;
  color: var(--nav-ink); text-decoration: none; font-weight: 700; }
.sidenav a:hover { background: var(--nav-active); }
.sidenav a[aria-current="page"] { background: var(--nav-active); color: var(--jade); }
.sidenav .soon { color: var(--nav-muted); font-weight: 400; }
.sidenav .soon small { margin-left: auto; font-size: 14px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.nav-h { margin: 14px 12px 4px; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-muted); }
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

@media (min-width: 1024px) {
  .topbar { display: none; }
  .sidenav { transform: none; width: var(--side); box-shadow: none; }
  .brand-side { display: inline-flex; margin: 4px 8px 18px; }
  .page { margin-left: var(--side); }
  body.nav-open::after { display: none; }
}

.page { min-width: 0; }
main { display: flex; flex-direction: column; gap: 20px;
  padding-block: 16px 28px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
@media (min-width: 1024px) { main { padding: 24px 28px 36px; gap: 28px; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 12px 22px; border-radius: 14px;
  font: inherit; font-weight: 700; font-size: 19px; text-decoration: none; cursor: pointer; border: 2px solid var(--line); background: var(--panel); color: var(--ink); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); box-shadow: 0 3px 0 #b88a1d; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #b88a1d; }
.btn-ghost { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); color: #fff; cursor: default; flex-direction: column; gap: 0; line-height: 1.15; }
.btn-ghost small { font-weight: 400; font-size: 15px; opacity: .85; }
.btn-small { min-height: 46px; padding: 8px 14px; font-size: 16px; border-radius: 12px; }

/* ---------- home: hero ---------- */
.hero { display: grid; gap: 18px; border-radius: 22px; padding: 20px 16px; color: #fff;
  background: var(--felt-tex), radial-gradient(120% 90% at 30% 20%, var(--felt-a), var(--felt-b)); }
:root { --felt-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hero h1 { font-size: clamp(30px, 7vw, 48px); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.lead { font-size: 19px; color: #f1fbee; margin: 10px 0 0; max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.cta .btn { flex: 1 1 220px; }
.fine { color: #e4f5df; font-size: 17px; margin: 12px 0 0; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; padding: 34px; gap: 28px; }
}

.felt { position: relative; border-radius: 18px; padding: 14px; background: var(--felt-tex), radial-gradient(circle at 50% 40%, #82c26b, #5a9f48);
  box-shadow: inset 0 0 0 7px var(--rail), inset 0 0 0 9px var(--rail-dark), 0 12px 30px rgba(0,0,0,.25); display: grid; gap: 12px; }
.felt-backs { display: flex; justify-content: center; gap: 2px; }
.felt-backs .tile { width: 22px; }
.felt-center { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.felt-center .tile { width: 38px; }
.tilt-l { transform: rotate(-8deg); } .tilt-r { transform: rotate(7deg); }
.felt-rack { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; background: linear-gradient(#d9a868, var(--rail-dark)); border-radius: 8px; padding: 6px 6px 9px; }
.felt-rack .tile { width: 100%; }
.felt-caption { margin: 0; text-align: center; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); font-weight: 700; font-size: 17px; }
@media (min-width: 560px) { .felt-rack { grid-template-columns: repeat(14, minmax(0, 1fr)); } .felt-center .tile { width: 46px; } }

/* ---------- home: cards ---------- */
.cards { display: grid; gap: 14px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.card h2 { font-size: 22px; }
.card p { margin: 0; color: var(--muted); }
.card-link { margin-top: auto; font-weight: 700; text-decoration: none; padding-top: 6px; }

/* ---------- long-form content ---------- */
.prose { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.prose > * { max-width: 70ch; margin: 0; }
.prose h2 { font-size: clamp(24px, 5vw, 30px); }
.prose h3 { font-size: 22px; margin-top: 10px; color: var(--jade); }
.prose p { color: var(--ink); }
.ticks, .steps { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.ticks li::marker { content: "✓  "; color: var(--jade); font-weight: 700; }
@media (min-width: 1024px) { .prose { padding: 30px 34px; } }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; min-height: 48px; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

.footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; flex-direction: column; gap: 4px;
  padding-block: 18px calc(24px + env(safe-area-inset-bottom, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
.footer p { margin: 0; max-width: 75ch; }
@media (min-width: 1024px) { .footer { padding: 22px 28px 30px; } }
.brand > span { white-space: nowrap; }

/* ---------- learn pages: boxes in the table's felt green ---------- */
.crumbs { font-size: 17px; color: var(--muted); }
.crumbs a { color: var(--jade); }
.art-head { display: flex; flex-direction: column; gap: 8px; }
.art-head h1 { font-size: clamp(30px, 6.5vw, 44px); }
.lead-dark { margin: 0; font-size: 22px; color: var(--muted); max-width: 60ch; }
.byline { margin: 0; font-size: 16px; color: var(--muted); }

.answer { position: relative; border-radius: 18px; padding: 18px 18px 18px 22px; color: #fff;
  background: var(--felt-tex), radial-gradient(120% 120% at 20% 0%, var(--felt-a), var(--felt-b));
  box-shadow: inset 0 0 0 5px var(--rail), inset 0 0 0 7px var(--rail-dark); }
.answer p { margin: 0 0 8px; max-width: 68ch; font-size: 21px; }
.answer p:last-child { margin-bottom: 0; }
.answer-label { display: inline-block; background: var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 15px !important;
  letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; }
.answer strong { color: #ffe08a; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fact { background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--felt-b); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column-reverse; gap: 2px; }
.fact dd { margin: 0; font-family: var(--head); font-size: 34px; font-weight: 700; color: var(--jade); line-height: 1.1; }
.fact dt { font-size: 17px; color: var(--muted); }

.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.toc-h { margin: 0 0 6px; font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 22px; columns: 1; }
@media (min-width: 760px) { .toc ol { columns: 2; column-gap: 32px; } }
.toc li { padding: 3px 0; break-inside: avoid; }
.toc a { text-decoration: none; font-weight: 700; }

.learn { display: flex; flex-direction: column; gap: 18px; }
.lsec { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; }
@media (min-width: 1024px) { .lsec { padding: 26px 30px; } }
.lsec > * { margin: 0; max-width: 72ch; }
.lsec h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(24px, 5vw, 30px); }
.lsec h3 { font-size: 21px; color: var(--jade); margin-top: 6px; }
.num { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font: 700 19px/1 var(--body); color: #fff;
  background: linear-gradient(#3aa684, #1c6a52); box-shadow: 0 3px 0 #e4dbc1; }
.key { font-weight: 700; font-size: 21px; border-left: 5px solid var(--gold); padding: 4px 0 4px 12px; }
.lsec ul, .lsec ol:not(.step-list) { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

.step-list { list-style: none; counter-reset: s; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step-list li { counter-increment: s; position: relative; padding: 12px 14px 12px 58px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--felt-a) 7%, var(--panel)); display: flex; flex-direction: column; gap: 2px; }
.step-list li::before { content: counter(s); position: absolute; left: 12px; top: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.step-list span { color: var(--muted); }

.note-box { border-radius: 14px; padding: 12px 16px; border: 1px solid; display: flex; flex-direction: column; gap: 6px; }
.note-box > * { margin: 0; }
.note-title { font-weight: 700; }
.note-box.tip { background: #fff7dd; border-color: #f0d68a; color: #4f3b00; }
.note-box.rule { background: #e9f5e4; border-color: #b9dcae; color: #1d3d1f; }
.note-box.warn { background: #fdecea; border-color: #f2b8b1; color: #5c1a12; }
.note-box.data { background: #eaf2fb; border-color: #b7cfee; color: #12305c; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; max-width: 100% !important; }
.tbl { border-collapse: collapse; width: 100%; font-size: 19px; }
.tbl caption { text-align: left; padding: 10px 14px 0; font-weight: 700; color: var(--muted); }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl thead th { background: var(--felt-b); color: #fff; font-size: 17px; letter-spacing: .02em; }
.tbl tbody tr:nth-child(even) { background: color-mix(in srgb, var(--felt-a) 6%, var(--panel)); }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: none; }
.tbl .tile { width: 40px; vertical-align: middle; }
.yes { color: var(--jade); font-weight: 700; white-space: nowrap; } .no { color: #c0392b; font-weight: 700; white-space: nowrap; }

.tile-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tile-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; border-radius: 12px; width: fit-content; max-width: 100%;
  background: var(--felt-tex), radial-gradient(circle at 50% 40%, var(--felt-a), var(--felt-b)); }
.tile-row .tile { width: clamp(52px, 15vw, 76px); }
.tile-fig figcaption { font-size: 19px; color: var(--ink); font-weight: 700; }
.tile-fig.bad .tile-row { background: #c9564b; }

.play-cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; border-radius: 18px; padding: 18px; color: #fff;
  background: var(--felt-tex), radial-gradient(120% 120% at 80% 0%, var(--felt-a), var(--felt-b)); }
.play-cta p { margin: 0; }
.play-cta-h { font-family: var(--head); font-weight: 700; font-size: 24px; }
@media (min-width: 760px) { .play-cta { flex-direction: row; align-items: center; justify-content: space-between; } }

.related h2 { font-size: 26px; margin-bottom: 10px; }
.related-grid { display: grid; gap: 10px; }
@media (min-width: 760px) { .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rel { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--felt-b); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.rel strong { color: var(--jade); font-size: 21px; }
.rel span { color: var(--muted); font-size: 18px; }
.rel:hover { border-color: var(--felt-a); }
.plain .lsec h2 { font-size: 24px; }

/* practice card */
.pc-sec { display: flex; flex-direction: column; gap: 8px; }
.pc-hand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pc-hand .pat { font-family: "Courier New", monospace; font-weight: 700; font-size: clamp(18px, 4.4vw, 23px); letter-spacing: 1px; overflow-wrap: anywhere; }
.pc-hand .val { font-weight: 700; white-space: nowrap; text-align: right; }
.pc-hand p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 18px; }
.pc-hand .pid { font-size: 15px; color: var(--muted); font-weight: 700; margin-right: 6px; }
.sa { color: #1c7a4c; } .sb { color: #b8261d; } .sc { color: #1d4f9c; } .hon { color: var(--ink); }
.tag { display: inline-block; border-radius: 6px; padding: 0 6px; font-size: 15px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.tag.c { background: #fdecea; color: #a12a1d; } .tag.x { background: #e9f5e4; color: #1d5a22; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 6px; }
.footer-nav a { color: var(--jade); font-weight: 700; text-decoration: none; }
@media print { .sidenav, .topbar, .footer, .crumbs, .toc, .related, .play-cta, .skip { display: none !important; } .page { margin: 0 !important; } .lsec { break-inside: avoid; border: none; } }
.answer-list { margin: 0 0 8px; padding-left: 24px; display: flex; flex-direction: column; gap: 4px; font-size: 20px; max-width: 68ch; }
.answer a { color: #ffe08a; }
/* phones: each table row becomes a small card */
@media (max-width: 559px) {
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: none; }
  .tbl th, .tbl td { border: none; padding: 2px 0; }
  .tbl tbody th { font-size: 20px; color: var(--jade); }
  .tbl td { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 10px; }
  .tbl td::before { content: attr(data-label); font-size: 16px; font-weight: 700; color: var(--muted); padding-top: 2px; }
  .tbl td.empty { display: none; }
}
.tbl .cell { display: block; } .tbl .cell .tile { width: 40px; margin: 0 3px 3px 0; }

/* ===== photos under article titles (AI pictures made for this site) ===== */
.photo { margin: 0; border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 667; object-fit: cover; }
.photo figcaption { padding: 10px 16px; font-size: 18px; color: var(--ink); background: var(--panel); }

/* ===== glossary ===== */
.gloss { margin: 0; display: grid; gap: 8px; }
.gloss > div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; scroll-margin-top: 80px; }
.gloss > div:target { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent); }
.gloss dt { font-weight: 700; font-size: 22px; }
.gloss dd { margin: 2px 0 0; }
@media (min-width: 760px) { .gloss { grid-template-columns: 1fr 1fr; } }

/* ===== learn hub cards ===== */
.guide-grid { margin-top: 4px; }

/* ===== payment calculator ===== */
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.calc fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.calc legend { font-weight: 700; padding: 0 6px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 19px; }
.calc input:not([type]), .calc select { font: inherit; font-size: 20px; min-height: 54px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--page); color: var(--ink); }
.calc-names label { flex: 1 1 130px; }
.calc-names input { width: 100%; }
.calc-row { display: flex; flex-wrap: wrap; gap: 12px; }
.calc-row label { flex: 1 1 200px; }
.calc .radio, .calc .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; min-height: 44px; }
.calc .radio input, .calc .check input { width: 28px; height: 28px; accent-color: var(--felt-b); }
.calc-out { border-top: 2px solid var(--line); padding-top: 12px; }
.calc-out ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.calc-out li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 19px; }
.calc-out li.win { background: color-mix(in srgb, var(--felt-a) 12%, var(--panel)); }
.calc-out li small { grid-column: 1 / -1; color: var(--muted); font-size: 17px; }
.calc-out .up { color: var(--jade); font-weight: 700; } .calc-out .down { color: #c0392b; font-weight: 700; }
.calc-h { margin: 0 0 6px; font-weight: 700; font-size: 20px; }
.calc-warn, .calc-note { margin: 8px 0 0; background: #fff4d6; color: #5a4300; padding: 8px 10px; border-radius: 10px; }

/* ===== big print (13/11): readers are older; nothing important under 16px ===== */
.tile-fig { gap: 8px; }
.tile-fig.bad figcaption { color: #b3261e; }
.tile-fig.bad .tile-row { box-shadow: 0 0 0 3px #b3261e; }
.photo.inline { margin: 4px 0; }
.tile-fig.bad figcaption::before { content: "✗ "; font-size: 1.15em; }
/* phones: table label above its value, so tiles get the full width */
@media (max-width: 559px) {
  .tbl td { grid-template-columns: 1fr; gap: 2px; padding: 4px 0; }
  .tbl .cell .tile, .tbl .tile { width: 52px; }
}
/* phones: every table row becomes its own card with a green title bar (13/11: user found stacked rows too loose) */
@media (max-width: 559px) {
  .tbl-wrap { border: none; border-radius: 0; overflow: visible; }
  .tbl caption { padding: 0 0 10px; font-size: 18px; color: var(--ink); }
  .tbl tbody { display: flex; flex-direction: column; gap: 14px; }
  .tbl tr, .tbl tbody tr:nth-child(even) { border: 2px solid var(--line); border-radius: 16px; padding: 0 0 12px; background: var(--panel);
    box-shadow: 0 2px 10px rgba(0,0,0,.07); overflow: hidden; }
  .tbl tbody tr:last-child { border-bottom: 2px solid var(--line); }
  .tbl tbody th { background: var(--felt-b); color: #fff; padding: 10px 14px; font-size: 21px; line-height: 1.3; }
  .tbl tbody th:empty { display: none; }
  .tbl td { padding: 10px 14px 0; }
  .tbl td::before { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--jade); padding-top: 0; }
  .tbl .cell { font-size: 19px; }
  .tbl .cell:has(.tile) { display: flex; flex-wrap: wrap; gap: 6px; }
  .tbl .cell .tile { width: 54px; margin: 0; }
}
@media (max-width: 559px) {
  .lsec { padding: 18px 14px; }
  .tbl .cell:has(.tile) { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .tbl .cell .tile { width: 100%; }
}
@media (max-width: 559px) {
  .tbl caption { display: block; width: 100%; font-size: 20px; font-weight: 700; color: var(--jade); }
  .tbl td + td { border-top: 1px dashed var(--line); margin-top: 8px; }
}
