:root {
  --mgp-ink: #332a23;
  --mgp-ink-soft: #63564a;
  --mgp-bg: #f7f2eb;
  --mgp-panel: rgba(255,255,255,.88);
  --mgp-panel-solid: #fff;
  --mgp-line: rgba(102, 78, 58, .17);
  --mgp-shadow: 0 24px 70px rgba(67, 49, 35, .12);
  --mgp-accent: #8a633f;
  --mgp-accent-deep: #6c482a;
  --mgp-gold: #c9a267;
  --mgp-green: #4f9e63;
  --mgp-green-track: #e5f1e6;
  --mgp-danger: #a55245;
  --mgp-soft: #efe4d4;
  --mgp-soft-2: #fbf7f1;
}

.mgp-page {
  background:
    radial-gradient(circle at top right, rgba(197, 160, 104, .14), transparent 30%),
    radial-gradient(circle at top left, rgba(138, 99, 63, .12), transparent 24%),
    var(--mgp-bg);
  color: var(--mgp-ink);
}

.mgp-page .brand {
  color: inherit;
  text-decoration: none;
}

.mgp-hero {
  padding: 58px 0 34px;
}

.mgp-hero-grid,
.mgp-workbench,
.mgp-explainer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 28px;
  align-items: stretch;
}

.mgp-hero-copy,
.mgp-hero-panel,
.mgp-app-shell,
.mgp-setup-card,
.mgp-grid-lab,
.mgp-result-shell,
.mgp-rule-card {
  border: 1px solid var(--mgp-line);
  box-shadow: var(--mgp-shadow);
}

.mgp-hero-copy {
  padding: 34px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,255,255,.78));
}

.mgp-hero-copy h1 {
  margin: 10px 0 18px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -.03em;
}

.mgp-lead {
  font-size: 18px;
  line-height: 1.7;
  margin: 0;
}

.mgp-seo-details {
  margin-top: 18px;
  border: 1px solid var(--mgp-line);
  border-radius: 22px;
  background: rgba(255,255,255,.75);
  overflow: hidden;
}

.mgp-seo-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 0 18px;
  font-weight: 800;
  color: var(--mgp-ink);
}

.mgp-seo-details summary::-webkit-details-marker { display: none; }
.mgp-seo-summary-open { display: none; }
.mgp-seo-details[open] .mgp-seo-summary-open { display: inline; }
.mgp-seo-details[open] .mgp-seo-summary-closed { display: none; }
.mgp-seo-summary-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--mgp-soft);
  transition: transform .18s ease;
}
.mgp-seo-details[open] .mgp-seo-summary-arrow { transform: rotate(180deg); }
.mgp-seo-details-body { padding: 0 18px 18px; }
.mgp-seo-details-body p { line-height: 1.8; }

.mgp-hero-badges { display:none; }

.mgp-grid-chip,
.mgp-card-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--mgp-line);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

.mgp-hero-panel {
  padding: 28px;
  border-radius: 30px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.95), rgba(240, 226, 209, .90));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mgp-hero-signal,
.mgp-app-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--mgp-line);
  font-weight: 800;
}

.mgp-live-dot,
.mgp-status-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7daf68;
  box-shadow: 0 0 0 7px rgba(125, 175, 104, .14);
}

.mgp-track-visual {
  position: relative;
  height: 280px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.15), transparent 28%), linear-gradient(180deg, #f0e3ce 0%, #ead6ba 38%, #c7ab8d 39%, #816956 100%);
  border: 1px solid rgba(104, 78, 55, .16);
  margin: 18px 0;
}
.mgp-track-visual-image {
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:2;
}
.mgp-track-fallback { position:absolute; inset:0; z-index:1; }
.mgp-track-visual-image:not([src]), .mgp-track-visual-image[src=] { display:none; }

.mgp-track-apex {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(128deg, transparent 0 34%, rgba(255,255,255,.35) 34% 34.9%, transparent 34.9%),
    linear-gradient(52deg, transparent 0 42%, rgba(255,255,255,.24) 42% 42.9%, transparent 42.9%);
  opacity: .85;
}

.mgp-track-road {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -28px;
  height: 190px;
  border-radius: 50% 50% 0 0;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255,255,255,.55) 47% 53%, transparent 53%),
    #715c4a;
  transform: perspective(260px) rotateX(36deg);
}

.mgp-bike-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--mgp-accent);
  border: 4px solid rgba(255,255,255,.92);
  box-shadow: 0 12px 24px rgba(48, 34, 23, .22);
  animation: mgpRide 4.6s ease-in-out infinite;
}
.mgp-bike-dot-a { left: 18%; bottom: 50px; animation-delay: .1s; }
.mgp-bike-dot-b { left: 38%; bottom: 88px; animation-delay: .45s; }
.mgp-bike-dot-c { right: 28%; bottom: 64px; animation-delay: .8s; }
.mgp-bike-dot-d { right: 12%; bottom: 42px; animation-delay: 1.1s; }

@keyframes mgpRide {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.mgp-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mgp-hero-stats div {
  padding: 18px 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--mgp-line);
  text-align: center;
}
.mgp-hero-stats strong { display: block; font-size: 26px; }
.mgp-hero-stats span { display: block; margin-top: 4px; color: var(--mgp-ink-soft); font-weight: 700; font-size: 13px; }

.mgp-app-shell {
  padding: 30px;
  border-radius: 34px;
  background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(255,255,255,.82));
}

.mgp-app-head,
.mgp-grid-head,
.mgp-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.mgp-app-head h2,
.mgp-explainer-copy h2 {
  margin: 10px 0 10px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.1;
}

.mgp-app-status.is-error {
  color: var(--mgp-danger);
}
.mgp-app-status.is-error .mgp-status-orb {
  background: var(--mgp-danger);
  box-shadow: 0 0 0 7px rgba(165, 82, 69, .15);
}

.mgp-workbench {
  margin-top: 26px;
  grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr);
}

.mgp-setup-card,
.mgp-grid-lab,
.mgp-result-shell {
  padding: 24px;
  border-radius: 28px;
  background: var(--mgp-panel);
}

.mgp-card-kicker {
  min-height: 34px;
  padding: 7px 12px;
  background: var(--mgp-soft);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
}

.mgp-setup-card h3,
.mgp-grid-lab h3,
.mgp-result-shell h3 {
  margin: 14px 0 10px;
  font-size: 28px;
  line-height: 1.2;
}

.mgp-setup-card p,
.mgp-grid-lab p,
.mgp-result-note,
.mgp-explainer-copy p,
.mgp-rule-card p,
.mgp-rider-panel p {
  color: var(--mgp-ink-soft);
  line-height: 1.7;
}

.mgp-form-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.mgp-field {
  display: grid;
  gap: 8px;
}
.mgp-field span,
.mgp-race-type legend,
.mgp-rider-control label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.mgp-field small {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--mgp-ink-soft);
}

.mgp-field select,
.mgp-rider-control select {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(99, 78, 57, .22);
  background: #fff;
  padding: 0 16px;
  color: var(--mgp-ink);
  font-weight: 700;
}

.mgp-race-type {
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(99, 78, 57, .18);
  display: grid;
  gap: 12px;
  background: rgba(255,255,255,.72);
}
.mgp-race-type label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}
.mgp-race-type input {
  width: 18px;
  height: 18px;
  accent-color: var(--mgp-accent);
}
.mgp-race-type label:has(input:checked) {
  border-color: rgba(138, 99, 63, .42);
  background: #fff5e9;
}

.mgp-context-preview,
.mgp-storage-note,
.mgp-grid-chip,
.mgp-result-note {
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--mgp-line);
}

.mgp-context-preview {
  margin-top: 18px;
  padding: 16px;
  display: grid;
  gap: 6px;
}
.mgp-context-preview strong { font-size: 16px; }
.mgp-context-preview span { color: var(--mgp-ink-soft); line-height: 1.6; }

.mgp-button-row,
.mgp-grid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.mgp-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 15px;
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.mgp-button:hover { transform: translateY(-1px); }
.mgp-button:disabled { opacity: .6; cursor: wait; transform: none; }
.mgp-button-primary {
  background: linear-gradient(135deg, var(--mgp-accent), var(--mgp-accent-deep));
  color: #fff;
  box-shadow: 0 18px 30px rgba(108, 72, 42, .18);
}
.mgp-button-secondary {
  background: #fff;
  color: var(--mgp-ink);
  border: 1px solid rgba(99, 78, 57, .24);
}
.mgp-button-ghost {
  background: var(--mgp-soft-2);
  color: var(--mgp-ink);
  border: 1px solid rgba(99, 78, 57, .16);
}

.mgp-storage-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  font-size: 14px;
}

.mgp-grid-head {
  margin-bottom: 20px;
}
.mgp-grid-chip {
  min-width: 170px;
  justify-content: center;
  color: var(--mgp-ink-soft);
}

.mgp-grid-shell {
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.85), rgba(246, 236, 224, .95));
  border: 1px solid var(--mgp-line);
}

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

.mgp-grid-slot {
  position: relative;
  min-height: 108px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(99, 78, 57, .18);
  background: rgba(255,255,255,.94);
  display: grid;
  gap: 10px;
  cursor: grab;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease;
}
.mgp-grid-slot:nth-child(3n+2) { transform: translateY(10px); }
.mgp-grid-slot:hover,
.mgp-grid-slot.is-selected,
.mgp-grid-slot.is-drop-target {
  border-color: rgba(138, 99, 63, .46);
  box-shadow: 0 16px 28px rgba(73, 53, 37, .12);
}
.mgp-grid-slot.is-selected { background: #fff6ea; }
.mgp-grid-slot.is-source-gap { opacity: .40; }
.mgp-grid-slot.is-preview-swap {
  transform: translate(var(--swap-x, 0), var(--swap-y, 0));
  z-index: 3;
}
.mgp-grid-slot.is-withdrawn {
  opacity: .62;
  filter: grayscale(.65);
}
.mgp-grid-slot.is-mobile-swap-source {
  outline: 3px solid rgba(138, 99, 63, .22);
  outline-offset: 2px;
}

.mgp-grid-position {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--mgp-soft);
  font-weight: 900;
  line-height: 1;
}

.mgp-grid-rider {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-right: 42px;
}

.mgp-avatar,
.mgp-result-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ede1d2, #fff);
  color: var(--mgp-accent-deep);
  border: 1px solid rgba(99, 78, 57, .18);
  font-weight: 900;
  letter-spacing: .02em;
}

.mgp-grid-rider strong,
.mgp-podium-card strong,
.mgp-top5-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}
.mgp-grid-rider span,
.mgp-grid-meta span,
.mgp-podium-card span,
.mgp-top5-card span {
  display: block;
  color: var(--mgp-ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.mgp-grid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mgp-grid-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--mgp-soft-2);
  border: 1px solid rgba(99, 78, 57, .13);
  font-size: 12px;
  font-weight: 800;
}

.mgp-grid-qualifying {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mgp-mini-track,
.mgp-score-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--mgp-green-track);
  overflow: hidden;
}
.mgp-mini-fill,
.mgp-score-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ec38b, var(--mgp-green));
  transition: width .55s ease;
}
.mgp-grid-qualifying em {
  font-style: normal;
  font-weight: 900;
  color: var(--mgp-ink-soft);
  min-width: 44px;
  text-align: right;
}

.mgp-rider-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  border: 1px solid var(--mgp-line);
}

.mgp-rider-panel-empty strong,
.mgp-rider-panel h4 {
  display: block;
  margin: 0 0 8px;
  font-size: 18px;
}

.mgp-rider-panel-layout {
  display: grid;
  gap: 16px;
}
.mgp-rider-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mgp-rider-panel-head small {
  display: block;
  color: var(--mgp-ink-soft);
  margin-top: 4px;
}
.mgp-rider-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.mgp-rider-control {
  display: grid;
  gap: 8px;
}

.mgp-result-shell {
  margin-top: 28px;
}

.mgp-output-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--mgp-line);
}

.mgp-empty-state,
.mgp-loading-state,
.mgp-error-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}
.mgp-empty-state span,
.mgp-error-state span { font-size: 38px; }
.mgp-empty-state strong,
.mgp-error-state strong { font-size: 24px; }

.mgp-result {
  display: grid;
  gap: 22px;
}

.mgp-result-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(239, 228, 212, .92), rgba(255,255,255,.96));
  border: 1px solid var(--mgp-line);
}
.mgp-result-banner h4 {
  margin: 8px 0 8px;
  font-size: 30px;
}
.mgp-result-banner p { margin: 0; color: var(--mgp-ink-soft); }
.mgp-result-verdict {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--mgp-line);
  font-weight: 900;
}

.mgp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.mgp-metric {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--mgp-line);
}
.mgp-metric strong { display: block; font-size: 28px; }
.mgp-metric span { display: block; margin-top: 4px; color: var(--mgp-ink-soft); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.mgp-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr);
  gap: 18px;
}

.mgp-section-title {
  margin: 0 0 14px;
  font-size: 19px;
}

.mgp-podium-list,
.mgp-top5-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.mgp-podium-card,
.mgp-top5-card,
.mgp-constructor-card,
.mgp-reason-box {
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--mgp-line);
  padding: 16px;
}

.mgp-podium-card {
  display: grid;
  grid-template-columns: 46px 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.mgp-podium-rank,
.mgp-top5-rank {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--mgp-soft);
  font-weight: 900;
  line-height: 1;
}

.mgp-score-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.mgp-score-number {
  font-weight: 900;
  color: var(--mgp-ink-soft);
}

.mgp-side-stack {
  display: grid;
  gap: 16px;
}

.mgp-top5-card {
  display: grid;
  gap: 10px;
}
.mgp-top5-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mgp-constructor-card strong,
.mgp-reason-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.mgp-reason-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--mgp-ink-soft);
  line-height: 1.8;
}

.mgp-loading-state {
  position: relative;
  overflow: hidden;
}
.mgp-loading-disc {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 7px solid rgba(138,99,63,.16);
  border-top-color: var(--mgp-accent);
  animation: mgpSpin 1s linear infinite;
}
@keyframes mgpSpin { to { transform: rotate(360deg); } }

.mgp-explainer-grid {
  align-items: start;
}
.mgp-explainer-copy,
.mgp-rule-card {
  padding: 28px;
  border-radius: 30px;
  background: rgba(255,255,255,.92);
}
.mgp-rule-cards {
  display: grid;
  gap: 16px;
}
.mgp-rule-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

@media (max-width: 1080px) {
  .mgp-hero-grid,
  .mgp-workbench,
  .mgp-explainer-grid,
  .mgp-results-grid {
    grid-template-columns: 1fr;
  }
  .mgp-start-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mgp-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mgp-hero { padding-top: 28px; }
  .mgp-hero-copy,
  .mgp-hero-panel,
  .mgp-app-shell,
  .mgp-setup-card,
  .mgp-grid-lab,
  .mgp-result-shell,
  .mgp-explainer-copy {
    padding: 18px;
    border-radius: 24px;
  }
  .mgp-app-head,
  .mgp-grid-head,
  .mgp-result-head,
  .mgp-result-banner {
    flex-direction: column;
  }
  .mgp-start-grid,
  .mgp-rider-controls,
  .mgp-metrics {
    grid-template-columns: 1fr;
  }
  .mgp-grid-slot:nth-child(3n+2) { transform: none; }
  .mgp-grid-rider { grid-template-columns: 48px minmax(0, 1fr); }
  .mgp-avatar,
  .mgp-result-avatar { width: 48px; height: 48px; }
  .mgp-podium-card { grid-template-columns: 42px 48px minmax(0, 1fr); }
  .mgp-podium-rank,
  .mgp-top5-rank { width: 42px; height: 42px; }
  .mgp-button,
  .mgp-button-row .mgp-button,
  .mgp-grid-actions .mgp-button { width: 100%; }
  .mgp-hero-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}


.mgp-grid-lab {
  display:flex;
  flex-direction:column;
}
.mgp-grid-head { order:1; }
.mgp-grid-actions { order:2; margin-top: 0; margin-bottom: 16px; position: sticky; top: 12px; z-index: 5; background: linear-gradient(180deg, rgba(247,242,235,.96), rgba(247,242,235,.75)); padding-bottom: 6px; }
.mgp-rider-panel { order:3; margin-top: 0; margin-bottom: 16px; position: sticky; top: 82px; z-index:4; }
.mgp-grid-shell { order:4; }

.mgp-start-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mgp-grid-slot {
  min-height: 150px;
  padding: 14px;
  gap: 10px;
}
.mgp-grid-slot:nth-child(3n+2) { transform: none; }
.mgp-grid-slot.is-source-gap {
  opacity: 1;
  background: rgba(255,255,255,.55);
  border-style: dashed;
  border-color: rgba(138,99,63,.42);
}
.mgp-grid-slot.is-source-gap > * { opacity: 0; }
.mgp-grid-slot.is-source-gap::after {
  content: 'Drop here';
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color: var(--mgp-ink-soft); font-weight:800; letter-spacing:.03em;
}
.mgp-grid-slot-head {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.mgp-grid-number,
.mgp-grid-position {
  position: static;
  width:auto; height:auto; min-height: 28px; padding: 0 10px; border-radius: 999px;
  display:inline-flex; align-items:center; justify-content:center; line-height:1; font-size: 12px; font-weight:900;
}
.mgp-grid-number { background: rgba(239,228,212,.72); border:1px solid rgba(99, 78, 57, .14); color: var(--mgp-accent-deep); }
.mgp-grid-position { background: var(--mgp-soft); }
.mgp-grid-rider {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding-right: 0;
}
.mgp-grid-rider-copy { min-width:0; }
.mgp-avatar,
.mgp-result-avatar { width: 44px; height: 44px; font-size: 14px; }
.mgp-grid-rider strong { font-size: 15px; line-height:1.2; }
.mgp-grid-subline {
  display:block;
  margin-top: 4px;
  color: var(--mgp-ink-soft);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mgp-grid-meta { display:none; }
.mgp-grid-qualifying { margin-top:auto; }
.mgp-grid-qualifying em { min-width: 40px; }

.mgp-rider-panel-layout { gap: 14px; }
.mgp-rider-panel-avatar-wrap { display:flex; align-items:center; gap:10px; }
.mgp-rider-panel-number { font-weight:900; color: var(--mgp-accent-deep); }

.mgp-grid-loader-note {
  margin-bottom: 14px;
  font-weight: 800;
  color: var(--mgp-ink-soft);
}
.mgp-grid-skeletons {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mgp-grid-skeleton {
  min-height:150px;
  border-radius: 22px;
  padding:14px;
  border:1px solid var(--mgp-line);
  background: rgba(255,255,255,.82);
  display:grid;
  align-content:start;
  gap:10px;
}
.mgp-grid-skeleton-avatar,
.mgp-grid-skeleton-line,
.mgp-grid-skeleton-bar {
  position:relative; overflow:hidden; background: #efe8dd; border-radius:999px;
}
.mgp-grid-skeleton-avatar { width:44px; height:44px; border-radius:50%; }
.mgp-grid-skeleton-line-1 { width:72%; height:14px; }
.mgp-grid-skeleton-line-2 { width:92%; height:12px; }
.mgp-grid-skeleton-bar { width:100%; height:10px; margin-top:auto; }
.mgp-grid-skeleton-avatar::after,
.mgp-grid-skeleton-line::after,
.mgp-grid-skeleton-bar::after {
  content:''; position:absolute; inset:0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: mgpShimmer 1.1s infinite;
}
@keyframes mgpShimmer { to { transform: translateX(100%); } }

@media (max-width: 1180px) {
  .mgp-start-grid,
  .mgp-grid-skeletons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mgp-grid-actions,
  .mgp-rider-panel { position: static; }
}
@media (max-width: 820px) {
  .mgp-start-grid,
  .mgp-grid-skeletons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .mgp-start-grid,
  .mgp-grid-skeletons { grid-template-columns: 1fr; }
  .mgp-grid-slot,
  .mgp-grid-skeleton { min-height: 132px; }
}

/* === v3 layout + assets patch === */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.mgp-page,
.mgp-page * {
  box-sizing: border-box;
}

.mgp-page .container,
.mgp-workbench,
.mgp-setup-card,
.mgp-grid-lab,
.mgp-result-shell,
.mgp-form-grid,
.mgp-field,
.mgp-race-type,
.mgp-context-visuals,
.mgp-grid-shell,
.mgp-grid-frame,
.mgp-start-grid,
.mgp-rider-panel,
.mgp-grid-actions {
  min-width: 0;
}

.mgp-app-shell > .app-poster-showcase,
.mgp-app-shell > .poster-showcase,
.mgp-app-shell > [class*="poster-showcase"] {
  margin-top: 26px;
}

.mgp-app-head {
  align-items: flex-start;
}

.mgp-app-status,
.mgp-grid-chip {
  inline-size: 250px;
  min-inline-size: 250px;
  max-inline-size: 250px;
  min-height: 76px;
  flex: 0 0 250px;
  justify-content: flex-start;
  padding: 14px 18px;
  line-height: 1.35;
}

.mgp-grid-chip {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  color: var(--mgp-ink);
  white-space: normal;
}

.mgp-context-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.mgp-context-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--mgp-line);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,234,221,.96));
}

.mgp-context-card-media {
  position: relative;
  height: 114px;
  background: linear-gradient(180deg, #efe4d4 0%, #f7efe5 100%);
}

.mgp-context-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mgp-context-card.is-fallback .mgp-context-card-media img,
.mgp-asset.is-fallback img,
.mgp-brand-badge.is-fallback img,
.mgp-rider-avatar.is-fallback img {
  display: none;
}

.mgp-context-card-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  color: var(--mgp-accent-deep);
  background:
    radial-gradient(circle at 20% 22%, rgba(255,255,255,.72), transparent 24%),
    radial-gradient(circle at 82% 30%, rgba(255,255,255,.58), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.28), transparent 40%),
    linear-gradient(135deg, rgba(194, 160, 122, .28), rgba(248, 240, 229, .9));
  font-weight: 900;
  letter-spacing: .02em;
}

.mgp-context-card.is-fallback .mgp-context-card-fallback {
  display: flex;
}

.mgp-context-card-copy {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.mgp-context-card-copy span {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--mgp-ink-soft);
  font-weight: 900;
}

.mgp-context-card-copy strong {
  font-size: 16px;
  line-height: 1.25;
}

.mgp-context-card-copy small {
  color: var(--mgp-ink-soft);
  line-height: 1.45;
}

.mgp-grid-shell {
  position: relative;
  overflow: hidden;
  padding: 14px;
}

.mgp-grid-frame {
  position: relative;
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 16px 16px 28px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(244,233,221,.94));
  scrollbar-width: thin;
}

.mgp-grid-frame::-webkit-scrollbar {
  width: 10px;
}

.mgp-grid-frame::-webkit-scrollbar-thumb {
  background: rgba(138, 99, 63, .24);
  border-radius: 999px;
}

.mgp-grid-startline {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, #2d241f 0 14px, #fff 14px 28px);
  box-shadow: inset 0 0 0 1px rgba(99, 78, 57, .16);
}

.mgp-grid-scroll-rail {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.mgp-grid-scroll-btn {
  appearance: none;
  border: 1px solid rgba(99, 78, 57, .18);
  background: rgba(255,255,255,.9);
  color: var(--mgp-ink);
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.mgp-grid-scroll-btn:disabled {
  opacity: .42;
  cursor: default;
}

.mgp-start-grid,
.mgp-grid-skeletons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mgp-grid-slot,
.mgp-grid-skeleton {
  position: relative;
  min-height: 128px;
  padding: 12px 12px 10px;
  gap: 8px;
  overflow: hidden;
}

.mgp-grid-slot::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 54px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(138,99,63,.18), rgba(138,99,63,.04));
}

.mgp-grid-slot::after {
  content: attr(data-grid-row);
  position: absolute;
  left: 8px;
  top: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  color: rgba(108, 72, 42, .52);
}

.mgp-grid-slot-head {
  position: relative;
  z-index: 1;
}

.mgp-grid-number,
.mgp-grid-position {
  min-height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.mgp-grid-rider {
  position: relative;
  z-index: 1;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.mgp-rider-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(99, 78, 57, .18);
  background: linear-gradient(145deg, #ede1d2, #fff);
}

.mgp-rider-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mgp-rider-avatar-fallback,
.mgp-brand-badge-fallback,
.mgp-asset-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--mgp-accent-deep);
}

.mgp-grid-rider strong {
  font-size: 14px;
  line-height: 1.15;
}

.mgp-grid-subline {
  margin-top: 2px;
  -webkit-line-clamp: 2;
}

.mgp-grid-machine-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.mgp-brand-badge {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  border: 1px solid rgba(99, 78, 57, .14);
  background: #fff;
  overflow: hidden;
}

.mgp-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 3px 5px;
}

.mgp-grid-team-line {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--mgp-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mgp-grid-status-line {
  min-height: 16px;
  font-size: 11px;
  color: var(--mgp-accent-deep);
  font-weight: 800;
}

.mgp-grid-qualifying {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.mgp-grid-slot.is-source-gap {
  opacity: 1;
  border-style: dashed;
  border-color: rgba(138,99,63,.42);
  background: rgba(255,255,255,.48);
}

.mgp-grid-slot.is-source-gap::before,
.mgp-grid-slot.is-source-gap::after,
.mgp-grid-slot.is-source-gap > * {
  opacity: 0;
}

.mgp-grid-slot.is-source-gap .mgp-grid-gap-label {
  opacity: 1;
}

.mgp-grid-gap-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--mgp-ink-soft);
  letter-spacing: .04em;
  opacity: 0;
}

.mgp-grid-slot.is-drop-target {
  border-color: rgba(138, 99, 63, .46);
  box-shadow: 0 18px 32px rgba(73,53,37,.14);
}

.mgp-grid-loader-note {
  margin-bottom: 10px;
}

.mgp-rider-panel {
  position: sticky;
  top: 82px;
  z-index: 4;
}

.mgp-rider-panel-head {
  align-items: flex-start;
}

.mgp-rider-panel-machine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.mgp-rider-panel-machine .mgp-brand-badge {
  width: 54px;
  height: 28px;
  flex-basis: 54px;
}

.mgp-rider-panel-machine small {
  margin: 0;
}

.mgp-output-card {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .mgp-app-status,
  .mgp-grid-chip {
    inline-size: 230px;
    min-inline-size: 230px;
    max-inline-size: 230px;
    flex-basis: 230px;
  }

  .mgp-start-grid,
  .mgp-grid-skeletons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .mgp-grid-actions,
  .mgp-rider-panel {
    position: static;
  }

  .mgp-context-visuals {
    grid-template-columns: 1fr 1fr;
  }

  .mgp-grid-frame {
    max-height: 520px;
  }
}

@media (max-width: 760px) {
  .mgp-app-status,
  .mgp-grid-chip {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    flex-basis: auto;
    min-height: 64px;
  }

  .mgp-context-visuals {
    grid-template-columns: 1fr;
  }

  .mgp-grid-frame {
    max-height: 480px;
    padding-left: 18px;
    padding-right: 12px;
  }

  .mgp-start-grid,
  .mgp-grid-skeletons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mgp-grid-shell {
    padding: 10px;
  }
}

@media (max-width: 520px) {
  .mgp-start-grid,
  .mgp-grid-skeletons {
    grid-template-columns: 1fr;
  }

  .mgp-grid-slot,
  .mgp-grid-skeleton {
    min-height: 118px;
  }
}

/* ===== v4 layout corrections ===== */
.mgp-app-head { align-items: flex-start; gap: 24px; }
.mgp-app-status,
.mgp-grid-chip {
  inline-size: 290px;
  min-inline-size: 290px;
  max-inline-size: 290px;
  min-height: 74px;
  flex: 0 0 290px;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  line-height: 1.35;
}

.mgp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.mgp-field-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.mgp-field-group.mgp-field-wide { grid-column: 1 / -1; }

.mgp-inline-visual {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  min-height: 118px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(99, 78, 57, .14);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,234,221,.96));
}

.mgp-inline-visual.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: mgp-shimmer 1.2s linear infinite;
}

@keyframes mgp-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.mgp-inline-visual-media {
  position: relative;
  min-height: 118px;
  background: linear-gradient(135deg, #efe4d4, #f8f1e8);
}

.mgp-inline-visual-media img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}

.mgp-inline-visual-fallback,
.mgp-rider-avatar-fallback,
.mgp-brand-badge-fallback,
.mgp-asset-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 900;
  color: #8b5c29;
  padding: 10px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.65), transparent 24%), linear-gradient(135deg, rgba(193,160,122,.25), rgba(248,240,229,.92));
}

.mgp-inline-visual.is-fallback .mgp-inline-visual-media img,
.mgp-rider-avatar.is-fallback img,
.mgp-brand-badge.is-fallback img,
.mgp-effect-icon.is-fallback img,
.mgp-result-avatar.is-fallback img {
  display: none;
}

.mgp-inline-visual.is-fallback .mgp-inline-visual-fallback,
.mgp-rider-avatar.is-fallback .mgp-rider-avatar-fallback,
.mgp-brand-badge.is-fallback .mgp-brand-badge-fallback,
.mgp-effect-icon.is-fallback .mgp-asset-fallback,
.mgp-result-avatar.is-fallback .mgp-rider-avatar-fallback { display: flex; }

.mgp-inline-visual-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  min-width: 0;
}

.mgp-inline-visual-copy span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .13em; color: var(--mgp-ink-soft); font-weight: 900;
}
.mgp-inline-visual-copy strong { font-size: 20px; line-height: 1.2; }
.mgp-inline-visual-copy small { color: var(--mgp-ink-soft); line-height: 1.42; }

.mgp-grid-shell { padding: 14px 0 0; }
.mgp-grid-frame {
  max-height: 720px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 6px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(244,233,221,.95));
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mgp-grid-frame::-webkit-scrollbar { display: none; }

.mgp-grid-scroll-btn {
  appearance: none;
  border: 1px solid rgba(99, 78, 57, .18);
  background: #fff;
  color: var(--mgp-ink);
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(63, 44, 28, .08);
}
.mgp-grid-scroll-btn-top, .mgp-grid-scroll-btn-bottom { display: block; margin: 0 auto 14px; }
.mgp-grid-scroll-btn-bottom { margin: 14px auto 0; }
.mgp-grid-scroll-btn:disabled { opacity: .45; cursor: default; }

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

.mgp-grid-row {
  display: grid;
  gap: 10px;
}
.mgp-grid-row-marker {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mgp-grid-row-label {
  font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; color: rgba(108,72,42,.72);
}
.mgp-grid-row-line {
  display: block; height: 8px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(190,170,146,.45), rgba(190,170,146,.45));
  box-shadow: inset 0 0 0 1px rgba(99,78,57,.08);
}
.mgp-grid-row-line.is-startline {
  background: repeating-linear-gradient(90deg, #2d241f 0 14px, #fff 14px 28px);
}
.mgp-grid-row-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mgp-grid-slot {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 186px;
  padding: 10px 10px 12px;
  border-radius: 22px;
  border: 1px solid rgba(99, 78, 57, .16);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(250,245,239,.96));
  box-shadow: 0 10px 24px rgba(63, 44, 28, .04);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  overflow: hidden;
}
.mgp-grid-slot:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(63,44,28,.08); }
.mgp-grid-slot.is-preview-swap { transform: translate(var(--swap-x), var(--swap-y)); z-index: 3; }
.mgp-grid-slot.is-source-gap {
  border-style: dashed;
  border-color: rgba(138,99,63,.42);
  background: rgba(255,255,255,.55);
}
.mgp-grid-slot.is-source-gap > * { opacity: 0; }
.mgp-grid-slot.is-source-gap .mgp-grid-gap-label { opacity: 1; }
.mgp-grid-gap-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--mgp-ink-soft); letter-spacing: .04em; opacity: 0;
}
.mgp-grid-slot.is-drop-target { border-color: rgba(138,99,63,.48); box-shadow: 0 18px 34px rgba(63,44,28,.16); }

.mgp-grid-slot-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.mgp-grid-number,
.mgp-grid-position {
  min-height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 999px; background: rgba(237,226,208,.92); border: 1px solid rgba(99,78,57,.12); font-size: 12px; font-weight: 900;
}
.mgp-grid-rider-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center;
}
.mgp-rider-avatar,
.mgp-result-avatar {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(99,78,57,.18); background: linear-gradient(145deg, #ede1d2, #fff); flex: 0 0 44px;
}
.mgp-rider-avatar img,
.mgp-result-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mgp-grid-rider-copy { min-width: 0; }
.mgp-grid-rider-copy strong {
  display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mgp-grid-team-inline {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; align-items: center; margin-top: 6px;
}
.mgp-brand-badge {
  position: relative; width: 42px; height: 24px; border-radius: 999px; overflow: hidden; background: #fff; border: 1px solid rgba(99,78,57,.14);
}
.mgp-brand-badge img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 3px 5px; }
.mgp-grid-team-inline span { font-size: 12px; color: var(--mgp-ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mgp-grid-effects { display: flex; align-items: center; gap: 8px; }
.mgp-effect-icon {
  position: relative;
  width: 32px; height: 32px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid rgba(99,78,57,.14); display: inline-flex; align-items: center; justify-content: center;
}
.mgp-effect-icon img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 5px; }
.mgp-grid-qualifying {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
}
.mgp-score-track {
  height: 10px; flex: 1 1 auto; border-radius: 999px; overflow: hidden; background: rgba(150, 185, 152, .28);
}
.mgp-score-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #65b873, #8fd09a); transition: width .5s ease; }
.mgp-score-number { font-size: 13px; font-weight: 900; min-width: 38px; text-align: right; }

.mgp-rider-panel { position: sticky; top: 14px; z-index: 3; }

.mgp-result-layout { display: grid; gap: 22px; }
.mgp-result-banner {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,241,232,.96));
  border: 1px solid rgba(99,78,57,.12);
}
.mgp-result-flag {
  width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 32px; background: rgba(237,226,208,.92);
}
.mgp-result-verdict {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.84); border: 1px solid rgba(99,78,57,.12); font-weight: 900; max-width: 360px;
}

.mgp-result-podium-grid,
.mgp-result-order-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mgp-result-order-rows { display: grid; gap: 12px; }
.mgp-result-order-row.is-faded { opacity: .42; }
.mgp-result-rider {
  display: grid; gap: 12px; padding: 14px; border-radius: 20px; border: 1px solid rgba(99,78,57,.14); background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,245,239,.98));
}
.mgp-result-rider.is-winner { border-color: rgba(160, 124, 67, .38); box-shadow: 0 16px 30px rgba(103,73,41,.08); }
.mgp-result-rider-rank { display: inline-flex; min-height: 30px; padding: 0 12px; align-items: center; justify-content: center; border-radius: 999px; background: rgba(237,226,208,.92); font-weight: 900; width: fit-content; }
.mgp-result-rider-main { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 10px; align-items: center; }
.mgp-result-rider-main strong { display: block; font-size: 15px; }
.mgp-result-rider-main span { display: block; font-size: 12px; color: var(--mgp-ink-soft); }
.mgp-result-rider-score { font-size: 20px; font-weight: 900; }
.mgp-result-order-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.mgp-result-order-controls { display: flex; align-items: center; gap: 10px; color: var(--mgp-ink-soft); }
.mgp-result-nav { appearance: none; border: 1px solid rgba(99,78,57,.18); background: #fff; min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 800; cursor: pointer; }
.mgp-result-nav:disabled { opacity: .45; cursor: default; }

.mgp-share-box { display: grid; gap: 10px; padding-top: 4px; }
.mgp-share-title { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; color: var(--mgp-ink-soft); }
.mgp-share-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.mgp-share-button {
  appearance: none; border: none; min-height: 44px; padding: 0 18px; border-radius: 999px; color: #fff; font-weight: 900; cursor: pointer;
}
.mgp-share-button.is-facebook { background: #4e6ea5; }
.mgp-share-button.is-x { background: #1d1d1f; }
.mgp-share-button.is-reddit { background: #cf7c47; }
.mgp-share-button.is-whatsapp { background: #58a66d; }
.mgp-share-button.is-copy { background: #fff; color: var(--mgp-ink); border: 1px solid rgba(99,78,57,.18); }

@media (max-width: 1100px) {
  .mgp-app-status, .mgp-grid-chip { inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; flex-basis: auto; }
  .mgp-inline-visual { grid-template-columns: 1fr; }
  .mgp-inline-visual-media { min-height: 132px; }
}
@media (max-width: 900px) {
  .mgp-form-grid { grid-template-columns: 1fr; }
  .mgp-grid-row-slots, .mgp-grid-skeletons, .mgp-result-podium-grid, .mgp-result-order-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mgp-result-banner { grid-template-columns: 64px minmax(0, 1fr); }
  .mgp-result-verdict { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 640px) {
  .mgp-grid-row-slots, .mgp-grid-skeletons, .mgp-result-podium-grid, .mgp-result-order-row { grid-template-columns: 1fr; }
  .mgp-grid-slot { min-height: 170px; }
  .mgp-inline-visual-copy strong { font-size: 18px; }
  .mgp-grid-frame { max-height: 640px; }
}

/* ===== v5 refinements ===== */
.mgp-field-group-visualstack {
  align-content: start;
}
.mgp-field-group-visualstack .mgp-inline-visual {
  grid-template-columns: 1fr;
  min-height: 162px;
}
.mgp-field-group-visualstack .mgp-inline-visual-media {
  min-height: 162px;
}
.mgp-field-group-visualstack .mgp-inline-visual-copy { display: none; }
.mgp-field-group-visualstack .mgp-field {
  display: grid;
  gap: 10px;
}
.mgp-field-group-visualstack .mgp-field > span {
  order: -1;
  display: block;
  margin: 0;
}

.mgp-grid-actions {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(242,232,219,.9), rgba(238,227,213,.88));
  border: 1px solid rgba(99,78,57,.12);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mgp-grid-scroll-btn {
  background: linear-gradient(180deg, #f7f1e8, #efe4d5);
  border-color: rgba(130,94,57,.26);
  color: #6a4729;
  box-shadow: 0 16px 30px rgba(63,44,28,.1);
  min-height: 54px;
  min-width: 230px;
  font-size: 16px;
}
.mgp-grid-scroll-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(63,44,28,.14);
}

.mgp-grid-frame {
  min-height: 760px;
  max-height: 760px;
}
.mgp-grid-row-slots {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.mgp-grid-slot {
  min-height: 198px;
}

.mgp-grid-loader-cover {
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,.65), transparent 22%),
    linear-gradient(180deg, rgba(248,242,235,.98), rgba(239,229,215,.96));
}
.mgp-grid-loader-cover-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  max-width: 420px;
  padding: 24px;
}
.mgp-grid-loader-cover-inner strong { font-size: 30px; line-height: 1.18; }
.mgp-grid-loader-cover-inner p { margin: 0; color: var(--mgp-ink-soft); }
.mgp-grid-loader-flag {
  width: 92px; height: 92px; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 40px;
  background: rgba(255,255,255,.72); box-shadow: 0 18px 40px rgba(63,44,28,.08);
}
.mgp-grid-loader-bars { display: flex; gap: 10px; }
.mgp-grid-loader-bars span {
  width: 14px; height: 14px; border-radius: 50%; background: #b7834e; animation: mgp-bounce 1.1s infinite ease-in-out;
}
.mgp-grid-loader-bars span:nth-child(2) { animation-delay: .12s; }
.mgp-grid-loader-bars span:nth-child(3) { animation-delay: .24s; }
@keyframes mgp-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-10px); opacity: 1; }
}

.mgp-result-banner {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
}
.mgp-result-hero-left {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.mgp-winner-portrait {
  position: relative;
  width: 122px;
  height: 122px;
}
.mgp-winner-portrait-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, transparent 53%, rgba(188,149,90,.16) 54%, rgba(188,149,90,.16) 61%, transparent 62%), conic-gradient(from 25deg, rgba(192,154,93,.9), rgba(233,211,154,.65), rgba(192,154,93,.9));
  -webkit-mask: radial-gradient(circle at center, transparent 52px, #000 53px);
          mask: radial-gradient(circle at center, transparent 52px, #000 53px);
}
.mgp-result-avatar.is-large {
  width: 98px;
  height: 98px;
  position: absolute;
  inset: 12px;
  border-width: 2px;
  box-shadow: 0 14px 24px rgba(63,44,28,.12);
}
.mgp-winner-overlay {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  object-fit: contain;
  pointer-events: none;
}
.mgp-result-verdict-card {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,241,233,.96));
  border: 1px solid rgba(99,78,57,.12);
  box-shadow: 0 14px 28px rgba(63,44,28,.06);
}
.mgp-result-verdict-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .15em; font-weight: 900; color: var(--mgp-ink-soft);
}
.mgp-result-verdict-card strong { font-size: 28px; line-height: 1.1; }
.mgp-result-verdict-card p { margin: 0; color: var(--mgp-ink-soft); }

.mgp-result-order-row.is-top3 .mgp-result-rider {
  padding: 18px;
  border-color: rgba(160,124,67,.26);
  box-shadow: 0 18px 34px rgba(63,44,28,.07);
}
.mgp-result-order-row.is-top3 .mgp-result-rider-score { font-size: 34px; }
.mgp-result-order-row.is-top3 .mgp-result-rider-main strong { font-size: 28px; }
.mgp-result-order-row.is-top3 .mgp-result-rider-main span { font-size: 15px; }
.mgp-result-order-row.is-top3 .mgp-result-rider-main { grid-template-columns: 62px minmax(0,1fr); }
.mgp-result-order-row.is-top3 .mgp-rider-avatar,
.mgp-result-order-row.is-top3 .mgp-result-avatar { width: 62px; height: 62px; }
.mgp-result-order-row.is-secondary .mgp-result-rider { opacity: .98; }
.mgp-result-order-row.is-faded .mgp-result-rider { opacity: .46; }

/* keep 3 result cards per row when possible */
.mgp-result-order-row,
.mgp-grid-row-slots { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

@media (max-width: 1100px) {
  .mgp-result-banner { grid-template-columns: 1fr; }
  .mgp-result-verdict-card { max-width: none; }
}
@media (max-width: 900px) {
  .mgp-grid-frame { min-height: 680px; max-height: 680px; }
  .mgp-grid-slot {
    min-height: 172px;
    padding: 8px 8px 10px;
  }
  .mgp-grid-rider-copy strong { font-size: 12px; }
  .mgp-grid-team-inline span,
  .mgp-score-number { font-size: 11px; }
  .mgp-grid-number, .mgp-grid-position { font-size: 11px; min-height: 24px; padding: 0 8px; }
  .mgp-grid-scroll-btn { min-width: 250px; }
  .mgp-result-order-row.is-top3 .mgp-result-rider-main strong { font-size: 20px; }
  .mgp-result-order-row.is-top3 .mgp-result-rider-score { font-size: 24px; }
}
@media (max-width: 640px) {
  .mgp-form-grid { grid-template-columns: 1fr 1fr; }
  .mgp-field-group.mgp-field-wide { grid-column: 1 / -1; }
  .mgp-field-group-visualstack .mgp-inline-visual,
  .mgp-field-group-visualstack .mgp-inline-visual-media { min-height: 140px; }
  .mgp-inline-visual-copy strong { font-size: 17px; }
  .mgp-grid-row-slots,
  .mgp-result-order-row { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
  .mgp-grid-rider-row { grid-template-columns: 36px minmax(0,1fr); gap: 8px; }
  .mgp-rider-avatar, .mgp-result-avatar, .mgp-brand-badge { transform: scale(.92); transform-origin: left center; }
  .mgp-grid-slot { min-height: 160px; }
  .mgp-grid-actions { padding: 14px; }
}
.mgp-field-title {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mgp-ink);
}
.mgp-field-title small {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--mgp-ink-soft);
}
.mgp-field-group-visualstack .mgp-field > span { display: none; }

/* ===== v6 grid layout fix ===== */
/* Keep the layout order intuitive: header, rider panel, grid, then actions */
.mgp-grid-lab {
  display: flex !important;
  flex-direction: column !important;
}
.mgp-grid-head { order: 1 !important; }
.mgp-rider-panel {
  order: 2 !important;
  position: static !important;
  margin-bottom: 16px !important;
}
.mgp-grid-shell {
  order: 3 !important;
  padding-top: 8px !important;
}
.mgp-grid-actions {
  order: 4 !important;
  position: static !important;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  top: auto !important;
  z-index: auto !important;
}

/* The grid itself must stack rows vertically, 3 riders per row */
.mgp-start-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;
}
.mgp-grid-row {
  display: grid !important;
  gap: 12px !important;
}
.mgp-grid-row-slots,
.mgp-grid-skeletons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

/* Show only two full grid rows in the viewport, then scroll */
.mgp-grid-frame {
  min-height: 520px !important;
  max-height: 520px !important;
  overflow-y: auto !important;
}

@media (max-width: 900px) {
  .mgp-grid-frame {
    min-height: 500px !important;
    max-height: 500px !important;
  }
}

@media (max-width: 640px) {
  .mgp-grid-row-slots,
  .mgp-grid-skeletons {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .mgp-grid-frame {
    min-height: 460px !important;
    max-height: 460px !important;
  }
}


/* ===== v7 interaction + layout refinements ===== */

.mgp-grid-slot::before {
  display: none !important;
  content: none !important;
}

.mgp-grid-actions-secondary {
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 10px 0 0 !important;
  margin-top: 12px !important;
}

.mgp-run-simulation-band {
  margin: 22px 0 8px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(232, 244, 231, .96), rgba(218, 235, 217, .96));
  border: 1px solid rgba(70, 130, 72, .18);
  box-shadow: 0 18px 34px rgba(42, 86, 45, .07);
}

.mgp-run-simulation-button {
  width: 100%;
  min-height: 62px;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #3ca65a, #25783f) !important;
  box-shadow: 0 16px 32px rgba(37, 120, 63, .24) !important;
  color: #fff !important;
  font-size: 20px !important;
  letter-spacing: .02em;
}

.mgp-run-simulation-button:hover {
  filter: brightness(1.03);
}

.mgp-start-grid {
  grid-template-columns: 1fr !important;
}

.mgp-grid-row-slots {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.mgp-grid-frame {
  min-height: 520px !important;
  max-height: 520px !important;
}

.mgp-grid-slot {
  padding: 0 !important;
}

.mgp-grid-slot-body {
  display: grid;
  gap: 10px;
  min-height: 198px;
  padding: 10px 10px 12px;
  transition: transform .16s ease, opacity .12s ease;
  position: relative;
  z-index: 1;
}

.mgp-grid-slot.is-source-gap .mgp-grid-slot-body {
  visibility: hidden !important;
  opacity: 0 !important;
}

.mgp-grid-slot.is-preview-swap {
  transform: none !important;
}

.mgp-grid-slot.is-preview-swap .mgp-grid-slot-body {
  transform: translate(var(--swap-x), var(--swap-y));
  opacity: .72;
}

.mgp-grid-slot.is-drop-target {
  outline: 2px dashed rgba(57, 128, 72, .58);
  outline-offset: -7px;
}

.mgp-grid-gap-label {
  z-index: 2;
  pointer-events: none;
}

.mgp-grid-slot.is-source-gap .mgp-grid-gap-label {
  opacity: 1 !important;
  visibility: visible !important;
}

.mgp-grid-rider-copy strong,
.mgp-result-rider-main strong {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.mgp-result-order-row.is-top3 .mgp-result-rider,
.mgp-result-order-row.is-top3 .mgp-result-rider-main,
.mgp-result-order-row.is-top3 .mgp-result-rider-score,
.mgp-result-order-row.is-top3 .mgp-result-rider-main strong,
.mgp-result-order-row.is-top3 .mgp-result-rider-main span {
  font-size: inherit !important;
  box-shadow: none !important;
}

.mgp-result-order-row.is-top3 .mgp-result-rider-main {
  grid-template-columns: 44px minmax(0, 1fr) !important;
}

.mgp-result-order-row.is-top3 .mgp-rider-avatar,
.mgp-result-order-row.is-top3 .mgp-result-avatar {
  width: 44px !important;
  height: 44px !important;
}

.mgp-result-rider {
  position: relative;
}

.mgp-result-trophy {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 226, 208, .92);
  border: 1px solid rgba(99, 78, 57, .12);
  font-size: 20px;
}

.mgp-result-rider-rank {
  padding-right: 42px;
}

@media (max-width: 900px) {
  .mgp-grid-frame {
    min-height: 500px !important;
    max-height: 500px !important;
  }
  .mgp-grid-slot-body {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .mgp-grid-frame {
    min-height: 460px !important;
    max-height: 460px !important;
  }
  .mgp-grid-row-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .mgp-grid-slot-body {
    min-height: 166px;
    padding: 8px 8px 10px;
  }
  .mgp-run-simulation-button {
    font-size: 17px !important;
  }
}


/* ==== v8 fixes ==== */
.mgp-grid-actions-secondary {
  justify-content: flex-end !important;
  margin-top: 18px !important;
  padding: 6px 0 0 !important;
}
.mgp-grid-actions-secondary .mgp-button {
  min-height: 46px !important;
  padding: 0 24px !important;
  font-size: 15px !important;
  opacity: .92;
}

/* cleaner drag visuals */
.mgp-grid-frame,
.mgp-start-grid,
.mgp-grid-row,
.mgp-grid-row-slots,
.mgp-grid-slot {
  overflow: visible !important;
}

.mgp-grid-gap-label {
  opacity: 0 !important;
  visibility: hidden !important;
  font-size: 0 !important;
}

.mgp-grid-slot.is-source-gap {
  border-style: dashed !important;
  border-color: rgba(122, 108, 90, .28) !important;
  background: rgba(255,255,255,.55) !important;
}

.mgp-grid-slot.is-source-gap .mgp-grid-slot-body {
  visibility: hidden !important;
  opacity: 0 !important;
}

.mgp-grid-slot.is-preview-swap {
  z-index: 12 !important;
}

.mgp-grid-slot.is-preview-swap .mgp-grid-slot-body {
  transform: translate(var(--swap-x), var(--swap-y)) !important;
  opacity: .94 !important;
  box-shadow: 0 16px 30px rgba(58, 42, 26, .16) !important;
}

.mgp-grid-slot.is-drop-target {
  outline: 2px dashed rgba(68, 143, 82, .55) !important;
  outline-offset: -6px !important;
  background: rgba(233, 247, 236, .6) !important;
}

.mgp-drag-ghost {
  transform: rotate(-2deg);
  box-shadow: 0 22px 38px rgba(40, 29, 19, .18);
  border-radius: 20px;
  background: var(--mgp-surface, #fff);
}
.mgp-drag-ghost .mgp-grid-gap-label { display: none !important; }

/* winner portrait */
.mgp-winner-portrait {
  position: relative;
  width: 108px;
  min-width: 108px;
  height: 108px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.92), rgba(244, 234, 217, .96));
  border: 1px solid rgba(112, 90, 62, .14);
  overflow: hidden;
}
.mgp-winner-portrait-avatar .mgp-rider-avatar {
  width: 74px !important;
  height: 74px !important;
}
.mgp-winner-portrait-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.mgp-winner-portrait-overlay img {
  width: 118%;
  height: auto;
  object-fit: contain;
  opacity: .9;
}
.mgp-winner-portrait-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,236,220,.94);
  border: 1px solid rgba(112,90,62,.12);
  font-size: 16px;
}
.mgp-winner-portrait-name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(112,90,62,.10);
  font-size: 12px;
  text-align: center;
  font-weight: 700;
  color: var(--mgp-ink, #2f241a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==== v9 fixes ==== */
.mgp-grid-shell {
  display: grid !important;
  gap: 12px !important;
}
.mgp-grid-scroll-btn-top,
.mgp-grid-scroll-btn-bottom {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.mgp-grid-scroll-btn-bottom {
  margin-top: 8px !important;
}
.mgp-grid-scroll-btn:disabled {
  opacity: .55 !important;
}

/* show only two visible grid rows */
.mgp-grid-frame {
  min-height: 430px !important;
  max-height: 430px !important;
  overflow-y: auto !important;
}

/* ensure third visible result row is not faded */
.mgp-result-order-row.is-faded,
.mgp-result-order-row.is-faded .mgp-result-rider {
  opacity: 1 !important;
}

/* trophy PNG support */
.mgp-result-trophy {
  overflow: hidden;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.mgp-result-trophy img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mgp-result-trophy-fallback {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: rgba(237, 226, 208, .92);
  border: 1px solid rgba(99, 78, 57, .12);
  font-size: 20px;
}

/* mobile: simplify rider cards heavily */
@media (max-width: 640px) {
  .mgp-grid-row-slots,
  .mgp-grid-skeletons {
    grid-template-columns: 1fr !important;
  }
  .mgp-grid-frame {
    min-height: 360px !important;
    max-height: 360px !important;
  }
  .mgp-grid-slot-body {
    min-height: 136px !important;
    padding: 8px 8px 10px !important;
    gap: 8px !important;
  }
  .mgp-grid-rider-row {
    grid-template-columns: 38px minmax(0,1fr) !important;
    gap: 8px !important;
  }
  .mgp-rider-avatar { width: 38px !important; height: 38px !important; }
  .mgp-grid-rider-copy strong { font-size: 14px !important; }
  .mgp-grid-team-inline { grid-template-columns: 36px minmax(0,1fr) !important; gap: 6px !important; margin-top: 3px !important; }
  .mgp-grid-team-inline span { font-size: 11px !important; }
  .mgp-brand-badge { width: 36px !important; height: 22px !important; }
  .mgp-grid-effects { gap: 6px !important; }
  .mgp-effect-icon { width: 28px !important; height: 28px !important; border-radius: 10px !important; }
  .mgp-grid-number,
  .mgp-grid-position { min-height: 24px !important; font-size: 11px !important; padding: 0 8px !important; }
  .mgp-score-track { height: 8px !important; }
  .mgp-score-number { font-size: 12px !important; min-width: 34px !important; }
}

@media (max-width: 900px) and (min-width: 641px) {
  .mgp-grid-frame {
    min-height: 410px !important;
    max-height: 410px !important;
  }
}


/* ==== v10 fixes ==== */
.mgp-workbench {
  align-items: start !important;
}
.mgp-grid-lab {
  align-self: start !important;
}
.mgp-grid-shell {
  gap: 10px !important;
}
.mgp-grid-frame {
  width: 100% !important;
  min-height: 520px !important;
  max-height: 520px !important;
}
.mgp-start-grid {
  width: 100% !important;
}
.mgp-grid-scroll-btn-bottom {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 768px) {
  .mgp-grid-lab,
  .mgp-result-shell {
    padding: 18px !important;
  }
  .mgp-grid-frame {
    min-height: 430px !important;
    max-height: 430px !important;
    padding: 12px 12px 8px !important;
  }
  .mgp-result-layout {
    gap: 16px !important;
  }
  .mgp-result-banner {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    align-items: start !important;
  }
  .mgp-result-hero-left {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    justify-items: start !important;
    align-items: start !important;
  }
  .mgp-winner-portrait {
    width: 108px !important;
    height: 108px !important;
  }
  .mgp-result-verdict-card {
    width: 100% !important;
    max-width: none !important;
  }
  .mgp-result-verdict-card strong {
    font-size: 24px !important;
    line-height: 1.15 !important;
  }
  .mgp-result-order-head {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .mgp-result-order-controls {
    width: 100% !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .mgp-result-order-row {
    grid-template-columns: 1fr !important;
  }
  .mgp-result-rider {
    padding: 14px !important;
  }
  .mgp-result-rider-main {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  .mgp-result-rider-main strong {
    font-size: 16px !important;
    line-height: 1.2 !important;
  }
  .mgp-result-rider-main span {
    font-size: 12px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .mgp-result-rider-score {
    font-size: 18px !important;
  }
  .mgp-reason-box {
    padding: 16px !important;
  }
  .mgp-reason-box ul,
  .mgp-reason-box li {
    max-width: 100% !important;
  }
  .mgp-share-buttons {
    gap: 8px !important;
  }
  .mgp-share-button {
    min-height: 42px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .mgp-grid-lab,
  .mgp-result-shell {
    padding: 14px !important;
  }
  .mgp-grid-frame {
    min-height: 400px !important;
    max-height: 400px !important;
  }
  .mgp-result-verdict-card strong {
    font-size: 20px !important;
  }
  .mgp-result-order-controls {
    font-size: 13px !important;
  }
  .mgp-result-nav {
    min-height: 36px !important;
    padding: 0 12px !important;
  }
}


/* ==== v11 mobile polish ==== */
@media (max-width: 768px) {
  /* 1. result nav: previous left, page centered, next right */
  .mgp-result-order-controls {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .mgp-result-order-controls > span {
    text-align: center !important;
    justify-self: center !important;
    white-space: nowrap !important;
  }
  .mgp-result-order-controls .mgp-result-nav:first-of-type {
    justify-self: start !important;
  }
  .mgp-result-order-controls .mgp-result-nav:last-of-type {
    justify-self: end !important;
  }

  /* 2. center the winner portrait and hero text on mobile */
  .mgp-result-hero-left {
    justify-items: center !important;
    text-align: center !important;
  }
  .mgp-result-hero-left > div:last-child {
    width: 100% !important;
    text-align: center !important;
  }
  .mgp-winner-portrait {
    margin-inline: auto !important;
  }

  /* 3. share buttons same width and centered */
  .mgp-share-buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .mgp-share-button {
    width: min(100%, 240px) !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* 4. center the grid status chip text */
  .mgp-grid-chip,
  .mgp-app-status {
    justify-content: center !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .mgp-share-button {
    width: min(100%, 220px) !important;
  }
  .mgp-result-order-controls {
    gap: 8px !important;
  }
}


/* ==== v13 simulation patience / computation readout ==== */
.mgp-computation-state {
  min-height: 390px;
  display: grid;
  gap: 18px;
  align-content: center;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(99, 78, 57, .14);
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.92), transparent 23%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,236,224,.96));
  box-shadow: 0 22px 46px rgba(64, 45, 28, .08);
}
.mgp-computation-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.mgp-computation-wheel-loader {
  position: relative;
  width: 92px;
  height: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.98), rgba(245,236,224,.92) 58%, rgba(229,214,194,.96));
  border: 1px solid rgba(99,78,57,.14);
  box-shadow:
    0 16px 34px rgba(64,45,28,.10),
    inset 0 1px 0 rgba(255,255,255,.74);
}
.mgp-computation-wheel,
.mgp-computation-wheel-light {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  display: block;
}
.mgp-computation-wheel {
  animation: mgp-computation-wheel-spin 1.2s linear infinite;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 5px 7px rgba(44,31,20,.18));
}
.mgp-computation-wheel-light {
  pointer-events: none;
  z-index: 2;
  opacity: .98;
  mix-blend-mode: screen;
}
@keyframes mgp-computation-wheel-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.mgp-computation-head strong {
  display: block;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.14;
  color: var(--mgp-ink);
}
.mgp-computation-head p {
  margin: 7px 0 0;
  color: var(--mgp-ink-soft);
  line-height: 1.5;
}
.mgp-computation-progress {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(139, 171, 139, .22);
  border: 1px solid rgba(71, 122, 71, .12);
}
.mgp-computation-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54ad6a, #2f8d4d);
  box-shadow: 0 0 22px rgba(71, 159, 88, .28);
  transition: width .12s linear;
}
.mgp-computation-readout {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(99,78,57,.12);
}
.mgp-computation-readout-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mgp-ink-soft);
}
.mgp-computation-readout strong {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  color: var(--mgp-ink);
}
.mgp-computation-log {
  display: grid;
  gap: 8px;
  max-height: 162px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mgp-computation-log-item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px 10px 42px;
  border-radius: 16px;
  font-weight: 800;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(99,78,57,.10);
  color: var(--mgp-ink-soft);
}
.mgp-computation-log-item::before {
  content: '•';
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 26px;
  color: #c1a078;
}
.mgp-computation-log-item.is-active {
  color: var(--mgp-ink);
  border-color: rgba(71, 122, 71, .28);
  background: rgba(232, 246, 233, .95);
}
.mgp-computation-log-item.is-active::before {
  content: '›';
  color: #31834c;
}
.mgp-computation-log-item.is-complete {
  color: var(--mgp-ink);
}
.mgp-computation-log-item.is-complete::before {
  content: '✓';
  color: #31834c;
  font-size: 18px;
  font-weight: 900;
}
@media (max-width: 768px) {
  .mgp-computation-state {
    min-height: 420px;
    padding: 18px;
    gap: 14px;
  }
  .mgp-computation-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .mgp-computation-wheel-loader {
    width: 76px;
    height: 76px;
    border-radius: 22px;
  }
  .mgp-computation-wheel,
  .mgp-computation-wheel-light {
    inset: 7px;
    width: calc(100% - 14px);
    height: calc(100% - 14px);
  }
  .mgp-computation-log-item {
    font-size: 14px;
    min-height: 40px;
  }
}


/* ==== v14 MotoGP hero / computation / poster showcase fix ==== */

/* Hide visible vertical scrollbar in the computation readout without breaking scripted movement. */
.mgp-computation-log {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.mgp-computation-log::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* The hero no longer carries three stat boxes; the presentation image takes the space. */
.mgp-hero-panel {
  justify-content: flex-start !important;
  gap: 18px !important;
}
.mgp-track-visual {
  height: 430px !important;
  min-height: 430px !important;
  margin-bottom: 0 !important;
}
@media (max-width: 980px) {
  .mgp-track-visual {
    height: 380px !important;
    min-height: 380px !important;
  }
}
@media (max-width: 640px) {
  .mgp-track-visual {
    height: 320px !important;
    min-height: 320px !important;
  }
}

/* Poster showcase markup is shared with the Tour de France implementation. */
.tdfp-poster-showcase {
  position: relative;
  margin: 28px 0;
  padding: 24px 26px 22px;
  border: 1px solid rgba(99, 78, 57, .14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(226, 214, 194, .42), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,238,228,.94));
  box-shadow: 0 18px 38px rgba(67, 48, 30, .07);
  overflow: hidden;
}
.tdfp-poster-showcase-outro {
  margin-top: 34px;
}
.tdfp-poster-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.tdfp-poster-head h2,
.tdfp-poster-head h3 {
  margin: 4px 0 4px;
  color: var(--mgp-ink);
  line-height: 1.18;
}
.tdfp-poster-head h2 { font-size: clamp(24px, 2.5vw, 34px); }
.tdfp-poster-head h3 { font-size: clamp(20px, 2vw, 28px); }
.tdfp-poster-head p {
  margin: 0;
  color: var(--mgp-ink-soft);
  line-height: 1.45;
}
.tdfp-poster-carousel {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.tdfp-poster-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: 14px;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 36px 4px;
}
.tdfp-poster-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.tdfp-poster-card {
  min-width: 0;
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: 150px auto;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(99, 78, 57, .12);
  background: rgba(255,255,255,.96);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(60, 43, 28, .06);
  transition: transform .16s ease, box-shadow .16s ease;
}
.tdfp-poster-card:hover,
.tdfp-poster-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(60, 43, 28, .11);
  outline: none;
}
.tdfp-poster-card-media {
  display: block;
  min-height: 150px;
  overflow: hidden;
  background: #efe5d8;
}
.tdfp-poster-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tdfp-poster-card-body {
  display: grid;
  gap: 8px;
  padding: 12px 12px 13px;
}
.tdfp-poster-card-body strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.28;
  font-size: 14px;
}
.tdfp-poster-card-body span {
  color: #8d5d2d;
  font-weight: 900;
  font-size: 13px;
}
.tdfp-poster-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(99, 78, 57, .16);
  background: rgba(255,255,255,.96);
  color: #8c633a;
  font-size: 30px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(55, 39, 25, .12);
}
.tdfp-poster-nav-prev { left: 0; }
.tdfp-poster-nav-next { right: 0; }
.tdfp-poster-nav:disabled {
  opacity: .42;
  cursor: default;
}
.tdfp-poster-dots {
  min-height: 14px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tdfp-poster-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(145, 121, 95, .35);
  cursor: pointer;
}
.tdfp-poster-dot.is-active {
  width: 24px;
  background: #98703e;
}
@media (max-width: 780px) {
  .tdfp-poster-showcase {
    padding: 20px 16px 18px;
    border-radius: 24px;
  }
  .tdfp-poster-grid {
    grid-auto-columns: minmax(162px, 76vw);
    padding-inline: 28px;
  }
  .tdfp-poster-nav {
    width: 38px;
    height: 38px;
  }
}


/* ==== v15 computation log readability fix ==== */
@media (max-width: 768px) {
  .mgp-computation-log {
    max-height: 176px !important;
    gap: 8px !important;
  }
  .mgp-computation-log-item {
    min-height: 38px !important;
    padding: 9px 12px 9px 38px !important;
    line-height: 1.2 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .mgp-computation-log-item::before {
    left: 14px !important;
    font-size: 20px !important;
  }
  .mgp-computation-log-item.is-complete::before {
    font-size: 16px !important;
  }
}


/* ==== V16 race type grid note ==== */
.mgp-grid-format-note {
  max-width: 640px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(99, 78, 57, .14);
  background: rgba(255, 255, 255, .76);
  color: var(--mgp-ink-soft);
  line-height: 1.45;
  font-size: 14px;
}
.mgp-grid-format-note strong {
  color: var(--mgp-ink);
}
@media (max-width: 768px) {
  .mgp-grid-format-note {
    font-size: 13px;
    padding: 11px 12px;
  }
}


/* ==== Version B: multi-mode MotoGP predictor tabs ==== */
.mgp-tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(99,78,57,.12);
}
.mgp-tool-tab {
  appearance: none;
  border: 1px solid rgba(99,78,57,.15);
  background: rgba(255,255,255,.95);
  color: var(--mgp-ink);
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.mgp-tool-tab:hover,
.mgp-tool-tab:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(63,44,28,.10);
  outline: none;
}
.mgp-tool-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, #a17848, #7e542c);
  border-color: rgba(126,84,44,.45);
  box-shadow: 0 14px 28px rgba(95,63,35,.18);
}
.mgp-tool-panel[hidden] {
  display: none !important;
}
.mgp-mode-card {
  margin-top: 8px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(99,78,57,.14);
  background:
    radial-gradient(circle at 100% 0%, rgba(226,214,194,.36), transparent 20%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,240,231,.95));
  box-shadow: 0 20px 42px rgba(63,44,28,.07);
}
.mgp-mode-head h3 {
  margin: 5px 0 8px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}
.mgp-mode-head p {
  max-width: 780px;
  margin: 0;
  color: var(--mgp-ink-soft);
  line-height: 1.55;
}
.mgp-mode-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 18px;
}
.mgp-mode-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.mgp-mode-field span {
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mgp-ink-soft);
}
.mgp-mode-field select {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(99,78,57,.18);
  background: rgba(255,255,255,.96);
  padding: 0 14px;
  color: var(--mgp-ink);
  font-weight: 800;
}
.mgp-mode-run {
  min-height: 58px;
  padding-inline: 26px;
  border-radius: 18px !important;
}
.mgp-mode-output {
  margin-top: 22px;
}
.mgp-mode-loading,
.mgp-mode-error,
.mgp-mode-callout {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(99,78,57,.14);
  background: rgba(255,255,255,.9);
}
.mgp-mode-loading {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}
.mgp-mode-loading p,
.mgp-mode-error p,
.mgp-mode-callout p {
  margin: 0;
  color: var(--mgp-ink-soft);
}
.mgp-mode-error {
  border-color: rgba(168,76,66,.22);
  background: rgba(255,243,241,.96);
}
.mgp-mode-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.mgp-mode-rider-card,
.mgp-mode-brand-card,
.mgp-mode-mini-panel {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(99,78,57,.14);
  background: rgba(255,255,255,.95);
}
.mgp-mode-rider-card strong,
.mgp-mode-brand-card strong,
.mgp-mode-mini-panel strong {
  font-size: clamp(20px, 2.3vw, 30px);
  line-height: 1.1;
}
.mgp-mode-rider-card span:not(.mgp-mode-rider-badge),
.mgp-mode-brand-card small,
.mgp-mode-mini-panel span {
  color: var(--mgp-ink-soft);
}
.mgp-mode-rider-card b,
.mgp-mode-brand-card b {
  font-size: 28px;
  color: #8d5d2d;
}
.mgp-mode-rider-card em {
  font-style: normal;
  font-weight: 900;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(237,226,208,.92);
}
.mgp-mode-rider-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 11px;
  background: linear-gradient(180deg, #b48854, #906235);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  font-weight: 900;
}
.mgp-mode-versus {
  display: grid;
  gap: 9px;
  align-content: center;
  justify-items: center;
  text-align: center;
}
.mgp-mode-versus strong {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  background: linear-gradient(180deg, #a17848, #7e542c);
  box-shadow: 0 16px 30px rgba(95,63,35,.18);
}
.mgp-mode-versus span {
  color: var(--mgp-ink-soft);
  line-height: 1.45;
}
.mgp-mode-callout span {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(237,226,208,.92);
  color: #845a32;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 900;
}
.mgp-mode-callout strong {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
}
.mgp-mode-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.mgp-mode-podium .mgp-mode-rider-card {
  padding: 14px;
}
.mgp-mode-podium .mgp-mode-rider-card strong {
  font-size: 18px;
}
.mgp-mode-podium .mgp-mode-rider-card b {
  font-size: 21px;
}
.mgp-mode-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.mgp-mode-mini-panel > span {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 900;
}
.mgp-mode-shifts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(99,78,57,.12);
}
.mgp-mode-shifts div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mgp-mode-shifts span {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(237,226,208,.88);
  color: var(--mgp-ink);
  font-weight: 800;
}
.mgp-mode-weather-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.mgp-mode-brand-card.is-winner {
  border-color: rgba(70,130,72,.32);
  box-shadow: 0 18px 34px rgba(42,86,45,.10);
}
@media (max-width: 980px) {
  .mgp-tool-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mgp-tool-tabs::-webkit-scrollbar { display: none; }
  .mgp-tool-tab { white-space: nowrap; }
  .mgp-mode-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mgp-mode-result-grid {
    grid-template-columns: 1fr;
  }
  .mgp-mode-two-columns,
  .mgp-mode-weather-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .mgp-mode-card {
    padding: 18px;
    border-radius: 24px;
  }
  .mgp-mode-form {
    grid-template-columns: 1fr;
  }
  .mgp-mode-run {
    width: 100%;
  }
  .mgp-mode-podium {
    grid-template-columns: 1fr;
  }
  .mgp-mode-loading {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}


/* ==== V18 visual cleanup + shared mode run buttons ==== */
.mgp-inline-visual-fallback {
  font-size: 0 !important;
  color: transparent !important;
  padding: 0 !important;
}

.mgp-mode-run {
  width: 100%;
  min-height: 62px;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #3ca65a, #25783f) !important;
  box-shadow: 0 16px 32px rgba(37, 120, 63, .24) !important;
  color: #fff !important;
  font-size: 18px !important;
  letter-spacing: .02em;
}
.mgp-mode-run:hover { filter: brightness(1.03); }
.mgp-mode-run:disabled { filter: saturate(.8); }
.mgp-mode-output .mgp-computation-state { margin-top: 0; }


/* ==== V19 comparison visuals, rider numbers, and manufacturer logos ==== */
.mgp-key-choice {
  padding: 14px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(152,112,62,.11), transparent 34%),
    rgba(255,255,255,.72);
  border: 1px solid rgba(152,112,62,.22);
  box-shadow: 0 12px 28px rgba(67, 48, 30, .06);
}
.mgp-key-choice > span {
  color: var(--mgp-accent-deep) !important;
}
.mgp-mode-select-preview {
  margin-top: 8px;
}
.mgp-choice-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(99,78,57,.12);
}
.mgp-choice-preview-card > div {
  min-width: 0;
}
.mgp-choice-preview-card strong,
.mgp-choice-preview-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-choice-preview-card strong {
  font-size: 16px;
  color: var(--mgp-ink);
}
.mgp-choice-preview-card span {
  font-size: 12px;
  color: var(--mgp-ink-soft);
}

.mgp-rider-visual {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.mgp-mode-rider-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.mgp-mode-rider-card .mgp-rider-avatar {
  width: 48px;
  height: 48px;
}
.mgp-race-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  flex: 0 0 auto;
}
.mgp-race-number img {
  display: block;
  max-width: 56px;
  max-height: 34px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.mgp-race-number-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(99,78,57,.16);
  background: #efe7da;
  color: var(--mgp-accent-deep);
  font-weight: 900;
  font-size: 13px;
}
.mgp-race-number.is-fallback img {
  display: none;
}
.mgp-race-number.is-fallback .mgp-race-number-fallback {
  display: inline-flex;
}
.mgp-mode-rider-card strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-mode-rider-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mgp-sprint-main-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  margin-bottom: 18px;
}
.mgp-sprint-main-hero {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(99,78,57,.14);
}
.mgp-sprint-main-hero > span {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 900;
  color: var(--mgp-ink-soft);
}
.mgp-sprint-main-hero > div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.mgp-sprint-main-hero strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(22px, 2.4vw, 34px);
}
.mgp-sprint-main-podiums .mgp-mode-mini-panel {
  overflow: hidden;
}

.mgp-manufacturer-result-banner {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(47, 130, 62, .22);
  background: linear-gradient(135deg, rgba(51,145,70,.15), rgba(255,255,255,.92));
}
.mgp-manufacturer-result-banner span {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
  font-size: 12px;
  color: #2f7a3e;
}
.mgp-manufacturer-result-banner strong {
  font-size: clamp(24px, 2.7vw, 38px);
  color: var(--mgp-ink);
}
.mgp-manufacturer-result-banner p {
  margin: 0;
  color: var(--mgp-ink-soft);
}
.mgp-brand-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.mgp-brand-card-head > div {
  min-width: 0;
}
.mgp-brand-card-head strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-manufacturer-logo {
  width: 74px;
  height: 54px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mgp-manufacturer-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.mgp-manufacturer-logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(99,78,57,.16);
  background: #efe7da;
  color: var(--mgp-accent-deep);
  font-weight: 900;
}
.mgp-manufacturer-logo.is-fallback img {
  display: none;
}
.mgp-manufacturer-logo.is-fallback .mgp-manufacturer-logo-fallback {
  display: inline-flex;
}
.mgp-mode-brand-card.is-winner {
  border-color: rgba(47, 130, 62, .36);
  box-shadow: 0 16px 36px rgba(47,130,62,.13);
}
.mgp-brand-winner-ribbon {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #2f8a43;
  color: white;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mgp-mode-podium .mgp-mode-rider-card {
  min-width: 0;
}
.mgp-mode-podium .mgp-mode-rider-card strong {
  font-size: clamp(15px, 1.5vw, 18px);
}
.mgp-mode-weather-grid .mgp-mode-podium {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mgp-mode-weather-grid .mgp-mode-rider-card {
  overflow: hidden;
}
.mgp-mode-weather-grid .mgp-mode-rider-card .mgp-rider-avatar {
  width: 42px;
  height: 42px;
}

@media (max-width: 860px) {
  .mgp-mode-form {
    grid-template-columns: 1fr;
  }
  .mgp-sprint-main-summary,
  .mgp-mode-two-columns,
  .mgp-mode-weather-grid,
  .mgp-mode-result-grid {
    grid-template-columns: 1fr !important;
  }
  .mgp-mode-podium {
    grid-template-columns: 1fr !important;
  }
  .mgp-mode-rider-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
  .mgp-mode-rider-card .mgp-mode-rider-top {
    grid-row: 1 / span 3;
  }
  .mgp-mode-rider-card b {
    justify-self: start;
  }
}


/* ==== V20 mode layout and result readability pass ==== */
.mgp-mode-form-split,
.mgp-mode-form-triple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.mgp-mode-form-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mgp-mode-form-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.mgp-mode-rider-divider {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(99,78,57,.16);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 900;
  color: var(--mgp-accent-deep);
}
.mgp-mode-rider-choices {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.mgp-mode-context-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mgp-mode-inline-visual {
  min-height: 108px;
  border-radius: 18px;
  border: 1px solid rgba(99,78,57,.13);
  overflow: hidden;
  background: rgba(244,235,222,.9);
}
.mgp-mode-inline-visual .mgp-inline-visual-media,
.mgp-mode-inline-visual .mgp-inline-visual-media img {
  height: 100%;
}
.mgp-mode-inline-visual .mgp-inline-visual-copy {
  padding: 10px 12px;
}
.mgp-mode-inline-visual .mgp-inline-visual-copy strong {
  font-size: 15px;
}
.mgp-mode-inline-visual.is-image-only .mgp-inline-visual-copy { display:none; }
.mgp-hidden-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.mgp-mode-radio {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(99,78,57,.14);
  background: rgba(255,255,255,.9);
}
.mgp-mode-radio legend {
  padding: 0 4px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 900;
  color: var(--mgp-ink-soft);
}
.mgp-mode-radio label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.74);
  font-weight: 900;
}
.mgp-mode-radio input { width: 18px; height: 18px; }
.mgp-mode-rider-card.is-mode-winner {
  border-color: rgba(47, 130, 62, .30);
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(246,252,244,.95));
}
.mgp-mode-winner-icon {
  margin-left: auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mgp-mode-winner-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.mgp-mode-winner-fallback { display:none; font-size: 26px; }
.mgp-mode-winner-icon.is-fallback img { display:none; }
.mgp-mode-winner-icon.is-fallback .mgp-mode-winner-fallback { display:inline-flex; }
.mgp-mode-score,
.mgp-brand-score {
  justify-self: end;
  align-self: end;
  font-size: clamp(28px, 3vw, 42px) !important;
  line-height: 1;
  color: #8d5d2d !important;
}
.mgp-duel-score-summary b {
  font-size: 30px;
  color: #8d5d2d;
}
.mgp-comeback-verdict {
  display:flex;
  align-items:center;
  gap:12px;
}
.mgp-comeback-verdict .mgp-mode-winner-icon {
  margin-left:0;
}
.mgp-inline-score {
  color:#8d5d2d;
}
.mgp-sprint-main-podiums .mgp-mode-podium,
.mgp-weather-chasers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mgp-weather-result-grid {
  align-items: stretch;
}
.mgp-weather-scenario-card {
  gap: 14px;
}
.mgp-weather-winner .mgp-mode-rider-card {
  min-height: 150px;
}
.mgp-weather-chasers {
  display: grid;
  gap: 12px;
}
.mgp-weather-chasers .mgp-mode-rider-card {
  padding: 12px;
}
.mgp-weather-chasers .mgp-mode-rider-card strong {
  font-size: 16px;
}
.mgp-weather-chasers .mgp-mode-score {
  font-size: 22px !important;
}
.mgp-brand-card-head {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
.mgp-brand-score {
  align-self: center;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card {
  margin-top: 12px;
}
@media (max-width: 980px) {
  .mgp-mode-form-split,
  .mgp-mode-form-triple,
  .mgp-mode-rider-choices,
  .mgp-mode-context-visuals {
    grid-template-columns: 1fr !important;
  }
  .mgp-brand-card-head {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }
  .mgp-brand-winner-ribbon { grid-column: 1 / -1; justify-self: start; }
}


/* ==== V21 Rider Duel layout / fallbacks / score placement ==== */
.mgp-duel-form-v21 {
  display: grid !important;
  gap: 22px !important;
}
.mgp-duel-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.mgp-duel-context-cell {
  min-width: 0;
  display: grid;
  grid-template-rows: 150px auto;
  gap: 12px;
}
.mgp-duel-context-cell .mgp-mode-inline-visual {
  width: 100%;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
}
.mgp-duel-context-cell .mgp-mode-field {
  min-width: 0;
  margin: 0;
}
.mgp-duel-context-cell .mgp-mode-field span {
  min-height: 18px;
}
.mgp-duel-context-cell .mgp-mode-field select {
  width: 100%;
}

/* Better image fallback: never show browser broken-image icon or raw alt text. */
.mgp-mode-inline-visual {
  position: relative;
}
.mgp-mode-inline-visual .mgp-inline-visual-media {
  position: relative;
  width: 100%;
  height: 100%;
}
.mgp-mode-inline-visual.is-fallback img,
.mgp-mode-winner-icon.is-fallback img,
.mgp-race-number.is-fallback img,
.mgp-result-avatar.is-fallback img,
.mgp-rider-avatar.is-fallback img,
.mgp-manufacturer-logo.is-fallback img {
  opacity: 0 !important;
  visibility: hidden !important;
}
.mgp-mode-inline-visual.is-fallback .mgp-inline-visual-fallback {
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.58), transparent 20%),
    linear-gradient(135deg, rgba(241,231,214,.95), rgba(232,219,199,.88));
}
.mgp-mode-inline-visual.is-fallback .mgp-inline-visual-fallback::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(112, 84, 52, .18);
}
.mgp-mode-winner-icon.is-fallback .mgp-mode-winner-fallback {
  display: inline-flex !important;
}

/* Rider Duel result: score sits at the right middle, not at the bottom. */
.mgp-mode-duel-result .mgp-mode-rider-card {
  min-height: 132px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top name score"
    "top meta score"
    "top rank score";
  column-gap: 14px;
  row-gap: 5px;
  align-items: center;
  padding: 16px 18px;
}
.mgp-mode-duel-result .mgp-mode-rider-top {
  grid-area: top;
  align-self: start;
  display: grid;
  gap: 7px;
}
.mgp-mode-duel-result .mgp-mode-rider-card > strong {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-mode-duel-result .mgp-mode-rider-meta {
  grid-area: meta;
}
.mgp-mode-duel-result .mgp-mode-rider-card > em {
  grid-area: rank;
}
.mgp-mode-duel-result .mgp-mode-score {
  grid-area: score;
  align-self: center;
  justify-self: end;
  margin-left: 10px;
}
.mgp-mode-duel-result .mgp-mode-winner-icon {
  margin-left: 0;
  width: 38px;
  height: 38px;
}
.mgp-mode-duel-result .mgp-mode-winner-icon img {
  object-fit: contain;
}
.mgp-mode-duel-result .mgp-duel-score-summary b {
  line-height: 1;
}

@media (max-width: 1100px) {
  .mgp-duel-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .mgp-duel-context-grid {
    grid-template-columns: 1fr;
  }
  .mgp-duel-context-cell {
    grid-template-rows: 130px auto;
  }
  .mgp-duel-context-cell .mgp-mode-inline-visual {
    height: 130px;
    min-height: 130px;
    max-height: 130px;
  }
  .mgp-mode-duel-result .mgp-mode-rider-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "top name"
      "top meta"
      "top rank"
      "top score";
  }
  .mgp-mode-duel-result .mgp-mode-score {
    justify-self: start;
  }
}


/* ==== V22 Rider Duel full-width context row ==== */
.mgp-tool-panel[data-tool-panel="duel"] .mgp-mode-card {
  width: 100%;
}

.mgp-duel-form-v21,
.mgp-duel-form-v21 .mgp-duel-context-grid,
.mgp-duel-form-v21 .mgp-mode-rider-choices {
  width: 100%;
}

.mgp-duel-context-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  column-gap: 14px !important;
  row-gap: 16px !important;
  align-items: stretch !important;
}

.mgp-duel-context-cell {
  min-width: 0 !important;
  width: 100% !important;
  grid-template-rows: 150px auto !important;
}

.mgp-duel-context-cell .mgp-mode-inline-visual {
  width: 100% !important;
  min-width: 0 !important;
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
}

.mgp-duel-context-cell .mgp-mode-field,
.mgp-duel-context-cell .mgp-mode-field select {
  width: 100% !important;
  max-width: none !important;
}

.mgp-duel-form-v21 .mgp-mode-rider-divider {
  width: 100%;
}

.mgp-duel-form-v21 .mgp-mode-rider-choices {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

@media (max-width: 900px) {
  .mgp-duel-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px) {
  .mgp-duel-context-grid,
  .mgp-duel-form-v21 .mgp-mode-rider-choices {
    grid-template-columns: 1fr !important;
  }
}


/* ==== V24 Comeback mode 5-column layout + result rider visual ==== */
.mgp-comeback-layout-v24 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}
.mgp-comeback-cell {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.mgp-comeback-cell-visual .mgp-mode-inline-visual {
  width: 100%;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
}
.mgp-comeback-cell-visual .mgp-inline-visual-media,
.mgp-comeback-cell-visual .mgp-inline-visual-media img {
  width: 100%;
  height: 100%;
}
.mgp-comeback-cell-rider .mgp-key-choice {
  min-height: 222px;
  align-content: start;
}
.mgp-comeback-cell-rider .mgp-choice-preview-card {
  min-height: 96px;
}
.mgp-comeback-cell-rider .mgp-start-position-field select,
.mgp-comeback-cell-visual .mgp-mode-field select {
  width: 100%;
}
.mgp-comeback-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 18px;
  align-items: center;
}
.mgp-comeback-callout-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.mgp-comeback-rider-hero {
  width: 118px;
  height: 118px;
  border-radius: 22px;
  border: 1px solid rgba(99,78,57,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(241,231,214,.92));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  justify-self: end;
}
.mgp-comeback-rider-hero .mgp-rider-visual {
  flex-direction: column;
  gap: 10px;
}
.mgp-comeback-rider-hero .mgp-rider-avatar {
  width: 64px;
  height: 64px;
}
.mgp-comeback-rider-hero .mgp-race-number {
  min-width: 54px;
  height: 34px;
}
.mgp-comeback-rider-hero .mgp-race-number img {
  max-width: 66px;
  max-height: 36px;
}
@media (max-width: 1180px) {
  .mgp-comeback-layout-v24 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .mgp-comeback-cell-rider {
    grid-column: span 2;
  }
}
@media (max-width: 860px) {
  .mgp-comeback-layout-v24 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mgp-comeback-cell-rider {
    grid-column: span 2;
  }
}
@media (max-width: 640px) {
  .mgp-comeback-layout-v24 {
    grid-template-columns: 1fr !important;
  }
  .mgp-comeback-cell-rider {
    grid-column: auto;
  }
  .mgp-comeback-cell-visual .mgp-mode-inline-visual {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
  .mgp-comeback-callout {
    grid-template-columns: 1fr;
  }
  .mgp-comeback-rider-hero {
    justify-self: start;
  }
}


/* ==== V25 duel restore + comeback rider width + stronger visual fallbacks ==== */
.mgp-mode-inline-visual .mgp-inline-visual-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.58), transparent 20%),
    linear-gradient(135deg, rgba(241,231,214,.95), rgba(232,219,199,.88));
}
.mgp-mode-inline-visual .mgp-inline-visual-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  font-size: 0;
  color: transparent;
}
.mgp-mode-inline-visual.is-fallback .mgp-inline-visual-media img {
  display: none !important;
}
.mgp-mode-inline-visual .mgp-inline-visual-fallback {
  position: absolute;
  inset: 0;
  display: block;
}
.mgp-mode-inline-visual:not(.is-fallback) .mgp-inline-visual-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
}
.mgp-duel-form-v21 {
  grid-template-columns: 1fr !important;
  width: 100%;
}
.mgp-duel-form-v21 .mgp-mode-rider-choices {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
}
.mgp-duel-form-v21 .mgp-key-choice {
  min-width: 0;
}
.mgp-comeback-layout-v24 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(260px, 1.28fr) !important;
}
.mgp-comeback-cell-rider {
  min-width: 0;
}
.mgp-comeback-cell-rider .mgp-key-choice,
.mgp-comeback-cell-rider .mgp-start-position-field {
  width: 100%;
}
@media (max-width: 1180px) {
  .mgp-duel-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mgp-comeback-layout-v24 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(240px, 1.25fr) !important;
  }
  .mgp-comeback-cell-rider {
    grid-column: auto !important;
  }
}
@media (max-width: 860px) {
  .mgp-duel-form-v21 .mgp-mode-rider-choices {
    grid-template-columns: 1fr !important;
  }
  .mgp-comeback-layout-v24 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mgp-comeback-cell-rider {
    grid-column: span 2 !important;
  }
}
@media (max-width: 640px) {
  .mgp-duel-context-grid,
  .mgp-comeback-layout-v24 {
    grid-template-columns: 1fr !important;
  }
  .mgp-comeback-cell-rider {
    grid-column: auto !important;
  }
}


/* ==== V26 Sprint vs Main 3-column setup ==== */
.mgp-sprint-main-layout-v26 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}
.mgp-sprint-main-cell {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.mgp-sprint-main-cell-visual .mgp-mode-inline-visual {
  width: 100%;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
}
.mgp-sprint-main-cell-visual .mgp-inline-visual-media,
.mgp-sprint-main-cell-visual .mgp-inline-visual-media img {
  width: 100%;
  height: 100%;
}
.mgp-sprint-main-cell .mgp-mode-field,
.mgp-sprint-main-cell .mgp-mode-field select {
  width: 100%;
}
@media (max-width: 980px) {
  .mgp-sprint-main-layout-v26 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  .mgp-sprint-main-layout-v26 {
    grid-template-columns: 1fr !important;
  }
  .mgp-sprint-main-cell-visual .mgp-mode-inline-visual {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
}


/* ==== V27 mobile collapsible mode menu ==== */
.mgp-tool-tabs-shell {
  position: relative;
  margin: 26px 0;
}
.mgp-tool-tabs-toggle {
  display: none;
  width: 100%;
  min-height: 62px;
  padding: 12px 16px;
  border-radius: 22px;
  border: 1px solid rgba(99,78,57,.12);
  background: rgba(255,255,255,.82);
  color: var(--mgp-ink);
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.mgp-tool-tabs-toggle-label {
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  font-weight: 900;
  color: var(--mgp-ink-soft);
}
.mgp-tool-tabs-toggle strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.2;
}
.mgp-tool-tabs-toggle-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239,228,212,.92);
  transition: transform .16s ease;
}
.mgp-tool-tabs-shell.is-open .mgp-tool-tabs-toggle-icon {
  transform: rotate(180deg);
}
@media (max-width: 768px) {
  .mgp-tool-tabs-shell {
    margin: 20px 0;
  }
  .mgp-tool-tabs-toggle {
    display: flex;
  }
  .mgp-tool-tabs {
    display: none;
    margin: 10px 0 0;
    padding: 10px;
    border-radius: 22px;
  }
  .mgp-tool-tabs-shell.is-open .mgp-tool-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .mgp-tool-tab {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
  }
}


/* ==== V28 Weather Chaos 3-column setup ==== */
.mgp-weather-layout-v28 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}
.mgp-weather-cell {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.mgp-weather-cell-visual .mgp-mode-inline-visual {
  width: 100%;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
}
.mgp-weather-cell-visual .mgp-inline-visual-media,
.mgp-weather-cell-visual .mgp-inline-visual-media img {
  width: 100%;
  height: 100%;
}
.mgp-weather-cell .mgp-mode-field,
.mgp-weather-cell .mgp-mode-field select {
  width: 100%;
}
@media (max-width: 980px) {
  .mgp-weather-layout-v28 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  .mgp-weather-layout-v28 {
    grid-template-columns: 1fr !important;
  }
  .mgp-weather-cell-visual .mgp-mode-inline-visual {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
}


/* ==== V29 Weather result card readability fix (PC + mobile) ==== */
.mgp-weather-scenario-card {
  overflow: hidden;
}
.mgp-weather-winner .mgp-mode-rider-card {
  min-height: 170px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top name score"
    "top meta score"
    "top rank score";
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
}
.mgp-weather-winner .mgp-mode-rider-top {
  grid-area: top;
  align-self: start;
  display: grid;
  gap: 8px;
}
.mgp-weather-winner .mgp-mode-rider-card > strong {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-weather-winner .mgp-mode-rider-meta {
  grid-area: meta;
}
.mgp-weather-winner .mgp-mode-rider-card > em {
  grid-area: rank;
}
.mgp-weather-winner .mgp-mode-score {
  grid-area: score;
  justify-self: end;
  align-self: end;
  font-size: clamp(28px, 3vw, 44px) !important;
}
.mgp-weather-winner .mgp-mode-winner-icon {
  width: 38px;
  height: 38px;
}
.mgp-weather-chasers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.mgp-weather-chasers .mgp-mode-rider-card {
  min-width: 0;
  min-height: 160px;
  padding: 12px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "top"
    "name"
    "meta"
    "rank"
    "score";
  grid-auto-rows: min-content;
  align-content: start;
  gap: 8px;
}
.mgp-weather-chasers .mgp-mode-rider-top {
  grid-area: top;
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.mgp-weather-chasers .mgp-mode-rider-card > strong {
  grid-area: name;
  min-width: 0;
  font-size: 15px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-weather-chasers .mgp-mode-rider-meta {
  grid-area: meta;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-weather-chasers .mgp-mode-rider-card > em {
  grid-area: rank;
  justify-self: start;
}
.mgp-weather-chasers .mgp-mode-score {
  grid-area: score;
  justify-self: end;
  align-self: end;
  font-size: 20px !important;
  line-height: 1;
}
.mgp-weather-chasers .mgp-mode-rider-badge {
  display: none;
}
.mgp-weather-chasers .mgp-mode-rider-card .mgp-rider-avatar {
  width: 40px;
  height: 40px;
}
.mgp-weather-chasers .mgp-race-number {
  min-width: 38px;
  height: 28px;
}
.mgp-weather-chasers .mgp-race-number img {
  max-width: 48px;
  max-height: 28px;
}
@media (max-width: 860px) {
  .mgp-weather-winner .mgp-mode-rider-card {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    grid-template-areas:
      "top name score"
      "top meta score"
      "top rank score" !important;
    align-items: center;
  }
  .mgp-weather-winner .mgp-mode-rider-top {
    grid-row: auto !important;
  }
  .mgp-weather-winner .mgp-mode-score {
    justify-self: end !important;
  }
}
@media (max-width: 640px) {
  .mgp-weather-chasers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mgp-weather-chasers .mgp-mode-rider-card {
    min-height: 150px;
    padding: 10px;
  }
  .mgp-weather-chasers .mgp-mode-rider-card > strong {
    font-size: 14px;
  }
  .mgp-weather-chasers .mgp-mode-score {
    font-size: 18px !important;
  }
}


/* ==== V30 Manufacturer Duel 5-column setup ==== */
.mgp-manufacturer-layout-v30 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(260px, 1.28fr) !important;
  gap: 16px !important;
  align-items: start !important;
}
.mgp-manufacturer-cell {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.mgp-manufacturer-cell-visual .mgp-mode-inline-visual {
  width: 100%;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
}
.mgp-manufacturer-cell-visual .mgp-inline-visual-media,
.mgp-manufacturer-cell-visual .mgp-inline-visual-media img {
  width: 100%;
  height: 100%;
}
.mgp-manufacturer-cell .mgp-mode-field,
.mgp-manufacturer-cell .mgp-mode-field select {
  width: 100%;
}
.mgp-manufacturer-cell-pick {
  min-width: 0;
}
.mgp-manufacturer-cell-pick .mgp-key-choice,
.mgp-manufacturer-cell-pick .mgp-choice-preview-card {
  width: 100%;
}
@media (max-width: 1180px) {
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(240px, 1.22fr) !important;
  }
  .mgp-manufacturer-cell-pick {
    grid-column: span 1 !important;
  }
}
@media (max-width: 860px) {
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mgp-manufacturer-cell-pick {
    grid-column: span 2 !important;
  }
}
@media (max-width: 640px) {
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: 1fr !important;
  }
  .mgp-manufacturer-cell-pick {
    grid-column: auto !important;
  }
  .mgp-manufacturer-cell-visual .mgp-mode-inline-visual {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
}


/* ==== V31 mobile weather + manufacturer overflow/result fixes ==== */
.mgp-mode-field select {
  box-sizing: border-box;
  max-width: 100%;
}

/* Weather Chaos winner card on mobile */
.mgp-weather-winner .mgp-mode-rider-card {
  overflow: hidden;
}
@media (max-width: 640px) {
  .mgp-weather-winner .mgp-mode-rider-card {
    min-height: 170px;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "top top"
      "name name"
      "meta meta"
      "rank score" !important;
    row-gap: 10px;
    align-items: end;
  }
  .mgp-weather-winner .mgp-mode-rider-top {
    grid-area: top;
    grid-row: auto !important;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .mgp-weather-winner .mgp-mode-rider-card > strong {
    grid-area: name;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
  }
  .mgp-weather-winner .mgp-mode-rider-meta {
    grid-area: meta;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
  }
  .mgp-weather-winner .mgp-mode-rider-card > em {
    grid-area: rank;
    justify-self: start;
  }
  .mgp-weather-winner .mgp-mode-score {
    grid-area: score;
    justify-self: end !important;
    align-self: end;
    font-size: 18px !important;
  }
}

/* Manufacturer Duel form overflow */
.mgp-manufacturer-layout-v30 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(320px, 1.42fr) !important;
}
.mgp-manufacturer-cell-pick,
.mgp-manufacturer-cell-pick .mgp-key-choice,
.mgp-manufacturer-cell-pick .mgp-mode-field,
.mgp-manufacturer-cell-pick .mgp-mode-field select,
.mgp-manufacturer-cell-pick .mgp-mode-select-preview,
.mgp-manufacturer-cell-pick .mgp-choice-preview-card,
.mgp-manufacturer-cell-pick .mgp-choice-preview-card > div {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.mgp-manufacturer-cell-pick {
  overflow: hidden;
}
.mgp-manufacturer-cell-pick .mgp-key-choice {
  overflow: hidden;
}
.mgp-manufacturer-cell-pick .mgp-choice-preview-card {
  overflow: hidden;
}
@media (max-width: 1180px) {
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(280px, 1.3fr) !important;
  }
}
@media (max-width: 860px) {
  .mgp-manufacturer-cell-pick .mgp-choice-preview-card {
    gap: 10px;
  }
}
@media (max-width: 640px) {
  .mgp-manufacturer-cell-pick .mgp-key-choice {
    padding: 12px;
  }
  .mgp-manufacturer-cell-pick .mgp-choice-preview-card strong {
    font-size: 15px;
  }
  .mgp-manufacturer-cell-pick .mgp-choice-preview-card span {
    font-size: 11px;
  }
}

/* Manufacturer Duel result best rider placement */
.mgp-manufacturer-result-grid .mgp-mode-brand-card {
  overflow: hidden;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card {
  min-height: 160px;
  overflow: hidden;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top name score"
    "top meta score"
    "top rank score";
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-top {
  grid-area: top;
  align-self: start;
  display: grid;
  gap: 8px;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card > strong {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-meta {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card > em {
  grid-area: rank;
  justify-self: start;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-score {
  grid-area: score;
  justify-self: end;
  align-self: end;
  font-size: 20px !important;
}
@media (max-width: 640px) {
  .mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "top top"
      "name name"
      "meta meta"
      "rank score" !important;
    row-gap: 10px;
    align-items: end;
  }
  .mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-top {
    grid-row: auto !important;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-score {
    justify-self: end;
  }
}


/* ==== V32 Manufacturer Duel mobile vertical stack ==== */
@media (max-width: 860px) {
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .mgp-manufacturer-cell,
  .mgp-manufacturer-cell-pick {
    grid-column: auto !important;
    width: 100%;
    min-width: 0;
  }
  .mgp-manufacturer-cell-visual .mgp-mode-inline-visual {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
  .mgp-manufacturer-cell .mgp-mode-field,
  .mgp-manufacturer-cell .mgp-mode-field select,
  .mgp-manufacturer-cell-pick .mgp-mode-field,
  .mgp-manufacturer-cell-pick .mgp-mode-field select,
  .mgp-manufacturer-cell-pick .mgp-mode-select-preview,
  .mgp-manufacturer-cell-pick .mgp-choice-preview-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .mgp-manufacturer-cell-pick .mgp-key-choice {
    width: 100%;
    max-width: 100%;
  }
}


/* ==== V33 Weather name, Sprint-vs-Main mobile name, and nav arrows only ==== */
/* Weather Chaos winner card: free more width for rider name */
.mgp-weather-winner .mgp-mode-rider-card {
  min-height: 170px;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "top top"
    "name score"
    "meta score"
    "rank score" !important;
  row-gap: 8px;
  column-gap: 14px;
  align-items: end;
}
.mgp-weather-winner .mgp-mode-rider-top {
  grid-area: top;
  grid-row: auto !important;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.mgp-weather-winner .mgp-mode-rider-card > strong {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(16px, 1.9vw, 22px);
  line-height: 1.1;
}
.mgp-weather-winner .mgp-mode-rider-meta {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-weather-winner .mgp-mode-rider-card > em {
  grid-area: rank;
  justify-self: start;
}
.mgp-weather-winner .mgp-mode-score {
  grid-area: score;
  justify-self: end !important;
  align-self: end;
}

/* Sprint vs Main result hero: make name readable on mobile */
@media (max-width: 640px) {
  .mgp-sprint-main-hero > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }
  .mgp-sprint-main-hero strong {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 18px;
    line-height: 1.1;
  }
  .mgp-sprint-main-hero .mgp-rider-avatar {
    width: 42px;
    height: 42px;
  }
  .mgp-sprint-main-hero .mgp-race-number {
    min-width: 38px;
    height: 28px;
  }
  .mgp-sprint-main-hero .mgp-race-number img {
    max-width: 48px;
    max-height: 28px;
  }
}

/* Result pager buttons with arrows only */
.mgp-result-nav {
  font-size: 0;
  position: relative;
  min-width: 52px;
}
.mgp-result-nav::before {
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}
.mgp-result-nav[data-result-nav="prev"]::before {
  content: '←';
}
.mgp-result-nav[data-result-nav="next"]::before {
  content: '→';
}


/* ==== V34 share workflow loader ==== */
.mgp-share-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(245, 240, 232, 0.76);
  backdrop-filter: blur(5px);
}
.mgp-share-loader[hidden] {
  display: none !important;
}
.mgp-share-loader-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(99,78,57,.15);
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 50px rgba(79, 62, 44, 0.16);
  text-align: center;
}
.mgp-share-loader-card strong {
  font-size: 22px;
  line-height: 1.15;
}
.mgp-share-loader-card p {
  margin: 0;
  color: var(--mgp-ink-soft);
}
.mgp-share-loader-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 2px;
  border-radius: 999px;
  border: 5px solid rgba(99,78,57,.16);
  border-top-color: #339c4e;
  animation: mgpShareSpin .8s linear infinite;
}
@keyframes mgpShareSpin {
  to { transform: rotate(360deg); }
}


/* ==========================================================================
   V43 — Portrait / winner layout refinements
   ========================================================================== */

/* Never show initials fallbacks when a real image is present. */
.mgp-rider-avatar:not(.is-fallback) .mgp-rider-avatar-fallback,
.mgp-result-avatar:not(.is-fallback) .mgp-rider-avatar-fallback,
.mgp-brand-badge:not(.is-fallback) .mgp-brand-badge-fallback,
.mgp-manufacturer-logo:not(.is-fallback) .mgp-manufacturer-logo-fallback,
.mgp-effect-icon:not(.is-fallback) .mgp-asset-fallback,
.mgp-mode-winner-icon:not(.is-fallback) .mgp-mode-winner-fallback {
  display: none !important;
}

.mgp-rider-avatar.is-fallback .mgp-rider-avatar-fallback,
.mgp-result-avatar.is-fallback .mgp-rider-avatar-fallback,
.mgp-brand-badge.is-fallback .mgp-brand-badge-fallback,
.mgp-manufacturer-logo.is-fallback .mgp-manufacturer-logo-fallback,
.mgp-effect-icon.is-fallback .mgp-asset-fallback,
.mgp-mode-winner-icon.is-fallback .mgp-mode-winner-fallback {
  display: flex !important;
}

.mgp-rider-avatar:not(.is-fallback) img,
.mgp-result-avatar:not(.is-fallback) img,
.mgp-brand-badge:not(.is-fallback) img,
.mgp-manufacturer-logo:not(.is-fallback) img {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Race Predictor hero winner: remove the square tile and keep the portrait clean. */
.mgp-winner-portrait {
  width: 136px !important;
  min-width: 136px !important;
  height: 126px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  display: grid !important;
  place-items: start center !important;
}

.mgp-winner-portrait-avatar {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.mgp-winner-portrait-avatar .mgp-rider-avatar {
  width: 92px !important;
  height: 92px !important;
  transform: none !important;
  transform-origin: center center !important;
}

.mgp-winner-portrait-overlay {
  inset: -4px 10px 26px 10px !important;
  z-index: 1;
}

.mgp-winner-portrait-overlay img {
  width: 122px !important;
  max-width: none !important;
  height: auto !important;
  object-fit: contain !important;
}

.mgp-winner-portrait-badge {
  right: 14px !important;
  top: 2px !important;
  z-index: 3;
}

.mgp-winner-portrait-name {
  left: 4px !important;
  right: 4px !important;
  bottom: 0 !important;
  z-index: 4;
}

/* Comeback result selected rider: remove the rounded square plate and center the visual. */
.mgp-comeback-rider-hero {
  width: 144px !important;
  height: 126px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid !important;
  place-items: center !important;
}

.mgp-comeback-rider-hero .mgp-rider-visual {
  width: 100%;
  height: 100%;
  display: grid !important;
  place-items: center !important;
  gap: 6px !important;
}

.mgp-comeback-rider-hero .mgp-rider-avatar {
  width: 84px !important;
  height: 84px !important;
  transform: none !important;
  transform-origin: center center !important;
}

.mgp-comeback-rider-hero .mgp-race-number {
  min-width: 56px !important;
  height: 30px !important;
}

/* Sprint vs Main Race: make the highlighted winners visibly larger. */
.mgp-sprint-main-hero .mgp-rider-avatar {
  width: 66px !important;
  height: 66px !important;
  transform: none !important;
  transform-origin: center center !important;
}

.mgp-sprint-main-hero .mgp-race-number {
  min-width: 44px !important;
  height: 30px !important;
}

.mgp-sprint-main-hero > div {
  gap: 16px !important;
}

/* Sprint/Main lower podium panels now hold P2 and P3 only. */
.mgp-mode-podium-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 780px) {
  .mgp-winner-portrait {
    margin-inline: auto !important;
  }

  .mgp-mode-podium-secondary {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   V44 — Size / shape refinements for rider portraits in result screens
   ========================================================================== */

/* Global safeguard: keep every rider avatar perfectly round and never squashed. */
.mgp-rider-avatar,
.mgp-result-avatar {
  aspect-ratio: 1 / 1 !important;
  border-radius: 999px !important;
  flex: 0 0 auto !important;
  overflow: hidden !important;
}

.mgp-rider-avatar img,
.mgp-result-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 999px !important;
}

/* Compact result cards across modes: larger portraits overall. */
.mgp-mode-rider-card .mgp-rider-avatar {
  width: 58px !important;
  height: 58px !important;
}

.mgp-mode-rider-card .mgp-rider-visual {
  gap: 10px !important;
}

/* Winner cards can be larger than the rest. */
.mgp-mode-rider-card.is-mode-winner .mgp-rider-avatar {
  width: 72px !important;
  height: 72px !important;
}

.mgp-mode-rider-card.is-mode-winner .mgp-race-number {
  min-width: 46px !important;
  height: 32px !important;
  font-size: 14px !important;
}

/* 1) Comeback hero: bigger portrait, no extra circular plate feeling. */
.mgp-comeback-rider-hero {
  width: 136px !important;
  height: 132px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.mgp-comeback-rider-hero .mgp-rider-visual {
  width: auto !important;
  height: auto !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
}

.mgp-comeback-rider-hero .mgp-rider-avatar {
  width: 104px !important;
  height: 104px !important;
  border-width: 2px !important;
  box-shadow: none !important;
}

.mgp-comeback-rider-hero .mgp-race-number {
  min-width: 52px !important;
  height: 32px !important;
  font-size: 14px !important;
}

/* 2) In podium result lists, portraits can be larger. */
.mgp-comeback-podium .mgp-mode-rider-card .mgp-rider-avatar,
.mgp-weather-result-grid .mgp-weather-chasers .mgp-mode-rider-card .mgp-rider-avatar,
.mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-rider-avatar,
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-rider-avatar {
  width: 60px !important;
  height: 60px !important;
}

/* 3) Sprint vs Main Race winners: larger and strictly round. */
.mgp-sprint-main-hero .mgp-rider-avatar {
  width: 82px !important;
  height: 82px !important;
  min-width: 82px !important;
  flex-basis: 82px !important;
  border-radius: 999px !important;
}

.mgp-sprint-main-hero .mgp-race-number {
  min-width: 48px !important;
  height: 32px !important;
  font-size: 14px !important;
}

.mgp-sprint-main-hero > div {
  gap: 18px !important;
}

/* Sprint/Main result cards: raise the score slightly. */
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-mode-score {
  position: relative !important;
  top: -10px !important;
}

/* 4) Weather chaos winners: larger portraits than P2/P3. */
.mgp-weather-result-grid .mgp-weather-winner .mgp-mode-rider-card.is-mode-winner .mgp-rider-avatar {
  width: 78px !important;
  height: 78px !important;
}

.mgp-weather-result-grid .mgp-weather-winner .mgp-mode-rider-card.is-mode-winner .mgp-race-number {
  min-width: 46px !important;
  height: 32px !important;
}

/* 5) Manufacturer Duel result: larger rider portraits in both brand cards. */
.mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-rider-avatar {
  width: 72px !important;
  height: 72px !important;
}

.mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-race-number {
  min-width: 44px !important;
  height: 30px !important;
}

/* Weather / Sprint / Manufacturer result cards can breathe a bit more. */
.mgp-weather-result-grid .mgp-mode-rider-card,
.mgp-manufacturer-result-grid .mgp-mode-rider-card,
.mgp-sprint-main-podiums .mgp-mode-rider-card {
  gap: 10px !important;
}

@media (max-width: 900px) {
  .mgp-sprint-main-hero .mgp-rider-avatar {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    flex-basis: 72px !important;
  }

  .mgp-weather-result-grid .mgp-weather-winner .mgp-mode-rider-card.is-mode-winner .mgp-rider-avatar,
  .mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-rider-avatar {
    width: 66px !important;
    height: 66px !important;
  }

  .mgp-comeback-rider-hero .mgp-rider-avatar {
    width: 96px !important;
    height: 96px !important;
  }
}


/* =====================================================================
   V45 — Winner tags + comeback / sprint / weather / manufacturer tweaks
   ===================================================================== */

/* Replace every cup/laurel winner icon by the green WINNER tag. */
.mgp-mode-winner-icon {
  margin-left: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 38px !important;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  background: #2f9e44 !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.mgp-mode-winner-icon img,
.mgp-mode-winner-fallback {
  display: none !important;
}
.mgp-mode-winner-icon::before {
  content: "Winner";
}

/* 1) Comeback result hero: bigger image, no beige circle/card behind. */
.mgp-comeback-rider-hero {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  justify-self: end !important;
}
.mgp-comeback-rider-hero .mgp-rider-visual {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  gap: 8px !important;
}
.mgp-comeback-rider-hero .mgp-rider-avatar {
  width: 112px !important;
  height: 112px !important;
  min-width: 112px !important;
}
.mgp-comeback-rider-hero .mgp-race-number {
  min-width: 64px !important;
  height: 32px !important;
}

/* 2) Comeback lower podium cards. */
.mgp-comeback-podium .mgp-mode-winner-icon {
  align-self: flex-start !important;
  margin-top: 6px !important;
}
.mgp-comeback-podium .mgp-mode-rider-card .mgp-mode-score {
  position: relative !important;
  top: -22px !important;
}
.mgp-comeback-podium .mgp-mode-rider-card .mgp-rider-avatar {
  width: 64px !important;
  height: 64px !important;
}

/* 3) Sprint vs Main Race hero winners. */
.mgp-sprint-main-hero > div {
  align-items: center !important;
}
.mgp-sprint-main-hero .mgp-mode-winner-icon {
  align-self: flex-start !important;
  margin-left: auto !important;
  margin-top: -6px !important;
}
.mgp-sprint-main-hero .mgp-rider-avatar {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  flex-basis: 96px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 999px !important;
}
.mgp-sprint-main-podiums .mgp-mode-rider-badge {
  display: none !important;
}
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-mode-score {
  position: relative !important;
  top: -26px !important;
}

/* 4) Weather Chaos. */
.mgp-weather-result-grid .mgp-weather-winner .mgp-mode-winner-icon {
  align-self: flex-start !important;
  margin-top: 6px !important;
}
.mgp-weather-result-grid .mgp-weather-chasers .mgp-mode-rider-card .mgp-mode-score {
  position: relative !important;
  top: -18px !important;
}
.mgp-weather-result-grid .mgp-weather-winner .mgp-mode-rider-card.is-mode-winner .mgp-rider-avatar {
  width: 92px !important;
  height: 92px !important;
}

/* 5) Manufacturer result. */
.mgp-manufacturer-result-grid .mgp-mode-winner-icon,
.mgp-brand-card-head .mgp-mode-winner-icon {
  align-self: start !important;
}
.mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-rider-avatar {
  width: 84px !important;
  height: 84px !important;
}
.mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-mode-score {
  position: relative !important;
  top: -8px !important;
}

@media (max-width: 900px) {
  .mgp-comeback-rider-hero .mgp-rider-avatar {
    width: 96px !important;
    height: 96px !important;
    min-width: 96px !important;
  }
  .mgp-sprint-main-hero .mgp-rider-avatar {
    width: 84px !important;
    height: 84px !important;
    min-width: 84px !important;
    flex-basis: 84px !important;
  }
  .mgp-weather-result-grid .mgp-weather-winner .mgp-mode-rider-card.is-mode-winner .mgp-rider-avatar,
  .mgp-manufacturer-result-grid .mgp-mode-rider-card .mgp-rider-avatar {
    width: 76px !important;
    height: 76px !important;
  }
}


/* ==========================================================================
   V46 — Saved custom grid scenario + contextual grid editor modal
   ========================================================================== */

.mgp-grid-head-v46 {
  align-items: start;
}

.mgp-grid-status-stack {
  display: grid;
  gap: 10px;
  min-width: min(320px, 100%);
}

.mgp-grid-saved-status {
  border: 1px solid rgba(99,78,57,.14);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,.82);
  color: var(--mgp-ink-soft);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.mgp-grid-actions-v46 {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mgp-grid-scenario-box {
  margin-top: 18px;
  margin-bottom: 18px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(99,78,57,.14);
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.82), transparent 25%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,240,229,.90));
}

.mgp-grid-scenario-copy {
  display: grid;
  gap: 5px;
}

.mgp-grid-scenario-copy strong {
  color: var(--mgp-ink);
  font-size: 16px;
}

.mgp-grid-scenario-copy p {
  margin: 0;
  color: var(--mgp-ink-soft);
  line-height: 1.45;
}

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

.mgp-grid-scenario-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid rgba(99,78,57,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.84);
  cursor: pointer;
  color: var(--mgp-ink);
  font-weight: 800;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.mgp-grid-scenario-option:hover {
  transform: translateY(-1px);
}

.mgp-grid-scenario-option.is-selected {
  border-color: rgba(47,130,62,.36);
  background: rgba(235,249,236,.92);
}

.mgp-grid-scenario-option.is-disabled {
  opacity: .56;
  cursor: not-allowed;
}

.mgp-grid-scenario-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.mgp-grid-scenario-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mgp-grid-editor-open {
  overflow: hidden;
}

.mgp-grid-editor-modal[hidden] {
  display: none !important;
}

.mgp-grid-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 28px;
}

.mgp-grid-editor-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(38, 28, 20, .56);
  backdrop-filter: blur(4px);
}

.mgp-grid-editor-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 30px;
  border: 1px solid rgba(99,78,57,.16);
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.94), transparent 26%),
    linear-gradient(180deg, #fffdf9, #f5ede2);
  box-shadow: 0 28px 80px rgba(43,30,18,.28);
}

.mgp-grid-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.mgp-grid-editor-head h3 {
  margin-bottom: 6px;
}

.mgp-grid-editor-head p {
  margin: 0;
  color: var(--mgp-ink-soft);
  line-height: 1.5;
}

.mgp-grid-editor-rider-panel {
  margin: 0 !important;
}

.mgp-grid-editor-frame {
  max-height: min(58vh, 720px);
  overflow: auto;
  padding: 14px;
  border-radius: 26px;
  border: 1px solid rgba(99,78,57,.14);
  background: rgba(255,255,255,.82);
}

.mgp-grid-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.mgp-effect-icon {
  border-color: rgba(99,78,57,.16);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.mgp-effect-condition-default,
.mgp-effect-bike-default {
  background: rgba(237,226,208,.92);
}

.mgp-effect-condition-strong_form,
.mgp-effect-bike-improved_package {
  background: rgba(218,242,220,.95);
  border-color: rgba(47,130,62,.28);
  color: #276d36;
}

.mgp-effect-condition-below_usual_level,
.mgp-effect-bike-slightly_off {
  background: rgba(251,232,196,.95);
  border-color: rgba(173,120,33,.30);
  color: #8b5f16;
}

.mgp-effect-condition-struggling,
.mgp-effect-bike-major_setup_struggle {
  background: rgba(249,214,209,.96);
  border-color: rgba(175,72,52,.30);
  color: #9b3c2e;
}

.mgp-effect-condition-withdrawn {
  background: rgba(226,224,224,.96);
  border-color: rgba(86,79,79,.28);
  color: #585252;
}

@media (max-width: 980px) {
  .mgp-grid-scenario-options {
    grid-template-columns: 1fr;
  }

  .mgp-grid-head-v46 {
    grid-template-columns: 1fr !important;
  }

  .mgp-grid-status-stack {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .mgp-grid-editor-modal {
    padding: 12px;
  }

  .mgp-grid-editor-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 16px;
    border-radius: 24px;
  }

  .mgp-grid-editor-head {
    display: grid;
  }

  .mgp-grid-editor-actions {
    justify-content: stretch;
  }

  .mgp-grid-editor-actions .mgp-button {
    width: 100%;
  }
}


/* ==========================================================================
   V47 — Saved toast + share portrait source + Race Predictor place tags
   ========================================================================== */

.mgp-custom-grid-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 12000;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  padding: 13px 22px;
  border-radius: 999px;
  background: #2f9e44;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: 0 18px 38px rgba(31, 92, 47, .28);
  transition: opacity .32s ease, transform .32s ease;
}

.mgp-custom-grid-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mgp-result-rider {
  position: relative;
}

.mgp-result-place-tag,
.mgp-inline-winner-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #2f9e44;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.mgp-result-place-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.mgp-result-scenario-line {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.mgp-inline-winner-tag {
  min-height: 36px;
  padding-inline: 14px;
}

@media (max-width: 760px) {
  .mgp-custom-grid-toast {
    bottom: 18px;
    font-size: 15px;
    padding: 12px 18px;
  }

  .mgp-result-place-tag {
    top: 12px;
    right: 12px;
    min-height: 34px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .mgp-result-scenario-line {
    align-items: flex-start;
  }
}


/* ==========================================================================
   V48 — Black place tags + external helmet / bike status icon system
   ========================================================================== */

/* Race result podium ranking tags: smaller, black, distinct from green Winner. */
.mgp-result-place-tag {
  min-height: 30px !important;
  padding: 7px 11px !important;
  border-radius: 999px !important;
  background: #1f1915 !important;
  color: #f2a13b !important;
  border: 1px solid rgba(242, 161, 59, .34) !important;
  font-size: 11px !important;
  letter-spacing: .06em !important;
}

/* Rider / bike status badges in grid cards. */
.mgp-grid-effects {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
}

.mgp-effect-pair {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  color: inherit !important;
}

.mgp-effect-grade {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 11px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.mgp-grade-a { background: #2f9e44 !important; }
.mgp-grade-b { background: #d5b16b !important; color: #fff !important; }
.mgp-grade-c { background: #e28a22 !important; }
.mgp-grade-d { background: #a95647 !important; }
.mgp-grade-x { background: #1f1915 !important; }

.mgp-effect-pair .mgp-effect-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

.mgp-effect-pair .mgp-effect-icon img {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 2px rgba(47, 34, 23, .12));
}

.mgp-effect-pair .mgp-effect-icon.is-fallback {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.88) !important;
  border: 1px solid rgba(99,78,57,.14) !important;
}

.mgp-effect-pair .mgp-effect-icon.is-fallback .mgp-asset-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #6b563f;
}

@media (max-width: 760px) {
  .mgp-result-place-tag {
    min-height: 28px !important;
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  .mgp-grid-effects {
    gap: 10px !important;
  }

  .mgp-effect-grade {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 14px !important;
  }

  .mgp-effect-pair .mgp-effect-icon,
  .mgp-effect-pair .mgp-effect-icon img {
    width: 34px !important;
    height: 34px !important;
  }
}


/* ==========================================================================
   V49 — Smaller scenario badges + race result rider status row
   ========================================================================== */
.mgp-effect-grade {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

.mgp-effect-pair {
  gap: 6px !important;
}

.mgp-effect-pair .mgp-effect-icon,
.mgp-effect-pair .mgp-effect-icon img {
  width: 28px !important;
  height: 28px !important;
}

.mgp-grid-effects {
  gap: 12px !important;
}

.mgp-result-rider-bottom {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.mgp-result-rider-status {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.mgp-result-rider-status .mgp-effect-pair {
  gap: 5px !important;
}

.mgp-result-rider-status .mgp-effect-grade {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  border-radius: 7px !important;
  font-size: 11px !important;
}

.mgp-result-rider-status .mgp-effect-icon,
.mgp-result-rider-status .mgp-effect-icon img {
  width: 24px !important;
  height: 24px !important;
}

.mgp-result-rider-score {
  margin-left: auto !important;
  justify-self: end !important;
  text-align: right !important;
}

@media (max-width: 760px) {
  .mgp-effect-grade {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
  }

  .mgp-effect-pair .mgp-effect-icon,
  .mgp-effect-pair .mgp-effect-icon img {
    width: 24px !important;
    height: 24px !important;
  }

  .mgp-result-rider-bottom {
    align-items: center !important;
  }

  .mgp-result-rider-status {
    gap: 10px !important;
  }
}


/* ==== V54 shared mode visual glow + remove permanent light veil ==== */
.mgp-mode-inline-visual {
  position: relative;
}
.mgp-mode-inline-visual .mgp-inline-visual-media {
  background: linear-gradient(135deg, #efe4d4, #f8f1e8);
}
.mgp-mode-inline-visual .mgp-inline-visual-fallback {
  display: none;
}
.mgp-mode-inline-visual.is-fallback .mgp-inline-visual-fallback {
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.58), transparent 20%),
    linear-gradient(135deg, rgba(241,231,214,.95), rgba(232,219,199,.88));
}
.mgp-mode-inline-visual:not(.is-fallback) .mgp-inline-visual-fallback,
.mgp-mode-inline-visual:not(.is-fallback) .mgp-inline-visual-fallback::before,
.mgp-mode-inline-visual:not(.is-fallback) .mgp-inline-visual-fallback::after {
  display: none !important;
  content: none !important;
}
.mgp-mode-inline-visual.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: mgp-shimmer 0.9s linear 1;
  pointer-events: none;
  z-index: 3;
}


/* ==== V57 team logos + manufacturer asset fallback paths ==== */
.mgp-team-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 56px;
  min-height: 36px;
  padding: 4px 7px;
  border-radius: 14px;
  border: 1px solid rgba(99,78,57,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,236,224,.94));
  box-shadow: 0 8px 18px rgba(63,44,28,.07);
}
.mgp-team-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.mgp-team-logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .06em;
  color: #8f6338;
}
.mgp-team-logo.is-fallback img { display: none !important; }
.mgp-team-logo.is-fallback .mgp-team-logo-fallback { display: inline-flex; }
.mgp-team-logo:not(.is-fallback) .mgp-team-logo-fallback { display: none !important; }

.mgp-choice-preview-card.has-team-logo {
  position: relative;
  padding-right: 104px;
}
.mgp-choice-preview-card .mgp-team-logo-preview {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 74px;
  height: 52px;
  transform: translateY(-50%);
}

.mgp-mode-rider-card.has-team-logo {
  position: relative;
  padding-right: 96px;
}
.mgp-mode-rider-card .mgp-team-logo-card {
  position: absolute;
  top: 78px;
  right: 14px;
  width: 74px;
  height: 52px;
}
.mgp-comeback-podium .mgp-mode-rider-card .mgp-team-logo-card {
  top: 86px;
  right: 16px;
}
.mgp-weather-result-grid .mgp-weather-winner .mgp-mode-rider-card .mgp-team-logo-card {
  top: 82px;
  right: 16px;
  width: 78px;
  height: 54px;
}
.mgp-weather-result-grid .mgp-weather-chasers .mgp-mode-rider-card.has-team-logo {
  padding-right: 62px;
}
.mgp-weather-result-grid .mgp-weather-chasers .mgp-mode-rider-card .mgp-team-logo-card {
  top: 88px;
  right: 10px;
  width: 48px;
  height: 34px;
  border-radius: 11px;
  padding: 3px 5px;
}

.mgp-sprint-main-hero {
  position: relative;
}
.mgp-sprint-main-full-name {
  display: block;
  margin: 6px 0 10px;
  max-width: calc(100% - 16px);
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.15;
  color: var(--mgp-ink);
  white-space: normal;
}
.mgp-sprint-main-hero .mgp-team-logo-hero {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 84px;
  height: 56px;
}
.mgp-sprint-main-hero > div {
  min-height: 86px;
  padding-right: 104px;
}

@media (max-width: 920px) {
  .mgp-choice-preview-card.has-team-logo { padding-right: 92px; }
  .mgp-choice-preview-card .mgp-team-logo-preview {
    width: 64px;
    height: 46px;
    right: 10px;
  }
  .mgp-mode-rider-card.has-team-logo { padding-right: 82px; }
  .mgp-mode-rider-card .mgp-team-logo-card {
    width: 62px;
    height: 44px;
    right: 10px;
  }
  .mgp-sprint-main-hero .mgp-team-logo-hero {
    width: 72px;
    height: 48px;
    right: 10px;
    bottom: 12px;
  }
  .mgp-sprint-main-hero > div { padding-right: 88px; }
}


/* ==== V58 visual card cleanup + transparent logos ==== */
.mgp-team-logo,
.mgp-manufacturer-logo {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
.mgp-team-logo-fallback,
.mgp-manufacturer-logo-fallback {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.mgp-team-logo-card,
.mgp-team-logo-preview,
.mgp-team-logo-hero {
  width: 72px !important;
  height: 38px !important;
}
.mgp-team-logo-card img,
.mgp-team-logo-preview img,
.mgp-team-logo-hero img,
.mgp-manufacturer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mgp-mode-rider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  grid-area: header;
  min-width: 0;
}
.mgp-mode-rider-header > strong {
  margin: 0 !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mgp-mode-rider-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mgp-mode-rank-pill,
.mgp-mode-rider-card > em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 48px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b48854, #906235) !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
}
.mgp-mode-rider-card .mgp-inline-winner-tag {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}
.mgp-mode-rider-card > em { font-style: normal; }
.mgp-mode-team-slot {
  grid-area: team;
  align-self: end;
  justify-self: start;
}
.mgp-mode-rider-meta {
  grid-area: meta;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-mode-score {
  grid-area: score;
  align-self: end;
  justify-self: end;
  line-height: 1;
}

.mgp-mode-rider-card.has-team-logo {
  padding-right: 18px !important;
}

/* Unified podium / weather / manufacturer rider cards */
.mgp-comeback-podium .mgp-mode-rider-card,
.mgp-weather-result-grid .mgp-mode-rider-card,
.mgp-sprint-main-podiums .mgp-mode-rider-card,
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card {
  display: grid !important;
  grid-template-columns: 72px minmax(0,1fr) auto;
  grid-template-areas:
    "avatar header header"
    "avatar meta meta"
    "team . score" !important;
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
  min-height: 190px;
  padding: 16px !important;
  overflow: hidden;
}
.mgp-comeback-podium .mgp-mode-rider-card .mgp-mode-rider-top,
.mgp-weather-result-grid .mgp-mode-rider-card .mgp-mode-rider-top,
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-mode-rider-top,
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card .mgp-mode-rider-top {
  grid-area: avatar;
  display: block !important;
}
.mgp-comeback-podium .mgp-mode-rider-card .mgp-rider-avatar,
.mgp-weather-result-grid .mgp-mode-rider-card .mgp-rider-avatar,
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-rider-avatar,
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card .mgp-rider-avatar {
  width: 64px !important;
  height: 64px !important;
}
.mgp-comeback-podium .mgp-mode-rider-card .mgp-race-number,
.mgp-weather-result-grid .mgp-mode-rider-card .mgp-race-number,
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-race-number,
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card .mgp-race-number {
  margin-top: 8px;
}
.mgp-comeback-podium .mgp-mode-rider-card > strong,
.mgp-weather-result-grid .mgp-mode-rider-card > strong,
.mgp-sprint-main-podiums .mgp-mode-rider-card > strong,
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card > strong { display:none !important; }
.mgp-comeback-podium .mgp-mode-rider-card .mgp-mode-score,
.mgp-weather-result-grid .mgp-mode-rider-card .mgp-mode-score,
.mgp-sprint-main-podiums .mgp-mode-rider-card .mgp-mode-score,
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card .mgp-mode-score {
  position: static !important;
  top: auto !important;
  font-size: clamp(24px, 3vw, 44px) !important;
}

/* Duel result cards */
.mgp-mode-duel-result .mgp-mode-rider-card {
  display: grid !important;
  grid-template-columns: 72px minmax(0,1fr) auto;
  grid-template-areas:
    "avatar header tags"
    "avatar meta tags"
    "team . score" !important;
  column-gap: 12px;
  row-gap: 8px;
  min-height: 176px;
  padding: 16px !important;
}
.mgp-mode-duel-result .mgp-mode-rider-top {
  grid-area: avatar;
  display: block !important;
}
.mgp-mode-duel-result .mgp-mode-rider-card > strong,
.mgp-mode-duel-result .mgp-mode-rider-card > em { display:none !important; }
.mgp-mode-duel-result .mgp-mode-rider-tags { grid-area: tags; align-self: start; }
.mgp-mode-duel-result .mgp-mode-score { position: static !important; }

/* Choice preview cards in selectors */
.mgp-choice-preview-card.has-team-logo {
  display: grid !important;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px !important;
}
.mgp-choice-preview-card .mgp-team-logo-preview {
  position: static !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
}
.mgp-choice-preview-card > div { min-width: 0; }

/* Sprint vs Main hero winners */
.mgp-sprint-main-hero {
  overflow: hidden;
}
.mgp-sprint-main-hero .mgp-sprint-main-full-name {
  margin: 0 !important;
  max-width: none !important;
}
.mgp-sprint-main-hero-body {
  display: grid;
  grid-template-columns: 90px minmax(0,1fr) auto;
  grid-template-areas:
    "avatar header header"
    "avatar meta team"
    "avatar . score";
  gap: 10px 14px;
  align-items: start;
  padding: 0 !important;
}
.mgp-sprint-main-hero-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.mgp-sprint-main-hero-visual { grid-area: avatar; }
.mgp-sprint-main-hero-meta {
  grid-area: meta;
  color: var(--mgp-ink-soft);
}
.mgp-sprint-main-hero-team {
  grid-area: team;
  align-self: center;
  justify-self: end;
}
.mgp-sprint-main-hero .mgp-mode-score {
  grid-area: score;
  font-size: clamp(24px, 3vw, 44px) !important;
}
.mgp-sprint-main-hero .mgp-rider-avatar {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
}
.mgp-sprint-main-hero .mgp-race-number {
  margin-top: 8px;
}
.mgp-sprint-main-hero .mgp-mode-winner-icon,
.mgp-sprint-main-hero > div > strong { display:none !important; }

/* Weather winner should match other rider cards */
.mgp-weather-winner .mgp-mode-rider-card {
  min-height: 190px !important;
}
.mgp-weather-winner .mgp-mode-rider-card > em { display:none !important; }

/* Manufacturer duel best rider cards */
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card .mgp-mode-rider-tags {
  align-self: start;
}
.mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card .mgp-mode-rider-meta {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .mgp-mode-duel-result .mgp-mode-rider-card,
  .mgp-comeback-podium .mgp-mode-rider-card,
  .mgp-weather-result-grid .mgp-mode-rider-card,
  .mgp-sprint-main-podiums .mgp-mode-rider-card,
  .mgp-manufacturer-result-grid .mgp-mode-brand-card .mgp-mode-rider-card,
  .mgp-sprint-main-hero-body {
    grid-template-columns: 64px minmax(0,1fr) auto;
  }
  .mgp-team-logo-card,
  .mgp-team-logo-preview,
  .mgp-team-logo-hero {
    width: 60px !important;
    height: 32px !important;
  }
}


/* ==========================================================================
   V59 — unified rider result cards across modes
   ========================================================================== */
.mgp-unified-rider-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(99,78,57,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,245,239,.98));
  overflow: hidden;
  min-width: 0;
}
.mgp-unified-rider-card.is-winner {
  border-color: rgba(122, 186, 130, .52);
  box-shadow: 0 14px 26px rgba(47, 158, 68, .08);
}
.mgp-unified-rider-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.mgp-unified-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(237,226,208,.92);
  color: var(--mgp-ink);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.mgp-unified-rider-awards {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mgp-unified-place-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #1f1915;
  color: #f2a13b;
  border: 1px solid rgba(242, 161, 59, .34);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.mgp-unified-rider-body {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.mgp-unified-rider-main {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.mgp-unified-rider-copy {
  min-width: 0;
}
.mgp-unified-rider-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-unified-rider-copy span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--mgp-ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-unified-rider-logo {
  align-self: center;
  justify-self: end;
}
.mgp-unified-rider-logo .mgp-team-logo-card,
.mgp-choice-preview-logo .mgp-team-logo-preview,
.mgp-sprint-main-hero .mgp-team-logo-card {
  width: 68px !important;
  height: 34px !important;
}
.mgp-unified-rider-logo .mgp-team-logo,
.mgp-choice-preview-logo .mgp-team-logo,
.mgp-sprint-main-hero .mgp-team-logo,
.mgp-manufacturer-result-grid .mgp-unified-rider-card .mgp-team-logo,
.mgp-weather-result-grid .mgp-unified-rider-card .mgp-team-logo {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.mgp-unified-rider-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.mgp-unified-rider-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.mgp-unified-rider-status .mgp-result-rider-status {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}
.mgp-unified-rider-score {
  margin-left: auto;
  font-size: clamp(24px, 2.4vw, 48px);
  line-height: .95;
  font-weight: 900;
  color: #9a6729;
  white-space: nowrap;
}
.mgp-unified-rider-card .mgp-rider-visual {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.mgp-unified-rider-card .mgp-rider-avatar {
  width: 52px !important;
  height: 52px !important;
}
.mgp-unified-rider-card .mgp-race-number {
  margin-top: 6px;
}
.mgp-comeback-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mgp-mode-podium-secondary,
.mgp-weather-chasers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.mgp-mode-duel-result .mgp-unified-rider-card,
.mgp-sprint-main-summary .mgp-unified-rider-card,
.mgp-manufacturer-result-grid .mgp-unified-rider-card,
.mgp-weather-result-grid .mgp-unified-rider-card,
.mgp-comeback-podium .mgp-unified-rider-card,
.mgp-mode-podium-secondary .mgp-unified-rider-card {
  min-height: 170px;
}
.mgp-sprint-main-hero {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.mgp-sprint-main-hero > span,
.mgp-weather-scenario-card > span,
.mgp-mode-mini-panel > span {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--mgp-ink-soft);
}
.mgp-choice-preview-card-unified {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px !important;
}
.mgp-choice-preview-main {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.mgp-choice-preview-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mgp-choice-preview-copy span {
  display: block;
  font-size: 12px;
  color: var(--mgp-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mgp-choice-preview-logo { justify-self: end; }
@media (max-width: 1100px) {
  .mgp-mode-duel-result,
  .mgp-sprint-main-summary,
  .mgp-manufacturer-result-grid,
  .mgp-weather-result-grid {
    grid-template-columns: 1fr !important;
  }
  .mgp-comeback-podium { grid-template-columns: 1fr !important; }
}
@media (max-width: 760px) {
  .mgp-mode-podium-secondary,
  .mgp-weather-chasers { grid-template-columns: 1fr; }
  .mgp-unified-rider-card { padding: 12px; border-radius: 18px; }
  .mgp-unified-rider-copy strong { font-size: 14px; }
  .mgp-unified-rider-copy span { font-size: 11px; }
  .mgp-unified-rider-score { font-size: 30px; }
  .mgp-unified-rider-logo .mgp-team-logo-card,
  .mgp-choice-preview-logo .mgp-team-logo-preview { width: 56px !important; height: 28px !important; }
}


/* ==========================================================================
   V60 — weather result card tweaks + mobile/hover tooltips for status icons
   ========================================================================== */
.mgp-unified-rider-awards .mgp-inline-winner-tag {
  color: #fff !important;
}

.mgp-effect-pair[data-tooltip] {
  position: relative;
  cursor: pointer;
}

.mgp-effect-pair[data-tooltip]::after,
.mgp-effect-pair[data-tooltip]::before {
  position: absolute;
  left: 0;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 30;
}

.mgp-effect-pair[data-tooltip]::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 10px);
  min-width: 180px;
  max-width: 240px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(31, 25, 21, 0.96);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(31, 25, 21, .22);
}

.mgp-effect-pair[data-tooltip]::before {
  content: '';
  bottom: calc(100% + 4px);
  width: 10px;
  height: 10px;
  background: rgba(31, 25, 21, 0.96);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.mgp-effect-pair[data-tooltip]:hover::after,
.mgp-effect-pair[data-tooltip]:hover::before,
.mgp-effect-pair[data-tooltip]:focus-visible::after,
.mgp-effect-pair[data-tooltip]:focus-visible::before,
.mgp-effect-pair[data-tooltip].is-tooltip-open::after,
.mgp-effect-pair[data-tooltip].is-tooltip-open::before {
  opacity: 1;
  transform: translateY(0);
}

.mgp-unified-rider-card--weather-chaser {
  gap: 10px;
  min-height: 208px !important;
  padding: 12px 12px 10px;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-topline {
  gap: 6px;
  margin-bottom: -2px;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-awards {
  display: none;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-body {
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: flex-start;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-main {
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: flex-start;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-copy {
  order: -1;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-copy strong {
  font-size: 17px;
  line-height: 1.05;
  white-space: nowrap;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-copy span {
  font-size: 11px;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-logo {
  justify-self: start;
  align-self: start;
  margin-left: 56px;
  margin-top: -2px;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-logo .mgp-team-logo-card {
  width: 58px !important;
  height: 29px !important;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-bottom {
  align-items: flex-end;
  gap: 10px;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-score {
  font-size: clamp(20px, 2vw, 34px);
  line-height: .92;
}

.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-status {
  gap: 10px;
}

.mgp-weather-result-grid .mgp-weather-chasers {
  align-items: stretch;
}

.mgp-weather-result-grid .mgp-weather-chasers .mgp-unified-rider-card {
  min-width: 0;
}

@media (max-width: 980px) {
  .mgp-unified-rider-card--weather-chaser {
    min-height: 190px !important;
  }

  .mgp-unified-rider-card--weather-chaser .mgp-unified-rider-copy strong {
    font-size: 15px;
  }

  .mgp-effect-pair[data-tooltip]::after {
    max-width: 210px;
  }
}


/* ==========================================================================
   V61 — preview-card harmonization + global tooltip + weather chaser cleanup
   ========================================================================== */
.mgp-choice-preview-card-unified--positioned {
  grid-template-columns: minmax(0,1fr) auto !important;
  grid-template-areas:
    "top logo"
    "main logo";
  align-items: center;
  gap: 10px 14px;
}
.mgp-choice-preview-card-unified--positioned .mgp-choice-preview-topline { grid-area: top; }
.mgp-choice-preview-card-unified--positioned .mgp-choice-preview-main { grid-area: main; min-width: 0; }
.mgp-choice-preview-card-unified--positioned .mgp-choice-preview-logo {
  grid-area: logo;
  justify-self: end;
  align-self: center;
}
.mgp-choice-preview-card-unified--positioned .mgp-choice-preview-copy strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 14px;
}
.mgp-choice-preview-card-unified--positioned .mgp-choice-preview-copy span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
}
.mgp-choice-preview-card-unified--positioned .mgp-rider-avatar {
  width: 48px !important;
  height: 48px !important;
}
.mgp-choice-preview-card-unified--positioned .mgp-race-number {
  margin-top: 6px;
}

.mgp-effect-pair[data-tooltip]::after,
.mgp-effect-pair[data-tooltip]::before {
  display: none !important;
}

.mgp-global-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(31, 25, 21, 0.97);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 10px 26px rgba(31, 25, 21, .22);
  pointer-events: none;
}
.mgp-global-tooltip[hidden] { display: none !important; }

.mgp-weather-result-grid .mgp-unified-place-tag {
  background: #1f1915;
  color: #f2a13b;
  border-color: rgba(242, 161, 59, .34);
}
.mgp-weather-result-grid .mgp-inline-winner-tag {
  color: #fff !important;
}
.mgp-weather-chaser-head {
  display: grid;
  gap: 2px;
}
.mgp-weather-chaser-head strong {
  display: block;
  font-size: 16px;
  line-height: 1.08;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-weather-chaser-head span {
  display: block;
  font-size: 11px;
  color: var(--mgp-ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgp-weather-chaser-visuals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 56px;
}
.mgp-weather-chaser-rider,
.mgp-weather-chaser-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mgp-unified-rider-card--weather-chaser {
  gap: 10px;
  min-height: 210px !important;
  padding: 12px 12px 10px;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-topline {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-awards {
  display: none;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-logo,
.mgp-unified-rider-card--weather-chaser .mgp-weather-chaser-logo {
  justify-self: center;
  align-self: center;
  margin: 0;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-logo .mgp-team-logo-card,
.mgp-unified-rider-card--weather-chaser .mgp-weather-chaser-logo .mgp-team-logo-card {
  width: 54px !important;
  height: 27px !important;
}
.mgp-unified-rider-card--weather-chaser .mgp-rider-visual {
  align-items: center;
}
.mgp-unified-rider-card--weather-chaser .mgp-rider-avatar {
  width: 48px !important;
  height: 48px !important;
}
.mgp-unified-rider-card--weather-chaser .mgp-race-number {
  margin-top: 6px;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-bottom {
  align-items: flex-end;
  gap: 10px;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-status {
  gap: 8px;
}
.mgp-unified-rider-card--weather-chaser .mgp-unified-rider-score {
  font-size: clamp(18px, 1.65vw, 28px);
  line-height: .95;
}
@media (max-width: 980px) {
  .mgp-choice-preview-card-unified--positioned {
    grid-template-areas:
      "top"
      "main"
      "logo";
    grid-template-columns: 1fr !important;
  }
  .mgp-choice-preview-card-unified--positioned .mgp-choice-preview-logo {
    justify-self: start;
  }
  .mgp-weather-chaser-visuals {
    justify-content: flex-start;
  }
}


/* ==========================================================================
   V62 — duel/comeback preview cards, comeback hero/meta, modal controls, manufacturer form
   ========================================================================== */
.mgp-global-tooltip {
  z-index: 10050;
}

.mgp-choice-preview-card-unified--scenario {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 14px 16px !important;
  min-height: 132px;
}
.mgp-choice-preview-card-unified--scenario.is-duel {
  grid-template-areas:
    "top top"
    "main logo"
    "status status";
}
.mgp-choice-preview-card-unified--scenario.is-comeback {
  grid-template-areas:
    "main logo"
    "status status";
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-topline {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-main {
  grid-area: main;
  min-width: 0;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-logo {
  grid-area: logo;
  justify-self: end;
  align-self: center;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-status {
  grid-area: status;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-status .mgp-result-rider-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-copy strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: 14px;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-copy span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
}
.mgp-choice-preview-card-unified--scenario .mgp-rider-avatar {
  width: 48px !important;
  height: 48px !important;
}
.mgp-choice-preview-card-unified--scenario .mgp-race-number {
  margin-top: 6px;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-logo .mgp-team-logo-preview {
  width: 62px !important;
  height: 31px !important;
}
.mgp-choice-preview-card-unified--scenario.is-comeback .mgp-choice-preview-main {
  align-items: center;
}

.mgp-comeback-callout {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.mgp-comeback-callout-main {
  min-width: 0;
}
.mgp-comeback-callout-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}
.mgp-comeback-score-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.mgp-comeback-inline-score {
  font-size: clamp(30px, 3.1vw, 46px);
  line-height: .9;
  font-weight: 900;
  color: #9a6729;
}
.mgp-comeback-score-copy > span {
  color: var(--mgp-ink-soft);
}
.mgp-comeback-callout-status .mgp-result-rider-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mgp-comeback-rider-hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-width: 118px;
}
.mgp-comeback-rider-hero .mgp-rider-visual {
  gap: 8px;
}
.mgp-comeback-rider-hero .mgp-rider-avatar {
  width: 96px !important;
  height: 96px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.mgp-comeback-rider-hero .mgp-race-number {
  margin-top: 8px;
}

.mgp-grid-editor-head {
  align-items: flex-start;
}
.mgp-grid-editor-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.mgp-grid-editor-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(99,78,57,.18);
  background: rgba(255,255,255,.94);
  color: var(--mgp-ink);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(43,30,18,.08);
}
.mgp-grid-editor-actions {
  display: none !important;
}

.mgp-manufacturer-layout-v30 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: start;
}
.mgp-manufacturer-picks-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.mgp-manufacturer-pick-card {
  min-width: 0;
}
.mgp-manufacturer-vs-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b57f3c, #915c1c);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow: 0 14px 30px rgba(149,92,28,.18);
}

@media (max-width: 1100px) {
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mgp-manufacturer-picks-row {
    grid-template-columns: 1fr;
  }
  .mgp-manufacturer-vs-pick {
    margin: 0 auto;
  }
}
@media (max-width: 980px) {
  .mgp-choice-preview-card-unified--scenario,
  .mgp-choice-preview-card-unified--scenario.is-duel,
  .mgp-choice-preview-card-unified--scenario.is-comeback {
    grid-template-areas:
      "top"
      "main"
      "logo"
      "status";
    grid-template-columns: 1fr !important;
  }
  .mgp-choice-preview-card-unified--scenario.is-comeback {
    grid-template-areas:
      "main"
      "logo"
      "status";
  }
  .mgp-choice-preview-card-unified--scenario .mgp-choice-preview-logo {
    justify-self: start;
  }
  .mgp-comeback-callout {
    grid-template-columns: 1fr;
  }
  .mgp-grid-editor-head {
    gap: 14px;
  }
  .mgp-grid-editor-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 760px) {
  .mgp-grid-editor-close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 18px;
  }
  .mgp-manufacturer-layout-v30 {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   V63 — layout touchups from QA pass
   ========================================================================== */
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-topline {
  min-height: 34px;
  align-items: center;
}
.mgp-choice-preview-card-unified--scenario .mgp-unified-rank-pill {
  min-width: 46px;
  min-height: 32px;
  padding: 0 14px;
}
.mgp-choice-preview-card-unified--scenario.is-comeback .mgp-choice-preview-main {
  align-items: flex-start;
}
.mgp-choice-preview-card-unified--scenario.is-comeback .mgp-choice-preview-copy {
  padding-top: 2px;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-status .mgp-result-rider-status {
  gap: 12px;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-status .mgp-effect-pair {
  align-items: center !important;
}
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-status .mgp-effect-icon,
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-status .mgp-effect-icon img {
  width: 28px !important;
  height: 28px !important;
  display: block !important;
}

.mgp-comeback-callout-meta {
  align-items: flex-start;
  gap: 12px 20px;
}
.mgp-comeback-score-copy {
  min-width: 100px;
}
.mgp-comeback-callout-status {
  display: flex;
  align-items: center;
  min-width: 0;
}
.mgp-comeback-callout-status .mgp-result-rider-status {
  gap: 14px;
}
.mgp-comeback-callout-status .mgp-effect-pair {
  align-items: center !important;
}
.mgp-comeback-callout-status .mgp-effect-icon,
.mgp-comeback-callout-status .mgp-effect-icon img {
  width: 28px !important;
  height: 28px !important;
  display: block !important;
}
.mgp-comeback-callout-status .mgp-effect-grade {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
}
.mgp-comeback-rider-hero .mgp-rider-visual {
  align-items: center;
}
.mgp-comeback-rider-hero .mgp-rider-avatar-wrap {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.mgp-grid-editor-head {
  gap: 10px;
}
.mgp-grid-editor-head > div:first-child {
  min-width: 0;
}
.mgp-grid-editor-head p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.mgp-grid-editor-head-actions {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "close close"
    "save clear";
  justify-content: end;
  align-items: start;
  gap: 8px;
}
.mgp-grid-editor-head-actions [data-action="save-custom-grid-modal"] { grid-area: save; }
.mgp-grid-editor-head-actions [data-action="clear-custom-grid-modal"] { grid-area: clear; }
.mgp-grid-editor-head-actions [data-close-grid-editor] { grid-area: close; justify-self: end; }
.mgp-grid-editor-head-actions .mgp-button {
  padding: 11px 18px;
  min-height: 42px;
  font-size: 14px;
  line-height: 1;
}
.mgp-grid-editor-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  border: 0;
  background: #cf3d32;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(207, 61, 50, .24);
}

@media (max-width: 980px) {
  .mgp-grid-editor-head p {
    white-space: normal;
  }
  .mgp-grid-editor-head-actions {
    width: auto;
  }
}


/* ==========================================================================
   V64 — preview badge centering, comeback status visibility, manufacturer rider alignment
   ========================================================================== */
.mgp-choice-preview-card-unified--scenario .mgp-choice-preview-topline {
  min-height: 36px;
  align-items: center;
}
.mgp-choice-preview-card-unified--scenario .mgp-unified-rank-pill {
  min-width: 48px;
  min-height: 32px;
  line-height: 1.1;
  padding: 1px 14px 0;
}

.mgp-comeback-callout-status,
.mgp-comeback-callout-status .mgp-result-rider-status {
  overflow: visible;
}
.mgp-comeback-callout-status .mgp-result-rider-status {
  gap: 16px;
  flex-wrap: wrap;
}
.mgp-comeback-callout-status .mgp-effect-pair {
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 7px !important;
}
.mgp-comeback-callout-status .mgp-effect-grade {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  font-size: 13px !important;
}
.mgp-comeback-callout-status .mgp-effect-icon {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  flex: 0 0 30px !important;
}
.mgp-comeback-callout-status .mgp-effect-icon img {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  display: block !important;
  opacity: 1 !important;
}

.mgp-mode-brand-card .mgp-unified-rider-main {
  align-items: center;
}
.mgp-mode-brand-card .mgp-unified-rider-copy {
  align-self: center;
  transform: translateY(-6px);
}
.mgp-mode-brand-card .mgp-unified-rider-copy strong {
  margin-bottom: 2px;
}

@media (max-width: 760px) {
  .mgp-mode-brand-card .mgp-unified-rider-copy {
    transform: translateY(-4px);
  }
}


/* ==========================================================================
   V65 — rider panel compact header + P-tag text centering
   ========================================================================== */
.mgp-rider-panel-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.mgp-rider-panel-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.mgp-rider-panel-team {
  margin: 0 !important;
  white-space: nowrap;
  flex: 1 1 auto;
}

.mgp-rider-panel-machine {
  margin-top: 0;
  flex: 0 0 auto;
}

.mgp-rider-panel-head h4 {
  margin: 0;
  line-height: 1.12;
}

.mgp-rider-panel-head {
  align-items: flex-start;
}

.mgp-choice-preview-card-unified--scenario .mgp-unified-rank-pill,
.mgp-choice-preview-card-unified.is-duel .mgp-unified-rank-pill,
.mgp-choice-preview-card-unified.is-comeback .mgp-unified-rank-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 14px !important;
  min-height: 32px !important;
}

@media (max-width: 860px) {
  .mgp-rider-panel-meta-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}
