
/* ============ DESIGN TOKENS: "Friendly plus" (Mint, Sun & Sky) ============ */
:root {
  /* Layout idea: friendly consumer utility. Mint hero panel with a sun motif, white ranking cards with soft tinted shadows, pill controls, a floating tab bar on phones. */
  --bg: #FFFFFF;
  --bg-soft: #F7FAF8;
  --ink: #10231A;
  --ink-2: #2E4238;
  --muted: #4A5B52;
  --green: #0E6B47;
  --green-dark: #0A4F35;
  --mint: #EAF4EE;
  --mint-strong: #D2EBDC;
  --mint-shadow: #CFE3D7;
  --sun: #FFCC33;
  --sun-shadow: #E0AE14;
  --sun-tint: #FFF3C9;
  --sun-text: #6B4E00;
  --sky-tint: #E3F2FD;
  --sky-text: #1D5A85;
  --sky-bar: #5BAEE6;
  --sky-shadow: #C6E1F5;
  --line: #DCE7E0;
  --track: #EEF4F0;
  --card-shadow: #EAF1EC;
  --footer: #10231A;
  /* Fonts: Mitr (display) and Anuphan (body). When porting, self-host the font files on the site's own domain; the stacks fall back to system Thai fonts. */
  --font-display: "Mitr", "Anuphan", "Noto Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
  --font-body: "Anuphan", "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Tahoma", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-xl: 28px;
  --radius: 22px;
  --radius-sm: 16px;
  --measure: 70ch;
  color-scheme: light;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--sky-text); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.3; text-wrap: balance; color: var(--ink); margin: 0; }
h1 { font-size: clamp(1.65rem, 4.6vw, 2.85rem); line-height: 1.28; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; max-width: var(--measure); }
ul, ol { margin: 0; padding-left: 1.25rem; max-width: var(--measure); }
li + li { margin-top: 0.35rem; }
.num, td, th { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--green); color: #fff; padding: 0.5rem 1rem; z-index: 30; border-radius: 999px; }
.skip:focus { top: 0.75rem; color: #fff; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ============ HEADER ============ */
.gov-bar { margin: 0; max-width: none; width: 100%; box-sizing: border-box; align-self: stretch; background: var(--sun-tint); color: var(--sun-text); font-size: 0.85rem; font-weight: 600; line-height: 1.45; text-align: center; padding: 0.45rem 1rem; }
.site-header { background: var(--bg); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0.85rem 1rem; display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; line-height: 1.2; }
.brand-tag { font-size: 0.75rem; color: var(--muted); line-height: 1.3; display: none; }
@media (min-width: 640px) and (max-width: 1179px), (min-width: 1440px) { .brand-tag { display: block; } }
#menu-btn { display: none; } /* phones and tablets open the menu from the tab bar's More button */
.header-btn { font: inherit; font-weight: 600; font-size: 0.92rem; color: var(--ink); background: #fff; border: 1.5px solid #C7D8CE; border-radius: 999px; box-shadow: 0 3px 0 var(--card-shadow); padding: 0 1rem; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.header-btn:hover { color: var(--green); border-color: var(--green); }
.site-nav { width: 100%; display: none; }
.site-nav.open { display: block; }
.site-nav ul { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.2rem; max-width: none; }
.site-nav li + li { margin: 0; }
.site-nav .nav-main { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--card-shadow); padding: 0.4rem; }
.site-nav a { display: block; color: var(--ink); text-decoration: none; padding: 0 1rem; line-height: 44px; border-radius: 999px; font-weight: 600; }
.site-nav a:hover { background: var(--bg-soft); color: var(--green); }
.site-nav a[aria-current="page"] { background: var(--mint); color: var(--green); }
.nav-soon { padding: 0.4rem 0.4rem 0; }
.nav-soon-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); padding: 0.4rem 1rem 0.1rem; }
.nav-soon a { font-weight: 500; font-size: 0.92rem; color: var(--muted); line-height: 40px; }
@media (min-width: 1180px) {
  .header-inner { padding: 1rem 2rem; }
  #menu-btn { display: none; }
  .header-inner { flex-wrap: nowrap; }
  .site-nav { display: block; width: auto; order: 2; }
  .site-nav a { padding: 0 0.8rem; white-space: nowrap; }
  .site-nav ul.nav-main { flex-wrap: nowrap; }
  .brand, #lang-btn { flex: none; white-space: nowrap; }
  .site-nav ul.nav-main { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; background: none; border: none; box-shadow: none; padding: 0; }
  .site-nav .nav-soon { display: none; }
  #lang-btn { order: 3; }
}

/* ============ LAYOUT ============ */
main { max-width: 1200px; margin: 0 auto; padding: 0.5rem 1rem 7.5rem; display: grid; gap: 2.75rem; }
@media (min-width: 1180px) { main { padding: 0.75rem 2rem 4rem; gap: 3.25rem; } }
main:focus, #page-h1:focus { outline: none; }
section { display: grid; gap: 1rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; }
.section-head a { font-weight: 700; }
.stack { display: grid; gap: 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* ============ PAGE HEAD (mint hero with sun motif) ============ */
.page-head { position: relative; overflow: hidden; background: var(--mint); border-radius: var(--radius-xl); padding: clamp(1.4rem, 4vw, 3.25rem); display: grid; gap: 2rem; align-items: center; }
.page-head::before { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--sun); opacity: 0.9; }
.page-head::after { content: ""; position: absolute; left: -40px; bottom: -50px; width: 120px; height: 120px; border-radius: 50%; background: var(--sky-tint); }
@media (min-width: 1180px) { .page-head::before { right: -70px; top: -70px; width: 220px; height: 220px; } .page-head::after { width: 140px; height: 140px; } }
.page-head.has-aside { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.head-main { position: relative; z-index: 1; display: grid; gap: 1rem; }
.head-aside { position: relative; z-index: 1; }
.sticker { justify-self: start; transform: rotate(-2deg); background: #fff; color: var(--green); font-weight: 700; font-size: 0.85rem; padding: 0.2rem 0.9rem; border-radius: 999px; box-shadow: 0 3px 0 var(--mint-shadow); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.88rem; color: var(--muted); max-width: none; }
.crumbs li { display: flex; align-items: center; min-height: 44px; }
.crumbs li + li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 0.35rem; color: var(--muted); }
.answer { font-size: 1.12rem; line-height: 1.75; max-width: 36em; color: var(--ink-2); }
.byline { font-size: 0.88rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.btn { display: inline-flex; align-items: center; text-decoration: none; font-weight: 700; padding: 0 1.5rem; min-height: 50px; border-radius: 999px; background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); }
.btn:hover { color: #fff; background: var(--green-dark); }
.btn.secondary { background: #fff; color: var(--green); border: 1.5px solid var(--green); box-shadow: 0 4px 0 var(--mint-shadow); }
.btn.secondary:hover { color: var(--green-dark); }

/* ============ KEY NUMBERS ============ */
.kn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
@media (max-width: 380px) { .kn-grid { grid-template-columns: 1fr; } }
.kn { background: #fff; border-radius: 20px; padding: 1rem 1.1rem; display: grid; gap: 0.2rem; align-content: start; box-shadow: 0 3px 0 var(--mint-shadow); }
.kn-value { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 3.2vw, 1.75rem); color: var(--green); line-height: 1.2; }
.kn-label { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.kn.sky { background: var(--sky-tint); box-shadow: 0 3px 0 var(--sky-shadow); }
.kn.sky .kn-value { color: var(--sky-text); }
.kn.sky .kn-label { color: #2D4A5F; }
.kn.sun { background: var(--sun); box-shadow: 0 3px 0 var(--sun-shadow); }
.kn.sun .kn-value, .kn.sun .kn-label { color: var(--ink); }

/* ============ TIER CHIPS AND RANKING CARDS ============ */
.tier-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; padding: 0 0.75rem; border-radius: 999px; font-weight: 700; font-size: 0.875rem; line-height: 28px; white-space: nowrap; }
.tier-S { background: var(--green); color: #fff; }
.tier-A { background: var(--mint-strong); color: var(--green-dark); }
.tier-B { background: var(--sky-tint); color: var(--sky-text); }
.tier-C { background: var(--sun-tint); color: var(--sun-text); }
.tier-NR { background: transparent; color: var(--muted); border: 1.5px dashed #8A968F; line-height: 25px; }
.tier-RF { background: #FDECEA; color: #A42A1E; border: 1.5px solid #E9A79F; line-height: 25px; }
.rank-card.rf { background: #FFF8F7; border-color: #F1C4BE; }
.pill.fail { background: #FDECEA; color: #A42A1E; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 1rem; }
.rank-card { background: #fff; border: 1.5px solid var(--line); box-shadow: 0 4px 0 var(--card-shadow); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; text-decoration: none; color: var(--ink); }
.rank-card:hover { border-color: var(--green); color: var(--ink); }
.rank-card[hidden] { display: none; }
.rank-card.nr { background: var(--bg-soft); box-shadow: none; }
.rank-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.rank-score { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1; }
.rank-name { font-weight: 700; font-size: 1.15rem; line-height: 1.35; }
.rank-id { display: flex; align-items: center; gap: 0.75rem; }
.co-logo { flex: none; width: var(--s); height: var(--s); border-radius: 12px; background: #fff; border: 1.5px solid var(--line); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; }
.co-logo.dark { background: var(--ink); border-color: var(--ink); }
.co-logo.has-img { width: calc(var(--s) * 1.9); }
.co-logo.has-img img { padding: 3px 5px; }
.co-mono { font-family: var(--font-display); font-weight: 500; color: var(--green); font-size: max(10px, calc(var(--s) * 0.3)); letter-spacing: 0.02em; line-height: 1; }
.name-cell { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 14.5rem; text-decoration: none; }
.name-cell > span:last-child { text-decoration: underline; text-underline-offset: 0.18em; }
.head-logo { justify-self: start; }
.rank-meta { font-size: 0.86rem; color: var(--muted); }
.bar { height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; }
.fill-S { background: var(--green); }
.fill-A { background: #3E9A6E; }
.fill-B { background: var(--sky-bar); }
.fill-C { background: var(--sun); }
.nr-line { font-size: 0.95rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font: inherit; font-weight: 700; font-size: 0.92rem; background: #fff; color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 1rem; min-height: 44px; cursor: pointer; }
.chip:hover { border-color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 3px 0 var(--green-dark); }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.88rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .tier-badge { font-size: 0.78rem; line-height: 22px; min-width: 1.8rem; padding: 0 0.5rem; }
.legend .tier-NR { line-height: 19px; }
.tier-rows { display: grid; gap: 0.6rem; }
.tier-row { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.75rem; align-items: start; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 0.75rem 1rem; }
.tier-row .rule { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; line-height: 1.35; }
.tier-row .names { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; }
.tier-row .names a { font-weight: 700; }
.tier-row .names .score { color: var(--muted); font-size: 0.85rem; margin-left: 0.25rem; }
@media (max-width: 420px) { .tier-row { grid-template-columns: 1fr; gap: 0.35rem; } }

/* ============ QUESTION TILES AND SOON CARDS ============ */
.q-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.q-tile { border-radius: var(--radius); padding: 1.2rem; display: flex; gap: 0.9rem; align-items: flex-start; text-decoration: none; color: var(--ink); background: var(--mint); }
.q-tile:hover { color: var(--ink); box-shadow: 0 4px 0 var(--mint-shadow); }
.q-tile.sky { background: var(--sky-tint); }
.q-tile.sun { background: var(--sun-tint); }
.q-icon { background: #fff; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex: none; color: var(--green); }
.q-tile.sky .q-icon { color: var(--sky-text); }
.q-tile.sun .q-icon { color: var(--sun-text); }
.q-text { display: flex; flex-direction: column; gap: 0.1rem; }
.q-title { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; line-height: 1.35; }
.q-desc { font-size: 0.9rem; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.85rem; }
.card { border: 1.5px dashed #B9CCC1; border-radius: var(--radius); padding: 1rem 1.1rem; display: grid; gap: 0.35rem; align-content: start; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--green); color: var(--ink); }
.card h3 { font-size: 1.05rem; }
.card p { font-size: 0.9rem; color: var(--muted); }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.6rem; border-radius: 999px; justify-self: start; }
.pill.soon { background: var(--sun-tint); color: var(--sun-text); }
.pill.ok { background: var(--mint); color: var(--green); }
.pill.cluster { background: var(--mint); color: var(--green); }
.guide-card { border-style: solid; border-color: #CFE0D6; background: #fff; }
.guide-card:hover { border-color: var(--green); }
.card-grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card-grid.hub { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card-thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; margin-bottom: 0.45rem; background: var(--mint); }
.head-hero { margin: 0; }
@media (max-width: 699px) { .head-aside:has(> .head-hero) { order: -1; } }
.head-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); box-shadow: 0 6px 0 var(--mint-shadow); }
.pill.pending { background: #F1EFE8; color: #5B4F2A; }

/* ============ NOTES, TABLES, FACTS, FAQ, SOURCES ============ */
.note { background: var(--sun-tint); color: var(--ink); padding: 0.9rem 1.2rem; border-radius: 18px; font-size: 0.95rem; max-width: var(--measure); }
.note.green { background: var(--mint); }
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--card-shadow); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
caption { text-align: left; padding: 0.75rem 1rem; color: var(--muted); font-size: 0.88rem; caption-side: top; }
th, td { padding: 0.65rem 0.85rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--mint); color: var(--green-dark); font-size: 0.85rem; border-top: none; white-space: nowrap; }
td.n, th.n { text-align: right; }
tbody tr:hover td { background: var(--bg-soft); }
.sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; box-shadow: 1px 0 0 var(--line); }
thead .sticky-col { background: var(--mint); z-index: 2; }
.sort-btn { font: inherit; font-weight: 700; color: inherit; background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; gap: 0.3rem; align-items: center; min-height: 44px; min-width: 44px; }
.sort-btn .arrow { font-size: 0.72rem; opacity: 0.6; }
.scroll-hint { font-size: 0.82rem; color: var(--muted); }
@media (min-width: 1000px) { .scroll-hint { display: none; } }
tr.total td, tr.total th { font-weight: 700; border-top: 2px solid var(--green); }
dl.facts { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: 0; margin: 0; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; }
dl.facts dt, dl.facts dd { padding: 0.6rem 0.9rem; border-top: 1px solid var(--line); margin: 0; }
dl.facts dt:first-of-type, dl.facts dt:first-of-type + dd { border-top: none; }
dl.facts dt { color: var(--muted); font-size: 0.9rem; background: var(--bg-soft); }
dl.facts dd .meta { display: block; font-size: 0.8rem; color: var(--muted); }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { border-top: none; padding-top: 0.2rem; } }
.news-list { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.6rem; }
.news-list a { display: grid; gap: 0.3rem; padding: 0.8rem 1rem; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; color: inherit; text-decoration: none; }
.news-list a:hover, .news-list a:focus-visible { border-color: var(--green); }
.news-list a { grid-template-columns: 34px 1fr; column-gap: 0.85rem; align-items: start; }
.news-body { display: grid; gap: 0.3rem; min-width: 0; }
.news-logo { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; margin-top: 0.1rem; }
.news-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.news-logo.mono { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 800; font-size: 0.85rem; }
.gov-bar a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.news-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.8rem; color: var(--muted); }
.news-outlet { font-weight: 700; }
.news-title { font-weight: 600; line-height: 1.45; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
section .table-wrap + .table-wrap, dl.facts + .table-wrap { margin-top: 0.9rem; }
.ref { font-size: 0.75rem; vertical-align: super; color: var(--muted); margin-left: 0.15rem; }
details.faq { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 0.15rem 1.1rem; }
details.faq + details.faq { margin-top: 0.6rem; }
details.faq summary { cursor: pointer; font-family: var(--font-display); font-weight: 500; padding: 0.7rem 0; color: var(--ink); }
details.faq[open] { box-shadow: 0 4px 0 var(--card-shadow); }
details.faq p { padding-bottom: 0.9rem; }
.article { display: grid; gap: 2.5rem; }
.article section > p, .article section > ul, .article section > ol { max-width: var(--measure); }
.article li + li { margin-top: 0.35rem; }
.keyfacts { background: var(--mint); border-radius: var(--radius); padding: 1.3rem 1.5rem; }
.keyfacts h2 { font-size: 1.25rem; }
.article table td, .article table th { vertical-align: top; }
ol.sources { font-size: 0.88rem; color: var(--muted); display: grid; gap: 0.3rem; }
ol.sources li + li { margin: 0; }
ol.sources a { word-break: break-word; }
.two-col { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.box { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--card-shadow); padding: 1.1rem; display: grid; gap: 0.5rem; align-content: start; }
.box.dashed { border-style: dashed; box-shadow: none; background: transparent; }
.formula { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 1rem 1rem 1rem 2.25rem; display: grid; gap: 0.4rem; }

/* ============ REFINEMENT PASS: references, contents, ranges, wide tables, tap targets, sheet ============ */
a.ref { color: var(--green); text-decoration: none; font-size: 0.8em; vertical-align: super; line-height: 0; padding: 0 0.1em; border-radius: 4px; }
a.ref:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--sky-bar); outline-offset: 2px; border-radius: 6px; }
ol.sources li:target { background: var(--sun-tint); border-radius: 8px; }
.cell-range { display: block; font-size: 0.8em; color: var(--muted); white-space: nowrap; }
.kf-def { font-size: 0.88rem; color: var(--muted); margin-top: 0.6rem; }
.toc { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; max-width: var(--measure); }
.toc-h { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; margin: 0 0 0.35rem; }
.toc ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--green); }
.back-top { margin-top: 1rem; }
.back-top a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--green); }
.back-top a::before { content: "↑"; margin-right: 0.4rem; }
h1, h2, h3, .toc-h { overflow-wrap: break-word; }
p, li, dd { text-wrap: pretty; }
.header-btn { min-height: 44px; }
details.faq summary { min-height: 44px; display: flex; align-items: center; }
.crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.btn-small { font: inherit; font-weight: 700; font-size: 0.9rem; color: var(--green); background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 1rem; min-height: 44px; cursor: pointer; }
.cols-toggle-row { margin: 0; }
@media (min-width: 640px) { .cols-toggle-row { display: none; } }
@media (max-width: 639px) {
  table.key-cols .col-x { display: none; }
  .scroll-hint.hide-sm { display: none; }
  table.reflow thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.reflow, table.reflow tbody, table.reflow tr, table.reflow td, table.reflow tbody th { display: block; width: auto; }
  table.reflow tr { border-top: 1px solid var(--line); padding: 0.6rem 1rem; }
  table.reflow td, table.reflow tbody th { border: none; padding: 0.15rem 0; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right; }
  table.reflow td::before, table.reflow tbody th::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; font-size: 0.85rem; }
  table.reflow tr > :first-child { font-weight: 700; }
  table.reflow .cell-range { display: inline; margin-left: 0.35rem; }
  .table-wrap:has(> table.reflow) { overflow-x: visible; }
}
.sheet-backdrop { position: fixed; inset: 0; background: rgba(16, 35, 26, 0.45); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 24px 24px 0 0; padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); max-height: 85vh; overflow-y: auto; box-shadow: 0 -8px 28px rgba(16, 35, 26, 0.18); }
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet-close { font: inherit; font-weight: 700; min-height: 44px; min-width: 44px; padding: 0 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list a { display: flex; align-items: center; min-height: 48px; padding: 0 0.75rem; border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 600; }
.sheet-list a[aria-current="page"] { background: var(--mint); color: var(--green); }
.sheet-list.soon a { font-weight: 500; color: var(--muted); }
.sheet-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin: 0.75rem 0.75rem 0.2rem; }
.sheet-lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.75rem; font-weight: 700; color: var(--green); }
body.sheet-open { overflow: hidden; }
@media (min-width: 1180px) { .sheet, .sheet-backdrop { display: none !important; } }

/* ============ FOOTER ============ */
.site-footer { background: var(--footer); color: #D5E3DA; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 1.75rem 1rem 7rem; display: grid; gap: 0.6rem; font-size: 0.9rem; }
@media (min-width: 1180px) { .footer-inner { padding: 1.75rem 2rem 2.5rem; } }
.footer-inner strong { color: #fff; }
.footer-inner a { color: var(--sun); }
.footer-inner a:hover { color: #FFE08A; }

/* ============ PHONE TAB BAR ============ */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 20; background: #fff; border: 1.5px solid var(--line); border-radius: 24px; box-shadow: 0 4px 0 var(--card-shadow), 0 10px 28px rgba(16, 35, 26, 0.14); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 5px; }
.tabbar a, .tabbar button { font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 18px; font-size: 0.75rem; color: var(--muted); text-decoration: none; background: none; border: none; cursor: pointer; }
.tabbar a[aria-current="page"] { background: var(--green); color: #fff; font-weight: 700; }
.tabbar svg { width: 21px; height: 21px; }
@media (min-width: 1180px) { .tabbar { display: none; } }
