:root {
  color-scheme: light;
  --navy-950: #061a2b;
  --navy-900: #08233a;
  --navy-800: #0b3151;
  --navy-700: #124466;
  --ink: #102033;
  --muted: #66768a;
  --line: #dbe3ec;
  --line-strong: #c7d3df;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --green: #079847;
  --green-dark: #05743a;
  --green-soft: #e7f7ee;
  --blue: #125ecf;
  --blue-soft: #e8f1ff;
  --red: #d23535;
  --red-soft: #fff0f0;
  --amber: #bb7808;
  --shadow: 0 18px 45px rgba(15, 31, 48, 0.08);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface-soft);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 12px;
  color: #eaf4ff;
  background: var(--navy-950);
}

.brand {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 0 6px 18px;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.brand-mark {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: linear-gradient(145deg, #0c9c50, #0a3154);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 22px;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: #9fbed6;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #d8e7f2;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.is-active {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 123, 61, 0.22);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status strong {
  color: #8ef2aa;
  font-size: 12px;
  text-transform: uppercase;
}

.sidebar-status small {
  margin-top: 2px;
  color: #d2e6f5;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #45d66f;
  box-shadow: 0 0 0 4px rgba(69, 214, 111, 0.16);
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.section-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.topbar-actions,
.editor-actions,
.tool-grid {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-height: 28px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sync-strip span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #a4afbd;
}

.sync-strip span.is-online {
  background: #18b45d;
  box-shadow: 0 0 0 3px rgba(24, 180, 93, 0.14);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(7, 152, 71, 0.2);
}

.primary-button:hover {
  background: var(--green-dark);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: #f9fbfd;
}

.ghost-button.danger {
  color: var(--red);
}

.content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px 28px 36px;
}

.hero-status {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.2fr) minmax(310px, 0.92fr);
  align-items: center;
  min-height: 184px;
  gap: 24px;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(4, 20, 34, 0.98) 0%, rgba(4, 24, 39, 0.9) 38%, rgba(5, 31, 48, 0.22) 73%, rgba(5, 31, 48, 0.38) 100%),
    url("/assets/foosball-banner.png");
  background-position:
    left top,
    right center;
  background-repeat: no-repeat;
  background-size:
    cover,
    auto 100%;
  box-shadow: var(--shadow);
  color: #ffffff;
}

.hero-copy,
.metric-row,
.next-match-card {
  position: relative;
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0 0 0 36%;
  z-index: 0;
  width: 64%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.66;
  filter: saturate(1.08) contrast(1.05);
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d4e9f9;
  font-size: 13px;
  font-weight: 800;
}

.hero-status h2 {
  margin: 14px 0 12px;
  font-size: 30px;
  line-height: 1.05;
}

.hero-copy small {
  color: #c8dbe9;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  width: min(260px, 100%);
  height: 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #66d66a;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.metric {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  font-size: 27px;
  line-height: 1;
}

.metric span {
  color: #d0e2ef;
  font-size: 12px;
  font-weight: 700;
}

.next-match-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

.next-match-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
}

.next-match-body {
  display: grid;
  grid-template-columns: auto auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.next-match-body b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-match-body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.next-match-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cockpit-grid,
.results-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(360px, 1.05fr) minmax(360px, 1.1fr);
  gap: 14px;
  margin-top: 14px;
}

.schedule-panel {
  grid-column: span 1;
}

.availability-panel {
  grid-column: span 1;
}

.availability-row .score {
  font-size: 12px;
}

.knockout-preview {
  grid-column: span 2;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 32, 51, 0.045);
}

.wide-panel {
  margin-top: 14px;
}

.self-planner-head {
  margin-top: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.planner-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.2fr);
  align-items: end;
  gap: 16px;
}

.planner-select {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.planner-select select,
.self-plan-form input,
.self-plan-form select {
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.planner-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.planner-metrics span {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.planner-metrics strong {
  font-size: 20px;
  line-height: 1;
}

.planner-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.self-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.self-plan-card {
  display: grid;
  align-content: start;
  gap: 13px;
}

.self-plan-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.self-plan-title span,
.self-plan-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.self-plan-title h2 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.2;
}

.plan-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eff3f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.plan-status.is-suggested,
.availability-tag.is-suggested {
  background: #fff4da;
  color: var(--amber);
}

.plan-status.is-planned,
.availability-tag.is-planned {
  background: var(--blue-soft);
  color: var(--blue);
}

.plan-status.is-fixed,
.availability-tag.is-fixed {
  background: var(--green-soft);
  color: var(--green-dark);
}

.self-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.self-plan-meta strong {
  color: var(--ink);
}

.self-plan-form {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 120px 86px 126px;
  gap: 10px;
}

.self-plan-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.self-plan-note {
  min-height: 54px;
}

.group-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.group-button {
  position: relative;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.group-button.is-active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.group-button span,
.group-button small {
  display: block;
}

.group-button span {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.group-button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.group-button i {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #a4afbd;
}

.group-button i.is-green {
  background: var(--green);
}

.group-button i.is-blue {
  background: var(--blue);
}

.table-wrap {
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.standings-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  text-align: left;
}

.standings-table td,
.standings-table th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.standings-table td {
  font-size: 13px;
  font-weight: 700;
}

.standings-table td:first-child {
  width: 38px;
  border-left: 3px solid transparent;
  text-align: center;
}

.standings-table tr.is-direct td:first-child {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.standings-table tr.is-third td:first-child {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.standings-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.legend-direct {
  background: var(--green);
}

.legend-third {
  background: var(--blue);
}

.match-list {
  display: grid;
  gap: 7px;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(58px, 0.58fr) minmax(68px, 1fr) auto minmax(68px, 1fr) 46px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #f9fbfd;
  color: var(--ink);
  text-align: left;
}

.match-row:hover,
.match-row.is-active {
  border-color: var(--green);
  background: #ffffff;
}

.match-row span,
.match-row small {
  display: block;
}

.match-row strong,
.match-row b,
.match-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-row strong {
  font-size: 13px;
}

.match-row b {
  font-size: 13px;
  font-weight: 800;
}

.match-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.match-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.score {
  justify-self: end;
  min-width: 30px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #eff3f7;
  text-align: center;
}

.score.is-done {
  background: var(--green-soft);
  color: var(--green-dark);
}

.score.is-free {
  background: #fff4da;
  color: var(--amber);
}

.match-context {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.match-context strong {
  color: var(--ink);
}

.schedule-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px 96px;
  gap: 10px;
  margin-bottom: 10px;
}

.schedule-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-editor input {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.schedule-editor input[readonly] {
  background: #f3f6f9;
  color: var(--muted);
}

.wm-date-note {
  margin-bottom: 14px;
  padding: 9px 10px;
  border: 1px solid #d6e8ff;
  border-radius: var(--radius);
  background: #f2f8ff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wm-date-note strong {
  color: var(--ink);
}

.score-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.score-side {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.score-side small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-side strong {
  overflow: hidden;
  min-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.score-side input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.score-side.home input {
  color: var(--blue);
  border-color: #9fc0ed;
  background: #f8fbff;
}

.score-side.away input {
  color: var(--red);
  border-color: #efb1b1;
  background: #fffafa;
}

.score-divider {
  padding-bottom: 16px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.winner-choice {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.winner-choice label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
}

.editor-actions {
  margin-top: 14px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.empty-state.compact {
  min-height: 118px;
  padding: 14px;
  text-align: center;
}

.preview-bracket {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-bracket-match {
  display: grid;
  min-height: 94px;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.mini-bracket-match span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.mini-bracket-match strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mini-bracket-match small {
  color: var(--muted);
  font-weight: 800;
}

.participant-tools {
  margin-top: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, auto);
  align-items: center;
}

.tool-grid strong,
.tool-grid small {
  display: block;
}

.tool-grid strong {
  font-size: 18px;
}

.tool-grid small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bulk-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.bulk-entry textarea {
  min-height: 92px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.participant-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.participant-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(0, 0.82fr);
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.availability-field {
  grid-column: 2 / -1;
}

.group-token {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-900);
  color: #ffffff;
  font-weight: 900;
}

.participant-row label,
.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.participant-row input,
.field input {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.group-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  padding: 14px;
}

.group-card.is-selected {
  border-color: var(--green);
}

.group-card-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.group-card-title strong {
  font-size: 16px;
}

.group-card-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.compact-match-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.compact-match-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.filter-strip button {
  min-width: 42px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.filter-strip button.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.schedule-table {
  display: grid;
  gap: 7px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.68fr) minmax(82px, 0.62fr) minmax(82px, 0.7fr) minmax(0, 1fr) auto minmax(0, 1fr) minmax(88px, 0.62fr) 62px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.schedule-row:hover {
  border-color: var(--green);
}

.schedule-row span,
.schedule-row b,
.schedule-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.schedule-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.availability-tag {
  justify-self: start;
  max-width: 128px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #eff3f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.availability-tag.is-active {
  background: #fff4da;
  color: var(--amber);
}

.results-grid {
  grid-template-columns: minmax(300px, 0.95fr) minmax(380px, 1.05fr) minmax(300px, 0.95fr);
  margin-top: 0;
}

.third-ranked {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.third-ranked div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.third-ranked div.is-qualified {
  border-color: #aed8c0;
  background: var(--green-soft);
}

.third-ranked span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: var(--navy-900);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.third-ranked strong,
.third-ranked small,
.third-ranked b,
.third-ranked em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.third-ranked small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.third-ranked b,
.third-ranked em {
  font-size: 12px;
  font-style: normal;
}

.qualification-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 0;
}

.qualification-strip .panel-header {
  margin-bottom: 0;
}

.qualification-strip div:last-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.qualification-strip strong {
  font-size: 24px;
}

.qualification-strip span {
  color: var(--muted);
  font-weight: 800;
}

.bracket-board {
  display: grid;
  grid-template-columns: 1.4fr 1.25fr 1fr 0.9fr 0.9fr 0.9fr;
  gap: 12px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.bracket-column {
  display: grid;
  align-content: start;
  min-width: 208px;
  gap: 9px;
}

.bracket-column h2 {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.bracket-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.bracket-card:hover {
  border-color: var(--green);
}

.bracket-card > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.bracket-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.bracket-card b,
.bracket-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-card b {
  font-size: 13px;
}

.bracket-card strong {
  justify-self: end;
  font-size: 15px;
}

.bracket-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

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

.field + .field {
  margin-top: 14px;
}

.rule-list {
  display: grid;
  gap: 9px;
}

.rule-list span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 1280px) {
  .hero-status,
  .cockpit-grid,
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .next-match-card,
  .knockout-preview {
    grid-column: 1 / -1;
  }

  .metric-row {
    border-right: 0;
  }

  .group-detail-grid,
  .third-ranked,
  .settings-grid,
  .self-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    min-height: 40px;
    padding: 9px;
  }

  .nav-item span {
    display: none;
  }

  .sidebar-status {
    display: none;
  }

  .topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .primary-button {
    flex: 1 1 120px;
  }

  .sync-strip {
    justify-content: flex-start;
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .hero-status,
  .cockpit-grid,
  .results-grid,
  .group-detail-grid,
  .settings-grid,
  .participant-table,
  .third-ranked,
  .planner-toolbar,
  .self-plan-grid {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
  }

  .group-button-grid,
  .preview-bracket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-grid,
  .bulk-entry {
    grid-template-columns: 1fr;
  }

  .self-plan-form {
    grid-template-columns: 1fr 1fr;
  }

  .participant-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .participant-row label:last-child,
  .availability-field {
    grid-column: 2;
  }

  .schedule-row {
    grid-template-columns: minmax(78px, 0.8fr) minmax(70px, 0.72fr) minmax(0, 1fr) 42px;
  }

  .schedule-row span:nth-child(3),
  .availability-tag,
  .schedule-row em,
  .schedule-row b:nth-of-type(2) {
    display: none;
  }

  .bracket-board {
    grid-template-columns: repeat(6, 220px);
  }

  .qualification-strip,
  .qualification-strip div:last-child {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .brand strong {
    font-size: 19px;
  }

  .hero-status {
    padding: 18px;
  }

  .hero-status h2 {
    font-size: 25px;
  }

  .next-match-body,
  .match-row {
    grid-template-columns: 1fr auto;
  }

  .next-match-body span,
  .next-match-body b:nth-of-type(2) {
    display: none;
  }

  .match-row {
    grid-template-columns: minmax(54px, 0.56fr) minmax(0, 1fr) auto minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .score-editor {
    grid-template-columns: 1fr;
  }

  .schedule-editor {
    grid-template-columns: 1fr;
  }

  .score-divider {
    display: none;
  }

  .winner-choice {
    grid-template-columns: 1fr;
  }

  .planner-metrics,
  .self-plan-form {
    grid-template-columns: 1fr;
  }

  .self-plan-title {
    flex-direction: column;
  }

  .compact-match-list,
  .preview-bracket {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .editor-panel,
  .participant-tools,
  .filter-strip,
  .ghost-button,
  .primary-button {
    display: none !important;
  }

  .app-shell,
  .main-shell,
  .content {
    display: block;
    width: 100%;
    padding: 0;
  }

  .panel,
  .hero-status {
    break-inside: avoid;
    box-shadow: none;
  }
}
