:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #10191a);
  --text: light-dark(#14302d, #e4eeec);
  --muted: light-dark(#4d6663, #9db3b0);
  --line: light-dark(#cfdcda, #2e4143);
  --top: light-dark(#0b6e63, #0c4a44);          /* the band with the next day off */
  --leave: light-dark(#0b6e63, #4cc7b5);
  --on-leave: light-dark(#ffffff, #08211e);
  --holiday: light-dark(#ffc94d, #e0a82e);
  --on-holiday: #33240a;
  --weekend: light-dark(#e6efed, #223234);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 system-ui, sans-serif; }
header { background: var(--top); color: #fff; padding: 28px max(20px, calc(50vw - 480px)) 32px; }
main, footer { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 1.1rem; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 14px; }
p { margin: 0 0 12px; max-width: 65ch; }
header p { margin: 0; }
.big { font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 10px; text-wrap: balance; }
section { padding-top: 36px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--holiday); outline-offset: 2px; }

/* the questions */
form, .row { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 24px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .above, legend { display: block; padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 0.95rem; }
.stepper, .choice { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 48px; height: 46px; border: 0; background: var(--weekend); font-size: 1.3rem; cursor: pointer; }
.stepper input { width: 64px; border: 0; background: none; text-align: center; font-weight: 700; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
select { height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.choice label { cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 10px 16px; }
.choice input:checked + span { background: var(--leave); color: var(--on-leave); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid var(--holiday); outline-offset: -3px; }
.stepper :focus-visible { outline-offset: -3px; }

/* the plan */
/* stays in view while choosing days */
#result { position: sticky; top: 0; z-index: 1; padding: 10px 0; background: var(--bg); }
#result p { margin: 0; }
#total { font-size: 1.2rem; font-weight: 700; }
.status:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions button { min-height: 48px; padding: 0 20px; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; }
.actions .main { background: var(--leave); border-color: var(--leave); color: var(--on-leave); font-weight: 600; }
.status { margin-top: 12px; overflow-wrap: anywhere; }
#mail-subject, #mail-body { display: block; width: 100%; max-width: 640px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
#mail-body { resize: vertical; field-sizing: content; min-height: 20rem; }   /* as tall as the text */
[hidden] { display: none !important; }

/* the calendar */
#actions { margin-top: 28px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0 0 20px; padding: 0; }
.legend li { display: flex; align-items: center; gap: 8px; }
.sample { width: 20px; height: 20px; border-radius: 6px; }
#calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); gap: 28px 32px; }
#calendar h3 { font-size: 1.05rem; margin: 0 0 6px; }
#calendar h3::first-letter, #holidays .when::first-letter { text-transform: uppercase; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; font-variant-numeric: tabular-nums; }
.days > * { display: grid; place-items: center; height: 42px; padding: 0; border: 0; border-radius: 8px; background: none; }
.days .head { height: 24px; color: var(--muted); font-size: 0.8rem; }
.days button { cursor: pointer; border: 1px solid var(--line); }
@media (hover: hover) {
  .days button:hover { border: 2px solid var(--leave); }
}
.days .suggested, .sample.suggested { border: 2px dashed var(--leave); }
.days .suggested { font-weight: 700; }
.days button.leave { border-color: var(--leave); }
/* Only the colour changes, nothing moves: so it looks the same for visitors who turned animations off in their system */
.untouched .suggested { animation: fill 1.8s ease-in-out infinite; }
@keyframes fill {
  50% { background: color-mix(in srgb, var(--leave) 45%, transparent); }
}
.weekend { background: var(--weekend) !important; }
.holiday { background: var(--holiday) !important; color: var(--on-holiday); font-weight: 700; }
.leave { background: var(--leave) !important; color: var(--on-leave); font-weight: 700; }
.days .today { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }

#holidays { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 40px; }
#holidays li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line); }
#holidays .when { display: block; }
#holidays .name { color: var(--muted); }
footer { margin-top: 40px; padding-top: 20px; padding-bottom: 32px; color: var(--muted); font-size: 0.92rem; }
