.rota-page {
  --rota-off: #a7e2f5;
  --rota-book: #ff735c;
  --rota-work: #f7fbfc;
  --rota-holiday: #ffd45c;
  background:
    linear-gradient(90deg, transparent 0 calc(50% - 590px), rgba(10, 42, 53, 0.045) calc(50% - 590px) calc(50% - 589px), transparent calc(50% - 589px) calc(50% + 589px), rgba(10, 42, 53, 0.045) calc(50% + 589px) calc(50% + 590px), transparent calc(50% + 590px)),
    var(--paper);
}

.rota-page .site-header {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}

.rota-breadcrumb {
  display: flex;
  width: min(1180px, calc(100% - 2.5rem));
  margin: 1.2rem auto 0;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rota-breadcrumb a:hover {
  color: var(--coral-dark);
}

.rota-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
  min-height: 630px;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.rota-page .rota-hero h1 {
  max-width: 770px;
  margin-bottom: 1.5rem;
  font-size: clamp(3.45rem, 7.2vw, 6.9rem);
}

.rota-hero-lede {
  max-width: 640px;
  margin-bottom: 2rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.rota-cta {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.rota-cta span {
  color: var(--coral);
  font-size: 1.3rem;
}

.shift-ticket {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 15px 15px 0 var(--rota-off);
}

.shift-ticket::before,
.shift-ticket::after {
  position: absolute;
  left: -9px;
  width: 17px;
  height: 17px;
  background: var(--paper);
  border-radius: 50%;
  content: "";
}

.shift-ticket::before { top: 30%; }
.shift-ticket::after { top: 68%; }

.shift-ticket-heading,
.shift-ticket-labels,
.shift-ticket-total {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  text-transform: uppercase;
}

.shift-ticket-heading {
  margin-bottom: 2rem;
  color: var(--rota-off);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.cycle-rail {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3px;
}

.cycle-rail.is-six-on-four {
  grid-template-columns: repeat(14, minmax(0, 1fr));
}

.cycle-rail span {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(0.68rem, 1.5vw, 1rem);
  font-weight: 900;
}

.cycle-rail .is-off { background: var(--rota-off); }
.cycle-rail .is-book { color: var(--ink); background: var(--rota-book); }

.shift-ticket-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.65rem;
  color: #a9bbc1;
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.shift-ticket-total {
  align-items: baseline;
  margin: 2.4rem 0 0;
  padding-top: 1.2rem;
  border-top: 2px solid var(--white);
  font-size: 0.68rem;
}

.shift-ticket-total strong {
  color: var(--rota-holiday);
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.rota-planner-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.66fr) minmax(0, 1.34fr);
  gap: clamp(2rem, 7vw, 7rem);
  padding-block: clamp(5rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}

.rota-planner-intro h2,
.rota-explainer h2,
.worked-example h2,
.rota-caveat h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.7rem, 5.5vw, 5rem);
  font-weight: 830;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.rota-planner-intro p:last-child,
.rota-explainer-copy,
.worked-example-copy > p:last-child,
.rota-caveat > div:last-child {
  color: var(--ink-soft);
}

.rota-form {
  padding: clamp(1.4rem, 3vw, 2.6rem);
  background: var(--white);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--muted);
}

.rota-field-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr;
  gap: 1rem;
}

.rota-field {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  font-weight: 750;
}

.rota-field input {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0.8rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
}

.rota-field small,
.bank-mode-options small {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
}

.rota-fieldset {
  margin: 2rem 0 0;
  padding: 0;
  border: 0;
}

.rota-fieldset legend {
  margin-bottom: 0.8rem;
  font-weight: 800;
}

.rota-options,
.bank-mode-options {
  display: grid;
  gap: 0.55rem;
}

.rota-options { grid-template-columns: repeat(3, 1fr); }
.bank-mode-options { grid-template-columns: repeat(2, 1fr); }

.rota-options label,
.bank-mode-options label {
  position: relative;
  cursor: pointer;
}

.rota-options input,
.bank-mode-options input {
  position: absolute;
  opacity: 0;
}

.rota-options span,
.bank-mode-options > label > span {
  display: grid;
  min-height: 100%;
  padding: 0.85rem;
  align-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
}

.bank-mode-options > label > span { gap: 0.2rem; }

.rota-options input:checked + span,
.bank-mode-options input:checked + span {
  background: var(--sky);
  border-color: var(--ink);
  box-shadow: inset 5px 0 0 var(--coral);
}

.rota-options input:focus-visible + span,
.bank-mode-options input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.rota-form .primary-button {
  margin-top: 2rem;
}

.rota-form-note {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.rota-results {
  padding-block: clamp(5rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}

.rota-results-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

.rota-results-heading h2 {
  max-width: 840px;
  margin-bottom: 0.8rem;
  font-size: clamp(2.8rem, 6vw, 5.7rem);
  font-weight: 840;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.rota-results-heading p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.rota-score {
  display: grid;
  min-width: 210px;
  padding: 1.2rem;
  color: var(--white);
  background: var(--ink);
  font-family: var(--mono);
  text-transform: uppercase;
}

.rota-score span,
.rota-score small { color: var(--rota-off); font-size: 0.62rem; }
.rota-score strong { margin-block: 0.3rem; color: var(--rota-holiday); font-family: var(--display); font-size: 3rem; }

.rota-year-wrap {
  padding: clamp(1rem, 2.5vw, 2rem);
  background: var(--white);
  border: 1px solid var(--ink);
}

.rota-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rota-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.rota-legend i { width: 0.75rem; height: 0.75rem; border: 1px solid var(--ink); }
.legend-leave { background: var(--rota-book); }
.legend-off { background: var(--rota-off); }
.legend-holiday { background: var(--rota-holiday); }
.legend-work { background: var(--rota-work); }

.rota-year {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.rota-month {
  min-width: 0;
  padding-top: 0.8rem;
  border-top: 2px solid var(--ink);
}

.rota-month-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rota-weekdays,
.rota-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.rota-weekdays {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.55rem;
  text-align: center;
}

.rota-day {
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  color: var(--ink);
  background: var(--rota-work);
  border: 1px solid var(--muted);
  font-family: var(--mono);
  font-size: clamp(0.55rem, 1vw, 0.7rem);
  font-weight: 700;
}

.rota-day.is-placeholder { visibility: hidden; }
.rota-day.is-rostered-off { background: var(--rota-off); border-color: var(--rota-off); }
.rota-day.is-observed-holiday { background: var(--rota-holiday); border-color: var(--rota-holiday); }
.rota-day.is-leave { color: var(--ink); background: var(--rota-book); border-color: var(--coral-dark); box-shadow: inset 0 0 0 1px var(--ink); }

.rota-day-number {
  display: block;
  line-height: 1;
}

.rota-break-list {
  display: grid;
  gap: 0;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.rota-break-item {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.rota-break-item > div { display: grid; gap: 0.25rem; }
.rota-break-item span { color: var(--ink-soft); font-size: 0.82rem; }
.rota-break-metric { text-align: right; }
.rota-break-metric strong { color: var(--coral-dark); font-family: var(--display); font-size: 1.55rem; text-transform: uppercase; }

.rota-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.rota-result-note { display: flex; gap: 0.7rem; margin-top: 1.5rem; color: var(--ink-soft); }
.rota-result-note strong { color: var(--ink); }

.rota-explainer,
.rota-caveat {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(2rem, 8vw, 8rem);
  padding-block: clamp(5rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
}

.rota-explainer-copy {
  align-self: end;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
}

.rota-explainer-copy > p:first-child strong,
.rota-two-two-four summary {
  color: var(--ink);
}

.two-two-four-rail {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  margin: 1.8rem 0;
  padding: 0;
  color: var(--ink);
  list-style: none;
}

.two-two-four-rail li {
  display: grid;
  min-width: 0;
  aspect-ratio: 0.82;
  padding: 0.65rem 0.35rem;
  place-content: center;
  gap: 0.25rem;
  text-align: center;
  border: 1px solid var(--ink);
}

.two-two-four-rail .is-day { background: var(--rota-holiday); }
.two-two-four-rail .is-night { color: var(--white); background: var(--ink); }
.two-two-four-rail .is-off { background: var(--rota-off); }

.two-two-four-rail strong {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1;
}

.two-two-four-rail span {
  font-family: var(--mono);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.rota-two-two-four details {
  margin-top: 0.7rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.rota-two-two-four summary {
  cursor: pointer;
  font-weight: 800;
}

.rota-two-two-four details p,
.rota-source-note {
  font-size: 0.86rem;
}

.rota-source-note {
  margin-top: 1.4rem;
  padding: 1rem;
  color: var(--ink-soft);
  background: var(--muted);
  border-left: 4px solid var(--coral);
}

.worked-example {
  padding-block: clamp(5rem, 9vw, 8rem);
  border-top: 1px solid var(--line);
}

.worked-example-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
}

.worked-cycle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 3rem 0 1.5rem;
  padding: 0;
  color: var(--ink);
  list-style: none;
  border: 1px solid var(--ink);
}

.worked-cycle li {
  display: grid;
  min-height: 190px;
  padding: clamp(1rem, 3vw, 2rem);
  align-content: space-between;
  background: var(--rota-off);
  border-right: 1px solid var(--ink);
}

.worked-cycle li:last-child { border: 0; }
.worked-cycle li.is-book { color: var(--ink); background: var(--rota-book); }
.worked-cycle span,
.worked-cycle small { font-family: var(--mono); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; }
.worked-cycle strong { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1; text-transform: uppercase; }
.worked-result { max-width: 820px; color: var(--ink-soft); }
.worked-result strong { color: var(--ink); }

.rota-caveat {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
  margin-bottom: clamp(3rem, 6vw, 6rem);
  padding-inline: clamp(1.2rem, 3vw, 2.5rem);
  color: var(--white);
  background: var(--ink);
  border: 0;
}

.rota-caveat .section-kicker,
.rota-caveat a { color: var(--rota-off); }
.rota-caveat > div:last-child { align-self: end; color: #d5e1e5; }

@media (max-width: 900px) {
  .rota-hero,
  .rota-planner-shell,
  .rota-explainer,
  .rota-caveat,
  .worked-example-copy {
    grid-template-columns: 1fr;
  }

  .rota-hero { min-height: auto; }
  .shift-ticket { max-width: 620px; }
  .rota-field-grid { grid-template-columns: 1fr 1fr; }
  .rota-field:first-child { grid-column: 1 / -1; }
  .rota-year { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .rota-page .site-header nav a:nth-child(2) { display: none; }
  .rota-breadcrumb,
  .site-header,
  .site-footer,
  .rota-page main > section,
  .rota-page main > aside { width: min(100% - 1.25rem, 1180px); }
  .rota-page .rota-hero h1 { font-size: clamp(3rem, 16vw, 4.6rem); }
  .cycle-rail { gap: 2px; }
  .shift-ticket { box-shadow: 8px 8px 0 var(--rota-off); }
  .rota-field-grid,
  .rota-options,
  .bank-mode-options,
  .rota-year,
  .worked-cycle { grid-template-columns: 1fr; }
  .rota-field:first-child { grid-column: auto; }
  .rota-results-heading { grid-template-columns: 1fr; }
  .rota-score { width: 100%; }
  .rota-break-item { grid-template-columns: 1fr; gap: 0.7rem; }
  .rota-break-metric { text-align: left; }
  .worked-cycle li { min-height: 145px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .two-two-four-rail { grid-template-columns: repeat(4, 1fr); }
  .rota-result-note { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .rota-page { scroll-behavior: auto; }
}
