:root {
  --ink: #07122d;
  --muted: #5f6c83;
  --line: #d6e0f0;
  --panel: #ffffff;
  --panel-strong: #f5f8fe;
  --brand: #005dff;
  --brand-bright: #0072ff;
  --brand-dark: #010f34;
  --brand-mid: #082b72;
  --teal: #00a6c8;
  --green: #15803d;
  --gold: #b88200;
  --red: #c2412d;
  --shadow: 0 16px 42px rgba(8, 23, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #edf3fb;
  touch-action: pan-x pan-y pinch-zoom;
}

body.msr-app {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 93, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 92% 16%, rgba(1, 15, 52, 0.12), transparent 24rem),
    linear-gradient(180deg, #fbfdff 0%, #eef4fc 46%, #f7f9fc 100%);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  overflow-x: hidden;
  touch-action: pan-x pan-y pinch-zoom;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 -14px;
  padding: 10px 14px;
  background: rgba(251, 253, 255, 0.9);
  border-bottom: 1px solid rgba(217, 226, 239, 0.76);
  backdrop-filter: blur(18px);
}

.app-brand img {
  display: block;
  width: clamp(198px, 40vw, 292px);
  height: auto;
}

.top-actions {
  display: none;
  align-items: center;
  gap: 6px;
}

.top-actions a {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-actions a.active,
.top-actions a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

.results-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 12px;
  padding: 22px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(1, 15, 52, 0.98), rgba(4, 35, 102, 0.96) 52%, rgba(0, 93, 255, 0.88)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.results-hero > div {
  position: relative;
  z-index: 2;
}

.hero-brand-icon {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 1;
  width: 128px;
  height: 128px;
  object-fit: contain;
  opacity: 0.18;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.results-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: 34px;
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.55;
}

.hero-stats {
  position: relative;
  z-index: 2;
  align-self: end;
  width: min(100%, 220px);
  padding: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.hero-stats span,
.hero-stats small {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.hero-stats strong {
  display: block;
  margin: 2px 0;
  font-size: 42px;
  line-height: 1;
}

.control-panel,
.results-section {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 239, 0.82);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(8, 23, 51, 0.08);
}

.content-hero {
  margin-top: 12px;
}

.content-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.content-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 226, 239, 0.86);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(8, 23, 51, 0.08);
}

.content-card h2,
.content-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.content-card h2 {
  font-size: 20px;
}

.content-card h3 {
  font-size: 16px;
}

.content-card p,
.content-card li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.content-card p {
  margin: 0 0 12px;
}

.content-card p:last-child {
  margin-bottom: 0;
}

.content-card ul {
  margin: 0;
  padding-left: 20px;
}

/* National Championship form guide */
.event-form-guide-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.form-guide-kicker {
  margin: 0 0 2px !important;
  color: var(--brand) !important;
  font-size: 11px !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

.form-guide-intro {
  margin: 0 0 14px !important;
}

.event-form-guide {
  display: grid;
  gap: 8px;
}

.form-guide-row {
  display: grid;
  grid-template-columns: 38px minmax(170px, 1fr) minmax(290px, 0.9fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-guide-row:first-child {
  color: #fff;
  background: linear-gradient(135deg, #061a49, #005dff);
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(0, 93, 255, 0.2);
}

.form-guide-rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--brand);
  background: rgba(0, 93, 255, 0.1);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
}

.form-guide-row:first-child .form-guide-rank {
  color: #061a49;
  background: #fff;
}

.form-guide-person {
  min-width: 0;
}

.form-guide-person strong,
.form-guide-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-guide-person strong {
  color: inherit;
  font-size: 14px;
}

.form-guide-person small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.form-guide-person p {
  margin: 5px 0 0 !important;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-guide-row:first-child .form-guide-person small,
.form-guide-row:first-child .form-guide-person p {
  color: rgba(255, 255, 255, 0.76);
}

.form-guide-odds {
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, 1fr));
  gap: 6px;
  margin: 0;
}

.form-guide-odds div {
  min-width: 0;
  padding: 6px 8px;
  background: rgba(0, 93, 255, 0.06);
  border-radius: 7px;
  text-align: center;
}

.form-guide-row:first-child .form-guide-odds div {
  background: rgba(255, 255, 255, 0.13);
}

.form-guide-odds dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-guide-odds dd {
  margin: 2px 0 0;
  color: inherit;
  font-size: 13px;
  font-weight: 900;
}

.form-guide-row:first-child .form-guide-odds dt {
  color: rgba(255, 255, 255, 0.7);
}

.form-guide-confidence {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.confidence-high {
  color: #087443;
  background: #dcfce7;
}

.confidence-medium {
  color: #8a4b08;
  background: #fef3c7;
}

.confidence-low {
  color: #667085;
  background: #eef2f7;
}

.form-guide-row:first-child .form-guide-confidence {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.form-guide-method {
  margin: 12px 0 0 !important;
  font-size: 11px !important;
}

@media (max-width: 760px) {
  .form-guide-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .form-guide-odds,
  .form-guide-confidence {
    grid-column: 2;
  }

  .form-guide-odds {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-guide-confidence {
    width: max-content;
  }
}

.event-detail-hero h1 {
  max-width: 15ch;
  font-size: 31px;
}

.event-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.event-detail-meta span,
.event-results-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.event-results-section {
  padding: 12px;
}

.event-results-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.event-results-metrics[hidden] {
  display: none;
}

.event-results-metrics span {
  justify-content: space-between;
  color: var(--muted);
  background: var(--panel-strong);
  border-color: var(--line);
}

.event-results-metrics strong {
  color: var(--ink);
  font-size: 18px;
  white-space: nowrap;
}

.event-results-content {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.fleet-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(217, 226, 239, 0.92);
  border-radius: 8px;
}

.fleet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #061a49, #005dff);
  color: #fff;
}

.fleet-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.fleet-card-header h3 i {
  display: none;
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.fleet-card-gold .fleet-card-header { background: linear-gradient(135deg, #5f4300, #b8860b); }
.fleet-card-silver .fleet-card-header { background: linear-gradient(135deg, #394655, #7b8998); }
.fleet-card-bronze .fleet-card-header { background: linear-gradient(135deg, #613216, #a96332); }
.fleet-card-copper .fleet-card-header { background: linear-gradient(135deg, #6f271d, #c45f44); }
.fleet-card-gold .fleet-card-header h3 i,
.fleet-card-silver .fleet-card-header h3 i,
.fleet-card-bronze .fleet-card-header h3 i,
.fleet-card-copper .fleet-card-header h3 i { display: block; }
.fleet-card-gold .fleet-card-header h3 i { color: #f4c542; }
.fleet-card-silver .fleet-card-header h3 i { color: #d7dee6; }
.fleet-card-bronze .fleet-card-header h3 i { color: #cd7f32; }
.fleet-card-copper .fleet-card-header h3 i { color: #e8795d; }

.fleet-card-header span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.event-results-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.app-results-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 12px;
}

.app-results-table th,
.app-results-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #e7eef8;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.app-results-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f5f8fe;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-results-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.app-results-table td.is-final-race,
.app-results-table th.is-final-race {
  background: #eef6ff;
}

.app-results-table small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.result-name strong,
.result-sail strong {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-position strong {
  font-size: 16px;
}

.score-first {
  display: inline-flex;
  min-width: 24px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  font-weight: 800;
}

.competitor-name-button {
  display: grid;
  position: relative;
  width: 100%;
  min-width: 150px;
  padding: 2px 24px 2px 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.competitor-name-button strong,
.competitor-name-button small {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competitor-name-button i {
  position: absolute;
  top: 8px;
  right: 3px;
  color: var(--brand);
  transition: transform 160ms ease;
}

.competitor-result-row.is-expanded {
  background: #eef5ff !important;
}

.competitor-result-row.is-expanded .competitor-name-button i {
  transform: rotate(180deg);
}

.competitor-detail-row[hidden] {
  display: none;
}

.app-results-table .competitor-detail-row > td {
  padding: 0;
  background: #f7faff;
  border-bottom: 2px solid #b9ccef;
  white-space: normal;
}

.competitor-detail {
  position: sticky;
  left: 0;
  display: grid;
  width: min(760px, calc(100vw - 58px));
  gap: 14px;
  padding: 16px;
  color: var(--ink);
}

.competitor-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.competitor-detail-head span,
.competitor-performance-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.competitor-detail-head h4 {
  margin: 3px 0 0;
  font-size: 18px;
}

.competitor-compare {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 11px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--brand-mid);
  background: #fff;
  border: 1px solid #b9ccef;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.competitor-compare.is-active {
  color: #fff;
  background: var(--brand-mid);
  border-color: var(--brand-mid);
}

.leader-badge {
  padding: 6px 9px;
  color: #725300 !important;
  background: #fff3bf;
  border: 1px solid #ead47a;
  border-radius: 6px;
}

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

.competitor-performance-stats > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.competitor-performance-stats strong {
  font-size: 20px;
}

.race-position-list {
  display: flex;
  gap: 7px;
  padding-bottom: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.race-position-tile {
  display: grid;
  width: 52px;
  min-width: 52px;
  min-height: 60px;
  place-content: center;
  gap: 1px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.race-position-tile span,
.race-position-tile small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.race-position-tile strong {
  font-size: 16px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

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

.chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 3px;
}

.selected-key {
  background: var(--brand);
}

.leader-key {
  background: #d08b00;
}

.competitor-chart-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  -webkit-overflow-scrolling: touch;
}

.competitor-chart {
  display: block;
  height: 190px;
  min-width: 100%;
}

.competitor-chart polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.competitor-line {
  stroke: var(--brand);
}

.leader-line {
  stroke: #d08b00;
  stroke-dasharray: 7 5;
}

.competitor-point {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 3;
}

.leader-point {
  fill: #fff;
  stroke: #d08b00;
  stroke-width: 3;
}

.chart-grid line {
  stroke: #dfe7f2;
  stroke-width: 1;
}

.chart-grid text {
  fill: #758197;
  font-size: 9px;
  font-weight: 700;
}

.competitor-chart-empty {
  padding: 18px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 7px;
  font-size: 12px;
}

@media (max-width: 520px) {
  .competitor-detail {
    width: calc(100vw - 40px);
    padding: 13px 10px;
  }

  .competitor-detail-head {
    align-items: flex-start;
  }

  .competitor-compare span {
    max-width: 82px;
  }

  .competitor-performance-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.empty-state {
  display: grid;
  gap: 4px;
  padding: 20px;
  color: var(--muted);
  background: var(--panel-strong);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty-state strong {
  color: var(--ink);
}

.related-news-list {
  display: grid;
  gap: 10px;
}

.related-news-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  min-height: 84px;
  padding: 10px;
  color: inherit;
  text-decoration: none;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.related-news-card img,
.related-news-card > i {
  width: 72px;
  height: 64px;
  object-fit: cover;
  background: linear-gradient(135deg, #07142e, #0668ff);
  border-radius: 6px;
}

.related-news-card span {
  display: grid;
  min-width: 0;
  gap: 4px;
  align-content: center;
}

.related-news-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.related-news-card small,
.related-news-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.favourite-filter-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.favourite-filter-bar[hidden] {
  display: none;
}

.favourite-filter-chips {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.favourite-chip,
.favourite-manage-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 7px 9px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.favourite-chip {
  max-width: 180px;
}

.favourite-chip span,
.favourite-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favourite-chip small {
  color: #8a97aa;
  font-size: 10px;
}

.favourite-chip.is-active {
  color: #fff;
  background: linear-gradient(135deg, #061a49, #005dff);
  border-color: transparent;
}

.favourite-chip.is-active small {
  color: rgba(255, 255, 255, 0.76);
}

.favourite-drawer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.filter-help-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.favourite-manager-list {
  display: grid;
  gap: 12px;
}

.favourite-manager-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.favourite-manager-item.is-active {
  border-color: rgba(0, 93, 255, 0.5);
  box-shadow: 0 10px 24px rgba(0, 93, 255, 0.12);
}

.favourite-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.favourite-manager-head h3 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 17px;
}

.favourite-manager-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.favourite-manager-head i {
  color: var(--brand);
  font-size: 18px;
}

.favourite-detail-list div {
  grid-template-columns: minmax(96px, 0.36fr) minmax(0, 1fr);
}

.favourite-manager-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.favourite-manager-actions button:first-child {
  grid-column: 1 / -1;
}

.ranking-control-panel {
  display: grid;
  gap: 12px;
}

.ranking-class-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ranking-class-tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.ranking-class-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #061a49, #005dff);
  border-color: transparent;
}

.section-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ranking-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ranking-podium-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(8, 23, 51, 0.08);
}

.ranking-podium-card.rank-1 {
  color: #fff;
  background: linear-gradient(135deg, #061a49, #005dff);
  border-color: transparent;
}

.ranking-rank {
  width: max-content;
  padding: 3px 7px;
  color: inherit;
  background: rgba(0, 93, 255, 0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.ranking-podium-card.rank-1 .ranking-rank {
  background: rgba(255, 255, 255, 0.18);
}

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

.ranking-podium-card strong {
  font-size: 13px;
}

.ranking-podium-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ranking-podium-card.rank-1 small {
  color: rgba(255, 255, 255, 0.78);
}

.ranking-podium-card b {
  font-size: 18px;
}

.ranking-list {
  margin-top: 8px;
}

.app-rankings-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 11px;
}

.app-rankings-table th:nth-child(1),
.app-rankings-table td:nth-child(1) {
  width: 38px;
}

.app-rankings-table th:nth-child(3),
.app-rankings-table td:nth-child(3) {
  width: 46px;
}

.app-rankings-table th:nth-child(4),
.app-rankings-table td:nth-child(4) {
  width: 50px;
}

.app-rankings-table th:nth-child(5),
.app-rankings-table td:nth-child(5) {
  width: 54px;
}

.app-rankings-table th,
.app-rankings-table td {
  padding: 6px 6px;
}

.app-rankings-table thead tr {
  background: linear-gradient(135deg, #061a49, #005dff);
}

.app-rankings-table th {
  padding: 9px 8px;
  color: #fff;
  background: transparent;
  border-bottom-color: #005dff;
  font-size: 10px;
  vertical-align: top;
}

.app-rankings-table td {
  vertical-align: top;
}

.app-rankings-table small {
  margin-top: 1px;
  font-size: 9px;
}

.app-rankings-table .result-position strong {
  font-size: 14px;
}

.app-rankings-table .result-name strong {
  max-width: 100%;
}

.app-rankings-table .result-sail strong {
  max-width: 100%;
}

.app-rankings-table .result-position,
.app-rankings-table .result-sail,
.app-rankings-table .ranking-points-cell,
.app-rankings-table .ranking-table-events {
  padding-top: 8px;
}

.ranking-table-row {
  cursor: pointer;
}

.ranking-table-row:focus-visible {
  outline: 3px solid rgba(0, 93, 255, 0.18);
  outline-offset: -3px;
}

.ranking-table-row.is-expanded {
  background: #edf5ff;
}

.ranking-table-events {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ranking-table-events span {
  font-weight: 900;
}

.ranking-table-events i {
  color: var(--muted);
  font-size: 11px;
}

.ranking-expanded-row td {
  padding: 0;
  background: #fff;
  max-width: calc(100vw - 28px);
}

.ranking-expanded-row .ranking-sailor-detail {
  width: 100%;
  max-width: calc(100vw - 28px);
  margin: 0;
  padding: 12px;
  border-top: 0;
}

.ranking-row-card {
  padding: 10px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ranking-row-card.is-expanded {
  background: #fff;
  border-color: rgba(0, 93, 255, 0.32);
  box-shadow: 0 12px 28px rgba(8, 23, 51, 0.1);
}

.ranking-row-summary {
  display: grid;
  width: 100%;
  grid-template-columns: 48px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.ranking-row-summary i {
  color: var(--muted);
  font-size: 12px;
}

.ranking-row-rank {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: #edf5ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.ranking-row-main {
  min-width: 0;
}

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

.ranking-row-main strong {
  color: var(--ink);
  font-size: 14px;
}

.ranking-row-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ranking-row-score {
  text-align: right;
}

.ranking-row-score strong,
.ranking-row-score span {
  display: block;
  white-space: nowrap;
}

.ranking-row-score strong {
  color: var(--ink);
  font-size: 17px;
}

.ranking-row-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ranking-sailor-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.ranking-detail-stats div {
  min-width: 0;
  padding: 8px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ranking-detail-stats dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ranking-detail-stats dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-detail-events {
  display: grid;
  gap: 7px;
}

.ranking-detail-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
  gap: 8px;
  padding: 9px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ranking-detail-event span {
  min-width: 0;
  max-width: 100%;
}

.ranking-detail-event strong,
.ranking-detail-event small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-detail-event strong {
  color: var(--ink);
  font-size: 12px;
}

.ranking-detail-event small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ranking-detail-event b {
  color: var(--brand);
  font-size: 16px;
  white-space: nowrap;
}

.ranking-detail-score {
  display: grid;
  width: 82px;
  justify-items: end;
  gap: 3px;
}

.ranking-detail-score em {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.ranking-detail-event.is-counted {
  border-color: rgba(0, 93, 255, 0.26);
}

.ranking-detail-event.is-counted .ranking-detail-score em {
  color: #fff;
  background: var(--brand);
}

.ranking-detail-event.is-unused {
  opacity: 0.72;
}

.ranking-detail-event.is-unused .ranking-detail-score em {
  color: var(--muted);
  background: #edf2f7;
}

.ranking-detail-event.is-empty {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.news-detail-hero h1 {
  max-width: 18ch;
}

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

.app-news-article {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.news-source-credit {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: #061a49;
  background: #eef6ff;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.news-detail-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.app-news-body {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.68;
}

.app-news-body :where(p, ul, ol, blockquote, table, figure) {
  margin: 0 0 14px;
}

.app-news-body :where(h1, h2, h3, h4) {
  margin: 20px 0 10px;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.18;
}

.app-news-body h1 {
  font-size: 24px;
}

.app-news-body h2 {
  font-size: 21px;
}

.app-news-body h3 {
  font-size: 18px;
}

.app-news-body :where(p, li) {
  color: #334155;
  font-size: 15px;
  line-height: 1.68;
}

.app-news-body :where(ul, ol) {
  padding-left: 20px;
}

.app-news-body :where(img, video) {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.app-news-body a {
  color: var(--brand);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.app-news-body blockquote {
  padding: 12px 14px;
  color: #1e3a8a;
  background: #eef6ff;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
}

.app-news-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

.app-news-body th,
.app-news-body td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.event-info-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.event-info-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.event-info-actions a[hidden] {
  display: none;
}

.event-info-actions.event-cross-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 370px) {
  .event-info-actions.event-cross-links { grid-template-columns: 1fr; }
}

.event-info-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.event-info-main {
  min-height: 140px;
}

.event-notes {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
  white-space: pre-line;
}

.event-notes:empty {
  display: none;
}

.event-info-main > p {
  white-space: pre-line;
}

.event-notes p {
  margin: 0 0 10px;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #e7eef8;
}

.detail-list div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.entry-list-heading h2 {
  margin-bottom: 0;
}

.entry-list-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.event-entry-list {
  display: grid;
  gap: 8px;
}

.event-entry-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 58px;
  padding: 12px 70px 10px 10px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-sail {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.entry-sail img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

.entry-sail > span {
  display: block;
  min-width: 0;
}

.entry-sail small {
  display: block;
  max-width: 110px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-sail strong,
.entry-person strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.entry-sail strong {
  overflow: visible;
  text-overflow: clip;
}

.entry-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-person {
  min-width: 0;
}

.entry-person small {
  display: block;
  min-width: 0;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 7px;
  color: #0f3b79;
  background: #e8f2ff;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.entry-status.confirmed {
  color: #065f46;
  background: #dff8ec;
  border-color: #b8efd5;
}

.entry-status.waiting-list {
  color: #854d0e;
  background: #fff5d7;
  border-color: #fde68a;
}

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

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

.event-resource-links a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 62px;
  border: 1px solid #cbd8e5;
  border-radius: 6px;
  padding: 9px;
  color: #26364c;
  background: #f7fafc;
  text-decoration: none;
}

.event-resource-links a > i {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #0061d8;
  background: #e7f1ff;
  font-size: 15px;
}

.event-resource-links span,
.event-resource-links strong,
.event-resource-links small {
  display: block;
  min-width: 0;
}

.event-resource-links strong {
  font-size: 12px;
}

.event-resource-links small {
  margin-top: 2px;
  color: #68798c;
  font-size: 10px;
  line-height: 1.3;
}

.event-resource-links a:active {
  background: #eaf3ff;
}

@media (max-width: 560px) {
  .event-resource-links {
    grid-template-columns: 1fr;
  }
}

.schedule-item {
  display: grid;
  grid-template-columns: minmax(82px, 0.32fr) minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schedule-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.schedule-item strong {
  color: var(--ink);
  font-size: 13px;
}

.schedule-item small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.resource-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.resource-heading h2 { margin: 0; }
.compact-action { min-height: 38px; padding: 9px 13px; font-size: .82rem; }
.event-native-list { display: grid; gap: 8px; }
.event-native-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) 16px; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; color: #12213b; background: #f5f8fc; border: 1px solid #dce4ef; border-radius: 6px; text-decoration: none; }
.event-native-item > i:first-child { color: #0874c9; }
.event-native-item > i:last-child { color: #708096; font-size: .75rem; }
.event-native-item strong { min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.empty-resource { margin: 0; color: #66758a; font-size: .88rem; }
.noticeboard-action-row { display: flex; margin-top: 16px; }
.schedule-table { display: grid; margin-top: 6px; }
.schedule-table h3 { margin: 16px 0 8px; color: #65a927; font-size: 13px; font-weight: 900; text-transform: uppercase; }
.schedule-table h3:first-child { margin-top: 0; }
.schedule-table > div { display: grid; grid-template-columns: minmax(120px, .46fr) minmax(0, 1fr); gap: 18px; min-height: 34px; align-items: center; border-bottom: 1px solid #dce4ef; }
.schedule-table time { color: #10203b; font-size: 13px; font-weight: 800; }
.schedule-table span { color: #10203b; font-size: 13px; font-weight: 650; }
@media (max-width: 520px) { .schedule-table > div { grid-template-columns: 112px minmax(0,1fr); gap: 10px; } }
.protest-header { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; align-items: start; padding: 20px max(16px,calc((100% - 760px)/2)); color: #fff; background: #07142e; }
.protest-header > a { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; text-decoration: none; }
.protest-header .eyebrow { margin: 0 0 3px; color: #87c84b; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.protest-header h1 { margin: 0; font-size: 24px; line-height: 1.15; }
.protest-header p:last-child { margin: 5px 0 0; color: #c8d3e3; font-size: 13px; }
.protest-page { margin: 14px 0 0; padding: 0 0 20px; }
.app-form { display: grid; gap: 12px; }
.app-form .protest-section { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.app-form .protest-section > h2 { display: flex; margin: 0 0 17px; align-items: center; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: 0; }
.app-form .protest-section > h2 span { display: inline-flex; width: 28px; height: 28px; margin-right: 9px; flex: 0 0 28px; align-items: center; justify-content: center; color: #fff; background: var(--brand-mid); border-radius: 8px; font-size: 12px; }
.app-form label { display: grid; gap: 7px; color: #344258; font-size: 12px; font-weight: 700; }
.app-form label b { display: inline; color: #c42b3b; }
.app-form input,.app-form select,.app-form textarea { width: 100%; min-height: 44px; padding: 10px 11px; color: #16233a; background: #fff; border: 1px solid #b9c5d5; border-radius: 5px; font: inherit; font-size: 14px; }
.app-form input:focus,.app-form select:focus,.app-form textarea:focus { outline: 3px solid rgba(8,116,201,.14); border-color: #0874c9; }
.app-form textarea { min-height: 130px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.choice-grid label { display: flex; min-height: 42px; padding: 8px 10px; align-items: center; gap: 8px; color: var(--ink); background: var(--panel-strong); border: 1px solid var(--line); border-radius: 8px; font-weight: 700; }
.choice-grid label:has(input:checked) { color: #075f9f; background: #edf7ff; border-color: #6ca9d5; }
.choice-grid input { width: 18px; min-height: 18px; }
.entry-select-label { margin-bottom: 14px; color: #0874c9 !important; }
.event-entry-select { border-color: #7aaed3 !important; background: #f4f9fd !important; font-weight: 700 !important; }
.form-stack { display: grid; gap: 16px; }
.field-label { margin: 0 0 7px; color: #344258; font-size: 12px; font-weight: 700; }
.informing-choices { grid-template-columns: repeat(2,minmax(0,160px)); }
.file-field input { padding: 8px; background: #f5f8fc; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 2px 0 0; }
.form-actions .primary-action { border: 0; cursor: pointer; }
.hp-field { position: absolute !important; left: -10000px !important; }
.form-alert { padding: 14px; border-radius: 6px; }.form-alert.error { color: #8b1d2c; background: #fff1f2; border: 1px solid #f2bdc4; }
@media (max-width: 620px) { .app-form .protest-section { padding: 16px; }.app-form .protest-section > h2 { margin-bottom: 14px; font-size: 15px; }.form-grid { grid-template-columns: 1fr; gap: 12px; }.choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.choice-grid label { min-height: 46px; padding: 7px 8px; font-size: 11px; }.form-grid .full { grid-column: auto; }.form-actions { flex-direction: column-reverse; }.form-actions a,.form-actions button { justify-content: center; width: 100%; }.resource-heading { align-items: flex-start; } }

.map-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 11;
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-open-link {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 13px;
  color: #fff;
  background: #0b4e9b;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(7, 20, 46, 0.25);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.feature-grid {
  display: grid;
  gap: 10px;
}

.feature-grid article {
  padding: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 14px;
}

.support-list {
  display: grid;
  gap: 10px;
}

.support-list article {
  padding: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.support-list a {
  color: var(--brand);
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
}

.search-field {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.icon-action {
  display: inline-flex;
  width: 48px;
  min-width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.boat-buttons-wrapper {
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.boat-buttons-wrapper::-webkit-scrollbar {
  display: none;
}

.boat-buttons,
.form-buttons {
  display: flex;
  width: max-content;
  min-width: 100%;
  gap: 6px;
}

.boat-filter,
.form-filter {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.boat-filter.is-selected,
.form-filter.is-selected {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-bright));
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(0, 93, 255, 0.22);
}

.reset-chip {
  color: #7f1d1d;
  background: #fff5f4;
  border-color: #ffd4cf;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.text-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--brand);
  background: #edf5ff;
  border: 1px solid #c7dcff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.results-status {
  padding: 14px;
  color: var(--muted);
  background: var(--panel-strong);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.results-status[hidden] {
  display: none;
}

.event-card-list {
  display: grid;
  gap: 10px;
}

.load-more-row {
  display: grid;
  grid-column: 1 / -1;
  padding: 4px 0 2px;
}

.load-more-button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--brand);
  background: #edf5ff;
  border: 1px solid #c7dcff;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.load-more-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.event-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(8, 23, 51, 0.06);
}

.date-tile {
  display: grid;
  min-height: 68px;
  align-content: center;
  justify-items: center;
  padding: 6px 4px;
  color: #fff;
  background: linear-gradient(155deg, var(--brand-dark), var(--brand-mid) 58%, var(--brand));
  border-radius: 8px;
}

.date-tile strong {
  font-size: 22px;
  line-height: 1;
}

.date-tile span {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.date-tile small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.event-content {
  min-width: 0;
}

.event-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.event-title {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.event-title a {
  display: block;
}

.flag-emoji {
  display: inline-flex;
  min-width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: #f4f8ff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.flag-img {
  width: 24px;
  height: 18px;
  margin-top: 1px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.event-meta span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.event-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 10px;
}

.event-pills .pill {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  justify-content: center;
  overflow: hidden;
  padding-inline: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-pills .pill:nth-child(2) {
  flex: 1 1 auto;
  width: 0;
}

.pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  color: #23415f;
  background: #edf4fb;
  border: 1px solid #d8e4f1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.pill.class-pill {
  color: #0f5c62;
  background: #e8fbfb;
  border-color: #bdeeee;
}

.pill.ranking-pill {
  color: #674800;
  background: #fff8db;
  border-color: #f3dd8a;
}

.pill.live-pill {
  color: #8d2517;
  background: #fff0ed;
  border-color: #ffc9c1;
}

.pill.soon-pill {
  color: #084e75;
  background: #eaf7ff;
  border-color: #b7e2f7;
}

.event-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.event-weather {
  display: flex;
  min-height: 35px;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 7px 9px;
  color: #24415c;
  background: #f3f7fa;
  border-top: 1px solid #dce5ec;
  border-bottom: 1px solid #dce5ec;
  font-size: 11px;
}

.event-weather > i.weather-symbol {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #14708a;
  background: #fff;
  border: 1px solid #9ccdd8;
  border-radius: 50%;
  font-size: 14px;
  text-align: center;
}

.event-weather > span {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.event-weather strong {
  color: var(--ink);
  font-size: 12px;
}

.event-weather small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.event-weather-detail {
  display: grid;
  gap: 15px;
}

.weather-location {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.weather-days {
  display: grid;
  border-top: 1px solid var(--line);
}

.weather-day {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.weather-day-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.weather-day-heading > i.weather-symbol {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #14708a;
  background: #fff;
  border: 1px solid #9ccdd8;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #edf7fa;
  font-size: 16px;
}

.weather-day-heading span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.weather-day-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.weather-day-heading small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weather-day-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.weather-condition {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-condition > i.weather-symbol {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #14708a;
  background: #fff;
  border: 1.5px solid #86c3d1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #edf7fa;
  font-size: 19px;
}

.weather-condition span {
  display: grid;
  gap: 2px;
}

.weather-condition strong {
  color: var(--ink);
  font-size: 16px;
}

.weather-condition small {
  color: var(--muted);
  font-size: 12px;
}

.event-weather-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.event-weather-detail dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.event-weather-detail dl > div:nth-child(odd) {
  padding-right: 14px;
}

.event-weather-detail dl > div:nth-child(even) {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.event-weather-detail dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.event-weather-detail dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

@media (max-width: 520px) {
  .weather-day {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .weather-day-stats {
    padding-left: 46px;
    justify-content: flex-start;
  }

  .event-weather-detail dl {
    grid-template-columns: 1fr;
  }

  .event-weather-detail dl > div:nth-child(odd),
  .event-weather-detail dl > div:nth-child(even) {
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }
}

.event-actions a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.event-actions .primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-bright));
}

.event-actions .secondary {
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.filter-drawer.active {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 46, 0);
  transition: background 180ms ease;
}

.filter-drawer.active .drawer-backdrop {
  background: rgba(7, 20, 46, 0.46);
}

.drawer-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 86vh;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #fff;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -22px 52px rgba(8, 23, 51, 0.24);
  transform: translateY(105%);
  transition: transform 220ms ease;
}

.filter-drawer.active .drawer-panel {
  transform: translateY(0);
}

.drawer-header,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.filter-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.dropselect {
  display: grid;
  gap: 14px;
}

.dropselect .row,
.dropselect .input-field,
.dropselect .input-select {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.dropselect label {
  display: block;
}

.filter-form label,
.filter-form legend {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.filter-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-form .form-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.filter-form .form-filter {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: normal;
}

#event-buttons {
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
}

.filter-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drawer-actions {
  padding-top: 4px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  flex: 1;
  border-radius: 8px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-mid), var(--brand-bright));
  border: 1px solid var(--brand);
}

.primary-action[hidden],
.secondary-action[hidden] {
  display: none;
}

.uploader-shell {
  min-height: 100vh;
}

.uploader-main {
  width: 100%;
  margin: 0;
  padding: 0;
}

.uploader-hero h1 {
  max-width: 15ch;
}

.event-info-grid.uploader-form {
  grid-template-columns: minmax(0, 1fr);
}

.uploader-section {
  display: grid;
  gap: 14px;
}

.uploader-section {
  align-content: start;
}

.uploader-section-heading {
  display: block;
}

.uploader-section-heading h2,
.uploader-section-heading p {
  margin: 0;
}

.uploader-section-heading h2 {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0;
}

.uploader-section-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.uploader-field {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.uploader-account {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.uploader-account span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.uploader-account strong {
  color: var(--ink);
  font-size: 14px;
}

.uploader-account small {
  font-size: 11px;
}

.uploader-login {
  width: 100%;
  gap: 8px;
}

.uploader-field input,
.uploader-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c8d2;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}

.uploader-user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.uploader-user-row button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 14px;
  align-items: center;
  gap: 7px;
  color: #0b4f71;
  background: #edf7fa;
  border: 1px solid #b7dce5;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.uploader-event-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(180px, .55fr);
  align-items: end;
  gap: 8px;
}

#uploader-event {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#uploader-event option {
  font-size: 11px;
  white-space: nowrap;
}

.uploader-choice-divider {
  display: grid;
  height: 46px;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.uploader-selected-event {
  display: flex;
  min-height: 38px;
  padding: 8px 11px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  background: #f3f7fa;
  border-left: 3px solid #14708a;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.uploader-selected-event[hidden] {
  display: none;
}

.uploader-selected-event strong {
  color: var(--ink);
  font-size: 13px;
}

.uploader-file {
  display: flex;
  min-height: 88px;
  padding: 14px;
  align-items: center;
  gap: 13px;
  color: #0b4f71;
  background: #f6fafc;
  border: 1px dashed #80b8c8;
  border-radius: 7px;
}

.uploader-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.uploader-file > i {
  font-size: 27px;
}

.uploader-file span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.uploader-file strong {
  font-size: 13px;
}

.uploader-file em {
  width: max-content;
  padding: 3px 6px;
  color: #0b5c3a;
  background: #dff5e8;
  border-radius: 4px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.uploader-file em[hidden] {
  display: none;
}

.uploader-file.is-shared {
  color: #0b5c3a;
  background: #f1faf5;
  border-style: solid;
  border-color: #77bd91;
}

.uploader-file small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploader-submit,
.uploader-results-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.uploader-submit {
  border: 1px solid var(--brand);
}

.uploader-form > .uploader-submit,
.uploader-form > .uploader-status,
.uploader-form > .uploader-results-link {
  grid-column: 1 / -1;
}

.uploader-submit:disabled {
  opacity: .45;
}

.uploader-results-link {
  color: #fff;
  background: #14708a;
}

.uploader-results-link[hidden] {
  display: none;
}

.uploader-status {
  padding: 12px 13px;
  color: #24415c;
  background: #edf5f8;
  border-left: 3px solid #6baabd;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.uploader-status.is-error {
  color: #8b2424;
  background: #fff1f1;
  border-left-color: #c84a4a;
}

.uploader-status.is-success {
  color: #245c38;
  background: #edf8f1;
  border-left-color: #3f9a61;
}

.uploader-bottom-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.uploader-bottom-tabs a {
  font-size: 11px;
}

.uploader-bottom-tabs a:first-child {
  color: #9b2f2f;
}

.uploader-bottom-tabs a:last-child {
  color: var(--brand-mid);
}

@media (max-width: 760px) {
  .uploader-event-choice {
    margin-right: -10px;
    margin-left: -10px;
  }
}

@media (max-width: 520px) {
  .uploader-user-row {
    grid-template-columns: 1fr;
  }

  .uploader-user-row button {
    justify-content: center;
  }

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

  #uploader-event {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#uploader-event option {
  font-size: 11px;
  white-space: nowrap;
}

.uploader-choice-divider {
    height: 18px;
  }
}

.secondary-action {
  color: #7f1d1d;
  background: #fff5f4;
  border: 1px solid #ffd4cf;
}

.app-footer {
  margin-top: 10px;
  padding: 10px 0 calc(96px + env(safe-area-inset-bottom));
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.app-footer p {
  margin: 0;
}

.app-footer .app-footer-event-id {
  margin-bottom: 3px;
  color: #a3adbd;
  font-size: 10px;
}

.bottom-tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 28px rgba(8, 23, 51, 0.12);
  backdrop-filter: blur(18px);
  transition: transform 220ms ease, opacity 220ms ease;
}

.bottom-tabs a {
  display: grid;
  min-height: 48px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.bottom-tabs a.active {
  color: var(--brand);
  background: #edf5ff;
}

.sr-only-table {
  display: none !important;
}

.notification-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  padding: 14px 44px 14px 16px;
  color: #fff;
  background: var(--red);
  text-align: center;
}

#close-banner {
  position: absolute;
  top: 8px;
  right: 12px;
  color: #fff;
  background: transparent;
  border: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.exit-dialog,
.favourite-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.exit-dialog.active,
.favourite-dialog.active {
  opacity: 1;
  pointer-events: auto;
}

.exit-dialog-backdrop,
.favourite-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 46, 0.58);
}

.exit-dialog-panel,
.favourite-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 58px rgba(8, 23, 51, 0.28);
}

.exit-dialog-panel h2,
.favourite-dialog-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.exit-dialog-panel p,
.favourite-dialog-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.favourite-dialog-panel input {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  outline: none;
}

.favourite-dialog-panel input:focus {
  border-color: rgba(0, 93, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 93, 255, 0.12);
}

.exit-dialog-actions,
.favourite-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .app-topbar {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .top-actions {
    display: flex;
  }

  .results-hero {
    grid-template-columns: minmax(0, 1fr) 220px;
    min-height: 250px;
    align-items: end;
    padding: 30px;
  }

  .hero-brand-icon {
    right: 28px;
    bottom: 20px;
    width: 190px;
    height: 190px;
    opacity: 0.2;
  }

  .results-hero h1 {
    font-size: 48px;
  }

  .control-panel,
  .results-section {
    padding: 18px;
  }

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

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

  .event-info-main,
  .map-card {
    grid-column: 1 / -1;
  }

  .event-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid,
  .support-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-panel {
    top: 0;
    bottom: 0;
    left: auto;
    width: min(460px, 92vw);
    max-height: none;
    border-radius: 8px 0 0 8px;
    transform: translateX(105%);
  }

  .filter-drawer.active .drawer-panel {
    transform: translateX(0);
  }

  body.bottom-tabs-auto .bottom-tabs {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + env(safe-area-inset-bottom) + 8px));
  }

  body.bottom-tabs-auto.bottom-tabs-peek .bottom-tabs,
  body.bottom-tabs-auto .bottom-tabs:focus-within,
  body.bottom-tabs-auto .bottom-tabs:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}

@media (min-width: 980px) {
  .bottom-tabs {
    display: none;
  }

  .app-shell {
    padding-bottom: 0;
  }

  .app-footer {
    position: static;
    padding-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .event-card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .event-entry-row {
    grid-template-columns: auto minmax(0, 1fr);
    padding-right: 68px;
  }

  .entry-status {
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .results-hero h1 {
    font-size: 30px;
  }

  .event-card {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 10px;
  }

  .event-actions {
    flex-wrap: wrap;
  }

  .boat-buttons {
    gap: 5px;
  }

  .boat-filter {
    min-height: 34px;
    padding: 0 9px;
    font-size: 11px;
  }
}

/* Ask Wally */
.wally-page {
  background: #eef3f7;
}

.wally-shell {
  min-height: 100dvh;
}

.wally-main {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 14px 12px calc(104px + env(safe-area-inset-bottom));
}

.wally-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #dce5ed;
  padding: 8px 2px 14px;
}

.wally-header > img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid #d7e2ec;
  border-radius: 50%;
  background: #eaf2f8;
}

.wally-header p,
.wally-header h1 {
  margin: 0;
  letter-spacing: 0;
}

.wally-header p {
  color: #006bff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.wally-header h1 {
  margin-top: 2px;
  color: #14233a;
  font-size: 20px;
  line-height: 1.2;
}

.wally-icon-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d4dfe9;
  border-radius: 50%;
  color: #34445c;
  background: #ffffff;
  font-size: 17px;
  cursor: pointer;
}

.wally-conversation {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  gap: 18px;
  padding: 24px 0 18px;
}

.wally-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: min(680px, 92%);
  align-self: flex-start;
}

.wally-message > img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid #d8e2eb;
  border-radius: 50%;
  background: #eaf2f8;
}

.wally-message > div {
  border: 1px solid #dce5ed;
  border-radius: 6px;
  padding: 11px 13px;
  color: #26364c;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(18, 42, 67, 0.05);
}

.wally-message strong {
  display: block;
  margin-bottom: 4px;
  color: #14233a;
  font-size: 12px;
}

.wally-message p,
.wally-message-content {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
}

.wally-event-card {
  display: grid;
  gap: 3px;
  margin: 10px 0;
  border: 1px solid #cbd8e5;
  border-radius: 6px;
  padding: 11px 12px;
  color: #26364c;
  background: #ffffff;
  text-decoration: none;
}

.wally-event-card strong {
  margin: 0;
  font-size: 13px;
}

.wally-event-card > span {
  color: #5d6f83;
  font-size: 11px;
  line-height: 1.4;
}

.wally-event-card:active {
  background: #eaf3ff;
}

.wally-product-card {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.wally-product-card > img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid #dce5ee;
  border-radius: 5px;
  background: #fff;
}

.wally-product-details {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.wally-product-price {
  color: #005dff !important;
  font-size: 14px !important;
  font-weight: 800;
}

.wally-message-user {
  grid-template-columns: minmax(0, 1fr);
  align-self: flex-end;
  width: min(600px, 86%);
}

.wally-message-user > div {
  border-color: #c9dcf4;
  background: #eaf3ff;
}

.wally-message.is-pending p {
  color: #67758a;
}

.wally-message.is-pending p::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: #006bff;
  animation: wally-pulse 900ms ease-in-out infinite alternate;
}

.wally-message.is-error > div {
  border-color: #efc5c5;
  background: #fff6f6;
}

@keyframes wally-pulse {
  from { opacity: 0.25; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}

.wally-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px 44px;
}

.wally-prompts[hidden] {
  display: none;
}

.wally-prompts button {
  min-height: 42px;
  border: 1px solid #cddae6;
  border-radius: 6px;
  padding: 8px 10px;
  color: #25415e;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.wally-prompts button:active {
  background: #eaf3ff;
}

.wally-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  align-items: end;
  gap: 8px;
  border: 1px solid #cbd8e5;
  border-radius: 8px;
  padding: 7px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(13, 35, 70, 0.1);
}

.wally-composer textarea {
  width: 100%;
  min-height: 42px;
  max-height: 132px;
  resize: none;
  border: 0;
  padding: 10px 8px;
  color: #17283f;
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  outline: 0;
}

.wally-composer button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: #006bff;
  font-size: 15px;
  cursor: pointer;
}

.wally-composer button:disabled {
  background: #9aabc0;
  cursor: wait;
}

.wally-composer .wally-voice-button {
  border: 1px solid #c8d7e5;
  color: #24405f;
  background: #eef4f8;
}

.wally-composer .wally-voice-button.is-listening {
  border-color: #c92b3a;
  color: #ffffff;
  background: #c92b3a;
  animation: wally-mic-pulse 900ms ease-in-out infinite alternate;
}

@keyframes wally-mic-pulse {
  from { box-shadow: 0 0 0 0 rgba(201, 43, 58, 0.28); }
  to { box-shadow: 0 0 0 7px rgba(201, 43, 58, 0); }
}

.wally-note {
  margin: 7px 4px 0;
  color: #6b788a;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 540px) {
  .wally-main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .wally-prompts {
    grid-template-columns: 1fr;
    margin-left: 44px;
  }

  .wally-message {
    width: 96%;
  }

  .wally-message-user {
    width: 88%;
  }
}

.app-map-page .app-shell {
  min-height: 100dvh;
}

.app-map-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100dvh - 72px - var(--bottom-nav-height, 70px));
  padding: 12px;
}

.app-map-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 12px;
}

.app-map-heading a {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 40px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.app-map-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.app-map-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.app-map-canvas {
  min-height: 420px;
  overflow: hidden;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-map-canvas iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
}

/* Sailor performance */
.performance-controls,
.saved-sailors,
.performance-profile { margin-top: 14px; padding: 16px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(8,23,51,.08); }
.performance-chip-group { display: grid; gap: 4px; }
.performance-chip-group + .performance-chip-group { margin-top: 9px; }
.performance-chip-group > span { color: var(--ink); font-size: 12px; font-weight: 800; }
.performance-chip-group .boat-buttons-wrapper { margin-top: 0; }
.performance-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.performance-fields label { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.performance-fields input,.performance-fields select { width: 100%; min-width: 0; height: 44px; padding: 0 11px; border: 1px solid #b9c8d8; border-radius: 5px; color: var(--ink); background: #fff; font: inherit; font-size: 14px; }
.performance-fields input:focus,.performance-fields select:focus { outline: 3px solid rgba(0,107,255,.12); border-color: var(--brand); }
.performance-view-button,.performance-save { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 0 16px; border: 0; border-radius: 5px; color: #fff; background: var(--brand); font: inherit; font-weight: 800; }
.performance-view-button:disabled { opacity: .48; }
.performance-message { min-height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.saved-sailor-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.saved-sailor { display: grid; grid-template-columns: minmax(140px,1fr) 34px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.saved-sailor button { border: 0; background: transparent; }
.saved-sailor-open { display: grid; gap: 2px; padding: 9px 11px; color: var(--ink); text-align: left; }
.saved-sailor-open span { color: var(--muted); font-size: 11px; }
.saved-sailor-remove { color: #7c8998; font-size: 14px; }
.performance-profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.performance-profile-head h2 { margin: 2px 0 3px; color: var(--ink); font-size: 24px; }
.performance-profile-head p { margin: 0; color: var(--muted); font-size: 13px; }
.performance-save { margin: 0; color: var(--brand); background: #eaf3ff; white-space: nowrap; }
.performance-save.is-saved { color: #fff; background: var(--brand); }
.performance-metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.performance-metrics article { display: grid; min-height: 76px; place-content: center; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fc; }
.performance-metrics strong { color: var(--ink); font-size: 22px; }
.performance-metrics span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.performance-chart,.performance-history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 15px; }
.performance-chart h3,.performance-history h3 { margin: 0; color: var(--ink); font-size: 16px; }
.performance-chart > div > span { color: var(--muted); font-size: 11px; }
.performance-chart-scroll { overflow-x: auto; margin-top: 8px; }
.performance-chart svg { display: block; min-width: 100%; height: 130px; }
.performance-chart line { stroke: #dfe7f0; stroke-width: 1; }
.performance-chart polyline { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.performance-chart circle { fill: #fff; stroke: var(--brand); stroke-width: 3; }
.performance-history { display: grid; gap: 8px; }
.performance-history > a { display: grid; grid-template-columns: 46px minmax(0,1fr) 48px; align-items: center; gap: 10px; min-height: 58px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.performance-history a > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.performance-history a strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.performance-history small { color: var(--muted); font-size: 10px; }
.performance-place { display: grid; place-content: center; align-self: stretch; border-radius: 4px; color: #fff; background: var(--brand); font-size: 19px; font-weight: 800; text-align: center; }
.performance-place small { color: rgba(255,255,255,.78); font-size: 9px; }
.performance-event-score { display: grid; color: var(--ink); font-size: 15px; font-weight: 800; text-align: right; }
.performance-event-score small { text-transform: uppercase; }

@media (max-width: 760px) {
  .performance-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .performance-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 430px) {
  .performance-controls,.saved-sailors,.performance-profile { padding: 12px; }
  .performance-fields { grid-template-columns: 1fr; }
  .performance-profile-head { align-items: stretch; flex-direction: column; }
  .performance-save { align-self: flex-start; }
  .performance-history > a { grid-template-columns: 42px minmax(0,1fr) 42px; }
}

@media (min-width: 760px) {
  .app-map-main {
    min-height: calc(100dvh - 86px - var(--bottom-nav-height, 70px));
    padding: 18px 24px;
  }
}

/* Event fleet assignments */
.event-fleets { display: grid; gap: 16px; }
.event-fleet-set { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #f6f9fd; }
.event-fleet-set > header { display: flex; align-items: center; gap: 10px; padding: 11px 13px; color: #fff; background: #081f4d; }
.event-fleet-set > header span { padding: 4px 7px; border-radius: 4px; color: #081f4d; background: #b9f324; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.event-fleet-set > header h3 { margin: 0; color: inherit; font-size: 16px; }
.event-fleet-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; background: var(--line); }
.event-fleet { min-width: 0; background: #fff; }
.event-fleet h4 { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 9px 10px; color: #075ed1; background: #edf5ff; font-size: 12px; text-align: center; text-transform: uppercase; }
.event-fleet h4 small { padding: 3px 5px; border-radius: 999px; color: #17643a; background: #dff7e8; font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.event-fleet ol { margin: 0; padding: 0; list-style: none; }
.event-fleet li { display: grid; grid-template-columns: minmax(58px,auto) minmax(0,1fr); align-items: center; gap: 7px; min-height: 38px; padding: 6px 8px; border-top: 1px solid #e8eef5; }
.event-fleet.is-completed li { grid-template-columns: minmax(30px,auto) minmax(58px,auto) minmax(0,1fr); }
.event-fleet-finish { display: inline-grid; place-items: center; min-width: 27px; height: 27px; padding: 0 5px; border-radius: 5px; color: #fff; background: #075ed1; font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1; }
.event-fleet li strong { color: var(--ink); font-size: 11px; white-space: nowrap; }
.event-fleet li em { min-width: 0; overflow: hidden; color: var(--ink); font-size: 11px; font-style: normal; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.event-fleet-observers { border-top: 1px solid var(--line); background: #f3f6fa; }
.event-fleet-observers > strong { display: block; padding: 7px 8px 5px; color: #081f4d; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.event-fleet-observers > span { display: grid; grid-template-columns: minmax(58px,auto) minmax(0,1fr); align-items: center; gap: 7px; min-height: 32px; padding: 4px 8px; border-top: 1px solid #e3e9f1; }
.event-fleet-observers > span b { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #075ed1; font-size: 10px; white-space: nowrap; }
.event-fleet-observers > span b i { overflow: hidden; font-style: normal; text-overflow: ellipsis; }
.event-fleet-observers > span b small { flex: 0 0 auto; padding: 2px 4px; border-radius: 3px; color: #075ed1; background: #e5effc; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.event-fleet-observers > span em { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 5px; overflow: hidden; color: var(--ink); font-size: 10px; font-style: normal; font-weight: 600; white-space: nowrap; }
@media (max-width: 700px) {
  .event-fleet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .event-fleet li, .event-fleet-observers > span { padding-inline: 6px; }
  .event-fleet-observers > span { grid-template-columns: 1fr; gap: 2px; padding-block: 7px; }
  .event-fleet-observers > span em { display: grid; justify-content: start; gap: 3px; overflow: visible; white-space: normal; line-height: 1.2; }
}
@media (max-width: 370px) {
  .event-fleet-grid { grid-template-columns: 1fr; }
}

/* Contact details stay collapsed until the visitor chooses Show. */
.event-contact-reveal summary { display: inline-flex; cursor: pointer; list-style: none; padding: 3px 10px; border: 1px solid #cbd5e1; border-radius: 6px; color: #526477; background: transparent; font-size: 12px; font-weight: 500; line-height: 1.5; }
.event-contact-reveal summary::-webkit-details-marker { display: none; }
.event-contact-reveal summary:hover { background: #f1f5f9; color: #173f69; }
.event-contact-reveal summary:focus-visible { outline: 2px solid #3978ab; outline-offset: 3px; }
.event-contact-reveal .contact-hide, .event-contact-reveal[open] .contact-show { display: none; }
.event-contact-reveal[open] .contact-hide { display: inline; }
.event-contact-reveal > a { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.map-card .venue-address { margin: 14px 0 0; color: var(--text, #24384b); font-size: 14px; line-height: 1.65; white-space: pre-line; }
