/* Lamba Weekend: calm teal and marigold, system fonts, mobile first. */
:root {
  --bg: #f8f5ee;
  --surface: #ffffff;
  --ink: #17232d;
  --muted: #4a5662;
  --line: #d9dfe3;
  --brand: #0f5c6e;
  --brand-dark: #0a3c48;
  --brand-soft: #e2eef1;
  --sun: #f2a71b;
  --hol: #f6c453;
  --hol-soft: #fde9b8;
  --mine: #f3b8a0;
  --wk: #e1e9ee;
  --rh: #6a4fb3;
  --leave: #bfe8d2;
  --leave-line: #1d7a4f;
  --focus: #b4410c;
  --warn-bg: #fff1c9;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute must win over display rules such as .controls .row { display: grid }. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code { font-size: 0.92em; background: var(--brand-soft); padding: 0.05em 0.35em; border-radius: 4px; word-break: break-all; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.no-js .js-only { display: none !important; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; color: #fff; }

/* Header */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.2rem; min-height: 44px; }
.brand img { display: block; }
.brand-name { letter-spacing: -0.01em; }
nav ul { list-style: none; margin: 0; padding: 0; }
.nav-wide { display: none; }
.nav-wide a, .nav-drop a { display: flex; align-items: center; min-height: 44px; padding: 0 10px; text-decoration: none; color: var(--ink); border-radius: 8px; font-weight: 550; }
.nav-wide a[aria-current="page"], .nav-drop a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.nav-wide a:hover, .nav-drop a:hover { background: var(--brand-soft); }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; min-height: 44px; min-width: 44px; display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 650; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; width: 8px; height: 8px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.nav-menu[open] summary { background: var(--brand-soft); }
.nav-drop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(10, 40, 50, 0.12); padding: 6px; min-width: 220px; z-index: 5; }
@media (min-width: 900px) {
  .nav-wide { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav-menu { display: none; }
}

.stale { background: var(--warn-bg); border-bottom: 1px solid #e6c870; padding: 12px 16px; text-align: center; }

/* Type */
main { padding-top: 8px; padding-bottom: 48px; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 6vw, 2.5rem); margin: 0.6em 0 0.3em; }
h2 { font-size: clamp(1.3rem, 4vw, 1.6rem); margin: 1.8em 0 0.5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 0.4em; }
h4 { font-size: 1.05rem; margin: 1.2em 0 0.4em; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; margin-top: 0; }
.hero { padding: 4px 0 4px; }
.help { color: var(--muted); font-size: 0.95rem; }
.notice { background: var(--surface); border-left: 4px solid var(--sun); padding: 12px 14px; border-radius: 8px; }
p, li { max-width: 72ch; }

/* Controls */
.controls { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 8px 0 12px; display: grid; gap: 10px; }
.controls .row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .controls .row { grid-template-columns: 1fr 1fr; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; font-size: 0.95rem; margin-bottom: 6px; padding: 0; }
.field { display: grid; gap: 4px; font-weight: 650; font-size: 0.95rem; }
select, input[type="number"], input[type="date"], input[type="text"] {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  min-height: 44px; width: 100%; padding: 8px 10px; border: 1px solid #8a969f; border-radius: 8px;
}
input[aria-invalid="true"] { border-color: #b3261e; box-shadow: 0 0 0 1px #b3261e; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg legend { width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid #8a969f; border-radius: 999px; background: #fff; font-weight: 600; }
.seg input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { color: var(--muted); border-style: dashed; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.checks { display: grid; gap: 2px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 18px; }
@media (min-width: 720px) { .check-list { grid-template-columns: 1fr 1fr; } }
.check input:disabled + span { color: var(--muted); }
.mine-count, .form-msg { margin: 0; color: var(--muted); font-size: 0.95rem; }
.form-msg:empty { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; margin: 4px 6px 4px 0; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--brand); }
.btn-quiet:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 0.95rem; }

/* Results */
.summary { font-weight: 650; font-size: 1.05rem; background: var(--brand-soft); border-radius: 10px; padding: 10px 14px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-width: none; }
.card p { margin: 0.25em 0; }
.card .len { font-size: 1.05rem; }
.card .len strong { font-size: 1.5rem; color: var(--brand); }
.card .range { font-weight: 650; }
.card .why { color: var(--muted); font-size: 0.95rem; }
.card .leave { font-size: 0.95rem; }
.card .leave.none { color: var(--leave-line); font-weight: 600; }
.card .rh-hint { font-size: 0.9rem; color: #4b3a86; }
.card .note, .card .rank { font-size: 0.85rem; color: var(--muted); text-transform: none; }
.card .rank { font-weight: 700; color: var(--brand); }
.card.is-past { border-style: dashed; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; }
.strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0 4px; }
.sq { width: 14px; height: 14px; border-radius: 4px; background: #eef1f3; border: 1px solid #c3ccd2; }
.sq-wk { background: var(--wk); border-color: #9fb2bd; }
.sq-hol { background: var(--sun); border-color: #b97a08; }
.sq-leave { background: var(--leave); border-color: var(--leave-line); }
.plan-total { font-weight: 650; }
.plain-list { padding-left: 1.2em; }
.plain-list li { margin: 0.3em 0; }
.plain-list li.is-past { color: var(--muted); }

/* Link cards */
.link-cards { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.link-cards a { display: grid; gap: 4px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.link-cards a strong { color: var(--brand); }
.link-cards a span { color: var(--muted); font-size: 0.95rem; }
.link-cards a:hover { border-color: var(--brand); }

/* Tables */
.table-wrap { max-width: 100%; }
.hol-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hol-table caption { text-align: left; font-weight: 650; padding: 8px 0; caption-side: top; }
.hol-table th, .hol-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hol-table thead th { background: var(--brand-soft); font-size: 0.92rem; }
.tag { display: inline-block; font-size: 0.8rem; background: var(--hol-soft); color: #5d3d00; border-radius: 6px; padding: 0 6px; margin-left: 4px; }
@media (max-width: 560px) {
  .hol-table thead { display: none; }
  .hol-table tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .hol-table td { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; border: 0; padding: 3px 12px; }
  .hol-table td::before { content: attr(data-label); font-weight: 650; color: var(--muted); font-size: 0.9rem; }
}

.om-card { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: var(--radius); padding: 10px 16px; margin: 12px 0; }
.om-card p { margin: 0.35em 0; }
.cite { font-size: 0.9rem; color: var(--muted); }
.facts { padding-left: 1.2em; }
.cols { columns: 1; padding-left: 1.2em; }
@media (min-width: 720px) { .cols { columns: 2; column-gap: 32px; } }
.example { background: var(--surface); border-left: 4px solid var(--sun); padding: 10px 14px; border-radius: 8px; }
.pattern-block { border-top: 2px solid var(--line); margin-top: 24px; }
.log { padding-left: 1.2em; }

/* Calendar */
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.92rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
/* Legend keys are sample calendar cells: same colour and same non-colour marker. */
.key { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 26px; border-radius: 6px; border: 1px solid transparent; background: #fff; color: var(--ink); font-size: 0.8rem; line-height: 1; }
.k-gaz { background: var(--hol); font-weight: 700; }
.k-gaz .dn { text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.k-mine { background: var(--mine); font-weight: 700; outline: 2px dotted #a5482a; outline-offset: -3px; }
.k-wk { background: var(--wk); box-shadow: inset 0 0 0 1px #7d8f99; }
.k-rh { background: #fff; border: 2px dashed var(--rh); }
.k-lv { background: var(--leave); border: 2px solid var(--leave-line); }
.months { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.month { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.month caption { text-align: left; font-weight: 700; padding: 4px 2px 6px; }
.month th { font-size: 0.78rem; color: var(--muted); font-weight: 650; padding: 2px 0; }
.month td { height: 36px; text-align: center; font-size: 0.92rem; border-radius: 7px; border: 1px solid transparent; padding: 0; }
.month td.blank { background: transparent; }
/* Each kind of day has a marker besides its colour (WCAG 1.4.1): weekly off a
   thin ring (#7d8f99, 3.35:1 on white), central holiday an underlined number,
   own holiday a dotted outline, restricted option a dashed border, leave a solid border. */
.month td.wk { background: var(--wk); box-shadow: inset 0 0 0 1px #7d8f99; }
.month td.gaz { background: var(--hol); font-weight: 700; }
.month td.gaz .dn { text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.month td.mine { background: var(--mine); font-weight: 700; outline: 2px dotted #a5482a; outline-offset: -3px; }
.month td.rh { border: 2px dashed var(--rh); }
.month td.lv { background: var(--leave); border: 2px solid var(--leave-line); }
.month td.out { color: #66727c; background: transparent; border-color: transparent; font-weight: 400; box-shadow: none; outline: none; }
.month td.out .dn { text-decoration: none; }
/* Grey past dates only on plain cells; coloured cells keep --ink for contrast. */
.month td.past:not(.gaz):not(.mine):not(.wk):not(.lv) { color: #5f6b75; }
.month td.today { box-shadow: inset 0 0 0 2px var(--ink); }

/* Footer */
.site-foot { background: var(--brand-dark); color: #e7f0f2; padding: 24px 0 32px; font-size: 0.95rem; }
.site-foot a { color: #ffffff; }
.foot-links { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 4px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px 0 0; }
.site-foot :focus-visible { outline-color: #ffd27a; } /* 8.42:1 on --brand-dark */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-head, .site-foot, .controls, .js-only { display: none !important; }
  body { background: #fff; }
}
