:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d7dde5;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --header: #fffdf9;
  --subtle: #f5f7f9;
  --soft-line: #edf0f3;
  --overlay-panel: rgba(255, 255, 255, 0.94);
  --today-bg: #dceaf0;
  --holiday-chip: #ffe1dd;
  --weekend: #e8edf3;
  --holiday: #f4b6ad;
  --holiday-ink: #8f1f13;
  --a: #8ecae6;
  --b: #b8d576;
  --c: #f4c46b;
  --today: #284b63;
  font-family: Arial, Helvetica, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf4;
  --muted: #a8b3c2;
  --line: #344154;
  --paper: #111820;
  --panel: #18222d;
  --header: #151f29;
  --subtle: #202b38;
  --soft-line: #263445;
  --overlay-panel: rgba(24, 34, 45, 0.94);
  --today-bg: #243d4d;
  --holiday-chip: #3f2527;
  --weekend: #253241;
  --holiday: #7f352f;
  --holiday-ink: #ffe1dd;
  --a: #347998;
  --b: #6f8f37;
  --c: #a46f22;
  --today: #8ecae6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(54px, 6vw, 76px) 12px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.toolbar,
.header-actions,
.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  text-decoration: none;
  font-weight: 700;
}

.button-muted {
  color: var(--muted);
  font-weight: 600;
}

.header-actions {
  justify-content: flex-end;
}

.side-arrow {
  position: fixed;
  top: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--overlay-panel);
  color: var(--ink);
  font-size: 52px;
  line-height: 1;
  text-decoration: none;
  transform: translateY(-50%);
}

.side-arrow-left {
  left: 8px;
}

.side-arrow-right {
  right: 8px;
}

.toolbar {
  padding: 10px clamp(54px, 6vw, 76px);
}

.toolbar label {
  font-weight: 700;
}

select {
  padding: 0 32px 0 10px;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 0 clamp(54px, 6vw, 76px) 18px;
}

.month {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: clip;
  background: var(--panel);
}

.month h2 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--subtle);
  font-size: 16px;
  text-transform: capitalize;
}

.days {
  display: flex;
  flex-direction: column;
}

.day {
  display: grid;
  grid-template-columns: 24px 30px minmax(0, 1fr);
  align-items: center;
  min-height: 23px;
  padding: 2px 5px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel);
  column-gap: 4px;
  font-size: 12px;
}

.day:last-child {
  border-bottom: 0;
}

.day.weekend {
  background: var(--weekend);
}

.day.holiday {
  background: linear-gradient(90deg, var(--holiday), var(--panel) 190%);
}

.day.today {
  position: relative;
  z-index: 1;
  border: 2px solid var(--today);
  background: var(--today-bg);
  box-shadow: 0 0 0 2px rgba(40, 75, 99, 0.18);
  font-weight: 700;
}

.date-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 19px;
  text-align: right;
  font-weight: 700;
}

.weekday-name {
  color: var(--muted);
  font-weight: 700;
}

.holiday .date-number {
  color: var(--holiday-ink);
}

.today .date-number {
  border-radius: 999px;
  background: var(--today);
  color: #fff;
}

.labels {
  display: flex;
  min-width: 0;
  gap: 2px;
  font-size: 10px;
  line-height: 1;
  justify-content: flex-end;
}

.label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.label.holiday {
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--holiday-chip);
  color: var(--holiday-ink);
  font-weight: 700;
}

.label.zone-a {
  background: var(--a);
}

.label.zone-b {
  background: var(--b);
}

.label.zone-c {
  background: var(--c);
}

body.hide-vacations .legend-vacation {
  display: none;
}

.legend {
  padding: 12px clamp(54px, 6vw, 76px) 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.legend a {
  color: var(--today);
  font-weight: 700;
}

.legend-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  vertical-align: -2px;
}

.legend-box.weekend {
  background: var(--weekend);
}

.legend-box.holiday {
  background: var(--holiday);
}

.legend-box.vacation-a {
  background: var(--a);
}

.legend-box.vacation-b {
  background: var(--b);
}

.legend-box.vacation-c {
  background: var(--c);
}

@media (max-width: 920px) {
  .calendar-grid {
    grid-template-columns: repeat(6, 150px);
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .side-arrow {
    width: 34px;
    height: 70px;
    font-size: 42px;
  }
}
