.ride-qr-dialog {
  --control-ink: var(--ui-accent);
  --control-border: var(--ui-border-strong);
  --control-hover: var(--ui-accent-surface);
  --control-focus: var(--ui-focus);
  width: min(460px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 24px;
  color: var(--ui-text);
  background: var(--ui-surface-strong);
  box-shadow: 0 24px 80px color-mix(in srgb, var(--ui-shadow) 33.3%, transparent);
  text-align: left;
}
.ride-qr-dialog[open] { display: flex; flex-direction: column; }
.ride-qr-dialog::backdrop { background: color-mix(in srgb, var(--ui-surface-strong) 76.9%, transparent); }
.ride-qr-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 16px 20px; border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 6.3%, transparent); }
.ride-qr-header h2 { margin: 0; color: #fff; font-size: clamp(1.15rem, 4.5vw, 1.35rem); line-height: 1.3; letter-spacing: -.025em; }
.ride-qr-header .ride-qr-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid color-mix(in srgb, var(--ui-border) 11%, transparent); border-radius: 13px; background: color-mix(in srgb, var(--ui-text) 3.1%, transparent); color: var(--ui-accent); font: inherit; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.ride-qr-close:hover { background: color-mix(in srgb, var(--ui-text) 7.1%, transparent); }
.ride-qr-body { min-height: 0; padding: 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ui-text-secondary) transparent; }
.ride-qr-footer { flex-shrink: 0; max-height: 50vh; max-height: 50dvh; padding: 16px 20px 20px; overflow-y: auto; border-top: 1px solid color-mix(in srgb, var(--ui-border) 6.3%, transparent); background: var(--ui-surface-strong); overscroll-behavior: contain; }
.ride-qr-body .ride-qr-description { margin: 0 0 20px; color: var(--ui-text-muted); font-size: .88rem; line-height: 1.65; }
.ride-qr-code { display: grid; justify-items: center; gap: 10px; margin: 0 0 22px; }
.ride-qr-code .ride-qr-image { display: block; width: min(100%, 248px, 40vh); width: min(100%, 248px, 40dvh); height: auto; margin: 0; background: #fff; image-rendering: pixelated; }
.ride-qr-code figcaption { color: var(--ui-text-muted); font-size: .75rem; line-height: 1.5; text-align: center; }
.ride-qr-loading, .ride-qr-unavailable { max-width: 32ch; margin: 10px 0; color: var(--ui-accent); font-size: .85rem; line-height: 1.6; text-align: center; }
.ride-share-link-group { margin-bottom: 0; }
.ride-share-link-label { margin: 0 0 7px; color: var(--ui-text-muted); font-size: .76rem; font-weight: 650; }
.ride-qr-dialog .ride-share-link { width: 100%; min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--ui-border) 33.3%, transparent); border-radius: 13px; color: var(--ui-accent); background: color-mix(in srgb, var(--ui-surface-strong) 40%, transparent); overflow-wrap: anywhere; white-space: normal; user-select: all; font-size: .8rem; line-height: 1.65; }
.ride-qr-dialog .ride-qr-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ride-qr-dialog .ride-qr-actions > .button { width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 11px 12px; border-radius: 13px; font-size: .85rem; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
.ride-qr-dialog .ride-share-copy { grid-column: 1 / -1; }
.ride-qr-actions:not(.has-native-share) .ride-qr-download { grid-column: 1 / -1; }
.ride-qr-dialog .ride-share-feedback { margin: 14px 0 0; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--ui-border-strong) 16.9%, transparent); border-radius: 12px; color: var(--ui-accent); background: color-mix(in srgb, var(--ui-primary) 4.3%, transparent); font-size: .8rem; line-height: 1.6; }
.ride-share-feedback:empty { display: none; }
.ride-qr-dialog :is(button, a, .ride-share-link):focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 3px; }
@media (max-width: 360px) {
  .ride-qr-header { padding: 13px 16px; }
  .ride-qr-body { padding: 16px; }
  .ride-qr-footer { padding: 14px 16px 16px; }
}
@media (max-height: 650px) {
  .ride-qr-code .ride-qr-image { width: min(100%, 180px, 32dvh); }
}
@media (max-height: 500px) {
  .ride-qr-header { padding-block: 10px; }
  .ride-qr-body { padding-block: 14px; }
  .ride-qr-footer { padding-block: 10px; }
  .ride-qr-body .ride-qr-description { margin-bottom: 12px; font-size: .8rem; line-height: 1.5; }
  .ride-qr-code .ride-qr-image { width: min(100%, 120px); }
}
@media (max-height: 500px) and (min-width: 500px) {
  .ride-qr-dialog { width: min(720px, calc(100% - 24px)); }
  .ride-qr-body { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; gap: 12px 20px; }
  .ride-qr-body .ride-qr-description { grid-column: 2; margin: 0; }
  .ride-qr-code { grid-column: 1; grid-row: 1 / span 2; margin: 0; }
  .ride-qr-code .ride-qr-image { width: min(100%, 160px, 38dvh); }
  .ride-share-link-group { grid-column: 2; }
  .ride-qr-dialog .ride-qr-actions { grid-template-columns: 1.1fr 1fr 1.1fr; }
  .ride-qr-dialog .ride-share-copy { grid-column: auto; }
  .ride-qr-dialog .ride-qr-actions:not(.has-native-share) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ride-qr-actions:not(.has-native-share) .ride-qr-download { grid-column: auto; }
}

.roadcrew-ride-heading {
  margin-block: 16px;
  padding: clamp(18px, 4vw, 36px);
  background: linear-gradient(145deg, var(--ui-accent-surface), var(--ui-surface));
  border: 1px solid var(--ui-border-strong);
  border-radius: 20px;
}
.roadcrew-ride-heading h1 { margin-top: 0; overflow-wrap: anywhere; }
.roadcrew-ride-heading .button { min-height: 48px; white-space: normal; }
.roadcrew-ride-page #community-ride-actions { align-items: center; }
@media (max-width: 600px) {
  .roadcrew-ride-heading .button { width: 100%; }
}
