:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #5b6673;
  --border: #dde2e8;
  --accent: #0b7a75;
  --accent-text: #ffffff;
  --accent-soft: #e2f3f1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b;
    --surface: #1b2128;
    --text: #e7ebef;
    --muted: #9aa5b1;
    --border: #2d3640;
    --accent: #4fc4bb;
    --accent-text: #06201e;
    --accent-soft: #15302e;
    --danger: #f27a6e;
    --danger-soft: #3a1f1d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 28px 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
h3 { font-size: .95rem; margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.muted { color: var(--muted); font-size: .92rem; margin-top: 0; }
small { color: var(--muted); font-weight: 400; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { height: 56px; display: flex; align-items: center; }
.brand { flex: none; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-weight: 700; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Page: main column + sticky sidebar ad on wide screens (only when a sidebar ad exists) */
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.sidebar { display: none; }
@media (min-width: 1180px) {
  .page--ads { max-width: 1460px; grid-template-columns: minmax(0, 1fr) 300px; }
  .page--ads .sidebar { display: block; padding-top: 28px; }
  .page--ads .sidebar .ad { position: sticky; top: 16px; }
}

/* Ad slots: fixed reserved heights so filling them causes no layout shift. Not rendered at all until AdSense is set up.
   The 18px on top holds the label, so it never sits on the ad. An unfilled slot closes up once Google reports it. */
.ad { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; margin: 24px auto; padding-top: 18px; overflow: hidden; box-sizing: border-box; }
.ad--preview { border: 1px dashed var(--border); border-radius: 8px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad::before { content: attr(data-label); position: absolute; top: 2px; left: 8px; font-size: .68rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ad--banner { min-height: 118px; max-width: 728px; }
.ad--rect { min-height: 298px; max-width: 336px; }
.ad--sky { min-height: 618px; max-width: 300px; margin-top: 0; }
@media (min-width: 768px) { .ad--banner { min-height: 108px; } }
/* Phones: more room between the tool and the banner under it, so a thumb aimed at a button can't land on the ad (as on HandyWheel
   and HandyQRCode). Was 24px from the tool's edge, 47px from the calendar's source link, 61px from "Download all" (2026-11-10). */
@media (max-width: 767px) { .ad--banner { margin-top: 80px; } }
.ad-placeholder { color: var(--muted); font-size: .85rem; }
.ad ins { width: 100%; }

.faq { margin-top: 24px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; min-height: 44px; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

.site-footer { color: var(--muted); font-size: .88rem; padding: 28px 0 36px; text-align: center; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 8px 0 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: center; }
.lang-switch { margin-bottom: 12px; }
.lang-switch details { display: inline-block; max-width: 100%; }
.lang-switch summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); cursor: pointer; list-style: none; user-select: none; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { color: var(--text); border-color: var(--muted); }
.lang-switch summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lang-switch .caret { display: inline-block; transition: transform .15s; }
.lang-switch details[open] .caret { transform: rotate(180deg); }
.lang-switch ul { list-style: none; margin: 8px 0 0; padding: 8px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 2px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-align: left; }
.lang-switch a { display: block; padding: 3px 0; color: var(--muted); }
.lang-switch a[aria-current="page"] { color: var(--text); font-weight: 600; text-decoration: none; }
@media (max-width: 480px) { .lang-switch ul { grid-template-columns: repeat(2, minmax(0, auto)); } }
@media (prefers-reduced-motion: reduce) { .lang-switch .caret { transition: none; } }
/* Header copy: same control, but the list drops down over the page instead of opening in place */
.lang-switch--header { margin: 0 0 0 auto; flex: none; }
.lang-switch--header details { position: relative; }
.lang-switch--header summary { padding: 3px 10px; font-size: .9rem; white-space: nowrap; }
.lang-switch--header ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; width: max-content; grid-template-columns: repeat(2, minmax(0, auto)); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.lang-switch .ls-code { display: none; }
@media (max-width: 480px) {
  /* Header on phones: "🌐 FI" so it fits beside the logo and the menu button; the full name stays for screen readers */
  .lang-switch--header summary { padding: 3px 7px; gap: 4px; }
  .lang-switch--header .ls-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lang-switch--header .ls-code { display: inline; }
  .lang-switch--header .caret { display: none; }
}
.linklike { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.options { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.options h3:first-of-type { margin-top: 18px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 5px; }
.field.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.field.inline > span { margin: 0; font-weight: 500; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.field.inline select { width: auto; }
textarea { resize: vertical; }

input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, .drop:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); padding: 3px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; margin-bottom: 12px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.opt-group { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 14px; }
.opt-group summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--text); }
.opt-group[open] summary { margin-bottom: 6px; }
.hint { font-size: .82rem; color: var(--muted); margin: 0 0 12px; }
.actions.tight { margin: 0 0 8px; }
.actions.tight label.btn { display: inline-block; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

.error { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: 8px; margin: 12px 0 0; font-size: .92rem; }

.article { margin-top: 24px; }
.article p, .article li { max-width: 75ch; }
.article h2 { margin-top: 18px; }
.article h2:first-child { margin-top: 0; }
.article dt { font-weight: 700; margin-top: 10px; }
.article dd { margin: 2px 0 0; color: var(--muted); }
.article li { margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .92rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10;
}

/* Top navigation (scrolls sideways on narrow screens) */
.site-header .wrap { gap: 20px; }
.top-nav { overflow-x: auto; scrollbar-width: none; }
.top-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; white-space: nowrap; }
.top-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.top-nav a:hover { color: var(--text); background: var(--bg); }
.top-nav a[aria-current] { color: var(--text); font-weight: 600; background: var(--accent-soft); }

/* Related tools */
.related { margin-top: 24px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cards a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.cards a:hover { border-color: var(--accent); }
.card-emoji { font-size: 1.25rem; }
/* There is no percent emoji: the percentage calculator's icon is a "%" drawn like the blue keycap emojis (🔢 🔠) next to it */
.glyph-pct { display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; border-radius: .2em; background: #3b82f6;
  color: #fff; font: 800 .78em/1 system-ui, sans-serif; vertical-align: -.12em; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .options { position: static; order: 2; }
}

/* Tables in guides */
.article table { border-collapse: collapse; width: 100%; max-width: 640px; margin: 8px 0 16px; font-size: .92rem; }
.article th, .article td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.article th { color: var(--muted); font-weight: 600; }
.article td code, .article p code, .article li code { overflow-wrap: anywhere; }
.article pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: .85rem; }
@media (max-width: 520px) { .article th, .article td { padding: 6px 4px; overflow-wrap: anywhere; } }

a.btn { display: inline-block; text-decoration: none; }
/* Printable calendar */
.cal { grid-template-columns: 320px minmax(0, 1fr); }
.cal-main { display: grid; gap: 16px; min-width: 0; }
.cal-paper { padding: 16px; background: var(--bg); }
.cal-preview { display: grid; gap: 16px; justify-items: center; }
.cal-preview.is-many { max-height: 80vh; overflow-y: auto; padding-right: 6px; }
.cal-sheet { width: 100%; max-width: 760px; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .22); }
.cal-sheet svg { display: block; width: 100%; height: 100%; }
.cal-holidays ul { list-style: none; margin: 0 0 10px; padding: 0; columns: 2 280px; column-gap: 24px; }
.cal-holidays li { break-inside: avoid; padding: 3px 0; font-size: .92rem; }
.cal-holidays li b { display: block; font-weight: 600; font-size: .82rem; color: var(--muted); }
.cal-holidays .hint { margin: 6px 0 0; }
@media (max-width: 820px) {
  .cal { grid-template-columns: 1fr; }
  .cal .options { order: 0; max-height: none; }
  .cal-paper { padding: 10px; }
}

#print-area { display: none; }
/* Printing. The calendar's Print button sets html.print-sheets (js/calendar.js) and only its pages are printed. Any other print,
   on any page, prints the page content (heading, tool and result, article) in light colours, without the header, menus, ads,
   related tools and footer. */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --border: #bbb; --accent: #0b7a75; --accent-text: #fff; --accent-soft: #eef6f5; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .skip, .ad, .related, .lang-switch, .cd-bar, .cd-pick, .cd-fx, #print-area { display: none !important; }
  .wrap.page { max-width: none; padding: 0; }
  .card { border-color: #bbb; break-inside: avoid; }
  .faq details:not([open]) > :not(summary) { display: none; }
  a { color: inherit; }
  .cd.is-fullscreen { position: static; }
  .fs-lock, .fs-lock body { overflow: visible; }
  .fin-table-wrap, .table-wrap, .cal-preview.is-many { max-height: none !important; overflow: visible !important; }
  html.print-sheets body > *:not(#print-area) { display: none !important; }
  html.print-sheets #print-area { display: block !important; }
  .print-sheet { width: var(--w); height: calc(var(--h) - .4mm); overflow: hidden; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheet:last-child { break-after: auto; }
  .print-sheet svg { display: block; width: var(--w); height: var(--h); }
}

/* --- Tool pages (batch 1) ---------------------------------------------------------------------------------------------------- */
:root { --add-bg: #e6f4ea; --add-mark: #a8dbb6; --del-bg: #fdecea; --del-mark: #f5b5ae; --bar: #dde2e8; }
@media (prefers-color-scheme: dark) {
  :root { --add-bg: #15301f; --add-mark: #2c6b40; --del-bg: #3a1f1d; --del-mark: #7d3530; --bar: #2d3640; }
}
.tool textarea { min-height: 180px; line-height: 1.5; }
.tool + .card, .card + .card { margin-top: 16px; }

/* Word counter */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 0; }
.stats > div { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stats dt { font-size: .82rem; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.limits li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: .92rem; }
.limit-num { font-variant-numeric: tabular-nums; color: var(--muted); }
.limits .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bar); overflow: hidden; }
.limits .bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.limits li.is-over .limit-num { color: var(--danger); font-weight: 600; }
.limits li.is-over .bar span { background: var(--danger); }
.limits-card .hint { margin: 12px 0 0; }

/* Case converter */
.case-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.case-buttons--code .btn { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 500; }

/* Text compare */
.diff-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff-inputs textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88rem; }
.diff-options { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.diff-options .check { margin: 0; }
@media (max-width: 700px) { .diff-inputs { grid-template-columns: 1fr; } .diff-inputs textarea { min-height: 130px; } }
.diff-summary { margin: 0 0 12px; font-weight: 600; }
.diff-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.diff { width: 100%; border-collapse: collapse; table-layout: fixed; font: .84rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.diff td { padding: 1px 8px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .ln { width: 3.4em; text-align: right; color: var(--muted); user-select: none; padding-right: 6px; background: var(--bg); }
.diff col.c-ln { width: 3.4em; }
.diff--inline td.ln { width: 3em; }
.diff .sg { width: 1.6em; text-align: center; user-select: none; color: var(--muted); }
.diff--split .tx.old, .d-del .tx, .d-del .sg { background: var(--del-bg); }
.diff--split .tx.new, .d-ins .tx, .d-ins .sg { background: var(--add-bg); }
.diff--split .d-chg .tx.old { background: var(--del-bg); }
.diff .tx.empty { background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--bg) 6px 12px); }
.diff del { background: var(--del-mark); text-decoration: none; border-radius: 2px; }
.diff ins { background: var(--add-mark); text-decoration: none; border-radius: 2px; }
.diff--split td.tx + td.ln { border-left: 1px solid var(--border); }
.d-skip td { text-align: center; padding: 4px; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-family: system-ui, sans-serif; }
.d-skip .linklike { color: var(--accent); font-size: .85rem; }
@media print { .diff del, .diff ins { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Unit converter */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.seg .btn { padding: 7px 12px; font-weight: 500; }
.seg .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.uc-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.uc-row .field { margin-bottom: 0; }
.uc-swap { padding: 8px 12px; font-size: 1.1rem; line-height: 1.2; }
#uc-ingredient-field { margin-top: 14px; max-width: 360px; }
.uc-result { font-size: 1.5rem; margin: 18px 0 6px; overflow-wrap: anywhere; }
.uc-result span { color: var(--muted); font-size: 1.1rem; }
.uc-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.uc-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.uc-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.uc-table tr.is-current td { font-weight: 700; background: var(--accent-soft); }
@media (max-width: 600px) {
  .uc-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .uc-row .uc-value { grid-column: 1 / -1; }
}

/* Percentage and date calculators */
.pc-grid, .dc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.pc-grid .card, .dc-grid .card { margin-top: 0; }
.pc h2, .dc h2 { font-size: 1.02rem; }
.row3 { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.row4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pc .field, .dc .field { margin-bottom: 10px; }
.pc-result, .dc-big { display: block; font-size: 1.6rem; font-weight: 700; margin: 6px 0 4px; overflow-wrap: anywhere; }
.pc-result small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.dc-big { font-size: 1.3rem; }
.pc-how { font-size: .85rem; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.dc-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: .92rem; }
.dc-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--border); }
.dc-list li strong { text-align: right; font-weight: 600; }
.dc-list li.hint { display: block; border: 0; }
input[type="date"] { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-height: 40px; }
input[aria-invalid="true"] { border-color: var(--danger); }
@media (max-width: 480px) { .row4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dc .row2 { grid-template-columns: 1fr; } }
input[type="date"] { min-width: 0; }

/* Phones: the category menu gets its own row under the logo, so all categories fit */
@media (max-width: 600px) {
  .site-header .wrap { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: 8px; padding-bottom: 4px; }
  .brand { min-height: 40px; }
  .top-nav { order: 3; flex: 1 0 100%; margin: 0 -10px; }
}

/* Image tools */
.drop { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.drop-icon { font-size: 2rem; }
.drop-text strong { color: var(--accent); }
.drop .hint { margin: 0; }
.im-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; margin-top: 18px; align-items: start; }
.im-options .row2, .im-options .check { grid-column: 1 / -1; }
.im-options .row2 { max-width: 460px; }
.im-privacy { margin: 4px 0 0; }
.im-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.im-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.im-list img, .im-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: repeating-conic-gradient(var(--border) 0 25%, transparent 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; font-size: 1.4rem; }
.im-info { display: grid; gap: 1px; font-size: .9rem; min-width: 0; }
.im-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-info .hint { margin: 2px 0 0; }
.im-down { color: var(--accent); font-weight: 600; }
.im-up { color: var(--danger); font-weight: 600; }
.error-text { color: var(--danger); }
.is-error, .is-working { grid-template-columns: 64px minmax(0, 1fr) !important; }
.spinner::after { content: ""; width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner::after { animation-duration: 3s; } }
@media (max-width: 480px) {
  .im-list li { grid-template-columns: 52px minmax(0, 1fr); }
  .im-list img, .im-thumb { width: 52px; height: 52px; }
  .im-list li .btn { grid-column: 1 / -1; }
}

/* Finance calculators: inputs and results side by side on wide screens */
:root { --fin-dep: #2a78d6; --fin-int: #eb6834; }
@media (prefers-color-scheme: dark) { :root { --fin-dep: #3987e5; --fin-int: #d95926; } }
.fin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 28px; align-items: start; }
.fin-assume { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 8px; font-size: .88rem; color: var(--muted); }
.fin-assume h3 { margin: 14px 0 6px; }
.fin-assume ul { margin: 0 0 8px; padding-left: 20px; }
.fin-assume li { margin-bottom: 3px; }
.fin-note { margin: 0; font-weight: 600; }
.fin-results { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.fin-sum { margin: 0; display: grid; gap: 10px; }
.fin-sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.fin-sum div:last-child { border-bottom: 0; padding-bottom: 0; }
.fin-sum dt { font-size: .9rem; color: var(--muted); }
.fin-sum dd { margin: 0; font-weight: 700; font-size: 1.1rem; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fin-sum .fin-main dd { font-size: 1.6rem; }
.fin-results .pc-how { margin-top: 10px; }
.fin-results .error { margin-top: 10px; }
@media (max-width: 760px) { .fin { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .fin-sum div { flex-direction: column; gap: 0; } .fin-sum dd { text-align: left; } }

/* Amount in words: the words large and easy to select */
.aw-words { margin: 0 0 6px; font-size: 1.25rem; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; user-select: all; }
.aw-digits { margin-bottom: 12px; font-variant-numeric: tabular-nums; }

.fin-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; padding: 0; font-size: .9rem; color: var(--muted); }
.fin-legend li { display: flex; align-items: center; gap: 6px; }
.fin-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fin-key--dep, .fin-dep { background: var(--fin-dep); fill: var(--fin-dep); }
.fin-key--int, .fin-int { background: var(--fin-int); fill: var(--fin-int); }
.fin-chart { position: relative; margin-bottom: 16px; }
.fin-chart svg { display: block; max-width: 100%; }
.fin-grid { stroke: var(--border); stroke-width: 1; }
.fin-axis { stroke: var(--muted); stroke-width: 1; }
.fin-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.fin-hit { fill: transparent; }
.fin-bar.is-on .fin-hit { fill: var(--accent-soft); fill-opacity: .5; }
.fin-tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 1px; padding: 8px 10px; font-size: .84rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .16); white-space: nowrap; }
.fin-table-wrap { overflow-x: auto; max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.fin-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.fin-table th, .fin-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fin-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-weight: 600; white-space: normal; vertical-align: bottom; }
.fin-table tbody th { font-weight: 600; color: var(--muted); }
@media (max-width: 480px) { .fin-table th, .fin-table td { padding: 5px; font-size: .78rem; } }
.fin-schedule details summary { cursor: pointer; font-weight: 600; padding: 8px 0; min-height: 44px; color: var(--accent); }
.fin-schedule .hint { margin: 10px 0 0; }
.fin-hub { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.fin-hub a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; height: 100%; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.fin-hub a:hover { border-color: var(--accent); }
.fin-hub .card-emoji { grid-row: span 2; font-size: 1.6rem; }
.fin-hub span:last-child { color: var(--muted); font-size: .9rem; }

/* Redesigned home page (home.html): a short intro per category and cards with one line on what each tool does */
.related--home { margin-top: 28px; }
.related--home h2 { margin-bottom: 4px; }
.cat-intro { color: var(--muted); margin: 0 0 12px; max-width: 70ch; }
.cards--home { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.cards--home a { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 2px 14px; height: 100%;
  padding: 14px 16px; border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.cards--home .card-emoji { grid-row: span 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--cat-soft); font-size: 1.6rem; line-height: 1; }
.cards--home .card-name { font-size: 1rem; align-self: end; }
/* One line per card (the rest is cut with "…" but stays in the HTML), so the categories read as a list of tools, not a wall of text */
.cards--home .card-line { color: var(--muted); font-weight: 400; font-size: .9rem; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards--home a { align-items: center; }
.cards--home a:hover { border-color: var(--cat); transform: translateY(-2px); }
.cards--home a:hover .card-name { color: var(--cat-ink); }
.cards--home a:focus-visible, .featured a:focus-visible { outline: 3px solid var(--cat); outline-offset: 2px; }

/* Each home category has its own colour: --cat (bars, borders), --cat-soft (tinted backgrounds), --cat-ink (text on the tint) */
.cat--calendars { --cat: #0b7a75; --cat-soft: #dcf2ef; --cat-ink: #075551; }
.cat--text { --cat: #2563eb; --cat-soft: #e3ecfd; --cat-ink: #1d4ab8; }
.cat--calculators { --cat: #d9600f; --cat-soft: #fdeadc; --cat-ink: #9a3d06; }
.cat--finance { --cat: #3f8a1c; --cat-soft: #e4f3d9; --cat-ink: #2c6512; }
.cat--images { --cat: #7655d6; --cat-soft: #ece7fc; --cat-ink: #5638b0; }
@media (prefers-color-scheme: dark) {
  .cat--calendars { --cat: #4fc4bb; --cat-soft: #173a37; --cat-ink: #8fe0d8; }
  .cat--text { --cat: #6f9cff; --cat-soft: #1c2b4a; --cat-ink: #a9c4ff; }
  .cat--calculators { --cat: #f5934f; --cat-soft: #3d2617; --cat-ink: #fbbd90; }
  .cat--finance { --cat: #84c95c; --cat-soft: #213619; --cat-ink: #b5e39a; }
  .cat--images { --cat: #a890f5; --cat-soft: #2a2347; --cat-ink: #cbbdfb; }
}
.related--home h2 { display: flex; align-items: center; gap: 10px; }
.related--home h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--cat); }

/* Featured strip: three large tinted tiles at the top of the home page, chosen by season (see FEATURED_JS in build.py) */
.featured { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.featured a { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 14px; height: 100%;
  padding: 16px 18px; border-radius: 16px; background: var(--cat-soft); color: var(--text); text-decoration: none;
  border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.featured a:hover { border-color: var(--cat); transform: translateY(-2px); }
.featured .card-emoji { grid-row: span 2; font-size: 2rem; line-height: 1; }
/* Featured tiles have colours of their own (not their category's), so a strip of three calendar tools is not all one colour */
.featured [data-k="christmas-countdown"] { --cat: #c62f2f; --cat-soft: #fbe4e1; --cat-ink: #9b1f1f; }
.featured [data-k="new-year-countdown"] { --cat: #5b4bd1; --cat-soft: #e9e6fc; --cat-ink: #3f31a8; }
.featured [data-k="school-holidays"] { --cat: #c98a06; --cat-soft: #fcf0d4; --cat-ink: #835800; }
.featured [data-k="working-days-calculator"] { --cat: #2563eb; --cat-soft: #e3ecfd; --cat-ink: #1d4ab8; }
.featured [data-k="countdown"] { --cat: #d9600f; --cat-soft: #fdeadc; --cat-ink: #9a3d06; }
@media (prefers-color-scheme: dark) {
  .featured [data-k="christmas-countdown"] { --cat: #f2786f; --cat-soft: #43201f; --cat-ink: #ffb3ab; }
  .featured [data-k="new-year-countdown"] { --cat: #9c8ff5; --cat-soft: #282347; --cat-ink: #c8bffb; }
  .featured [data-k="school-holidays"] { --cat: #e8b23c; --cat-soft: #3a2f12; --cat-ink: #f6d58a; }
  .featured [data-k="working-days-calculator"] { --cat: #6f9cff; --cat-soft: #1c2b4a; --cat-ink: #a9c4ff; }
  .featured [data-k="countdown"] { --cat: #f5934f; --cat-soft: #3d2617; --cat-ink: #fbbd90; }
}
.featured .card-name { font-weight: 700; font-size: 1.05rem; color: var(--cat-ink); align-self: end; }
.featured .card-line { color: var(--text); opacity: .8; font-size: .9rem; line-height: 1.45; align-self: start; }
/* Days left on the countdown tiles, filled in by FEATURED_JS */
.featured a { position: relative; }
.feat-count { grid-column: 3; grid-row: 1 / span 2; align-self: center; text-align: center; color: var(--cat-ink); line-height: 1; }
.feat-count b { display: block; font-size: 2rem; font-weight: 800; }
.feat-count small { display: block; font-size: .8rem; font-weight: 600; margin-top: 2px; }
.featured a:has(.feat-count:not([hidden])) { grid-template-columns: auto minmax(0, 1fr) auto; }

/* Home page header band: brand colour, white text, a few large emoji scattered on the right */
.hero { position: relative; overflow: hidden; margin: 8px 0 0; padding: 30px 28px 28px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #0b7a75 0%, #0f9a8a 55%, #2bb39a 100%); }
.hero h1 { position: relative; margin: 0 0 8px; color: #fff; max-width: 24ch; font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.hero .lead { position: relative; margin: 0; color: rgba(255, 255, 255, .92); max-width: 60ch !important; }
.hero-deco span { position: absolute; font-size: 2.6rem; opacity: .32; filter: saturate(.6); transform: rotate(var(--r)); line-height: 1; }
.hero-deco span:nth-child(1) { right: 4%; top: 12%; --r: -12deg; font-size: 3.4rem; }
.hero-deco span:nth-child(2) { right: 17%; top: 52%; --r: 10deg; }
.hero-deco span:nth-child(3) { right: 28%; top: 8%; --r: 24deg; font-size: 2rem; }
.hero-deco span:nth-child(4) { right: 9%; bottom: -6%; --r: -8deg; font-size: 3rem; }
.hero-deco span:nth-child(5) { right: 38%; bottom: 6%; --r: -18deg; font-size: 2rem; }
.hero-deco span:nth-child(6) { right: 24%; top: 30%; --r: 6deg; font-size: 1.6rem; opacity: .22; }
.hero-deco span:nth-child(7) { right: 1%; top: 58%; --r: 16deg; font-size: 1.8rem; }
.hero-deco span:nth-child(8) { right: 46%; top: 10%; --r: -6deg; font-size: 1.5rem; opacity: .2; }
@media (prefers-color-scheme: dark) {
  .hero { background: linear-gradient(135deg, #0a4f4b 0%, #0d6560 55%, #137a6d 100%); }
}
@media (max-width: 899px) { .hero-deco span:nth-child(n+5) { display: none; } .hero h1, .hero .lead { max-width: 75%; } }
@media (max-width: 639px) {
  .hero { padding: 22px 18px 20px; border-radius: 16px; }
  .hero h1, .hero .lead { max-width: none; }
  .hero-deco span { opacity: .18; }
  .hero-deco span:nth-child(n+3) { display: none; }
}

/* Phones: one short row per tile (icon and name only), so the strip does not fill the first screen */
@media (max-width: 639px) {
  .featured { gap: 8px; margin-top: 16px; }
  .featured a { padding: 10px 14px; border-radius: 12px; gap: 0 12px; }
  .featured .card-emoji { grid-row: auto; font-size: 1.5rem; }
  .featured .card-name { align-self: center; font-size: 1rem; }
  .featured .card-line { display: none; }
  .feat-count { grid-row: 1; display: flex; align-items: baseline; gap: 4px; }
  .feat-count b { font-size: 1.25rem; }
  .feat-count small { margin: 0; }
}
@media (min-width: 640px) {
  .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured li:first-child { grid-column: 1 / -1; }
}
@media (min-width: 980px) {
  .featured { grid-template-columns: 1.5fr 1fr 1fr; }
  .featured li:first-child { grid-column: auto; }
  .featured li:first-child a { grid-template-columns: 1fr; align-content: center; padding: 22px 24px; }
  .featured li:first-child .card-emoji { grid-row: auto; font-size: 2.8rem; margin-bottom: 8px; }
  .featured li:first-child .card-name { font-size: 1.3rem; }
  .featured li:first-child a:has(.feat-count:not([hidden])) { grid-template-columns: 1fr; }
  .featured li:first-child .feat-count { position: absolute; right: 24px; top: 22px; }
  .featured li:first-child .feat-count b { font-size: 3rem; }
}

/* Redesigned home (main.home-new): the text uses the full width of the card grid, so text and cards share the same edges.
   On wide screens the article (Why / How it works) and the FAQ split into two columns to keep lines a readable length. */
.home-new .lead, .home-new .cat-intro, .home-new .article p, .home-new .article li { max-width: none; }
.home-new .home-col + .home-col { margin-top: 18px; }
.home-new .faq-col:first-of-type details:last-child { border-bottom: 1px solid var(--border); }
@media (min-width: 900px) {
  .home-new .article { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
  .home-new .home-col + .home-col { margin-top: 0; }
  .home-new .faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-items: start; }
  .home-new .faq h2 { grid-column: 1 / -1; }
  .home-new .faq-col:first-of-type details:last-child { border-bottom: 0; }
}

/* Month calendar pages: previous / whole year / next, and the grid of the year's months */
.month-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 600; }
.month-nav > a { text-align: center; }
.month-nav > span:last-child { text-align: right; }
.month-nav a { text-decoration: none; white-space: nowrap; }
@media (max-width: 520px) { .month-nav { grid-template-columns: 1fr 1fr; } .month-nav > a { grid-column: 1 / -1; grid-row: 2; } }
.month-grid { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; max-width: 640px; }
.month-grid a { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; overflow-wrap: anywhere; }
.month-grid a:hover { border-color: var(--accent); }
.month-grid a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
@media (max-width: 520px) { .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.table-wrap { overflow-x: auto; }
.article table.month-others { max-width: none; }
.article table.month-others td { vertical-align: top; }
/* whole words only: these cells have room, and "anywhere" (the phone rule for article tables) split names like "Christmas" */
.article table.month-hol :is(td, th), .article table.month-others :is(td, th) { overflow-wrap: break-word; }
.article table.month-others td:last-child, .article table.month-others th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Working days calculator */
.wd-big-label { margin: 14px 0 0; color: var(--muted); font-size: .92rem; }
.wd-grid .dc-big { font-size: 1.8rem; margin-top: 0; }
.wd-holidays { list-style: none; margin: 4px 0 8px; padding: 0; font-size: .92rem; }
.wd-holidays li { padding: 5px 0; border-top: 1px solid var(--border); }
.wd-holidays li b { font-weight: 600; margin-right: 6px; }
.wd-holidays li.hint { border: 0; }
.wd-table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.wd-table caption { text-align: left; color: var(--muted); padding: 0 0 6px; }
.wd-table th, .wd-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); text-align: right; }
.wd-table th:first-child { text-align: left; }
.wd-table thead th { color: var(--muted); font-weight: 600; vertical-align: bottom; }
.wd-table tbody th { font-weight: 500; }
.wd-table tr.is-total th, .wd-table tr.is-total td { font-weight: 700; border-bottom: 0; }

/* Countdowns (christmas-countdown, new-year-countdown, countdown) */
.cd { position: relative; text-align: center; padding: 44px 16px 22px; }
.cd-bar { position: absolute; top: 10px; right: 10px; }
.cd-fs { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: .85rem; font-weight: 500; }
.cd-name { font-size: 1.15rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.cd-big { font-size: clamp(2.4rem, 12vw, 4.6rem); font-weight: 800; line-height: 1.08; margin: 4px 0 6px; color: var(--accent); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cd-big.is-msg { font-size: clamp(1.7rem, 7vw, 3rem); }
.cd-what { font-size: 1.12rem; font-weight: 600; margin: 0 0 18px; overflow-wrap: anywhere; }
.cd-what:empty { display: none; }
.cd-units { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 540px; margin: 0 auto 16px; }
.cd-units[hidden] { display: none; }
.cd-unit { background: var(--accent-soft); border-radius: 10px; padding: 10px 2px 8px; min-width: 0; }
.cd-num { display: block; font-size: clamp(1.5rem, 7vw, 2.5rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-lab { display: block; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.cd-when { color: var(--muted); font-size: .9rem; margin: 0 auto 6px; max-width: 60ch; }
.cd-alt { font-size: .95rem; margin: 0 0 4px; }
.cd-pick { justify-content: center; margin: 14px 0 0; }
.cd-pick[hidden] { display: none; }
.cd-brand { display: none; }
.cd-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: inherit; }
.cd-table th, .cd-table td { text-align: left; }
.cd:fullscreen, .cd.is-fullscreen { display: flex; flex-direction: column; justify-content: center; justify-content: safe center; border: 0; border-radius: 0; background: var(--bg); padding: 56px 20px 40px; }
.cd.is-fullscreen { position: fixed; inset: 0; z-index: 60; overflow-y: auto; }
.fs-lock, .fs-lock body { overflow: hidden; }
.cd:fullscreen .cd-bar, .cd.is-fullscreen .cd-bar { top: 14px; right: 16px; }
.cd:fullscreen .cd-name, .cd.is-fullscreen .cd-name { font-size: clamp(1.4rem, 4vw, 3rem); }
.cd:fullscreen .cd-big, .cd.is-fullscreen .cd-big { font-size: clamp(3.2rem, 15vw, 11rem); }
.cd:fullscreen .cd-big.is-msg, .cd.is-fullscreen .cd-big.is-msg { font-size: clamp(2.2rem, 8vw, 6rem); }
.cd:fullscreen .cd-what, .cd.is-fullscreen .cd-what { font-size: clamp(1.2rem, 3.6vw, 2.6rem); }
.cd:fullscreen .cd-units, .cd.is-fullscreen .cd-units { max-width: min(1100px, 100%); gap: clamp(8px, 1.6vw, 20px); }
.cd:fullscreen .cd-num, .cd.is-fullscreen .cd-num { font-size: clamp(2rem, 9vw, 7rem); }
.cd:fullscreen .cd-lab, .cd.is-fullscreen .cd-lab { font-size: clamp(.85rem, 1.8vw, 1.4rem); }
.cd:fullscreen .cd-when, .cd.is-fullscreen .cd-when { font-size: clamp(.9rem, 1.6vw, 1.2rem); }
.cd:fullscreen .cd-pick, .cd.is-fullscreen .cd-pick { display: none; }
.cd:fullscreen .cd-brand, .cd.is-fullscreen .cd-brand { display: block; position: absolute; bottom: 10px; right: 18px; margin: 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 400px) { .cd-units { gap: 5px; } .cd-lab { font-size: .7rem; } }

/* School holidays (/school-holidays/ hub and country pages; .sh-flag shows only on drafts with open items) */
:root { --sh-off: #f3c969; --sh-off-text: #3d2c00; --sh-we: #eef1f4; }
@media (prefers-color-scheme: dark) { :root { --sh-off: #8a6a1c; --sh-off-text: #fff4d6; --sh-we: #232a32; } }
.sh-flag { border: 2px dashed var(--danger); background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 8px 12px; font-weight: 600; margin: 0 0 14px; }
.sh-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
.sh-pick label { font-weight: 600; }
.sh-pick select { max-width: 100%; min-width: 0; font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.sh-breaks { width: 100%; border-collapse: collapse; margin: 0 0 8px; }
.sh-breaks th, .sh-breaks td { text-align: left; vertical-align: top; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.sh-breaks thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.sh-breaks tbody th { width: 34%; font-weight: 600; }
.sh-r { display: block; }
.sh-r + .sh-r { margin-top: 4px; }
.sh-back, .sh-breaks small { display: block; color: var(--muted); font-size: .88rem; }
.sh-r.is-off { opacity: .4; }
.sh-r.is-on { font-weight: 600; }
.sh-cal-h { font-size: 1.1rem; margin: 22px 0 10px; }
.sh-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 12px; }
.sh-cal table { width: 100%; border-collapse: collapse; font-size: .8rem; table-layout: fixed; }
.sh-cal caption { font-weight: 600; text-align: left; padding: 0 0 4px; font-size: .88rem; }
.sh-cal th { color: var(--muted); font-weight: 500; padding: 2px 0; }
.sh-cal td { text-align: center; padding: 3px 0; border-radius: 4px; }
.sh-cal td.we { background: var(--sh-we); }
.sh-cal td.off, .sh-cal td.rg.is-on { background: var(--sh-off); color: var(--sh-off-text); font-weight: 600; }
.sh-cal td.rg:not(.is-on) { background: repeating-linear-gradient(135deg, var(--sh-off) 0 3px, transparent 3px 6px); }
.sh-cal td.rg.is-off { background: transparent; }
.sh-cal td.rg.is-off.we { background: var(--sh-we); }
.sh-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 12px 0 0; font-size: .88rem; color: var(--muted); }
.sh-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--border); }
.sh-legend .sw.off { background: var(--sh-off); }
.sh-legend .sw.rg { background: repeating-linear-gradient(135deg, var(--sh-off) 0 3px, transparent 3px 6px); }
.sh-actions { margin: 16px 0 0; }
.sh-overview { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.sh-overview caption { text-align: left; font-weight: 600; padding: 0 0 8px; }
.sh-overview th, .sh-overview td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--border); }
.sh-overview thead th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.sh-overview th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.sh-groups td, .sh-groups th, .sh-next td, .sh-next th { vertical-align: top; text-align: left; }
@media print {
  .sh-pick, .sh-actions { display: none !important; }
  .sh-cal td, .sh-legend .sw { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sh-cal { grid-template-columns: repeat(4, 1fr); }
  .sh-cal table { break-inside: avoid; }
  .sh-overview { min-width: 0; }
}

/* Week number */
.wn-sys { max-width: 560px; margin: 0 0 16px; }
.wn-sys, .wn-grid, .wn-year { --wn-soft: #dcf2ef; --wn-ink: #075551; }
@media (prefers-color-scheme: dark) { .wn-sys, .wn-grid, .wn-year { --wn-soft: #173a37; --wn-ink: #8fe0d8; } }
.wn-now { background: var(--wn-soft); border-color: transparent; }
.wn-now .wn-big { color: var(--wn-ink); }
.wn-big { display: block; font-size: clamp(2.4rem, 8vw, 3.4rem); font-weight: 800; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.wn-range { margin: 4px 0 0; color: var(--muted); }
.wn-year { margin-top: 16px; }
.wn-caption { margin: 10px 0 6px; color: var(--muted); }
.wn-tables { display: grid; gap: 0 24px; }
@media (min-width: 640px) { .wn-tables { grid-template-columns: 1fr 1fr; } }
.wn-table th:first-child, .wn-table td:first-child { width: 4.5em; }
.wn-table tr.is-current th, .wn-table tr.is-current td { background: var(--wn-soft); color: var(--wn-ink); font-weight: 700; }
