:root {
  color-scheme: light;
  --color-primary: #111827;
  --color-secondary: #64748b;
  --color-tertiary: #0f7180;
  --color-canvas: #eef2f7;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafc;
  --color-border: #e5eaf2;
  --color-border-strong: #d8dde6;
  --color-accent: #0f7180;
  --color-accent-hover: #095d69;
  --color-accent-soft: #ecfeff;
  --color-success: #15803d;
  --color-success-soft: #f0fdf4;
  --color-warning: #b45309;
  --color-warning-soft: #fff7ed;
  --color-error: #b91c1c;
  --color-error-soft: #fef2f2;
  --color-focus-ring: #0f7180;
  --red: #c91828;
  --red-dark: #8f0f1b;
  --ink: var(--color-primary);
  --muted: var(--color-secondary);
  --line: var(--color-border-strong);
  --panel: var(--color-surface);
  --display-black: #08090c;
  --display-line: #303640;
  --digit-yellow: #f6d316;
  --digit-orange: #f39b20;
  --cyan: #20d6ef;
  --control-height: 34px;
  --field-action-height: 40px;
  --device-gutter: 10px;
  --card-padding: 10px;
  --font-event-title: 18px;
  --font-page-title: 16px;
  --font-section-title: 14px;
  --font-body: 14px;
  --font-body-small: 13px;
  --font-label: 12px;
  --font-caption: 11px;
  --font-metric: 16px;
  --weight-regular: 400;
  --weight-medium: 700;
  --weight-strong: 800;
  --radius-small: 4px;
  --radius-medium: 6px;
  --radius-large: 8px;
  --space-xs: 4px;
  --space-sm: 6px;
  --space-md: 8px;
  --space-lg: 10px;
  --space-xl: 12px;
  --workspace-list-width: 300px;
  --workspace-summary-item-width: 100px;
}

@media (min-width: 901px) and (max-width: 1120px) {
  :root {
    --workspace-list-width: 280px;
    --workspace-summary-item-width: 88px;
  }
}

/* Canonical device contracts. Component media rules must use one of these ranges. */
@media (max-width: 720px) and (min-height: 501px) {
  :root {
    --device-gutter: 6px;
    --card-padding: 8px;
    --control-height: 40px;
  }
}

@media (max-width: 980px) and (max-height: 500px) {
  :root {
    --device-gutter: 6px;
    --card-padding: 8px;
    --control-height: 40px;
    --workspace-list-width: 280px;
  }
}

@media (min-width: 721px) and (max-width: 900px) and (min-height: 501px),
       (min-width: 901px) and (max-width: 1120px) and (min-height: 501px) {
  :root {
    --device-gutter: 8px;
    --card-padding: 10px;
    --control-height: 34px;
    --workspace-list-width: 280px;
  }
}

@media (max-width: 720px) {
  .competition-picker-panel.picker-collapsed.mobile-collapsed {
    display: flex;
  }

  .match-selection-toolbar,
  .match-decision-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .match-selection-toolbar .primary-next-match-button {
    width: 100%;
  }

  .match-decision-actions {
    grid-template-columns: 1fr;
  }

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

  .match-forfeit-actions span {
    display: none;
  }

}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-body);
}

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

button {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  min-height: var(--control-height);
  padding: 6px 10px;
}

button:hover {
  background: var(--color-surface-subtle);
}

button:disabled {
  background: var(--color-surface-subtle);
  border-color: var(--color-border);
  color: var(--color-secondary);
  cursor: not-allowed;
  opacity: 1;
}

button:disabled:hover {
  background: var(--color-surface-subtle);
}

button:not(:disabled):active {
  filter: brightness(0.96);
}

button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-surface);
}

.global-feedback {
  align-items: flex-start;
  background: var(--color-primary);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  color: var(--color-surface);
  display: grid;
  gap: 3px;
  max-width: min(360px, calc(100vw - 24px));
  min-width: 220px;
  opacity: 0;
  padding: 11px 14px;
  pointer-events: none;
  position: fixed;
  right: 16px;
  top: 16px;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10000;
}

.global-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.global-feedback strong {
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  line-height: 1.2;
}

.global-feedback span {
  color: rgba(255, 255, 255, 0.86);
  font-size: var(--font-body-small);
  font-weight: 800;
  line-height: 1.35;
}

.global-feedback.pending {
  background: #1d4ed8;
}

.global-feedback.success {
  background: var(--color-success);
}

.global-feedback.error {
  background: var(--color-error);
}

button.danger {
  background: var(--color-error);
  border-color: var(--color-error);
  color: var(--color-surface);
}

input,
select,
textarea {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-medium);
  color: var(--color-primary);
  padding: 6px 8px;
  width: 100%;
}

a {
  color: #0f5db8;
}

.loading,
.display-loading {
  padding: 40px;
  text-align: center;
}

.control-body {
  background: var(--color-canvas);
  color: var(--color-primary);
}

.control-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.events-body {
  min-height: 100vh;
}

.events-app {
  margin: 0 auto;
  max-width: 1360px;
  min-height: 100vh;
  padding: clamp(10px, 1.4vw, 16px);
}

.events-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.events-header h1 {
  align-items: baseline;
  display: flex;
  font-size: var(--font-event-title);
  gap: 7px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.events-version-tip {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
}

.events-header p {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 6px;
  margin: 0;
}

.events-header-actions {
  align-items: stretch;
  display: flex;
  gap: var(--space-md);
}

.events-account-chip {
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-large);
  display: flex;
  gap: var(--space-md);
  padding: 6px 8px 6px 12px;
}

.events-account-chip span {
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-account-name {
  background: transparent;
  border: 0;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  max-width: 160px;
  min-height: 30px;
  overflow: hidden;
  padding-inline: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-account-chip button {
  min-height: 30px;
}

.account-workspace {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-large);
  min-height: 520px;
  overflow: hidden;
}

.account-workspace-head {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  padding: 20px 22px;
}

.account-workspace-head h2 {
  font-size: 22px;
  margin: 4px 0 5px;
}

.account-workspace-head p {
  color: var(--color-secondary);
  font-size: var(--font-body-small);
  margin: 0;
}

.account-workspace-kicker {
  color: var(--color-tertiary);
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.account-organization-tabs {
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 22px 0;
}

.account-organization-tabs button {
  background: transparent;
  border-color: transparent;
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
  white-space: nowrap;
}

.account-organization-tabs button.active {
  background: var(--color-canvas);
  border-color: var(--color-border);
  border-bottom-color: var(--color-canvas);
}

.account-workspace-sections {
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 18px;
  padding: 0 22px;
}

.account-workspace-sections button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--color-secondary);
  font-weight: var(--weight-strong);
  min-height: 44px;
  padding-inline: 2px;
}

.account-workspace-sections button.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary);
}

.account-profile {
  display: grid;
  gap: 20px;
  padding: 20px 22px 26px;
}

.account-profile-summary {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding-bottom: 18px;
}

.account-profile-summary > div,
.account-security > div,
.account-password-form label {
  display: grid;
  gap: 5px;
}

.account-profile-summary > div span,
.account-security > div span,
.account-password-form label span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-security {
  display: grid;
  gap: 14px;
}

.account-password-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
}

.account-password-form input,
.account-password-form button {
  min-height: 40px;
}

.account-inline-error {
  background: var(--color-error-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-medium);
  color: var(--color-error);
  font-size: var(--font-body-small);
  margin: 0;
  max-width: 520px;
  padding: 9px 10px;
}

.account-mfa-setup {
  align-items: end;
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(230px, 1fr) minmax(160px, 220px) auto;
  padding: 12px;
}

.account-recovery-codes {
  border: 1px solid #b7e4c7;
  border-radius: var(--radius-medium);
  display: grid;
  gap: 14px;
  max-width: 640px;
  padding: 18px;
}

.account-recovery-codes > div {
  display: grid;
  gap: 5px;
}

.account-recovery-codes span {
  color: var(--color-secondary);
  font-size: var(--font-body-small);
}

.account-recovery-codes pre {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  font: 700 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 0;
  padding: 14px;
}

.account-mfa-setup p {
  color: var(--color-secondary);
  grid-column: 1 / -1;
  margin: 0;
}

.account-mfa-setup code {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  font-size: var(--font-body-small);
  letter-spacing: .08em;
  overflow-wrap: anywhere;
  padding: 10px;
}

.account-mfa-setup label,
.account-organization-create label,
.account-plan-editor label,
.account-danger-zone label {
  display: grid;
  gap: 5px;
}

.account-mfa-setup label span,
.account-organization-create label span,
.account-plan-editor label span,
.account-danger-zone label span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-organization-create {
  align-items: end;
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, 1fr) minmax(180px, 1fr) minmax(160px, .8fr) 150px auto;
  padding: 16px 22px;
}

.account-organization-create > div {
  display: grid;
  gap: 5px;
}

.account-organization-create > div span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-organization-settings-list {
  display: grid;
  gap: 14px;
  padding: 18px 22px 24px;
}

.account-organization-settings {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.account-organization-settings.pending-deletion {
  background: #fff9ec;
  border-color: #ead7aa;
}

.account-organization-settings > header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.account-organization-settings h3,
.account-organization-settings p {
  margin: 0;
}

.account-organization-settings header p {
  color: var(--color-secondary);
  font-size: var(--font-label);
  margin-top: 4px;
}

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

.account-capacity-grid > div {
  display: grid;
  gap: 7px;
}

.account-capacity-grid span {
  color: var(--color-secondary);
  display: flex;
  font-size: var(--font-label);
  justify-content: space-between;
}

.account-capacity-grid i {
  background: var(--color-canvas);
  border-radius: 999px;
  display: block;
  height: 6px;
  overflow: hidden;
}

.account-capacity-grid b {
  background: var(--color-primary);
  display: block;
  height: 100%;
}

.account-plan-editor,
.account-deletion-panel {
  align-items: end;
  display: flex;
  gap: 10px;
}

.account-plan-editor label {
  min-width: 220px;
}

.account-pending-invitations {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.account-pending-invitations > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.account-deletion-panel {
  background: #fff2d9;
  border-radius: var(--radius-medium);
  justify-content: space-between;
  padding: 10px 12px;
}

.account-danger-zone {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.account-danger-zone summary {
  color: var(--color-error);
  cursor: pointer;
  font-weight: var(--weight-strong);
}

.account-danger-zone p {
  color: var(--color-secondary);
  margin: 10px 0;
}

.account-danger-zone[open] {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.account-danger-zone[open] summary,
.account-danger-zone[open] p {
  grid-column: 1 / -1;
}

.account-member-mode {
  background: var(--color-canvas);
  display: flex;
  gap: 4px;
  padding: 14px 22px 0;
}

.account-audit-toolbar {
  align-items: end;
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(210px, 1fr) 140px minmax(170px, .8fr) minmax(150px, .7fr) auto;
  padding: 16px 22px;
}

.account-audit-toolbar > div,
.account-audit-toolbar label {
  display: grid;
  gap: 5px;
}

.account-audit-toolbar > div span,
.account-audit-toolbar label span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-audit-toolbar select,
.account-audit-toolbar button {
  min-height: 40px;
}

.account-audit-list {
  display: grid;
  padding: 6px 22px 24px;
}

.account-audit-item {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 12px;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  min-height: 72px;
  padding: 12px 2px;
}

.account-audit-marker {
  background: var(--color-primary);
  border-radius: 999px;
  height: 8px;
  width: 8px;
}

.account-audit-marker.account {
  background: #18783c;
}

.account-audit-marker.member {
  background: #36657e;
}

.account-audit-marker.access {
  background: #9a6414;
}

.account-audit-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.account-audit-main > div,
.account-audit-main p {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.account-audit-main p {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-audit-main p span + span::before {
  color: var(--color-tertiary);
  content: "·";
  margin-right: 7px;
}

.account-audit-type {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-secondary);
  font-size: var(--font-label);
  padding: 2px 7px;
}

.account-audit-item time {
  color: var(--color-tertiary);
  font-size: var(--font-label);
  white-space: nowrap;
}

.account-audit-empty {
  color: var(--color-secondary);
  margin: 0;
  padding: 40px 0;
  text-align: center;
}

.account-audit-more {
  justify-self: center;
  margin-top: 16px;
}

.account-member-mode button {
  background: transparent;
  border-color: transparent;
}

.account-member-mode button.active {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

.account-member-add {
  align-items: end;
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-border);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) 150px auto;
  padding: 16px 22px;
}

.account-member-add.managed {
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) minmax(190px, 1.1fr) minmax(150px, .9fr) 140px auto;
}

.account-member-add > div,
.account-member-add label {
  display: grid;
  gap: 5px;
}

.account-member-add > div span,
.account-member-add label span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-member-add input,
.account-member-add select,
.account-member-add button {
  min-height: 40px;
}

.account-member-list {
  display: grid;
  gap: 12px;
  padding: 18px 22px 24px;
}

.account-member-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  overflow: hidden;
}

.account-member-card > header {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  padding: 14px;
}

.account-member-tags,
.account-member-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.account-status-tag {
  background: #e8f7ee;
  border: 1px solid #b7e4c7;
  border-radius: 999px;
  color: #18783c;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 5px 9px;
  white-space: nowrap;
}

.account-status-tag.disabled {
  background: #f4f5f7;
  border-color: var(--color-border);
  color: var(--color-secondary);
}

.account-status-tag.external {
  background: #edf5fb;
  border-color: #c7ddeb;
  color: #36657e;
}

.account-password-editor {
  align-items: end;
  background: #fff9ec;
  border-top: 1px solid #ead7aa;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 360px) auto auto;
  padding: 12px 14px;
}

.account-password-editor label {
  display: grid;
  gap: 5px;
}

.account-password-editor label span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-owner-transfer {
  align-items: end;
  background: var(--color-error-soft);
  border-top: 1px solid #fecaca;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 280px) auto auto;
  padding: 12px 14px;
}

.account-owner-transfer > div,
.account-owner-transfer label {
  display: grid;
  gap: 5px;
}

.account-owner-transfer > div span,
.account-owner-transfer label span {
  color: var(--color-secondary);
  font-size: var(--font-label);
}

.account-owner-transfer .account-inline-error {
  grid-column: 1 / -1;
}

.account-member-card h3,
.account-member-card p {
  margin: 0;
}

.account-member-card header p {
  color: var(--color-secondary);
  font-size: var(--font-label);
  margin-top: 3px;
}

.account-member-avatar {
  align-items: center;
  background: var(--color-primary);
  border-radius: 50%;
  color: var(--color-surface);
  display: inline-flex;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  height: 36px;
  justify-content: center;
  width: 36px;
}

.account-role-tag {
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 5px 9px;
}

.account-member-scope,
.account-access-list {
  background: var(--color-canvas);
  border-top: 1px solid var(--color-border);
  color: var(--color-secondary);
  font-size: var(--font-body-small);
  padding: 12px 14px;
}

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

.account-access-list > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.account-access-list span {
  align-items: baseline;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.account-access-list em {
  color: var(--color-secondary);
  font-size: var(--font-label);
  font-style: normal;
}

.account-access-editor {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(200px, 1fr) 140px 110px auto;
  padding: 12px 14px;
}

.account-access-editor select,
.account-access-editor button {
  min-height: 38px;
}

.events-enter-current {
  align-items: flex-start;
  background: #111827;
  border: 1px solid #111827;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 3px;
  min-width: 260px;
  padding: 10px 14px;
  text-decoration: none;
}

.events-enter-current span {
  color: #cbd5e1;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.events-enter-current strong {
  color: #ffffff;
  font-size: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-enter-current em {
  color: #94a3b8;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: 800;
}

.events-create-panel {
  align-items: start;
  display: grid;
  gap: clamp(10px, 1.2vw, 14px);
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1.66fr);
  margin-bottom: 12px;
}

.events-create-panel h2,
.events-create-panel p {
  margin-bottom: 6px;
}

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

.event-form.compact {
  align-items: end;
  grid-template-columns: minmax(240px, 1.4fr) minmax(96px, 0.52fr) minmax(140px, 0.7fr) repeat(2, minmax(140px, 0.9fr)) minmax(96px, auto);
}

.events-create-actions {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.event-backup-import {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 0.82fr) auto;
  padding: 10px;
}

.event-backup-import div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.event-backup-import strong {
  color: #111827;
  font-size: var(--font-body);
}

.event-backup-import span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.event-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.event-form label span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.events-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

@media (max-width: 1240px) {
  .events-create-panel {
    grid-template-columns: 1fr;
  }

  .events-create-actions {
    grid-template-columns: 1fr;
  }

  .event-form.compact {
    grid-template-columns: minmax(260px, 1.3fr) minmax(100px, 0.5fr) minmax(150px, 0.7fr);
  }

  .event-form.compact button {
    min-height: var(--control-height);
  }

  .event-backup-import {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) auto;
  }
}

@media (max-width: 720px) {
  .events-grid {
    grid-template-columns: 1fr;
  }

  .event-form.compact,
  .event-backup-import {
    grid-template-columns: 1fr;
  }
}

.event-card {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 9px;
  min-height: 230px;
  padding: 11px 12px 10px;
  position: relative;
}

.event-card::before {
  background: #94a3b8;
  border-radius: 8px 0 0 8px;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 5px;
}

.event-card.active {
  border-color: #111827;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.event-card.active::before {
  background: #111827;
}

.event-card.archived {
  background: #f8fafc;
}

.event-card.archived::before {
  background: #94a3b8;
}

.event-card-head {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  padding-left: 2px;
}

.event-title-row {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.event-title-row strong {
  background: #111827;
  border-radius: 999px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: var(--font-caption);
  line-height: 1;
  padding: 4px 6px;
}

.event-card h2 {
  font-size: 16px;
  line-height: 1.25;
  margin: 0 0 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card p,
.event-meta-line {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-meta-line {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.event-meta-line strong {
  color: #111827;
}

.event-phase {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  color: #0e7490;
  flex: 0 0 auto;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 5px 8px;
}

.event-phase.archived {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.event-phase.draft {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.event-phase.prep,
.event-phase.draw {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.event-phase.schedule,
.event-phase.running {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.event-phase.partial,
.event-phase.results {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.event-phase.ended {
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}

.event-card.ended {
  border-color: #fde68a;
}

.event-card.ended::before {
  background: #eab308;
}

.event-card.prep::before,
.event-card.draw::before {
  background: #2563eb;
}

.event-card.schedule::before,
.event-card.running::before {
  background: #f97316;
}

.event-card.partial::before,
.event-card.results::before {
  background: #16a34a;
}

.event-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, 1fr);
}

.event-stats div {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  padding: 6px 7px;
}

.event-stats span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.event-stats strong {
  font-size: 16px;
  line-height: 1.1;
}

.event-guide {
  align-items: center;
  background: #fbfdff;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 9px;
}

.event-guide.active {
  background: #f9fafb;
  border-color: #111827;
}

.event-guide div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.event-guide strong {
  color: #111827;
  font-size: var(--font-body-small);
  line-height: 1.25;
}

.event-guide span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-primary-action {
  align-items: center;
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  justify-content: center;
  min-height: var(--control-height);
  padding: 5px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.event-primary-action:hover {
  background: #0f172a;
}

.event-primary-action:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  color: #ffffff;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.event-actions button {
  font-size: var(--font-label);
  min-height: var(--control-height);
  padding: 4px 8px;
}

.event-actions .warning-button {
  width: auto;
}

.event-edit-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(900px, calc(100dvh - 32px));
  max-height: min(900px, calc(100dvh - 32px));
  max-width: min(1180px, 94vw);
  overflow: hidden;
  padding: 14px;
  width: 100%;
}

.modal-head,
.modal-actions {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0 0 4px;
}

.modal-head p {
  color: var(--muted);
  margin: 0;
}

.modal-actions {
  justify-content: flex-end;
}

.modal-action-note {
  align-self: center;
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  line-height: 1.4;
  margin-right: auto;
}

.event-config-layout {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.event-config-tabs {
  background: #f8fafc;
  border-right: 1px solid #e5eaf2;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px;
}

.event-config-tabs button {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.event-config-content {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.event-config-pane {
  display: none;
}

.event-config-pane.active {
  display: block;
}

.event-config-section {
  display: grid;
  gap: 10px;
}

.event-config-section h3 {
  display: block;
  font-size: var(--font-section-title);
  margin: 0 0 4px;
}

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

.event-config-grid label,
.event-switch-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.event-config-grid label span,
.event-switch-field span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.event-config-grid label small,
.event-switch-field small {
  color: #94a3b8;
  display: block;
  font-size: var(--font-caption);
  font-weight: 800;
  line-height: 1.35;
  margin-top: 3px;
}

.event-config-grid textarea {
  min-height: 150px;
  resize: vertical;
}

.event-config-grid .config-textarea-field {
  grid-column: 1 / -1;
}

.event-config-notice {
  border: 1px solid;
  border-radius: 8px;
  font-size: var(--font-body-small);
  font-weight: 800;
  line-height: 1.45;
  padding: 8px 10px;
}

.event-config-notice.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.event-config-notice.locked {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.charter-editor {
  gap: 10px;
}

.charter-editor .event-config-notice {
  padding: 6px 8px;
}

.charter-editor-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.charter-import-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.charter-import-actions button {
  min-height: var(--control-height);
  padding: 4px 9px;
  width: auto;
}

.charter-rule-block {
  background: #fbfcfe;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 8px;
}

.charter-rule-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.charter-rule-heading h4 {
  color: #0f172a;
  font-size: var(--font-body-small);
  margin: 0 0 1px;
}

.charter-rule-heading p {
  color: #64748b;
  font-size: var(--font-caption);
  margin: 0;
}

.charter-rule-heading > span {
  background: #e2e8f0;
  border-radius: 999px;
  color: #475569;
  flex: 0 0 auto;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  padding: 2px 7px;
}

.charter-column-head {
  align-items: center;
  color: #94a3b8;
  display: grid;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) 126px;
  min-width: 1300px;
  padding: 0 7px;
}

.charter-column-head > span:last-child {
  background: #fbfcfe;
  position: sticky;
  right: 0;
  text-align: right;
  z-index: 2;
}

.charter-column-head .charter-rule-fields {
  align-items: center;
}

.charter-rule-list {
  display: grid;
  gap: 4px;
  overflow: visible;
  padding-bottom: 1px;
}

.charter-rule-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) 126px;
  min-width: 1300px;
  padding: 5px 7px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.charter-rule-row.is-dirty {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

.charter-rule-fields {
  align-items: center;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.charter-unified-fields {
  grid-template-columns: 64px 138px 130px 84px 174px minmax(560px, 1fr);
}

.charter-rule-fields label {
  display: block;
  min-width: 0;
}

.charter-rule-row .charter-rule-fields label > span,
.charter-rule-row .charter-field-label {
  display: none;
}

.charter-rule-fields input,
.charter-rule-fields select {
  min-height: var(--control-height);
  min-width: 0;
  padding: 4px 7px;
  width: 100%;
}

.charter-range-inputs {
  align-items: center;
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.charter-range-inputs i {
  color: #94a3b8;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: 800;
}

.charter-rule-actions {
  align-items: center;
  background: #ffffff;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  min-width: 126px;
  padding-left: 5px;
  position: sticky;
  right: 0;
  z-index: 2;
}

.charter-rule-row.is-dirty .charter-rule-actions {
  background: #ffffff;
}

.charter-row-status {
  color: #2563eb;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  white-space: nowrap;
}

.charter-rule-row:not(.is-dirty) .charter-row-status {
  display: none;
}

.charter-rule-actions button,
.charter-weight-add button {
  min-height: var(--control-height);
  padding: 4px 8px;
  width: auto;
}

.charter-delete-button:not(:disabled) {
  background: #ffffff;
  border-color: #fecaca;
  color: #dc2626;
}

.charter-add-row {
  background: #ffffff;
  border: 1px dashed #93c5fd;
  color: #2563eb;
  justify-self: start;
  min-height: var(--control-height);
  padding: 4px 10px;
  width: auto;
}

.charter-kata-weight {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  padding-left: 4px;
}

.charter-kata-time {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  padding-left: 4px;
}

.charter-time-fields {
  align-items: center;
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr 1fr;
}

.charter-time-fields label {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: grid;
  gap: 3px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 2px 4px;
}

.charter-rule-row .charter-time-fields label > span {
  color: #64748b;
  display: block;
  font-size: var(--font-caption);
  font-weight: 800;
}

.charter-time-fields input {
  background: transparent;
  border: 0;
  min-height: 24px;
  padding: 2px;
  text-align: right;
}

.charter-time-fields i {
  color: #64748b;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: 800;
}

.charter-weight-groups {
  align-items: center;
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
  white-space: nowrap;
}

.charter-weight-inline-group {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 2px 3px;
}

.charter-weight-inline-group > select {
  min-height: 26px;
  padding: 2px 4px;
  width: 66px;
}

.charter-weight-chips {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-height: 30px;
  overflow: visible;
  white-space: nowrap;
}

.charter-weight-chip {
  align-items: center;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  display: inline-flex;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  gap: 3px;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 2px 4px 2px 8px;
}

.charter-weight-chip button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6366f1;
  display: inline-flex;
  font-size: 15px;
  height: 20px;
  justify-content: center;
  min-height: 0;
  padding: 0;
  width: 20px;
}

.charter-weight-chip button:disabled {
  color: #a5b4fc;
}

.charter-weight-add {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.charter-weight-add input {
  min-width: 64px;
  width: 64px;
}

.charter-add-gender,
.charter-remove-gender {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 2px 6px;
  width: auto;
}

.charter-add-gender {
  background: #ffffff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.charter-remove-gender:not(:disabled) {
  background: transparent;
  border: 0;
  color: #dc2626;
  font-size: 15px;
  padding: 0 4px;
}

/* Event settings workspace */
.event-settings-screen {
  background: #f4f7fb;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  inset: 0;
  position: fixed;
  z-index: 100;
}

.event-settings-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #dbe3ee;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px clamp(14px, 2.5vw, 34px);
}

.event-settings-heading,
.event-settings-save {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.event-settings-heading h2 {
  font-size: 18px;
  margin: 0 0 2px;
}

.event-settings-heading p,
.event-settings-save > span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  margin: 0;
}

.event-settings-save > span {
  min-width: 110px;
  text-align: right;
}

.event-settings-screen.has-unsaved-changes .event-settings-save > span {
  color: #b45309;
}

.event-settings-save button,
.event-settings-back {
  min-height: 34px;
  width: auto;
}

.event-settings-back {
  align-items: center;
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
  display: inline-flex;
  font-size: 18px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.event-settings-body {
  min-height: 0;
  padding: 12px clamp(10px, 2vw, 24px) 18px;
}

.event-settings-screen .event-config-layout {
  background: #ffffff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
  grid-template-columns: 184px minmax(0, 1fr);
  height: 100%;
  margin: 0 auto;
  max-width: 1580px;
}

.event-settings-screen .event-config-tabs {
  align-content: start;
  gap: 3px;
  padding: 14px 10px;
}

.event-config-nav-label {
  color: #94a3b8;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  padding: 3px 9px 8px;
}

.event-settings-screen .event-config-tabs button {
  background: transparent;
  border-color: transparent;
  color: #475569;
  min-height: 38px;
  padding: 7px 10px;
  position: relative;
}

.event-settings-screen .event-config-tabs button:hover {
  background: #eef2f7;
}

.event-settings-screen .event-config-tabs button.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.event-settings-screen .event-config-tabs button.is-dirty::after {
  background: #f59e0b;
  border: 2px solid #ffffff;
  border-radius: 50%;
  content: '';
  height: 9px;
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
}

.event-settings-screen .event-config-content {
  background: #ffffff;
  padding: clamp(16px, 2vw, 28px);
}

.event-config-stack {
  display: grid;
  gap: 28px;
}

.event-config-stack > .event-config-section + .event-config-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
}

.settings-overview {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 980px;
}

.settings-overview-hero {
  align-items: center;
  background: #111827;
  border-radius: 10px;
  color: #ffffff;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 22px 24px;
}

.settings-overview-hero span {
  color: #94a3b8;
  display: block;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  margin-bottom: 5px;
}

.settings-overview-hero h3 {
  font-size: var(--font-page-title);
  margin: 0 0 5px;
}

.settings-overview-hero p {
  color: #cbd5e1;
  font-size: var(--font-label);
  font-weight: 700;
  margin: 0;
}

.settings-overview-phase {
  border-left: 1px solid #334155;
  flex: 0 0 auto;
  min-width: 130px;
  padding-left: 20px;
}

.settings-overview-phase strong {
  font-size: var(--font-body);
}

.settings-readiness-list {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  display: grid;
  overflow: hidden;
}

.settings-readiness-item {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #e5eaf2;
  border-radius: 0;
  color: #0f172a;
  display: grid;
  gap: 12px;
  grid-template-columns: 10px minmax(0, 1fr) auto 14px;
  min-height: 68px;
  padding: 11px 16px;
  text-align: left;
  width: 100%;
}

.settings-readiness-item:last-child {
  border-bottom: 0;
}

.settings-readiness-item:hover {
  background: #f8fafc;
}

.settings-readiness-mark {
  background: #16a34a;
  border-radius: 50%;
  height: 9px;
  width: 9px;
}

.settings-readiness-item.recommended .settings-readiness-mark {
  background: #f59e0b;
}

.settings-readiness-item.required .settings-readiness-mark {
  background: #dc2626;
}

.settings-readiness-copy {
  display: grid;
  gap: 3px;
}

.settings-readiness-copy strong {
  font-size: var(--font-body);
}

.settings-readiness-copy small {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 700;
}

.settings-readiness-state {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #15803d;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  padding: 4px 8px;
}

.settings-readiness-item.recommended .settings-readiness-state {
  background: #fffbeb;
  border-color: #fde68a;
  color: #a16207;
}

.settings-readiness-arrow {
  color: #94a3b8;
  font-size: 20px;
}

.event-settings-screen .charter-rule-block {
  overflow: visible;
}

.event-settings-screen .charter-column-head,
.event-settings-screen .charter-rule-row {
  min-width: 0;
}

.charter-summary-head,
.charter-rule-summary {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 130px minmax(150px, 0.75fr) 160px minmax(220px, 1fr) 178px;
}

.charter-summary-head {
  padding: 0 12px;
}

.event-settings-screen .charter-rule-row {
  display: block;
  padding: 0;
}

.charter-rule-summary {
  min-height: 62px;
  padding: 8px 11px;
}

.charter-summary-project,
.charter-summary-name,
.charter-summary-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.charter-rule-summary strong {
  color: #1e293b;
  font-size: var(--font-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charter-summary-project > strong {
  color: #0f7180;
  font-size: var(--font-body-small);
}

.charter-rule-summary small {
  color: #94a3b8;
  font-size: var(--font-caption);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charter-summary-actions {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.charter-summary-actions button {
  min-height: var(--control-height);
  padding: 4px 8px;
  width: auto;
}

.charter-summary-actions .charter-row-status {
  color: #b45309;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
}

.charter-rule-row:not(.is-dirty) .charter-summary-actions .charter-row-status {
  display: none;
}

.charter-rule-editor {
  background: #f8fafc;
  border-top: 1px solid #dbe3ee;
  display: none;
  gap: 14px;
  padding: 14px;
}

.charter-rule-row.is-expanded .charter-rule-editor {
  animation: charter-editor-enter 170ms ease-out;
  display: grid;
}

.charter-editor-fields {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: 84px 160px minmax(150px, 1fr) 110px 250px;
}

.charter-editor-fields > label,
.charter-edit-time label,
.charter-static-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.charter-editor-fields label > span,
.charter-static-field > span,
.charter-editor-weights-head > span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.charter-editor-fields input,
.charter-editor-fields select {
  min-height: 34px;
  width: 100%;
}

.charter-edit-time {
  display: grid;
  gap: 7px;
  grid-template-columns: 1fr 1fr;
}

.charter-kata-names {
  display: grid;
  gap: 9px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.charter-kata-names label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.charter-kata-names label > span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.charter-number-unit {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.charter-number-unit i {
  color: #64748b;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
}

.charter-static-field strong {
  align-items: center;
  color: #475569;
  display: flex;
  min-height: 34px;
}

.charter-editor-weights {
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.charter-editor-weights-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.charter-editor-weights-head > strong {
  color: #64748b;
  font-size: var(--font-label);
}

.charter-editor-weights .charter-weight-groups {
  align-items: stretch;
  flex-wrap: wrap;
  overflow: visible;
}

@keyframes charter-editor-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .event-settings-screen .event-config-layout {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .charter-summary-head,
  .charter-rule-summary {
    grid-template-columns: 108px minmax(130px, 1fr) 140px 178px;
  }

  .charter-summary-head > span:nth-child(4),
  .charter-summary-weight {
    display: none;
  }

  .charter-editor-fields {
    grid-template-columns: 80px 150px minmax(140px, 1fr) 100px;
  }

  .charter-edit-time,
  .charter-static-field {
    grid-column: 1 / -1;
    max-width: 300px;
  }
}

@media (max-width: 720px) {
  .event-settings-header {
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .event-settings-heading p,
  .event-settings-save > span,
  .event-settings-save .secondary {
    display: none;
  }

  .event-settings-heading h2 {
    font-size: 16px;
  }

  .event-settings-save {
    margin-left: auto;
  }

  .event-settings-body {
    padding: 0;
  }

  .event-settings-screen .event-config-layout {
    border: 0;
    border-radius: 0;
    grid-template-columns: 1fr;
  }

  .event-settings-screen .event-config-tabs {
    align-items: center;
    border-bottom: 1px solid #dbe3ee;
    border-right: 0;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 7px 9px;
  }

  .event-config-nav-label {
    display: none;
  }

  .event-settings-screen .event-config-tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px;
    width: auto;
  }

  .event-settings-screen .event-config-content {
    padding: 12px 10px 24px;
  }

  .settings-overview-hero {
    align-items: flex-start;
    padding: 18px;
  }

  .settings-overview-hero h3 {
    font-size: var(--font-page-title);
  }

  .settings-overview-phase {
    display: none;
  }

  .settings-readiness-item {
    gap: 8px;
    grid-template-columns: 9px minmax(0, 1fr) 12px;
    padding: 10px 12px;
  }

  .settings-readiness-state {
    display: none;
  }

  .charter-editor-title {
    align-items: stretch;
    flex-direction: column;
  }

  .charter-import-actions {
    overflow-x: auto;
  }

  .charter-summary-head {
    display: none;
  }

  .charter-rule-summary {
    gap: 5px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .charter-summary-project {
    grid-column: 1;
    grid-row: 1;
  }

  .charter-summary-name {
    grid-column: 1;
    grid-row: 2;
  }

  .charter-summary-time {
    grid-column: 1;
    grid-row: 3;
  }

  .charter-summary-weight {
    display: none;
  }

  .charter-summary-actions {
    align-self: center;
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .charter-summary-actions .charter-row-status,
  .charter-summary-actions .charter-delete-button {
    display: none;
  }

  .charter-editor-fields,
  .charter-edit-time,
  .charter-kata-names {
    grid-template-columns: 1fr;
  }

  .charter-edit-time,
  .charter-static-field {
    max-width: none;
  }

  .charter-editor-weights .charter-weight-groups {
    display: grid;
  }

  .charter-weight-inline-group {
    align-items: stretch;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    width: 100%;
  }

  .charter-weight-chips {
    flex-wrap: wrap;
    white-space: normal;
  }
}

.event-switch-field {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 8px;
}

.event-switch-field input {
  height: 18px;
  width: 18px;
}

.event-config-grid input:disabled,
.event-config-grid select:disabled,
.event-config-grid textarea:disabled,
.event-form input:disabled,
.event-form select:disabled,
.event-switch-field input:disabled {
  background: #f1f5f9;
  color: #64748b;
}

.control-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, auto) minmax(360px, 1fr) auto;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 8;
}

.control-header h1 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-brand {
  min-width: 0;
}

.control-header p {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.connection-dot {
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.connection-dot.online {
  background: #16a34a;
}

.header-tabs {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
}

.header-tabs button {
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
  min-height: 34px;
  white-space: nowrap;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.court-toggle-button {
  align-items: center;
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  display: inline-flex;
  gap: 6px;
  font-weight: var(--weight-strong);
  justify-content: center;
  min-width: 92px;
  white-space: nowrap;
}

.court-toggle-button svg {
  display: block;
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.court-toggle-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.court-toggle-button:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.lan-access {
  position: relative;
}

.lan-access > button {
  font-weight: 800;
  white-space: nowrap;
}

.header-icon-button,
.header-actions .header-icon-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 var(--control-height, 34px);
  height: var(--control-height, 34px);
  justify-content: center;
  min-height: var(--control-height, 34px);
  min-width: var(--control-height, 34px);
  padding: 0;
  width: var(--control-height, 34px);
}

.header-icon-button svg {
  display: block;
  height: 17px;
  width: 17px;
}

.header-icon-button path,
.header-icon-button rect {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.header-actions .mobile-menu-toggle,
.mobile-header-context,
.mobile-header-menu-scrim {
  display: none;
}

.lan-popover {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 10px;
  max-height: min(78vh, 720px);
  min-width: min(640px, calc(100vw - 32px));
  overflow: auto;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.lan-popover-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lan-popover h3 {
  display: block;
  font-size: var(--font-section-title);
  margin: 0;
}

.lan-host-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.lan-host-switch button {
  font-size: var(--font-label);
  min-height: var(--control-height);
  padding: 4px 8px;
}

.lan-host-switch button.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.lan-popover em {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: 800;
  overflow: hidden;
  padding: 7px 8px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lan-entry-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.lan-entry-card {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  color: #111827;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 8px;
}

.lan-qr-target {
  border-radius: 6px;
  display: block;
  line-height: 0;
}

.lan-entry-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.lan-entry-info strong {
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.lan-entry-info code {
  background: #ffffff;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  color: #0f5db8;
  display: block;
  font-size: var(--font-caption);
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  padding: 5px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lan-entry-info button {
  font-size: var(--font-label);
  min-height: var(--control-height);
  padding: 4px 8px;
  width: fit-content;
}

.qr-code {
  display: block;
  height: clamp(72px, 8vw, 104px);
  shape-rendering: crispEdges;
  width: clamp(72px, 8vw, 104px);
}

.qr-fallback {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  display: flex;
  font-size: var(--font-label);
  font-weight: 800;
  height: clamp(72px, 8vw, 104px);
  justify-content: center;
  padding: 8px;
  text-align: center;
  width: clamp(72px, 8vw, 104px);
}

.overview-strip {
  align-items: stretch;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(78px, 0.42fr)) repeat(2, minmax(220px, 1fr));
  padding: 8px 12px;
}

.overview-metric,
.overview-court {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  min-width: 0;
  padding: 7px 8px;
}

.overview-metric span,
.overview-court span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  line-height: 1.1;
}

.overview-metric strong,
.overview-court strong {
  color: #111827;
  display: block;
  font-size: 16px;
  line-height: 1.2;
  margin-top: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-court.active {
  border-color: #111827;
}

.overview-court strong {
  font-size: var(--font-body-small);
}

.status-pill {
  background: #111827;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 700;
  padding: 10px 14px;
}

.control-grid {
  align-items: start;
  display: grid;
  gap: var(--device-gutter);
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  padding: var(--device-gutter);
}

.people-workspace {
  display: grid;
  flex: 1 1 auto;
  gap: var(--device-gutter);
  grid-template-columns: var(--workspace-list-width) minmax(460px, 1fr) 280px;
  grid-template-rows: auto minmax(0, 1fr);
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: var(--device-gutter);
}

.people-workspace > .module {
  min-height: 0;
}

.people-topbar {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  min-height: 0;
  overflow: hidden;
}

.people-topbar .player-table-wrap {
  max-height: calc(100dvh - 360px);
  min-height: 0;
}

.roster-filter-bar {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  padding: 8px 10px;
}

.roster-filter-bar strong {
  align-self: center;
  flex: 0 0 auto;
  font-size: var(--font-body-small);
  margin-right: 4px;
  white-space: nowrap;
}

.roster-filter-bar label {
  align-items: center;
  display: flex;
  flex: 0 1 150px;
  gap: 6px;
  min-width: 0;
}

.roster-filter-bar .roster-filter-unit {
  flex-basis: 240px;
}

.roster-filter-bar label span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  flex: 0 0 auto;
}

.roster-filter-bar select {
  flex: 1 1 auto;
  min-height: 34px;
  min-width: 0;
  padding: 6px 8px;
}

.people-roster-panel {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  overflow: hidden;
}

.people-roster-inline {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.people-roster-inline strong {
  display: block;
  font-size: var(--font-body);
}

.people-roster-inline span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: 800;
  margin-top: 2px;
}

.people-roster-inline button {
  flex: 0 0 auto;
}

.people-roster-maintenance {
  border-top: 1px solid #e5eaf2;
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 10px 12px 12px;
}

.people-roster-drawer {
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  grid-column: 1 / -1;
  inset: 0;
  padding: 88px 18px 18px;
  position: fixed;
  z-index: 28;
}

.people-roster-drawer-panel {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.people-roster-drawer-panel > header {
  align-items: flex-start;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.people-roster-drawer-panel h2 {
  margin: 0 0 4px;
}

.people-detail-backdrop {
  background: rgba(15, 23, 42, 0.24);
  inset: 0;
  position: fixed;
  z-index: 31;
}

.people-detail-drawer {
  background: #ffffff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, 0.2);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  max-width: calc(100vw - 24px);
  position: fixed;
  right: 0;
  top: 0;
  width: 420px;
  z-index: 32;
}

.people-detail-drawer > header {
  align-items: center;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.people-detail-drawer > header span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  margin-bottom: 3px;
}

.people-detail-drawer > header h2 {
  font-size: 18px;
  margin: 0;
}

.people-detail-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 14px 16px 24px;
}

.people-detail-body > section {
  align-content: start;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.people-detail-body h3 {
  font-size: var(--font-body);
  margin: 0;
}

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

.people-detail-grid > div {
  background: #ffffff;
  border: 1px solid #e5eaf2;
  border-radius: 7px;
  min-width: 0;
  padding: 8px 9px;
}

.people-detail-grid > div.wide {
  grid-column: 1 / -1;
}

.people-detail-grid dt {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.people-detail-grid dd {
  color: #111827;
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
  line-height: 1.4;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.people-roster-drawer .people-roster-maintenance {
  border-top: 0;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 12px 16px 16px;
}

.people-roster-drawer .player-table-wrap {
  max-height: none;
  min-height: 0;
}

.people-roster-drawer .player-table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
}

.people-roster-drawer .player-table-wrap th {
  box-shadow: 0 1px 0 #e5eaf2;
  isolation: isolate;
  z-index: 3;
}

.people-roster-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.people-roster-tools .people-list-summary {
  flex: 0 0 auto;
  margin-right: 4px;
}

.people-roster-tools .roster-filter-bar {
  background: transparent;
  border: 0;
  flex: 1 1 520px;
  margin-top: 0;
  padding: 0;
}

.people-topbar-main {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto minmax(460px, auto);
}

.people-topbar h2,
.people-group-nav h3,
.people-side-panel h3 {
  margin-bottom: 4px;
}

.people-group-nav h3,
.people-side-panel h3 {
  font-size: var(--font-section-title);
}

.people-topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.people-prep-summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  padding: 6px 8px;
}

.people-prep-summary div {
  align-items: baseline;
  background: transparent;
  border: 0;
  border-right: 1px solid #e5eaf2;
  display: flex;
  gap: 6px;
  min-width: 0;
  padding: 0 10px;
}

.people-prep-summary div:first-child {
  padding-left: 0;
}

.people-prep-summary div:last-child {
  border-right: 0;
  padding-right: 0;
}

.people-prep-summary div.warn {
  color: #c2410c;
}

.people-prep-summary span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.people-prep-summary strong {
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
}

.people-prep-summary .warn span,
.people-prep-summary .warn strong {
  color: #c2410c;
}

.people-topbar-actions input[type="file"] {
  max-width: 220px;
}

.people-data-warning {
  align-items: center;
  background: var(--color-warning-soft);
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 10px;
  padding: 8px 10px;
}

.people-data-warning button {
  flex: 0 0 auto;
}

.competition-type-cell.missing-competition-type {
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px #fdba74;
}

.competition-type-cell.missing-competition-type em {
  color: #c2410c;
  display: block;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
  margin-top: 4px;
}

.people-list-summary {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.event-year-control {
  align-items: center;
  display: flex;
  gap: 6px;
}

.event-year-control span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  white-space: nowrap;
}

.event-year-control input {
  width: 92px;
}

.warning-button.compact {
  width: auto;
}

.people-group-nav,
.people-member-panel,
.people-side-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.people-group-nav-head {
  border-bottom: 1px solid #e5eaf2;
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.people-group-nav-head h3 {
  margin: 0;
}

.people-group-nav-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.people-group-nav-title .competition-type-filter {
  flex: 0 0 auto;
}

.people-group-search {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 7px 9px;
}

.people-group-search span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.people-group-search input {
  background: #ffffff;
  min-height: var(--control-height);
  padding: 5px 8px;
}

.group-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.group-status-filters button {
  align-items: center;
  display: inline-flex;
  font-size: var(--font-label);
  gap: 5px;
  min-height: var(--control-height);
  padding: 5px 8px;
}

.group-status-filters button.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.group-status-filters span {
  background: #eef2f7;
  border-radius: 999px;
  color: #475569;
  font-size: var(--font-caption);
  min-width: 20px;
  padding: 2px 5px;
  text-align: center;
}

.group-status-filters button.active span {
  background: #ffffff;
  color: #111827;
}

.competition-type-checks {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 116px;
}

.competition-type-checks label {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d8e0eb;
  border-radius: 6px;
  color: #111827;
  display: inline-flex;
  font-size: var(--font-body-small);
  font-weight: 800;
  gap: 4px;
  min-height: 38px;
  padding: 0 8px;
  white-space: nowrap;
}

.competition-type-checks input {
  height: 16px;
  margin: 0;
  width: 16px;
}

.competition-type-cell {
  min-width: 142px;
}

.people-group-nav-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.people-group-nav-item {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.people-group-nav-item.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.people-group-nav-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.people-group-nav-item .people-group-name {
  align-items: center;
  display: flex;
  gap: 6px;
}

.people-group-name strong {
  min-width: 0;
}

.people-competition-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  flex: 0 0 auto;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 4px 6px;
}

.people-competition-chip.kata {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.people-group-nav-item.active .people-competition-chip {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.people-group-nav-item strong,
.people-group-nav-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-group-nav-item em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
}

.people-group-nav-item.active em {
  color: #d1d5db;
}

.people-group-nav-item i {
  font-style: normal;
}

.people-group-nav-item.pending-pool {
  border-color: #fed7aa;
  background: #fff7ed;
}

.people-group-nav-item.pending-pool.active {
  background: #9a3412;
  border-color: #9a3412;
}

.people-panel-head {
  align-items: flex-start;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.people-panel-head h3 {
  margin-bottom: 4px;
}

.people-panel-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.people-panel-actions button {
  min-height: var(--control-height);
  padding: 7px 12px;
  white-space: nowrap;
}

.people-member-panel .people-member-table-wrap {
  flex: 1 1 auto;
  margin-top: 0;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.people-member-table th,
.people-member-table td {
  vertical-align: middle;
}

.people-member-panel .people-member-card-list {
  align-content: start;
  display: none;
  min-height: 0;
}

.people-member-card {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 7px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 9px 10px;
}

.people-member-card-main {
  min-width: 0;
}

.people-member-card-main strong,
.people-member-card-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-member-card-main strong {
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
}

.people-member-card-main span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: 800;
  margin-top: 2px;
}

.people-member-card-check {
  align-items: center;
  align-self: start;
  background: #f8fafc;
  border: 1px solid #d8e0eb;
  border-radius: 999px;
  display: inline-flex;
  min-height: 28px;
  padding: 4px 7px;
}

.people-member-card-check input {
  height: 16px;
  margin: 0;
  width: 16px;
}

.people-member-card-check span {
  display: none;
}

.people-member-card-meta {
  display: grid;
  gap: 5px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
}

.people-member-card-meta span {
  background: #f8fafc;
  border-radius: 5px;
  color: #111827;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  min-width: 0;
  overflow: hidden;
  padding: 5px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-member-card-meta span::before {
  color: #64748b;
  content: attr(data-label);
  display: block;
  font-size: var(--font-caption);
  font-weight: 800;
  margin-bottom: 2px;
}

.people-member-card-foot {
  align-items: center;
  color: #64748b;
  display: grid;
  font-size: var(--font-caption);
  font-weight: 800;
  gap: 6px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
}

.people-member-card-foot > span {
  color: #0e7490;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-member-card-foot button {
  font-size: var(--font-caption);
  min-height: var(--control-height);
  padding: 4px 8px;
}

.pending-card-foot em {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.check-col {
  text-align: center;
  width: 54px;
}

.check-col input {
  height: 18px;
  width: 18px;
}

.source-cell {
  color: #475569;
  font-size: var(--font-label);
  font-weight: 800;
  min-width: 88px;
}

.source-cell small {
  color: #64748b;
  font-weight: 700;
}

.pending-pool-table .pending-reason-cell {
  line-height: 1.35;
  max-width: 360px;
  min-width: 220px;
  white-space: normal;
}

.pending-pool-table .pending-reason-cell {
  color: #b91c1c;
  font-weight: var(--weight-strong);
}

.pending-card-foot {
  align-items: flex-start;
  display: grid;
  gap: 4px;
}

.people-side-panel {
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.people-side-block {
  border-bottom: 1px solid #e5eaf2;
  padding-bottom: 10px;
}

.people-side-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.people-side-toolbar {
  display: grid;
  margin-top: 6px;
  position: static;
}

.people-side-stats {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.people-side-stats div {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 8px;
}

.people-side-stats span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.people-side-stats strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.group-check-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.group-check-list div {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  color: #475569;
  font-size: var(--font-body-small);
  font-weight: 800;
  line-height: 1.4;
  padding: 9px 10px;
}

.group-check-list .ok {
  background: var(--color-success-soft);
  border-color: #bbf7d0;
  color: var(--color-success);
}

.group-check-list .warn {
  background: var(--color-warning-soft);
  border-color: #fed7aa;
  color: #c2410c;
}

.group-check-list .error {
  background: var(--color-error-soft);
  border-color: #fecaca;
  color: var(--color-error);
}

.people-list-area {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.people-entry-panel .player-table-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

.draw-head-actions {
  align-items: flex-end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.draw-head-actions .competition-type-filter {
  justify-content: flex-end;
}

.draw-head-actions .export-row {
  justify-content: flex-end;
  margin: 0;
}

.draw-summary-bar {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  gap: 0;
  height: var(--control-height);
  margin: 0;
  overflow: hidden;
}

.draw-summary-bar div {
  align-items: center;
  border-right: 1px solid #e5eaf2;
  display: flex;
  gap: 7px;
  min-width: 76px;
  padding: 0 9px;
}

.draw-summary-bar div:last-child {
  border-right: 0;
}

.draw-summary-bar span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.draw-summary-bar strong {
  font-size: 16px;
  line-height: 1.1;
  margin-left: auto;
}

.draw-group-panel,
.draw-detail {
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.draw-group-panel {
  display: flex;
  flex-direction: column;
}

.draw-list-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.draw-list-heading h3 {
  margin: 0;
}

.draw-group-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.draw-group-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.draw-group-row.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.draw-group-main,
.draw-group-side {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.draw-group-side {
  justify-items: end;
  text-align: right;
}

.draw-group-title {
  font-weight: var(--weight-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-group-subtitle,
.draw-group-side span {
  color: #64748b;
  font-size: var(--font-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-group-row.active .draw-group-subtitle,
.draw-group-row.active .draw-group-side span {
  color: #d1d5db;
}

.draw-status {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #64748b;
  display: inline-flex;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

.draw-status.pending {
  background: #f8fafc;
  color: #64748b;
}

.draw-status.ready {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.draw-status.active {
  background: #fff7d6;
  border-color: #f4d35e;
  color: #854d0e;
}

.draw-status.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.draw-detail {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 10px;
}

.draw-detail-header {
  align-items: flex-start;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.draw-detail-header h3 {
  margin-bottom: 4px;
}

.draw-detail-header .hint {
  margin-top: 0;
}

.draw-detail-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(120px, 1fr) repeat(4, auto);
  margin-top: 10px;
}

.draw-seed-panel {
  align-items: end;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  margin-top: 10px;
  padding: 10px;
}

.draw-seed-panel h4 {
  font-size: var(--font-body);
  margin: 0 0 4px;
}

.draw-seed-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.seed-select {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.seed-select span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.seed-badge {
  background: #fff7d6;
  border: 1px solid #f4d35e;
  border-radius: 999px;
  color: #854d0e;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 3px 6px;
  white-space: nowrap;
}

.draw-detail-section {
  border-top: 1px solid #e5eaf2;
  margin-top: 10px;
  padding-top: 10px;
}

.draw-detail-section h4 {
  font-size: var(--font-body);
  margin: 0 0 8px;
}

.selected-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-player-list span {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  padding: 6px 8px;
}

.selected-player-list small {
  color: #64748b;
  font-size: var(--font-label);
}

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

.draw-match-row {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 8px;
}

.draw-match-row.done {
  border-color: #86c897;
}

.draw-match-row span {
  color: #0f7180;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.draw-match-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-match-row em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
}

.group-adjust-workbench {
  grid-template-columns: minmax(240px, 0.85fr) minmax(420px, 1.25fr);
}

.group-member-list,
.draw-slot-list {
  display: grid;
  gap: 8px;
}

.draw-slot-helper {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px;
}

.draw-slot-feedback {
  border-radius: 999px;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 4px 8px;
}

.draw-slot-feedback.ok {
  background: #f0fdf4;
  color: #15803d;
}

.draw-slot-feedback.error {
  background: #fff1f2;
  color: #be123c;
}

.draw-slot-helper em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: 800;
}

.group-bulk-toolbar {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-top: 8px;
  padding: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.group-bulk-toolbar select {
  min-width: 0;
}

.group-recommendation-hint {
  display: grid;
  gap: 5px;
  grid-column: 1 / -1;
}

.group-recommendation-hint > span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 700;
  line-height: 1.4;
}

.group-recommendation-hint button {
  align-items: center;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #164e63;
  display: grid;
  gap: 2px;
  grid-template-columns: minmax(0, 1fr);
  justify-content: start;
  min-height: var(--control-height);
  padding: 5px 8px;
  text-align: left;
  width: 100%;
}

.group-recommendation-hint button:hover {
  background: #cffafe;
  border-color: #22d3ee;
  color: #164e63;
}

.group-recommendation-hint button strong {
  font-size: var(--font-label);
  line-height: 1.35;
}

.group-recommendation-hint button span {
  color: #0e7490;
  font-size: var(--font-caption);
  line-height: 1.35;
}

.group-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.group-bulk-actions button {
  min-width: 88px;
  white-space: nowrap;
}

.selection-meter {
  color: #64748b;
  font-size: var(--font-body-small);
  font-weight: 800;
  white-space: nowrap;
}

.selection-meter strong {
  color: #111827;
  font-size: 18px;
}

.group-member-list {
  margin-top: 12px;
}

.readonly-note {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  color: #64748b;
  font-size: var(--font-body-small);
  font-weight: 800;
  line-height: 1.45;
  margin-top: 12px;
  padding: 10px;
}

.group-member-row {
  align-items: center;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.group-member-row.readonly {
  grid-template-columns: minmax(0, 1fr);
}

.group-member-row:has(input:checked) {
  background: #f0f9ff;
  border-color: #67c7df;
}

.member-check {
  align-items: center;
  display: flex;
  justify-content: center;
}

.member-check input {
  height: 18px;
  width: 18px;
}

.group-member-row strong,
.group-member-row span,
.group-member-row em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-row span,
.group-member-row em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
  margin-top: 3px;
}

.draw-slot-row {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 10px;
}

.draw-slot-row.duplicate,
.draw-slot-row.needs-player {
  background: #fff7ed;
  border-color: #fb923c;
}

.draw-slot-row > span {
  color: #0f7180;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  grid-column: 1 / -1;
}

.draw-slot-row > em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
  grid-column: 1 / -1;
}

.slot-select {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.slot-select span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.slot-select select {
  min-width: 0;
  width: 100%;
}

.slot-player-profile {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 104px;
  min-width: 0;
  padding: 9px;
}

.slot-player-profile.empty {
  background: #ffffff;
  border-style: dashed;
}

.slot-player-profile div,
.slot-player-profile span,
.slot-player-profile em,
.slot-player-profile strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-player-profile div {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.slot-player-profile strong {
  align-items: center;
  color: #111827;
  display: flex;
  font-size: var(--font-body);
  gap: 6px;
}

.slot-player-profile span,
.slot-player-profile em {
  color: #475569;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: 700;
}

.draw-page-grid {
  align-items: stretch;
  flex: 1 1 auto;
  grid-template-columns: var(--workspace-list-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.draw-mobile-backdrop {
  display: none;
}

.draw-page-head {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 0;
}

.draw-page-head h2 {
  margin-bottom: 4px;
}

.draw-detail {
  overflow: auto;
}

.schedule-grid {
  align-items: stretch;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.schedule-grid .module.wide {
  grid-column: span 1;
}

.schedule-grid > .module {
  min-height: 0;
}

.schedule-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.schedule-page-head {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.schedule-page-head h2 {
  margin-bottom: 4px;
}

.schedule-page-head .schedule-action-buttons {
  grid-template-columns: repeat(5, max-content);
  width: auto;
}

.schedule-overview-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.draw-summary-inline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.draw-summary-inline span {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 999px;
  color: #475569;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 5px 8px;
}

.schedule-head-actions {
  align-items: flex-end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.schedule-type-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.schedule-view-switch {
  align-items: center;
  display: flex;
  gap: 18px;
}

.schedule-view-switch button {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #64748b;
  display: inline-flex;
  gap: 5px;
  min-height: var(--control-height);
  padding: 4px 1px 5px;
}

.schedule-view-switch button:hover:not(:disabled) {
  background: transparent;
  color: #334155;
}

.schedule-view-switch button:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: 3px;
}

.schedule-view-switch button.active {
  background: transparent;
  border-bottom-color: #0f766e;
  color: #0f766e;
}

.schedule-view-switch button small {
  color: #94a3b8;
  font-size: var(--font-caption);
  font-weight: 800;
}

.schedule-view-switch button.active small {
  color: #0f766e;
}

.schedule-action-buttons {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(6, max-content);
  justify-content: end;
}

.schedule-action-buttons button {
  min-height: var(--control-height);
  min-width: 0;
  white-space: nowrap;
}

.schedule-preallocate-button:not(:disabled) {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.schedule-filter-note {
  color: #64748b;
  font-size: var(--font-label);
  margin: 8px 0 0;
  padding: 0;
}

.schedule-summary-bar {
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.draw-summary-inline .court-a,
.schedule-legend .court-a,
.schedule-court-badge.court-a {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.draw-summary-inline .court-b,
.schedule-legend .court-b,
.schedule-court-badge.court-b {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.draw-summary-inline .court-pending,
.schedule-legend .court-pending,
.schedule-court-badge.court-pending {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.draw-summary-inline .court-running,
.schedule-legend .court-running,
.schedule-court-badge.court-running {
  background: #fff7d6;
  border-color: #f4d35e;
  color: #854d0e;
}

.schedule-court-badge.court-saved {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.schedule-legend {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.schedule-legend span,
.schedule-court-badge {
  border: 1px solid;
  border-radius: 999px;
  display: inline-flex;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.schedule-list {
  align-content: start;
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  grid-auto-rows: max-content;
  margin-top: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.schedule-list::-webkit-scrollbar {
  display: none;
}

.schedule-row {
  align-items: center;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px minmax(0, 1fr) auto auto;
  padding: 10px;
  position: relative;
}

.schedule-row::before {
  border-radius: 8px 0 0 8px;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 6px;
}

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

.schedule-code {
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #475569;
  display: inline-flex;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  justify-content: center;
  min-height: 30px;
  padding: 4px 7px;
  white-space: nowrap;
}

.schedule-code.court-a {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.schedule-code.court-b {
  background: #dcfce7;
  border-color: #86efac;
  color: #047857;
}

.schedule-code.court-running {
  background: #fff7d6;
  border-color: #f4d35e;
  color: #854d0e;
}

.schedule-code.court-saved {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.schedule-row.court-a {
  background: linear-gradient(90deg, #eff6ff 0, #ffffff 34%);
  border-color: #bfdbfe;
}

.schedule-row.court-a::before {
  background: #2563eb;
}

.schedule-row.court-b {
  background: linear-gradient(90deg, #ecfdf5 0, #ffffff 34%);
  border-color: #bbf7d0;
}

.schedule-row.court-b::before {
  background: #059669;
}

.schedule-row.court-running {
  background: linear-gradient(90deg, #fff7d6 0, #ffffff 34%);
  border-color: #f4d35e;
}

.schedule-row.court-running::before {
  background: #d97706;
}

.schedule-row.court-saved::before {
  background: #16a34a;
}

.schedule-row.court-pending::before {
  background: #cbd5e1;
}

.schedule-row h3 {
  display: block;
  font-size: var(--font-section-title);
  margin: 0 0 4px;
}

.schedule-row p {
  color: var(--color-secondary);
  font-size: var(--font-body-small);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-meta-primary,
.schedule-meta-secondary {
  display: inline;
}

.schedule-meta-secondary {
  font-size: var(--font-caption);
  font-weight: var(--weight-medium);
  line-height: 1.3;
}

.schedule-meta-secondary::before {
  content: " · ";
}

.schedule-status {
  align-items: end;
  display: grid;
  gap: 5px;
  justify-self: end;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 270px;
}

.schedule-actions .court-action-a {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.schedule-actions .court-action-b {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.schedule-actions button:disabled {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.schedule-row-transferred {
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .22);
}

.schedule-transfer-note {
  background: #fff7d6;
  border: 1px solid #f4d35e;
  border-radius: 999px;
  color: #854d0e;
  display: inline-flex;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  margin-left: 5px;
  padding: 2px 7px;
  vertical-align: middle;
  white-space: nowrap;
}

.schedule-actions .schedule-transfer-button {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  min-width: 104px;
}

.schedule-actions .schedule-transfer-button.restore {
  background: #ffffff;
  border-color: #d97706;
  color: #92400e;
}

.checkin-page {
  display: grid;
  flex: 1 1 auto;
  gap: var(--device-gutter);
  grid-template-columns: var(--workspace-list-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: var(--device-gutter);
}

.checkin-head {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.checkin-head h2 {
  margin-bottom: 4px;
}

.checkin-summary,
.checkin-stats {
  display: flex;
  gap: 8px;
}

.checkin-display-links {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.access-logout-button {
  align-items: center;
  background: #fff;
  border: 1px solid #bfc7d5;
  border-radius: 6px;
  color: #475569;
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.access-logout-button:hover {
  background: #f3f6fb;
  color: #111827;
}

.access-logout-button svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 17px;
}

.field-progress-link {
  align-items: center;
  background: #e7f7fa;
  border: 1px solid #8dd7e2;
  border-radius: 6px;
  color: #0f7180;
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  min-width: max-content;
  padding: 0 9px;
  text-decoration: none;
  width: auto;
}

.field-progress-link:hover {
  background: #d5f1f5;
  color: #095d69;
}

.checkin-summary div,
.checkin-stats div {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  min-width: 82px;
  padding: 7px 10px;
  text-align: center;
}

.checkin-summary span,
.checkin-stats span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: 800;
}

.checkin-summary strong,
.checkin-stats strong {
  color: #111827;
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.checkin-summary {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  gap: 0;
  height: var(--control-height);
  overflow: hidden;
}

.checkin-summary div {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-right: 1px solid #e5eaf2;
  display: flex;
  gap: 8px;
  min-width: 94px;
  padding: 0 10px;
  text-align: left;
}

.checkin-summary div:last-child {
  border-right: 0;
}

.checkin-summary span,
.checkin-summary strong {
  display: inline;
  margin: 0;
}

.checkin-summary strong {
  font-size: 16px;
  margin-left: auto;
}

.checkin-display-links > .checkin-screen-button,
.checkin-display-links > .access-logout-button {
  height: var(--control-height);
  min-height: var(--control-height);
}

.workspace-summary {
  flex: 0 0 auto;
  height: var(--control-height);
  max-width: 100%;
  padding: 0;
  width: max-content;
}

.workspace-summary > div,
.workspace-summary > div:first-child,
.workspace-summary > div:last-child {
  align-items: center;
  flex: 0 0 var(--workspace-summary-item-width);
  justify-content: space-between;
  min-width: 0;
  padding: 0 9px;
  width: var(--workspace-summary-item-width);
}

.workspace-summary span,
.workspace-summary strong {
  white-space: nowrap;
}

.people-group-nav-list,
.people-member-table-wrap,
.people-member-card-list,
.people-side-panel,
.draw-group-list,
.draw-detail,
.checkin-group-list,
.checkin-roster,
.checkin-detail-panel {
  scrollbar-width: none;
}

.people-group-nav-list::-webkit-scrollbar,
.people-member-table-wrap::-webkit-scrollbar,
.people-member-card-list::-webkit-scrollbar,
.people-side-panel::-webkit-scrollbar,
.draw-group-list::-webkit-scrollbar,
.draw-detail::-webkit-scrollbar,
.checkin-group-list::-webkit-scrollbar,
.checkin-roster::-webkit-scrollbar,
.checkin-detail-panel::-webkit-scrollbar {
  display: none;
}

.checkin-list-panel,
.checkin-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.checkin-list-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.checkin-list-heading h3 {
  margin: 0;
}

.checkin-court-filter {
  gap: 12px;
}

.checkin-mobile-switcher {
  display: none;
}

.people-mobile-switcher,
.draw-mobile-switcher,
.competition-mobile-switcher {
  display: none;
}

.checkin-group-list,
.checkin-roster {
  align-content: start;
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.checkin-group-list {
  grid-auto-rows: max-content;
}

.checkin-group-row {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  color: #111827;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr);
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.checkin-group-row-meta {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.checkin-group-row.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.checkin-group-row.on-display {
  background: #f0fdfa;
  border-color: #5eead4;
}

.checkin-group-row.active.on-display {
  color: #064e3b;
}

.checkin-group-row.active.on-display strong {
  color: #064e3b;
}

.checkin-group-row.active.on-display em {
  color: #0f766e;
}

.checkin-group-row span {
  min-width: 0;
}

.checkin-group-row-meta em {
  flex: 1 1 auto;
  min-width: 0;
}

.checkin-group-row-meta .checkin-status-chip {
  flex: 0 0 auto;
}

.checkin-group-row strong,
.checkin-group-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-group-row strong {
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
}

.checkin-group-row em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: 800;
  margin-top: 3px;
}

.checkin-detail {
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.checkin-detail header {
  align-items: center;
  display: grid;
  column-gap: 10px;
  grid-template-areas:
    "title actions"
    "meta .";
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 3px;
}

.checkin-detail h3 {
  margin: 0;
}

.checkin-detail-meta {
  grid-area: meta;
  margin: 0;
}

.checkin-detail-actions,
.checkin-player-actions {
  display: flex;
  gap: 7px;
}

.checkin-detail-actions {
  align-self: center;
  grid-area: actions;
}

.checkin-start-button:not(:disabled) {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.checkin-display-state {
  align-items: center;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  color: #0f766e;
  display: inline-flex;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  min-height: 0;
  padding: 5px 9px;
  white-space: nowrap;
}

.checkin-progress-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.checkin-all-present-button {
  flex: 0 0 auto;
  min-width: 96px;
}

.checkin-player-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 10px;
}

.checkin-player-row.present {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.checkin-player-row.absent {
  background: #fff1f2;
  border-color: #fecdd3;
}

.checkin-player-row.late {
  background: #fffbeb;
  border-color: #fde68a;
}

.checkin-player-main {
  min-width: 0;
}

.checkin-player-side {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  justify-self: end;
}

.checkin-player-main strong,
.checkin-player-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-player-main strong {
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
}

.checkin-player-main span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  margin-top: 3px;
}

.checkin-weight-control {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.checkin-weight-control label {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d8dde6;
  border-radius: 7px;
  display: inline-flex;
  gap: 6px;
  min-height: 28px;
  padding: 3px 5px 3px 8px;
}

.checkin-weight-control label span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.checkin-weight-control input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  height: 22px;
  padding: 2px 5px;
  width: 58px;
}

.checkin-weight-control button {
  min-height: var(--control-height);
  padding: 4px 8px;
}

.checkin-weight-control.readonly {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.group-weight-tag {
  background: #eef2f7;
  border: 1px solid #d8dde6;
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

.weighing-page {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.weigh-in-body {
  background: #eef2f7;
  min-height: 100vh;
  min-height: 100dvh;
}

.weigh-in-app {
  min-height: 100vh;
  min-height: 100dvh;
}

.weigh-in-login {
  align-items: center;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(16px, 4vw, 40px);
}

.weigh-in-login-card {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 460px;
  width: 100%;
}

.weigh-in-login-card h1 {
  font-size: var(--font-event-title);
  font-weight: var(--weight-strong);
  margin: 0 0 6px;
}

.weigh-in-login-card p {
  color: #64748b;
  font-weight: 800;
  margin: 0;
}

.standalone-weighing-page {
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.module.weighing-command-bar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1fr) auto minmax(150px, 220px) minmax(120px, 170px) minmax(100px, 140px) auto;
  min-width: 0;
  padding: 9px 12px;
}

.weighing-command-identity,
.weighing-command-state,
.weighing-command-filter {
  min-width: 0;
}

.weighing-command-bar .weighing-command-identity h2 {
  font-size: var(--font-page-title);
  line-height: 1.1;
  margin: 0;
}

.weighing-command-identity .hint {
  font-size: var(--font-caption);
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weighing-command-state {
  min-width: 238px;
}

.weighing-command-bar .weighing-summary {
  gap: 0;
  white-space: nowrap;
}

.weighing-command-bar .weighing-summary div {
  align-items: baseline;
  background: transparent;
  border: 0;
  border-left: 1px solid #e5eaf2;
  border-radius: 0;
  display: inline-flex;
  gap: 4px;
  min-width: 0;
  padding: 1px 10px;
}

.weighing-command-bar .weighing-summary div:first-child {
  border-left: 0;
  padding-left: 0;
}

.weighing-command-bar .weighing-summary .has-abnormal strong {
  color: #b45309;
}

.weighing-command-filter input,
.weighing-command-filter select {
  font-size: var(--font-body-small);
  height: var(--control-height);
  min-height: var(--control-height);
  min-width: 0;
  padding: 6px 9px;
  width: 100%;
}

.weighing-command-bar .weighing-actions {
  display: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.weighing-command-bar .weighing-actions.active {
  display: flex;
}

.weighing-command-bar .weighing-summary.selection-active {
  display: none;
}

.weighing-command-bar .weighing-actions button,
.weighing-command-logout {
  font-size: var(--font-label);
  min-height: 34px;
  padding: 5px 9px;
}

.weighing-command-logout {
  align-items: center;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.weighing-command-logout svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.standalone-weighing-head {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.weighing-head,
.weighing-toolbar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.weighing-summary,
.weighing-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.weighing-summary div {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  min-width: 82px;
  padding: 7px 10px;
  text-align: center;
}

.weighing-summary span,
.weighing-actions span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: 800;
}

.weighing-summary strong,
.weighing-actions strong {
  color: #111827;
  font-weight: var(--weight-strong);
}

.weighing-toolbar label {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(220px, 360px);
}

.standalone-weighing-toolbar {
  grid-template-columns: minmax(220px, 0.9fr) minmax(190px, 0.7fr) auto;
}

.standalone-weighing-toolbar label {
  grid-template-columns: auto minmax(0, 1fr);
}

.weighing-toolbar label span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.weighing-list-panel {
  min-height: 0;
  overflow: hidden;
}

.weighing-list {
  display: grid;
  gap: 7px;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.weighing-list-head,
.weighing-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(170px, 1.1fr) minmax(220px, 1.4fr) minmax(220px, 1.1fr) minmax(140px, 0.8fr) auto;
}

.weighing-list-head {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.weighing-row {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 8px 10px;
}

.weighing-row:not(.readonly) {
  cursor: pointer;
}

.weighing-row:not(.readonly):hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.weighing-row:has([data-weighing-select]:checked) {
  background: #ecfeff;
  border-color: #d8dde6;
}

.weighing-row.readonly {
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: default;
}

.weighing-row.readonly .weighing-weight input {
  background: #eef2f7;
  color: #64748b;
}

.weighing-check {
  align-items: center;
  display: flex;
  justify-content: center;
}

.weighing-check input {
  accent-color: #0891b2;
  cursor: pointer;
  height: 20px;
  width: 20px;
}

.weighing-check input:disabled {
  cursor: not-allowed;
}

.weighing-player,
.weighing-group,
.weighing-weight,
.weighing-status {
  min-width: 0;
}

.weighing-player strong,
.weighing-player span,
.weighing-group strong,
.weighing-group span,
.weighing-weight span,
.weighing-status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weighing-player strong,
.weighing-group strong {
  color: #111827;
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
}

.weighing-project-tag {
  background: var(--color-accent-soft);
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  color: var(--color-accent);
  display: inline-flex;
  font-size: var(--font-caption);
  font-style: normal;
  line-height: 1;
  margin-left: 5px;
  padding: 3px 6px;
  vertical-align: 1px;
  white-space: nowrap;
}

.weighing-not-required {
  background: var(--color-surface-subtle);
  border-color: var(--color-border-strong);
  color: var(--color-secondary);
}

.weighing-player span,
.weighing-group span,
.weighing-weight span,
.weighing-status span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  margin-top: 3px;
}

.weighing-status .weighing-readonly-note {
  color: #b45309;
}

.weighing-weight input {
  margin-top: 5px;
  max-width: 120px;
}

.weighing-weight-entry {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.weighing-weight-entry input {
  margin-top: 0;
  min-width: 0;
}

.weighing-row-actions {
  justify-self: end;
}

@media (max-width: 1180px) {
  .weighing-page {
    gap: 8px;
    padding: 8px;
  }

  .weighing-head,
  .weighing-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .standalone-weighing-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .standalone-weighing-head .weighing-summary {
    grid-column: 1 / -1;
    order: 3;
  }

  .module.weighing-command-bar {
    gap: 8px;
    grid-template-columns: minmax(150px, 1fr) auto minmax(130px, 190px) minmax(105px, 145px) minmax(92px, 125px) auto;
    padding: 8px 10px;
  }

  .weighing-command-state {
    min-width: 210px;
  }

  .weighing-command-bar .weighing-summary div {
    padding-left: 7px;
    padding-right: 7px;
  }

  .weighing-summary,
  .weighing-actions {
    flex-wrap: wrap;
  }

  .weighing-toolbar label {
    grid-template-columns: auto minmax(0, 1fr);
  }

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

  .standalone-weighing-toolbar .weighing-actions {
    grid-column: 1 / -1;
  }

  .weighing-list-head {
    display: none;
  }

  .weighing-list {
    gap: 6px;
    padding-right: 0;
  }

  .weighing-row {
    align-items: center;
    gap: 8px;
    grid-template-columns: 34px minmax(0, 1.35fr) minmax(116px, 0.8fr) minmax(54px, auto);
    padding: 8px;
  }

  .weighing-check {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .weighing-player {
    grid-column: 2;
    grid-row: 1;
  }

  .weighing-group {
    grid-column: 2;
    grid-row: 2;
  }

  .weighing-weight {
    grid-column: 3;
    grid-row: 1;
  }

  .weighing-status {
    grid-column: 3;
    grid-row: 2;
  }

  .weighing-status .weight-tag {
    margin-left: 0;
  }

  .weighing-status .weighing-readonly-note {
    font-size: var(--font-caption);
    margin-top: 4px;
  }

  .weighing-weight input {
    height: 34px;
    max-width: none;
    width: 100%;
  }

  .weighing-row-actions {
    align-items: center;
    align-self: stretch;
    display: flex;
    grid-column: 4;
    grid-row: 1 / span 2;
    justify-self: stretch;
  }

  .weighing-row-actions button {
    min-height: 42px;
    padding: 0 10px;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .module.weighing-command-bar {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 7px 8px;
  }

  .weighing-command-state {
    min-width: 0;
  }

  .weighing-command-search {
    grid-column: 1 / 2;
  }

  .weighing-command-unit {
    grid-column: 2 / 3;
  }

  .weighing-command-status {
    grid-column: 3 / 4;
  }

  .weighing-command-search,
  .weighing-command-unit,
  .weighing-command-status {
    grid-row: 2;
  }

  .weighing-command-logout {
    grid-column: 3 / 4;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .weigh-in-login {
    align-items: stretch;
    padding: 10px;
  }

  .weigh-in-login-card {
    align-self: center;
  }

  .weighing-command-identity .hint {
    display: none;
  }

  .module.weighing-command-bar {
    align-items: center;
    grid-template-areas:
      "identity identity identity logout"
      "state state state state"
      "search unit status status";
    grid-template-columns: minmax(0, 1fr) 88px 44px 44px;
  }

  .weighing-command-identity {
    grid-area: identity;
  }

  .weighing-command-state {
    grid-area: state;
    width: 100%;
  }

  .weighing-command-search {
    grid-area: search;
  }

  .weighing-command-unit {
    grid-area: unit;
  }

  .weighing-command-status {
    grid-area: status;
  }

  .weighing-command-logout {
    grid-area: logout;
    justify-self: end;
  }

  .weighing-command-bar .weighing-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 36px;
    width: 100%;
  }

  .weighing-command-bar .weighing-summary div {
    border: 0;
    gap: 2px;
    justify-content: center;
    padding: 0 3px;
  }

  .weighing-command-bar .weighing-summary span {
    font-size: var(--font-caption);
  }

  .weighing-command-bar .weighing-summary strong {
    font-size: var(--font-section-title);
  }

  .weighing-command-bar .weighing-actions.active {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    bottom: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    left: 8px;
    padding: 7px;
    position: fixed;
    right: 8px;
    z-index: 30;
  }

  .standalone-weighing-page.selection-active .weighing-list-panel {
    padding-bottom: 52px;
  }

  .standalone-weighing-toolbar {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.55fr);
    padding: 7px;
  }

  .weighing-toolbar label {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .standalone-weighing-toolbar label span {
    display: none;
  }

  .standalone-weighing-toolbar input,
  .standalone-weighing-toolbar select {
    font-size: var(--font-body-small);
    height: 34px;
    min-height: 34px;
    padding: 6px 8px;
  }

  .standalone-weighing-toolbar .weighing-actions {
    display: grid;
    gap: 5px;
    grid-column: 1 / -1;
    grid-template-columns: auto repeat(3, minmax(48px, 1fr));
  }

  .weighing-actions span {
    align-self: center;
    font-size: var(--font-caption);
    line-height: 1.1;
    white-space: nowrap;
  }

  .weighing-list {
    gap: 5px;
  }

  .weighing-row {
    align-items: start;
    gap: 6px;
    grid-template-areas:
      "check player status status"
      "check group status status"
      ". weight weight action";
    grid-template-columns: 26px minmax(0, 1fr) 76px 64px;
    padding: 7px 6px;
  }

  .weighing-check {
    align-self: start;
    grid-area: check;
    padding-top: 2px;
  }

  .weighing-player {
    grid-area: player;
  }

  .weighing-group {
    grid-area: group;
  }

  .weighing-weight {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-area: weight;
    grid-template-columns: minmax(0, 1fr) 76px;
    min-width: 0;
  }

  .weighing-status {
    align-self: start;
    display: grid;
    gap: 2px;
    grid-area: status;
    justify-items: end;
    justify-self: end;
    max-width: 112px;
    text-align: right;
  }

  .weighing-row-actions {
    align-items: end;
    align-self: stretch;
    grid-area: action;
    min-width: 64px;
  }

  .weighing-check input {
    height: 18px;
    width: 18px;
  }

  .weighing-player strong {
    font-size: var(--font-body);
  }

  .weighing-player span {
    font-size: var(--font-body-small);
    font-weight: var(--weight-regular);
    line-height: 1.4;
  }

  .weighing-group strong {
    display: block;
    font-size: var(--font-body-small);
    font-weight: var(--weight-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .weighing-group span,
  .weighing-weight span,
  .weighing-status span {
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    margin-top: 2px;
  }

  .weighing-group span,
  .weighing-status .weighing-readonly-note {
    display: block;
  }

  .weighing-status .weighing-readonly-note {
    white-space: normal;
  }

  .weighing-weight span {
    font-size: var(--font-caption);
    margin-top: 0;
  }

  .weighing-weight input {
    font-size: var(--font-body);
    height: 32px;
    margin-top: 0;
    padding: 5px 6px;
    width: 76px;
  }

  .weighing-weight-entry {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0;
    min-width: 0;
  }

  .weighing-weight-entry .group-weight-tag {
    display: none;
  }

  .weighing-declared-weight,
  .weighing-inline-note {
    white-space: nowrap;
  }

  .weighing-inline-note {
    color: var(--color-secondary);
    font-size: var(--font-caption);
    font-style: normal;
    font-weight: var(--weight-medium);
  }

  .weighing-row-actions button {
    font-size: var(--font-label);
    font-weight: var(--weight-medium);
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 8px;
  }

  .weighing-status .weight-tag {
    font-size: var(--font-caption);
    padding: 2px 5px;
  }

  .weighing-actions button {
    flex: none;
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 0 6px;
  }
}

.checkin-status-chip {
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  color: var(--color-secondary);
  display: inline-flex;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.checkin-status-chip.active,
.checkin-status-chip.present {
  background: var(--color-accent-soft);
  border-color: #a5f3fc;
  color: var(--color-accent);
}

.checkin-status-chip.done {
  background: var(--color-success-soft);
  border-color: #bbf7d0;
  color: var(--color-success);
}

.checkin-status-chip.absent {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.checkin-status-chip.late {
  background: var(--color-warning-soft);
  border-color: #fde68a;
  color: var(--color-warning);
}

.absent-tag {
  background: #e11d48;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  line-height: 1;
  margin-left: 4px;
  padding: 3px 6px;
  vertical-align: middle;
}

.weight-tag {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
  margin-left: 4px;
  padding: 3px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.weight-tag.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.weight-tag.warning {
  background: #fffbeb;
  border-color: #facc15;
  color: #92400e;
}

.weight-tag.danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.weight-tag.unknown {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
}

.field-status-main .absent-tag,
.overview-court .absent-tag,
.dashboard-side .absent-tag,
.score-control-panel .absent-tag,
.competition-match-row .absent-tag,
.display-tree-player .absent-tag {
  background: #be123c;
  color: #ffffff;
  font-size: var(--font-caption);
  line-height: 1;
}

.field-toolbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 7px 12px;
}

.field-status-main {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.field-status-main strong {
  color: #111827;
  font-size: var(--font-body);
  font-weight: 800;
}

.field-status-main span {
  color: #475569;
  font-size: var(--font-label);
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-status-main em {
  color: #64748b;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-status-side {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.field-status-navigation {
  min-height: var(--control-height);
  padding: 4px 9px;
  white-space: nowrap;
}

.timer-chip {
  background: #111827;
  border-radius: 999px;
  color: var(--digit-yellow);
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  padding: 5px 8px;
  white-space: nowrap;
}

.display-link-button {
  align-items: center;
  border: 1px solid #bfc7d5;
  border-radius: 6px;
  color: #111827;
  display: inline-flex;
  font-weight: 800;
  min-height: var(--control-height);
  padding: 6px 10px;
  text-decoration: none;
}

.display-link-button:hover {
  background: #f3f6fb;
}

.checkin-screen-button {
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-medium);
  color: var(--color-primary);
  display: inline-flex;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  justify-content: center;
  min-height: var(--control-height);
  padding: 6px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.checkin-screen-button:hover {
  background: var(--color-surface-subtle);
}

.checkin-screen-button:active {
  background: var(--color-border);
}

.field-login-grid {
  grid-template-columns: minmax(320px, 0.7fr) minmax(480px, 1.3fr);
}

.field-login-grid .module.wide {
  grid-column: span 1;
}

.field-login-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.field-login-grid .competition-match-row {
  pointer-events: none;
}

.competition-grid {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  grid-template-columns: 320px minmax(480px, 1fr) 310px;
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.competition-grid.field-execution-grid {
  grid-template-columns: minmax(520px, 1fr) minmax(270px, 320px);
}

.competition-grid.field-execution-grid > .competition-center:only-child {
  grid-column: 1 / -1;
}

.competition-panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.competition-panel-heading h3 {
  margin: 0 0 2px;
}

.competition-panel-heading span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: 700;
}

.next-match-primary-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.next-match-primary-actions .primary-next-match-button {
  min-width: 150px;
}

.field-overlay {
  align-items: stretch;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  inset: 0;
  justify-content: flex-end;
  position: fixed;
  z-index: 80;
}

.field-match-navigator-head {
  align-items: start;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-bottom: 12px;
}

.field-match-navigator-head > div:first-child > span {
  color: #0f7180;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.field-match-navigator-head h2 {
  margin: 3px 0;
}

.field-match-navigator-head p {
  color: #64748b;
  font-size: var(--font-label);
  margin: 0;
}

.field-overlay-close {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.field-match-overlay {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.field-match-navigator {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(90vh, 900px);
  max-width: 1500px;
  overflow: hidden;
  padding: 14px;
  width: min(96vw, 1500px);
}

.field-match-navigator-body {
  display: grid;
  gap: 12px;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 0;
  padding-top: 12px;
}

.field-match-group-rail {
  border-right: 1px solid #e5eaf2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding-right: 12px;
}

.field-match-group-rail-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0 2px 8px;
}

.field-match-group-rail-head strong {
  font-size: var(--font-body-small);
}

.field-match-group-rail-head span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: 800;
}

.field-match-group-list,
.field-match-tree-pane {
  min-height: 0;
  overflow: hidden;
}

.field-match-group-list {
  overflow-y: auto;
  padding-right: 2px;
}

.field-match-tree-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.field-match-navigator-head h2 em {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 5px;
  color: #3730a3;
  font-size: var(--font-label);
  font-style: normal;
  margin-right: 7px;
  padding: 3px 5px;
  vertical-align: middle;
}

.field-match-navigator-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.field-match-navigator-operations {
  align-items: center;
  display: flex;
  gap: 8px;
}

.field-projection-warning {
  background: #fffbeb;
  border: 1px solid #facc15;
  border-radius: 6px;
  color: #92400e;
  font-size: var(--font-label);
  font-weight: 800;
  margin-top: 10px;
  padding: 8px 10px;
}

.field-match-tree-scroll {
  min-height: 0;
  overflow: auto;
}

.field-match-tree-scroll .bracket-map-selector {
  margin: 12px auto 0;
}

.competition-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.competition-column > .module {
  min-height: 0;
}

.competition-picker-panel,
.competition-rounds-panel,
.competition-current-panel,
.competition-operation-panel,
.competition-timer-panel,
.competition-display-panel {
  display: flex;
  flex-direction: column;
}

.competition-picker-panel {
  flex: 0 0 auto;
  min-height: 0;
}

.competition-picker-panel.picker-open {
  flex: 0 1 46%;
  min-height: 180px;
}

.competition-group-selector {
  align-items: center;
  background: #ffffff;
  border: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 54px;
  padding: 4px 2px;
  text-align: left;
  width: 100%;
}

.competition-group-selector > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.competition-group-selector em,
.competition-group-selector small {
  color: #64748b;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: 800;
}

.competition-group-selector strong {
  display: block;
  font-size: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-group-selector-side {
  align-items: end;
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  justify-items: end;
}

.competition-group-selector-side b {
  color: #0f7180;
  font-size: var(--font-label);
}

.compact-rule-options {
  margin-top: 8px;
}

.competition-rounds-panel {
  flex: 1 1 auto;
}

.competition-picker-scroll,
.competition-rounds-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.competition-picker-scroll .group-grid {
  margin-top: 0;
}

.competition-group-list,
.competition-round-list,
.competition-match-list {
  display: grid;
  gap: 6px;
}

.competition-group-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.competition-group-row.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.competition-group-row.archived:not(.active) {
  background: #f8fafc;
}

.group-row-main,
.group-row-side {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.group-row-side {
  justify-items: end;
  text-align: right;
}

.group-row-title {
  align-items: center;
  display: flex;
  gap: 6px;
  font-weight: var(--weight-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row-code {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 5px;
  color: #3730a3;
  flex: 0 0 auto;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
  padding: 3px 5px;
}

.group-row-subtitle,
.group-row-meta {
  color: #64748b;
  font-size: var(--font-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-row-status {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

.group-row-status.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #111827;
}

.group-row-status.ready {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.group-row-status.done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.competition-group-row.active .group-row-subtitle,
.competition-group-row.active .group-row-meta,
.competition-group-row.active .group-row-status:not(.active) {
  color: #d1d5db;
}

.competition-match-row:disabled {
  cursor: default;
  opacity: 1;
}

.competition-round-block {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 8px;
}

.competition-round-block h3 {
  margin-bottom: 6px;
}

.competition-match-row {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 42px;
  padding: 7px 8px;
  text-align: left;
  width: 100%;
}

.competition-match-row span {
  color: #0f7180;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.competition-match-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-match-row em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
  grid-column: 1 / -1;
}

.competition-match-row.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.competition-match-row.done {
  border-color: #86c897;
}

.competition-match-row.locked {
  background: #f8fafc;
}

.competition-current-panel {
  flex: 0 0 auto;
}

.competition-grid.match-selection-mode {
  grid-template-columns: 280px minmax(0, 1fr);
}

.competition-grid.match-selection-mode .competition-center,
.competition-grid.match-selection-mode .competition-current-panel {
  min-height: 0;
}

.competition-grid.match-selection-mode .competition-current-panel {
  flex: 1 1 auto;
  overflow: hidden;
}

.selection-hidden {
  display: none !important;
}

.match-selection-workspace {
  display: grid;
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.match-selection-toolbar {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 12px;
}

.match-selection-toolbar > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.match-selection-toolbar span,
.match-selection-toolbar small {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: 800;
}

.match-selection-toolbar strong {
  font-size: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-selection-tree {
  min-height: 0;
  overflow: auto;
}

.bracket-map-selector {
  min-height: 520px;
  min-width: 980px;
}

button.bracket-selector-node {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  text-align: left;
}

button.bracket-selector-node:not(:disabled):hover .bracket-player-card,
button.bracket-selector-node.active .bracket-player-card {
  border-color: #0f7180;
  box-shadow: 0 0 0 2px rgba(15, 113, 128, 0.12);
}

button.bracket-selector-node.active .bracket-match-label {
  color: #111827;
}

button.bracket-selector-node:disabled {
  cursor: default;
  opacity: 0.72;
}

.competition-operation-panel {
  flex: 1 1 auto;
  overflow: auto;
}

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

.match-dashboard {
  display: grid;
  gap: 10px;
}

.match-dashboard-meta {
  color: #64748b;
  font-size: var(--font-body-small);
  font-weight: 800;
}

.match-dashboard-versus {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.dashboard-side {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
}

.dashboard-red {
  background: #fff5f5;
  border-color: #f1b7bd;
}

.dashboard-white {
  background: #f8fafc;
}

.dashboard-side span,
.dashboard-side small {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.dashboard-side strong {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-side em {
  color: #111827;
  font-size: 32px;
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
}

.dashboard-vs {
  align-self: center;
  color: #64748b;
  font-weight: var(--weight-strong);
}

.match-dashboard-status {
  background: #fff7d6;
  border: 1px solid #f4d35e;
  border-radius: 6px;
  color: #624400;
  font-weight: 800;
  padding: 8px 10px;
}

.archived-result-dashboard {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 10px;
}

.archived-result-podium {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.score-control-panel {
  background: #ffffff;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.score-control-panel.side-red,
.score-control-panel.side-white {
  border-left: 1px solid #e5eaf2;
  border-right: 1px solid #e5eaf2;
  border-bottom: 1px solid #e5eaf2;
}

.score-control-panel.side-red {
  background: #fff7f7;
}

.score-control-panel.side-white {
  background: #fbfdff;
}

.score-control-panel.penalty-limit {
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.24);
}

.score-control-panel h3 {
  margin-bottom: 0;
}

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

.score-metrics div {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 7px;
}

.score-metrics span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: 800;
}

.score-metrics strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

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

.operation-buttons button,
.timer-buttons button,
.match-decision-actions button {
  min-height: var(--field-action-height);
}

.winner-button {
  grid-column: span 2;
}

.winner-button {
  color: #ffffff;
  font-weight: var(--weight-strong);
}

.red-winner {
  background: var(--red);
  border-color: var(--red);
}

.white-winner {
  background: #111827;
  border-color: #111827;
}

.forfeit-button {
  background: #ffffff;
  border-style: dashed;
  color: #475569;
}

.live-match-console {
  display: grid;
  gap: 10px;
}

.live-match-heading {
  --match-state-color: #315b86;
  --match-state-muted: #557494;
  background: linear-gradient(120deg, #edf4ff, #dce9fa);
  border-left: 4px solid var(--match-state-color);
  border-radius: 8px;
  padding: 8px 10px;
}

.live-match-heading h2 {
  color: var(--match-state-color);
  margin-bottom: 2px;
}

.live-match-heading span {
  color: var(--match-state-muted);
  font-size: var(--font-label);
  font-weight: 800;
}

.live-match-heading.tone-running {
  --match-state-color: #08766b;
  --match-state-muted: #397f78;
  background: linear-gradient(120deg, #dff7f3, #c7eee8);
}

.live-match-heading.tone-paused {
  --match-state-color: #6d4fb3;
  --match-state-muted: #75629f;
  background: linear-gradient(120deg, #f1ecff, #e2d9fa);
}

.live-match-heading.tone-overtime {
  --match-state-color: #b9531e;
  --match-state-muted: #9a613e;
  background: linear-gradient(120deg, #fff0e3, #ffdcc5);
}

.live-match-heading.tone-warning {
  --match-state-color: #a92543;
  --match-state-muted: #985064;
  background: linear-gradient(120deg, #ffe9ee, #ffd3dc);
}

.live-match-heading.tone-done {
  --match-state-color: #526174;
  --match-state-muted: #667384;
  background: linear-gradient(120deg, #f0f3f7, #dfe5ec);
}

.live-match-heading-actions {
  align-items: stretch;
  display: flex;
  gap: 8px;
}

.field-side-order-switch {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(82, 113, 145, 0.28);
  border-radius: 7px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.field-side-order-switch button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #526174;
  font-size: var(--font-caption);
  font-weight: 900;
  min-height: var(--control-height);
  padding: 4px 8px;
  white-space: nowrap;
}

.field-side-order-switch button + button {
  border-left: 1px solid rgba(82, 113, 145, 0.2);
}

.field-side-order-switch button.active {
  background: var(--match-state-color);
  color: #ffffff;
}

.live-match-status {
  align-items: center;
  color: var(--match-state-color);
  display: flex;
  font-size: var(--font-body);
  font-weight: var(--weight-strong);
  justify-content: center;
  min-height: var(--control-height);
  min-width: 104px;
  padding: 4px 6px;
  white-space: nowrap;
}

.weight-penalty-source {
  align-items: center;
  background: #fff8e7;
  border: 1px solid #efd58b;
  border-radius: 6px;
  color: #76530a;
  display: flex;
  gap: 7px;
  justify-content: space-between;
  min-height: var(--control-height);
  padding: 4px 7px;
}

.weight-penalty-source span {
  flex: 0 0 auto;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.weight-penalty-source strong {
  font-size: var(--font-label);
  font-weight: 800;
  text-align: right;
}

.weight-penalty-source.danger {
  background: #fff0f2;
  border-color: #f0a0ac;
  color: #9f1239;
}

.weight-penalty-source.suspended {
  background: #f1f4f8;
  border-color: #cbd5e1;
  color: #526174;
}

.match-decision-panel {
  background: #f8fafc;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 9px;
}

.match-decision-heading {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.match-decision-heading strong {
  font-size: var(--font-body-small);
}

.match-decision-heading span {
  color: #64748b;
  font-size: var(--font-caption);
  font-weight: 700;
}

.match-decision-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.match-forfeit-actions {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.match-forfeit-actions span {
  color: #94a3b8;
  font-size: var(--font-caption);
  font-weight: 800;
  text-align: center;
}

.match-forfeit-actions .forfeit-button {
  min-height: var(--field-action-height);
}

.decision-winner,
.tie-decision,
.decision-waiting {
  align-items: center;
  display: flex;
  font-weight: var(--weight-strong);
  justify-content: center;
  min-height: var(--field-action-height);
  text-align: center;
}

.red-decision {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.white-decision {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.tie-decision {
  background: #ffffff;
  border-color: #94a3b8;
  color: #111827;
}

.decision-waiting {
  background: #e2e8f0;
  border-radius: 6px;
  color: #475569;
  font-size: var(--font-label);
}

.decision-revoke {
  margin-top: 7px;
}

.warning-button {
  border-color: #eab308;
  color: #854d0e;
  width: 100%;
}

.competition-timer-panel {
  flex: 0 0 auto;
}

.competition-display-panel {
  flex: 1 1 auto;
  overflow: auto;
}

.competition-display-panel.collapsed {
  flex: 0 0 auto;
  overflow: visible;
}

.competition-display-panel.expanded {
  flex: 1 1 auto;
  overflow: auto;
}

.aux-toggle-row {
  align-items: center;
  background: #f8fafc;
  border-color: #d8dde6;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 9px;
  width: 100%;
}

.aux-toggle-row span {
  font-weight: var(--weight-strong);
}

.aux-toggle-row em {
  color: #64748b;
  font-size: var(--font-caption);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.auxiliary-panel-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.auxiliary-panel-head > div {
  min-width: 0;
}

.auxiliary-panel-head h2 {
  margin-bottom: 2px;
}

.auxiliary-panel-head span {
  color: #64748b;
  display: block;
  font-size: var(--font-caption);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auxiliary-panel-head button {
  flex: 0 0 auto;
  min-height: var(--control-height);
  padding: 4px 8px;
}

.field-auxiliary-content {
  display: grid;
  margin-top: 10px;
  min-height: 0;
}

.timer-buttons {
  flex-wrap: wrap;
}

.timer-buttons button {
  flex: 1 1 72px;
}

.timer-state {
  color: #64748b;
  font-size: var(--font-body-small);
  font-weight: 800;
  margin: -4px 0 8px;
  text-align: center;
}

.timer-shortcut-hint {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
  margin: 6px 0 0;
  text-align: center;
}

.next-match-gate {
  align-content: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 18px;
  text-align: center;
}

.next-match-gate.final-rest {
  background: #fffbeb;
  border-color: #fbbf24;
}

.next-match-gate > span {
  color: #0f766e;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
}

.next-match-gate.final-rest > span {
  color: #92400e;
}

.next-match-gate h3,
.next-match-gate p {
  margin: 0;
}

.next-match-gate p {
  color: #64748b;
  font-size: var(--font-body-small);
}

.primary-next-match-button {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  justify-self: center;
  min-width: 180px;
}

.primary-next-match-button:not(:disabled):hover,
.primary-next-match-button:not(:disabled):focus-visible {
  background: #263244;
  border-color: #263244;
  color: #ffffff;
}

.primary-next-match-button:not(:disabled):active {
  background: #080f1d;
  border-color: #080f1d;
  color: #ffffff;
}

.primary-next-match-button:disabled,
.primary-next-match-button:disabled:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.archived-result-display-action {
  align-items: center;
  border-top: 1px solid #e5eaf2;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
}

.archived-result-display-action span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 700;
}

.field-display-projection-notice {
  align-items: center;
  background: #fff8db;
  border: 1px solid #e7c85d;
  border-radius: 10px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 8px 12px 0;
  padding: 10px 12px;
}

.field-display-projection-notice > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.field-display-projection-notice span,
.field-display-projection-notice small {
  color: #80610b;
  font-size: var(--font-caption);
  font-weight: 800;
}

.field-display-projection-notice strong {
  color: #3b2d05;
  font-size: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-display-projection-notice button {
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .field-display-projection-notice,
  .archived-result-display-action {
    align-items: stretch;
    flex-direction: column;
  }

  .field-display-projection-notice button,
  .archived-result-display-action button {
    width: 100%;
  }
}

.timer-settings {
  border-top: 1px solid #e5eaf2;
  margin-top: 10px;
  padding-top: 10px;
}

.menu-tabs {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 10px 12px;
  position: sticky;
  top: 75px;
  z-index: 4;
}

.menu-tabs button {
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  min-height: 38px;
}

.module {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  padding: var(--card-padding);
}

.module.wide {
  grid-column: span 2;
}

.module h2 {
  font-size: var(--font-page-title);
  font-weight: var(--weight-strong);
  line-height: 1.25;
  margin: 0 0 10px;
}

.module h3 {
  align-items: center;
  display: flex;
  font-size: var(--font-section-title);
  font-weight: var(--weight-strong);
  justify-content: space-between;
  margin: 0 0 8px;
}

.module h3 span {
  color: var(--muted);
  font-size: var(--font-label);
}

.module-title-row {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.module-title-row h2 {
  margin-bottom: 4px;
}

.module-title-row .hint {
  margin-top: 0;
}

.hint,
.empty {
  color: var(--muted);
  font-size: var(--font-body-small);
  font-weight: var(--weight-regular);
  margin: 10px 0 0;
}

.small-stat {
  color: #64748b;
  font-size: var(--font-label);
  margin: 8px 0 0;
}

.segmented,
.button-row,
.action-row,
.import-row {
  display: flex;
  gap: 8px;
}

.segmented button {
  flex: 1;
}

.vertical {
  flex-direction: column;
}

.player-form {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(80px, 1fr));
  margin-top: 12px;
}

.table-wrap {
  margin-top: 10px;
  max-height: 300px;
  overflow: auto;
}

.player-table-wrap {
  max-height: clamp(280px, calc(100vh - 430px), 760px);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #e5eaf2;
  padding: 5px;
  text-align: left;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: var(--font-body-small);
  position: sticky;
  top: 0;
}

td input {
  min-width: 80px;
}

td select {
  min-width: 88px;
}

td [data-field="birthDate"] {
  min-width: 126px;
}

td [data-field="idNumber"] {
  min-width: 170px;
}

.table-actions {
  white-space: nowrap;
}

.round-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.round-card {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  padding: 8px;
}

.round-card.locked {
  background: #f8fafc;
}

.match-button {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #bfc7d5;
  border-radius: 6px;
  color: #111827;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  min-height: 36px;
  padding: 7px 12px;
  text-align: left;
  width: 100%;
}

.match-button.static {
  cursor: default;
}

.match-button strong {
  font-size: var(--font-body-small);
}

.match-button span {
  font-weight: 700;
}

.match-button em {
  color: var(--muted);
  font-size: var(--font-label);
  font-style: normal;
}

.match-button.done {
  border-color: #a7d8b7;
}

.match-button.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.match-button.active em {
  color: #d1d5db;
}

.group-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 10px;
}

.group-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.group-card {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.group-card.active-group {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.group-card h3 {
  gap: 12px;
}

.group-players {
  color: #334155;
  font-size: var(--font-body-small);
  line-height: 1.5;
  margin-bottom: 10px;
}

.group-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin-bottom: 10px;
}

.draw-summary {
  border-top: 1px solid #e5eaf2;
  margin-top: 10px;
  padding-top: 10px;
}

.draw-summary-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.draw-summary-head .hint {
  margin: 0;
}

.draw-summary-head button {
  flex: 0 0 auto;
}

.export-row {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(8px, 2vw, 24px);
  position: fixed;
  z-index: 100;
}

.tree-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: min(860px, calc(100dvh - 32px));
  max-width: min(92vw, 1280px);
  min-height: 420px;
  overflow: hidden;
  padding: 14px;
  width: 100%;
}

.tree-modal header {
  align-items: center;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.tree-modal h2 {
  font-size: 18px;
  margin: 0;
}

.tree-modal p {
  color: var(--muted);
  margin: 4px 0 0;
}

.tree-modal .bracket-preview {
  margin-top: 0;
  min-height: 0;
  overflow: auto;
  padding: 8px 18px 12px 0;
}

.tree-modal .bracket-preview-round {
  min-width: 230px;
}

.tree-modal .bracket-preview-node {
  padding: 12px;
}

.player-entry-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(900px, calc(100dvh - 32px));
  max-width: min(94vw, 1180px);
  overflow: hidden;
  width: 100%;
}

.player-entry-modal > header {
  align-items: center;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.player-entry-modal h2 {
  font-size: 18px;
  margin: 0;
}

.player-entry-modal header p {
  color: var(--muted);
  margin: 4px 0 0;
}

.player-entry-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 12px 16px;
}

.player-entry-row {
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  padding: 10px;
}

.player-entry-row-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.player-entry-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.player-entry-fields > label,
.player-entry-events {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.player-entry-fields > label > span,
.player-entry-events > span {
  color: #475569;
  font-size: var(--font-label);
  font-weight: 800;
}

.player-entry-events .competition-type-checks {
  min-height: 34px;
}

.player-entry-id {
  grid-column: span 2;
}

.entry-icon-button {
  align-items: center;
  display: inline-flex;
  font-size: 20px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.entry-icon-button.remove {
  color: #b91c1c;
}

.player-entry-modal > footer {
  align-items: center;
  border-top: 1px solid #e5eaf2;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  padding: 12px 16px;
}

.player-entry-modal > footer > span {
  color: var(--muted);
  font-size: var(--font-body-small);
  font-weight: 800;
}

.player-entry-modal > footer > div {
  display: flex;
  gap: 8px;
}

.player-import-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  max-width: min(92vw, 680px);
  overflow: hidden;
  width: 100%;
}

.player-import-modal > header {
  align-items: center;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.player-import-modal h2 {
  font-size: 18px;
  margin: 0;
}

.player-import-modal header p {
  color: var(--muted);
  margin: 4px 0 0;
}

.player-import-content {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.player-import-picker {
  display: grid;
  gap: 8px;
}

.player-import-picker > span,
.player-import-note strong {
  color: #334155;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
}

.player-import-picker input {
  min-height: 38px;
  padding: 8px;
}

.player-import-note {
  background: #f8fafc;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  padding: 10px;
}

.player-import-note p {
  color: #64748b;
  font-size: var(--font-body-small);
  line-height: 1.6;
  margin: 6px 0 0;
}

.player-import-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: var(--font-body-small);
  font-weight: 800;
  padding: 10px 12px;
}

.player-import-modal > footer {
  border-top: 1px solid #e5eaf2;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
}

.schedule-age-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(780px, calc(100dvh - 32px));
  max-width: min(94vw, 920px);
  overflow: hidden;
  width: 100%;
}

.schedule-age-modal > header,
.schedule-age-modal > footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.schedule-age-modal > header {
  border-bottom: 1px solid #e5eaf2;
}

.schedule-age-modal > footer {
  border-top: 1px solid #e5eaf2;
}

.schedule-age-modal h2 {
  font-size: 18px;
  margin: 0;
}

.schedule-age-modal p,
.schedule-age-modal footer span {
  color: var(--muted);
  margin: 4px 0 0;
}

.schedule-age-modal footer > div {
  display: flex;
  gap: 8px;
}

.schedule-preallocation-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  max-width: min(94vw, 620px);
  overflow: hidden;
  width: 100%;
}

.schedule-preallocation-modal > header,
.schedule-preallocation-modal > footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.schedule-preallocation-modal > header {
  border-bottom: 1px solid #e5eaf2;
}

.schedule-preallocation-modal > footer {
  border-top: 1px solid #e5eaf2;
  justify-content: flex-end;
}

.schedule-preallocation-modal h2 {
  font-size: 18px;
  margin: 0;
}

.schedule-preallocation-modal header p,
.schedule-preallocation-status {
  color: var(--muted);
  margin: 4px 0 0;
}

.schedule-preallocation-rules {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.schedule-preallocation-rules div {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.schedule-preallocation-rules span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 800;
}

.schedule-preallocation-rules strong {
  font-size: var(--font-body-small);
  text-align: right;
}

.schedule-preallocation-status {
  padding: 0 16px 16px;
}

.manual-group-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(760px, calc(100dvh - 32px));
  max-width: min(94vw, 820px);
  overflow: hidden;
  width: 100%;
}

.group-edit-modal {
  max-width: min(94vw, 560px);
}

.manual-group-modal > header,
.manual-group-modal > footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.manual-group-modal > header {
  border-bottom: 1px solid #e5eaf2;
}

.manual-group-modal > footer {
  border-top: 1px solid #e5eaf2;
}

.manual-group-modal h2 {
  font-size: 18px;
  margin: 0;
}

.manual-group-modal header p,
.manual-group-modal footer > span {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 700;
  margin: 4px 0 0;
}

.manual-group-modal footer > div {
  display: flex;
  gap: 8px;
}

.manual-group-content {
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
}

.manual-group-selection {
  align-items: baseline;
  background: #f8fafc;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 10px;
}

.manual-group-selection strong {
  color: #334155;
  flex: 0 0 auto;
  font-size: var(--font-label);
}

.manual-group-selection span {
  color: #64748b;
  font-size: var(--font-label);
  line-height: 1.5;
}

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

.manual-group-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.manual-group-fields label > span {
  color: #475569;
  font-size: var(--font-label);
  font-weight: 800;
}

.manual-group-fields .weight-unrestricted-field {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  gap: 9px;
  padding: 10px 12px;
}

.manual-group-fields .weight-unrestricted-field input {
  flex: 0 0 auto;
  height: 16px;
  margin: 2px 0 0;
  min-height: 0;
  width: 16px;
}

.manual-group-fields .weight-unrestricted-field > span {
  display: grid;
  gap: 3px;
}

.manual-group-fields .weight-unrestricted-field strong {
  color: #1e293b;
  font-size: var(--font-body-small);
}

.manual-group-fields .weight-unrestricted-field small {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: 500;
  line-height: 1.45;
}

.manual-group-fields label.is-disabled > span {
  color: #94a3b8;
}

.manual-group-name {
  grid-column: 1 / -1;
}

.manual-group-fields textarea {
  min-height: 74px;
  resize: vertical;
}

.schedule-age-order-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px;
}

.schedule-age-section {
  display: grid;
  gap: 8px;
}

.schedule-age-section + .schedule-age-section {
  border-top: 1px solid #e5eaf2;
  padding-top: 12px;
}

.schedule-age-section-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.schedule-age-section-head h3 {
  font-size: var(--font-section-title);
  margin: 0;
}

.schedule-age-section-head span {
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.schedule-age-row {
  align-items: center;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  padding: 10px;
}

.schedule-age-rank {
  align-items: center;
  background: #0f172a;
  border-radius: 7px;
  color: #ffffff;
  display: inline-flex;
  font-size: var(--font-body-small);
  font-weight: var(--weight-strong);
  justify-content: center;
  min-height: 32px;
  padding: 4px 7px;
}

.schedule-age-main {
  min-width: 0;
}

.schedule-age-main h3 {
  font-size: var(--font-section-title);
  margin: 0 0 4px;
}

.schedule-age-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-age-stats,
.schedule-age-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.schedule-age-stats span {
  border: 1px solid;
  border-radius: 999px;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 5px 8px;
  white-space: nowrap;
}

.schedule-age-stats .court-a {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.schedule-age-stats .court-b {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.schedule-age-stats .court-pending {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.bracket-map {
  position: relative;
}

.bracket-map-preview {
  margin-top: 0;
  min-height: 420px;
  min-width: 820px;
  width: 100%;
}

.bracket-map-lines,
.display-bracket-lines {
  height: 100%;
  inset: 0;
  overflow: visible;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.bracket-map-lines path,
.display-bracket-lines path {
  fill: none;
  stroke: #c7d2e1;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bracket-map-lines path.player-branch,
.display-bracket-lines path.player-branch {
  stroke-width: 1.5;
}

.bracket-map-lines path.advanced,
.display-bracket-lines path.advanced {
  stroke: var(--red);
  stroke-width: 5;
}

.bracket-map-node {
  display: grid;
  gap: 4px;
  grid-template-rows: 20px 40px 40px;
  overflow: visible;
  position: absolute;
  z-index: 2;
}

.bracket-map-node::before {
  border: 2px solid #cbd5e1;
  border-radius: 6px 0 0 6px;
  border-right: 0;
  bottom: auto;
  box-sizing: border-box;
  content: "";
  left: -8px;
  position: absolute;
  height: 84px;
  top: 24px;
  width: 7px;
}

.bracket-map-node.done::before {
  border-color: #86c897;
}

.bracket-match-label {
  align-items: center;
  color: #0f7180;
  display: flex;
  font-size: var(--font-label);
  font-weight: 800;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.bracket-match-label span,
.bracket-match-label em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-match-label em {
  color: #64748b;
  font-size: var(--font-caption);
  font-style: normal;
}

.bracket-player-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  font-size: var(--font-body-small);
  font-weight: 800;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  padding: 6px 8px;
}

.bracket-player-card > span {
  border-radius: 4px;
  color: #ffffff;
  font-size: var(--font-caption);
  padding: 2px 5px;
}

.bracket-player-card.red > span {
  background: var(--red);
}

.bracket-player-card.white > span {
  background: #111827;
}

.bracket-player-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-player-card.winner {
  background: #fff7ed;
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(201, 24, 40, 0.08);
}

.bracket-player-card.loser {
  opacity: 0.68;
}

.bracket-player-card.empty {
  background: #f8fafc;
  border-style: dashed;
  color: #64748b;
  margin: 0;
}

.bracket-preview {
  --round-gap: 18px;
  --tree-gap: 22px;
  display: grid;
  gap: var(--tree-gap);
  grid-template-columns: repeat(var(--round-count), minmax(190px, 1fr));
  margin-top: 12px;
  overflow: auto;
  padding: 4px calc(var(--tree-gap) + 10px) 10px 0;
}

.bracket-preview-round {
  min-width: 0;
}

.bracket-preview-round h4 {
  color: #475569;
  font-size: var(--font-body-small);
  margin: 0 0 8px;
}

.bracket-preview-stack {
  display: flex;
  flex-direction: column;
  gap: var(--round-gap);
  height: 100%;
  justify-content: space-around;
}

.bracket-preview-node {
  --line-color: #cbd5e1;
  --line-width: 2px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 8px;
  position: relative;
}

.bracket-preview-node.connector-advanced {
  --line-color: var(--red);
  --line-width: 4px;
}

.bracket-preview-node.has-connector .tree-connector {
  border-top: var(--line-width) solid var(--line-color);
  content: "";
  height: 0;
  left: 100%;
  position: absolute;
  top: 50%;
  width: var(--tree-gap);
}

.bracket-preview-node.has-connector .tree-connector::after {
  border-left: var(--line-width) solid var(--line-color);
  content: "";
  left: 50%;
  position: absolute;
  width: 0;
}

.bracket-preview-node.connector-top .tree-connector::after {
  height: calc(50% + var(--round-gap) / 2);
  top: 0;
}

.bracket-preview-node.connector-bottom .tree-connector::after {
  bottom: 0;
  height: calc(50% + var(--round-gap) / 2);
}

.bracket-preview-node.done {
  border-color: #86c897;
}

.bracket-player {
  align-items: center;
  display: flex;
  font-size: var(--font-body-small);
  font-weight: 800;
  gap: 6px;
  min-width: 0;
}

.bracket-player span {
  border-radius: 4px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: var(--font-label);
  padding: 2px 5px;
}

.bracket-player.red span {
  background: var(--red);
}

.bracket-player.white span {
  background: #111827;
}

.bracket-preview-node strong {
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: 700;
}

.result-actions {
  margin-top: 12px;
}

.result-save-block {
  border-top: 1px solid #e5eaf2;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

.result-save-block h3 {
  display: block;
  margin: 0;
}

.result-save-block .hint {
  margin-top: 0;
}

.results-page {
  display: grid;
  flex: 1 1 auto;
  gap: var(--device-gutter);
  grid-template-rows: auto minmax(0, 1fr);
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: var(--device-gutter);
}

.results-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.results-head h2 {
  margin-bottom: 4px;
}

.results-head .hint {
  margin-top: 0;
}

.results-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.results-summary-bar {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
}

.results-summary-bar div {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 9px;
}

.results-summary-bar span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.results-summary-bar strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  margin-top: 4px;
}

.results-toolbar {
  align-items: end;
  border-top: 1px solid #e5eaf2;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(110px, 0.7fr)) auto auto;
  margin-top: 10px;
  padding-top: 10px;
}

.results-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.results-toolbar span,
.results-toolbar em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: var(--weight-strong);
}

.results-toolbar input,
.results-toolbar select {
  min-width: 0;
  width: 100%;
}

.results-list-panel {
  min-height: 0;
  overflow: auto;
}

.result-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.compact-results {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
}

.result-list-head,
.result-row-main {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 2fr) minmax(110px, 0.85fr) 72px minmax(150px, 1.2fr) minmax(130px, 1fr) auto;
}

.result-list-head {
  color: #64748b;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  padding: 0 10px 2px;
}

.result-row {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
}

.result-row.expanded {
  border-color: #94a3b8;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.result-row-main[data-result-toggle] {
  border-radius: 6px;
  cursor: pointer;
  margin: -5px -6px;
  padding: 5px 6px;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.result-row-main[data-result-toggle]:hover {
  background: #f7f9fc;
}

.result-row-main[data-result-toggle]:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 113, 128, 0.18);
  outline: 2px solid #0f7180;
  outline-offset: 1px;
}

.result-row-main > div,
.result-group-cell,
.result-row-main strong,
.result-row-main span,
.result-row-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row-main strong {
  display: block;
  font-size: var(--font-body);
}

.result-row-main span,
.result-row-main em,
.result-group-cell span {
  color: #64748b;
  display: block;
  font-size: var(--font-label);
  font-style: normal;
  margin-top: 2px;
}

.result-cell-label {
  display: none;
}

.result-row-actions {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.result-row-chevron {
  border-bottom: 2px solid #64748b;
  border-right: 2px solid #64748b;
  display: block;
  height: 8px;
  margin: 0 5px 4px 3px;
  transform: rotate(45deg);
  transition: transform 160ms ease, margin 160ms ease;
  width: 8px;
}

.result-row.expanded .result-row-chevron {
  margin-bottom: -3px;
  transform: rotate(225deg);
}

.result-detail {
  border-top: 1px solid #e5eaf2;
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.compact-podium div {
  padding: 7px 8px;
}

.result-round-summary {
  display: grid;
  gap: 8px;
}

.result-round-group {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 8px;
}

.result-round-group h4 {
  font-size: var(--font-body-small);
  margin: 0 0 6px;
}

.result-match-summary {
  display: grid;
  gap: 5px;
}

.result-match-summary div {
  align-items: center;
  background: #f8fafc;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: 64px minmax(0, 1fr) minmax(180px, 1.2fr);
  padding: 6px 8px;
}

.result-match-summary span {
  color: #0f7180;
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

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

.result-match-summary em {
  color: #64748b;
  font-size: var(--font-label);
  font-style: normal;
}

.result-card {
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.result-card header {
  align-items: center;
  border-bottom: 1px solid #e5eaf2;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.result-card h3 {
  font-size: 16px;
  margin: 0;
}

.result-card p {
  color: var(--muted);
  margin: 4px 0 0;
}

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

.podium div {
  background: #f8fafc;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 8px;
  min-width: 0;
}

.podium span {
  color: var(--muted);
  display: block;
  font-size: var(--font-label);
  margin-bottom: 4px;
}

.podium strong {
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-rounds-scroll {
  border-top: 1px solid #e5eaf2;
  max-height: 320px;
  min-height: 0;
  overflow: auto;
  padding-top: 10px;
}

.timer-control {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.timer-control button {
  grid-column: span 2;
}

.control-timer {
  background: #111827;
  border-radius: 8px;
  color: var(--digit-yellow);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 58px;
  letter-spacing: 0;
  line-height: 1;
  margin: 12px 0;
  padding: 14px;
  text-align: center;
}

.current-match {
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 12px;
}

.match-title {
  color: var(--muted);
  font-size: var(--font-body-small);
  margin-bottom: 10px;
}

.versus-line {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto 1fr;
  font-size: 18px;
  font-weight: 800;
}

.red-name {
  color: var(--red);
}

.champion {
  background: #fff7d6;
  border: 1px solid #f4d35e;
  border-radius: 6px;
  font-weight: 800;
  margin-top: 12px;
  padding: 10px;
}

.side-red {
  border-top: 4px solid var(--red);
}

.side-white {
  border-top: 4px solid #111827;
}

.side-player {
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
  min-height: 28px;
}

.score-row {
  align-items: center;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding: 10px;
}

.score-row strong {
  font-size: 28px;
}

textarea {
  margin: 12px 0 8px;
  resize: vertical;
}

@media (max-width: 1280px) {
  .schedule-head-actions {
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
  }

  .schedule-type-toolbar {
    justify-content: flex-start;
  }

  .schedule-action-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }
}

@media (max-width: 1120px) {
  .control-header {
    grid-template-columns: minmax(180px, auto) 1fr;
  }

  .header-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .overview-strip {
    grid-template-columns: repeat(4, minmax(78px, 1fr));
  }

  .overview-court {
    grid-column: span 2;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

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

  .checkin-page {
    grid-template-columns: var(--workspace-list-width) minmax(0, 1fr);
  }

  .schedule-panel,
  .schedule-list {
    overflow: visible;
  }

  .field-login-grid {
    grid-template-columns: 1fr;
  }

  .people-workspace {
    grid-template-columns: var(--workspace-list-width) minmax(420px, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .roster-filter-bar {
    align-items: stretch;
  }

  .draw-head-actions {
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
  }

  .draw-head-actions .competition-type-filter {
    justify-content: flex-start;
  }

  .draw-head-actions .export-row {
    justify-content: flex-start;
  }

  .schedule-head-actions {
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
  }

  .schedule-head-actions .draw-summary-inline {
    justify-content: flex-start;
  }

  .schedule-type-toolbar {
    justify-content: flex-start;
  }

  .schedule-overview-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .player-entry-fields {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .people-group-nav {
    grid-column: 1;
  }

  .people-member-panel {
    grid-column: 2;
  }

  .control-app.active-people .people-member-table-wrap {
    display: none;
  }

  .control-app.active-people .people-member-card-list {
    display: grid;
    flex: 1 1 auto;
    gap: 7px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .people-side-panel {
    grid-column: 1 / -1;
  }

  .people-side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .competition-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .competition-column {
    overflow: visible;
  }

  .field-toolbar {
    flex-wrap: wrap;
  }

  .field-status-main {
    flex-wrap: wrap;
    width: 100%;
  }

  .field-status-side {
    width: 100%;
  }

  .competition-picker-panel {
    flex-basis: auto;
  }

  .competition-picker-scroll,
  .competition-rounds-scroll,
  .competition-operation-panel,
  .competition-display-panel {
    overflow: visible;
  }

  .results-page {
    height: auto;
    overflow: visible;
  }

  .draw-group-list,
  .draw-detail {
    max-height: none;
    overflow: visible;
  }

  .draw-slot-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .results-head {
    flex-direction: column;
  }

  .results-actions {
    justify-content: flex-start;
  }

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

  .results-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .result-list-head {
    display: none;
  }

  .result-row-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-row-actions {
    justify-content: flex-start;
  }

  .result-match-summary div {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .schedule-row {
    align-items: center;
    gap: 6px 8px;
    grid-template-areas:
      "code main actions"
      "code status actions";
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 8px 10px;
  }

  .schedule-code {
    grid-area: code;
    min-height: 28px;
    min-width: 46px;
  }

  .schedule-main {
    grid-area: main;
  }

  .schedule-actions {
    flex-wrap: wrap;
    grid-area: actions;
    justify-self: end;
    max-width: 210px;
  }

  .schedule-actions button {
    min-width: 48px;
    padding: 5px 8px;
  }

  .schedule-status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    grid-area: status;
    gap: 5px;
    justify-self: start;
  }

  .people-entry-panel .player-table-wrap {
    max-height: clamp(280px, calc(100vh - 430px), 760px);
  }
}

@media (max-width: 1120px) and (min-width: 901px) {
  .control-app.active-draws .draw-detail {
    overflow: auto;
    width: 100%;
  }

  .control-app.active-draws .draw-slot-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draw-group-list,
  .draw-detail {
    overflow: auto;
  }

  .group-bulk-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .control-app.active-checkin {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .control-header {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 7px 10px;
  }

  .control-header h1 {
    font-size: var(--font-event-title);
    margin: 0;
  }

  .control-header p {
    display: none;
  }

  .header-tabs {
    display: flex;
    gap: 5px;
    margin: 0 -2px;
    overflow-x: auto;
    padding: 0 2px 2px;
    scrollbar-width: none;
  }

  .header-tabs::-webkit-scrollbar,
  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-tabs button {
    flex: 0 0 auto;
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .header-actions {
    align-items: center;
    flex-direction: row;
    gap: 5px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-actions button,
  .header-actions .display-link-button {
    flex: 0 0 auto;
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .control-app.active-checkin .header-actions,
  .control-app.active-people .header-actions {
    display: none;
  }

  .court-toggle-button {
    min-width: 0;
  }

  .lan-popover {
    left: 0;
    min-width: min(520px, calc(100vw - 32px));
    right: auto;
  }

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

  .control-app.active-checkin .overview-strip {
    display: none;
  }

  .overview-court {
    grid-column: span 2;
  }

  .people-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .people-prep-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .people-roster-drawer {
    padding: 10px;
  }

  .people-roster-drawer-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .people-group-nav,
  .people-member-panel,
  .people-side-panel {
    grid-column: 1;
    overflow: visible;
  }

  .people-side-panel {
    display: flex;
  }

  .roster-filter-bar {
    align-items: stretch;
  }

  .roster-filter-bar label,
  .roster-filter-bar .roster-filter-unit {
    flex: 1 1 100%;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .player-entry-modal {
    max-height: 96vh;
    max-width: 100%;
  }

  .player-entry-modal > header,
  .player-entry-list,
  .player-entry-modal > footer,
  .player-import-modal > header,
  .player-import-content,
  .player-import-modal > footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .player-entry-fields {
    grid-template-columns: 1fr;
  }

  .player-entry-id {
    grid-column: auto;
  }

  .player-entry-modal > footer {
    grid-template-columns: auto 1fr;
  }

  .player-entry-modal > footer > div {
    grid-column: 1 / -1;
  }

  .schedule-age-modal {
    max-height: 96vh;
    max-width: 100%;
  }

  .schedule-age-modal > header,
  .schedule-age-modal > footer,
  .schedule-age-order-list {
    padding-left: 12px;
    padding-right: 12px;
  }

  .schedule-age-modal > header,
  .schedule-age-modal > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-age-modal footer > div {
    flex-direction: column;
  }

  .schedule-age-modal > header button,
  .schedule-age-modal footer > div,
  .schedule-age-modal footer button {
    width: 100%;
  }

  .schedule-preallocation-modal {
    max-width: 100%;
  }

  .schedule-preallocation-modal > header,
  .schedule-preallocation-modal > footer {
    align-items: stretch;
    flex-direction: column;
    padding-left: 12px;
    padding-right: 12px;
  }

  .schedule-preallocation-modal > header button,
  .schedule-preallocation-modal > footer button {
    width: 100%;
  }

  .schedule-preallocation-rules {
    padding: 12px;
  }

  .schedule-preallocation-rules div {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-preallocation-rules strong {
    text-align: left;
  }

  .manual-group-modal {
    max-height: 96vh;
    max-width: 100%;
  }

  .manual-group-modal > header,
  .manual-group-modal > footer {
    align-items: stretch;
    flex-direction: column;
    padding-left: 12px;
    padding-right: 12px;
  }

  .manual-group-content {
    padding: 12px;
  }

  .manual-group-fields {
    grid-template-columns: 1fr;
  }

  .manual-group-name {
    grid-column: auto;
  }

  .manual-group-selection {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-group-modal footer > div,
  .manual-group-modal footer button {
    width: 100%;
  }

  .group-recommendation-hint button {
    grid-template-columns: 1fr;
  }

  .schedule-age-row {
    gap: 8px;
    grid-template-areas:
      "rank main actions"
      "stats stats stats";
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .schedule-age-rank {
    grid-area: rank;
  }

  .schedule-age-main {
    grid-area: main;
  }

  .schedule-age-stats {
    grid-area: stats;
    justify-content: flex-start;
  }

  .schedule-age-actions {
    flex-direction: column;
    grid-area: actions;
  }

  .schedule-age-actions button {
    min-height: var(--control-height);
    min-width: 52px;
    padding: 4px 8px;
  }

  .people-group-nav-list,
  .people-member-table-wrap {
    overflow: auto;
  }

  .control-grid,
  .checkin-page,
  .player-form,
  .menu-tabs,
  .podium,
  .draw-summary-bar,
  .draw-detail-actions,
  .schedule-row,
  .group-bulk-toolbar,
  .competition-score-grid,
  .match-dashboard-versus,
  .timer-control {
    grid-template-columns: 1fr;
  }

  .dashboard-vs {
    text-align: center;
  }

  .module.wide,
  .timer-control button {
    grid-column: span 1;
  }

  .group-bulk-actions {
    justify-content: flex-start;
  }

  .schedule-row {
    gap: 5px 8px;
    grid-template-areas:
      "code main actions"
      "code status actions";
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 0;
    padding: 7px 8px;
  }

  .schedule-code {
    font-size: var(--font-label);
    grid-area: code;
    min-height: 26px;
    min-width: 42px;
    padding: 3px 6px;
  }

  .schedule-main {
    grid-area: main;
  }

  .schedule-row h3 {
    font-size: var(--font-body);
    margin-bottom: 3px;
  }

  .schedule-row p {
    font-size: var(--font-caption);
  }

  .schedule-status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    grid-area: status;
    gap: 4px;
    justify-self: start;
  }

  .schedule-court-badge,
  .schedule-status .checkin-status-chip {
    font-size: var(--font-caption);
    padding: 4px 6px;
  }

  .schedule-actions {
    flex-direction: column;
    gap: 4px;
    grid-area: actions;
    justify-self: end;
  }

  .schedule-action-buttons {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-action-buttons button {
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 5px 7px;
  }

  .schedule-actions button {
    font-size: var(--font-label);
    min-height: 26px;
    min-width: 46px;
    padding: 3px 7px;
  }

  .control-header {
    align-items: flex-start;
  }

  .checkin-page {
    flex: 1 1 auto;
    gap: 6px;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 6px;
  }

  .control-app.active-checkin .checkin-page {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .checkin-head {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px;
  }

  .checkin-head > div:first-child {
    display: none;
  }

  .checkin-head h2 {
    font-size: 16px;
    margin: 0;
  }

  .checkin-head .hint {
    display: none;
  }

  .checkin-display-links {
    gap: 5px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .checkin-display-links .checkin-screen-button,
  .checkin-head .checkin-screen-button {
    flex: 0 0 auto;
    justify-content: center;
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .checkin-summary {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .checkin-summary div {
    min-width: 0;
    padding: 4px 5px;
  }

  .checkin-summary span,
  .checkin-stats span {
    font-size: var(--font-caption);
  }

  .checkin-summary strong {
    font-size: var(--font-body);
  }

  .checkin-mobile-switcher,
  .people-mobile-switcher,
  .draw-mobile-switcher,
  .competition-mobile-switcher {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px 8px;
  }

  .checkin-mobile-switcher div,
  .people-mobile-switcher div,
  .draw-mobile-switcher div,
  .competition-mobile-switcher div {
    min-width: 0;
  }

  .checkin-mobile-switcher em,
  .people-mobile-switcher em,
  .draw-mobile-switcher em,
  .competition-mobile-switcher em {
    color: #64748b;
    display: block;
    font-size: var(--font-caption);
    font-style: normal;
    font-weight: 800;
  }

  .checkin-mobile-switcher span {
    display: none;
  }

  .checkin-mobile-court-filter {
    grid-column: 1 / -1;
  }

  .checkin-mobile-court-filter .checkin-court-filter {
    justify-content: flex-start;
  }

  .checkin-mobile-court-filter .checkin-court-filter span {
    display: inline;
  }

  .checkin-list-heading .checkin-court-filter {
    display: none;
  }

  .checkin-mobile-switcher strong,
  .people-mobile-switcher strong,
  .draw-mobile-switcher strong,
  .competition-mobile-switcher strong {
    display: block;
    font-size: var(--font-body-small);
    font-weight: var(--weight-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .checkin-mobile-switcher button,
  .people-mobile-switcher button,
  .draw-mobile-switcher button,
  .competition-mobile-switcher button {
    min-height: var(--control-height);
    padding: 4px 8px;
    white-space: nowrap;
  }

  .checkin-list-panel.mobile-collapsed,
  .people-group-nav.mobile-collapsed,
  .draw-group-panel.mobile-collapsed,
  .competition-picker-panel.mobile-collapsed {
    display: none;
  }

  .checkin-list-panel.mobile-open,
  .people-group-nav.mobile-open,
  .draw-group-panel.mobile-open,
  .competition-picker-panel.mobile-open {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    bottom: 8px;
    box-shadow: 0 -18px 60px rgba(15, 23, 42, 0.28);
    left: 8px;
    max-height: min(72vh, 520px);
    overflow: hidden;
    padding: 10px;
    position: fixed;
    right: 8px;
    z-index: 30;
  }

  .checkin-list-panel.mobile-open .checkin-group-list,
  .people-group-nav.mobile-open .people-group-nav-list,
  .competition-picker-panel.mobile-open .competition-picker-scroll {
    max-height: calc(min(72vh, 520px) - 52px);
    overflow: auto;
  }

  .draw-group-panel.mobile-open .draw-group-list {
    align-content: start;
    max-height: calc(min(72vh, 520px) - 52px);
    overflow: auto;
  }

  .people-group-nav.mobile-open .people-group-nav-list {
    max-height: calc(min(72vh, 520px) - 150px);
  }

  .control-app.active-field .competition-mobile-switcher {
    margin: 6px 6px 0;
  }

  .control-app.active-field .overview-strip {
    display: none;
  }

  .control-app.active-field .competition-grid {
    gap: 6px;
    padding: 6px;
  }

  .control-app.active-field .competition-center {
    order: 1;
  }

  .control-app.active-field .competition-right {
    order: 2;
  }

  .control-app.active-field .competition-left {
    order: 3;
  }

  .competition-picker-panel.mobile-open h2 {
    font-size: var(--font-page-title);
    margin-bottom: 6px;
  }

  .checkin-detail-panel {
    min-height: 0;
    overflow: hidden;
    padding: 8px;
  }

  .checkin-detail {
    gap: 6px;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .checkin-detail header {
    gap: 6px;
    grid-template-areas: "actions";
    grid-template-columns: 1fr;
  }

  .control-app.active-checkin .checkin-detail-title-row,
  .control-app.active-checkin .checkin-detail-meta {
    display: none;
  }

  .checkin-detail h3 {
    font-size: var(--font-section-title);
    margin: 0;
  }

  .checkin-detail header .hint {
    font-size: var(--font-label);
    margin-top: 3px;
  }

  .checkin-stats {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .checkin-progress-row {
    align-items: stretch;
    gap: 6px;
  }

  .checkin-all-present-button {
    min-width: 86px;
    padding-inline: 7px;
  }

  .checkin-stats div {
    min-width: 0;
    padding: 4px 5px;
  }

  .checkin-stats strong {
    font-size: var(--font-body);
  }

  .checkin-roster {
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .checkin-player-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .checkin-player-side {
    align-items: center;
    flex-direction: row;
    gap: 4px;
  }

  .checkin-detail-actions,
  .checkin-player-actions {
    flex-wrap: wrap;
  }

  .checkin-detail-actions button {
    flex: 1 1 auto;
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .checkin-player-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .checkin-player-actions button {
    flex: 0 0 auto;
    min-height: var(--control-height);
    min-width: 54px;
    padding: 4px 8px;
  }

  .checkin-player-row {
    gap: 5px 8px;
    min-height: 0;
    padding: 7px 8px;
  }

  .checkin-player-main strong {
    font-size: var(--font-body);
  }

  .checkin-player-main span {
    font-size: var(--font-caption);
    margin-top: 2px;
  }

  .checkin-weight-control {
    gap: 4px;
    margin-top: 4px;
  }

  .checkin-weight-control label {
    min-height: 25px;
    padding: 2px 4px 2px 6px;
  }

  .checkin-weight-control input {
    height: 20px;
    width: 50px;
  }

  .checkin-weight-control button {
    min-height: 25px;
    padding: 3px 6px;
  }

  .checkin-status-chip {
    font-size: var(--font-caption);
    padding: 4px 7px;
  }

  .control-app.active-draws {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .control-app.active-draws .overview-strip {
    display: none;
  }

  .control-app.active-draws .draw-page-grid {
    flex: 1 1 auto;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    padding: 6px;
  }

  .control-app.active-draws .draw-page-head {
    grid-row: 1;
  }

  .control-app.active-draws .draw-mobile-switcher {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
  }

  .control-app.active-draws .draw-detail {
    grid-column: 1;
    grid-row: 3;
  }

  .control-app.active-draws .draw-mobile-backdrop {
    background: rgba(15, 23, 42, 0.34);
    border: 0;
    border-radius: 0;
    display: block;
    inset: 0;
    min-height: 0;
    padding: 0;
    position: fixed;
    z-index: 29;
  }

  .control-app.active-draws .draw-page-head {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }

  .control-app.active-draws .draw-page-head > div:first-child {
    display: none;
  }

  .control-app.active-draws .draw-head-actions {
    gap: 6px;
  }

  .control-app.active-draws .draw-head-actions .export-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .control-app.active-draws .draw-head-actions .export-row button {
    flex: 0 0 auto;
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .control-app.active-draws .draw-summary-bar {
    gap: 5px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0;
  }

  .control-app.active-draws .draw-summary-bar div {
    padding: 5px 6px;
  }

  .control-app.active-draws .draw-summary-bar span {
    font-size: var(--font-caption);
  }

  .control-app.active-draws .draw-summary-bar strong {
    font-size: var(--font-body);
    margin-top: 2px;
  }

  .control-app.active-draws .draw-detail {
    min-height: 0;
    overflow: auto;
    width: 100%;
  }

  .control-app.active-draws .draw-detail-header {
    align-items: flex-start;
    gap: 6px;
  }

  .control-app.active-draws .draw-detail-header > .draw-status {
    align-self: flex-start;
    flex: 0 0 auto;
    min-height: 0;
  }

  .control-app.active-draws .draw-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 6px;
  }

  .control-app.active-draws .draw-detail-actions select {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .control-app.active-draws .draw-detail-actions button {
    min-width: 0;
    padding-inline: 6px;
  }

  .control-app.active-draws .draw-seed-panel,
  .control-app.active-draws .draw-seed-controls,
  .control-app.active-draws .draw-slot-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .control-app.active-draws .draw-detail-section,
  .control-app.active-draws .draw-slot-list,
  .control-app.active-draws .draw-slot-row,
  .control-app.active-draws .slot-select,
  .control-app.active-draws .slot-player-profile {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .control-app.active-draws .selected-player-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .control-app.active-draws .selected-player-list span {
    width: 100%;
  }

  .control-app.active-people {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .control-app.active-people .overview-strip {
    display: none;
  }

  .control-app.active-people .people-workspace {
    flex: 1 1 auto;
    gap: 6px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(132px, 0.42fr) minmax(0, 1fr);
    height: auto;
    min-height: 0;
    overflow: hidden;
    padding: 6px;
  }

  .control-app.active-people .people-workspace > .module {
    min-height: 0;
    padding: 8px;
  }

  .control-app.active-people .people-mobile-switcher {
    grid-column: 1;
    grid-row: 2;
  }

  .control-app.active-people .people-side-panel {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
  }

  .control-app.active-people .people-member-panel {
    grid-column: 1;
    grid-row: 4;
    min-height: 0;
  }

  .control-app.active-people .people-topbar-main {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
  }

  .control-app.active-people .people-topbar-main > div:first-child {
    display: none;
  }

  .control-app.active-people .people-prep-summary {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 5px 6px;
    width: 100%;
  }

  .control-app.active-people .people-prep-summary div {
    flex: 1 0 auto;
    padding: 0 8px;
  }

  .control-app.active-people .people-prep-summary span {
    font-size: var(--font-caption);
  }

  .control-app.active-people .people-prep-summary strong {
    font-size: var(--font-body);
  }

  .control-app.active-people .people-topbar-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .control-app.active-people .people-topbar-actions button {
    flex: 0 0 auto;
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .control-app.active-people .people-group-nav,
  .control-app.active-people .people-member-panel,
  .control-app.active-people .people-side-panel {
    grid-column: 1;
    overflow: hidden;
  }

  .control-app.active-people .people-group-nav-head {
    gap: 5px;
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .control-app.active-people .people-group-nav-title {
    gap: 8px;
  }

  .control-app.active-people .competition-type-filter button {
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .control-app.active-people .people-group-search {
    gap: 5px;
    padding: 5px 7px;
  }

  .control-app.active-people .people-group-search input {
    min-height: var(--control-height);
    padding: 4px 7px;
  }

  .control-app.active-people .group-status-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .control-app.active-people .group-status-filters button {
    flex: 0 0 auto;
    min-height: var(--control-height);
    padding: 4px 7px;
  }

  .control-app.active-people .people-group-nav-list {
    flex: 1 1 auto;
    gap: 5px;
    max-height: none;
    min-height: 0;
    overflow: auto;
  }

  .control-app.active-people .people-group-nav-item {
    gap: 6px;
    min-height: 46px;
    padding: 6px 7px;
  }

  .control-app.active-people .people-group-nav-item strong {
    font-size: var(--font-body-small);
  }

  .control-app.active-people .people-group-nav-item em,
  .control-app.active-people .draw-status {
    font-size: var(--font-caption);
  }

  .control-app.active-people .people-panel-head {
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .control-app.active-people .people-panel-head h3 {
    font-size: var(--font-section-title);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .control-app.active-people .people-panel-head .hint {
    display: none;
  }

  .control-app.active-people .people-panel-actions {
    gap: 5px;
  }

  .control-app.active-people .people-panel-actions button {
    font-size: var(--font-label);
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .control-app.active-people .people-member-table-wrap {
    display: none;
  }

  .control-app.active-people .people-member-card-list {
    display: grid;
    flex: 1 1 auto;
    gap: 5px;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .people-member-card {
    background: #ffffff;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    display: grid;
    gap: 4px 7px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px 7px;
  }

  .people-member-card-main {
    min-width: 0;
  }

  .people-member-card-main strong,
  .people-member-card-main span,
  .people-member-card-foot em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .people-member-card-main strong {
    font-size: var(--font-body);
    font-weight: var(--weight-strong);
  }

  .people-member-card-main span {
    color: #64748b;
    font-size: var(--font-caption);
    font-weight: 800;
    margin-top: 2px;
  }

  .people-member-card-check {
    align-items: center;
    align-self: start;
    background: #f8fafc;
    border: 1px solid #d8e0eb;
    border-radius: 999px;
    color: #111827;
    display: inline-flex;
    gap: 0;
    min-height: 26px;
    padding: 4px 6px;
    white-space: nowrap;
  }

  .people-member-card-check input {
    height: 15px;
    margin: 0;
    width: 15px;
  }

  .people-member-card-check span {
    display: none;
  }

  .people-member-card-meta {
    display: grid;
    gap: 3px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .people-member-card-meta span {
    font-size: var(--font-caption);
    padding: 4px;
  }

  .people-member-card-meta span::before {
    font-size: 8px;
  }

  .people-member-card-foot {
    align-items: center;
    color: #64748b;
    display: grid;
    font-size: var(--font-caption);
    font-weight: 800;
    gap: 4px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .people-member-card-foot span {
    color: #0e7490;
  }

  .people-member-card-foot em {
    display: none;
  }

  .control-app.active-people .people-side-panel {
    gap: 7px;
    flex-direction: column;
    overflow: auto;
    padding-right: 2px;
  }

  .control-app.active-people .people-side-block:has(.people-side-toolbar) {
    order: -1;
  }

  .control-app.active-people .people-side-block {
    padding-bottom: 7px;
  }

  .control-app.active-people .people-side-toolbar {
    gap: 6px;
    grid-template-columns: auto minmax(0, 1fr);
    margin-top: 0;
    padding: 6px;
  }

  .control-app.active-people .group-bulk-actions {
    gap: 5px;
  }

  .control-app.active-people .group-bulk-actions button {
    flex: 1 1 0;
    font-size: var(--font-label);
    min-height: var(--control-height);
    min-width: 0;
    padding: 4px 6px;
  }

  .control-app.active-people .people-side-block h3 {
    font-size: var(--font-body-small);
    margin-bottom: 4px;
  }

  .control-app.active-people .group-check-list {
    gap: 5px;
    margin-top: 5px;
  }

  .control-app.active-people .group-check-list div,
  .control-app.active-people .readonly-note,
  .control-app.active-people .people-side-block .hint {
    font-size: var(--font-label);
    line-height: 1.35;
    padding: 6px 7px;
  }
}

.display-body {
  background: #000000;
  color: #ffffff;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
}

.court-progress-body {
  background: #edf1f5;
  color: #172033;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.court-progress-root,
.court-progress-page {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

.court-progress-loading {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 18px;
  font-weight: 800;
  justify-content: center;
  min-height: 100vh;
}

.court-progress-page {
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.court-progress-header {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 10px 14px;
}

.court-progress-title span {
  color: #64748b;
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.court-progress-title h1 {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.05;
  margin: 2px 0 0;
}

.court-progress-court-switch {
  background: #e8edf3;
  border-radius: 7px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(2, minmax(56px, 1fr));
  padding: 3px;
}

.court-progress-court-switch button {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #526075;
  font-weight: 900;
  min-height: 34px;
  padding: 5px 14px;
}

.court-progress-court-switch button.active {
  background: #172033;
  color: #ffffff;
}

.court-progress-connection {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.court-progress-connection i {
  background: #ef4444;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.court-progress-connection.online i {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.court-progress-live {
  align-items: stretch;
  background: #111827;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(220px, 0.85fr) minmax(420px, 1.7fr) minmax(150px, 0.55fr);
  overflow: hidden;
  padding: 12px 16px;
}

.court-progress-live.idle {
  grid-template-columns: minmax(0, 1fr);
}

.court-progress-live-label,
.court-progress-live-timer,
.court-progress-live.idle > div {
  align-content: center;
  display: grid;
  min-width: 0;
}

.court-progress-live-label span,
.court-progress-live.idle span {
  color: #45c9dc;
  font-size: 12px;
  font-weight: 900;
}

.court-progress-live-label strong,
.court-progress-live.idle strong {
  font-size: clamp(18px, 2vw, 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.court-progress-live-label em,
.court-progress-live.idle em {
  color: #cbd5e1;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  margin-top: 3px;
}

.court-progress-live-match {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
}

.court-progress-live-match > span {
  border-radius: 5px;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 7px;
}

.court-progress-live-match > span.red {
  background: #c91828;
}

.court-progress-live-match > span.white {
  background: #ffffff;
  color: #111827;
}

.court-progress-live-match strong {
  font-size: clamp(16px, 1.8vw, 27px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.court-progress-live-match strong:nth-of-type(2) {
  text-align: right;
}

.court-progress-live-match strong small {
  color: #cbd5e1;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 3px;
}

.court-progress-live-match b {
  color: #f6d316;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(34px, 4vw, 60px);
  line-height: 1;
}

.court-progress-live-match i {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.court-progress-live-timer {
  border-left: 1px solid #334155;
  justify-items: end;
  padding-left: 16px;
}

.court-progress-live-timer span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 900;
}

.court-progress-live-timer strong {
  color: #f6d316;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(40px, 5vw, 76px);
  line-height: 0.95;
}

.court-progress-workspace {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(300px, 0.32fr) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.court-progress-groups,
.court-progress-detail {
  background: #ffffff;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  min-height: 0;
  overflow: hidden;
}

.court-progress-groups {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.court-progress-groups-head {
  align-items: center;
  border-bottom: 1px solid #e5eaf0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.court-progress-groups-head > div {
  display: grid;
}

.court-progress-groups-head strong {
  font-size: 14px;
}

.court-progress-groups-head span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.court-progress-groups-head button {
  background: #e7f7fa;
  border: 1px solid #8dd7e2;
  color: #0f7180;
  font-size: 12px;
  min-height: 32px;
  padding: 5px 9px;
}

.court-progress-group-list {
  overflow: auto;
  padding: 6px;
}

.court-progress-group-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 6px;
  display: grid;
  gap: 3px 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 3px;
  min-height: 57px;
  padding: 7px 8px;
  text-align: left;
  width: 100%;
}

.court-progress-group-row:hover {
  background: #f5f8fb;
}

.court-progress-group-row.selected {
  background: #edf9fb;
  border-color: #69c7d4;
}

.court-progress-group-row.current {
  box-shadow: inset 3px 0 #0f7180;
}

.group-code {
  background: #172033;
  border-radius: 4px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  min-width: 36px;
  padding: 4px 6px;
  text-align: center;
}

.group-copy {
  display: grid;
  min-width: 0;
}

.group-copy strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-copy em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.progress-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.status-pending-checkin { background: #eef2f6; color: #64748b; }
.status-checkin { background: #e0edf8; color: #315b7d; }
.status-ready { background: #dff7f5; color: #0f766e; }
.status-active { background: #172033; color: #ffffff; }
.status-resumable { background: #fff1b8; color: #854d0e; }
.status-complete { background: #dcfce7; color: #166534; }
.status-archived { background: #166534; color: #ffffff; }

.group-progress {
  background: #e7ebf0;
  border-radius: 999px;
  grid-column: 2 / -1;
  height: 3px;
  overflow: hidden;
}

.group-progress i {
  background: #21aabd;
  display: block;
  height: 100%;
}

.court-progress-detail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.court-progress-navigator {
  align-items: center;
  border-bottom: 1px solid #e5eaf0;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) minmax(96px, auto);
  padding: 8px 12px;
}

.court-progress-navigator > button {
  align-items: center;
  background: #f4f7fa;
  border: 1px solid #d6dde7;
  color: #334155;
  display: flex;
  gap: 4px;
  justify-content: center;
  min-height: 40px;
  padding: 6px 10px;
}

.court-progress-navigator > button svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.court-progress-navigator > div {
  align-items: center;
  display: flex;
  gap: 9px;
  justify-content: center;
  min-width: 0;
}

.court-progress-navigator em {
  background: #172033;
  border-radius: 5px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.court-progress-navigator strong {
  font-size: clamp(16px, 1.7vw, 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.court-progress-metrics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px 12px 0;
}

.court-progress-metrics > div {
  background: #f5f7fa;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  padding: 7px 9px;
}

.court-progress-metrics span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.court-progress-metrics strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.court-progress-podium {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 12px 0;
}

.court-progress-podium > div {
  border: 1px solid transparent;
  border-radius: 7px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
}

.court-progress-podium .gold { background: #fff8db; border-color: #e9c64b; }
.court-progress-podium .silver { background: #f3f6fa; border-color: #b9c4d1; }
.court-progress-podium .bronze { background: #fff0e6; border-color: #d89a6a; }

.court-progress-podium span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.court-progress-podium strong {
  color: #172033;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.court-progress-podium strong i {
  color: #a65f32;
  font-style: normal;
  margin: 0 6px;
}

.court-progress-rounds {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-auto-columns: minmax(230px, 1fr);
  grid-auto-flow: column;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
}

.court-progress-round {
  min-width: 0;
}

.court-progress-round h2 {
  color: #526075;
  font-size: 13px;
  margin: 0 0 6px;
}

.court-progress-round > div {
  display: grid;
  gap: 7px;
}

.court-progress-match {
  background: #f8fafc;
  border: 1px solid #dce2ea;
  border-radius: 7px;
  overflow: hidden;
}

.court-progress-match.active {
  border-color: #20a9bc;
  box-shadow: 0 0 0 2px rgba(32, 169, 188, 0.12);
}

.court-progress-match.done {
  background: #ffffff;
  border-color: #a8dbb4;
}

.court-progress-match.has-winner header em {
  color: #166534;
  font-weight: 900;
}

.court-progress-match header {
  align-items: center;
  background: #edf1f5;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: space-between;
  padding: 5px 7px;
}

.court-progress-match.active header {
  background: #dff6f9;
  color: #0f7180;
}

.court-progress-match header em {
  color: #64748b;
  font-style: normal;
}

.court-progress-match > div {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 6px 7px;
}

.court-progress-match > div + div {
  border-top: 1px solid #e5eaf0;
}

.court-progress-match > div.winner {
  background: #e8f7ec;
  box-shadow: inset 4px 0 #16a34a;
}

.court-progress-match > div.winner strong {
  color: #14532d;
  font-weight: 900;
}

.court-progress-match > div.winner .court-progress-side-stats b {
  color: #15803d;
}

.court-progress-match > div.loser {
  background: #f8fafc;
  color: #64748b;
}

.court-progress-match > div span {
  border-radius: 4px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 5px;
}

.court-progress-match > div.red span { background: #c91828; }
.court-progress-match > div.white span { background: #ffffff; color: #111827; border: 1px solid #cbd5e1; }
.court-progress-match > div strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.court-progress-match > div b { color: #b77905; font-family: Impact, "Arial Black", sans-serif; font-size: 23px; }

.court-progress-side-stats {
  display: grid;
  justify-items: end;
  line-height: 1.1;
  min-width: 88px;
}

.court-progress-side-stats b {
  white-space: nowrap;
}

.court-progress-side-stats small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  margin-top: 3px;
  white-space: nowrap;
}

.court-progress-empty {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding: 16px;
  text-align: center;
}

.court-progress-empty.large {
  align-self: center;
  font-size: 16px;
}

@media (max-width: 900px) {
  .court-progress-body {
    height: auto;
    overflow: auto;
  }

  .court-progress-root,
  .court-progress-page {
    height: auto;
  }

  .court-progress-page {
    display: block;
    min-height: 100dvh;
    overflow: visible;
    padding: 7px;
  }

  .court-progress-header,
  .court-progress-live,
  .court-progress-workspace {
    margin-bottom: 7px;
  }

  .court-progress-live {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .court-progress-live-match {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .court-progress-live-timer {
    grid-column: 2;
    grid-row: 1;
  }

  .court-progress-workspace {
    display: block;
    overflow: visible;
  }

  .court-progress-groups {
    margin-bottom: 7px;
    max-height: 38vh;
  }

  .court-progress-detail {
    min-height: 52vh;
  }
}

@media (max-width: 620px) {
  .court-progress-header {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 9px;
  }

  .court-progress-connection {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: -4px;
  }

  .court-progress-court-switch {
    grid-template-columns: repeat(2, 48px);
  }

  .court-progress-court-switch button {
    min-height: 38px;
    padding: 5px 8px;
  }

  .court-progress-live {
    padding: 10px;
  }

  .court-progress-live-match {
    gap: 5px;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr) auto;
  }

  .court-progress-live-match strong {
    font-size: 14px;
  }

  .court-progress-live-match b {
    font-size: 31px;
  }

  .court-progress-navigator {
    gap: 6px;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: 7px;
  }

  .court-progress-navigator > button {
    min-height: 44px;
    padding: 4px;
  }

  .court-progress-navigator > button span {
    display: none;
  }

  .court-progress-navigator > div {
    display: grid;
    gap: 3px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .court-progress-navigator strong {
    font-size: 15px;
  }

  .court-progress-navigator .progress-status {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .court-progress-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 7px 7px 0;
  }

  .court-progress-podium {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 7px 0;
  }

  .court-progress-podium .gold {
    grid-column: 1 / -1;
  }

  .court-progress-rounds {
    grid-auto-columns: minmax(84vw, 1fr);
    padding: 8px 7px;
  }
}

.display-root {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

.checkin-display-root {
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

.checkin-display-screen {
  --checkin-name-size: clamp(28px, min(4.5vh, 3.2vw), 68px);
  --checkin-number-size: clamp(20px, min(3.4vh, 2.4vw), 50px);
  --checkin-meta-size: clamp(14px, min(2.2vh, 1.55vw), 30px);
  --checkin-status-size: clamp(14px, min(2vh, 1.35vw), 28px);
  background:
    radial-gradient(circle at 50% 20%, rgba(32, 214, 239, 0.14), transparent 36%),
    #070a0f;
  color: #ffffff;
  display: grid;
  gap: clamp(10px, 1.4vh, 20px);
  grid-template-rows: auto minmax(0, 1fr);
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(12px, 2.4vh, 36px) clamp(16px, 3.4vw, 68px);
}

.checkin-display-screen.empty-screen {
  align-content: center;
  justify-items: center;
  text-align: center;
}

.checkin-display-screen.empty-screen h1 {
  font-size: clamp(42px, 7vh, 90px);
  margin: 0;
}

.checkin-display-screen.empty-screen p {
  color: var(--digit-yellow);
  font-size: clamp(24px, 4vh, 52px);
  font-weight: 900;
  margin: 14px 0 0;
}

.checkin-display-screen header {
  align-items: end;
  border-bottom: 1px solid var(--display-line);
  display: grid;
  gap: clamp(10px, 2vw, 34px);
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding-bottom: clamp(7px, 1.1vh, 14px);
}

.checkin-display-title {
  min-width: 0;
}

.checkin-display-screen header span {
  color: #cbd5e1;
  display: block;
  font-size: clamp(14px, min(2vh, 1.55vw), 28px);
  font-weight: 900;
}

.checkin-display-screen h1 {
  font-size: clamp(28px, min(5vh, 4vw), 72px);
  line-height: 1.05;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.checkin-display-summary {
  color: var(--digit-yellow);
  font-size: clamp(13px, min(1.8vh, 1.3vw), 24px);
  font-weight: 900;
  line-height: 1.2;
  margin: clamp(4px, 0.6vh, 8px) 0 0;
}

.checkin-display-meta {
  display: grid;
  gap: clamp(6px, 0.9vh, 10px);
  justify-items: end;
}

.checkin-display-meta strong,
.checkin-display-meta em {
  border-radius: 8px;
  display: inline-flex;
  font-size: clamp(18px, min(3vh, 2.5vw), 44px);
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: clamp(7px, 0.9vh, 12px) clamp(12px, 1.6vw, 24px);
}

.checkin-display-meta strong {
  background: #ffffff;
  color: #000000;
}

.checkin-display-meta em {
  background: var(--digit-yellow);
  color: #000000;
}

.checkin-display-list {
  align-content: start;
  display: grid;
  gap: clamp(8px, 1.4vh, 18px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.checkin-layout-2 .checkin-display-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.checkin-layout-4 .checkin-display-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.checkin-layout-8 .checkin-display-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.checkin-display-player {
  background: #141922;
  border: 3px solid #2c3340;
  border-radius: 8px;
  display: grid;
  gap: clamp(5px, 0.9vh, 14px);
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: clamp(10px, 1.55vh, 22px);
}

.checkin-display-player.present {
  border-color: #22c55e;
}

.checkin-display-player.absent {
  border-color: #e11d48;
  background: #241018;
}

.checkin-display-player.late {
  border-color: var(--digit-yellow);
  background: #251f0c;
}

.checkin-display-player.draw-side-red {
  box-shadow: inset 6px 0 0 #e11d48;
}

.checkin-display-player.draw-side-white {
  box-shadow: inset 6px 0 0 #f8fafc;
}

.checkin-display-side-badge {
  border-radius: 6px;
  display: inline-flex;
  font-size: var(--checkin-status-size);
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  margin-right: clamp(8px, 0.8vw, 14px);
  padding: clamp(5px, 0.65vh, 9px) clamp(8px, 0.8vw, 14px);
  vertical-align: bottom;
}

.draw-side-red .checkin-display-side-badge {
  background: #e11d48;
  color: #ffffff;
}

.draw-side-white .checkin-display-side-badge {
  background: #f8fafc;
  color: #111827;
}

.checkin-display-player div,
.checkin-display-player p {
  min-width: 0;
}

.checkin-display-player strong,
.checkin-display-player span,
.checkin-display-player p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-display-player strong {
  color: var(--cyan);
  display: inline-block;
  font-size: var(--checkin-number-size);
  font-weight: 900;
  margin-right: clamp(8px, 0.8vw, 16px);
}

.checkin-display-player span {
  display: inline-block;
  font-size: var(--checkin-name-size);
  font-weight: 900;
  vertical-align: bottom;
}

.checkin-display-player p {
  color: #cbd5e1;
  align-self: end;
  font-size: var(--checkin-meta-size);
  font-weight: 800;
  grid-column: 1 / -1;
  margin: 0;
}

.checkin-display-player em {
  align-self: start;
  border-radius: 8px;
  font-size: var(--checkin-status-size);
  font-style: normal;
  font-weight: 900;
  justify-self: end;
  padding: clamp(6px, 0.8vh, 10px) clamp(10px, 1vw, 18px);
}

.checkin-display-player.pending em {
  background: #334155;
}

.checkin-display-player.present em {
  background: #22c55e;
  color: #052e16;
}

.checkin-display-player.absent em {
  background: #e11d48;
}

.checkin-display-player.late em {
  background: var(--digit-yellow);
  color: #000000;
}

.checkin-layout-2 {
  --checkin-name-size: clamp(44px, min(9vh, 5.8vw), 120px);
  --checkin-number-size: clamp(28px, min(5.8vh, 3.8vw), 78px);
  --checkin-meta-size: clamp(20px, min(3.4vh, 2.2vw), 46px);
  --checkin-status-size: clamp(18px, min(3vh, 2vw), 40px);
}

.checkin-layout-4 {
  --checkin-name-size: clamp(34px, min(6.4vh, 4.2vw), 88px);
  --checkin-number-size: clamp(24px, min(4.2vh, 2.8vw), 58px);
  --checkin-meta-size: clamp(17px, min(2.7vh, 1.8vw), 36px);
  --checkin-status-size: clamp(16px, min(2.4vh, 1.6vw), 32px);
}

.checkin-layout-8 {
  --checkin-name-size: clamp(24px, min(4.6vh, 2.7vw), 56px);
  --checkin-number-size: clamp(20px, min(3.4vh, 2vw), 42px);
  --checkin-meta-size: clamp(14px, min(2.2vh, 1.35vw), 28px);
  --checkin-status-size: clamp(13px, min(2vh, 1.25vw), 26px);
}

.checkin-display-board {
  --checkin-name-size: clamp(28px, min(4.5vh, 3.2vw), 68px);
  --checkin-number-size: clamp(20px, min(3.4vh, 2.4vw), 50px);
  --checkin-meta-size: clamp(14px, min(2.2vh, 1.55vw), 30px);
  --checkin-status-size: clamp(14px, min(2vh, 1.35vw), 28px);
  background:
    radial-gradient(circle at 50% 20%, rgba(32, 214, 239, 0.14), transparent 36%),
    #070a0f;
  box-sizing: border-box;
  color: #ffffff;
  display: grid;
  gap: clamp(10px, 1.4vh, 20px);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(10px, 1.8vh, 24px) clamp(10px, 1.8vw, 28px);
}

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

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

.checkin-display-court {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--display-line);
  border-radius: 10px;
  display: grid;
  gap: clamp(8px, 1.1vh, 16px);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: clamp(10px, 1.7vh, 24px);
}

.checkin-display-single .checkin-display-court {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  padding: clamp(12px, 2.4vh, 36px) clamp(16px, 3.4vw, 68px);
}

.checkin-display-court header {
  align-items: end;
  border-bottom: 1px solid var(--display-line);
  display: grid;
  gap: clamp(8px, 1.4vw, 24px);
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding-bottom: clamp(7px, 1.1vh, 14px);
}

.checkin-display-court header span {
  color: #cbd5e1;
  display: block;
  font-size: clamp(12px, min(1.8vh, 1.25vw), 22px);
  font-weight: 900;
}

.checkin-display-court h1 {
  font-size: clamp(22px, min(4.1vh, 3vw), 56px);
  line-height: 1.05;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.checkin-display-split .checkin-display-court header {
  align-items: center;
  min-height: clamp(92px, 15vh, 154px);
}

.checkin-display-split .checkin-display-court h1 {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-display-single .checkin-display-court header span {
  font-size: clamp(14px, min(2vh, 1.55vw), 28px);
}

.checkin-display-single .checkin-display-court h1 {
  font-size: clamp(28px, min(5vh, 4vw), 72px);
}

.checkin-display-empty-state {
  align-content: center;
  color: #cbd5e1;
  display: grid;
  gap: clamp(8px, 1vh, 14px);
  justify-items: center;
  min-height: 0;
  text-align: center;
}

.checkin-display-empty-state strong {
  color: var(--digit-yellow);
  font-size: clamp(38px, min(8vh, 5vw), 96px);
  font-weight: 900;
}

.checkin-display-empty-state span {
  font-size: clamp(18px, min(3vh, 2vw), 42px);
  font-weight: 900;
}

.checkin-display-split .checkin-layout-2 {
  --checkin-name-size: clamp(30px, min(6vh, 3.6vw), 74px);
  --checkin-number-size: clamp(22px, min(4vh, 2.5vw), 48px);
  --checkin-meta-size: clamp(15px, min(2.4vh, 1.5vw), 28px);
  --checkin-status-size: clamp(13px, min(2.1vh, 1.3vw), 24px);
}

.checkin-display-split .checkin-layout-4 {
  --checkin-name-size: clamp(24px, min(4.6vh, 2.8vw), 54px);
  --checkin-number-size: clamp(18px, min(3.2vh, 2vw), 36px);
  --checkin-meta-size: clamp(12px, min(2vh, 1.2vw), 22px);
  --checkin-status-size: clamp(11px, min(1.8vh, 1.1vw), 20px);
}

.checkin-display-split .checkin-layout-8 {
  --checkin-name-size: clamp(18px, min(3.3vh, 2vw), 38px);
  --checkin-number-size: clamp(15px, min(2.6vh, 1.6vw), 30px);
  --checkin-meta-size: clamp(10px, min(1.8vh, 1vw), 18px);
  --checkin-status-size: clamp(10px, min(1.6vh, 0.95vw), 17px);
}

.checkin-display-split .checkin-layout-2 .checkin-display-list,
.checkin-display-split .checkin-layout-4 .checkin-display-list,
.checkin-display-split .checkin-layout-8 .checkin-display-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkin-display-split .checkin-layout-2 .checkin-display-list {
  grid-template-rows: minmax(0, 1fr);
}

.checkin-display-split .checkin-layout-4 .checkin-display-list {
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.checkin-display-split .checkin-layout-8 .checkin-display-list {
  grid-template-rows: repeat(4, minmax(0, 1fr));
}

.checkin-display-court .checkin-display-list.checkin-side-ordered {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--checkin-draw-rows), minmax(0, 1fr));
}

@media (max-height: 720px) and (orientation: landscape) {
  .checkin-display-board {
    gap: 8px;
    padding-block: 10px;
  }

  .checkin-display-court {
    gap: 8px;
    padding: 10px;
  }

  .checkin-display-screen {
    gap: 8px;
    padding-block: 10px;
  }

  .checkin-display-court header,
  .checkin-display-screen header {
    align-items: center;
    padding-bottom: 8px;
  }

  .checkin-display-court header span,
  .checkin-display-screen header span {
    font-size: clamp(12px, 2vh, 18px);
  }

  .checkin-display-court h1,
  .checkin-display-screen h1 {
    font-size: clamp(22px, 4.8vh, 46px);
    margin-top: 2px;
  }

  .checkin-display-summary {
    font-size: clamp(11px, 2vh, 17px);
  }

  .checkin-display-meta strong,
  .checkin-display-meta em {
    font-size: clamp(14px, 2.7vh, 24px);
    padding: 6px 10px;
  }
}

@media (orientation: portrait), (max-width: 760px) {
  .checkin-display-board {
    gap: 8px;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
    padding: 12px;
  }

  .checkin-display-court,
  .checkin-display-screen {
    gap: 8px;
    padding: 12px;
  }

  .checkin-display-court header,
  .checkin-display-screen header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .checkin-display-title {
    padding-right: 50px;
  }

  .checkin-display-court header span,
  .checkin-display-screen header span {
    font-size: clamp(13px, 3.2vw, 22px);
  }

  .checkin-display-court h1,
  .checkin-display-screen h1 {
    font-size: clamp(24px, 7vw, 46px);
  }

  .checkin-display-summary {
    font-size: clamp(12px, 3.2vw, 18px);
  }

  .checkin-display-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
  }

  .checkin-display-meta strong,
  .checkin-display-meta em {
    justify-content: center;
  }

  .checkin-layout-2 .checkin-display-list {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .checkin-layout-4 .checkin-display-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .checkin-layout-8 .checkin-display-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .checkin-layout-2 {
    --checkin-name-size: clamp(34px, min(7vh, 10vw), 76px);
    --checkin-number-size: clamp(24px, min(5vh, 7vw), 52px);
    --checkin-meta-size: clamp(18px, min(3vh, 4vw), 32px);
    --checkin-status-size: clamp(16px, min(2.7vh, 3.8vw), 28px);
  }

  .checkin-layout-4 {
    --checkin-name-size: clamp(26px, min(5.2vh, 7vw), 52px);
    --checkin-number-size: clamp(20px, min(4vh, 5.2vw), 40px);
    --checkin-meta-size: clamp(14px, min(2.6vh, 3.5vw), 26px);
    --checkin-status-size: clamp(13px, min(2.4vh, 3.2vw), 24px);
  }

  .checkin-layout-8 {
    --checkin-name-size: clamp(18px, min(3.2vh, 5.8vw), 34px);
    --checkin-number-size: clamp(15px, min(2.6vh, 4.4vw), 26px);
    --checkin-meta-size: clamp(10px, min(1.9vh, 3vw), 18px);
    --checkin-status-size: clamp(10px, min(1.8vh, 2.9vw), 17px);
  }

  .checkin-display-list {
    gap: 7px;
  }

  .checkin-display-player {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }
}

@media (max-width: 520px) {
  .checkin-display-screen h1 {
    font-size: clamp(20px, 6.6vw, 34px);
  }

  .checkin-display-meta strong,
  .checkin-display-meta em {
    border-radius: 7px;
    font-size: clamp(13px, 4vw, 18px);
    padding: 6px 8px;
  }

  .checkin-display-player {
    border-width: 2px;
    gap: 3px;
    padding: 6px;
  }

  .checkin-display-player em {
    border-radius: 6px;
    padding: 4px 6px;
  }
}

.display-control {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  color: #000000;
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  min-height: 42px;
  opacity: 1;
  padding: 0;
  position: fixed;
  top: 18px;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
  width: 42px;
  z-index: 50;
}

.display-control:hover {
  background: #ffffff;
}

.display-control svg {
  display: block;
  height: 24px;
  pointer-events: none;
  width: 24px;
}

.display-control path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}

.fullscreen-btn {
  right: 18px;
}

.checkin-mode-btn {
  right: 68px;
}

.layout-toggle-btn {
  right: 118px;
}

.sound-toggle-btn {
  right: 68px;
}

.sound-toggle-btn .icon-sound-on,
.sound-toggle-btn.is-enabled .icon-sound-off {
  display: none;
}

.sound-toggle-btn.is-enabled .icon-sound-on {
  display: block;
}

.sound-toggle-btn.is-enabled {
  background: #fff7d6;
  color: #9a3412;
}

.sound-toggle-btn.is-ready {
  background: #dcfce7;
  color: #166534;
}

.fullscreen-btn .icon-compress,
.fullscreen-btn.is-fullscreen .icon-expand {
  display: none;
}

.fullscreen-btn.is-fullscreen .icon-compress {
  display: block;
}

.display-control.is-hidden,
.fullscreen-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.scoreboard {
  background:
    linear-gradient(rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.68)),
    radial-gradient(circle at 50% 35%, #28313a 0, #11151b 42%, #020305 100%);
  display: grid;
  gap: clamp(10px, 2vh, 26px);
  grid-template-rows: minmax(112px, 21%) minmax(220px, 1fr) minmax(160px, 27%);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: clamp(18px, 4vh, 60px) clamp(36px, 6vw, 140px) clamp(16px, 3vh, 42px);
  position: relative;
}

.scoreboard::after {
  border: clamp(4px, 0.65vh, 9px) solid transparent;
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
  transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  z-index: 10;
}

.scoreboard.countdown-alert::after {
  border-color: rgba(239, 51, 71, 0.28);
  box-shadow: inset 0 0 clamp(42px, 8vw, 150px) rgba(215, 25, 45, 0.2);
}

.scoreboard.countdown-critical::after {
  border-color: rgba(255, 45, 45, 0.58);
  box-shadow: inset 0 0 clamp(68px, 12vw, 220px) rgba(215, 25, 45, 0.34);
}

.scoreboard.countdown-critical.countdown-tick-pulse::after {
  animation: countdown-critical-frame 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.scoreboard.countdown-time-up::after {
  animation: time-up-frame 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  border-color: rgba(255, 213, 0, 0.86);
  box-shadow: inset 0 0 clamp(80px, 14vw, 260px) rgba(215, 25, 45, 0.46);
}

.screen-top {
  align-items: end;
  display: grid;
  gap: clamp(24px, 5vw, 96px);
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}

.fighter-panel {
  border: clamp(2px, 0.45vh, 5px) solid;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -18px 38px rgba(0, 0, 0, 0.18),
    0 10px 30px rgba(0, 0, 0, 0.28);
  min-width: 0;
  overflow: hidden;
}

.fighter-red {
  background:
    linear-gradient(135deg, #7d101a 0%, #c91828 46%, #ef3347 100%);
  border-color: #ff1d35;
  color: #ffffff;
}

.fighter-white {
  background:
    linear-gradient(135deg, #cbd5e1 0%, #ffffff 46%, #f8fafc 100%);
  border-color: #f8fafc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -18px 38px rgba(15, 23, 42, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.24);
  color: #000000;
}

.fighter-label {
  align-items: center;
  display: flex;
  font-size: clamp(18px, 3.2vh, 42px);
  font-weight: 900;
  gap: clamp(8px, 1.2vw, 20px);
  justify-content: space-between;
  padding: clamp(4px, 0.7vh, 10px) clamp(10px, 1.2vw, 22px) 0;
}

.fighter-label span {
  display: block;
  font-size: clamp(16px, 2.4vh, 30px);
  font-weight: 900;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter-main {
  align-items: baseline;
  display: grid;
  gap: clamp(10px, 1.5vw, 28px);
  grid-template-columns: minmax(72px, 0.34fr) minmax(0, 1fr);
  padding: 0 clamp(10px, 1.2vw, 22px) clamp(6px, 1vh, 14px);
}

.fighter-main span,
.fighter-main strong {
  display: block;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter-main span {
  font-size: clamp(42px, 7vh, 98px);
  font-weight: 900;
}

.fighter-main strong {
  font-size: clamp(48px, 8vh, 112px);
  font-weight: 900;
}

.fighter-meta {
  font-size: clamp(14px, 2.3vh, 28px);
  font-weight: 900;
  min-height: 1.35em;
  opacity: 0.88;
  overflow: hidden;
  padding: 0 clamp(10px, 1.2vw, 22px) clamp(6px, 1vh, 14px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-middle {
  align-items: center;
  background: rgba(0, 0, 0, 0.88);
  border: clamp(3px, 0.65vh, 7px) solid #1f2937;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 0;
  position: relative;
}

.screen-middle-result {
  border-color: rgba(255, 255, 255, 0.82);
}

.screen-middle-result.result-red {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 220, 92, 0.3), transparent 34%),
    linear-gradient(135deg, #7f101b 0%, #d7192d 52%, #8a121d 100%);
  box-shadow:
    inset 0 0 70px rgba(255, 255, 255, 0.16),
    0 0 48px rgba(215, 25, 45, 0.34);
}

.screen-middle-result.result-white {
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.96), rgba(226, 232, 240, 0.78) 45%, #f8fafc 100%),
    linear-gradient(135deg, #ffffff, #cbd5e1);
  border-color: #ffffff;
  box-shadow:
    inset 0 0 60px rgba(15, 23, 42, 0.1),
    0 0 40px rgba(255, 255, 255, 0.24);
}

.timer-wrap {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 0;
  height: 100%;
  position: relative;
  width: 100%;
}

.timer-result-card {
  align-items: center;
  display: grid;
  gap: clamp(6px, 1.2vh, 18px);
  justify-items: center;
  max-width: min(92%, 1500px);
  padding: clamp(14px, 2.2vh, 36px) clamp(20px, 3vw, 70px);
  text-align: center;
}

.result-side-label {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: #111827;
  display: inline-flex;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(24px, 4vh, 58px);
  font-weight: 900;
  line-height: 1;
  padding: clamp(7px, 1.1vh, 16px) clamp(18px, 2.2vw, 46px);
}

.result-winner-name {
  color: #ffffff;
  align-items: baseline;
  display: flex;
  gap: clamp(14px, 2vw, 42px);
  justify-content: center;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(78px, 14vh, 210px);
  font-weight: 900;
  line-height: 0.98;
  max-width: 100%;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.42);
  text-wrap: balance;
}

.result-winner-name i {
  font-size: 0.42em;
  font-style: normal;
  opacity: 0.82;
}

.result-reason {
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: clamp(28px, 5vh, 76px);
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
  padding: clamp(7px, 1vh, 14px) clamp(16px, 2vw, 42px);
}

.result-context {
  color: rgba(255, 255, 255, 0.84);
  display: block;
  font-size: clamp(18px, 3vh, 44px);
  font-weight: 900;
  line-height: 1.1;
}

.result-white .result-side-label {
  background: #111827;
  color: #ffffff;
}

.result-white .result-winner-name {
  color: #050505;
  text-shadow: 0 3px 10px rgba(255, 255, 255, 0.68);
}

.result-white .result-reason {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.result-white .result-context {
  color: #111827;
}

.timer-status-stage {
  align-content: center;
  background: linear-gradient(135deg, rgba(18, 22, 28, 0.98), rgba(2, 3, 5, 0.99));
  border: clamp(3px, 0.55vh, 7px) solid rgba(255, 213, 0, 0.84);
  border-radius: 6px;
  display: grid;
  gap: clamp(10px, 2vh, 28px);
  inset: 0;
  justify-items: center;
  opacity: 0;
  overflow: hidden;
  padding: clamp(16px, 3vh, 46px) clamp(22px, 4vw, 76px);
  pointer-events: none;
  position: absolute;
  text-align: center;
  transform: scale(0.97);
  visibility: hidden;
  z-index: 4;
}

.timer-status-stage::before {
  background: linear-gradient(90deg, transparent, rgba(255, 213, 0, 0.84), transparent);
  content: '';
  height: clamp(3px, 0.5vh, 7px);
  left: 10%;
  position: absolute;
  right: 10%;
  top: 0;
}

.timer-status-stage strong {
  color: #ffd500;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(58px, 13vh, 176px);
  font-weight: 900;
  line-height: 0.92;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-shadow: 0 0 30px rgba(255, 213, 0, 0.32);
  text-wrap: balance;
}

.timer-status-stage span {
  color: #ffffff;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(25px, 5vh, 70px);
  font-weight: 900;
  line-height: 1.08;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.timer-status-stage.status-score-stop {
  border-color: rgba(32, 214, 239, 0.9);
}

.timer-status-stage.status-score-stop::before {
  background: linear-gradient(90deg, transparent, rgba(32, 214, 239, 0.96), transparent);
}

.timer-status-stage.status-score-stop strong {
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(32, 214, 239, 0.3);
}

.timer-status-stage.status-penalty-stop {
  border-color: rgba(255, 55, 55, 0.92);
}

.timer-status-stage.status-penalty-stop::before {
  background: linear-gradient(90deg, transparent, rgba(255, 55, 55, 0.96), transparent);
}

.timer-status-stage.status-weight-decision strong {
  color: #ffe56b;
}

.timer-wrap.timer-status-active .timer-status-stage {
  animation: timer-status-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  visibility: visible;
}

.timer-wrap.timer-status-active .timer-number {
  opacity: 0;
}

.timer-number {
  color: var(--digit-orange);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(150px, 31vh, 360px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 0.82;
  text-shadow:
    0 0 8px rgba(246, 211, 22, 0.8),
    0 0 22px rgba(243, 155, 32, 0.45);
  transition: opacity 140ms ease;
  transform-origin: 50% 50%;
  will-change: transform, filter;
}

.timer-number.timer-kata-name {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(44px, 11vh, 132px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.08;
  max-width: 92vw;
  overflow-wrap: anywhere;
  text-align: center;
}

.timer-warning {
  color: #ff2d2d;
  text-shadow:
    0 0 8px rgba(255, 45, 45, 0.9),
    0 0 24px rgba(255, 45, 45, 0.55);
}

.timer-number.timer-tick-pulse {
  animation: timer-second-impact 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.timer-wrap.timer-critical .timer-number.timer-tick-pulse {
  animation-name: timer-critical-impact;
}

@keyframes timer-second-impact {
  0% { filter: brightness(1.65); transform: scale(1.105); }
  45% { filter: brightness(1.18); transform: scale(0.985); }
  100% { filter: brightness(1); transform: scale(1); }
}

@keyframes timer-critical-impact {
  0% { filter: brightness(2.75); transform: scale(1.34); }
  46% { filter: brightness(1.3); transform: scale(0.94); }
  100% { filter: brightness(1); transform: scale(1); }
}

@keyframes countdown-critical-frame {
  0% {
    border-color: rgba(255, 55, 55, 1);
    box-shadow: inset 0 0 clamp(110px, 18vw, 330px) rgba(215, 25, 45, 0.7), 0 0 42px rgba(255, 45, 45, 0.76);
    opacity: 1;
  }
  100% {
    border-color: rgba(255, 45, 45, 0.5);
    box-shadow: inset 0 0 clamp(68px, 12vw, 220px) rgba(215, 25, 45, 0.3);
    opacity: 0.7;
  }
}

@keyframes timer-status-enter {
  0% { opacity: 0; transform: scale(0.88); }
  58% { opacity: 1; transform: scale(1.025); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes time-up-frame {
  0% { opacity: 0; }
  36% { opacity: 1; }
  62% { opacity: 0.52; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .timer-number.timer-tick-pulse,
  .timer-wrap.timer-status-active .timer-status-stage,
  .scoreboard.countdown-critical.countdown-tick-pulse::after,
  .scoreboard.countdown-time-up::after {
    animation: none;
  }

  .timer-wrap.timer-status-active .timer-status-stage {
    opacity: 1;
    transform: scale(1);
  }
}

.screen-bottom {
  align-items: stretch;
  display: grid;
  gap: clamp(16px, 3vw, 58px);
  grid-template-columns: 1fr minmax(220px, 0.54fr) 1fr;
  min-height: 0;
}

.screen-score {
  background: rgba(0, 0, 0, 0.84);
  border: clamp(3px, 0.55vh, 6px) solid;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.score-red {
  border-color: var(--red);
}

.score-white {
  border-color: #ffffff;
}

.screen-score.penalty-limit {
  box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.52), 0 0 34px rgba(255, 213, 0, 0.45);
}

.score-head {
  display: grid;
  font-size: clamp(18px, 3.7vh, 48px);
  font-weight: 900;
  grid-template-columns: 0.62fr repeat(3, minmax(0, 1fr));
  line-height: 1;
  text-align: center;
}

.score-head span {
  padding: clamp(6px, 1.1vh, 14px) clamp(5px, 0.6vw, 12px);
}

.score-red .score-head span {
  background:
    linear-gradient(135deg, #8f0f1b 0%, #c91828 55%, #ef3347 100%);
}

.score-white .score-head span {
  background:
    linear-gradient(135deg, #cbd5e1 0%, #ffffff 55%, #f8fafc 100%);
  color: #000000;
}

.score-values {
  align-items: center;
  display: grid;
  grid-template-columns: 0.62fr repeat(3, minmax(0, 1fr));
  text-align: center;
}

.score-values strong {
  color: var(--digit-yellow);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(58px, 10vh, 138px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
  text-shadow: 0 0 12px rgba(246, 211, 22, 0.7);
}

.match-number {
  align-self: center;
  color: var(--cyan);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(52px, 8vh, 120px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
  text-align: center;
  text-shadow: 0 0 14px rgba(32, 214, 239, 0.65);
}

.match-number span {
  background: #ffffff;
  border-radius: 8px;
  color: #000000;
  display: inline-block;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(22px, 3.2vh, 44px);
  line-height: 1.1;
  margin-top: clamp(6px, 1vh, 14px);
  padding: clamp(4px, 0.5vh, 8px) clamp(8px, 1vw, 18px);
  text-shadow: none;
}

.match-number small {
  color: #ffffff;
  display: block;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(15px, 2.2vh, 32px);
  font-weight: 900;
  line-height: 1.15;
  margin-top: clamp(6px, 1vh, 12px);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(32, 214, 239, 0.5);
  white-space: nowrap;
}

.penalty-notice {
  background: #ffd500;
  border: 2px solid #ffffff;
  border-radius: 8px;
  color: #000000;
  display: block;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(16px, 2.5vh, 34px);
  line-height: 1.15;
  margin-top: clamp(8px, 1.3vh, 18px);
  padding: clamp(5px, 0.8vh, 10px) clamp(8px, 1vw, 16px);
  text-shadow: none;
}

.broadcast-bar {
  background: rgba(8, 15, 29, 0.94);
  border-bottom: 2px solid rgba(255, 213, 0, 0.78);
  color: #ffffff;
  font-size: clamp(22px, 3.8vh, 52px);
  font-weight: 900;
  left: 0;
  overflow: hidden;
  padding: clamp(8px, 1.2vh, 16px) 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  white-space: nowrap;
  z-index: 200;
}

.broadcast-bar span {
  animation: broadcast-marquee 10s linear 3;
  display: inline-block;
  padding-left: 100vw;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

@keyframes broadcast-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.winner-popup {
  align-items: center;
  border-radius: 8px;
  display: grid;
  inset: 0;
  justify-items: center;
  justify-content: center;
  padding: 8vh 8vw;
  position: fixed;
  text-align: center;
  z-index: 30;
}

.winner-popup.hidden {
  display: none;
}

.winner-popup.result-red {
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 220, 92, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(92, 9, 18, 0.98), rgba(215, 25, 45, 0.97) 52%, rgba(92, 9, 18, 0.98));
  color: #ffffff;
}

.winner-popup.result-white {
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.9) 48%, rgba(248, 250, 252, 0.96)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(203, 213, 225, 0.96));
  color: #000000;
}

.winner-popup-card {
  align-items: center;
  display: grid;
  gap: clamp(12px, 2.2vh, 32px);
  justify-items: center;
  max-width: min(94vw, 1600px);
}

.winner-popup .result-side-label {
  font-size: clamp(30px, 5.2vh, 78px);
}

.winner-popup .result-winner-name {
  font-size: clamp(100px, 18vh, 270px);
}

.winner-popup .result-reason {
  font-size: clamp(34px, 6vh, 92px);
}

.winner-popup .result-context {
  font-size: clamp(22px, 3.6vh, 52px);
}

.bracket-screen {
  background: #0a0d12;
  color: #ffffff;
  display: grid;
  gap: clamp(8px, 1.8vh, 22px);
  grid-template-rows: auto 1fr;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: clamp(14px, 2.6vh, 38px) clamp(30px, 5vw, 96px) clamp(18px, 4vh, 56px);
  width: 100vw;
}

.bracket-screen header {
  align-items: end;
  border-bottom: 1px solid var(--display-line);
  display: grid;
  gap: clamp(14px, 2vw, 24px);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-width: 0;
  padding-bottom: clamp(6px, 1.1vh, 16px);
}

.bracket-screen h1,
.bracket-screen h2 {
  margin: 0;
}

.bracket-screen h1 {
  font-size: clamp(22px, 3.2vh, 42px);
  line-height: 1.08;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bracket-screen header div {
  color: var(--digit-yellow);
  font-size: clamp(16px, 2.2vh, 28px);
  font-weight: 900;
  line-height: 1.12;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-bracket-tree {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.display-bracket-map {
  left: var(--fit-left, 0);
  position: absolute;
  top: var(--fit-top, 0);
  transform: scale(var(--fit-scale, 1));
  transform-origin: top left;
}

.display-bracket-round {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.display-bracket-round h2 {
  color: #d1d5db;
  font-size: clamp(20px, 3.6vh, 38px);
  margin: 0 0 clamp(10px, 2vh, 24px);
}

.display-bracket-stack {
  display: flex;
  flex-direction: column;
  gap: var(--round-gap);
  justify-content: space-around;
  min-height: 0;
}

.display-bracket-node {
  --line-color: #697386;
  --line-width: 3px;
  display: grid;
  gap: 4px;
  grid-template-rows: 24px 52px 52px 18px 18px;
  overflow: visible;
  position: absolute;
  z-index: 2;
}

.display-bracket-node::before {
  border: 3px solid #4b5563;
  border-radius: 8px 0 0 8px;
  border-right: 0;
  bottom: 48px;
  content: "";
  left: -10px;
  position: absolute;
  top: 28px;
  width: 9px;
}

.display-bracket-node.connector-advanced {
  --line-color: var(--red);
  --line-width: 6px;
}

.display-bracket-node.has-connector .tree-connector {
  border-top: var(--line-width) solid var(--line-color);
  content: "";
  height: 0;
  left: 100%;
  position: absolute;
  top: 50%;
  width: var(--tree-gap);
}

.display-bracket-node.has-connector .tree-connector::after {
  border-left: var(--line-width) solid var(--line-color);
  content: "";
  left: 50%;
  position: absolute;
  width: 0;
}

.display-bracket-node.connector-top .tree-connector::after {
  height: calc(50% + var(--round-gap) / 2);
  top: 0;
}

.display-bracket-node.connector-bottom .tree-connector::after {
  bottom: 0;
  height: calc(50% + var(--round-gap) / 2);
}

.display-bracket-node.done {
  --group-line: #65d17a;
}

.display-bracket-node.done::before {
  border-color: #65d17a;
}

.display-bracket-node.current .display-tree-player {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(32, 214, 239, 0.18), 0 0 22px rgba(32, 214, 239, 0.2);
}

.display-bracket-node.locked {
  opacity: 0.55;
}

.display-match-title {
  align-items: center;
  color: var(--cyan);
  display: flex;
  font-size: clamp(13px, 1.9vh, 22px);
  font-weight: 900;
  gap: 10px;
  justify-content: space-between;
  line-height: 1.1;
  min-width: 0;
}

.display-match-title span,
.display-match-title em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-match-title em {
  color: var(--digit-yellow);
  font-size: 0.72em;
  font-style: normal;
}

.display-tree-player {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid #2c3340;
  border-radius: 6px;
  display: grid;
  gap: clamp(4px, 0.5vw, 10px);
  grid-template-columns: auto minmax(0, 1fr) minmax(24px, auto);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: clamp(4px, 0.65vh, 8px);
}

.display-tree-player span {
  border-radius: 4px;
  color: #ffffff;
  font-size: clamp(12px, 1.6vh, 18px);
  font-weight: 900;
  line-height: 1.1;
  padding: 0.18em 0.42em;
}

.display-tree-player.red span {
  background: var(--red);
}

.display-tree-player.white span {
  background: #ffffff;
  color: #000000;
}

.display-tree-player strong {
  display: block;
  font-size: clamp(15px, 2.1vh, 26px);
  line-height: 1.08;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-tree-player em {
  color: var(--digit-yellow);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(20px, 3vh, 36px);
  font-style: normal;
  line-height: 1;
  min-width: 1ch;
  text-align: right;
}

.display-tree-player.winner {
  background: rgba(246, 211, 22, 0.14);
  border-color: rgba(246, 211, 22, 0.8);
  outline: 2px solid rgba(246, 211, 22, 0.65);
}

.display-match-meta,
.display-match-state {
  color: #cbd5e1;
  font-size: clamp(12px, 1.55vh, 18px);
  font-weight: 800;
  line-height: 1.08;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-match-state {
  color: var(--digit-yellow);
}

.bracket-columns {
  display: grid;
  gap: clamp(16px, 2vw, 36px);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  min-height: 0;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vh, 24px);
  justify-content: center;
}

.bracket-round h2 {
  color: #d1d5db;
  font-size: clamp(20px, 3.6vh, 38px);
}

.bracket-match {
  background: #141922;
  border: 2px solid #2c3340;
  border-radius: 8px;
  display: grid;
  gap: clamp(4px, 0.6vh, 8px);
  padding: clamp(9px, 1.4vh, 18px) clamp(10px, 1vw, 20px);
}

.bracket-match.current {
  border-color: var(--cyan);
}

.bracket-match.done {
  border-color: #7dd38a;
}

.bracket-match div {
  align-items: center;
  display: flex;
  font-size: clamp(18px, 3vh, 32px);
  font-weight: 800;
  gap: clamp(8px, 0.8vw, 16px);
  min-width: 0;
}

.bracket-match div span {
  border-radius: 4px;
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.72em;
  padding: 0.18em 0.35em;
}

.bracket-match div:first-child span {
  background: var(--red);
}

.bracket-match div:nth-child(2) span {
  background: #ffffff;
  color: #000000;
}

.bracket-match strong {
  color: var(--digit-yellow);
  font-size: clamp(16px, 2.5vh, 28px);
}

.first-round-table {
  border-top: 1px solid var(--display-line);
  padding-top: clamp(10px, 2vh, 28px);
}

.first-round-table h2 {
  font-size: clamp(20px, 3.6vh, 38px);
}

.first-round-grid {
  display: grid;
  gap: clamp(10px, 1vw, 18px);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: clamp(8px, 1.5vh, 18px);
}

.first-round-grid div {
  background: #141922;
  border: 1px solid #2c3340;
  border-radius: 8px;
  display: grid;
  gap: clamp(4px, 0.6vh, 8px);
  padding: clamp(8px, 1vh, 14px) clamp(10px, 1vw, 18px);
}

.first-round-grid strong {
  color: var(--cyan);
  font-size: clamp(16px, 2.5vh, 28px);
}

.first-round-grid span {
  font-size: clamp(16px, 2.8vh, 30px);
  font-weight: 800;
}

@media (max-aspect-ratio: 4 / 3) {
  .scoreboard {
    padding: clamp(16px, 3vh, 44px) clamp(22px, 4vw, 72px);
  }

  .screen-bottom {
    gap: clamp(12px, 1.5vw, 28px);
    grid-template-columns: 1fr 0.6fr 1fr;
  }
}

/* Portrait phones are useful as a monitoring fallback even though the venue display is landscape-first. */
@media (max-aspect-ratio: 3 / 4) {
  .scoreboard {
    gap: 10px;
    grid-template-rows: minmax(112px, 20%) minmax(180px, 34%) minmax(210px, 1fr);
    padding: 18px 22px 16px;
  }

  .screen-top {
    gap: 10px;
  }

  .fighter-label {
    font-size: clamp(16px, 4.6vw, 20px);
    gap: 5px;
    padding: 5px 8px 0;
  }

  .fighter-label span,
  .fighter-meta {
    font-size: clamp(12px, 3.2vw, 15px);
  }

  .fighter-main {
    gap: 5px;
    grid-template-columns: minmax(36px, 0.38fr) minmax(0, 1fr);
    padding: 0 8px 6px;
  }

  .fighter-main span {
    font-size: clamp(32px, 9vw, 40px);
  }

  .fighter-main strong {
    font-size: clamp(38px, 11vw, 48px);
  }

  .fighter-meta {
    padding: 0 8px 6px;
  }

  .timer-number {
    font-size: clamp(96px, 25vw, 120px);
  }

  .screen-bottom {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(70px, 0.55fr) minmax(0, 1fr);
  }

  .screen-bottom > *,
  .score-head > *,
  .score-values > * {
    min-width: 0;
  }

  .score-head {
    font-size: clamp(12px, 3.6vw, 16px);
  }

  .score-head span {
    padding: 5px 2px;
  }

  .score-values strong {
    font-size: clamp(42px, 14vw, 62px);
  }

  .match-number {
    font-size: clamp(42px, 13vw, 58px);
  }

  .match-number span {
    font-size: clamp(14px, 3.8vw, 18px);
    padding-inline: 5px;
  }

  .match-number small {
    font-size: clamp(12px, 3.3vw, 15px);
  }
}

@media (max-height: 820px) {
  .scoreboard {
    gap: 10px;
    grid-template-rows: minmax(96px, 20%) minmax(180px, 1fr) minmax(136px, 28%);
    padding-bottom: 14px;
    padding-top: 16px;
  }

  .fighter-label {
    font-size: clamp(16px, 2.6vh, 30px);
  }

  .fighter-label span,
  .fighter-meta {
    font-size: clamp(12px, 1.9vh, 22px);
  }

  .timer-number {
    font-size: clamp(132px, 30vh, 250px);
  }

  .screen-bottom {
    grid-template-columns: 1fr minmax(170px, 0.5fr) 1fr;
  }
}

@media (max-width: 980px) {
  .global-feedback {
    bottom: 12px;
    left: 12px;
    max-width: none;
    right: 12px;
    top: auto;
    transform: translateY(8px);
  }

  .global-feedback.visible {
    transform: translateY(0);
  }

  .events-app {
    padding: 12px;
  }

  .events-header,
  .events-create-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .events-header {
    flex-direction: column;
  }

  .events-header-actions {
    flex-direction: column-reverse;
  }

  .events-account-chip {
    justify-content: space-between;
  }

  .events-enter-current {
    min-width: 0;
    width: 100%;
  }

  .account-workspace-head {
    align-items: flex-start;
    gap: 12px;
  }

  .account-member-add,
  .account-member-add.managed,
  .account-password-editor,
  .account-owner-transfer,
  .account-password-form,
  .account-audit-toolbar,
  .account-access-editor {
    grid-template-columns: 1fr;
  }

  .account-audit-toolbar {
    align-items: stretch;
  }

  .account-password-form {
    align-items: stretch;
  }

  .account-owner-transfer {
    align-items: stretch;
  }

  .account-owner-transfer .account-inline-error {
    grid-column: auto;
  }

  .account-member-card > header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .account-member-actions,
  .account-member-card > header > .danger {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .account-audit-item {
    align-items: start;
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .account-audit-item time {
    grid-column: 2;
  }

	  .event-form,
	  .event-form.compact,
	  .events-grid,
	  .event-backup-import,
	  .event-config-grid {
	    grid-template-columns: 1fr;
	  }

	  .event-card {
	    min-height: 0;
	  }

	  .event-card-head,
	  .event-guide {
	    grid-template-columns: minmax(0, 1fr);
	  }

	  .event-primary-action {
	    justify-self: start;
	  }

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

  .event-config-tabs {
    border-right: 0;
    border-bottom: 1px solid #e5eaf2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 13-inch desktop refinement: keep the operational layout stable down to 1121px. */
@media (min-width: 1121px) {
  .control-app .module h2,
  .control-app .module h3,
  .control-app .people-panel-head h3,
  .control-app .draw-detail-header h3,
  .control-app .schedule-main h3,
  .control-app .results-head h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .control-app .people-member-table {
    table-layout: fixed;
  }

  .control-app .people-member-table .people-col-secondary {
    display: none;
  }

  .control-app .people-member-table th,
  .control-app .people-member-table td {
    height: 40px;
    overflow: hidden;
    padding: 7px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .control-app .people-member-table .people-col-number {
    width: 68px;
  }

  .control-app .people-member-table .people-col-name {
    font-weight: 900;
    width: 88px;
  }

  .control-app .people-member-table .people-col-unit {
    width: 112px;
  }

  .control-app .people-member-table .people-col-gender,
  .control-app .people-member-table .people-col-age,
  .control-app .people-member-table .people-col-height,
  .control-app .people-member-table .people-col-weight {
    text-align: center;
    width: 54px;
  }

  .control-app .people-member-table .people-col-level {
    width: 84px;
  }

  .control-app .people-member-table .people-col-source {
    text-align: center;
    width: 76px;
  }

  .control-app .people-member-table .people-col-detail {
    text-align: center;
    width: 62px;
  }

  .control-app .people-member-table .people-col-detail button {
    font-size: 12px;
    min-height: var(--control-height);
    padding: 4px 8px;
  }

  .control-app .pending-pool-table .people-col-unit {
    width: 82px;
  }

  .control-app .pending-pool-table .pending-reason-cell {
    width: 180px;
  }

  .control-app .people-member-table .people-col-source small {
    display: none;
  }
}

@media (min-width: 1121px) and (max-width: 1366px) {
  .control-header {
    gap: 8px;
    grid-template-columns: minmax(160px, 0.7fr) minmax(500px, 2.2fr) auto;
    padding: 8px 12px;
  }

  .control-header h1 {
    font-size: 17px;
  }

  .control-header p {
    font-size: 12px;
  }

  .header-tabs {
    gap: 5px;
    grid-template-columns: repeat(6, minmax(78px, 1fr));
  }

  .header-tabs button {
    font-size: 13px;
    min-height: var(--control-height);
    padding-inline: 7px;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions button,
  .header-actions .display-link-button {
    font-size: 12px;
    min-height: var(--control-height);
    padding-inline: 8px;
    white-space: nowrap;
  }

  .court-toggle-button {
    min-width: 78px;
  }

  .overview-strip {
    gap: 6px;
    padding: 6px 10px;
  }

  .overview-metric,
  .overview-court {
    padding: 6px 7px;
  }

  .overview-metric strong,
  .overview-court strong {
    margin-top: 3px;
  }

  .people-workspace {
    gap: 8px;
    grid-template-columns: var(--workspace-list-width) minmax(0, 1fr) 250px;
    padding: 8px;
  }

  .people-topbar-main {
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) auto minmax(430px, auto);
  }

  .people-topbar-actions {
    gap: 6px;
  }

  .people-topbar-actions button {
    font-size: 12px;
    padding-inline: 8px;
  }

  .people-prep-summary {
    gap: 0;
  }

  .people-prep-summary div {
    min-width: 58px;
    padding: 5px 7px;
  }

  .competition-grid {
    gap: 8px;
    grid-template-columns: 280px minmax(450px, 1fr) 280px;
    padding: 8px;
  }

  .competition-column {
    gap: 8px;
  }

  .competition-group-row {
    min-height: 52px;
    padding: 7px 8px;
  }

  .competition-round-block {
    padding: 7px;
  }

  .competition-match-row {
    min-height: 40px;
    padding: 6px 7px;
  }

  .schedule-grid {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }

  .checkin-page,
  .results-page,
  .draw-page-grid {
    gap: 8px;
    padding: 8px;
  }

  .results-toolbar {
    gap: 6px;
    grid-template-columns: minmax(200px, 1.5fr) repeat(4, minmax(96px, 0.7fr)) auto auto;
  }
}

@media (min-width: 1121px) and (max-height: 760px) {
  .control-header {
    padding-block: 6px;
  }

  .control-header h1 {
    margin-bottom: 2px;
  }

  .overview-strip {
    padding-block: 5px;
  }

  .overview-metric,
  .overview-court {
    padding-block: 5px;
  }

  .control-app .module {
    padding: var(--card-padding);
  }

  .control-app .module h2 {
    margin-bottom: 7px;
  }

  .control-app .hint {
    font-size: var(--font-label);
    line-height: 1.35;
  }

  .people-topbar .hint,
  .results-head .hint,
  .checkin-head .hint {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .field-toolbar {
    padding-block: 5px;
  }

  .competition-picker-panel {
    min-height: 108px;
  }

  .match-dashboard,
  .match-dashboard-versus,
  .competition-score-grid {
    gap: 7px;
  }

  .dashboard-side,
  .score-control-panel {
    gap: 5px;
    padding: 7px;
  }

  .dashboard-side em {
    font-size: 28px;
  }

  .match-dashboard-status {
    padding: 6px 8px;
  }

  .score-metrics {
    gap: 5px;
  }

  .score-metrics div {
    padding: 5px;
  }

  .score-metrics strong {
    font-size: 23px;
  }

  .operation-buttons {
    gap: 5px;
  }

  .operation-buttons button,
  .decision-panel button {
    min-height: var(--field-action-height);
    padding-block: 6px;
  }

  .decision-panel {
    margin-top: 7px;
  }

  .control-timer {
    font-size: 50px;
    margin: 7px 0;
    padding: 9px;
  }

  .timer-state {
    margin: -2px 0 5px;
  }

  .timer-settings {
    margin-top: 6px;
    padding-top: 6px;
  }

  .competition-display-panel textarea {
    margin: 7px 0 6px;
    min-height: 34px;
    resize: none;
  }

  .result-save-block {
    margin-top: 8px;
    padding-top: 8px;
  }
}

@media (max-width: 1120px) {
  .competition-grid.field-execution-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-execution-grid .competition-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-match-navigator {
    height: calc(100vh - 24px);
    width: calc(100vw - 24px);
  }
}

@media (max-width: 720px) {
  .field-execution-grid .competition-right {
    display: flex;
  }

  .field-match-overlay {
    padding: 0;
  }

  .field-match-navigator {
    border-radius: 0;
    height: 100vh;
    padding: 10px;
    width: 100vw;
  }

  .field-match-navigator-head {
    align-items: stretch;
    flex-direction: column;
  }

  .field-match-navigator-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .field-match-navigator-operations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .field-match-navigator-actions button,
  .field-match-navigator-operations button {
    min-height: 40px;
  }

  .field-match-navigator-body {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 142px minmax(0, 1fr);
    padding-top: 8px;
  }

  .field-match-group-rail {
    border-bottom: 1px solid #e5eaf2;
    border-right: 0;
    padding: 0 0 8px;
  }

  .field-match-group-list {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .field-match-group-list .competition-group-list {
    display: flex;
    width: max-content;
  }

  .field-match-group-list .competition-group-row {
    flex: 0 0 270px;
  }

  .competition-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .live-match-heading-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .field-side-order-switch {
    grid-column: 1 / -1;
  }

  .next-match-primary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  .next-match-primary-actions button {
    min-height: 40px;
    width: 100%;
  }
}

/* Results archive: purpose-built tablet layout instead of collapsing every field. */
@media (min-width: 721px) and (max-width: 1120px) {
  .results-page {
    gap: 8px;
    padding: 8px;
  }

  .results-overview {
    padding: 10px;
  }

  .results-list-panel {
    padding: 10px;
  }

  .results-head {
    align-items: center;
    flex-direction: row;
  }

  .results-head .hint {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .results-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .results-summary-bar {
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 8px;
  }

  .results-summary-bar div {
    padding: 7px 8px;
  }

  .results-summary-bar strong {
    font-size: 16px;
    margin-top: 2px;
  }

  .results-toolbar {
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 8px;
    padding-top: 8px;
  }

  .result-search-field {
    grid-column: span 2;
  }

  .results-toolbar button {
    min-height: var(--control-height);
  }

  .results-toolbar > em {
    align-self: center;
    justify-self: end;
  }

  .result-list-head {
    display: none;
  }

  .result-row-main {
    gap: 5px 10px;
    grid-template-areas:
      "group event podium actions"
      "group mode saved actions";
    grid-template-columns: minmax(180px, 1.45fr) minmax(100px, 0.7fr) minmax(150px, 1fr) auto;
  }

  .result-group-cell { grid-area: group; }
  .result-event-cell { grid-area: event; }
  .result-mode-cell { grid-area: mode; }
  .result-podium-cell { grid-area: podium; }
  .result-saved-cell { grid-area: saved; }
  .result-row-actions { grid-area: actions; justify-content: flex-end; }

  .result-detail .podium {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Unified control header: iPad landscape keeps the desktop information model. */
@media (min-width: 721px) and (max-width: 1120px) and (min-height: 501px) and (orientation: landscape) {
  .control-header {
    align-items: center;
    gap: 8px;
    grid-template-columns: minmax(160px, 0.72fr) minmax(410px, 1.75fr) auto;
    padding: 8px 10px;
  }

  .header-tabs {
    gap: 5px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .header-tabs button {
    font-size: 12px;
    min-height: var(--control-height);
    padding-inline: 5px;
  }

  .header-actions {
    grid-column: auto;
    justify-content: flex-end;
  }

  .court-toggle-button {
    min-width: 76px;
    padding-inline: 8px;
  }

  .overview-strip {
    gap: 6px;
    grid-template-columns: repeat(4, minmax(60px, 0.38fr)) repeat(2, minmax(180px, 1fr));
    padding: 6px 8px;
  }

  .overview-court {
    grid-column: auto;
  }
}

/* Unified control header: iPad portrait uses three deliberate rows. */
@media (min-width: 721px) and (max-width: 1120px) and (min-height: 501px) and (orientation: portrait) {
  .control-header {
    align-items: center;
    gap: 7px 10px;
    grid-template-areas:
      "brand actions"
      "tabs tabs";
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px 7px;
  }

  .header-brand {
    grid-area: brand;
  }

  .header-tabs {
    display: grid;
    gap: 5px;
    grid-area: tabs;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .header-tabs button {
    font-size: 12px;
    min-height: 34px;
    padding: 5px 4px;
  }

  .header-actions {
    grid-area: actions;
    grid-column: auto;
    justify-content: flex-end;
  }

  .court-toggle-button {
    min-width: 78px;
    padding-inline: 8px;
  }

  .overview-strip {
    gap: 5px;
    grid-template-columns: repeat(4, minmax(50px, 0.4fr)) repeat(2, minmax(170px, 1fr));
    padding: 6px 8px;
  }

  .overview-metric,
  .overview-court {
    grid-column: auto;
    min-height: 43px;
    padding: 5px 7px;
  }

  .overview-metric strong,
  .overview-court strong {
    font-size: 14px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Unified control header: phones keep one permanent row and a downward menu. */
@media (max-width: 720px), (max-height: 500px) and (max-width: 980px) {
  .control-header {
    align-items: center !important;
    gap: 6px;
    grid-template-columns: minmax(78px, 1fr) auto;
    min-height: 48px;
    padding: 6px 8px;
  }

  .header-brand {
    min-width: 0;
  }

  .control-header h1 {
    font-size: var(--font-event-title);
    line-height: 1.15;
    margin: 0;
  }

  .control-header p {
    display: flex;
    font-size: var(--font-caption);
    gap: 3px;
    line-height: 1.1;
    margin-top: 3px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .connection-dot {
    flex: 0 0 auto;
    height: 6px;
    width: 6px;
  }

  .header-actions,
  .control-app.active-checkin .header-actions,
  .control-app.active-people .header-actions {
    display: flex !important;
    gap: 4px;
    grid-column: 2;
    justify-content: flex-end;
    overflow: visible;
    padding: 0;
  }

  .header-actions .header-icon-button,
  .mobile-menu-toggle {
    flex-basis: 34px;
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    width: 34px;
    min-width: 30px;
    padding: 0;
    width: 30px;
  }

  .header-icon-button svg {
    height: 15px;
    width: 15px;
  }

  .court-toggle-button {
    font-size: 11px;
    gap: 3px;
    min-height: 34px;
    min-width: 58px;
    padding: 4px 6px;
  }

  .court-toggle-button svg {
    height: 12px;
    width: 12px;
  }

  .header-actions .mobile-menu-toggle {
    display: inline-flex;
  }

  .header-tabs {
    background: #ffffff;
    border-bottom: 1px solid #d8dde6;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    left: 0;
    margin: 0;
    max-height: calc(100dvh - 48px);
    opacity: 0;
    overflow: auto;
    padding: 9px;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 100%;
    transform: translateY(-8px);
    transition: opacity 150ms ease, transform 150ms ease;
    visibility: hidden;
    z-index: 12;
  }

  .mobile-header-menu-open .header-tabs {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .header-tabs button {
    flex: initial;
    font-size: 12px;
    min-height: 38px;
    padding: 6px 4px;
    width: 100%;
  }

  .mobile-header-context {
    border-top: 1px solid #e5eaf2;
    display: grid;
    gap: 6px;
    grid-column: 1 / -1;
    padding-top: 8px;
  }

  .mobile-header-metrics,
  .mobile-header-courts {
    display: grid;
    gap: 5px;
  }

  .mobile-header-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .mobile-header-metrics > div,
  .mobile-header-courts > div {
    background: #f7f9fc;
    border: 1px solid #e5eaf2;
    border-radius: 7px;
    min-width: 0;
    padding: 6px 7px;
  }

  .mobile-header-courts > div.active {
    background: #ecfeff;
    border-color: #67c7cc;
  }

  .mobile-header-metrics span,
  .mobile-header-courts span {
    color: #64748b;
    display: block;
    font-size: 10px;
    font-weight: 900;
  }

  .mobile-header-metrics strong,
  .mobile-header-courts strong {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header-menu-scrim {
    background: rgba(15, 23, 42, 0.24);
    border: 0;
    border-radius: 0;
    bottom: 0;
    display: block;
    left: 0;
    padding: 0;
    position: fixed;
    right: 0;
    top: 48px;
    z-index: 7;
  }

  .overview-strip,
  .control-app.active-checkin .overview-strip,
  .control-app.active-field .overview-strip,
  .control-app.active-draws .overview-strip,
  .control-app.active-people .overview-strip {
    display: none !important;
  }

  .lan-popover {
    left: 8px;
    max-height: calc(100dvh - 64px);
    min-width: 0;
    position: fixed;
    right: 8px;
    top: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-tabs {
    transition: none;
  }
}

@media (max-width: 380px) {
  .control-header {
    gap: 4px;
    grid-template-columns: minmax(68px, 1fr) auto;
    padding-inline: 6px;
  }

  .header-actions,
  .control-app.active-checkin .header-actions,
  .control-app.active-people .header-actions {
    gap: 3px;
  }

  .header-actions .header-icon-button,
  .header-actions .mobile-menu-toggle {
    flex-basis: 34px;
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    width: 34px;
  }

  .court-toggle-button {
    gap: 2px;
    min-height: 34px;
    min-width: 52px;
    padding-inline: 4px;
  }
}

/* Shared workspace header: iPad portrait follows one canonical hierarchy. */
@media (min-width: 721px) and (max-width: 1120px) and (min-height: 501px) and (orientation: portrait) {
  .workspace-page-head-layout,
  .people-topbar-main.workspace-page-head-layout,
  .draw-page-head.workspace-page-head-layout,
  .schedule-page-head.workspace-page-head-layout,
  .checkin-head.workspace-page-head-layout {
    align-items: center;
    display: grid;
    gap: 8px 12px;
    grid-template-areas:
      "intro intro"
      "summary actions";
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .workspace-head-intro {
    grid-area: intro;
    min-width: 0;
  }

  .workspace-head-intro .hint {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .workspace-head-summary {
    --workspace-summary-item-width: 84px;
    display: grid;
    grid-template-columns: repeat(4, var(--workspace-summary-item-width));
    grid-area: summary;
    justify-self: start;
    max-width: 100%;
    width: max-content;
  }

  .workspace-head-actions {
    grid-area: actions;
    justify-self: end;
    min-width: 0;
  }

  .people-prep-summary.workspace-head-summary,
  .draw-summary-bar.workspace-head-summary,
  .checkin-summary.workspace-head-summary {
    height: var(--control-height);
    padding-block: 0;
  }

  .people-prep-summary.workspace-head-summary div,
  .draw-summary-bar.workspace-head-summary div,
  .checkin-summary.workspace-head-summary div {
    gap: 5px;
    min-width: 0;
    padding-inline: 7px;
    width: var(--workspace-summary-item-width);
  }

  .workspace-head-summary span,
  .workspace-head-summary strong {
    flex: 0 0 auto;
    line-height: 1;
    white-space: nowrap;
  }

  .workspace-head-summary span {
    font-size: 11px;
  }

  .workspace-head-summary strong {
    font-size: 15px;
  }

  .people-topbar-actions.workspace-head-actions,
  .checkin-display-links.workspace-head-actions,
  .draw-head-actions.workspace-head-actions .action-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
  }

  .people-topbar-actions.workspace-head-actions button,
  .draw-head-actions.workspace-head-actions button,
  .schedule-action-buttons.workspace-head-actions button,
  .checkin-display-links.workspace-head-actions .checkin-screen-button {
    font-size: 12px;
    min-height: var(--control-height);
    padding-inline: 6px;
    white-space: nowrap;
  }

  .schedule-page-head.workspace-page-head-no-summary .workspace-head-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }

  .schedule-page-head .schedule-action-buttons.workspace-head-actions {
    grid-template-columns: repeat(5, max-content);
    width: auto;
  }
}

/* Shared workspace header: phones preserve the same order with compact rows. */
@media (max-width: 720px), (max-height: 500px) and (max-width: 980px) {
  .workspace-page-head-layout,
  .people-topbar-main.workspace-page-head-layout,
  .draw-page-head.workspace-page-head-layout,
  .schedule-page-head.workspace-page-head-layout,
  .checkin-head.workspace-page-head-layout {
    align-items: stretch;
    display: grid;
    gap: 7px;
    grid-template-areas:
      "intro"
      "summary"
      "actions";
    grid-template-columns: minmax(0, 1fr);
  }

  .control-app.active-people .people-topbar-main > .workspace-head-intro,
  .control-app.active-draws .draw-page-head > .workspace-head-intro,
  .checkin-head.workspace-page-head-layout > .workspace-head-intro {
    display: block;
  }

  .workspace-head-intro {
    grid-area: intro;
    min-width: 0;
  }

  .workspace-head-intro h2 {
    font-size: 16px;
    margin: 0;
  }

  .workspace-head-intro .hint,
  .checkin-head .workspace-head-intro .hint {
    display: -webkit-box;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 3px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .workspace-head-summary,
  .people-prep-summary.workspace-head-summary,
  .draw-summary-bar.workspace-head-summary,
  .checkin-summary.workspace-head-summary {
    display: grid;
    gap: 0;
    grid-area: summary;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 36px;
    max-width: none;
    overflow: hidden;
    padding: 0;
    width: 100%;
  }

  .people-prep-summary.workspace-head-summary div,
  .draw-summary-bar.workspace-head-summary div,
  .checkin-summary.workspace-head-summary div {
    align-items: center;
    border: 0;
    border-right: 1px solid #e5eaf2;
    display: flex;
    gap: 4px;
    justify-content: center;
    min-width: 0;
    padding: 0 5px;
  }

  .people-prep-summary.workspace-head-summary div:last-child,
  .draw-summary-bar.workspace-head-summary div:last-child,
  .checkin-summary.workspace-head-summary div:last-child {
    border-right: 0;
  }

  .workspace-head-summary span,
  .workspace-head-summary strong,
  .people-prep-summary.workspace-head-summary span,
  .people-prep-summary.workspace-head-summary strong,
  .draw-summary-bar.workspace-head-summary span,
  .draw-summary-bar.workspace-head-summary strong,
  .checkin-summary.workspace-head-summary span,
  .checkin-summary.workspace-head-summary strong {
    display: inline;
    font-size: 11px;
    line-height: 1.1;
    margin: 0;
  }

  .workspace-head-summary strong,
  .people-prep-summary.workspace-head-summary strong,
  .draw-summary-bar.workspace-head-summary strong,
  .checkin-summary.workspace-head-summary strong {
    font-size: 14px;
  }

  .workspace-head-actions {
    grid-area: actions;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
  }

  .people-topbar-actions.workspace-head-actions,
  .schedule-action-buttons.workspace-head-actions,
  .checkin-display-links.workspace-head-actions,
  .draw-head-actions.workspace-head-actions .action-row {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    overflow: visible;
    padding: 0;
    width: 100%;
  }

  .draw-head-actions.workspace-head-actions {
    display: block;
  }

  .people-topbar-actions.workspace-head-actions button,
  .draw-head-actions.workspace-head-actions button,
  .schedule-action-buttons.workspace-head-actions button,
  .checkin-display-links.workspace-head-actions .checkin-screen-button {
    flex: initial;
    font-size: 11px;
    justify-content: center;
    min-height: var(--control-height);
    min-width: 0;
    overflow: hidden;
    padding: 5px 4px;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }

  .schedule-page-head.workspace-page-head-no-summary {
    grid-template-areas:
      "intro"
      "actions";
  }
}

/* Results archive: compact controls and balanced two-column cards on phones. */
@media (max-width: 720px) {
  .results-page {
    gap: 7px;
    padding: 6px;
  }

  .results-overview,
  .results-list-panel {
    padding: 9px;
  }

  .results-head {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .results-head h2 {
    margin: 0;
  }

  .results-head .hint {
    display: none;
  }

  .results-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .results-actions button {
    font-size: 12px;
    min-height: var(--control-height);
    padding: 5px 8px;
  }

  .results-summary-bar {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 7px;
  }

  .results-summary-bar div {
    min-width: 0;
    padding: 6px 7px;
  }

  .results-summary-bar span {
    font-size: 11px;
  }

  .results-summary-bar strong {
    font-size: 15px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .results-toolbar {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 7px;
    padding-top: 7px;
  }

  .results-toolbar label {
    gap: 0;
  }

  .results-toolbar label > span {
    display: none;
  }

  .result-search-field {
    grid-column: 1 / -1;
  }

  .results-toolbar input,
  .results-toolbar select,
  .results-toolbar button {
    font-size: 13px;
    min-height: 34px;
  }

  .results-toolbar > em {
    align-self: center;
    justify-self: end;
  }

  .result-row {
    padding: 8px;
  }

  .result-row-main {
    gap: 6px;
    grid-template-areas:
      "group actions"
      "event mode"
      "podium saved";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .result-group-cell { grid-area: group; }
  .result-event-cell { grid-area: event; }
  .result-mode-cell { grid-area: mode; }
  .result-podium-cell { grid-area: podium; }
  .result-saved-cell { grid-area: saved; }
  .result-row-actions {
    grid-area: actions;
    justify-content: flex-end;
  }

  .result-event-cell,
  .result-mode-cell,
  .result-podium-cell,
  .result-saved-cell {
    background: #f7f9fc;
    border-radius: 6px;
    min-height: 52px;
    padding: 6px 7px;
  }

  .result-cell-label {
    color: #94a3b8;
    display: block;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .result-detail .podium {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Design system control geometry: keep this terminal so legacy page rules cannot fragment sizing. */
.control-app button:not(.header-icon-button):not(.mobile-menu-toggle):not(.mobile-header-menu-scrim):not(.draw-mobile-backdrop):not(.people-group-nav-item):not(.draw-group-row),
.control-app .display-link-button:not(.header-icon-button),
.control-app .checkin-screen-button,
.events-app button,
.weigh-in-app button {
  min-height: var(--control-height);
}

.control-app input:not([type="checkbox"]):not([type="radio"]),
.control-app select,
.events-app input:not([type="checkbox"]):not([type="radio"]),
.events-app select,
.weigh-in-app input:not([type="checkbox"]):not([type="radio"]),
.weigh-in-app select {
  min-height: var(--control-height);
}

.field-execution-grid .operation-buttons button,
.field-execution-grid .timer-buttons button,
.field-execution-grid .match-decision-actions button,
.field-execution-grid .match-forfeit-actions button,
.field-execution-grid .primary-next-match-button {
  min-height: var(--field-action-height);
}

.schedule-page-head .schedule-action-buttons {
  gap: 6px;
}

.schedule-page-head .schedule-action-buttons button {
  min-width: 0;
}

@media (min-width: 721px) and (max-width: 1120px) and (min-height: 501px) {
  .results-page {
    gap: var(--device-gutter);
    padding: var(--device-gutter);
  }

  .results-overview,
  .results-list-panel {
    padding: var(--card-padding);
  }
}

/* Management typography and accessibility use the DESIGN.md tokens. */
.control-body .control-header h1,
.events-body .events-header h1,
.weigh-in-body .weighing-command-identity h1 {
  font-size: var(--font-event-title);
  font-weight: var(--weight-strong);
  line-height: 1.2;
}

.control-body .workspace-head-intro h2,
.control-body .module h2,
.events-body .module h2,
.weigh-in-body .module h2 {
  font-size: var(--font-page-title);
  font-weight: var(--weight-strong);
  line-height: 1.25;
}

.control-body .module h3,
.events-body .module h3,
.weigh-in-body .module h3 {
  font-size: var(--font-section-title);
  font-weight: var(--weight-strong);
  line-height: 1.3;
}

.control-body .group-detail-title {
  font-size: var(--font-section-title);
  font-weight: var(--weight-strong);
  line-height: 1.3;
  margin: 0;
}

.control-app :is(.draw-status, .checkin-status-chip, .schedule-court-badge, .checkin-display-state),
.events-app .event-phase {
  align-items: center;
  align-self: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--font-label);
  font-style: normal;
  font-weight: var(--weight-strong);
  line-height: 1;
  min-height: 0;
  padding: 4px 7px;
  white-space: nowrap;
}

.control-body .hint,
.control-body .empty,
.events-body .hint,
.events-body .empty,
.weigh-in-body .hint,
.weigh-in-body .empty {
  color: var(--color-secondary);
  font-size: var(--font-body-small);
  font-weight: var(--weight-regular);
  line-height: 1.4;
}

.control-body :is(button, a, input, select, textarea, [role="button"]):focus-visible,
.events-body :is(button, a, input, select, textarea, [role="button"]):focus-visible,
.weigh-in-body :is(button, a, input, select, textarea, [role="button"]):focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.schedule-preallocate-button:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-surface);
}

.schedule-preallocate-button:not(:disabled):hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.warning-button:not(:disabled) {
  background: var(--color-warning-soft);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

@media (max-width: 720px) and (min-height: 501px),
       (max-width: 980px) and (max-height: 500px) {
  .control-app button:not(.header-icon-button):not(.mobile-menu-toggle):not(.mobile-header-menu-scrim):not(.draw-mobile-backdrop):not(.people-group-nav-item):not(.draw-group-row),
  .control-app .display-link-button:not(.header-icon-button),
  .control-app .checkin-screen-button,
  .events-app button,
  .weigh-in-app button {
    font-size: var(--font-body-small);
    min-height: 40px;
  }

  .schedule-row {
    align-items: start;
    column-gap: var(--space-md);
    grid-template-areas:
      "code actions"
      "main actions"
      "status actions";
    grid-template-columns: minmax(0, 1fr) clamp(132px, 40%, 144px);
    padding: var(--card-padding);
    row-gap: var(--space-sm);
  }

  .schedule-code {
    grid-area: code;
    justify-self: start;
  }

  .schedule-main {
    display: grid;
    gap: var(--space-xs);
    grid-area: main;
    min-width: 0;
  }

  .schedule-row .group-detail-title {
    margin: 0;
  }

  .schedule-meta-primary,
  .schedule-meta-secondary {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .schedule-meta-primary {
    font-size: var(--font-body-small);
    font-weight: var(--weight-regular);
    line-height: 1.4;
  }

  .schedule-meta-secondary {
    font-size: var(--font-caption);
    font-weight: var(--weight-medium);
    line-height: 1.3;
  }

  .schedule-meta-secondary::before {
    content: none;
  }

  .schedule-status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    grid-area: status;
    justify-self: start;
  }

  .schedule-actions {
    align-self: center;
    display: grid;
    gap: var(--space-xs);
    grid-area: actions;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    justify-self: stretch;
    max-width: none;
    width: 100%;
  }

  .schedule-actions button {
    font-weight: var(--weight-medium);
    height: var(--control-height);
    min-width: 0;
    padding-inline: var(--space-xs);
    width: 100%;
  }

  .schedule-actions .court-action-a {
    grid-column: 1 / span 2;
  }

  .schedule-actions .court-action-b {
    grid-column: 3 / span 2;
  }

  .schedule-actions .schedule-cancel-button {
    grid-column: 5 / span 2;
  }

  .schedule-actions .schedule-move-up-button {
    grid-column: 1 / span 3;
  }

  .schedule-actions .schedule-move-down-button {
    grid-column: 4 / span 3;
  }

  .schedule-actions .schedule-transfer-button {
    grid-column: 1 / -1;
  }

  .control-app.active-schedule .schedule-grid,
  .control-app.active-schedule .schedule-panel {
    min-height: 0;
    overflow: hidden;
  }

  .control-app.active-schedule .schedule-list {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Icon geometry and compact header hierarchy. Big-screen display controls are a separate domain. */
.control-app .header-icon-button,
.control-app .header-actions .header-icon-button,
.control-app .mobile-menu-toggle,
.control-app .access-logout-button,
.weigh-in-app .weighing-command-logout {
  flex-basis: 34px;
  height: 34px;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
  width: 34px;
}

.control-app :is(.header-icon-button, .access-logout-button) svg,
.control-app .court-toggle-button svg,
.weigh-in-app .weighing-command-logout svg,
.court-progress-navigator > button svg {
  height: 17px;
  width: 17px;
}

.control-app .court-toggle-button {
  min-height: 34px;
}

@media (max-width: 720px) and (min-height: 501px),
       (max-width: 980px) and (max-height: 500px) {
  .control-header p {
    font-size: var(--font-caption);
    line-height: 1.3;
  }

  .workspace-head-intro h2 {
    display: block;
    font-size: var(--font-page-title);
  }

  .workspace-head-intro .hint {
    display: -webkit-box;
    font-size: var(--font-caption);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .workspace-head-summary span {
    font-size: var(--font-caption);
  }

  .workspace-head-summary strong {
    font-size: var(--font-section-title);
  }
}

/* Master-detail workspaces: roster and draw share one width model. */
.people-group-nav-list {
  align-content: start;
  grid-auto-rows: max-content;
}

.draw-group-list {
  grid-auto-rows: max-content;
}

@media (min-width: 721px) and (max-width: 1120px) and (min-height: 501px) {
  .control-app.active-draws {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .control-app.active-draws .draw-page-grid {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .control-app.active-draws .draw-group-panel,
  .control-app.active-draws .draw-detail {
    max-height: 100%;
    min-height: 0;
  }
}

@media (min-width: 721px) {
  .control-app.active-draws .draw-page-grid {
    grid-template-columns: var(--workspace-list-width) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .control-app.active-draws .draw-page-head {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .control-app.active-draws .draw-group-panel.mobile-collapsed,
  .control-app.active-draws .draw-group-panel.mobile-open {
    display: flex;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    position: static;
    width: auto;
  }

  .control-app.active-draws .draw-group-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }

  .control-app.active-draws .draw-detail {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .control-app.active-draws .draw-mobile-switcher,
  .control-app.active-draws .draw-mobile-backdrop {
    display: none;
  }
}

@media (max-width: 720px) {
  .control-app.active-people .people-group-nav-item,
  .control-app.active-draws .draw-group-row {
    min-height: 54px;
    padding: 7px 8px;
  }
}

/* Field status: context on the left, state and navigation grouped on the right. */
.field-toolbar {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 50px;
  padding: 7px 12px;
}

.field-status-main {
  flex-wrap: nowrap;
  width: auto;
}

.field-status-side,
.field-status-indicators,
.field-status-actions {
  align-items: center;
  display: flex;
}

.field-status-side {
  gap: 12px;
  width: auto;
}

.field-status-indicators,
.field-status-actions {
  gap: 6px;
}

.field-toolbar .draw-status,
.field-toolbar .timer-chip {
  align-items: center;
  display: inline-flex;
  min-height: 30px;
}

.field-toolbar .field-progress-link {
  flex-basis: auto;
  gap: 6px;
  min-width: max-content;
  padding: 0 9px;
  width: auto;
}

.field-toolbar .field-progress-link span {
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
  white-space: nowrap;
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 500px) {
  .field-toolbar {
    align-items: stretch;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr);
    padding: 7px 10px;
  }

  .field-status-main {
    display: grid;
    gap: 3px 7px;
    grid-template-areas:
      "court group"
      "match match";
    grid-template-columns: auto minmax(0, 1fr);
  }

  .field-status-main strong { grid-area: court; }
  .field-status-main span { grid-area: group; }
  .field-status-main em { grid-area: match; }

  .field-status-side {
    justify-content: space-between;
    width: 100%;
  }
}

/* Check-in roster rows use a fixed three-line contract; group weight is a group-level rule. */
.checkin-detail-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
  grid-area: title;
  min-height: var(--control-height);
  min-width: 0;
}

.checkin-detail-title-row h3 {
  align-items: center;
  display: flex;
  height: var(--control-height);
  line-height: 1;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  padding-top: 1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-group-weight-rule {
  align-items: center;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 26px;
  padding: 3px 7px;
  white-space: nowrap;
}

.checkin-group-weight-rule small {
  color: var(--color-secondary);
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.checkin-group-weight-rule strong {
  color: var(--color-primary);
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.checkin-player-row {
  height: 78px;
  min-height: 78px;
  overflow: hidden;
}

.checkin-player-main {
  align-content: center;
  display: grid;
  gap: 3px;
  grid-template-rows: repeat(3, max-content);
  min-height: 0;
  overflow: hidden;
}

.checkin-player-main strong,
.checkin-player-main > span,
.checkin-weight-control > span {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-weight-control,
.checkin-weight-control.readonly {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
}

.checkin-weight-control > span {
  flex: 0 1 auto;
}

.checkin-weight-control .weight-tag {
  flex: 0 0 auto;
  margin-left: 0;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkin-player-side {
  display: grid;
  gap: 6px;
  grid-template-columns: max-content 58px;
}

.checkin-player-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  min-width: 58px;
}

.checkin-player-action-placeholder {
  display: block;
  height: 1px;
  width: 58px;
}

/* Field toolbar separates non-interactive state from navigation actions. */
.field-toolbar .draw-status,
.field-toolbar .timer-chip,
.field-toolbar .field-status-navigation,
.field-toolbar .field-progress-link,
.field-toolbar .access-logout-button {
  border-radius: var(--radius-medium);
  height: var(--control-height);
  min-height: var(--control-height);
}

.field-toolbar .draw-status {
  gap: 5px;
  padding: 0 9px;
}

.field-toolbar .draw-status::before {
  background: currentColor;
  border-radius: 50%;
  content: '';
  height: 6px;
  opacity: .8;
  width: 6px;
}

.field-toolbar .timer-chip {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  padding: 0 9px;
}

.field-toolbar .timer-chip small {
  color: #cbd5e1;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
}

.field-toolbar .timer-chip strong {
  color: var(--digit-yellow);
  font-size: var(--font-section-title);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-strong);
}

.field-toolbar .field-status-navigation,
.field-toolbar .field-progress-link {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-primary);
}

.field-toolbar .field-status-navigation:hover,
.field-toolbar .field-progress-link:hover {
  background: var(--color-surface-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

@media (max-width: 720px), (max-width: 980px) and (max-height: 500px) {
  .checkin-player-row {
    height: 82px;
    min-height: 82px;
  }

  .checkin-player-side {
    gap: 4px;
    grid-template-columns: max-content 54px;
  }

  .checkin-player-actions,
  .checkin-player-action-placeholder {
    min-width: 54px;
    width: 54px;
  }

  .checkin-weight-control .weight-tag {
    max-width: 104px;
  }

  .field-status-side {
    gap: 7px;
  }

  .field-status-indicators,
  .field-status-actions {
    gap: 5px;
  }
}
/* Account login uses a full-panel bitmap artwork layer; the production
   illustration is supplied through --account-login-artwork. */
.account-login-body {
  align-items: center;
  background: var(--color-canvas);
  color: var(--color-primary);
  display: flex;
  min-height: 100dvh;
  padding: 24px;
}

.account-login-shell {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-large);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  margin: auto;
  max-width: 960px;
  min-height: 560px;
  overflow: hidden;
  width: 100%;
}

.account-login-visual {
  --account-login-artwork: none;
  background-color: var(--color-primary);
  background-image:
    linear-gradient(90deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.58)),
    var(--account-login-artwork);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--color-surface);
  min-width: 0;
  padding: 48px;
}

.account-login-visual-copy {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  max-width: 430px;
}

.account-login-kicker,
.account-login-product {
  color: var(--color-tertiary);
  display: block;
  font-size: var(--font-caption);
  font-weight: var(--weight-strong);
  letter-spacing: 0.12em;
  line-height: 1.3;
}

.account-login-visual .account-login-kicker {
  color: #67e8f9;
}

.account-login-visual h1 {
  align-self: center;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: var(--weight-strong);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 18px 0;
  text-wrap: balance;
  writing-mode: vertical-rl;
}

.account-login-visual h1 span {
  display: block;
  white-space: nowrap;
}

.account-login-visual p {
  align-self: end;
  color: #cbd5e1;
  font-size: var(--font-body);
  line-height: 1.65;
  margin: 0;
  max-width: 390px;
  text-wrap: pretty;
}

.account-login-panel {
  align-self: center;
  padding: 48px;
}

.account-login-heading h2 {
  font-size: 24px;
  font-weight: var(--weight-strong);
  line-height: 1.25;
  margin: 14px 0 8px;
}

.account-login-heading p,
.account-login-footnote {
  color: var(--color-secondary);
  font-size: var(--font-body-small);
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}

.account-login-footnote a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}

.account-login-form {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.account-login-form > label {
  display: grid;
  gap: var(--space-sm);
}

.account-login-form > label > span:first-child {
  font-size: var(--font-label);
  font-weight: var(--weight-strong);
}

.account-login-form input {
  font-size: var(--font-body);
  height: 44px;
  min-width: 0;
  padding: 0 12px;
  width: 100%;
}

.account-login-form input:focus {
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px rgba(15, 113, 128, 0.14);
  outline: 0;
}

.account-password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.account-password-field input {
  border-radius: var(--radius-medium) 0 0 var(--radius-medium);
}

.account-password-field button {
  border-left: 0;
  border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
  min-height: 44px;
  padding-inline: 12px;
}

.account-login-submit {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-surface);
  font-size: var(--font-body-small);
  min-height: 44px;
  width: 100%;
}

.account-login-submit:not(:disabled):hover {
  background: #1f2937;
}

.account-login-message {
  background: var(--color-error-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-medium);
  color: var(--color-error);
  font-size: var(--font-body-small);
  line-height: 1.4;
  margin: -4px 0;
  padding: 9px 10px;
}

.account-login-message.success {
  background: #e8f7ee;
  border-color: #b7e4c7;
  color: #18783c;
}

.account-login-footnote {
  border-top: 1px solid var(--color-border);
  margin-top: 32px;
  padding-top: 16px;
}

@media (max-width: 720px) {
  .account-login-body {
    align-items: stretch;
    padding: var(--device-gutter);
  }

  .account-login-shell {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 2 * var(--device-gutter));
  }

  .account-login-visual {
    min-height: 184px;
    padding: 24px 20px;
  }

  .account-login-visual h1 {
    font-size: 30px;
    margin: 12px 0 10px;
    writing-mode: horizontal-tb;
  }

  .account-login-visual p {
    font-size: var(--font-body-small);
    line-height: 1.45;
  }

  .account-login-panel {
    margin: auto 0;
    padding: 28px 20px;
  }

  .account-login-form {
    margin-top: 24px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .account-login-shell {
    animation: account-login-enter 180ms ease-out both;
  }
}

@keyframes account-login-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .account-organization-create,
  .account-mfa-setup {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-organization-create > div,
  .account-mfa-setup p {
    grid-column: 1 / -1;
  }

  .account-capacity-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .account-workspace-sections {
    gap: 12px;
    overflow-x: auto;
  }

  .account-organization-create,
  .account-mfa-setup {
    grid-template-columns: 1fr;
    padding-inline: 14px;
  }

  .account-organization-create > div,
  .account-mfa-setup p {
    grid-column: 1;
  }

  .account-organization-settings-list {
    padding-inline: 14px;
  }

  .account-plan-editor,
  .account-deletion-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .account-plan-editor label {
    min-width: 0;
  }

  .account-danger-zone[open] {
    grid-template-columns: 1fr;
  }

  .account-danger-zone[open] summary,
  .account-danger-zone[open] p {
    grid-column: 1;
  }
}
