:root {
  --primary: #0b1f2a;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #101418;
  --muted: #68737d;
  --accent: #ffcc00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 16px 24px;
  background: var(--primary);
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 600;
}

.brand-link {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.brand-link:hover {
  text-decoration: underline;
}
.topbar nav a {
  color: #ffffff;
  text-decoration: none;
  margin-left: 12px;
  opacity: 0.9;
  font-weight: 500;
}

.topbar nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.topbar-links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.topbar-nav a {
  margin-left: 0;
  padding: 4px 8px;
  border-radius: 8px;
}

.topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.lang-switch {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  position: relative;
  flex: 0 0 auto;
}

.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(3px);
  color: #ffffff;
  border-radius: 999px;
  padding: 7px 34px 7px 12px;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.lang-switch select option {
  color: #101418;
}

.lang-switch select:focus {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 1px;
}

.logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.container {
  padding: 24px;
  flex: 1;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dbe4ec;
  background: #f8fafc;
  color: #20303d;
}

.flash--success {
  border-color: #b7ebc6;
  background: #edfdf2;
  color: #166534;
}

.flash--warning,
.flash--error {
  border-color: #f3d19c;
  background: #fff7e8;
  color: #9a6700;
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid #e6e8eb;
  background: #f9fbfd;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 24px;
  font-size: 14px;
  color: var(--muted);
  position: relative;
}

.footer-col {
  display: grid;
  gap: 8px;
}

.footer-col a {
  color: inherit;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-social,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-lang-switch {
  margin-left: 0;
  margin-top: 2px;
}

.footer-lang-corner {
  position: absolute;
  right: 24px;
  bottom: 20px;
}

.footer-lang-switch select {
  border: 1px solid #c7d0da;
  background: rgba(233, 239, 245, 0.85);
  color: #1b2730;
  box-shadow: none;
}

.footer-lang-switch select:focus {
  outline: 2px solid rgba(11, 31, 42, 0.18);
}

.print-mode .topbar,
.print-mode .actions,
.print-mode .tabs,
.print-mode .tabs-mobile,
.print-mode .search,
.print-mode .show-more-bar,
.print-mode .cards,
.print-mode .site-footer {
  display: none !important;
}

.print-mode .table {
  display: table !important;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-lang-corner {
    position: static;
    justify-self: start;
    margin-top: 8px;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 50;
  overflow: visible;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
  justify-content: flex-end;
}

.actions-menu {
  position: relative;
  display: inline-flex !important;
  z-index: 6;
}

.actions-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  padding: 8px;
  display: none;
  min-width: 190px;
  box-shadow: 0 8px 24px rgba(15, 23, 32, 0.12);
  z-index: 2000;
  pointer-events: auto;
}

.actions-dropdown.open {
  display: grid;
  gap: 6px;
}

.actions-dropdown .button {
  justify-content: flex-start;
  width: 100%;
}

.print-contest-title {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 600;
  color: #1b2730;
}

.button, button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.button.danger {
  background: #b42318;
  color: #fff;
  border: 1px solid #b42318;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions form {
  margin: 0;
}

.admin-list-table {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.admin-list-table th,
.admin-list-table td {
  padding: 14px 16px;
}

.admin-list-table th {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #243240;
  background: #f3f6f9;
}

.admin-list-table tbody tr {
  transition: background-color 0.16s ease;
}

.admin-list-table tbody tr:hover {
  background: #fbfcfd;
}

.admin-list-table .table-actions {
  gap: 10px;
}

.admin-list-table .button.ghost,
.admin-list-table button.button.ghost {
  background: #fbfcfe;
  border-color: #cbd5df;
  color: #20303d;
}

.admin-list-table .button.ghost:hover,
.admin-list-table button.button.ghost:hover {
  background: #f1f5f9;
  border-color: #b6c3cf;
}

.admin-list-table .button.danger,
.admin-list-table button.button.danger {
  box-shadow: none;
}

.ui-chip {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  max-width: 100%;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #eef2f7;
  color: #334155;
}

.ui-badge--success {
  background: #ecfdf3;
  color: #166534;
}

.ui-badge--muted {
  background: #f1f5f9;
  color: #475569;
}

.ui-date-stack {
  display: inline-grid;
  gap: 2px;
  min-width: 110px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  line-height: 1.2;
  white-space: nowrap;
}

.ui-date-stack__date,
.ui-date-stack__time {
  display: block;
}

.ui-action-group {
  align-items: stretch;
  row-gap: 10px;
}

.ui-action-button.button,
button.ui-action-button {
  min-width: 82px;
  min-height: 42px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-action-button--wide.button,
button.ui-action-button--wide {
  min-width: 96px;
}

.ui-action-button--xwide.button,
button.ui-action-button--xwide {
  min-width: 138px;
}

.ui-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.list-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.list-toolbar input[type="text"] {
  width: min(420px, 100%);
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #cbd5df;
  border-radius: 12px;
  background: #fbfcfe;
  color: #101418;
  font-size: 16px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.list-toolbar input[type="text"]::placeholder {
  color: #7b8794;
}

.list-toolbar input[type="text"]:focus {
  border-color: #9fb0c0;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(11, 31, 42, 0.06);
}

.list-toolbar .button,
.list-toolbar button {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.list-toolbar .button.ghost,
.list-toolbar button.ghost {
  background: #fbfcfe;
  border-color: #cbd5df;
  color: #20303d;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
}

.show-more-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}

.show-more-info {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .page-header {
    align-items: flex-start;
    gap: 12px;
  }
  .page-header .actions {
    margin-top: 34px !important;
    margin-bottom: 0;
    transform: none !important;
    flex: 0 0 auto;
  }
  #actions-toggle {
    position: relative;
    top: 16px !important;
  }
  .page-header .actions .button {
    padding: 10px 16px;
  }
}

@media (max-width: 900px) {
  .list-toolbar {
    flex-wrap: wrap;
    padding: 12px;
  }
  .list-toolbar input[type="text"] {
    flex: 1 1 100%;
    width: 100%;
  }
  .show-more-bar {
    position: sticky;
    bottom: 12px;
    z-index: 6;
    width: fit-content;
    margin: 14px auto 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(245, 248, 252, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(201, 209, 219, 0.75);
    box-shadow: 0 8px 22px rgba(15, 23, 32, 0.12);
  }
  .show-more-info {
    color: #4f5f70;
    font-weight: 500;
  }
  .show-more-bar .button {
    background: var(--primary);
    color: #fff;
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6e8eb;
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f0f2f5;
  font-weight: 600;
}

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

.stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sticky {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 8px 0;
  z-index: 10;
}

.tab {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e9edf1;
  color: #24313a;
  text-decoration: none;
  font-size: 13px;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border: 2px solid transparent;
}

.tab.has-match {
  background: #f3f5f7;
  color: #1f1300;
  border: 2px solid #ff9f1a;
}

.tab.active.has-match {
  background: var(--primary);
  color: #fff;
  border-color: #ff9f1a;
  box-shadow: 0 0 0 2px rgba(255,159,26,0.2);
}

.tab .tab-count {
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.8;
}
.search {
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 8px;
  border: 1px solid #d5d9dd;
  border-radius: 8px;
  background: #fff;
}

.search input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d5d9dd;
}

.search select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d5d9dd;
  background: #fff;
}

@media (max-width: 900px) {
  .search {
    flex-wrap: wrap;
  }
  .search input {
    flex: 1 1 100%;
  }
}

.form {
  background: var(--panel);
  padding: 16px;
  border-radius: 12px;
  max-width: 520px;
}

.form.wide {
  max-width: 960px;
}

.form p {
  display: grid;
  gap: 6px;
}

.form input, .form select {
  padding: 8px 10px;
  border: 1px solid #d5d9dd;
  border-radius: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.form-grid label {
  font-weight: 600;
  padding-top: 8px;
}

.form-grid .muted {
  grid-column: 2;
  margin-top: -4px;
  margin-bottom: 6px;
}

.form-errors {
  background: #ffeaea;
  color: #8a1f1f;
  border: 1px solid #f5c2c2;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.mapping {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.mapping-head,
.mapping-row {
  display: grid;
  grid-template-columns: 40px 1.2fr 2.2fr 0.8fr 0.6fr 0.6fr;
  gap: 8px;
  align-items: center;
}

.mapping-head {
  font-weight: 600;
  color: var(--muted);
}

.mapping-row input[type="text"],
.mapping-row input[type="number"] {
  width: 100%;
}

.stack {
  display: grid;
  gap: 6px;
}

.mapping-row select {
  width: 100%;
}

.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-weight: 600;
  user-select: none;
  text-align: center;
}

.mapping-row.dragging {
  opacity: 0.6;
  background: #f3f5f8;
  border-radius: 8px;
}
.cards {
  display: none;
  gap: 12px;
  margin-top: 16px;
}

.tabs-mobile {
  display: none;
  margin-bottom: 12px;
}

.tabs-mobile-row {
  display: none;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.tabs-mobile select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d5d9dd;
  background: #fff;
  line-height: 44px;
}

.actions--mobile {
  display: none;
}

.actions-icon-button {
  width: 46px;
  min-width: 46px;
  height: 44px;
  padding: 0;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
}

.actions-icon {
  font-size: 20px;
  line-height: 1;
}

.month-section {
  margin-bottom: 20px;
}

.month-title {
  margin: 6px 0 12px;
  font-size: 22px;
  font-weight: 700;
}

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

@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.race-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.competition-editor-form {
  max-width: 1280px;
}

.editor-card {
  border: 1px solid #d9e1ea;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.editor-card__header {
  margin-bottom: 16px;
}

.editor-card__header h2 {
  margin: 0 0 4px;
}

.editor-card__header--with-action {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.editor-grid {
  display: grid;
  gap: 14px 16px;
}

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

.editor-grid--feed-top,
.editor-grid--feed-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.editor-field {
  display: grid;
  gap: 6px;
}

.editor-field label {
  font-weight: 700;
}

.editor-field--full {
  grid-column: 1 / -1;
}

.editor-field--check {
  align-content: start;
}

.editor-checkbox {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d5d9dd;
  border-radius: 12px;
  background: #fff;
}

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

.editor-form input[type="text"],
.editor-form input[type="number"],
.editor-form input[type="date"],
.editor-form input[type="file"],
.editor-form textarea,
.editor-form select,
.editor-form input[type="url"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d5d9dd;
  border-radius: 12px;
  background: #fff;
}

.editor-form textarea {
  min-height: 96px;
  resize: vertical;
}

.editor-form input:focus,
.editor-form select:focus,
.editor-form textarea:focus {
  outline: none;
  border-color: #9fb0c0;
  box-shadow: 0 0 0 4px rgba(11, 31, 42, 0.06);
}

.editor-form .muted {
  margin-top: 2px;
}

.editor-form .actions {
  margin-top: 24px;
  justify-content: flex-start;
}

.editor-form .actions .button,
.editor-form .actions button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-form .form-errors ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.editor-form .errorlist {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #8a1f1f;
  font-size: 13px;
}

.editor-form .errorlist li {
  margin: 0;
}

.editor-code-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #d9e1ea;
  border-radius: 16px;
  background: #f8fafc;
}

.editor-code-list__title {
  font-size: 13px;
  font-weight: 700;
  color: #243240;
}

.editor-code-list__body {
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
  word-break: break-word;
}

.editor-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-inline-actions .button,
.editor-inline-actions button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.editor-table th,
.editor-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e6e8eb;
  vertical-align: middle;
}

.editor-table th {
  background: #f3f6f9;
  color: #243240;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
}

.editor-table td:last-child,
.editor-table th:last-child {
  width: 120px;
}

.admin-stat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 20px 0;
}

.admin-stat-card {
  background: #fff;
  border: 1px solid #d9e1ea;
  border-radius: 16px;
  padding: 16px;
}

.admin-stat-card__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.admin-stat-card__value {
  color: #101418;
  line-height: 1.45;
}

.admin-preview-json {
  max-height: 360px;
  overflow: auto;
  background: #0f172a;
  color: #e5eefc;
  padding: 16px;
  border-radius: 16px;
}

.api-secret-block {
  display: grid;
  gap: 8px;
}

.api-secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-secret-value {
  display: inline-block;
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
}

.api-secret-toggle,
.api-secret-copy {
  min-width: 82px;
}

.api-docs-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.api-docs-list li {
  padding: 12px 14px;
  border: 1px solid #d9e1ea;
  border-radius: 14px;
  background: #f8fafc;
}

.api-docs-stack {
  display: grid;
  gap: 18px;
}

.competition-editor-form input[type="text"],
.competition-editor-form input[type="number"],
.competition-editor-form input[type="date"],
.competition-editor-form input[type="file"],
.competition-editor-form textarea,
.competition-editor-form select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d5d9dd;
  border-radius: 12px;
  background: #fff;
}

.competition-editor-form textarea {
  min-height: 84px;
  resize: vertical;
}

.feed-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.feed-tab {
  border: 1px solid #d5d9dd;
  border-radius: 999px;
  padding: 10px 16px;
  background: #eef3f8;
  color: #22313f;
  font-weight: 700;
}

.feed-tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.feed-panel {
  display: none;
  border: 1px solid #d9e1ea;
  border-radius: 16px;
  padding: 18px;
  background: #f9fbfd;
}

.feed-panel.is-active {
  display: block;
}

.feed-template-row,
.feed-subsection__header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.feed-subsection {
  margin-top: 18px;
}

.feed-source-mode {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.feed-source-mode__item {
  display: none;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d9e1ea;
  border-radius: 14px;
  background: #fff;
  color: #536273;
}

.feed-source-mode[data-source-type="track"] .feed-source-mode__item[data-mode="track"],
.feed-source-mode[data-source-type="road"] .feed-source-mode__item[data-mode="road"],
.feed-source-mode[data-source-type="relay"] .feed-source-mode__item[data-mode="relay"] {
  display: grid;
}

.split-field-grid {
  display: grid;
  grid-template-columns: 1.1fr repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: center;
}

.split-field-grid--head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.split-field-rows {
  display: grid;
  gap: 10px;
}

.contest-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.contest-grid--head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.contest-rows {
  display: grid;
  gap: 10px;
}

.feed-subsection .mapping {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .editor-card__header--with-action,
  .editor-grid--main,
  .editor-grid--feed-top,
  .editor-grid--feed-settings,
  .contest-grid,
  .split-field-grid {
    grid-template-columns: 1fr;
  }

  .feed-template-row,
  .feed-subsection__header {
    align-items: stretch;
  }

  .editor-inline-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.race-filters input,
.race-filters select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d5d9dd;
  background: #fff;
}

.race-filters button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.race-card {
  background: var(--panel);
  border-radius: 14px;
  padding: 0;
  border: 1px solid #e6e8eb;
  text-decoration: none;
  color: var(--text);
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 160px;
  overflow: hidden;
}

.race-media {
  height: 100%;
}

.race-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.race-image.placeholder {
  background: linear-gradient(135deg, #e6edf3, #f7f9fb);
}

.race-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 160px;
}

.race-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.race-title {
  font-size: 18px;
  font-weight: 700;
}

.race-dates {
  color: var(--muted);
  font-size: 13px;
}

.race-location {
  color: #3a4650;
  font-size: 13px;
}

.race-desc {
  color: #2f3b45;
  font-size: 14px;
  min-height: 40px;
  max-height: 48px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.race-open {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  margin-top: auto;
}

.results-disclaimer {
  margin-top: 14px;
  padding: 12px 14px 12px 14px;
  border: 1px solid #d9c48b;
  background: #fff7e6;
  border-radius: 10px;
  color: #4d3a12;
  position: relative;
}

.results-disclaimer-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #6f5320;
  cursor: pointer;
}

.results-disclaimer-text {
  font-size: 14px;
  line-height: 1.4;
  padding-right: 24px;
}

@media (max-width: 900px) {
  .race-card {
    grid-template-columns: 96px 1fr;
  }
  .race-card {
    min-height: 120px;
  }
  .race-body {
    min-height: 120px;
  }
  .card summary strong {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

.card {
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #e6e8eb;
}

.card summary {
  display: grid;
  grid-template-columns: 48px 60px minmax(0, 1fr) 72px;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

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

.card summary span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 0;
}

.card summary span:last-child {
  align-items: flex-end;
  text-align: right;
}

.card summary strong {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card summary span:nth-child(3) strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card summary span.is-name strong {
  display: block;
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.card summary span.is-name {
  position: relative;
  padding-right: 16px;
}

.card summary span.is-name .yellow-card-badge {
  position: absolute;
  right: 0;
  top: 2px;
}

@media (max-width: 900px) {
  .card summary span.is-name strong {
    line-height: 1.15;
  }
}

.card summary small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card summary small {
  color: var(--muted);
}

.card-body {
  margin-top: 10px;
  border-top: 1px solid #e6e8eb;
  padding-top: 8px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.card-body .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.yellow-card-badge {
  display: inline-block;
  width: 12px;
  height: 16px;
  background: #ffcf33;
  border: 1px solid #c99b00;
  border-radius: 2px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .table { display: none; }
  .table-scroll .table {
    display: table;
    min-width: 900px;
  }
  .cards { display: grid; }
  .tabs { overflow-x: auto; }
  .tabs { display: none; }
  .tabs-mobile-row { display: flex; }
  .tabs-mobile { display: block; flex: 1; margin-bottom: 0; }
  .actions--desktop { display: none; }
  .actions--mobile { display: flex; }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 5mm;
  }
  body {
    background: #fff;
  }
  body, .container, .table, .table th, .table td {
    font-size: 9.5px;
    line-height: 1.1;
  }
  .topbar,
  .actions,
  .tabs,
  .tabs-mobile,
  .search,
  .show-more-bar,
  .cards,
  .site-footer {
    display: none !important;
  }
  .table {
    display: table !important;
  }
  .table th,
  .table td {
    padding: 3px 5px;
    white-space: nowrap;
  }
  .table tr {
    page-break-inside: avoid;
  }
  .container {
    padding: 0 4px;
  }
  .print-contest-title {
    margin-top: 2px;
    margin-bottom: 4px;
    font-size: 12.5px;
    color: #000;
  }
  h1 {
    font-size: 17px;
    margin: 0 0 4px;
  }
  .event-meta {
    font-size: 10.5px;
    margin-bottom: 4px;
  }
}

pre {
  background: #0f1720;
  color: #e6edf3;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
}

code {
  background: #eef2f6;
  padding: 2px 6px;
  border-radius: 6px;
}

pre code {
  background: transparent;
  padding: 0;
}

.csv-log {
  background: var(--panel);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.ops-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ops-pill.ok {
  background: #e9f8ef;
  color: #1f7a3a;
  border: 1px solid #b9e7c8;
}

.ops-pill.warn {
  background: #fff5e8;
  color: #9a5b0b;
  border: 1px solid #ffd6a3;
}

.ops-checklist-text {
  width: 100%;
  margin-top: 12px;
  min-height: 180px;
  display: none;
}

.v2-clickable-row {
  cursor: pointer;
}

.v2-clickable-row:hover td {
  background: rgba(11, 31, 42, 0.04);
}

.v2-entry-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #d7dde4;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.v2-entry-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.v2-entry-panel__header h2 {
  margin: 0 0 8px;
}

.v2-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.v2-entry-grid__item {
  padding: 12px 14px;
  border: 1px solid #d7dde4;
  border-radius: 16px;
  background: #fff;
}

.v2-entry-grid__item span {
  display: block;
  color: #667280;
  font-size: 13px;
  margin-bottom: 6px;
}

.v2-entry-panel__actions {
  margin-bottom: 16px;
}

.certificate-editor {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.certificate-editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.certificate-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.certificate-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d7dde4;
  border-radius: 16px;
  background: #fff;
}

.certificate-field-item {
  border: 1px solid #d7dde4;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.certificate-field-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 31, 42, 0.08);
}

.certificate-editor-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d7dde4;
  border-radius: 20px;
  background: #fff;
}

.certificate-editor-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.certificate-editor-control--checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.certificate-editor-control--checkbox label {
  margin: 0;
}

.certificate-canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.certificate-preview-toolbar {
  display: flex;
  justify-content: flex-start;
}

.certificate-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  min-height: 720px;
  border-radius: 24px;
  border: 1px solid #d7dde4;
  background-color: #ffffff;
  background-image: linear-gradient(180deg, #fbfbfd 0%, #f2f4f8 100%);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  overflow: hidden;
}

.certificate-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(11, 31, 42, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 31, 42, 0.06) 1px, transparent 1px);
  background-size: 5% 5%;
}

.certificate-guide {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  background: rgba(11, 31, 42, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.certificate-guide--v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.certificate-guide--h {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
}

.certificate-canvas-field {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: transparent;
  padding: 12px;
  cursor: move;
  white-space: pre-wrap;
  box-sizing: border-box;
  z-index: 2;
  font-family: "DejaVu Sans", "Arial Unicode MS", Arial, sans-serif;
  line-height: 1.15;
}

.certificate-canvas-field.active {
  border: 1px dashed var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 31, 42, 0.08);
}

.certificate-render-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid #d7dde4;
  border-radius: 20px;
  background: #ffffff;
}

.certificate-render-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid #e2e6ea;
  background: #fff;
}

@media (max-width: 900px) {
  .certificate-editor {
    grid-template-columns: 1fr;
  }

  .certificate-editor-sidebar {
    position: static;
  }

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

  .certificate-canvas {
    min-height: 420px;
  }

  .v2-entry-panel {
    padding: 16px;
    border-radius: 20px;
  }

  .v2-entry-panel__header {
    flex-direction: column;
    align-items: stretch;
  }

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