:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #5b6b7c;
  --line: #d7dee7;
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
  --danger: #9b2226;
  --warn: #9a3412;
  --ok: #0b6e4f;
  --shadow: 0 1px 2px rgba(21, 32, 43, 0.06);
  --radius: 10px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.08), transparent 40%),
    linear-gradient(180deg, #eef3f6, var(--bg));
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}
.wrap.wrap--public {
  max-width: 820px;
}
.topbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center;
  margin-bottom: 1.25rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { text-decoration: none; color: var(--accent); }
.btn.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem 0.15rem;
  margin-left: auto;
  min-width: 0;
}
.nav-icon {
  flex: 0 0 auto;
  display: block;
}
.nav-step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}
.nav-link,
.nav-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
}
.nav-summary { list-style: none; }
.nav-summary::-webkit-details-marker { display: none; }
.nav-link:hover,
.nav-summary:hover,
.nav-link.active,
.nav-summary.active,
.nav-dropdown.is-active > .nav-summary {
  color: var(--accent);
  background: rgba(11, 110, 79, 0.08);
  text-decoration: none;
}
.nav-link.active,
.nav-summary.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-dropdown {
  position: relative;
}
.nav-panel {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 40;
  min-width: 11.5rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(21, 32, 43, 0.12);
}
.nav-panel .nav-link {
  width: 100%;
  justify-content: flex-start;
}
.nav-dropdown:last-child .nav-panel {
  left: auto;
  right: 0;
}
.nav-logout-form { margin: 0; }
.nav-logout-form .nav-logout {
  width: 100%;
  justify-content: flex-start;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
@media (max-width: 640px) {
  .topbar { align-items: center; }
  .btn.nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  .nav {
    display: none;
    flex: 1 1 100%;
    order: 5;
    margin-left: 0;
    justify-content: stretch;
  }
  .nav.is-open {
    display: grid;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  .nav-dropdown { width: 100%; }
  .nav-panel {
    position: static;
    left: auto;
    right: auto;
    box-shadow: none;
    border: 0;
    padding: 0.25rem 0 0.25rem 0.75rem;
    min-width: 0;
  }
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
h1, h2, h3 { margin: 0 0 0.75rem; line-height: 1.2; }
.title-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  position: relative;
  top: -0.1em;
}
.title-help:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}
.page-heading .title-help { margin-left: 0; top: 0; }
.title-period {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
}
.title-period select {
  min-width: 12rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.help-bubble {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(21, 32, 43, 0.18);
  text-decoration: none;
}
.help-bubble:hover {
  color: var(--accent-ink);
  text-decoration: none;
  filter: brightness(1.05);
}
.muted { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfd; }
.stat strong { display: block; font-size: 1.6rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); }
label { display: block; font-weight: 600; margin: 0.5rem 0 0.25rem; }
input, select, textarea, button {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.65rem; background: #fff;max-width: 100%;
}
textarea { width: 100%; min-height: 70px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.fixture-form .form-section {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}
.fixture-form .form-section legend {
  padding: 0 0.35rem;
  font-weight: 700;
  color: var(--ink);
}
.fixture-form .form-section-hint {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}
.fixture-form .room-checks { margin-top: 0.75rem; }
.fixture-form .room-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.35rem;
}
.fixture-form .room-check-list label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-weight: 500;
}
.fixture-form .flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.fixture-form .flag-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-weight: 500;
}
.fixture-form .form-actions { margin: 0.25rem 0 0; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 8px; padding: 0.55rem 0.9rem; font-weight: 700; cursor: pointer;
}
.btn.secondary { background: #e8eef2; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn + .btn { margin-left: 0.35rem; }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}
.flash { padding: 0.7rem 0.9rem; border-radius: 8px; margin-bottom: 0.75rem; }
.flash.success { background: #e7f6ef; color: var(--ok); }
.flash.error { background: #fde8e8; color: var(--danger); }
.flash.warning { background: #ffedd5; color: var(--warn); }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.card-actions .btn { margin-left: 0; padding: 0.3rem 0.55rem; font-size: 0.8rem; }
.badge {
  display: inline-block; padding: 0.15rem 0.45rem; border-radius: 999px; font-size: 0.75rem;
  background: #e8eef2; color: var(--muted); font-weight: 700;
}
.badge.warn { background: #ffedd5; color: var(--warn); }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.login-card { max-width: 420px; margin: 4rem auto; }
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}
.board-layout > :first-child {
  min-width: 0;
}
.page-board .board-layout .sidebar-list {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
}
.board-cue {
  margin: 0.35rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #c5e1d6;
  background: #eef8f3;
  color: var(--ink);
}
.board-day { margin-bottom: 1.25rem; }
.board-day-empty { margin: 0 0 0.65rem; font-size: 0.9rem; }
.board-day.is-drop-day .board-lane {
  border-color: rgba(11, 110, 79, 0.35);
  background: #f3faf7;
}
.board-day.is-other-day {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.pitch-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.pitch-col {
  min-height: 120px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem;
}
.pitch-col-title { display: block; margin-bottom: 0.45rem; }
.board-lane {
  display: flex;
  flex-direction: column;
  min-height: 130px;
  margin-top: 0.45rem;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.board-lane-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  background: #fbfcfd;
  border-radius: 6px 6px 0 0;
}
.board-lane-body {
  flex: 1;
  padding: 0.45rem;
  min-height: 88px;
}
.board-lane-empty {
  margin: 1.1rem 0.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed transparent;
}
.board-lane.drop-target {
  border-style: solid;
  border-color: var(--accent);
  background: #e7f6ef;
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15);
}
.board-lane.drop-target .board-lane-empty {
  color: var(--accent);
  font-weight: 700;
}
.board-lane.drop-invalid {
  border-style: solid;
  border-color: #f0b4b4;
  background: #fff5f5;
}
[data-board].is-dragging .board-lane {
  border-color: rgba(11, 110, 79, 0.28);
}
/* Let drag events hit the lane, not nested cards (keeps drop highlight stable).
   Never disable the active drag source — that cancels HTML5 drag in WebKit/Blink. */
[data-board].is-dragging .fixture-card:not(.dragging) {
  pointer-events: none;
}
.fixture-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  cursor: grab;
  user-select: none;
}
.fixture-card:active { cursor: grabbing; }
.fixture-card.needs { border-color: #fdba74; background: #fff7ed; }
.fixture-card small { display: block; color: var(--muted); }
.fixture-card-top { display: flex; gap: 0.45rem; align-items: flex-start; }
.drag-hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.1;
  letter-spacing: -0.08em;
  padding-top: 0.15rem;
}
.drag-cue {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.fixture-card.dragging {
  opacity: 0.45;
  transform: scale(0.98);
  box-shadow: var(--shadow);
}
.sidebar-drag-cue { margin: 0 0 0.65rem; font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.sidebar-list { max-height: none; overflow: visible; }
.board-confirm[hidden] { display: none !important; }
.board-confirm {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(21, 32, 43, 0.35);
}
.board-confirm-panel {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(21, 32, 43, 0.18);
  padding: 1rem 1.1rem 1.15rem;
}
.board-confirm-panel h2 { margin-bottom: 0.35rem; }
.board-confirm-rooms {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.board-confirm-rooms legend { padding: 0 0.25rem; font-weight: 700; }
.board-confirm-rooms label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  margin: 0.35rem 0;
}
.board-confirm-constraints,
.board-confirm-ko-note {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
}
.board-confirm-panel input[type="time"][readonly],
.board-confirm-panel input[type="time"]:disabled {
  background: #f1f5f8;
  color: var(--muted);
  cursor: not-allowed;
}
@media (min-width: 701px) {
  .board-confirm { align-items: center; }
}
@media (min-width: 901px) {
  .page-board .board-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  }
}
.public-hero { padding: 1.5rem 0 0.5rem; }
.public-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.public-downloads { margin: 0.85rem 0 0; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.public-schedule {
  display: grid;
  gap: 1.75rem;
  margin: 1.25rem 0 2rem;
}
.public-day-title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.public-fixture-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.public-fixture {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.public-fixture-main { min-width: 0; flex: 1; }
.public-fixture-team {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1.25;
}
.public-fixture-meta {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}
.public-fixture-venue {
  margin: 0.3rem 0 0;
  color: var(--muted);
}
.public-fixture-notes {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.public-fixture.is-cancelled .public-fixture-team,
.public-fixture.is-postponed .public-fixture-team {
  text-decoration: line-through;
  color: var(--muted);
}
.help-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 1rem;
  align-items: start;
}
.help-toc { position: sticky; top: 0.75rem; }
.help-toc ol { margin: 0; padding-left: 1.1rem; }
.help-toc li { margin: 0.35rem 0; }
.help-toc a:focus-visible,
.help-faq summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.help-section { scroll-margin-top: 1rem; }
.help-steps { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.help-steps li { margin: 0.4rem 0; }
.help-faq details {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0;
}
.help-faq details:first-of-type { border-top: 0; }
.help-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.help-faq details[open] summary { color: var(--accent); }
.help-faq details p { margin: 0.5rem 0 0; }
@media (max-width: 700px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; }
  .wrap { padding: 0.75rem; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .board-layout {
    grid-template-columns: 1fr;
  }
  .page-board .board-layout .sidebar-list {
    position: static;
    max-height: none;
  }
  .public-hero { padding-top: 0.75rem; }
  .filter-bar { flex-direction: column; }
  .filter-bar > div { width: 100%; }
  .public-fixture-team { font-size: 1.1rem; }
}
