/* DateSpan — shared styles. System font stack, no external requests. */
:root {
  --violet: #7048e8;
  --violet-600: #5f3dc4;
  --violet-700: #4c2fb0;
  --violet-tint: #f3f0fe;
  --violet-tint-2: #ece7fd;
  --bg: #ffffff;
  --bg-alt: #f7f8fb;
  --surface: #ffffff;
  --text: #191b25;
  --muted: #5b6072;
  --border: #e5e7ef;
  --ok: #1f9d6b;
  --warn: #b5580a;
  --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 8px 24px rgba(20, 22, 40, .06);
  --radius: 14px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --violet: #9d80ff;
    --violet-600: #b39dff;
    --violet-700: #c9baff;
    --violet-tint: #1e1c33;
    --violet-tint-2: #262247;
    --bg: #121319;
    --bg-alt: #171923;
    --surface: #1b1d28;
    --text: #e9eaf1;
    --muted: #a2a7b8;
    --border: #2a2d3b;
    --ok: #4ecb95;
    --warn: #e0975a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.22; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem); margin-top: 1.6em; }
h3 { font-size: 1.12rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
a { color: var(--violet-600); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 650; }
code, kbd { font-family: var(--mono); font-size: .92em; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 6px; padding: .05em .4em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Skip link */
.skip { position: absolute; left: -999px; top: 0; background: var(--violet); color: #fff;
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 200; }
.skip:focus { left: 0; }

/* Header / nav */
.site-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 10px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.12rem;
  color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: .93rem; font-weight: 500; padding: 8px 10px;
  border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-links a.active { color: var(--violet-600); background: var(--violet-tint); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: 9px; width: 44px; height: 40px; color: var(--text); cursor: pointer; align-items: center;
  justify-content: center; }
.nav-toggle svg { display: block; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { position: absolute; left: 0; right: 0; top: 62px; flex-direction: column;
    align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px; margin: 0; display: none; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 12px; font-size: 1rem; border-radius: 10px; }
}

/* Hero */
.hero { padding: 44px 0 8px; }
.hero .eyebrow { color: var(--violet-600); font-weight: 650; font-size: .82rem; letter-spacing: .06em;
  text-transform: uppercase; margin: 0 0 10px; }
.hero p.lede { font-size: 1.12rem; color: var(--muted); max-width: 640px; }

/* Tool card */
.tool { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 8px 0 4px; }
@media (min-width: 640px) { .tool { padding: 26px; } }
.field-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 640px) { .field-grid.three { grid-template-columns: repeat(3, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .82rem; }
input, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 12px; min-height: 46px; width: 100%;
}
input:focus, select:focus, .checkbox input:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--violet) 45%, transparent); outline-offset: 1px;
}
input[type="number"] { max-width: 100%; }
.checkbox { display: flex; align-items: center; gap: 10px; font-size: .95rem; min-height: 44px; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--violet); flex: none; }
.controls-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600;
  background: var(--violet); color: #fff; border: none; border-radius: 10px; padding: 11px 16px;
  min-height: 44px; cursor: pointer; }
.btn:hover { background: var(--violet-700); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--violet-600); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--bg-alt); }

/* Result panel */
.result { margin-top: 20px; border-top: 1px dashed var(--border); padding-top: 18px; }
.result[hidden] { display: none; }
.result-primary { font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 750;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-primary .sep { color: var(--violet); }
.result-sub { color: var(--muted); margin-top: 2px; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-top: 18px; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 1.32rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.callout { background: var(--violet-tint); border: 1px solid color-mix(in srgb, var(--violet) 25%, var(--border));
  border-radius: 12px; padding: 12px 15px; margin-top: 16px; font-size: .95rem; }
.callout.note { background: var(--bg-alt); border-color: var(--border); }
.error-msg { color: var(--warn); font-weight: 600; margin-top: 14px; }
.error-msg[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-size: .82rem; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 11px; color: var(--muted); }

/* Side-by-side comparison (week numbers) */
.compare { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 560px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .box { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--bg-alt); }
.compare .box h3 { margin: 0 0 6px; font-size: 1rem; }
.compare .big { font-size: 2.1rem; font-weight: 750; color: var(--violet); font-variant-numeric: tabular-nums; }

/* Holiday list */
.hol-list { list-style: none; padding: 0; margin: 10px 0 0; }
.hol-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: .92rem; }
.hol-list li:last-child { border-bottom: none; }
.hol-list .d { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Prose / content sections */
.prose { max-width: 760px; }
.prose h2 { padding-top: 6px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.prose thead th { border-bottom: 2px solid var(--border); }
.prose .table-wrap { overflow-x: auto; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 2px 16px; margin: 10px 0;
  background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 620; padding: 12px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--violet); font-weight: 700; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details p { padding-top: 10px; }

/* Related tools */
.related { margin: 40px 0 8px; }
.card-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .card-grid.g3 { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  background: var(--surface); color: var(--text); }
.card:hover { border-color: var(--violet); text-decoration: none; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Disclaimer */
.disclaimer { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border);
  padding-top: 16px; margin-top: 34px; }

/* Ad slots: zero height, no fake box */
.ad-slot { height: 0; overflow: hidden; margin: 0; }

/* Section spacing helpers */
section { scroll-margin-top: 76px; }
.sec { margin-top: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 54px; background: var(--bg-alt); }
.footer-inner { padding: 30px 0; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: baseline;
  justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); font-size: .92rem; }
.footer-note { color: var(--muted); font-size: .84rem; max-width: 420px; }
.footer-brand { font-weight: 700; color: var(--text); }

/* Utility */
.mt0 { margin-top: 0; }
.muted { color: var(--muted); }
.tabnum { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
