:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --surface: #121820;
  --panel: #18212b;
  --panel-2: #202a36;
  --text: #edf2f7;
  --muted: #9aa8b6;
  --line: #2d3947;
  --red: #ef4444;
  --blue: #3b82f6;
  --green: #20c997;
  --yellow: #f59e0b;
  --accent: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #0d1218;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-block {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}

.brand-text {
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 900;
  line-height: 1;
}

.brand-season {
  align-self: flex-end;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding-bottom: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.global-event-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  margin-left: auto;
  min-height: 48px;
  max-width: min(34vw, 520px);
  padding: 8px 16px;
  border: 1px solid rgba(226, 232, 240, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.global-event-button span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.global-event-button strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(22px, 2.1vw, 31px);
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-event-button:hover {
  border-color: rgba(226, 232, 240, 0.68);
  background: rgba(255, 255, 255, 0.1);
}

.decode-lockup {
  --decode-wordmark-height: clamp(42px, 4.8vw, 58px);
  --decode-icon-height: clamp(32px, 3.4vw, 42px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.decode-wordmark {
  display: block;
  width: clamp(126px, 18vw, 194px);
  height: var(--decode-wordmark-height);
  object-fit: cover;
  object-position: top center;
}

.decode-logo {
  display: block;
  width: var(--decode-icon-height);
  height: var(--decode-icon-height);
  object-fit: cover;
  object-position: top center;
}

@media (max-width: 820px) {
  .topbar {
    gap: 10px;
    min-height: 64px;
    padding: 10px 14px;
  }

  .brand-title {
    gap: 7px;
  }

  .brand-text {
    max-width: 178px;
    overflow: hidden;
    font-size: 28px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .decode-lockup {
    --decode-wordmark-height: 40px;
    --decode-icon-height: 30px;
    gap: 6px;
  }

  .decode-wordmark {
    width: 136px;
  }

  .brand-season {
    display: none;
  }

  .global-event-button {
    max-width: 260px;
    min-height: 48px;
    padding: 8px 12px;
  }

  .global-event-button strong {
    font-size: 20px;
  }
}

@media (max-width: 620px) {
  .brand-text {
    max-width: 116px;
    font-size: 24px;
  }

  .decode-wordmark {
    width: 112px;
  }

  .decode-logo {
    display: none;
  }

  .global-event-button {
    max-width: 190px;
  }
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 16px;
}

.icon-button,
.small-button,
.primary-button,
.secondary-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  min-height: 38px;
  background: var(--panel-2);
}

.icon-button {
  width: 48px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.file-button input {
  display: none;
}

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

.sidebar {
  position: sticky;
  top: 76px;
  z-index: 9;
  align-self: start;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
  padding: 10px 22px;
  background: #0d1218;
}

.nav-item {
  display: grid;
  place-items: center;
  flex: 1 0 110px;
  min-height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: center;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  color: var(--text);
  background: var(--panel);
}

.content {
  padding: 22px;
  min-width: 0;
  overflow-x: hidden;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.heading-context {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent);
  font-size: 1em;
  font-weight: 800;
  line-height: 1.15;
  vertical-align: baseline;
}

.status-pill {
  padding: 8px 12px;
  color: #c8f7e4;
  background: rgba(32, 201, 151, 0.12);
  border: 1px solid rgba(32, 201, 151, 0.38);
  border-radius: 999px;
  font-size: 13px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.panel,
.team-card,
.pit-card,
.pick-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

.metric span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

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

.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.auth-panel {
  margin-bottom: 18px;
}

.small-button,
.secondary-button,
.danger-button,
.primary-button {
  padding: 0 14px;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #061018;
  font-weight: 800;
}

.data-panel {
  margin-bottom: 18px;
}

.settings-status-stack {
  align-items: flex-start;
}

.dashboard-settings-panel {
  margin-top: 18px;
  scroll-margin-top: 170px;
}

.dashboard-settings-head {
  align-items: flex-start;
  margin-bottom: 4px;
}

.settings-bubble-grid {
  display: grid;
  gap: 0;
}

.settings-block {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.settings-block:first-child {
  border-top: 0;
}

.settings-block h3 {
  font-size: 22px;
}

.settings-block.auth-panel,
.settings-block.data-panel {
  margin-bottom: 0;
}

.data-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  cursor: pointer;
}

.data-file-button input {
  display: none;
}

.danger-button {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

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

.pit-form {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.pit-form[hidden] {
  display: none;
}

.event-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.dashboard-event-panel {
  margin-bottom: 18px;
  padding: 0;
  overflow: hidden;
  scroll-margin-top: 170px;
}

.dashboard-event-summary {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 18px;
  cursor: pointer;
  list-style: none;
}

.dashboard-event-panel[open] .expand-open {
  display: none;
}

.dashboard-event-panel[open] .expand-close {
  display: inline;
}

.dashboard-event-panel:not([open]) .expand-close {
  display: none;
}

.dashboard-event-summary::-webkit-details-marker {
  display: none;
}

.dashboard-event-summary > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.event-summary-label {
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-event-summary strong {
  display: block;
  overflow: hidden;
  padding-bottom: 5px;
  max-width: min(100%, 72vw);
  font-size: clamp(28px, 1.75vw, 34px);
  font-weight: 900;
  line-height: 1.16;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-event-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.dashboard-event-panel .eyebrow {
  font-size: 15px;
  font-weight: 900;
}

.dashboard-event-panel label {
  font-size: 18px;
  font-weight: 900;
}

.event-modal {
  width: min(860px, 100%);
}

.import-modal-form {
  margin-bottom: 0;
}

.event-strip {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(240px, 1fr) minmax(180px, 280px);
  gap: 12px;
  align-items: end;
}

.active-event-label {
  color: var(--accent);
  font-size: 13px;
  text-align: left;
  padding-bottom: 9px;
}

.event-select-field {
  max-width: none;
}

.event-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px minmax(150px, 220px) max-content;
  gap: 10px;
  align-items: end;
}

.import-panel {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  align-items: end;
  padding: 12px;
}

.import-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding-bottom: 8px;
  white-space: nowrap;
}

.import-copy .eyebrow {
  margin: 0;
}

.import-copy h3 {
  font-size: 15px;
}

.import-controls {
  display: grid;
  grid-template-columns: 96px minmax(150px, 210px) max-content max-content;
  gap: 8px;
  align-items: end;
  justify-content: start;
}

.import-status {
  grid-column: 2;
  margin: -2px 0 0;
  font-size: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.choice-group {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 13px;
}

.choice-group legend {
  display: block;
  padding: 0;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.alliance-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 13px;
}

.alliance-choice legend {
  grid-column: 1 / -1;
  display: block;
  padding: 0;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.alliance-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.alliance-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.red-card {
  background: #b91c1c;
}

.blue-card {
  background: #1d4ed8;
}

.alliance-card:has(input:checked) {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1218;
  color: var(--text);
  min-height: 40px;
  padding: 9px 10px;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

input[type="range"] {
  width: 100%;
  padding: 0;
}

.range-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

textarea {
  resize: vertical;
}

.form-section {
  grid-column: span 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.form-section h3 {
  grid-column: 1 / -1;
  font-size: 20px;
}

.quality-section {
  grid-template-columns: 1fr;
}

.reliability-field,
.quality-section .wide {
  grid-column: 1 / -1;
}

.reliability-field {
  display: grid;
  gap: 10px;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

.reliability-field input[type="range"] {
  min-height: 32px;
}

.pit-identity-panel {
  display: grid;
  gap: 14px;
  align-items: start;
}

.team-number-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.team-number-field span {
  font-size: 24px;
  font-weight: 900;
}

.team-number-field input {
  min-height: 50px;
  font-size: 24px;
  font-weight: 900;
}

.pit-fields-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
}

.pit-fields-panel .choice-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  min-width: 0;
  min-inline-size: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.pit-fields-panel .choice-group legend {
  float: left;
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.05;
  white-space: normal;
}

.pit-fields-panel .choice-group .checkbox-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
}

.pit-fields-panel .choice-group .checkbox-row input {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
}

.inline-number-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 18px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.08;
  white-space: normal;
}

.inline-number-field input {
  width: 100%;
  min-width: 0;
}

.wide-check {
  grid-column: 1 / -1;
  white-space: nowrap;
}

.pit-feature-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-check {
  min-height: 56px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.08;
}

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

.pit-identity-panel .pit-number-grid {
  gap: 10px;
}

.pit-identity-panel .pit-number-grid label {
  min-width: 0;
}

.pit-fields-panel .pit-number-grid,
.pit-fields-panel .pit-feature-checks,
.pit-fields-panel > label,
.pit-fields-panel .form-actions {
  grid-column: 1 / -1;
}

.photo-upload-panel {
  display: grid;
  gap: 9px;
}

.photo-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1218;
  color: var(--muted);
  font-size: 13px;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-picker {
  color: var(--text);
  font-weight: 700;
}

.pit-notes-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.field-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

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

.counter-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.counter-control {
  display: grid;
  grid-template-columns: 58px minmax(72px, 1fr) 58px;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1218;
}

.counter-control button {
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  font-size: 30px;
  font-weight: 900;
  cursor: pointer;
}

.counter-control button:hover {
  background: rgba(56, 189, 248, 0.18);
}

.counter-control input {
  min-height: 58px;
  border-width: 0 1px;
  border-radius: 0;
  background: #090e14;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.base-control {
  grid-template-columns: 72px minmax(136px, 1fr) 72px;
}

.base-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 12px;
  border-inline: 1px solid var(--line);
  background: #090e14;
  color: var(--text);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.base-control button {
  display: grid;
  place-items: center;
  font-size: 34px;
  line-height: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.checkbox-row.feature-check {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.checkbox-row.feature-check input {
  width: 20px;
  min-height: 20px;
}

.wide,
.form-actions {
  grid-column: span 4;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.search-input {
  max-width: 260px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
}

.team-list,
.record-list,
.pick-list,
.match-groups {
  display: grid;
  gap: 10px;
}

.match-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.match-archive {
  padding: 0;
}

.match-archive-summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.match-archive-summary::-webkit-details-marker {
  display: none;
}

.match-archive-summary strong {
  font-size: 24px;
}

.match-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 620px);
  overflow: hidden;
}

.match-score-badge {
  display: inline-grid;
  grid-template-columns: 74px 74px;
  align-items: center;
  justify-items: start;
  gap: 4px;
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}

.match-score-with-rp {
  width: auto;
  max-width: 100%;
  grid-template-columns: minmax(154px, 1fr) 74px 74px minmax(154px, 1fr);
  justify-items: start;
  gap: 5px;
  overflow: hidden;
}

.match-score-badge > .red-score,
.match-score-badge > .blue-score {
  display: inline-grid;
  width: 74px;
  place-items: center;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.match-score-separator {
  color: var(--muted);
  font-size: 24px;
  font-weight: 900;
}

.match-rp-compare {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.rp-strip {
  display: inline-grid;
  grid-template-columns: repeat(6, 26px);
  align-items: center;
  gap: 4px;
  min-width: 176px;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rp-label {
  display: none;
  margin-right: 3px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.red-rp .rp-label {
  color: #fecaca;
}

.blue-rp .rp-label {
  color: #bfdbfe;
}

.rp-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.rp-icon.earned {
  color: #fff;
}

.red-rp .rp-icon.earned {
  background: #ef202d;
}

.blue-rp .rp-icon.earned {
  background: #1d4ed8;
}

.rp-icon svg {
  width: 78%;
  height: 78%;
  fill: currentColor;
}

.match-archive.red-win {
  background: rgba(127, 29, 29, 0.18);
  border-color: rgba(239, 68, 68, 0.48);
}

.match-archive.blue-win {
  background: rgba(30, 64, 175, 0.18);
  border-color: rgba(59, 130, 246, 0.48);
}

.match-archive-teams {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.match-team-chip-group {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 5px;
}

.match-team-chip {
  display: inline-grid;
  width: 94px;
  height: 34px;
  place-items: center;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
}

.match-team-chip.filled.red-score {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.2);
}

.match-team-chip.filled.blue-score {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(30, 64, 175, 0.2);
}

.match-team-chip.missing {
  opacity: 0.42;
  filter: grayscale(0.35);
}

.match-team-chip:hover {
  opacity: 1;
  border-color: var(--accent);
}

.match-archive-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.match-collapse-tab {
  display: none;
}

.match-archive[open] .match-collapse-tab,
.match-archive-open .match-collapse-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 16px;
}

.match-archive-open .match-archive-summary {
  border-bottom: 1px solid var(--line);
}

.match-archive-open .match-summary-title {
  max-width: none;
}

.match-archive-teams .versus {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.match-archive-body {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.match-group-head,
.alliance-lane-head,
.match-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-group-head {
  margin-bottom: 14px;
}

.match-group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.score-input {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.score-input input {
  width: 82px;
  min-height: 38px;
  padding: 6px 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}

.match-group-meta .small-button {
  min-height: 38px;
  padding: 6px 13px;
  font-size: 18px;
}

.red-score {
  color: #fecaca;
}

.blue-score {
  color: #bfdbfe;
}

.alliance-lanes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alliance-lane {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  background: #0d1218;
  border: 1px solid var(--line);
}

.red-lane {
  border-color: rgba(239, 68, 68, 0.5);
}

.blue-lane {
  border-color: rgba(59, 130, 246, 0.5);
}

.alliance-lane-head {
  margin-bottom: 10px;
  font-size: 21px;
}

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

.match-team-row {
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--panel);
}

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

.match-team-row .muted {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.35;
}

.match-team-row .small-button,
.match-team-row .delete-button {
  font-size: 20px;
}

.match-groups:has(.match-archive[open]) {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  align-items: start;
}

.match-groups:has(.match-archive[open]) .match-archive {
  grid-column: 2;
}

.match-groups:has(.match-archive[open]) .match-archive[open] {
  grid-column: 1;
  grid-row: 1 / span 100;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-archive-summary {
  border-bottom: 1px solid var(--line);
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-score-separator,
.match-groups:has(.match-archive[open]) .match-archive[open] .match-score-badge {
  display: none;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-archive-right,
.match-groups:has(.match-archive[open]) .match-archive[open] .match-archive-teams,
.match-groups:has(.match-archive[open]) .match-archive[open] .expand-label {
  display: none;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-archive-right {
  display: flex;
  margin-left: auto;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-group-head {
  display: block;
  margin-bottom: 12px;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-group-head > div:first-child {
  display: none;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-group-meta {
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 19, 0.72);
  overflow-x: auto;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-group-meta > span {
  flex: 0 0 auto;
  min-width: 112px;
  font-size: 18px;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .match-group-meta .small-button:first-of-type {
  margin-left: auto;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .score-input input {
  font-size: 24px;
}

.match-groups:has(.match-archive[open]) .match-archive[open] .alliance-lanes {
  grid-template-columns: 1fr;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-archive-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "score"
    "teams";
  align-items: center;
  justify-items: stretch;
  min-height: 92px;
  padding: 10px 14px;
  gap: 6px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-summary-title {
  position: relative;
  display: flex;
  grid-area: score;
  align-items: center;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-archive-summary strong {
  font-size: 30px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-badge {
  font-size: 30px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-with-rp {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  grid-template-columns: 58px max-content max-content 58px;
  align-items: center;
  justify-items: center;
  gap: 6px;
  max-width: none;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-rp-compare {
  gap: 3px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-strip {
  grid-template-columns: repeat(6, 8px);
  align-items: center;
  justify-content: center;
  min-width: 58px;
  gap: 2px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-label {
  display: none;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-icon {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-icon svg {
  display: none;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-archive-teams {
  display: grid;
  grid-area: teams;
  grid-template-columns: 176px 38px 176px;
  align-items: center;
  justify-content: center;
  justify-items: center;
  width: 100%;
  font-size: 20px;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-team-chip {
  width: 84px;
  height: 28px;
  padding: 1px 5px;
  font-size: 16px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-team-chip-group {
  display: grid;
  grid-template-columns: repeat(2, 84px);
  align-items: center;
  justify-content: center;
  justify-items: center;
  gap: 4px;
}

.match-groups:has(.match-archive[open]) .match-archive:not([open]) .expand-label {
  display: none;
}

.match-expanded-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

.match-groups:has(.match-expanded-layout):has(.match-archive[open]),
.match-groups.is-expanded {
  grid-template-columns: 1fr;
}

.match-groups:has(.match-expanded-layout):has(.match-archive[open]) .match-expanded-layout,
.match-groups.is-expanded .match-expanded-layout {
  grid-column: 1;
  grid-row: auto;
}

.match-expanded-detail {
  min-width: 0;
  overflow: visible;
}

.match-expanded-detail > .match-archive {
  height: auto;
  margin: 0;
}

.match-compact-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  height: auto;
  max-height: none;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.match-compact-list > .match-archive {
  margin: 0;
}

.match-archive-compact {
  min-height: 114px;
  overflow: hidden;
}

.match-archive-compact .match-archive-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "score"
    "teams";
  align-items: center;
  justify-items: stretch;
  min-height: 112px;
  padding: 14px 18px;
  gap: 8px;
}

.match-archive-compact .match-summary-title {
  position: relative;
  display: grid;
  grid-template-columns: minmax(72px, 96px) minmax(0, 1fr);
  grid-area: score;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 46px;
  justify-content: stretch;
  gap: 12px;
}

.match-archive-compact .match-archive-summary strong {
  font-size: 36px;
  line-height: 1;
  white-space: nowrap;
}

.match-archive-compact .match-score-badge {
  font-size: 33px;
}

.match-archive-compact .match-score-with-rp {
  position: static;
  transform: none;
  justify-self: center;
  grid-template-columns: 54px 108px 108px 54px;
  align-items: center;
  justify-items: center;
  gap: 8px;
  width: min(100%, 348px);
  max-width: 100%;
  overflow: visible;
}

.match-archive-compact .match-score-badge > .red-score,
.match-archive-compact .match-score-badge > .blue-score {
  width: 108px;
}

.match-archive-compact .match-rp-compare {
  gap: 3px;
}

.match-archive-compact .rp-strip {
  grid-template-columns: repeat(6, 8px);
  align-items: center;
  justify-content: center;
  min-width: 54px;
  gap: 2px;
}

.match-archive-compact .rp-label,
.match-archive-compact .rp-icon svg,
.match-archive-compact .expand-label {
  display: none;
}

.match-archive-compact .rp-icon {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.match-archive-compact .match-archive-right {
  grid-area: teams;
  width: 100%;
  justify-content: center;
}

.match-archive-compact .match-archive-teams {
  display: grid;
  grid-template-columns: 176px 38px 176px;
  align-items: center;
  justify-content: center;
  justify-items: center;
  width: 100%;
  font-size: 20px;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
}

.match-archive-compact .match-team-chip {
  width: 84px;
  height: 28px;
  padding: 1px 5px;
  font-size: 16px;
}

.match-archive-compact .match-team-chip-group {
  display: grid;
  grid-template-columns: repeat(2, 84px);
  align-items: center;
  justify-content: center;
  justify-items: center;
  gap: 4px;
}

.match-groups:has(.match-expanded-layout) .match-expanded-layout .match-archive,
.match-groups:has(.match-expanded-layout) .match-expanded-layout .match-archive[open] {
  grid-column: auto;
  grid-row: auto;
}

.match-groups:has(.match-expanded-layout) .match-expanded-layout .match-archive[open] {
  position: static;
}

.team-row,
.record-row,
.pick-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.score-bar {
  height: 9px;
  border-radius: 999px;
  background: #0d1218;
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}

.score-bar.danger span {
  background: var(--red);
}

.ranking-panel {
  padding: 0;
}

.official-ranking-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.official-ranking-head,
.official-ranking-source {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.official-ranking-head h3 {
  font-size: 24px;
}

.official-ranking-source {
  flex: 0 1 auto;
}

.official-ranking-source label {
  width: 116px;
  font-weight: 800;
}

.official-ranking-source label:nth-child(2) {
  width: 176px;
}

.official-ranking-status {
  margin: 0;
}

.official-ranking-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.official-ranking-auto {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 15px;
  font-weight: 900;
}

.official-ranking-interval {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.official-ranking-interval select {
  width: 104px;
}

.official-ranking-table-wrap {
  max-height: min(68vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1218;
}

.official-ranking-table {
  width: 100%;
  min-width: 880px;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.official-ranking-rank-col {
  width: 6%;
}

.official-ranking-team-col {
  width: 43%;
}

.official-ranking-rs-col {
  width: 8.5%;
}

.official-ranking-points-col {
  width: 10%;
}

.official-ranking-record-col {
  width: 9.5%;
}

.official-ranking-plays-col {
  width: 7%;
}

.official-ranking-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #151e28;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.official-ranking-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.official-ranking-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.02);
}

.official-ranking-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.08);
}

.official-rank-cell {
  width: 72px;
  color: var(--accent);
  font-size: 18px;
}

.official-team-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.official-ranking-empty td {
  color: var(--muted);
  text-align: center;
}

.ranking-summary {
  display: block;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.ranking-summary::-webkit-details-marker {
  display: none;
}

.ranking-summary h3 {
  margin: 0;
  flex: 0 0 auto;
}

.ranking-summary-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ranking-preview-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.ranking-preview-list .team-row {
  padding: 9px 10px;
  background: var(--panel);
}

.ranking-panel[open] .ranking-preview-list {
  display: none;
}

.ranking-panel[open] .expand-open {
  display: none;
}

.ranking-panel[open] .expand-close {
  display: inline;
}

.ranking-panel-body {
  padding: 0 16px 16px;
}

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

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

.pit-browser-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 14px;
  align-items: start;
}

.pit-compare-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.pit-compare-browser {
  display: grid;
  gap: 14px;
  align-items: start;
}

.pit-compare-list {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-height: 300px;
}

.pit-compare-layout .pit-archive-body {
  grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.pit-compare-layout .pit-archive .pit-fields-panel {
  gap: 8px;
}

.pit-compare-layout .pit-archive .pit-fields-panel .choice-group {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 6px;
  padding: 8px 10px;
}

.pit-compare-layout .pit-archive .pit-feature-checks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pit-compare-layout .pit-archive .photo-preview {
  max-height: 170px;
}

.pit-compare-layout .pit-archive .pit-notes-field textarea {
  min-height: 66px;
}

.pit-compare-layout .pit-archive .pit-number-grid {
  gap: 8px;
}

.pit-detail-pane,
.pit-list-column {
  min-width: 0;
}

.pit-list-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.pit-list-only {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pit-mini-list {
  min-width: 0;
  max-height: min(680px, calc(100vh - 280px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.pit-browser-layout .pit-mini-list,
#pit.view.active:has(#pitForm:not([hidden])) #pitCards .pit-mini-list {
  grid-template-columns: 1fr;
}

#pit.view.active:has(#pitForm:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(820px, 1.35fr) minmax(300px, 0.65fr);
  gap: 0 16px;
  align-items: start;
}

#pit.view.active:has(#pitForm:not([hidden])) .section-head,
#pit.view.active:has(#pitForm:not([hidden])) .pit-editor-tab {
  grid-column: 1 / -1;
}

#pit.view.active:has(#pitForm:not([hidden])) #pitForm {
  grid-column: 1;
  margin-bottom: 0;
}

#pit.view.active:has(#pitForm:not([hidden])) #pitCards {
  grid-column: 2;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#pit.view.active:has(#pitForm:not([hidden])) #pitCards > .pit-list-column,
#pit.view.active:has(#pitForm:not([hidden])) #pitCards .pit-browser-layout,
#pit.view.active:has(#pitForm:not([hidden])) #pitCards .pit-compare-browser {
  min-height: 0;
}

#pit.view.active:has(#pitForm:not([hidden])) #pitCards .pit-editor-mini-list {
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

@media (max-width: 899px), (orientation: portrait) {
  #pit.view.active:has(#pitForm:not([hidden])) {
    grid-template-columns: 1fr;
  }

  #pit.view.active:has(#pitForm:not([hidden])) #pitForm,
  #pit.view.active:has(#pitForm:not([hidden])) #pitCards {
    grid-column: 1;
  }
}

@media (max-width: 1240px) {
  #pit.view.active:has(#pitForm:not([hidden])) {
    grid-template-columns: 1fr;
  }

  #pit.view.active:has(#pitForm:not([hidden])) #pitForm,
  #pit.view.active:has(#pitForm:not([hidden])) #pitCards {
    grid-column: 1;
  }
}

@media (max-width: 1240px), (orientation: portrait) {
  .pit-browser-layout,
  .pit-compare-browser {
    grid-template-columns: 1fr;
  }

  .pit-compare-layout {
    grid-template-columns: 1fr;
  }

  .pit-mini-list {
    max-height: 360px;
  }
}

.pit-card {
  padding: 15px;
}

.team-card {
  padding: 12px;
}

.team-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.team-card-head h3 {
  font-size: 20px;
}

.team-score {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.team-score strong {
  color: var(--text);
  font-size: 20px;
}

.pit-archive {
  padding: 0;
}

.pit-archive-compact .pit-archive-summary {
  cursor: default;
}

.pit-editor-tab,
.editor-tab {
  padding: 0;
  margin-bottom: 14px;
}

.form-grid[hidden] {
  display: none;
}

.pit-archive-summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.pit-archive-summary::-webkit-details-marker {
  display: none;
}

.pit-archive-summary strong {
  font-size: 22px;
}

.pit-archive-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pit-archive-status {
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.pit-archive-status.is-duplicate {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.pit-archive-compact.is-duplicate {
  border-color: rgba(248, 113, 113, 0.82);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.22);
}

.expand-label {
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.expand-close,
.pit-archive[open] .expand-open {
  display: none;
}

.pit-archive[open] .expand-close {
  display: inline;
}

.pit-archive-body {
  display: grid;
  grid-template-columns: minmax(145px, 190px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .pit-archive-body {
    grid-template-columns: minmax(135px, 180px) minmax(0, 1fr);
  }
}

.pit-archive-edit-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.pit-archive input:disabled,
.pit-archive textarea:disabled {
  opacity: 1;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.pit-archive input[type="checkbox"]:disabled {
  accent-color: var(--accent);
}

.pit-archive .pit-fields-panel {
  gap: 9px;
}

.pit-archive .pit-fields-panel .choice-group {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  column-gap: 10px;
  row-gap: 6px;
  padding: 10px 12px;
}

.pit-archive .inline-number-field {
  white-space: normal;
}

.pit-archive .pit-fields-panel .choice-group legend {
  font-size: 16px;
}

.pit-archive .readonly-check {
  min-height: 28px;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(154, 168, 182, 0.72);
  gap: 6px;
  min-width: 0;
}

.pit-archive .readonly-check input {
  flex: 0 0 auto;
}

.pit-archive .readonly-check.is-selected {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.pit-archive .readonly-check.is-selected input {
  filter: none;
}

.pit-archive .feature-check {
  min-height: 38px;
  padding: 8px;
  border-color: transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.18;
}

.pit-archive .inline-number-field {
  min-height: 34px;
  padding: 0 2px;
}

.pit-archive .pit-number-grid {
  gap: 12px;
}

.pit-archive .pit-feature-checks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.pit-archive .photo-preview {
  aspect-ratio: 1 / 1;
  max-height: 190px;
}

.pit-archive .pit-notes-field textarea {
  min-height: 76px;
}

.pit-archive .pit-notes-field {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
}

.pit-archive .pit-notes-field textarea {
  min-height: 132px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.28;
  resize: none;
}

.pit-compare-layout .pit-archive .pit-notes-field textarea {
  min-height: 132px;
}

.pit-archive .pit-fields-panel .choice-group legend,
.pit-archive .inline-number-field,
.pit-archive .feature-check,
.pit-archive .readonly-check,
.pit-archive .readonly-check.is-selected,
.pit-archive .pit-fields-panel .choice-group .checkbox-row {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.05;
}

.pit-archive .inline-number-field input {
  font-size: 20px;
  font-weight: 900;
}

.pit-archive .pit-fields-panel .choice-group .checkbox-row input,
.pit-archive .feature-check input {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
}

.pit-photo,
.pit-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1218;
}

.pit-photo {
  display: block;
  object-fit: cover;
}

.pit-photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.stat-line:last-child {
  border-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: #0d1218;
  color: var(--muted);
  font-size: 12px;
}

.team-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.team-card .stat-line {
  padding: 6px 0;
  font-size: 13px;
}

.team-card .stat-line strong {
  font-size: 14px;
}

.team-card .tag-row {
  gap: 5px;
  margin-top: 8px;
}

.team-card .tag {
  padding: 4px 7px;
  font-size: 11px;
}

.team-card-actions .secondary-button {
  min-height: 34px;
  font-size: 13px;
}

.red {
  color: #fecaca;
}

.blue {
  color: #bfdbfe;
}

.delete-button {
  border: 0;
  background: transparent;
  color: #fca5a5;
  cursor: pointer;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-backdrop[hidden] {
  display: none;
}

.detail-modal {
  width: min(980px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}

.pit-detail-modal {
  width: min(1120px, 100%);
}

.pit-detail-modal .pit-archive-body {
  padding: 12px 0 0;
}

.pit-modal-empty {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 18px 0 4px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-summary div,
.detail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.detail-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

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

.detail-section h3 {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .sidebar {
    padding: 10px;
  }

  .nav-item {
    margin: 0;
    text-align: center;
  }

  .metrics-grid,
  .split-grid,
  .single-grid,
  .team-grid,
  .pit-grid,
  .alliance-lanes,
  .match-groups:has(.match-archive[open]),
  .detail-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .match-groups:has(.match-archive[open]) .match-archive,
  .match-groups:has(.match-archive[open]) .match-archive[open] {
    grid-column: 1;
    grid-row: auto;
  }

  .form-grid,
  .form-section,
  .pit-form,
  .event-form,
  .import-panel {
    grid-template-columns: 1fr 1fr;
  }

  #matchForm {
    width: 100%;
    margin-left: 0;
    grid-template-columns: repeat(2, minmax(140px, 220px)) minmax(180px, 260px);
  }

  .import-panel {
    align-items: start;
  }

  .event-strip {
    grid-template-columns: 1fr;
  }

  .active-event-label {
    padding-bottom: 0;
  }

  .import-copy,
  .import-controls,
  .import-status {
    grid-column: 1 / -1;
  }

  .import-copy {
    padding-bottom: 0;
  }

  .event-form button {
    min-height: 42px;
  }

  .import-controls {
    grid-template-columns: minmax(110px, 0.75fr) minmax(160px, 1fr) max-content max-content;
    justify-content: stretch;
  }

  .field-cluster,
  .numeric-cluster {
    grid-template-columns: 1fr;
  }

  .form-section,
  .form-section h3,
  .wide,
  .form-actions {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .decode-logo {
    display: none;
  }

  .topbar,
  .section-head,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .form-grid,
  .form-section,
  .event-form,
  .import-panel {
    grid-template-columns: 1fr;
  }

  #matchForm {
    width: 100%;
    grid-template-columns: 1fr;
  }

  #matchForm .match-id-field,
  #matchForm .alliance-choice {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }

  .import-controls {
    grid-template-columns: 1fr 1fr;
  }

  .import-controls button {
    min-height: 42px;
  }

  .field-cluster,
  .numeric-cluster,
  .pit-form,
  .pit-archive-body,
  .pit-archive-fields,
  .pit-fields-panel,
  .pit-feature-checks,
  .pit-number-grid {
    grid-template-columns: 1fr;
  }

  .form-section,
  .form-section h3,
  .wide,
  .form-actions {
    grid-column: span 1;
  }

  .team-row,
  .record-row,
  .pick-row {
    grid-template-columns: 1fr;
  }

  .table-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .topbar {
    min-height: 56px;
    padding: 8px 14px;
  }

  .topbar .eyebrow {
    margin-bottom: 0;
    font-size: 11px;
  }

  h1 {
    font-size: 20px;
  }

  .brand-text {
    font-size: 26px;
  }

  .brand-season {
    font-size: 11px;
    padding-bottom: 3px;
  }

  .decode-wordmark {
    width: 126px;
    height: 42px;
  }

  .decode-logo {
    width: 32px;
    height: 32px;
  }

  h2 {
    font-size: 22px;
  }

  .icon-button {
    width: 42px;
    min-height: 34px;
  }

  .app-shell {
    min-height: calc(100vh - 56px);
  }

  .sidebar {
    position: sticky;
    top: 56px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
  }

  .nav-item {
    flex-basis: 96px;
    min-height: 34px;
    margin: 0;
    padding: 0 10px;
    text-align: center;
  }

  .content {
    padding: 12px;
  }

  .section-head,
  .panel-head {
    margin-bottom: 10px;
  }

  .panel,
  .team-card,
  .metric {
    padding: 12px;
    margin-bottom: 10px;
  }

  .ranking-panel,
  .pit-archive,
  .editor-tab,
  .pit-editor-tab {
    padding: 0;
  }

  .metrics-grid,
  .split-grid,
  .single-grid,
  .team-grid,
  .pit-grid,
  .alliance-lanes,
  .detail-grid {
    gap: 10px;
  }

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

  .pit-browser-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
    gap: 10px;
  }

  .pit-compare-browser {
    gap: 10px;
  }

  .pit-compare-layout {
    gap: 10px;
  }

  .pit-list-column {
    gap: 8px;
  }

  .form-grid,
  .form-section,
  .event-form,
  .import-panel {
    gap: 10px;
  }

  .import-controls {
    grid-template-columns: 96px minmax(132px, 1fr) max-content max-content;
    gap: 8px;
  }

  .pit-form,
  .pit-archive-body,
  .pit-detail-modal .pit-archive-body {
    grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
    gap: 12px;
  }

  .pit-fields-panel {
    gap: 10px;
  }

  .pit-fields-panel .choice-group,
  .pit-archive .pit-fields-panel .choice-group {
    gap: 8px;
    padding: 10px;
  }

  .pit-fields-panel .choice-group legend,
  .pit-archive .pit-fields-panel .choice-group legend {
    font-size: 17px;
  }

  .feature-check,
  .pit-archive .feature-check {
    min-height: 44px;
    padding: 10px;
    font-size: 15px;
  }

  .photo-preview,
  .pit-archive .photo-preview {
    max-height: 42vh;
  }

  .pit-notes-field textarea,
  .pit-archive .pit-notes-field textarea {
    min-height: 84px;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .detail-modal {
    max-height: calc(100vh - 16px);
    padding: 12px;
  }

  .pit-detail-modal {
    width: min(1120px, calc(100vw - 16px));
  }
}

@media (orientation: landscape) and (max-height: 620px) and (max-width: 720px) {
  .nav-item {
    font-size: 13px;
  }

  .split-grid,
  .team-grid,
  .pit-grid {
    grid-template-columns: 1fr;
  }

  .pit-browser-layout {
    grid-template-columns: 1fr;
  }

  .pit-compare-browser {
    grid-template-columns: 1fr;
  }

  .pit-compare-layout {
    grid-template-columns: 1fr;
  }

  .pit-form,
  .pit-archive-body,
  .pit-detail-modal .pit-archive-body {
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  }

  .pit-fields-panel .choice-group,
  .pit-archive .pit-fields-panel .choice-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .official-ranking-head {
    align-items: stretch;
    flex-direction: column;
  }

  .official-ranking-source {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .official-ranking-source label,
  .official-ranking-source label:nth-child(2),
  .official-ranking-source .primary-button {
    width: 100%;
  }

  .official-ranking-source .primary-button {
    grid-column: 1 / -1;
  }
}

/* Stable match editing workspace: left match list, right scoring form. */
#matchEventContent {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.match-workspace {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.match-list-panel {
  min-width: 0;
  overflow: hidden;
}

#matchForm {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  justify-content: stretch;
}

#matchForm[hidden] {
  display: none;
}

/* Match editor polish: compact stacked ID fields and balanced scoring sections. */
#matchForm {
  grid-template-columns: minmax(170px, 250px) minmax(240px, 1fr);
  align-items: start;
  gap: 12px 16px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.match-editor-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding-bottom: 4px;
}

.match-editor-head h3 {
  color: var(--text);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.match-editor-head .secondary-button {
  min-width: 132px;
  min-height: 48px;
  font-size: 18px;
  font-weight: 900;
}

#matchForm .match-id-field {
  grid-column: 1;
  max-width: none;
  width: 100%;
}

#matchForm .match-id-field:nth-of-type(1) {
  grid-row: 2;
}

#matchForm .match-id-field:nth-of-type(2) {
  grid-row: 3;
}

#matchForm .match-id-field input {
  min-height: 54px;
  font-size: 30px;
}

#matchForm .alliance-choice {
  grid-column: 2;
  grid-row: 2 / span 2;
  align-self: stretch;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr 1fr;
  gap: 8px;
  min-height: 154px;
}

#matchForm .alliance-choice legend {
  font-size: 22px;
  line-height: 1;
}

#matchForm .alliance-card {
  min-height: 54px;
  font-size: 20px;
}

#matchForm > .form-section,
#matchForm > .form-actions {
  grid-column: 1 / -1;
}

#matchForm .form-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
  min-width: 0;
}

#matchForm .form-section h3 {
  grid-column: 1 / -1;
}

#matchForm .field-cluster,
#matchForm .numeric-cluster {
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

#matchForm .checkbox-row {
  min-height: 84px;
  gap: 14px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.06;
}

#matchForm .checkbox-row input {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
}

#matchForm .phase-disabled-field {
  align-self: stretch;
}

#matchForm .form-section:has(.base-field) .phase-disabled-field {
  min-height: 58px;
}

#matchForm .counter-control {
  grid-template-columns: 58px minmax(96px, 1fr) 58px;
}

#matchForm .base-control {
  grid-template-columns: 72px minmax(136px, 1fr) 72px;
}

#matchForm .base-value {
  min-height: 58px;
  font-size: 32px;
}

#matchForm .base-control button {
  font-size: 36px;
}

#matchForm .quality-section .wide {
  grid-column: 1 / -1;
}

@media (orientation: landscape) and (min-width: 900px) {
  .match-workspace.editing #matchForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #matchForm,
  #matchForm .form-section {
    grid-template-columns: 1fr;
  }

  #matchForm .match-id-field,
  #matchForm .alliance-choice {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }
}

/* Match editing split: the editor uses a dedicated compact half-width layout. */
@media (orientation: landscape) and (min-width: 900px) {
  .match-workspace.editing {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
    gap: 16px;
    align-items: start;
    overflow: hidden;
  }

  #matchEventContent:has(#matchForm:not([hidden])) .match-workspace.editing #matchForm {
    order: 2;
    position: static;
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 14px;
    gap: 10px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-workspace.editing #matchForm .match-editor-head {
    min-height: 42px;
    padding-bottom: 0;
  }

  .match-workspace.editing #matchForm .match-editor-head h3 {
    font-size: 22px;
  }

  .match-workspace.editing #matchForm .match-editor-head .secondary-button {
    min-width: 104px;
    min-height: 38px;
    font-size: 15px;
  }

  #matchEventContent:has(#matchForm:not([hidden])) .match-workspace.editing .match-list-panel {
    order: 1;
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-self: start;
    width: 100%;
    max-width: none;
    margin-bottom: 0;
    overflow: hidden;
  }

  .match-workspace.editing .match-groups {
    min-height: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .match-workspace.editing .match-groups:has(.match-archive[open]) {
    grid-template-columns: 1fr;
  }

  .match-workspace.editing .match-groups:has(.match-archive[open]) .match-archive,
  .match-workspace.editing .match-groups:has(.match-archive[open]) .match-archive[open] {
    grid-column: 1;
    grid-row: auto;
  }

  .match-workspace.editing .match-groups:has(.match-archive[open]) .match-archive[open] .match-archive-body {
    display: none;
  }

  .match-workspace.editing .match-groups:has(.match-archive[open]) .match-collapse-tab,
  .match-workspace.editing .match-groups:has(.match-archive[open]) .expand-label {
    display: none;
  }

  .match-workspace.editing #matchForm .match-id-field {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    font-size: 20px;
    line-height: 1;
  }

  .match-workspace.editing #matchForm .match-id-field input {
    min-height: 50px;
    padding: 8px 12px;
    font-size: 28px;
  }

  .match-workspace.editing #matchForm .alliance-choice {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    gap: 10px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .match-workspace.editing #matchForm .alliance-choice legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .match-workspace.editing #matchForm .alliance-card {
    min-height: 0;
    height: 100%;
    font-size: 22px;
  }

  .match-workspace.editing #matchForm .alliance-card:has(input:checked) {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  }

  .match-workspace.editing #matchForm .form-section {
    gap: 8px 10px;
    padding: 10px;
  }

  .match-workspace.editing #matchForm .form-section h3 {
    font-size: 20px;
  }

  .match-workspace.editing #matchForm .checkbox-row {
    min-height: 68px;
    gap: 12px;
    font-size: 23px;
    font-weight: 900;
    line-height: 1.06;
  }

  .match-workspace.editing #matchForm .checkbox-row input {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .match-workspace.editing #matchForm .phase-disabled-field {
    transform: none;
  }

  .match-workspace.editing #matchForm .form-section:has(.base-field) .phase-disabled-field {
    min-height: 58px;
    transform: none;
  }

  .match-workspace.editing #matchForm .field-cluster,
  .match-workspace.editing #matchForm .numeric-cluster {
    gap: 6px;
  }

  .match-workspace.editing #matchForm label {
    font-size: 15px;
  }

  .match-workspace.editing #matchForm .counter-field {
    gap: 5px;
    color: #c7d5e6;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.08;
  }

  .match-workspace.editing #matchForm .counter-control {
    grid-template-columns: 40px minmax(62px, 1fr) 40px;
    min-height: 42px;
  }

  .match-workspace.editing #matchForm .counter-control input {
    min-height: 42px;
    font-size: 23px;
  }

  .match-workspace.editing #matchForm .counter-control button {
    font-size: 24px;
  }

  .match-workspace.editing #matchForm .base-control {
    grid-template-columns: 56px minmax(128px, 1fr) 56px;
    min-height: 58px;
  }

  .match-workspace.editing #matchForm .base-value {
    min-height: 58px;
    font-size: 30px;
    line-height: 1;
  }

  .match-workspace.editing #matchForm .base-control button {
    font-size: 32px;
    line-height: 1;
  }

  .match-workspace.editing #matchForm input,
  .match-workspace.editing #matchForm select,
  .match-workspace.editing #matchForm textarea {
    min-height: 38px;
  }

  .match-workspace.editing #matchForm .reliability-field {
    gap: 7px;
    font-size: 15px;
  }

  .match-workspace.editing #matchForm textarea {
    min-height: 78px;
  }

  .match-workspace.editing .match-archive-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "score"
      "teams";
    align-items: center;
    min-height: 72px;
    padding: 8px 10px;
    gap: 4px;
    overflow: hidden;
  }

  .match-workspace.editing .match-summary-title {
    position: relative;
    display: flex;
    grid-area: score;
    align-items: center;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: flex-start;
  }

  .match-workspace.editing .match-summary-title > strong {
    justify-self: start;
  }

  .match-workspace.editing .match-score-separator {
    margin-left: 12px;
  }

  .match-workspace.editing .match-archive-right {
    display: contents;
  }

  .match-workspace.editing .match-archive-teams {
    grid-area: teams;
    width: 100%;
    justify-content: center;
    text-align: center;
    overflow: hidden;
  }

  .match-workspace.editing .expand-label {
    grid-area: action;
    min-width: 88px;
  }

  .match-workspace.editing .match-archive-summary {
    pointer-events: none;
  }

  .match-workspace.editing .match-archive[open] .match-archive-body {
    display: none;
  }

  .match-workspace.editing .match-archive[open] .match-archive-summary {
    border-bottom: 0;
  }

  .match-workspace.editing .expand-label {
    display: none;
  }

  .match-workspace.editing .match-score-with-rp {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    grid-template-columns: 58px max-content max-content 58px;
    align-items: center;
    justify-items: center;
    gap: 4px;
    margin-inline: auto;
    overflow: visible;
  }

  .match-workspace.editing .match-score-with-rp .rp-strip {
    display: inline-grid;
    grid-template-columns: repeat(6, 8px);
    align-items: center;
    justify-content: center;
    min-width: 58px;
    gap: 2px;
  }

  .match-workspace.editing .match-team-chip-group {
    display: grid;
    grid-template-columns: repeat(2, 84px);
    align-items: center;
    justify-content: center;
    justify-items: center;
    gap: 3px;
  }

  .match-workspace.editing .match-score-with-rp .rp-icon {
    width: 8px;
    height: 8px;
    border-radius: 999px;
  }

  .match-workspace.editing .match-score-with-rp .rp-icon svg {
    display: none;
  }

  .match-workspace.editing .match-score-badge:not(.match-score-with-rp) {
    grid-template-columns: max-content max-content;
  }

  .match-workspace.editing .match-score-badge > .red-score,
  .match-workspace.editing .match-score-badge > .blue-score {
    width: auto;
    min-width: 52px;
    padding: 0 2px;
  }

  .match-workspace.editing .match-team-chip {
    width: 84px;
    height: 28px;
    font-size: 16px;
  }

  .match-workspace.editing .match-archive-summary,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-archive-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "score"
      "teams";
    align-items: center;
    justify-items: stretch;
    min-height: 112px;
    padding: 14px 18px;
    gap: 8px;
    overflow: hidden;
  }

  .match-workspace.editing .match-summary-title,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-summary-title {
    position: relative;
    display: flex;
    grid-area: score;
    align-items: center;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 42px;
    justify-content: flex-start;
    overflow: visible;
  }

  .match-workspace.editing .match-summary-title > strong,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-summary-title > strong {
    min-width: 82px;
    font-size: 34px;
    line-height: 1;
  }

  .match-workspace.editing .match-score-separator,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-separator {
    margin-left: 2px;
    font-size: 30px;
  }

  .match-workspace.editing .match-score-with-rp,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-with-rp {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    grid-template-columns: 58px max-content max-content 58px;
    align-items: center;
    justify-items: center;
    gap: 6px;
    margin-inline: 0;
    max-width: none;
    overflow: visible;
  }

  .match-workspace.editing .match-score-badge,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-badge {
    font-size: 32px;
  }

  .match-workspace.editing .match-score-badge > .red-score,
  .match-workspace.editing .match-score-badge > .blue-score,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-badge > .red-score,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-score-badge > .blue-score {
    width: auto;
    min-width: 58px;
    padding: 0 2px;
  }

  .match-workspace.editing .match-score-with-rp .rp-strip,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-strip {
    display: inline-grid;
    grid-template-columns: repeat(6, 8px);
    align-items: center;
    justify-content: center;
    min-width: 58px;
    gap: 2px;
  }

  .match-workspace.editing .match-score-with-rp .rp-icon,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-icon {
    width: 8px;
    height: 8px;
    border-radius: 999px;
  }

  .match-workspace.editing .match-score-with-rp .rp-icon svg,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .rp-icon svg {
    display: none;
  }

  .match-workspace.editing .match-archive-right,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-archive-right {
    display: contents;
  }

  .match-workspace.editing .match-archive-teams,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-archive-teams {
    display: grid;
    grid-area: teams;
    grid-template-columns: 196px 38px 196px;
    align-items: center;
    justify-content: center;
    justify-items: center;
    width: 100%;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
  }

  .match-workspace.editing .match-team-chip-group,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-team-chip-group {
    display: grid;
    grid-template-columns: repeat(2, 94px);
    align-items: center;
    justify-content: center;
    justify-items: center;
    gap: 4px;
  }

  .match-workspace.editing .match-team-chip,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .match-team-chip {
    width: 94px;
    height: 32px;
    padding: 2px 6px;
    font-size: 18px;
  }

  .match-workspace.editing .expand-label,
  .match-groups:has(.match-archive[open]) .match-archive:not([open]) .expand-label {
    display: none;
  }
}

/* Portrait scouting should open straight into the editor, not the result list. */
@media (orientation: portrait) {
  .match-workspace.editing .match-list-panel {
    display: none;
  }

  .match-workspace.editing #matchForm {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    max-width: none;
    margin: 0;
  }
}
