:root {
  --ink: #152a36;
  --muted: #61717a;
  --surface: #ffffff;
  --page: #eef3f1;
  --border: #d9e3df;
  --early-one: #e9b949;
  --early-two: #56ae92;
  --late: #668ccf;
  --free: #dbe3e5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(150deg, #dcebe7 0%, var(--page) 45%, #f7f4ed 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, select { font: inherit; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 52px; }
.page-header { margin-bottom: 24px; }
.eyebrow, .section-label { margin: 0 0 6px; color: #3c7567; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; }
.intro { margin: 8px 0 0; color: var(--muted); font-size: 1.05rem; }

.today-card, .calendar-card { background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.75); border-radius: 20px; box-shadow: 0 12px 36px rgba(35, 61, 60, .1); }
.today-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; margin-bottom: 18px; }
.today-date { margin: 0; font-weight: 700; }
.today-shift { min-width: 205px; padding: 10px 14px; border-radius: 12px; border-left: 5px solid var(--free); background: #f1f4f4; }
.today-shift strong, .today-shift span { display: block; }
.today-shift span { margin-top: 2px; color: #3e525b; font-size: .9rem; }
.today-shift.early-one { border-color: var(--early-one); background: #fff8e8; }
.today-shift.early-two { border-color: var(--early-two); background: #edf8f4; }
.today-shift.late { border-color: var(--late); background: #eff4ff; }

.calendar-card { padding: 18px; }
.calendar-controls { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; }
.month-selection { display: flex; gap: 8px; }
.nav-button, .today-button, select { min-height: 40px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
.nav-button { width: 40px; font-size: 1.25rem; }
.today-button { padding: 0 14px; margin-left: 4px; }
select { padding: 0 28px 0 10px; }
.nav-button:hover, .today-button:hover, select:hover { border-color: #78a99c; }

.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.weekday-row { margin: 0 2px 7px; color: var(--muted); font-size: .78rem; font-weight: 800; text-align: right; }
.calendar-day { min-height: 124px; padding: 10px; border: 1px solid var(--border); border-top: 5px solid var(--free); border-radius: 12px; background: #f9fbfb; }
.calendar-day.early-one { border-top-color: var(--early-one); background: #fffaf0; }
.calendar-day.early-two { border-top-color: var(--early-two); background: #f2faf7; }
.calendar-day.late { border-top-color: var(--late); background: #f2f6ff; }
.calendar-day.outside-month { opacity: .42; }
.calendar-day.is-today { outline: 3px solid #173d4f; outline-offset: 1px; }
.day-number { margin-bottom: 12px; font-weight: 850; text-align: right; }
.shift-detail strong, .shift-detail span { display: block; }
.shift-detail strong { font-size: clamp(.72rem, 1.35vw, .95rem); line-height: 1.2; }
.shift-detail span { margin-top: 5px; color: #40565f; font-size: .85rem; font-variant-numeric: tabular-nums; }

.legend { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 18px 4px 0; color: #41535c; font-size: .88rem; }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--free); }
.legend-dot.early-one { background: var(--early-one); }.legend-dot.early-two { background: var(--early-two); }.legend-dot.late { background: var(--late); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 18px, 600px); padding-top: 25px; }
  .today-card { align-items: flex-start; flex-direction: column; }
  .today-shift { width: 100%; }
  .calendar-card { padding: 9px; }
  .calendar-controls { flex-wrap: wrap; }
  .today-button { margin-left: 0; }
  .weekday-row, .calendar-grid { gap: 3px; }
  .weekday-row { font-size: .66rem; }
  .calendar-day { min-height: 90px; padding: 6px 4px; border-radius: 8px; }
  .day-number { margin-bottom: 7px; font-size: .8rem; }
  .shift-detail strong { font-size: .62rem; overflow-wrap: anywhere; }
  .shift-detail span { margin-top: 3px; font-size: .64rem; line-height: 1.15; }
}

@media (max-width: 400px) {
  .month-selection { width: 100%; }
  .month-selection select { width: 50%; }
  .calendar-day { min-height: 76px; }
  .shift-detail strong { font-size: .56rem; }
  .shift-detail span { font-size: .56rem; }
}
