/* Dad Ping — "morning warm white": light first, large type, AAA contrast (docs/research/01 §5). */
:root {
  --bg: #fffdf8;
  --surface: #f5efe6;
  --surface-2: #fbf7f0;
  --line: #e4d9ca;
  --text: #1f1a17;
  --text-2: #5a4f47;
  --accent: #9a3412;
  --accent-strong: #7c2d12;
  --accent-soft: #fbe9dc;
  --ok: #0f5132;
  --focus: #1d4ed8;
  --on-accent: #ffffff;
  --radius: 14px;
  --fs: 20px;
  --maxw: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1714; --surface: #26201b; --surface-2: #211c18; --line: #3a312a;
    --text: #f6efe7; --text-2: #d4c6b8; --accent: #f4a46c; --accent-strong: #ffc199; --accent-soft: #3a2619;
    --ok: #8fd6ae; --focus: #93b4ff; --on-accent: #1b1714; color-scheme: dark;
  }
}
html[data-size="1"] { --fs: 23px; }
html[data-size="2"] { --fs: 26px; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs)/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial,
    "PingFang SC", "PingFang TC", "Hiragino Sans", "Microsoft YaHei", "Microsoft JhengHei", sans-serif;
}
:lang(zh-Hant) body, body:lang(zh-Hant) { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.25; color: var(--text); font-weight: 700; overflow-wrap: break-word; }
/* long words (pt-br, es at large text sizes) wrap instead of widening the page */
.msg-text, .tiles a, .hol-list li, .brand, .prose li { overflow-wrap: anywhere; }
h1 { font-size: 1.75em; margin: .4em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.3em; margin: 1.6em 0 .6em; }
h3 { font-size: 1.1em; margin: 1.2em 0 .4em; }
p { margin: 0 0 .9em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 10; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15em; color: var(--text); text-decoration: none; margin-right: auto; min-height: 48px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.size-btn { min-width: 48px; min-height: 48px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.size-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.lang { position: relative; }
.lang summary { list-style: none; min-height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg); }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; right: 0; top: 54px; z-index: 5; list-style: none; margin: 0; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; min-width: 14rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.lang li a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.lang li a:hover, .lang li a[aria-current="true"] { background: var(--accent-soft); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 0 8px; margin: 0; list-style: none; }
.nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); }
.nav a:hover { background: var(--surface); }

/* banner */
.lang-banner { background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.lang-banner .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 16px; }
.lang-banner[hidden] { display: none; }

/* main */
main { padding: 8px 0 48px; }
.lead { font-size: 1.1em; color: var(--text-2); max-width: 46rem; }
.ai-note { font-size: .85em; color: var(--text-2); background: var(--surface); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; max-width: 52rem; }
.meta { color: var(--text-2); font-size: .9em; }
.crumbs { font-size: .9em; color: var(--text-2); margin: 12px 0 0; }
.crumbs a { color: var(--text-2); }

/* messages */
.msgs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.msg { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg-text { margin: 0; font-size: 1.05em; white-space: pre-line; }
.msg-tags { font-size: .8em; color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; min-width: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: .9em; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn[hidden] { display: none; }
.btn.done { border-color: var(--ok); color: var(--ok); }

/* cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 15rem), 1fr)); }
.cards a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); }
.cards img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.card-hero { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .card-hero { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); } }
.card-hero img { border-radius: var(--radius); border: 1px solid var(--line); }

/* scenario grid */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.tiles a { display: flex; flex-direction: column; justify-content: center; min-height: 84px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 700; }
.tiles a span { font-weight: 400; color: var(--text-2); font-size: .85em; }
.tiles a:hover { border-color: var(--accent); }

/* holidays */
.hol-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hol-list li { padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9em; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); }

/* generator */
.gen fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0 0 14px; }
.gen legend { font-weight: 700; padding: 0 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; }
.choices input { width: 20px; height: 20px; accent-color: var(--accent); }
.gen-out { margin-top: 16px; }

/* article */
.prose { max-width: 46rem; }
.prose li { margin: .3em 0; }
.sources { font-size: .9em; }
.sources li { margin: .4em 0; word-break: break-word; }
.notice { background: var(--surface); border-radius: 12px; padding: 12px 16px; font-size: .9em; }

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface-2); padding: 24px 0 36px; font-size: .9em; color: var(--text-2); }
.site-foot ul { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-foot a { color: var(--text-2); display: inline-flex; min-height: 48px; align-items: center; }
.pager { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin: 24px 0; }
.langs-root { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.langs-root a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); text-decoration: none; color: var(--text); }
.langs-root strong { display: block; font-size: 1.1em; }
.langs-root span { color: var(--text-2); font-size: .9em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.more { display: inline-block; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more[open] { display: flex; flex-wrap: wrap; gap: 8px; }
.more[hidden] { display: none; }
