:root {
  color-scheme: light;
  --ink: #242a27;
  --muted: #666;
  --paper: #f4f4f4;
  --surface: #ffffff;
  --line: #dedede;
  --green: #006633;
  --green-bright: #00b359;
  --orange: #bd5b30;
  --blue: #11607d;
  --red: #b43e35;
  --shadow: 0 2px 8px rgb(0 0 0 / 8%);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
}

button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(22px, calc((100vw - 1060px) / 2));
  border-bottom: 0;
  background: var(--green);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 700; }
.brand-logo { display: block; width: auto; height: 44px; max-width: 64px; object-fit: contain; }
.brand-name { display: grid; gap: 2px; }
.brand-name strong { font-size: 15px; text-transform: uppercase; }
.brand-name small { color: #d6e8df; font-size: 10px; font-weight: 600; }
.top-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.top-nav > a { color: white; text-decoration: none; font-weight: 700; }
.top-nav > a:hover { color: #b9f1d0; }
.top-nav form { margin: 0; }
.user-name { color: #d6e8df; }
.page-shell { width: min(100% - 36px, 1000px); min-height: calc(100vh - 122px); margin: 0 auto; padding: 40px 0 64px; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 20px; color: var(--muted); text-align: center; font-size: 12px; }
.site-footer a { color: var(--green); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Arial, Helvetica, sans-serif; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
h1 { margin-bottom: 0; font-size: 38px; line-height: 1.08; }
h2 { margin-bottom: 0; font-size: 22px; }
.eyebrow { margin-bottom: 9px; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 13px; padding: 0 20px; border: 0; border-radius: 25px; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none; text-transform: uppercase; transition: transform 120ms ease, filter 120ms ease; }
.button:hover { filter: brightness(.96); transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #e4a344; outline-offset: 3px; }
.button-primary { background: var(--green); color: #fff; }
.button-dark { background: var(--blue); color: #fff; }
.button-primary:hover, .button-dark:hover { background: var(--green-bright); color: #fff; }
.button-quiet { min-height: 38px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.topbar .button-quiet { border-color: rgb(255 255 255 / 55%); color: white; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--red); cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { margin: 0; padding: 12px 15px; border-left: 4px solid var(--green); background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.flash-error { border-color: var(--red); }

.login-layout { display: grid; width: min(100%, 520px); margin: 36px auto; animation: arrive 320ms ease both; }
.login-panel { padding: clamp(24px, 5vw, 40px); border-top: 6px solid var(--green); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); }
.login-panel h1 { margin-bottom: 28px; color: var(--green); font-size: clamp(25px, 6vw, 36px); }
.login-panel h2 { margin-bottom: 20px; font-size: 18px; }
.form-stack { display: grid; gap: 12px; }
.form-stack label, .booking-form label, .admin-create-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); }
.code-separator { display: flex; align-items: center; gap: 12px; margin: 24px 0 18px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.code-separator::before, .code-separator::after { height: 1px; flex: 1; background: var(--line); content: ''; }

.page-heading, .section-heading, .booking-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.page-heading { margin-bottom: 28px; }
.lane-key { display: flex; gap: 14px; padding-bottom: 5px; color: var(--muted); font-size: 12px; }
.lane-key span { display: inline-flex; align-items: center; gap: 6px; }
.lane-key i { width: 8px; height: 8px; border: 2px solid var(--green); border-radius: 50%; }
.lane-key span:last-child i { border-color: var(--orange); }
.booking-bar { margin-bottom: 42px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.booking-title { justify-content: flex-start; margin-bottom: 18px; }
.section-index { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--green-bright); font-size: 11px; font-weight: 700; }
.booking-form { display: grid; grid-template-columns: 1fr 1.45fr auto; align-items: end; gap: 12px; }
.booking-form .button { min-width: 122px; }
.section-heading { margin-bottom: 15px; }
.section-heading h2 { font-size: 26px; }
.schedule-count { padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: 11px; }
.schedule-list { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.day-row { display: grid; min-height: 80px; grid-template-columns: 88px 1fr; border-bottom: 1px solid var(--line); animation: arrive 320ms ease both; }
.day-row:last-child { border-bottom: 0; }
.day-row.is-today { background: #fbfdf5; }
.day-date { display: flex; align-items: center; justify-content: center; gap: 4px; border-right: 1px solid var(--line); color: var(--muted); }
.day-weekday, .day-month { font-size: 10px; text-transform: uppercase; }
.day-date strong { color: var(--ink); font-family: 'Space Grotesk', sans-serif; font-size: 20px; }
.day-content { display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; }
.reservation-line { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); }
.reservation-line:last-child { border: 0; }
.reservation-main, .reservation-meta { display: flex; align-items: center; gap: 10px; }
.reservation-name { font-size: 13px; font-weight: 600; }
.reservation-type { padding: 5px 8px; border-radius: 3px; background: #e7f2e8; color: var(--green); font-size: 10px; font-weight: 700; }
.type-gameday { background: #fce9df; color: #a64e2c; }
.type-external { background: #e9f1f7; color: var(--blue); }
.lane-label { color: var(--muted); font-size: 11px; }
.reservation-meta form { margin: 0; }
.empty-state { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.blocked-state { color: var(--red); }
.free-dot { width: 7px; height: 7px; border-radius: 50%; background: #62a274; }

.admin-heading { align-items: center; }
.admin-section { margin: 36px 0 0; padding-top: 25px; border-top: 1px solid var(--line); }
.admin-create-form { display: grid; grid-template-columns: 1fr 1.3fr auto auto; align-items: end; gap: 12px; margin: 18px 0; }
.admin-create-form .button { white-space: nowrap; }
.check-label { min-height: 46px; grid-template-columns: 18px auto !important; align-items: center; justify-content: start; }
.check-label input { width: 18px; min-height: 18px; accent-color: var(--green); }
.admin-list { border-top: 1px solid var(--line); }
.admin-list-row { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.person-details { display: grid; gap: 4px; min-width: 0; }
.person-details strong { font-size: 13px; }
.person-details span { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.person-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 12px; }
.person-status form, .admin-list-row form { margin: 0; }
.status-pill { padding: 5px 8px; border-radius: 12px; background: #e2f0e2; color: var(--green); font-size: 10px; font-weight: 700; }
.status-off { background: #fbe8e4; color: var(--red); }

.calendar-heading { align-items: center; margin-bottom: 12px; }
.month-navigation { display: flex; gap: 7px; }
.calendar-nav { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 20px; text-decoration: none; }
.calendar-nav:hover { border-color: var(--green); color: var(--green); }
.calendar-nav.is-disabled { background: #e9ede6; color: #a7b0a7; }
.calendar-key { display: flex; gap: 18px; margin: 0 0 18px; color: var(--muted); font-size: 11px; }
.calendar-key span { display: inline-flex; align-items: center; gap: 7px; }
.lane-dot { display: inline-block; width: 10px; height: 10px; flex: 0 0 auto; border: 1px solid #6c9a76; border-radius: 50%; background: #dcebdd; }
.lane-dot.is-occupied { border-color: #c36c43; background: #f2c4a8; }
.lane-dot.is-unavailable { border-color: #a7b0a7; background: #e5e9e3; }
.calendar-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { min-height: 38px; align-items: center; border-bottom: 1px solid var(--line); background: var(--green); color: white; font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-week { min-height: 120px; border-bottom: 1px solid var(--line); }
.calendar-week:last-child { border-bottom: 0; }
.calendar-cell { min-width: 0; min-height: 120px; padding: 8px; border-right: 1px solid var(--line); }
.calendar-cell:last-child { border-right: 0; }
.calendar-cell.is-outside { background: #f2f4ef; }
.calendar-cell.is-out-of-range { background: #f7f8f5; }
.calendar-cell.is-today { background: #f4f9e4; }
.calendar-day, .calendar-day-number { display: inline-grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; }
.calendar-day { cursor: pointer; }
.calendar-day:hover, .calendar-day:focus-visible { background: var(--green-bright); }
.calendar-day-number { color: var(--muted); }
.calendar-lanes { display: flex; gap: 4px; padding: 4px 2px; }
.calendar-events { display: grid; gap: 4px; margin-top: 3px; }
.calendar-event { min-width: 0; padding: 4px 5px; overflow: hidden; border-left: 2px solid var(--green); border-radius: 2px; background: #e7f2e8; font-size: 9px; }
.calendar-event.type-gameday { border-color: var(--orange); background: #fce9df; }
.calendar-event.type-external { border-color: var(--blue); background: #e9f1f7; }
.calendar-event strong, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { margin-top: 2px; color: var(--muted); }
.calendar-blocked { display: block; margin-top: 4px; color: var(--red); font-size: 9px; }
.month-bookings { margin-top: 30px; }
.month-bookings .section-heading { align-items: end; }
.calendar-hint { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.comment-field small { color: var(--muted); font-size: 10px; font-weight: 400; }

.imprint-page { max-width: 760px; margin: 0 auto; padding: 30px clamp(20px, 5vw, 56px); border-top: 6px solid var(--green); background: var(--surface); box-shadow: var(--shadow); }
.imprint-page h1 { margin-bottom: 32px; }
.imprint-section { padding: 22px 0; border-top: 1px solid var(--line); }
.imprint-section h2 { margin-bottom: 12px; color: var(--green); font-size: 16px; }
.imprint-section p { margin-bottom: 10px; line-height: 1.65; }
.imprint-section a, .imprint-source a { color: var(--green); font-weight: 700; }
.imprint-source { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }

@keyframes arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 700px) {
  .topbar { min-height: 60px; padding: 8px 16px; }
  .top-nav { gap: 10px; }
  .user-name { display: none; }
  .page-shell { width: min(100% - 28px, 520px); padding-top: 28px; }
  .brand-logo { height: 36px; max-width: 50px; }
  .brand-name strong { font-size: 12px; }
  .brand-name small { font-size: 9px; }
  .login-layout { margin: 16px auto; }
  .booking-form { grid-template-columns: 1fr 1fr; }
  .booking-form .comment-field { grid-column: 1 / -1; }
  .booking-form .button { grid-column: 1 / -1; }
  .calendar-week { min-height: 84px; }
  .calendar-cell { min-height: 84px; padding: 4px 3px; }
  .calendar-day, .calendar-day-number { width: 27px; height: 27px; font-size: 12px; }
  .calendar-lanes { gap: 3px; padding: 4px 1px; }
  .lane-dot { width: 8px; height: 8px; }
  .calendar-events { display: none; }
  .calendar-weekdays { min-height: 32px; font-size: 9px; }
  .calendar-nav { width: 38px; height: 38px; }
  .calendar-key { margin-bottom: 12px; }
  .month-bookings { margin-top: 24px; }
  .day-row { grid-template-columns: 68px 1fr; }
  .day-date { flex-direction: column; gap: 1px; }
  .day-weekday, .day-month { font-size: 9px; }
  .day-content { padding: 8px 10px; }
  .reservation-line { align-items: flex-start; flex-direction: column; gap: 3px; padding: 7px 0; }
  .reservation-main { flex-wrap: wrap; gap: 6px; }
  .reservation-meta { width: 100%; justify-content: space-between; }
  .admin-create-form { grid-template-columns: 1fr 1fr; }
  .admin-create-form .button { grid-column: 1 / -1; }
  .admin-create-form .check-label { grid-column: 1 / -1; min-height: 30px; }
  .admin-heading { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}