@font-face {
  font-family: "Univers LT Std";
  src: url("./assets/fonts/UniversLTStd-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Univers LT Std";
  src: url("./assets/fonts/UniversLTStd-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Glypha LT Std";
  src: url("./assets/fonts/GlyphaLTStd.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rail Alphabet";
  src: url("./assets/fonts/RailAlphabet2SIGNBETA-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --gwr-green: #053525;
  --gwr-green-soft: #dce9e4;
  --gwr-ink: #111816;
  --gwr-slate: #525761;
  --gwr-mist: #eef1ed;
  --gwr-cream: #f8f6ef;
  --gwr-line: #d9d6ce;
  --gwr-white: #ffffff;
  --gwr-focus: #f69143;
  --gwr-accent: #37aa32;
  --gwr-alert: #f64f5f;
  --gwr-yellow: #fadc64;
  --page-bg: #f3f0e8;
  --page-width: 78rem;
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-soft: none;
  --font-sans: "Univers LT Std", "Avenir Next", sans-serif;
  --font-display: "Glypha LT Std", Georgia, serif;
  --font-rail: "Rail Alphabet", "Univers LT Std", sans-serif;
}

:root[data-brand="gbr"] {
  --gwr-green: #14357b;
  --gwr-green-soft: #e5ecfa;
  --gwr-ink: #16203a;
  --gwr-slate: #446095;
  --gwr-mist: #eef2f9;
  --gwr-cream: #f5f8fd;
  --gwr-line: rgba(20, 53, 123, 0.18);
  --gwr-white: #ffffff;
  --gwr-focus: #d91d43;
  --gwr-accent: #d91d43;
  --gwr-alert: #d91d43;
  --gwr-yellow: #ffcd00;
  --page-bg: #f3f5f9;
  --font-sans: "Rail Alphabet", "Univers LT Std", sans-serif;
  --font-display: "Rail Alphabet", "Univers LT Std", sans-serif;
  --font-rail: "Rail Alphabet", "Univers LT Std", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--gwr-ink);
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--page-bg);
}

body.body--modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--gwr-line);
  border-radius: var(--radius-md);
  color: var(--gwr-ink);
  background: var(--gwr-white);
}

#depot-code {
  text-transform: uppercase;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.link-card:focus-visible {
  outline: 3px solid var(--gwr-focus);
  outline-offset: 3px;
}

.site-header {
  color: var(--gwr-white);
  background: var(--gwr-green);
}

.site-header__frame {
  display: grid;
  gap: 1.75rem;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 2.4rem;
}

.site-header__brand {
  display: block;
}

.site-header__eyebrow {
  margin: 0 0 0.35rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.site-header__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.site-header__copy {
  max-width: 44rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.page-shell {
  display: grid;
  gap: 1.25rem;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.5rem;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 22, 0.48);
}

.info-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: min(80vh, 44rem);
  overflow: auto;
  padding: 1.5rem;
}

.info-modal__close {
  position: sticky;
  top: 0;
  display: inline-flex;
  justify-self: end;
  margin-left: auto;
  margin-bottom: 1rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(82, 87, 97, 0.18);
  border-radius: 999px;
  color: var(--gwr-green);
  background: rgba(255, 255, 255, 0.98);
  font-weight: 700;
}

.hero,
.panel,
.status {
  border: 1px solid rgba(82, 87, 97, 0.18);
  border-radius: var(--radius-xl);
  background: var(--gwr-white);
  box-shadow: var(--shadow-soft);
}

.hero {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-self: stretch;
}

.hero__copy h2,
.panel__heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.hero__copy p,
.panel__intro {
  margin: 0;
  max-width: 42rem;
  line-height: 1.65;
  color: var(--gwr-slate);
}

.hero__disclaimer {
  margin-top: auto;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(246, 79, 95, 0.22);
  border-radius: var(--radius-md);
  color: #6f1e27;
  background: rgba(246, 79, 95, 0.1);
  font-size: 0.92rem;
  line-height: 1.55;
}

.hero__steps {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hero-steps;
}

.hero__steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(82, 87, 97, 0.1);
  border-radius: var(--radius-lg);
  background: var(--gwr-cream);
}

.hero__steps li::before {
  counter-increment: hero-steps;
  content: counter(hero-steps);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--gwr-white);
  background: var(--gwr-green);
  font-family: var(--font-rail);
  font-size: 0.9rem;
}

.section-eyebrow {
  margin: 0 0 0.45rem;
  color: var(--gwr-slate);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.panel {
  padding: 1.4rem;
}

.panel__heading {
  margin-bottom: 1rem;
}

.info-panel {
  display: grid;
  gap: 1rem;
}

.info-panel__list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--gwr-slate);
  line-height: 1.6;
}

.info-panel__note {
  margin: 1rem 0 0;
  color: var(--gwr-slate);
  line-height: 1.6;
}

.info-panel__actions {
  display: grid;
  gap: 0.75rem;
}

.info-panel__actions .button {
  width: 100%;
}

.upload-form,
.export-form {
  display: grid;
  gap: 1rem;
}

.upload-drop {
  display: grid;
  gap: 0.7rem;
  padding: 1.35rem;
  border: 1px solid rgba(82, 87, 97, 0.16);
  border-radius: var(--radius-lg);
  background: var(--gwr-cream);
}

.upload-drop__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.upload-drop__copy {
  margin: 0;
  color: var(--gwr-slate);
  line-height: 1.55;
}

.upload-drop__input {
  width: 100%;
  min-height: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--gwr-line);
  border-radius: var(--radius-md);
  background: var(--gwr-white);
  color: var(--gwr-ink);
}

.upload-drop__input::file-selector-button {
  margin-right: 0.85rem;
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: 999px;
  color: var(--gwr-white);
  background: var(--gwr-green);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.upload-drop__file-name {
  margin: 0;
  color: var(--gwr-slate);
  font-size: 0.92rem;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 3.25rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover {
  transform: none;
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.button--primary {
  color: var(--gwr-white);
  background: var(--gwr-green);
}

.button--primary:hover {
  background: #064330;
}

.button--secondary {
  border: 1px solid rgba(5, 53, 37, 0.16);
  color: var(--gwr-green);
  background: var(--gwr-white);
}

.button--secondary:hover {
  border-color: rgba(5, 53, 37, 0.28);
  background: var(--gwr-cream);
}

:root[data-brand="gbr"] .button--secondary {
  border-color: rgba(20, 53, 123, 0.18);
  color: var(--gwr-green);
}

:root[data-brand="gbr"] .button--secondary:hover {
  border-color: rgba(20, 53, 123, 0.28);
}

.links-grid {
  display: grid;
  gap: 0.9rem;
}

.link-card {
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(82, 87, 97, 0.16);
  border-radius: var(--radius-lg);
  text-align: left;
  color: inherit;
  background: var(--gwr-white);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.link-card:hover {
  border-color: rgba(5, 53, 37, 0.25);
  background: var(--gwr-cream);
}

:root[data-brand="gbr"] .link-card:hover {
  border-color: rgba(20, 53, 123, 0.25);
}

.link-card--active {
  border-color: var(--gwr-green);
  background: var(--gwr-green-soft);
}

.link-card__eyebrow {
  margin: 0 0 0.4rem;
  color: var(--gwr-slate);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.link-card__title {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.link-card__meta {
  margin: 0;
  color: var(--gwr-slate);
  line-height: 1.55;
}

.selection-summary {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(82, 87, 97, 0.12);
  border-radius: var(--radius-lg);
  background: var(--gwr-green-soft);
}

.selection-summary__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.selection-summary__copy {
  margin: 0;
  color: var(--gwr-slate);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field--compact {
  width: 100%;
}

.field--toggle {
  align-content: start;
}

.field__label {
  font-weight: 700;
}

.field__hint {
  color: var(--gwr-slate);
  font-size: 0.92rem;
  line-height: 1.5;
}

.toggle-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(82, 87, 97, 0.16);
  border-radius: var(--radius-md);
  background: var(--gwr-white);
}

.toggle-field input[type="checkbox"] {
  appearance: auto;
  width: 1.15rem;
  min-width: 1.15rem;
  min-height: 1.15rem;
  height: 1.15rem;
  margin: 0.18rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--gwr-green);
}

.toggle-field__body {
  line-height: 1.5;
}

.field--hidden,
.panel--hidden,
.status--hidden {
  display: none;
}

.preview-table-wrap {
  display: grid;
  gap: 1rem;
}

.preview-actions {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(82, 87, 97, 0.12);
}

.preview-actions__copy {
  margin: 0;
  color: var(--gwr-slate);
  line-height: 1.55;
}

.preview-actions__controls {
  display: grid;
  gap: 0.75rem;
}

.preview-actions__button {
  width: 100%;
}

.preview-weeks {
  display: grid;
  gap: 1rem;
}

.preview-week {
  border: 1px solid rgba(82, 87, 97, 0.16);
  border-radius: var(--radius-lg);
  background: var(--gwr-cream);
  overflow: hidden;
}

.preview-week__header {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(82, 87, 97, 0.12);
  background: rgba(5, 53, 37, 0.04);
}

.preview-week__eyebrow {
  margin: 0;
  font-family: var(--font-rail);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gwr-slate);
}

.preview-week__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.preview-week__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.preview-week__table th,
.preview-week__table td {
  padding: 0.8rem 0.7rem;
  border-bottom: 1px solid rgba(82, 87, 97, 0.12);
  text-align: left;
  vertical-align: top;
}

.preview-week__table tbody tr:last-child td {
  border-bottom: 0;
}

.preview-week__table th {
  font-family: var(--font-rail);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gwr-slate);
}

.preview-week__day-name,
.preview-week__day-date {
  display: block;
}

.preview-week__day-name {
  font-weight: 700;
}

.preview-week__day-date {
  margin-top: 0.18rem;
  color: var(--gwr-slate);
  font-size: 0.88rem;
}

.status {
  padding: 1rem 1.1rem;
  line-height: 1.6;
}

.page-footer {
  padding: 0 1.5rem 1.75rem;
}

.page-footer__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: var(--page-width);
  margin: 0 auto;
}

.page-footer__button {
  min-height: 2.85rem;
  padding: 0.7rem 1.05rem;
  border: 1px solid rgba(5, 53, 37, 0.16);
  border-radius: 999px;
  color: var(--gwr-green);
  background: var(--gwr-white);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.page-footer__button:hover,
.page-footer__button[aria-expanded="true"] {
  border-color: rgba(5, 53, 37, 0.28);
  background: var(--gwr-cream);
}

:root[data-brand="gbr"] .page-footer__button {
  border-color: rgba(20, 53, 123, 0.18);
  color: var(--gwr-green);
}

:root[data-brand="gbr"] .page-footer__button:hover,
:root[data-brand="gbr"] .page-footer__button[aria-expanded="true"] {
  border-color: rgba(20, 53, 123, 0.28);
}

.page-footer__button--nationalise {
  border-color: rgba(217, 29, 67, 0.2);
  color: var(--gwr-white);
  background: var(--gwr-alert);
}

.page-footer__button--nationalise:hover,
.page-footer__button--nationalise[aria-expanded="true"],
.page-footer__button--nationalise[aria-pressed="true"] {
  border-color: rgba(217, 29, 67, 0.3);
  background: #bf1639;
}

:root[data-brand="gbr"] .page-footer__button--nationalise {
  border-color: rgba(20, 53, 123, 0.22);
  background: var(--gwr-green);
}

:root[data-brand="gbr"] .page-footer__button--nationalise:hover,
:root[data-brand="gbr"] .page-footer__button--nationalise[aria-expanded="true"],
:root[data-brand="gbr"] .page-footer__button--nationalise[aria-pressed="true"] {
  border-color: rgba(20, 53, 123, 0.32);
  background: #102c68;
}

.page-footer__signature {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--gwr-slate);
  font-size: 0.92rem;
  line-height: 1.5;
}

.status--loading {
  border-color: rgba(246, 145, 67, 0.25);
  background: rgba(246, 145, 67, 0.12);
}

.status--success {
  border-color: rgba(55, 170, 50, 0.24);
  background: rgba(55, 170, 50, 0.12);
}

.status--error {
  border-color: rgba(246, 79, 95, 0.28);
  background: rgba(246, 79, 95, 0.12);
}

@media (min-width: 760px) {
  .site-header__frame {
    grid-template-columns: 1.3fr 1fr;
    align-items: end;
  }

  .hero {
    grid-template-columns: 1.2fr 0.9fr;
    align-items: start;
  }

  .links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--compact {
    max-width: 23rem;
    justify-self: start;
  }

  .preview-actions__button {
    width: auto;
    min-width: 15rem;
    justify-self: start;
  }

  .preview-actions__controls {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
  }

  .preview-weeks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .info-panel__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .links-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
