:root {
  --rf-vse-vvh: 100dvh;
  --rf-vse-safe-bottom: env(safe-area-inset-bottom, 0px);
  --rf-vse-ink: #0b1020;
  --rf-vse-panel: #151b31;
  --rf-vse-paper: #e6e8ef;
  --rf-vse-muted: #a0a6b9;
  --rf-vse-amber: #fbbf24;
  --rf-vse-green: #37d67a;
  --rf-vse-danger: #ff5c7a;
  --rf-vse-border: rgba(255, 255, 255, .13);
}

.rf-vse-dialog,
.rf-vse-dialog *,
.rf-vse-dialog *::before,
.rf-vse-dialog *::after {
  box-sizing: border-box;
}

.rf-vse-dialog [hidden] {
  display: none !important;
}

body.rf-vse-page-locked {
  overflow: hidden;
}

.rf-vse-open-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: 11px;
  background: rgba(251, 191, 36, .1);
  color: #fde68a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.rf-vse-open-button:hover {
  border-color: rgba(251, 191, 36, .62);
  background: rgba(251, 191, 36, .16);
}

.rf-vse-open-button:focus-visible,
.rf-vse-dialog :focus-visible {
  outline: 3px solid rgba(251, 191, 36, .45);
  outline-offset: 2px;
}

.rf-vse-dialog {
  width: min(680px, calc(100vw - 32px));
  max-width: 680px;
  max-height: calc(var(--rf-vse-vvh, 100dvh) - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--rf-vse-paper);
  background: linear-gradient(180deg, rgba(21, 27, 49, .995), rgba(10, 15, 31, .995));
  border: 1px solid rgba(251, 191, 36, .24);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .68);
  font-family: system-ui, -apple-system, "Segoe UI", Inter, Roboto, Arial, sans-serif;
}

.rf-vse-dialog::backdrop {
  background: rgba(4, 7, 16, .76);
  backdrop-filter: blur(7px);
}

.rf-vse-shell {
  position: relative;
  min-height: 0;
  max-height: calc(var(--rf-vse-vvh, 100dvh) - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rf-vse-head,
.rf-vse-foot {
  position: sticky;
  z-index: 4;
  flex: 0 0 auto;
  background: rgba(12, 18, 38, .985);
}

.rf-vse-head {
  top: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 11px 18px;
  border-bottom: 1px solid var(--rf-vse-border);
}

.rf-vse-head h2 {
  margin: 0;
  color: #fff;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.rf-vse-head p {
  margin: 3px 0 0;
  color: var(--rf-vse-muted);
  font-size: 12px;
  line-height: 1.35;
}

.rf-vse-icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rf-vse-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
  color: var(--rf-vse-paper);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.rf-vse-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 18px 22px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rf-vse-form-content {
  display: grid;
  gap: 16px;
}

.rf-vse-ticket {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 15px 18px;
  color: #241800;
  background: linear-gradient(120deg, #fcd34d 0%, var(--rf-vse-amber) 55%, #f59e0b 100%);
  border: 1px solid rgba(255, 236, 168, .72);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(217, 119, 6, .18);
}

.rf-vse-ticket::before,
.rf-vse-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rf-vse-panel);
  transform: translateY(-50%);
}

.rf-vse-ticket::before { left: -10px; }
.rf-vse-ticket::after { right: -10px; }

.rf-vse-ticket-id {
  min-width: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}

.rf-vse-ticket-code {
  letter-spacing: .14em;
}

.rf-vse-ticket-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(36, 24, 0, .38);
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.rf-vse-status-pill {
  align-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(36, 24, 0, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .32);
  color: #2b1d00;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.rf-vse-banner,
.rf-vse-error-summary {
  display: none;
  padding: 11px 13px;
  border: 1px solid var(--rf-vse-border);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.rf-vse-body > .rf-vse-error-summary.is-visible { margin-bottom: 14px; }

.rf-vse-banner.is-visible,
.rf-vse-error-summary.is-visible { display: block; }

.rf-vse-banner.info {
  color: #d8dded;
  background: rgba(124, 92, 255, .1);
  border-color: rgba(124, 92, 255, .26);
}

.rf-vse-banner.locked {
  color: #fde68a;
  background: rgba(251, 191, 36, .09);
  border-color: rgba(251, 191, 36, .3);
}

.rf-vse-error-summary {
  color: #fecdd3;
  background: rgba(255, 92, 122, .11);
  border-color: rgba(255, 92, 122, .34);
}

.rf-vse-error-summary strong {
  display: block;
  margin-bottom: 3px;
  color: #fff;
}

.rf-vse-retry {
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.rf-vse-section {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .095);
  border-radius: 14px;
  background: rgba(255, 255, 255, .032);
}

.rf-vse-section-title {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

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

.rf-vse-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.rf-vse-field.rf-vse-span-2 { grid-column: 1 / -1; }

.rf-vse-field label,
.rf-vse-fieldset legend {
  color: #dce1ef;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.3;
}

.rf-vse-field input,
.rf-vse-field select,
.rf-vse-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 11px;
  outline: none;
  background: rgba(5, 9, 22, .56);
  color: var(--rf-vse-paper);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
}

.rf-vse-field textarea {
  min-height: 88px;
  resize: vertical;
}

.rf-vse-field input:focus,
.rf-vse-field select:focus,
.rf-vse-field textarea:focus {
  border-color: rgba(251, 191, 36, .64);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .1);
}

.rf-vse-field input:disabled,
.rf-vse-field select:disabled,
.rf-vse-field textarea:disabled {
  opacity: 1;
  color: #aeb5c8;
  background: rgba(255, 255, 255, .035);
  cursor: not-allowed;
}

.rf-vse-field.is-invalid input,
.rf-vse-field.is-invalid select,
.rf-vse-field.is-invalid textarea,
.rf-vse-fieldset.is-invalid .rf-vse-payment-options {
  border-color: rgba(255, 92, 122, .68);
}

.rf-vse-lock-reason,
.rf-vse-field-error,
.rf-vse-help {
  min-height: 0;
  margin: 0;
  color: var(--rf-vse-muted);
  font-size: 12px;
  line-height: 1.4;
}

.rf-vse-lock-reason:empty,
.rf-vse-field-error:empty,
.rf-vse-help:empty { display: none; }

.rf-vse-lock-reason:not(:empty)::before { content: "🔒 "; }
.rf-vse-field-error { color: #fda4af; }

.rf-vse-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rf-vse-fieldset legend { margin-bottom: 7px; }

.rf-vse-payment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  background: rgba(5, 9, 22, .45);
}

.rf-vse-payment-option {
  position: relative;
  min-width: 0;
}

.rf-vse-payment-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rf-vse-payment-option span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #d5dae9;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}

.rf-vse-payment-option input:checked + span {
  color: #241800;
  background: var(--rf-vse-amber);
  border-color: rgba(255, 243, 196, .56);
}

.rf-vse-payment-option input:focus-visible + span {
  outline: 3px solid rgba(251, 191, 36, .43);
  outline-offset: 2px;
}

.rf-vse-payment-option input:disabled + span {
  color: #858da3;
  cursor: not-allowed;
}

.rf-vse-split-status {
  display: none;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
}

.rf-vse-split-status.is-visible { display: block; }
.rf-vse-split-status.ok { color: #bbf7d0; background: rgba(55, 214, 122, .1); }
.rf-vse-split-status.error { color: #fecdd3; background: rgba(255, 92, 122, .1); }

.rf-vse-preview {
  display: none;
  padding: 12px 13px;
  border: 1px solid rgba(55, 214, 122, .24);
  border-radius: 12px;
  background: rgba(55, 214, 122, .075);
}

.rf-vse-preview.is-visible { display: grid; gap: 6px; }
.rf-vse-preview strong { color: #d9ffea; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.rf-vse-preview-row { display: grid; grid-template-columns: minmax(88px, .7fr) 1fr; gap: 10px; color: #dce5df; font-size: 12px; line-height: 1.4; }
.rf-vse-preview-row span:last-child { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.rf-vse-history {
  border: 1px solid rgba(255, 255, 255, .095);
  border-radius: 14px;
  background: rgba(255, 255, 255, .026);
}

.rf-vse-history summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.rf-vse-history-list {
  display: grid;
  gap: 0;
  padding: 0 14px 12px;
}

.rf-vse-history-entry {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, .075);
  color: #d6dbe9;
  font-size: 12px;
  line-height: 1.45;
}

.rf-vse-history-entry time,
.rf-vse-history-entry .rf-vse-history-actor { color: var(--rf-vse-muted); }
.rf-vse-history-change { overflow-wrap: anywhere; }

.rf-vse-danger-zone {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(255, 92, 122, .24);
  border-radius: 14px;
  background: rgba(255, 92, 122, .045);
}

.rf-vse-danger-zone h3 { margin: 0; color: #fecdd3; font-size: 14px; }
.rf-vse-danger-zone p { margin: 0; color: #c9cfde; font-size: 12px; line-height: 1.45; }

.rf-vse-foot {
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px max(12px, calc(10px + var(--rf-vse-safe-bottom)));
  border-top: 1px solid var(--rf-vse-border);
  box-shadow: 0 -18px 38px rgba(0, 0, 0, .26);
}

.rf-vse-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.rf-vse-button.secondary { color: var(--rf-vse-paper); background: rgba(255, 255, 255, .065); border-color: var(--rf-vse-border); }
.rf-vse-button.primary { color: #06130c; background: linear-gradient(180deg, #45df89, var(--rf-vse-green)); box-shadow: 0 12px 26px rgba(55, 214, 122, .16); }
.rf-vse-button.warning { color: #241800; background: linear-gradient(180deg, #fcd34d, var(--rf-vse-amber)); }
.rf-vse-button.danger { color: #fff; background: rgba(255, 92, 122, .18); border-color: rgba(255, 92, 122, .44); }
.rf-vse-button:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; }

.rf-vse-loading {
  display: none;
  gap: 12px;
}

.rf-vse-loading.is-visible { display: grid; }
.rf-vse-skeleton { height: 62px; border-radius: 13px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.095), rgba(255,255,255,.04)); background-size: 220% 100%; animation: rf-vse-shimmer 1.2s linear infinite; }
.rf-vse-skeleton:first-child { height: 92px; }

.rf-vse-confirm-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 7, 16, .82);
  backdrop-filter: blur(5px);
}

.rf-vse-confirm-layer[hidden] { display: none; }

.rf-vse-confirm-box {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(251, 191, 36, .31);
  border-radius: 16px;
  background: #12192d;
  box-shadow: 0 26px 72px rgba(0, 0, 0, .58);
}

.rf-vse-confirm-box h3 { margin: 0; color: #fff; font-size: 18px; line-height: 1.3; }
.rf-vse-confirm-box p { margin: 0; color: #c9cfde; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.rf-vse-confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }

.rf-vse-redemption-note {
  color: #fde68a;
  font-weight: 750;
}

@keyframes rf-vse-shimmer { to { background-position: -220% 0; } }

@media (max-width: 680px) {
  .rf-vse-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: calc(var(--rf-vse-vvh, 100dvh) - 8px);
    inset: auto 0 0;
    margin: 0;
    border-radius: 18px 18px 0 0;
  }

  .rf-vse-shell { max-height: calc(var(--rf-vse-vvh, 100dvh) - 8px); }
  .rf-vse-head { padding-left: 14px; }
  .rf-vse-body { padding: 14px 14px 20px; }
  .rf-vse-grid { grid-template-columns: 1fr; }
  .rf-vse-field.rf-vse-span-2 { grid-column: auto; }
  .rf-vse-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px max(18px, calc(10px + var(--rf-vse-safe-bottom))); }
  .rf-vse-foot.is-single { grid-template-columns: 1fr; }
  .rf-vse-foot .rf-vse-button { width: 100%; padding-inline: 9px; }
  .rf-vse-confirm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-vse-confirm-actions .rf-vse-button { width: 100%; padding-inline: 8px; }
  .rf-vse-ticket { padding-inline: 16px; }
  .rf-vse-preview-row { grid-template-columns: 76px 1fr; }
  .rf-vse-table-action { width: 100%; min-height: 48px; }
}

@media (max-width: 390px) {
  .rf-vse-payment-options { grid-template-columns: 1fr; }
  .rf-vse-payment-option span { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .rf-vse-dialog,
  .rf-vse-dialog *,
  .rf-vse-open-button { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
