/* Bói Ơi – main stylesheet. Plain CSS, mobile first. Fonts: Mali (headings), Nunito (body), self-hosted. */
/* Mali:wght@400;600;700 – SIL Open Font License 1.1, see OFL.txt */
/* vietnamese */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/mali/mali-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/mali/mali-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/mali/mali-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/mali/mali-600-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/mali/mali-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/mali/mali-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/mali/mali-700-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/mali/mali-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Mali';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/mali/mali-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Nunito:ital,wght@0,400;0,700;1,400 – SIL Open Font License 1.1, see OFL.txt */
/* vietnamese */
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400i-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400i-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400i-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/nunito/nunito-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --cream: #fffaf0;
  --paper: #ffffff;
  --ink: #4a3530;          /* body text: 10.9:1 on cream */
  --ink-soft: #6e5650;     /* muted text: 6.5:1 on cream */
  --line: #f1dccd;
  --pink-50: #fff0f4;
  --pink-200: #ffd1dc;
  --pink-400: #ff9fbf;
  --pink-600: #d6336c;     /* menu bar, white text 4.6:1 */
  --link: #c2255c;         /* 5.4:1 on cream */
  --mint-50: #effbf5;
  --mint-200: #bff0d9;
  --mint-400: #6fd3a6;
  --mint-700: #17663f;   /* 5.6:1 on mint-200 */
  --butter-50: #fffbe6;
  --butter-200: #fff1a8;
  --butter-400: #ffd75e;
  --butter-600: #e0ad2c;
  --sky-50: #f0f8ff;
  --sky-200: #cfe9ff;
  --sky-400: #8cc8f5;
  --sky-700: #2668a0;
  --orange-400: #ffad5c;
  --orange-700: #b4570f;   /* 4.9:1 on white */
  --outline: #5b4037;      /* illustration outline */
  --focus: #2668a0;
  /* Roles (each gets its own value in dark mode): */
  --accent: #d6336c;       /* headings, big numbers, symbols on the page surface */
  --accent-fill: #d6336c;  /* filled pink behind white text: menu bar, badges, quiz numbers */
  --on-accent: #fff;
  --on-pastel: #4a3530;    /* text on the pastel stickers and buttons, which stay light in both themes */
  --btn-pink: #ff9fbf; --btn-mint: #bff0d9; --btn-sky: #cfe9ff; --btn-butter: #ffd75e; --btn-butter-d: #e0ad2c;
  --neutral-bg: #f3eeec; --neutral-line: #d9cfcb;
  --hac-bg: #fdeee5; --hac-line: #eba98c; --hac-ink: #a3461f;   /* "ngày hắc đạo": soft peach, 5.4:1 */
  --error: #b3261e;
  --shadow: rgba(91, 64, 55, .08);
  --banner: url("../img/deco/banner.svg");
  --show-moon: inline; --show-sun: none;
  color-scheme: light;
  --radius: 10px;
  --font-display: "Mali", "Comic Sans MS", "Segoe UI", sans-serif;
  --font-body: "Nunito", "Segoe UI", Tahoma, Arial, sans-serif;
}

/* @dark-start: dark palette. build.mjs copies this block into @media (prefers-color-scheme: dark) for visitors
   who have not picked a theme; [data-theme] is set by theme.js only after an explicit choice. */
:root[data-theme="dark"] {
  --cream: #1c1720;
  --paper: #29212a;
  --ink: #f4e9e4;
  --ink-soft: #cdbab3;
  --line: #4b3b45;
  --pink-50: #36222e;
  --pink-200: #4d2c3d;
  --link: #ff9fc0;
  --mint-50: #1c2f27;
  --mint-200: #224535;
  --mint-400: #5cc497;
  --mint-700: #93e6be;
  --butter-50: #2f2a1c;
  --butter-200: #4a4020;
  --butter-600: #c9992a;
  --sky-50: #1b2734;
  --sky-200: #213b53;
  --sky-400: #6fb4e8;
  --sky-700: #a3d3ff;
  --orange-700: #ffb877;
  --outline: #8f7064;
  --focus: #a3d3ff;
  --accent: #ff8fb5;
  --accent-fill: #c2255c;
  --neutral-bg: #302a2e;
  --neutral-line: #4f464b;
  --hac-bg: #3a2721;
  --hac-line: #9a5f48;
  --hac-ink: #ffb08f;
  --error: #ff8a80;
  --shadow: rgba(0, 0, 0, .35);
  --banner: url("../img/deco/banner-night.svg");
  --show-moon: none; --show-sun: inline;
  color-scheme: dark;
}
/* @dark-end */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.65 var(--font-body);
  background: var(--cream) radial-gradient(var(--pink-200) 1.6px, transparent 2px) 0 0 / 24px 24px;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; color: var(--accent); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- page frame ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 6px 24px var(--shadow);
}
@media (min-width: 1120px) { .page { margin: 16px auto; border-radius: 14px; overflow: hidden; } }

.site-header {
  position: relative;
  height: 112px;
  background: var(--sky-200) var(--banner) left bottom / auto 100% repeat-x;
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo img { width: 64px; height: 64px; }
.logo-text { display: block; font: 700 2rem/1 var(--font-display); color: #e8772e;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 2px 2px #fff, -2px -2px #fff, 2px -2px #fff, -2px 2px #fff, 0 4px 0 rgba(91,64,55,.18); }
.logo-tld { font-size: .5em; margin-left: 2px; }
.logo-tag { display: block; width: fit-content; margin-top: 4px; font: 600 .82rem/1.2 var(--font-display); color: var(--on-pastel);
  background: rgba(255,255,255,.8); padding: 2px 8px; border-radius: 99px; }
.header-mascot { display: none; position: absolute; right: 24px; bottom: 0; width: 140px; height: 140px; }
@media (min-width: 768px) {
  .site-header { height: 150px; padding: 0 24px; }
  .logo img { width: 92px; height: 92px; }
  .logo-text { font-size: 2.9rem; }
  .logo-tag { font-size: .95rem; }
  .header-mascot { display: block; }
}

/* ---------- menu bar ---------- */
.menu-bar { background: var(--accent-fill); border-top: 3px solid var(--pink-400); border-bottom: 3px solid #a8325e; }
.menu-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0;
  background: none; color: var(--on-accent); font: 700 1.05rem var(--font-display); cursor: pointer; }
.menu-toggle .bars { display: inline-block; width: 20px; height: 3px; background: #fff; border-radius: 2px;
  box-shadow: 0 -6px #fff, 0 6px #fff; }
.menu { list-style: none; margin: 0; padding: 0 8px 10px; display: none; grid-template-columns: 1fr 1fr; gap: 6px; }
.menu.open { display: grid; }
.menu a { display: block; padding: 8px 10px; color: var(--on-accent); text-decoration: none; font: 700 .98rem var(--font-display);
  border-radius: 8px; background: rgba(255,255,255,.12); }
.menu a:hover, .menu a[aria-current] { background: #fff; color: var(--accent-fill); }
@media (min-width: 1180px) {
  .menu-toggle { display: none; }
  .menu, .menu.open { display: flex; flex-wrap: wrap; justify-content: center; padding: 6px 8px; gap: 2px; }
  .menu a { background: none; padding: 6px 8px; font-size: .95rem; }
}

/* ---------- layout ---------- */
.breadcrumb { font-size: .9rem; padding: 10px 14px 0; color: var(--ink-soft); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; color: var(--pink-400); font-weight: 700; }
.layout { display: grid; gap: 18px; padding: 14px; }
@media (min-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; padding: 18px 22px 24px; } }
.main > * + * { margin-top: 18px; }
.sidebar > * + * { margin-top: 18px; }

/* ---------- boxes ---------- */
.box { --c: var(--pink-400); --bg: var(--pink-200); border: 2px solid var(--c); border-radius: var(--radius);
  background: var(--paper); box-shadow: 0 3px 0 var(--bg); }
.box--mint { --c: var(--mint-400); --bg: var(--mint-200); }
.box--butter { --c: var(--butter-400); --bg: var(--butter-200); }
.box--sky { --c: var(--sky-400); --bg: var(--sky-200); }
.box-title { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 12px; background: var(--bg);
  border-bottom: 2px dashed var(--c); border-radius: 8px 8px 0 0; font-size: 1.1rem; }
.box-title img { width: 28px; height: 28px; flex: none; }
.box-body { padding: 12px 14px; }
.box-body > :last-child { margin-bottom: 0; }

hr.dots { border: 0; border-top: 4px dotted var(--pink-400); margin: 16px 0; }

/* ---------- buttons, badges, forms ---------- */
.btn { --b: var(--btn-butter); --d: var(--btn-butter-d); display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 22px; border: 2px solid var(--outline); border-radius: 14px; background: var(--b); color: var(--on-pastel);
  font: 700 1.05rem/1.3 var(--font-display); text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--outline);
  transition: transform .08s, box-shadow .08s; }
.btn:hover { color: var(--on-pastel); filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }
.btn--pink { --b: var(--btn-pink); }
.btn--mint { --b: var(--btn-mint); }
.btn--sky { --b: var(--btn-sky); }
.btn--small { padding: 5px 14px; font-size: .92rem; border-radius: 10px; box-shadow: 0 3px 0 var(--outline); }
.btn--big { padding: 12px 30px; font-size: 1.25rem; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font: 700 .72rem/1.5 var(--font-display);
  vertical-align: middle; transform: rotate(-6deg); border: 1.5px solid var(--outline); }
.badge--new { background: var(--mint-200); color: var(--ink); }
.badge--hot { background: var(--accent-fill); color: var(--on-accent); }

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label, .field legend { font: 700 .98rem var(--font-display); }
.field input, .field select { font: inherit; color: var(--ink); padding: 9px 12px; border: 2px solid var(--pink-400);
  border-radius: 10px; background: var(--pink-50); min-height: 44px; width: 100%; }
.field input:focus, .field select:focus { outline: 3px solid var(--focus); outline-offset: 1px; background: var(--paper); }
.hint { font-size: .86rem; color: var(--ink-soft); }
.form-row { display: grid; gap: 0 14px; }
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* ---------- result ---------- */
.result { display: grid; gap: 14px; align-items: center; }
@media (min-width: 600px) { .result { grid-template-columns: 140px 1fr; } }
.sticker { flex: none; width: 140px; height: 140px; margin: 0 auto; display: grid; place-content: center; text-align: center;
  background: url("../img/deco/sticker.svg") center / contain no-repeat; transform: rotate(-6deg); }
.sticker b { font: 700 2.2rem/1 var(--font-display); color: #d6336c; }
.sticker span { font: 700 .85rem/1.2 var(--font-display); color: var(--on-pastel); }
.sticker > span { display: block; max-width: 88px; margin: 2px auto 0; text-wrap: balance; }
.sticker > b { display: block; max-width: 112px; margin-inline: auto; }
.sticker--long > b { font-size: 1.2rem; white-space: nowrap; margin-bottom: 2px; }
.sticker b.hearts { font-size: 1.9rem; letter-spacing: 0; margin-bottom: 2px; }
.sticker b.hearts span { font-size: inherit; }
.hearts .on { color: #d6336c; }
.hearts .off { color: #ffd1dc; }
.score { width: 100%; border-collapse: collapse; font-size: .95rem; }
.score th, .score td { padding: 6px 8px; border-bottom: 2px dotted var(--line); text-align: left; }
.score th { font-family: var(--font-display); background: var(--butter-50); }
.score td.pt { text-align: right; font-weight: 700; white-space: nowrap; }
.tip { display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--mint-50);
  border: 2px dashed var(--mint-400); border-radius: var(--radius); }
.tip img { width: 56px; height: 56px; flex: none; }
.tip > p, .tip > div > p:last-child { margin: 0; }
.tip + :not(hr) { margin-top: 16px; }
.note { font-size: .86rem; color: var(--ink-soft); }

/* ---------- tool grid ---------- */
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tools a { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; padding: 10px 8px;
  text-align: center; text-decoration: none; color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--paper); transition: transform .1s, border-color .1s; }
.tools a:hover { transform: translateY(-2px) rotate(-1deg); border-color: var(--pink-400); }
.tools img { width: 56px; height: 56px; }
.tools b { font: 700 1rem/1.25 var(--font-display); }
.tools small { font-size: .8rem; color: var(--ink-soft); line-height: 1.35; }

/* ---------- sidebar widgets ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 2px dotted var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { display: flex; align-items: center; gap: 8px; padding: 6px 2px; text-decoration: none; color: var(--ink); font-weight: 700; }
.list a:hover { color: var(--link); }
.list img { width: 30px; height: 30px; flex: none; }
.list--num { counter-reset: n; }
.list--num a::before { counter-increment: n; content: counter(n); flex: none; display: grid; place-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--butter-400); color: var(--on-pastel); font: 700 .8rem var(--font-display); }
.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 6px; }
.chips li { display: flex; min-width: 0; }
.chips a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 40px;
  padding: 6px 2px; text-align: center; border-radius: 8px; background: var(--sky-50); white-space: nowrap;
  border: 1.5px solid var(--sky-200); text-decoration: none; color: var(--ink); font: 600 .84rem/1.25 var(--font-display); letter-spacing: -.01em; }
.chips a:hover { background: var(--sky-200); }
.chips .g { display: block; font-size: 1.2rem; }

/* ---------- share, ads, footer ---------- */
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 700; }
.ad-slot { margin-left: auto; margin-right: auto; text-align: center; }
.ad-slot::before { content: "Quảng cáo"; display: block; font-size: .72rem; color: var(--ink-soft); letter-spacing: .04em; }
.ad-slot .ad-box { width: 300px; height: 250px; margin: 2px auto 0; }
@media (min-width: 768px) { .ad-slot--wide .ad-box { width: 728px; max-width: 100%; height: 90px; } }

.site-footer { background: var(--mint-200); border-top: 4px dotted var(--mint-400); padding: 18px 14px; font-size: .92rem; text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-bottom: 10px; }
.site-footer a { color: var(--mint-700); font-weight: 700; }
.site-footer p { margin: 4px 0; }

/* ---------- page parts ---------- */
.layout--wide { grid-template-columns: 1fr !important; }
.sidebar-cat { display: block; margin: 0 auto; width: 180px; height: 180px; }
.intro { display: flex; gap: 12px; align-items: center; }
.intro img { width: 110px; height: 110px; flex: none; }
.intro h1 { margin-bottom: .25em; }
.intro p { margin: 0; }
@media (max-width: 480px) { .intro img { width: 84px; height: 84px; } }
.lead { font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.error { color: var(--error); font-weight: 700; }
.faq details { border-bottom: 2px dotted var(--line); padding: 6px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font: 700 1rem/1.4 var(--font-display); padding: 4px 0; }
.faq summary::marker { color: var(--accent); }
.faq details p { margin: 6px 0 4px; }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: 6px; }
.letters { font: 700 1.15rem/1.6 var(--font-display); letter-spacing: .12em; word-break: break-all; }
.letters s { color: var(--ink-soft); text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.flames { display: flex; gap: 6px; list-style: none; padding: 0; margin: 8px 0; }
.flames li { width: 40px; height: 44px; display: grid; place-content: center; border: 2px solid var(--outline); border-radius: 8px;
  font: 700 1.25rem var(--font-display); background: var(--paper); }
.flames li.out { opacity: .35; text-decoration: line-through; }
.flames li.win { background: var(--pink-400); color: var(--on-pastel); transform: rotate(-6deg) scale(1.1); }
.result-title { font-size: 1.35rem; color: var(--accent); margin: 0 0 .3em; }
.crit { margin: 12px 0 0; }
.crit h3 { font-size: 1rem; margin: 0 0 .2em; }
.crit p { margin: 0; }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 600px) { .related { grid-template-columns: 1fr 1fr; } }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
.center { text-align: center; }
.big-cat { width: 220px; height: 220px; display: block; margin: 0 auto 8px; }
.actions--center { justify-content: center; }

/* ---------- tarot ---------- */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(5, 1fr); } }
.card-grid a { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--ink); line-height: 1.25; }
.card-grid img { width: 100%; height: auto; border-radius: 8px; border: 2px solid var(--outline); margin-bottom: 4px; transition: transform .1s; }
.card-grid a:hover img { transform: translateY(-3px) rotate(-2deg); }
.card-grid b { font: 700 .9rem var(--font-display); }
.card-grid small { font-size: .75rem; color: var(--ink-soft); }
.card-hero { display: grid; gap: 16px; }
@media (min-width: 600px) { .card-hero { grid-template-columns: 220px 1fr; align-items: start; } }
.card-img { width: 220px; max-width: 70%; height: auto; margin: 0 auto; border-radius: 12px; border: 3px solid var(--outline); box-shadow: 0 5px 0 var(--pink-200); }
.facts th { width: 40%; }
.keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.keywords span { padding: 2px 10px; border-radius: 99px; background: var(--butter-200); border: 1.5px solid var(--butter-600); font-weight: 700; font-size: .88rem; }
.pager .box-body { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.spread { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 130px)); justify-content: center; gap: 10px; }
.spread li { text-align: center; font-size: .85rem; }
.tcard { position: relative; aspect-ratio: 240 / 415; border-radius: 10px; border: 3px solid var(--outline); overflow: hidden; background: var(--pink-200); margin-bottom: 6px; }
.tcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard.rev img { transform: rotate(180deg); }
.tcard.flip { animation: flip .5s ease-out both; }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
@media (prefers-reduced-motion: reduce) { .tcard.flip { animation: none; } }
.spread b { font-family: var(--font-display); display: block; }
.reading-sec { border-top: 2px dotted var(--line); padding-top: 10px; margin-top: 10px; }
.reading-sec h3 { margin-bottom: .2em; }
.reading-sec .kw { color: var(--ink-soft); font-size: .9rem; margin-bottom: .4em; }
.deck-pick { display: flex; justify-content: center; margin: 6px 0 12px; }
.deck-pick img { width: 120px; height: auto; border-radius: 10px; transform: rotate(-4deg); }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--accent-fill); }
.date-field { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.date-field legend { padding: 0; margin-bottom: 4px; }
.date-row { display: grid; grid-template-columns: 1fr 1.2fr 1.3fr; gap: 6px; }
.date-row select { font: inherit; color: var(--ink); padding: 9px 6px; border: 2px solid var(--pink-400); border-radius: 10px; background: var(--pink-50); min-height: 44px; width: 100%; }
.date-row select:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.radios { display: flex; gap: 14px; flex-wrap: wrap; }
.radios label { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.radios input { width: 20px; height: 20px; accent-color: var(--accent-fill); }
.finder { margin: -4px 0 12px; font-size: .92rem; }
.finder summary { cursor: pointer; color: var(--link); font-weight: 700; }
.finder .date-field { margin-top: 8px; }
.pc-grid { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 600px) { .pc-grid { grid-template-columns: repeat(7, 1fr); } }
.pc-grid img { border: 0; border-radius: 6px; }
.pc-img { border: 0; box-shadow: none; width: 180px; }
.en { font-size: .65em; color: var(--ink-soft); }
.pcard { aspect-ratio: 120 / 168; }
.pcard img { object-fit: contain; }
.tcard.pcard { border: 0; background: none; border-radius: 6px; }
.spread--pc { grid-template-columns: repeat(auto-fit, minmax(80px, 96px)); }

/* ---------- Lịch âm ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.badges .badge { transform: none; font-size: .8rem; padding: 3px 10px; color: var(--ink); }
.badge--mint { background: var(--mint-200); }
.badge--sky { background: var(--sky-200); }
.badge--butter { background: var(--butter-200); }
.badge--pink { background: var(--pink-200); }
.lich-sheet { display: grid; grid-template-columns: 1fr 1fr; border: 3px solid var(--outline); border-radius: 14px; overflow: hidden; background: var(--paper); }
.lich-sheet > div { display: flex; flex-direction: column; align-items: center; padding: 10px 6px 12px; text-align: center; }
.lich-solar { border-right: 3px dashed var(--line); }
.lich-solar .lich-big { color: var(--accent); }
.lich-lunar { background: var(--butter-50); }
.lich-lunar .lich-big { color: var(--orange-700); }
.lich-big { font: 700 clamp(3.4rem, 14vw, 5.2rem)/1.05 var(--font-display); }
.lich-small { font: 600 .95rem/1.3 var(--font-display); }
.lich-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; }
.lich-nav input { font: inherit; padding: 5px 8px; border: 2px solid var(--line); border-radius: 8px; }
.lich-grid { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.lich-grid th { font: 700 .85rem var(--font-display); color: var(--ink-soft); padding: 4px 0; }
.lich-grid th:last-child { color: var(--accent); }
.lich-grid td { padding: 0; }
.lich-cell, .lich-grid .cell { display: flex; flex-direction: column; align-items: center; width: 100%; min-height: 50px; padding: 4px 2px; border: 2px solid var(--line); border-radius: 8px; background: var(--paper); font: inherit; color: var(--ink); cursor: pointer; }
.lich-grid .cell { cursor: default; }
.lich-cell b, .lich-grid .cell b { font: 700 1.05rem/1.2 var(--font-display); }
.lich-cell small, .lich-grid .cell small { font-size: .72rem; color: var(--ink-soft); }
.lich-cell:hover { border-color: var(--pink-400); }
/* Hoàng đạo = mint cell + green border + ★; bình thường = plain; hắc đạo = peach cell + ☾. Holiday: pink dot + pink date. */
.lich-cell, .lich-grid .cell { position: relative; }
.is-good, .lich-grid .cell.is-good { background: var(--mint-50); border-color: var(--mint-400); }
.is-good small { color: var(--mint-700); font-weight: 700; }
.is-good::after { content: "★"; position: absolute; top: 1px; right: 3px; font-size: .62rem; line-height: 1; color: var(--mint-700); }
.is-bad, .lich-grid .cell.is-bad { background: var(--hac-bg); border-color: var(--hac-line); }
.is-bad small { color: var(--hac-ink); font-weight: 700; }
.is-bad::after { content: "☾"; position: absolute; top: 1px; right: 3px; font-size: .62rem; line-height: 1; color: var(--hac-ink); }
.is-holiday b { color: var(--accent); }
.is-holiday::before { content: ""; position: absolute; top: 4px; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.is-today { border-color: var(--orange-400); border-width: 3px; background: var(--butter-200); }
.lich-cell[aria-pressed="true"] { border-color: var(--sky-700); box-shadow: inset 0 0 0 2px var(--sky-700); }
.lich-legend { font-size: .85rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.lich-legend i { flex: none; }
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.month-head b { font: 700 1.15rem var(--font-display); }
.conv-out { font: 700 1.2rem/1.4 var(--font-display); color: var(--accent); margin: 10px 0 0; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-fields .field { margin: 0; }
.inline-fields input[type=number], .inline-fields select { width: 6.5em; }
.lich-legend { gap: 6px 16px; align-items: center; }
.lich-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lich-legend .lg { position: relative; display: inline-block; width: 26px; height: 22px; border: 2px solid var(--line); border-radius: 6px; background: var(--paper); }
.lich-legend .lg.is-good { background: var(--mint-50); border-color: var(--mint-400); }
.lich-legend .lg.is-bad { background: var(--hac-bg); border-color: var(--hac-line); }
.lg.is-bad::after { top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); font-size: .8rem; }
.lich-legend .lg.is-today { border: 3px solid var(--orange-400); background: var(--butter-200); }
.lg.is-good::after { top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); font-size: .8rem; }
.lg.is-holiday::before { top: 50%; left: 50%; width: 8px; height: 8px; transform: translate(-50%, -50%); }
.day-kind { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; padding: 8px 12px; border-radius: 12px; border: 2px solid; font: 700 1.05rem/1.3 var(--font-display); }
.day-kind .ic { flex: none; display: grid; place-content: center; width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; }
.day-kind small { display: block; font: 600 .82rem/1.3 var(--font-body); }
.day-kind--good { background: var(--mint-200); border-color: var(--mint-400); color: var(--mint-700); }
.day-kind--good .ic { background: var(--mint-700); color: var(--paper); }
.day-kind--normal { background: var(--neutral-bg); border-color: var(--neutral-line); color: var(--ink-soft); }
.day-kind--normal .ic { background: var(--ink-soft); color: var(--paper); }
.day-kind--bad { background: var(--hac-bg); border-color: var(--hac-line); color: var(--hac-ink); }
.day-kind--bad .ic { background: var(--hac-ink); color: var(--paper); }

/* ---------- Lịch năm ---------- */
.year-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .year-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .year-grid { grid-template-columns: repeat(3, 1fr); } }
.year-month h3 { margin: 0 0 4px; text-align: center; font: 700 1.05rem var(--font-display); }
.lich-grid--mini { border-spacing: 2px; }
.lich-grid--mini .cell { min-height: 34px; padding: 2px 1px; border-width: 1px; border-radius: 6px; }
.lich-grid--mini .cell b { font-size: .85rem; }
.lich-grid--mini .cell small { font-size: .62rem; }
.lich-grid--mini th { font-size: .72rem; }
.lich-grid--mini .is-good::after, .lich-grid--mini .is-bad::after { font-size: .5rem; right: 2px; }
.lich-grid--mini .is-holiday::before { width: 5px; height: 5px; top: 3px; left: 3px; }

/* ---------- Đếm ngược Tết ---------- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; margin: 0 auto; }
.cd-cell { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); }
.cd-cell b { font: 700 clamp(1.8rem, 8vw, 3rem)/1.1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.cd-cell span { font: 700 .9rem var(--font-display); color: var(--ink-soft); }
.cd-say { text-align: center; font: 700 1.05rem var(--font-display); margin: 12px 0 0; }

/* ---------- Xem ngày tốt ---------- */
.pick-day .inline-fields select { width: auto; }
#out { margin-top: 14px; }
.goodday-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.goodday { border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--paper); }
.goodday--rat-tot { border-color: var(--mint-400); background: var(--mint-50); }
.goodday .why { margin: 0; }
.goodday summary { color: var(--ink); font: 400 .95rem/1.5 var(--font-body); }
.goodday summary b { font-family: var(--font-display); }
.goodday-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; font: 700 .8rem/1.6 var(--font-display); background: var(--neutral-bg); color: var(--ink); }
.goodday--rat-tot .goodday-tag { background: var(--mint-200); color: var(--mint-700); }
.goodday ul { margin: 6px 0; padding-left: 1.2em; font-size: .92rem; }

/* ---------- Tử vi hôm nay ---------- */
.day-switch { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.day-switch [aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.daily-when { font: 700 .95rem var(--font-display); color: var(--ink-soft); margin: 0 0 8px; }
.cats { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 12px 0; }
@media (min-width: 600px) { .cats { grid-template-columns: 1fr 1fr; } }
.cat { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--paper); }
.cat h4 { margin: 0 0 2px; font: 700 1rem var(--font-display); }
.cat p { margin: 4px 0; }
.cat--love { background: var(--pink-50); }
.cat--career { background: var(--sky-50); }
.cat--finance { background: var(--butter-50); }
.cat--wellbeing { background: var(--mint-50); }
.meter { margin: 0; font-size: 1.1rem; letter-spacing: 1px; }
.meter .on { color: var(--accent); }
.meter .off { color: var(--line); }
.meter small { font: 600 .8rem var(--font-display); color: var(--ink-soft); letter-spacing: 0; margin-left: 6px; }
.why { margin: 10px 0; }
.why summary { cursor: pointer; font: 700 .95rem var(--font-display); color: var(--link); }
.zgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 600px) { .zgrid { grid-template-columns: repeat(4, 1fr); } }
.zgrid a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); text-align: center; }
.zgrid a:hover { border-color: var(--pink-400); }
.zgrid b { font: 700 1rem var(--font-display); }
.zgrid small { font-size: .78rem; color: var(--ink-soft); }
.zgrid .sym { font-size: 1.6rem; line-height: 1; color: var(--accent); }
.zgrid .lv { font: 700 .75rem var(--font-display); color: var(--mint-700); min-height: 1.2em; }
.day-switch .btn { flex: 1 1 0; padding: 5px 6px; max-width: 130px; }

/* ---------- Thần số học ---------- */
.ns-grids { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 8px 0; }
.ns-grid { border-collapse: separate; border-spacing: 4px; }
.ns-grid caption { font: 700 .9rem var(--font-display); color: var(--ink-soft); padding-bottom: 4px; }
.ns-grid td { width: 64px; height: 52px; text-align: center; border: 2px solid var(--outline); border-radius: 10px; font: 700 1.1rem var(--font-display); background: var(--paper); color: var(--accent); word-break: break-all; }
.ns-grid td.empty { background: var(--pink-50); border-style: dashed; border-color: var(--line); }

/* ---------- Mệnh ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 8px; }
.sw { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.sw svg { flex: none; }
.dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--outline); }
.colors small { display: block; color: var(--ink-soft); }
.table-wrap { max-height: 520px; overflow: auto; border: 2px solid var(--line); border-radius: 10px; }
/* Tables have no bottom margin, so give whatever follows one some room. */
:is(table.score, .table-wrap) + * { margin-top: 16px; }
.year-table { margin: 0; }
.year-table thead th { position: sticky; top: 0; background: var(--butter-200); }
.year-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.year-list small { display: block; color: var(--ink-soft); }

/* ---------- Trắc nghiệm ---------- */
.quiz-q { border: 2px solid var(--line); border-radius: 12px; background: var(--paper); margin: 0 0 12px; padding: 8px 12px 10px; }
.quiz-q legend { font: 700 1.02rem/1.4 var(--font-display); padding: 0 6px; display: flex; gap: 8px; align-items: flex-start; }
.qn { flex: none; display: inline-grid; place-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); font-size: .85rem; }
.quiz-a { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.quiz-a:hover { background: var(--pink-50); }
.quiz-a input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent-fill); flex: none; }
.quiz-a:has(input:checked) { background: var(--pink-200); font-weight: 700; }
.block { display: block; font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.prose h2 { font: 700 1.2rem var(--font-display); color: var(--accent); margin: 18px 0 6px; }
.prose h2:first-child { margin-top: 0; }
.credit-list { font-size: .85rem; columns: 2 260px; }
.article-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.article-head h1 { margin: 0; }
.article .lead { font-weight: 600; }
.article-list small { margin-top: 2px; }
.article p { max-width: 68ch; }

/* ---------- Home ---------- */
.today { display: grid; gap: 14px; }
@media (min-width: 700px) { .today { grid-template-columns: 1fr 1.4fr; } }
.today-cal { border: 3px solid var(--outline); border-radius: 14px; background: var(--paper); padding: 10px 12px; text-align: center;
  display: flex; flex-direction: column; justify-content: center; }
.today-solar { font: 700 1.15rem var(--font-display); color: var(--accent); margin: 0; }
.today-lunar { font: 600 1rem var(--font-display); color: var(--orange-700); margin: 4px 0; }
.today h3 { margin: 0 0 6px; font: 700 1rem var(--font-display); }
.zgrid--mini { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.zgrid--mini a { padding: 4px 2px; }
.zgrid--mini .lv { font-size: .68rem; }
.today-cal p:last-child { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 0; }
.zgrid { grid-auto-rows: 1fr; }
.zgrid li { display: flex; min-width: 0; }
.zgrid a { flex: 1; justify-content: center; }

/* Giờ hoàng đạo strip: 12 canh giờ, good ones mint + star (same language as the month grid). */
.hours { margin: 14px 0; }
.hours-title { margin: 0 0 8px; font-size: 1.05rem; }
.hours-title small { font: 600 .82rem var(--font-body); color: var(--ink-soft); }
.hours-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 6px; }
.hour { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px;
  padding: 6px 2px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink-soft); text-align: center; }
.hour b { font: 700 .95rem/1.2 var(--font-display); }
.hour span { font-size: .78rem; line-height: 1.2; white-space: nowrap; }
.hour.is-good { background: var(--mint-50); border-color: var(--mint-400); color: var(--ink); }
.hour.is-good b { color: var(--mint-700); }
.hour.is-good::after { content: "★"; position: absolute; top: 1px; right: 4px; font-size: .62rem; color: var(--mint-700); }
.hour.is-now { border: 3px solid var(--orange-400); }
.hour em { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); padding: 0 5px; border-radius: 6px;
  background: var(--orange-400); color: var(--on-pastel); font: 700 .62rem/1.4 var(--font-display); font-style: normal; white-space: nowrap; }
@media (max-width: 520px) { .hours-grid { grid-template-columns: repeat(4, 1fr); } }

.score--compare { table-layout: fixed; }
.score--compare th:first-child { width: 38%; }
.score--compare tbody th { background: none; font: 400 .95rem var(--font-body); color: var(--ink-soft); }
.score--compare td { font-weight: 700; }

.hours-note { margin: 10px 0 0; font-size: .85rem; color: var(--ink-soft); }

/* Theme toggle (top right of the header). Icons switch through variables so the OS-preference copy works too. */
.theme-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-content: center; width: 40px; height: 40px;
  border: 2px solid var(--outline); border-radius: 50%; background: var(--btn-butter); color: var(--on-pastel); cursor: pointer;
  box-shadow: 0 3px 0 var(--outline); }
.theme-toggle:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .moon { display: var(--show-moon); }
.theme-toggle .sun { display: var(--show-sun); }
@media (min-width: 768px) { .theme-toggle { right: 200px; top: 14px; } }

@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
  --cream: #1c1720;
  --paper: #29212a;
  --ink: #f4e9e4;
  --ink-soft: #cdbab3;
  --line: #4b3b45;
  --pink-50: #36222e;
  --pink-200: #4d2c3d;
  --link: #ff9fc0;
  --mint-50: #1c2f27;
  --mint-200: #224535;
  --mint-400: #5cc497;
  --mint-700: #93e6be;
  --butter-50: #2f2a1c;
  --butter-200: #4a4020;
  --butter-600: #c9992a;
  --sky-50: #1b2734;
  --sky-200: #213b53;
  --sky-400: #6fb4e8;
  --sky-700: #a3d3ff;
  --orange-700: #ffb877;
  --outline: #8f7064;
  --focus: #a3d3ff;
  --accent: #ff8fb5;
  --accent-fill: #c2255c;
  --neutral-bg: #302a2e;
  --neutral-line: #4f464b;
  --hac-bg: #3a2721;
  --hac-line: #9a5f48;
  --hac-ink: #ffb08f;
  --error: #ff8a80;
  --shadow: rgba(0, 0, 0, .35);
  --banner: url("../img/deco/banner-night.svg");
  --show-moon: none; --show-sun: inline;
  color-scheme: dark;
}
}
