:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #111319;
  color: #f2f2f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1440px; margin: auto; padding: clamp(16px, 4vw, 54px); }
header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 14px; }
h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 3rem); letter-spacing: -.045em; }
header p { margin: 6px 0 0; color: #bbc0ce; }
a { color: #ffd1c5; text-underline-offset: .2em; }
.overview { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin: 24px 0; padding: 14px 0; border-block: 1px solid #363a47; }
.remaining { display: flex; align-items: baseline; gap: .5rem; }
.remaining strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.legend span { font-size: .875rem; padding: 4px 8px; border-radius: 4px; }
.months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.month { background: #1a1d26; border: 1px solid #363a47; border-radius: 10px; overflow: hidden; }
h2 { font-size: 1.05rem; margin: 0; padding: 12px; }
.days, .weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { text-align: center; color: #c3c9d5; font-size: .875rem; background: #272b36; padding: 6px 0; }
.cell { min-height: 4rem; border-top: 1px solid #363a47; border-right: 1px solid #363a47; display: flex; flex-direction: column; gap: 2px; padding: 4px 2px; text-align: center; }
.cell:nth-child(7n) { border-right: 0; }
.cell b { font-size: .875rem; font-variant-numeric: tabular-nums; }
.cell span { font-size: .75rem; line-height: 1.2; border-radius: 3px; padding: 1px 0; overflow-wrap: anywhere; }
.first { background: #f29681; color: #251411; font-weight: 700; }
.second { background: #42447a; color: #f5f3ff; }
.blackout { background: #e0b364; color: #211a0e; font-weight: 700; }
.blocked { background: #322b20; }
.outside, .blank { background: #13151b; color: #888d9e; }
.panel { max-width: 580px; border: 1px solid #363a47; padding: 20px; border-radius: 10px; margin: 24px 0; background: #1a1d26; }
.panel h2 { padding: 0; }
form { display: grid; gap: 14px; margin: 18px 0; }
label { display: grid; gap: 5px; }
input, button { font: inherit; padding: 8px; border: 1px solid #73798c; border-radius: 5px; }
input { width: 100%; }
button { cursor: pointer; background: #f29681; color: #211411; border-color: #f29681; font-weight: 650; }
button[value="remove"] { background: #272b36; color: #f2f2f5; border-color: #73798c; }
.actions { display: flex; gap: 10px; }
.error { color: #ffb3a5; }
.saved { color: #a5e6ba; }
@media (max-width: 1020px) { .months { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .months { grid-template-columns: minmax(0, 1fr); } }

/* Calendar and seniority layout */
:root { background: #10151e; color: #edf1f7; }
main { max-width: 1480px; }
header { padding-bottom: 20px; border-bottom: 1px solid #323c4c; }
header a { background: #1b2534; padding: 9px 13px; border-radius: 8px; text-decoration: none; }
.overview { margin: 18px 0; padding: 14px 18px; border: 1px solid #384659; border-radius: 12px; background: #192332; }
.remaining strong { font-size: 2.4rem; color: #fff; }
.legend .first, .cell .first { background: #ffa78d; }
.legend .second, .cell .second { background: #484b86; }
.people { margin: 0 0 24px; padding: 16px; border: 1px solid #364152; border-radius: 12px; background: #161e2b; }
.seniority h2 { padding: 0; }
.seniority ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; padding-left: 0; list-style: none; counter-reset: seniority; }
.seniority li { counter-increment: seniority; padding: 9px; background: #233044; border-radius: 8px; }
.seniority li::before { content: counter(seniority) ". "; color: #c0c9d8; }
.seniority li span { display: block; margin-top: 3px; font-size: .875rem; color: #d3dbe9; }
.people summary { cursor: pointer; width: fit-content; color: #ffd1c5; }
.people details li + li { margin-top: 8px; }
.people details + details { margin-top: 10px; }
.seniority li .balance { display: block; margin: 4px 0 0; color: #ffd1c5; }
textarea { width: 100%; font: inherit; padding: 8px; }
.month { background: #171f2c; border-color: #364152; }
.month h2 { color: #f7f9fc; letter-spacing: .01em; }
.weekdays { background: #233044; }
.cell { border-color: #354153; min-height: 3.6rem; }
.cell.available { background: #192433; }
.cell.taken { background: #292836; }
.cell.blocked { background: #392f23; }
.holiday { color: #dbf7ff; background: #235265; }
.panel { max-width: 680px; }
.panel label select { font: inherit; padding: 8px; border: 1px solid #73798c; border-radius: 5px; }
fieldset { border: 1px solid #51596d; border-radius: 8px; min-width: 0; }
.date-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; }
form p { margin: 0; }
.seniority ol { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.seniority li span { display: inline; margin: 0 0 0 6px; }
.controls { display: flex; align-items: end; flex-wrap: wrap; gap: 12px 18px; margin: 0 0 16px; }
.controls select { font: inherit; padding: 6px; border-radius: 6px; }
.controls .toggle { display: flex; align-items: center; gap: 8px; }
.toggle input { width: auto; }
.month { scroll-margin-top: 16px; }
.available-only .cell.taken { opacity: .45; }
.updated { color: #c3c9d5; font-size: .875rem; }
.pick-calendar { margin: 18px 0; min-width: 0; }
.editor-layout { display: grid; gap: 20px; margin-top: 24px; }
.editor-layout .panel, .editor-layout .pick-calendar { margin: 0; }
.editor-layout .panel { max-width: none; }
.editor-layout .pick-calendar .months { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .editor-layout { grid-template-columns: minmax(325px, 390px) minmax(0, 1fr); align-items: start; }
  .editor-layout .pick-calendar .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 651px) and (max-width: 999px) {
  .editor-layout .pick-calendar .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pick-calendar summary { cursor: pointer; margin-bottom: 12px; }
.pick-calendar .cell button { padding: 0; width: 100%; color: inherit; background: transparent; border: 1px solid transparent; }
.pick-calendar .cell button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pick-calendar .cell button:hover { border-color: #ffa78d; }
.pick-calendar .cell button[aria-pressed="true"] { background: #ffa78d; color: #211411; }