/* ปีไทย / ThaiYear — warm, friendly, answer-first. Tokens first, then components. */

@font-face { font-family: "Mitr"; font-weight: 600; font-display: swap; src: url(/fonts/mitr-600-thai.woff2) format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Mitr"; font-weight: 600; font-display: swap; src: url(/fonts/mitr-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Mitr"; font-weight: 500; font-display: swap; src: url(/fonts/mitr-500-thai.woff2) format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Mitr"; font-weight: 500; font-display: swap; src: url(/fonts/mitr-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }

:root {
  color-scheme: light;
  --bg: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f3eee5;
  --line: #e8e2d6;
  --line-strong: #cfc6b6;
  --text: #1f1b16;
  --muted: #6b6257;
  --brand: #f2a93b;
  --brand-ink: #a85f00;
  --brand-soft: #fff1d6;
  --accent: #0f766e;
  --accent-ink: #0b5c56;
  --accent-soft: #dcf3ef;
  --on-accent: #ffffff;
  --hl: #fff1d6;
  --ok: #1b7f4c; --ok-soft: #e3f6e9;
  --warn: #b06a00; --warn-soft: #fff1d6;
  --danger: #b4302b; --danger-soft: #fde9e7;
  --chip: #f3eee5; --chip-text: #3b342c;
  --tint-rose: #ffe4ec; --tint-sky: #e3f0ff; --tint-lilac: #ece6ff; --tint-mint: #e2f6e6; --tint-mari: #fff1d6; --tint-teal: #dcf3ef;
  --ink-rose: #b8325f; --ink-sky: #2563a8; --ink-lilac: #6a4bb5; --ink-mint: #2f7d45; --ink-mari: #a85f00; --ink-teal: #0f766e;
  --shadow-1: 0 1px 2px rgba(60, 40, 10, .06), 0 2px 6px rgba(60, 40, 10, .06);
  --shadow-2: 0 8px 24px rgba(60, 40, 10, .14);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, .18);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Leelawadee UI", Thonburi, Tahoma, sans-serif;
  --font-display: "Mitr", "Prompt", var(--font);
  --fs-note: 13px; --fs-h3: 18px; --fs-h2: 20px; --fs-h1: 24px; --fs-answer: 23px; --fs-input-xl: 28px;
  --lh-body: 1.7; --lh-tight: 1.4; --lh-answer: 1.35;
}
@media (min-width: 600px) {
  :root { --fs-h1: 28px; --fs-h2: 22px; --fs-answer: 28px; --fs-input-xl: 30px; }
}
/* Dark tokens: system preference unless the visitor picked light, or an explicit dark choice */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark { color: var(--bg); }
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16130f; --surface: #1f1b16; --surface-2: #28231c;
    --line: #322c24; --line-strong: #4a4136;
    --text: #f1ece3; --muted: #a79d8f;
    --brand: #f4b24f; --brand-ink: #f4b24f; --brand-soft: #3a2d10;
    --accent: #5fd3c6; --accent-ink: #8fe3d9; --accent-soft: #10302c; --on-accent: #0f1a18;
    --hl: #3a2d10;
    --ok: #5ccf8a; --ok-soft: #13301f; --warn: #f3b24f; --warn-soft: #3a2d10; --danger: #ff8a80; --danger-soft: #3b1a17;
    --chip: #2b251d; --chip-text: #e4dccf;
    --tint-rose: #3a1b26; --tint-sky: #15263a; --tint-lilac: #241d3a; --tint-mint: #13301a; --tint-mari: #3a2d10; --tint-teal: #0f2b28;
    --ink-rose: #ff9db8; --ink-sky: #8cbcff; --ink-lilac: #c3b2ff; --ink-mint: #8fdba3; --ink-mari: #f4b24f; --ink-teal: #5fd3c6;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16130f; --surface: #1f1b16; --surface-2: #28231c;
  --line: #322c24; --line-strong: #4a4136;
  --text: #f1ece3; --muted: #a79d8f;
  --brand: #f4b24f; --brand-ink: #f4b24f; --brand-soft: #3a2d10;
  --accent: #5fd3c6; --accent-ink: #8fe3d9; --accent-soft: #10302c; --on-accent: #0f1a18;
  --hl: #3a2d10;
  --ok: #5ccf8a; --ok-soft: #13301f; --warn: #f3b24f; --warn-soft: #3a2d10; --danger: #ff8a80; --danger-soft: #3b1a17;
  --chip: #2b251d; --chip-text: #e4dccf;
  --tint-rose: #3a1b26; --tint-sky: #15263a; --tint-lilac: #241d3a; --tint-mint: #13301a; --tint-mari: #3a2d10; --tint-teal: #0f2b28;
    --ink-rose: #ff9db8; --ink-sky: #8cbcff; --ink-lilac: #c3b2ff; --ink-mint: #8fdba3; --ink-mari: #f4b24f; --ink-teal: #5fd3c6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/var(--lh-body) var(--font); line-break: auto; overflow-wrap: break-word; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[lang="en"] :lang(th) { font-size: 1.06em; }
/* Mitr covers Thai and Latin only; other scripts keep one system face so digits match the text. */
html:not([lang="th"]):not([lang="en"]) { --font-display: var(--font); }

/* ---------- header ---------- */
.site-header { background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: var(--s3); }
.logo { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -.01em; line-height: 1.4; }
.logo::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: 4px; border-radius: 50%; background: var(--brand); vertical-align: .35em; }
.logo:hover { color: var(--text); }
.controls { display: flex; gap: var(--s2); align-items: center; }
.theme-btn, .langs summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; min-width: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--text); font: 500 13px/1.4 var(--font); cursor: pointer; }
.theme-btn { padding: 0; justify-content: center; }
.langs { position: relative; }
.langs summary { list-style: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs li a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 15px; }
.langs li a small { color: var(--muted); font-size: 11px; }
.langs li a:hover, .langs li a[aria-current] { background: var(--accent-soft); }
.langs li a[aria-current] { font-weight: 700; }
@media (max-width: 599px) {
  .langs[open]::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 9; }
}

/* ---------- tool strip ---------- */
.strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.strip .wrap { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.strip .wrap::-webkit-scrollbar { display: none; }
.strip a { flex: 0 0 auto; scroll-snap-align: start; min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); background: var(--chip); color: var(--chip-text); font: 500 14px/1.4 var(--font-display); text-decoration: none; white-space: nowrap; }
.strip a[aria-current] { background: var(--accent); color: var(--on-accent); }
@media (min-width: 960px) { .strip .wrap { flex-wrap: wrap; mask-image: none; overflow: visible; } }

/* ---------- headings & text ---------- */
h1, h2, h3, .answer-big, .num-xl, .fact span, .tool-title, .seg span, .card strong, .cd-days { font-family: var(--font-display); font-weight: 600; }
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); margin: var(--s4) 0 var(--s2); letter-spacing: -.01em; }
h1 .sub { display: block; font: 400 15px/1.5 var(--font); color: var(--muted); margin-top: 4px; letter-spacing: 0; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); margin: var(--s6) 0 var(--s3); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); margin: var(--s5) 0 var(--s2); }
.crumbs { font-size: 12px; margin: var(--s3) 0 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); font-size: 15px; margin: var(--s3) 0; }
.note, .answer-note { margin: var(--s2) 0 0; font-size: var(--fs-note); color: var(--muted); line-height: 1.6; }

/* emoji icon tiles */
.ico { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--tint, var(--surface-2)); color: var(--ink, var(--muted)); }
.ico-h1 { width: 38px; height: 38px; font-size: 21px; vertical-align: -9px; margin-right: 10px; }
.mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--brand); animation: pop .18s ease-out; }
.answer--yes .mark { background: var(--ok); } .answer--soon .mark { background: var(--warn); } .answer--no .mark { background: var(--danger); }
:root[data-theme="dark"] .mark { color: var(--bg); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- tool card ---------- */
.tool { background: var(--surface); border-radius: var(--r-lg); padding: var(--s4); margin: var(--s3) 0; box-shadow: var(--shadow-1); position: relative; }
.tool-title { margin: 0 0 var(--s3); font-size: 17px; line-height: var(--lh-tight); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-end; }
.field { display: grid; gap: 4px; flex: 1 1 0; min-width: 0; font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.5; }
.field.grow { flex: 2 1 0; }
.field.wide { flex: 1 1 100%; }
.date3 { display: grid; grid-template-columns: minmax(62px, .75fr) 1fr 2fr; gap: var(--s2); flex: 1 1 100%; }
.date3 select { padding-inline: 10px 26px; background-position: right 6px center; }
[dir="rtl"] select { background-position: left 10px center; }
[dir="rtl"] .date3 select { background-position: left 6px center; }
select, input, button { font: 600 16px/1.4 var(--font); }
select, input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8073' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.num-xl { font-size: var(--fs-input-xl); font-weight: 600; min-height: 58px; letter-spacing: .02em; }
.swap { align-self: center; color: var(--muted); font-size: 22px; padding: 18px 2px 0; flex: 0 0 auto; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 3px; border: 0; background: var(--chip); border-radius: var(--r-pill); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-size: 15px; color: var(--chip-text); line-height: 1.4; }
.seg input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.tool-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.tool-head .label { font-size: 14px; font-weight: 500; color: var(--muted); }
.more { margin-top: var(--s2); font-size: 15px; }
.more summary { color: var(--accent); cursor: pointer; padding: 8px 0; list-style: none; font-weight: 600; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+ "; }
.more[open] summary::before { content: "− "; }
.more .row { margin-top: var(--s2); }
button { cursor: pointer; }
.btn { padding: 10px 20px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); }
/* Results update as you type; the button stays only for Enter and screen readers. */
.btn-ghost { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); }
.result:empty { display: none; }
.arrow { color: var(--muted); align-self: center; padding: 18px 2px 0; }

/* ---------- answer card ---------- */
.answer { margin-top: var(--s3); padding-block: 14px; padding-inline: 18px 16px; border-radius: var(--r-md); background: var(--brand-soft); border-inline-start: 4px solid var(--brand); transition: background-color .25s, border-color .25s; }
.answer--yes { background: var(--ok-soft); border-color: var(--ok); }
.answer--no { background: var(--danger-soft); border-color: var(--danger); }
.answer--soon { background: var(--warn-soft); border-color: var(--warn); }
.answer--plain { background: var(--surface-2); border-color: var(--line-strong); }
.answer-big { margin: 0; display: flex; align-items: center; gap: 12px; text-wrap: balance; font-size: var(--fs-answer); line-height: var(--lh-answer); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

.answer-sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(7.5em, 1fr); column-gap: var(--s3); row-gap: 6px; margin: var(--s3) 0 0; }
.kv div { display: contents; }
.kv dt { color: var(--muted); font-size: 14px; line-height: 1.6; }
.kv dd { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.kv dd .t { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.kv dd .copy { flex: 0 0 auto; margin-inline-start: auto; }
.kv dd:has(.copy) { flex-wrap: nowrap; align-items: flex-start; }
.copy { min-height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 600; }
.answer .table-wrap { background-color: var(--surface); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: 0; }
.dot.yes { background: var(--ok); } .dot.soon { background: var(--warn); } .dot.no { background: var(--danger); }
.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 50%; vertical-align: -0.08em; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: var(--s3) 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; vertical-align: top; line-height: 1.5; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
td.text { white-space: normal; min-width: 11em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
tr.hl td { background: var(--hl) !important; font-weight: 700; }
.table-more { margin: -4px 0 var(--s3); }
.table-more > summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--chip); color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.table-more > summary::-webkit-details-marker { display: none; }

/* ---------- tiles, cards, chips ---------- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin: var(--s3) 0; }
.fact { background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--shadow-1); min-width: 0; }
.fact b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.5; }
.fact span { display: block; font-size: 18px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin: var(--s3) 0; }
.card { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); text-decoration: none; min-width: 0; transition: box-shadow .15s, transform .15s; }
.card > div { min-width: 0; }
.card strong { display: block; font-size: 15px; line-height: 1.4; }
.card span.d { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.card:hover { color: var(--text); }
@media (hover: hover) { .card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); } }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.year-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: var(--s3) 0; list-style: none; }
.year-links a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.year-more > summary { color: var(--accent); cursor: pointer; font-weight: 600; padding: 6px 0; }
.jump { display: flex; gap: var(--s2); max-width: 340px; }
.jump input { flex: 1; }
.countdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.countdown { display: block; background: var(--surface); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow-1); }
.cd-label { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; }
.cd-days { display: block; font-size: 18px; line-height: 1.4; }

/* ---------- faq ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; line-height: 1.5; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "⌄"; color: var(--muted); transition: transform .15s; flex: 0 0 auto; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq p { margin: 8px 0 0; font-size: 15px; }

.pager { display: flex; justify-content: space-between; gap: var(--s2); margin: var(--s5) 0; }
.pager a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; font-weight: 600; }

/* ads: reserve space only when ads are configured */
html[data-ads] .ad { min-height: 100px; margin: var(--s4) 0; }

/* ---------- footer ---------- */
.site-footer { margin-top: var(--s7); border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.site-footer .wrap { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 2px 14px; padding-top: var(--s3); }
.site-footer a { color: var(--muted); text-decoration: none; padding: 8px 0; display: inline-block; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .langs { display: inline-block; margin-top: var(--s2); }
.site-footer p { margin: var(--s3) 0 0; }

main { min-width: 0; }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } .answer, .card { transition: none; } }

/* lists inside answers: quiet rows, no bullets */
.answer-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 6px; }
.answer-list li { position: relative; padding-inline-start: 16px; line-height: 1.55; }
.answer-list li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.answer p { margin: var(--s3) 0 0; }
.answer .answer-big + * { margin-top: var(--s3); }
.kv-card { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-1); margin: var(--s3) 0; }
.today { color: var(--muted); font-size: 15px; margin: 0 0 var(--s2); }
.today strong { color: var(--text); }

/* Wide screens: keep forms and prose at a readable width */
@media (min-width: 760px) {
  .tool { max-width: 680px; }
  main > p, .lead, .faq, main > ul { max-width: 72ch; }
  .num-xl { max-width: 16ch; }
  .row .field:has(.num-xl) { flex: 0 1 260px; }
}

/* Burmese: script-specific faces and extra line height for stacked marks */
html[lang="my"] { --font: system-ui, -apple-system, "Noto Sans Myanmar", "Myanmar Text", "Myanmar Sangam MN", Padauk, sans-serif; --lh-body: 1.9; --lh-tight: 1.6; --lh-answer: 1.6; }

/* Arabic: system Arabic faces; arrows and the swap mark flip with the text direction */
html[lang="ar"] { --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif; }
[dir="rtl"] .swap, [dir="rtl"] .arrow { transform: scaleX(-1); }

/* "Available in your language" bar */
.lang-suggest { background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.lang-suggest .wrap { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.lang-suggest span { flex: 1 1 auto; line-height: 1.5; }
.lang-suggest a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; }
.lang-suggest button { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.fwd::after { content: "→"; }
[dir="rtl"] .fwd::after { content: "←"; }

/* Flags in the language menu */
.flag { width: 20px; height: 15px; flex: 0 0 auto; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.langs li a .lname { flex: 1 1 auto; }
.langs summary .flag { width: 22px; height: 16px; }

/* "Who is 18 this year" rows: dot, birth years, verdict on the right */
.cohorts { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 4px; }
.cohorts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.cohorts li:last-child { border-bottom: 0; }
.cohorts .who { flex: 1 1 12em; color: var(--muted); }
.cohorts b { flex: 0 1 auto; margin-inline-start: auto; text-align: end; }

/* "How it's counted" under the 18+ check */
.how { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px dashed var(--line-strong); font-size: 14px; color: var(--muted); }
.how-title { margin: 0 0 4px; font-weight: 600; color: var(--text); }
.how ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }

/* Language menu: a two-column grid that scrolls vertically, with a filter box on top */
.langs .lang-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 10; width: min(360px, calc(100vw - 32px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.langs .lang-panel ul { list-style: none; position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 4px; columns: auto; min-width: 0; max-height: none; margin: 0; padding: 4px 8px 8px; overflow-y: auto; border: 0; border-radius: 0; box-shadow: none; background: none; }
.langs .lang-panel li a { min-height: 42px; padding: 0 10px; }
.lang-filter { margin: 8px 8px 4px; width: auto; min-height: 40px; font-weight: 500; }
.site-footer .langs .lang-panel { top: auto; bottom: calc(100% + 6px); inset-inline: 0 auto; }
@media (max-width: 599px) {
  .langs .lang-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 75vh; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-sheet); padding-bottom: env(safe-area-inset-bottom); }
  .site-footer .langs .lang-panel { inset-inline: 0; bottom: 0; }
}

/* Converter answer: a single line, details folded */
.answer--compact { padding-block: 10px; }
.answer--compact .answer-big { font-size: calc(var(--fs-answer) * .85); }
.answer--compact .more { margin-top: 4px; }
/* 18+ empty state: a compact cheat sheet, not a second headline */
.tool[data-tool="check"] .answer:not([class*="--"]) .answer-big { font-size: 18px; }
.home-today { margin-top: var(--s4); }
