:root {
  --blue: #d8333f;
  --purple: #c92f3b;
  --danger: #cf2734;
  --orange: #d8333f;
}

.brand {
  background: #fff;
  color: #202734;
  border-bottom: 1px solid var(--line);
}

.brand-mark,
.login-logo span {
  background: #d8333f;
  color: #fff;
}

.topbar {
  background: #fff;
  color: #303846;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(35, 43, 55, .06);
}

.breadcrumb,
.breadcrumb strong,
.user-menu,
.topbar .link-button {
  color: #303846;
}

.topbar .link-button {
  background: #fff1f2;
  border: 1px solid #f3c9cd;
}

.drawer .link-button {
  color: #d8333f;
  background: #fff;
  border: 0;
}

.nav-item.active {
  background: #fff0f1;
  color: #d8333f;
}

.primary-button:hover {
  background: #bd2732;
}

.primary-button:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.back-button,
.table-action {
  color: #c92f3b;
}

.filter-bar {
  grid-template-columns: minmax(170px, 1.15fr) minmax(245px, 1.4fr) minmax(120px, .7fr) repeat(2, minmax(150px, .85fr)) auto;
  background: #fff7f7;
  border-color: #f3dfe1;
}

.event-type-filter {
  position: relative;
  min-width: 0;
}

.cascader {
  position: relative;
}

.cascader-trigger {
  width: 100%;
  height: 38px;
  border: 1px solid #d3dae4;
  border-radius: 5px;
  background: #fff;
  color: #263445;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.cascader-trigger:focus {
  border-color: #d8333f;
  box-shadow: 0 0 0 3px rgba(216, 51, 63, .1);
}

.cascader-menu {
  position: absolute;
  top: 44px;
  left: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(3, 180px);
  min-height: 220px;
  background: #fff;
  border: 1px solid #e1e5eb;
  border-radius: 7px;
  box-shadow: 0 14px 34px rgba(39, 45, 56, .18);
  overflow: hidden;
}

.cascader-column {
  padding: 7px;
  border-right: 1px solid #edf0f4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cascader-column:last-child {
  border-right: 0;
}

.cascader-column button {
  border: 0;
  background: transparent;
  color: #303846;
  padding: 10px 9px;
  border-radius: 4px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  cursor: pointer;
}

.cascader-column button:hover,
.cascader-column button.active {
  background: #fff0f1;
  color: #d8333f;
}

.cascader-placeholder {
  padding: 11px 9px;
  color: #a1aab6;
}

.datetime-display {
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d8333f' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='17' rx='2'/%3E%3Cpath d='M8 2v4M16 2v4M3 9h18'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 36px;
}

.event-workspace-heading h1 {
  margin: 0;
  font-size: 22px;
}

.event-workspace-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.event-side-nav {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  position: sticky;
  top: 158px;
}

.event-side-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #495768;
  border-radius: 5px;
  padding: 12px 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  cursor: pointer;
}

.event-side-item small {
  margin-left: auto;
  color: #a1aab6;
  font-size: 11px;
}

.event-side-item.active {
  background: #fff0f1;
  color: #d8333f;
  font-weight: 650;
}

.event-side-item.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.event-workspace-content {
  min-width: 0;
  background: #fff8f8;
  border: 1px solid #f1e4e5;
  border-radius: 7px;
  padding: 14px;
}

.division-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #eadfe0;
  overflow: auto;
}

.division-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: #fff;
  color: #505d6c;
  padding: 12px 22px;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.division-tab.active {
  color: #d8333f;
  border-bottom-color: #d8333f;
  font-weight: 650;
  background: #fff7f7;
}

.team-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 4px;
}

.team-management-list {
  display: grid;
  gap: 14px;
}

.team-empty {
  background: #fff;
  border: 1px dashed #e2cfd1;
  border-radius: 7px;
}

.team-card {
  background: #fff;
  border: 1px solid #eccfd2;
  border-radius: 7px;
  overflow: hidden;
}

.team-card-head {
  padding: 14px 16px;
  background: #f7dfe1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.team-card-head strong {
  font-size: 16px;
  margin-right: 24px;
}

.team-card-head span {
  color: #556171;
}

.team-card-head p {
  margin: 7px 0 0;
  color: #687484;
}

.icon-edit-button {
  width: 32px;
  height: 32px;
  border: 1px solid #e3b6ba;
  border-radius: 5px;
  background: #fff;
  color: #bd2732;
  font-size: 18px;
  cursor: pointer;
}

.team-card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.team-member-table {
  padding: 0 6px;
}

.team-member-table .event-table {
  min-width: 1040px;
}

.team-member-table .event-table td {
  padding: 13px 10px;
}

.team-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  background: #fff7f7;
}

.team-card-foot .pagination {
  min-height: 36px;
}

.team-card-foot .pagination > span {
  font-size: 12px;
}

.table-empty-cell {
  text-align: center;
  color: #9aa4b1;
  height: 78px;
}

.drawer-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drawer-double label {
  min-width: 0;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 26, 36, .4);
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

.confirm-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.confirm-card p {
  margin: 0;
  color: #647184;
  line-height: 1.7;
  white-space: pre-line;
}

.datetime-picker {
  display: grid;
  gap: 20px;
}

.datetime-picker > label,
.time-select-row label {
  display: grid;
  gap: 7px;
  color: #455366;
  font-weight: 600;
}

.time-select-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
}

.time-select-row b {
  padding-bottom: 9px;
  font-size: 20px;
}

.datetime-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.datetime-shortcuts button {
  border: 1px solid #efc7ca;
  background: #fff5f5;
  color: #c52c38;
  border-radius: 5px;
  padding: 8px 10px;
  cursor: pointer;
}

.step.active {
  border-color: #d8333f;
  background: linear-gradient(90deg, #df414c, #bd2732);
}

.division-card-number {
  background: #d8333f;
}

#registration-fields .registration-option {
  grid-column: 1 / -1;
  min-height: 54px;
  padding: 2px 0 14px;
  border-bottom: 1px solid #e6e9ef;
}

#registration-fields .registration-option + .registration-option {
  padding-top: 0;
}

.division-description-field {
  grid-column: 1 / -1;
}

.division-description-field textarea {
  min-height: 92px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.division-description-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.division-description-actions button {
  min-height: 38px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #245aba;
  font: inherit;
  cursor: pointer;
}

.division-description-actions button:focus-visible {
  outline: 2px solid #245aba;
  outline-offset: 2px;
}

.division-description-actions small {
  margin-left: auto;
  color: #626a79;
  font-weight: 400;
}

/* Keep division eligibility fields within the available editor width. */
.division-list, .division-card, .division-card .form-grid > label,
.division-card .age-fields, .division-card .age-fields > label {
  min-width: 0;
}
.division-card .age-fields {
  flex-wrap: wrap;
}
.division-card .age-fields > label {
  flex: 1 1 144px;
}
.division-card .age-fields input, .division-card .age-fields select {
  width: 100%;
}
@media (max-width: 900px) {
  .division-card { padding: 52px 14px 20px; }
  .division-card .form-grid { grid-template-columns: minmax(0, 1fr); padding-right: 0; }
  #event-workspace-page:has(#create-page:not(.hidden)) .event-workspace-shell { grid-template-columns: minmax(0, 1fr); }
  #event-workspace-page:has(#create-page:not(.hidden)) .event-side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #event-workspace-page:has(#create-page:not(.hidden)) .event-workspace-content { min-width: 0; }
}

.tag {
  background: #fff0f1;
  color: #c92f3b;
}

.draft-id {
  background: #fff0f1;
  color: #b42430;
}

.event-level {
  display: inline-block;
  margin-top: 5px;
  color: #8a6570;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.event-center-table {
  min-width: 1240px;
}

.sidebar-toggle {
  width: 26px;
  height: 26px;
  margin-left: auto;
  border: 1px solid #e5c4c8;
  border-radius: 5px;
  background: #fff7f7;
  color: #c72c38;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
}

.platform-sidebar-collapsed .sidebar {
  width: 72px;
  padding-left: 10px;
  padding-right: 10px;
}

.platform-sidebar-collapsed .main {
  margin-left: 72px;
  width: calc(100% - 72px);
}

.platform-sidebar-collapsed .brand {
  margin-left: -10px;
  margin-right: -10px;
  padding: 0 10px;
  justify-content: center;
}

.platform-sidebar-collapsed .brand-name,
.platform-sidebar-collapsed .nav-label,
.platform-sidebar-collapsed .nav-text,
.platform-sidebar-collapsed .nav-item small,
.platform-sidebar-collapsed .sidebar-bottom {
  display: none;
}

.platform-sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
}

.platform-sidebar-collapsed .nav-icon {
  font-size: 18px;
}

.platform-sidebar-collapsed .sidebar-toggle {
  position: absolute;
  right: -13px;
  top: 22px;
  z-index: 17;
  background: #fff;
}

.workspace-panel-heading {
  margin: 2px 4px 16px;
}

.workspace-panel-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.workspace-panel-heading p {
  margin: 0;
  color: var(--muted);
}

#event-info-host > #create-page {
  padding: 0;
}

#event-info-host .sticky-page-heading {
  top: 64px;
  margin-top: 0;
}

#event-info-host .create-heading {
  background: #fff8f8;
}

.competition-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.competition-empty {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  border: 1px dashed #e2b9bd;
  border-radius: 10px;
  background: #fffafa;
  color: #7c5d62;
}

.competition-empty strong {
  color: #302326;
  font-size: 18px;
}

.competition-empty p {
  margin: 8px 0 18px;
}

/* 赛程编排：赛事内比赛场地是排程资源，不等同于建赛时选择的举办地点。 */
.schedule-venue-summary {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(220px, 1fr) auto minmax(180px, 1fr) minmax(220px, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding: 16px 18px;
  margin: 0 4px 16px;
  border: 1px solid #ecd9db;
  border-radius: 10px;
  background: #fff;
  color: #7d696d;
  font-size: 13px;
}
.schedule-venue-summary strong { color: #382b2d; font-size: 14px; }
.schedule-venue-summary small { color: #9b868a; }
.schedule-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 4px 16px; }
.schedule-step { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e5e8ed; border-radius: 10px; background: #fff; color: #9aa2ad; }
.schedule-step b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #eef0f3; color: #89919b; }
.schedule-step span { display: grid; gap: 3px; }
.schedule-step small { font-size: 12px; }
.schedule-step.active { border-color: #edc6ca; background: #fff7f7; color: #6d474c; }
.schedule-step.active b { background: #d8333f; color: #fff; }
.schedule-step.ready { border-color: #cce4d8; background: #f7fcf9; color: #3e7259; }
.schedule-step.ready b { background: #2a9a67; color: #fff; }
.schedule-court-table { margin: 0 4px; }
.schedule-court-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.schedule-court-status.enabled { color: #18744e; background: #e4f5ec; }
.schedule-court-status.disabled { color: #707985; background: #edf0f3; }
.schedule-court-empty { min-height: 220px; margin: 0 4px; }
.schedule-next-step { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; margin: 16px 4px 0; border: 1px dashed #e0c9cc; border-radius: 10px; background: #fffafa; color: #7a6064; }
.schedule-next-step strong { color: #382b2d; }
.schedule-next-step p { margin: 5px 0 0; font-size: 13px; }
.schedule-next-step.ready { border-color: #c7dfd3; background: #f8fcf9; color: #527564; }
.schedule-next-step button { display: grid; gap: 2px; text-align: center; white-space: nowrap; }
.schedule-next-step button small { font-size: 10px; font-weight: 400; }

.section-publication-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 4px 18px;
  padding: 18px 20px;
  border: 1px solid #e6d7d9;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff, #fff8f8);
}
.section-publication-copy { display: grid; gap: 5px; min-width: 0; }
.section-publication-title { display: flex; align-items: center; gap: 9px; color: #382b2d; font-size: 16px; }
.section-publication-copy p { margin: 0; color: #7e6e71; font-size: 13px; }
.section-publication-note { color: #9a8589; font-size: 12px; }
.section-publication-note.warning { color: #b05f24; }
.section-publication-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.publication-state { padding: 5px 9px; border-radius: 999px; color: #7a6e71; background: #f0edef; font-size: 12px; font-weight: 650; }
.publication-state.ready { color: #287052; background: #e7f5ed; }
.publication-toggle { display: inline-flex; align-items: center; gap: 8px; color: #4f4547; font-weight: 600; cursor: pointer; white-space: nowrap; }
.publication-toggle input { width: 44px; height: 24px; margin: 0; accent-color: #d8333f; cursor: pointer; }
.publication-toggle input:disabled { cursor: not-allowed; }

.rule-overview,
.competition-step {
  border: 1px solid #ecd9db;
  border-radius: 10px;
  background: #fff;
  padding: 20px;
}

.rule-state-row,
.competition-workflow-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #7e6a6d;
  margin-bottom: 16px;
}

.rule-state {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff0f1;
  color: #bd2732;
  font-size: 12px;
  font-weight: 700;
}

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

.rule-summary-grid > div {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid #f0dfe1;
  border-radius: 8px;
  background: #fffafa;
}

.rule-summary-grid span,
.rule-summary-grid small {
  color: #8b777b;
}

.rule-summary-grid strong {
  color: #2e2527;
  font-size: 16px;
}

.rule-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid #d8333f;
  background: #fff6f6;
}

.rule-note p {
  margin: 4px 0 0;
  color: #80696d;
}

.rule-count-preview {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 7px;
  background: #fff5f5;
  color: #725d61;
}

.rule-count-preview strong {
  color: #bf2935;
}

.rule-count-preview em {
  color: #d13c47;
  font-style: normal;
}

.grouping-mode-field {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #eadadd;
  border-radius: 7px;
}

.grouping-mode-field legend {
  padding: 0 5px;
  color: #455366;
  font-weight: 600;
}

.grouping-mode-field legend em {
  color: #d13c47;
  font-style: normal;
}

.grouping-mode-field label {
  flex-direction: row !important;
  align-items: center;
  gap: 7px !important;
  cursor: pointer;
}

.grouping-mode-field input {
  width: auto;
  accent-color: #d8333f;
}

#regular-group-config > label {
  display: grid;
  gap: 7px;
}

.special-group-config {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid #eadadd;
  border-radius: 7px;
  background: #fffafa;
}

.special-group-config > p {
  margin: 0;
  color: #8b777b;
  font-size: 12px;
}

.special-group-plan-list {
  display: grid;
  gap: 9px;
}

.special-group-plan-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.special-group-plan-row label {
  display: grid;
  gap: 5px;
}

.special-group-plan-row label span {
  color: #725d61;
  font-size: 12px;
}

.special-group-plan-row > span {
  padding-top: 22px;
  color: #8b777b;
}

.remove-special-plan {
  align-self: end;
  height: 38px;
  border: 0;
  background: transparent;
  color: #d13c47;
  cursor: pointer;
}

.add-special-group-plan {
  justify-self: start;
}

.apply-rule-options {
  display: grid;
  gap: 10px;
}

.apply-rule-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px !important;
  padding: 13px;
  border: 1px solid #eadadd;
  border-radius: 7px;
  cursor: pointer;
}

.apply-rule-option input {
  margin-top: 3px;
}

.apply-rule-option span {
  display: grid;
  gap: 3px;
}

.apply-rule-option small {
  color: #947e82;
  font-weight: 400;
}

.competition-workflow-status {
  min-height: 52px;
  padding: 0 4px;
}

.competition-workflow-status strong {
  color: #312628;
  margin-left: auto;
}

.competition-step {
  margin-bottom: 18px;
}

.competition-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.competition-step-head > b {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d8333f;
  color: #fff;
}

.competition-step-head > div:not(.actions) {
  flex: 1;
}

.competition-step-head strong {
  font-size: 16px;
}

.competition-step-head p {
  margin: 3px 0 0;
  color: #8a777b;
}

.competition-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.competition-group,
.unassigned-group {
  min-height: 150px;
  padding: 13px;
  border: 1px solid #eadadd;
  border-radius: 8px;
  background: #fffafa;
  transition: border-color .15s, background .15s;
}

.unassigned-group {
  min-height: auto;
  background: #fff;
}

.competition-dropzone.drag-over {
  border-color: #d8333f;
  background: #fff0f1;
}

.competition-group h4,
.unassigned-group h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  color: #4a383b;
}

.competition-group h4 span,
.unassigned-group h4 span {
  color: #b25b63;
  font-weight: 500;
}

.competition-team-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.competition-team-pool.static .competition-team-chip {
  cursor: default;
}

.competition-team-chip,
.pairing-source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(90deg, #e35a64, #bd2732);
  color: #fff;
  box-shadow: 0 5px 14px rgba(190, 39, 50, .16);
  cursor: grab;
  user-select: none;
}

.competition-placeholder {
  color: #a99397;
  padding: 9px;
}

.first-round-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.first-round-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid #eadadd;
  border-radius: 8px;
  background: #fffafa;
}

.first-round-match > span {
  grid-column: 1 / -1;
  color: #967f83;
  font-size: 12px;
}

.pairing-source-chip {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 7px;
  text-align: center;
  font-size: 12px;
}

.pairing-source-chip.drag-over {
  outline: 3px solid rgba(216, 51, 63, .2);
}

.pairing-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 12px;
}

.pairing-round {
  min-width: 220px;
  flex: 1 0 220px;
}

.pairing-round h4 {
  margin: 0 0 9px;
  color: #5b464a;
}

.pairing-card {
  display: grid;
  gap: 5px;
  padding: 11px;
  margin-bottom: 9px;
  border: 1px solid #eadadd;
  border-radius: 7px;
  background: #fff;
}

.pairing-card > span,
.pairing-card > small {
  color: #9a8387;
  font-size: 11px;
}

.pairing-card > b {
  color: #c94a54;
  font-size: 11px;
}

@media (max-width: 1280px) {
  .filter-bar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .cascader-menu {
    grid-template-columns: repeat(3, 155px);
  }

  .event-workspace-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .rule-summary-grid,
  .competition-groups,
  .first-round-editor {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 900px) {
  .platform-sidebar-collapsed .sidebar {
    width: 58px;
  }

  .platform-sidebar-collapsed .main {
    margin-left: 58px;
    width: calc(100% - 58px);
  }

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

  .event-side-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .cascader-menu {
    grid-template-columns: repeat(3, 145px);
    max-width: calc(100vw - 220px);
    overflow: auto;
  }

  .team-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .confirm-card {
    width: 100%;
  }

  .competition-heading,
  .competition-step-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rule-summary-grid,
  .competition-groups,
  .first-round-editor {
    grid-template-columns: 1fr;
  }

  .schedule-venue-summary,
  .schedule-steps {
    grid-template-columns: 1fr;
  }

  .schedule-next-step {
    align-items: flex-start;
    flex-direction: column;
  }
}

.reward-setting-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reward-setting-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #d63b47;
}

.reward-setting-line input[type="number"] {
  width: 140px;
}

.reward-setting-line small {
  color: #8c777b;
  font-weight: 400;
}


.reservation-statistics {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.reservation-statistics article {
  display: grid;
  gap: 9px;
  padding: 18px;
  border: 1px solid #eadadd;
  border-radius: 9px;
  background: linear-gradient(150deg, #fff, #fff8f8);
}

.reservation-statistics span {
  color: #8f7b7e;
  font-size: 12px;
}

.reservation-statistics strong {
  color: #a92230;
  font-size: 25px;
}

.reservation-section {
  margin-top: 22px;
}

.reservation-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.reservation-section-heading h3,
.reservation-section-heading p {
  margin: 0;
}

.reservation-section-heading p {
  margin-top: 4px;
  color: #8f7b7e;
  font-size: 12px;
}

.reservation-section-heading input {
  width: 240px;
}

.reservation-admin-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eadadd;
}

.reservation-admin-tabs button {
  padding: 9px 18px;
  border: 1px solid #e4d2d5;
  border-radius: 999px;
  background: #fff;
  color: #725b5f;
  cursor: pointer;
}

.reservation-admin-tabs button.active {
  border-color: #b72d3c;
  background: #b72d3c;
  color: #fff;
}

.reservation-settings-card {
  padding: 20px;
  border: 1px solid #eadadd;
  border-radius: 12px;
  background: linear-gradient(150deg, #fff, #fff9f9);
}

.reservation-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px 20px;
  margin-top: 18px;
}

.reservation-settings-grid label {
  display: grid;
  gap: 7px;
}

.reservation-settings-grid small {
  color: #8f7b7e;
}

.reservation-settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.reservation-target-tree {
  display: grid;
  gap: 12px;
}

.reservation-target-card {
  padding: 16px;
  border: 1px solid #eadadd;
  border-radius: 10px;
  background: #fff;
}

.reservation-target-card.child {
  margin: 10px 0 0 24px;
  border-left: 3px solid #d64b58;
  background: #fffafa;
}

.reservation-target-head,
.reservation-target-actions,
.reservation-admin-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reservation-target-head {
  justify-content: space-between;
}

.reservation-target-title {
  display: grid;
  gap: 5px;
}

.reservation-target-title span,
.reservation-target-window {
  color: #8f7b7e;
  font-size: 12px;
}

.reservation-target-note {
  margin: 0;
  color: #5f5052;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reservation-target-window {
  margin-top: 10px;
}

.reservation-target-actions button {
  border: 0;
  background: transparent;
  color: #9d2734;
  cursor: pointer;
}

.reservation-target-actions button.danger-action {
  color: #bc3030;
}

.reservation-admin-filters select {
  min-width: 180px;
}
.compact-switch { min-width: 280px; margin: 0; }
.guest-whitelist-target-picker { margin-top: 18px; max-width: 520px; }
.guest-whitelist-target-picker label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; }
.guest-whitelist-target-picker select { width: 100%; }
.guest-whitelist-target-label { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); color: var(--ink); font-weight: 600; }
.guest-whitelist-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 10px; flex-wrap: wrap; }
.guest-whitelist-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.guest-person-line { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.guest-person-line span { color: var(--muted); font-size: 12px; }
.guest-participant-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.guest-participant-row { display: grid; grid-template-columns: 1fr .9fr 1.2fr auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.guest-participant-row + .guest-participant-row { margin-top: 10px; }
.guest-participant-row label { min-width: 0; }
.guest-import-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0; padding: 14px 16px; border: 1px solid #ead9c7; border-radius: 10px; background: #fffaf4; }
.guest-import-card > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.guest-import-card span, .guest-import-errors { color: var(--muted); font-size: 13px; line-height: 1.6; }
.guest-import-errors { max-height: 130px; overflow: auto; flex: 1; }

@media (max-width: 1100px) {
  .reservation-statistics { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 700px) {
  .guest-participant-row { grid-template-columns: 1fr; }
  .guest-import-card { align-items: stretch; flex-direction: column; }
  .reservation-statistics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .reservation-section-heading { align-items: stretch; flex-direction: column; }
  .reservation-section-heading input { width: 100%; }
  .reservation-settings-grid { grid-template-columns: 1fr; }
  .reservation-admin-filters { align-items: stretch; flex-direction: column; }
  .reservation-admin-filters select { width: 100%; }
  .reservation-target-head { align-items: flex-start; flex-direction: column; }
}

/* V15 check-in routing follows the approved red-console review artwork. */
.checkin-routing-focus-mode .event-workspace-heading .miniapp-path-line:not(#workspace-publish-state) { display: none; }
.checkin-routing-focus-mode .event-workspace-shell { grid-template-columns: 140px minmax(0,1fr); gap: 42px; }
.checkin-routing-focus-mode .event-side-nav { padding: 0; border: 0; border-radius: 0; background: transparent; }
.checkin-routing-focus-mode .event-workspace-content { padding: 0; border: 0; border-radius: 0; background: transparent; }
.checkin-routing-focus > .workspace-panel-heading { display: none; }
.checkin-routing-focus > .reservation-admin-tabs { gap: 32px; margin: 0 0 20px; padding: 0 0 0 8px; }
.checkin-routing-focus > .reservation-admin-tabs button { padding: 11px 14px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #6e7078; }
.checkin-routing-focus > .reservation-admin-tabs button.active { border-bottom-color: #df3842; background: transparent; color: #df3842; font-weight: 700; }
.checkin-routing-focus .routing-protected > .checkin-routing-heading { display: none; }
.checkin-routing-focus .routing-protected .checkin-routing-layout { display: block; min-height: 0; border: 0; background: transparent; }
.checkin-routing-focus .routing-protected .checkin-routing-layout > aside { display: none; }
.checkin-routing-focus .routing-protected #checkin-routing-editor { padding: 0; }
.checkin-routing-publish-status {
  display: flex;
  min-height: 54px;
  margin-bottom: 18px;
  padding: 13px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #eadff7;
  border-radius: 7px;
  color: #7d7486;
  background: #faf7ff;
}
.checkin-routing-publish-status.live { border-color: #cfe9dd; background: #f1faf6; }
.checkin-routing-publish-status strong { margin: 0 12px; color: #62359e; }
.checkin-routing-publish-status.live strong { color: #227557; }
.checkin-routing-live-pill { padding: 6px 12px; border-radius: 999px; color: #227557; background: #e3f6ed; font-size: 12px; font-weight: 700; white-space: nowrap; }
.checkin-routing-heading { display: flex; margin: 0 0 14px; align-items: flex-start; justify-content: space-between; gap: 20px; }
.checkin-routing-heading h2 { margin: 0 0 6px; font-size: 22px; }
.checkin-routing-heading p { margin: 0; color: #8b929f; }
.checkin-routing-layout { display: grid; min-height: 515px; grid-template-columns: 270px minmax(0,1fr); overflow: hidden; border: 1px solid #dde1e7; border-radius: 8px; background: #fff; }
.checkin-routing-layout > aside { border-right: 1px solid #e3e6eb; background: #fbfbfc; }
.checkin-routing-tree-title { padding: 20px 20px 12px; color: #343942; font-weight: 750; }
.checkin-routing-group { padding: 14px 18px; border-top: 1px solid #eceef2; }
.checkin-routing-group > div { display: flex; margin-bottom: 7px; align-items: center; justify-content: space-between; gap: 8px; }
.checkin-routing-group > div span { color: #969ca7; font-size: 11px; }
.checkin-routing-target { display: flex; width: 100%; padding: 12px 13px; flex-direction: column; gap: 5px; border: 0; border-left: 3px solid transparent; border-radius: 4px; color: #494f5b; background: transparent; text-align: left; cursor: pointer; }
.checkin-routing-target span { color: #949aa5; font-size: 11px; }
.checkin-routing-target.active { border-left-color: #df3842; color: #b72730; background: #fff1f2; }
.checkin-routing-target + .checkin-routing-target { margin-top: 3px; }
#checkin-routing-editor { min-width: 0; padding: 22px; }
.checkin-routing-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.checkin-routing-editor-head small { color: #a0a5ae; }
.checkin-routing-editor-head h3 { margin: 5px 0; font-size: 21px; }
.checkin-routing-editor-head p { margin: 0; color: #7e8592; }
.checkin-routing-switch { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.checkin-routing-switch input, #checkin-region-enabled { position: relative; width: 40px; height: 22px; margin: 0; appearance: none; border: 0; border-radius: 999px; background: #c9ced6; cursor: pointer; transition: background .16s ease; }
.checkin-routing-switch input::after, #checkin-region-enabled::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,31,46,.25); content: ''; transition: transform .16s ease; }
.checkin-routing-switch input:checked, #checkin-region-enabled:checked { background: #df3842; }
.checkin-routing-switch input:checked::after, #checkin-region-enabled:checked::after { transform: translateX(18px); }
.checkin-routing-switch input:disabled, #checkin-region-enabled:disabled { cursor: not-allowed; opacity: .65; }
.checkin-routing-capacity { display: flex; margin: 18px 0 13px; padding: 12px 14px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #d4efe1; border-radius: 6px; color: #237b59; background: #eff9f4; }
.checkin-routing-capacity.error { border-color: #facdce; color: #a52b32; background: #fff0f0; }
.checkin-routing-capacity span { margin-left: 12px; color: #5a8975; }
.checkin-routing-capacity.error span { color: #a85a5e; }
.checkin-routing-capacity > strong:last-child { font-size: 18px; white-space: nowrap; }
.checkin-routing-protected { display: flex; margin: 16px 0 13px; padding: 12px 14px; gap: 16px; border: 1px solid #e6dcfa; border-radius: 6px; color: #653e9b; background: #f7f3ff; }
.checkin-routing-protected span { color: #77717f; }
.checkin-routing-table { overflow: hidden; border: 1px solid #e0e3e8; border-radius: 6px; }
.checkin-routing-row { display: grid; min-height: 72px; padding: 0 12px; grid-template-columns: 60px minmax(190px,1.7fr) repeat(4,minmax(66px,.65fr)) minmax(95px,.85fr); align-items: center; border-top: 1px solid #eceef1; }
.checkin-routing-row.header { min-height: 42px; border-top: 0; color: #7c828d; background: #fafafb; font-size: 11px; }
.checkin-routing-row.available { background: #f4fbf8; }
.checkin-routing-row.dragging { opacity: .55; }
.checkin-routing-order { color: #969ca7; cursor: grab; }
.checkin-routing-region-name { display: flex; min-width: 0; align-items: center; gap: 10px; }
.checkin-routing-region-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkin-routing-thumb { width: 96px; height: 36px; min-width: 96px; border-radius: 3px; object-fit: cover; box-shadow: inset 0 -3px rgba(53,53,57,.5); }
.checkin-routing-no-image { display: grid; width: 96px; height: 36px; min-width: 96px; place-items: center; border: 1px dashed #cbd0d8; border-radius: 4px; color: #9197a1; background: #fafbfc; font-size: 10px; }
.checkin-routing-enabled { display: inline-flex; width: max-content; padding: 4px 9px; border-radius: 999px; color: #17815c; background: #e9f7f1; font-size: 11px; }
.checkin-routing-disabled { color: #8f96a1; background: #eef0f4; }
.checkin-routing-actions button { margin-right: 10px; padding: 0; border: 0; color: #c7333b; background: transparent; cursor: pointer; }
.checkin-routing-actions .locked { color: #a4a8b0; }
.checkin-routing-add { margin-top: 14px; }
.checkin-routing-latest { display: flex; margin-top: 16px; padding: 13px 14px; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #e3d6ff; border-radius: 6px; background: #faf7ff; }
.checkin-routing-latest span { color: #7b7485; }
.checkin-routing-latest strong { color: #6740c0; }
.checkin-routing-help { display: flex; margin-top: 16px; padding: 12px 14px; gap: 14px; border: 1px solid #eadff7; border-radius: 6px; color: #725391; background: #faf7ff; }
.checkin-routing-help span { color: #7d7486; }
.checkin-region-drawer { width: min(365px,100vw); padding: 22px; overflow-x: hidden; }
.checkin-region-drawer .drawer-head small { color: #999; }
.checkin-region-drawer .drawer-head h2 { margin-top: 4px; }
.checkin-region-image-field { display: flex; width: 100%; min-width: 0; max-width: 100%; flex-direction: column; gap: 7px; color: #455366; font-weight: 600; }
.checkin-region-image-field > small { color: #7f8997; font-weight: 400; line-height: 1.55; }
.optional-pill { display: inline-flex; margin-left: 6px; padding: 2px 7px; border-radius: 999px; color: #7e8590!important; background: #eef0f4; font-size: 10px; }
.checkin-region-image-card { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; border: 1px dashed #c9cfd9; border-radius: 7px; background: #fafbfc; }
.checkin-region-image-preview { display: grid; width: 100%; min-width: 0; max-width: 100%; aspect-ratio: 3/1; place-items: center; overflow: hidden; color: #9197a1; background: #f7f8fa; font-weight: 500; }
.checkin-region-image-preview img { display: block; width: 100%; min-width: 0; max-width: 100%; height: 100%; object-fit: cover; }
.checkin-region-image-meta { display: flex; width: 100%; min-width: 0; max-width: 100%; min-height: 52px; padding: 8px 10px; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #e4e7eb; background: #fff; }
.checkin-region-image-meta > div { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.checkin-region-image-meta strong { display: block; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.checkin-region-image-meta small { color: #8d949f; font-size: 9px; font-weight: 400; }
.checkin-region-upload { flex: 0 0 auto; color: #d5343e; cursor: pointer; font-size: 12px; white-space: nowrap; }
.checkin-routing-empty { padding: 65px 20px; color: #8d949f; text-align: center; }
.checkin-routing-capacity-scale { margin: 15px 0; padding: 18px; border: 1px solid #e0e3e8; border-radius: 7px; }
.checkin-routing-capacity-scale > div:first-child { display: flex; margin-bottom: 11px; justify-content: space-between; }
.checkin-routing-capacity-bar { position: relative; height: 14px; border-radius: 8px; background: #f2e7e8; }
.checkin-routing-capacity-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg,#ef6a64,#df3f43); }
.checkin-routing-capacity-bar em { position: absolute; right: 0; top: -4px; width: 3px; height: 22px; background: #8d2930; }
@media(max-width:1100px){.checkin-routing-layout{grid-template-columns:230px minmax(700px,1fr);overflow:auto}.checkin-routing-row{grid-template-columns:55px 220px repeat(4,75px) 100px}}

.miniapp-path-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #8f7b7e; font-size: 11px; }
.miniapp-path-line code { padding: 5px 8px; border: 1px solid #eadadd; border-radius: 6px; background: #fff8f8; color: #7e2b34; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.miniapp-path-line button { padding: 5px 9px; border: 1px solid #d9c2c5; border-radius: 6px; background: #fff; color: #9d2734; cursor: pointer; font-size: 11px; }

@media (max-width: 900px) {
  .section-publication-card { align-items: stretch; flex-direction: column; }
  .section-publication-actions { justify-content: space-between; flex-wrap: wrap; }
}

/* Publication review must remain readable for multiple changed modules. */
#confirm-message { white-space: pre-line; max-height: 50vh; overflow-y: auto; }
#workspace-publish-state button { margin: 6px 0 6px 10px; }
/* V21: continuous region editing, readable limits and keyboard-safe dialogs. */
.workflow-dialog { width:min(560px, calc(100vw - 32px)); border:0; border-radius:12px; padding:24px; color:#243143; box-shadow:0 18px 70px #0003; }
.workflow-dialog::backdrop { background:#15223866; }
.workflow-dialog h2 { font-size:20px; margin:0 0 16px; }
.workflow-dialog p { font-size:15px; line-height:1.7; }
.workflow-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; margin-top:24px; }
.workflow-actions button { min-height:42px; padding:8px 15px; border-radius:6px; border:1px solid #c8d0dc; }
.checkin-routing-focus .routing-protected .checkin-routing-layout { display:grid; grid-template-columns:230px minmax(0,1fr); gap:20px; }
.checkin-routing-focus .routing-protected .checkin-routing-layout > aside { display:block; }
.checkin-routing-row, .checkin-routing-row.header, .checkin-routing-actions button { font-size:14px; }
.checkin-routing-row > span:nth-child(3), .checkin-routing-row > span:nth-child(4), .checkin-routing-row > span:nth-child(5) { font-weight:650; }
.checkin-routing-protected span, .checkin-routing-publish-status small, .checkin-region-drawer small { color:#526177; font-size:13px; line-height:1.6; }
.checkin-routing-actions button { min-height:38px; padding:8px 12px; border-radius:6px; }
.checkin-routing-actions .danger-action { color:#b32934; margin-left:12px; }
.checkin-region-drawer .drawer-actions { position:sticky; bottom:0; background:white; padding:16px 0; margin-top:auto; border-top:1px solid #dce2ea; }
.checkin-region-drawer.capacity-only .checkin-region-image-field, .checkin-region-drawer.capacity-only label:has(#checkin-region-name), .checkin-region-drawer.capacity-only label:has(#checkin-region-enabled), .checkin-region-drawer.capacity-only label:has(#checkin-region-sort) { display:none; }
.checkin-region-drawer.capacity-only .drawer-form { min-height:calc(100% - 110px); display:flex; flex-direction:column; }
.checkin-region-drawer.capacity-only #checkin-region-capacity { font-size:26px; font-weight:650; }
.routing-counts { display:flex; gap:24px; flex-wrap:wrap; margin:16px 0; }
.routing-counts div { min-width:140px; padding:12px 16px; background:#f4f6f9; border-radius:8px; }
.routing-counts span { display:block; font-size:13px; color:#526177; }
.routing-counts strong { font-size:26px; color:#253349; }
.field-error { color:#b32934; font-size:13px; margin:5px 0; }
[aria-invalid="true"] { border-color:#b32934 !important; }
tr.updated-row { background:#fff5d6; }
@media(max-width:1100px) { .checkin-routing-focus .routing-protected .checkin-routing-layout { grid-template-columns:180px minmax(0,1fr); gap:12px; } .checkin-routing-table { overflow-x:auto; } .checkin-routing-row { min-width:700px; } }
