/* Routes · Add Document — full-screen fluid wizard (mobile + desktop) */

:root {
  --rdw-brand: #132a8e;
  --rdw-accent: #ff7a1a;
  --rdw-ink: #0e1116;
  --rdw-muted: #6b7280;
  --rdw-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rdw-dur: 420ms;
}

.rdw-root {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(255, 122, 26, 0.18), transparent 55%),
    radial-gradient(70% 50% at 0% 100%, rgba(19, 42, 142, 0.45), transparent 50%),
    linear-gradient(165deg, #07102e 0%, #132a8e 48%, #1a348f 100%);
  color: #fff;
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  opacity: 0;
  /* Avoid leaving a transform on the scroll container (breaks iOS overflow) */
  transition: opacity var(--rdw-dur) var(--rdw-ease);
}
.rdw-root.is-open {
  display: flex;
  opacity: 1;
  animation: rdw-in var(--rdw-dur) var(--rdw-ease) both;
}
@keyframes rdw-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.rdw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  padding: 1rem 1.35rem;
  padding-top: max(1rem, env(safe-area-inset-top));
}
.rdw-brand {
  font-family: "Plus Jakarta Sans", "DM Sans", sans-serif;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  text-transform: uppercase;
  opacity: 0.85;
}
.rdw-close {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
}
.rdw-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.04);
}

.rdw-progress {
  display: flex;
  gap: 0.4rem;
  flex: 0 0 auto;
  padding: 0 1.35rem 0.85rem;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Step rail (mobile = dots, desktop = labeled) */
.rdw-steps {
  display: flex;
  width: 100%;
  gap: 0.35rem;
  align-items: center;
}
.rdw-steps__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.rdw-steps__dot {
  width: 100%;
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.35s var(--rdw-ease), transform 0.35s;
}
.rdw-steps__item.is-done .rdw-steps__dot { background: var(--rdw-accent); }
.rdw-steps__item.is-active .rdw-steps__dot {
  background: #fff;
  transform: scaleY(1.35);
}
.rdw-steps__lab {
  display: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
  white-space: nowrap;
}
.rdw-steps__item.is-active .rdw-steps__lab,
.rdw-steps__item.is-done .rdw-steps__lab {
  opacity: 0.95;
}

.rdw-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0.35rem 1.15rem 1.6rem;
  padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
}
.rdw-shell {
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 0.5rem;
}

.rdw-card {
  background: #fff;
  color: var(--rdw-ink);
  border-radius: 1.65rem;
  padding: 1.45rem 1.3rem 1.5rem;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  animation: rdw-card-in 0.45s var(--rdw-ease) both;
}
@keyframes rdw-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.rdw-hero-band {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.35rem;
}
.rdw-hero-band__aside {
  display: none;
}
.rdw-orb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 30% 30%, #fff7ed, transparent 50%),
    linear-gradient(135deg, #ff7a1a, #132a8e);
  box-shadow: 0 16px 36px rgba(255, 122, 26, 0.35);
}

/* Desktop two-column step layout — stacks on mobile */
.rdw-layout {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.rdw-layout__copy,
.rdw-layout__stage {
  min-width: 0;
}
.rdw-sidepanel {
  margin-top: 0.85rem;
}
.rdw-sidepanel__title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rdw-brand);
  margin-bottom: 0.45rem;
}

.rdw-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rdw-brand);
}
.rdw-title {
  margin: 0.4rem 0 0.45rem;
  font-family: "Plus Jakarta Sans", "DM Sans", sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.rdw-sub {
  margin: 0;
  color: var(--rdw-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Existing docs hub */
.rdw-doc-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.15rem;
}
.rdw-doc-card {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem;
  border-radius: 1.1rem;
  border: 1px solid #e8ebf2;
  background: #f8fafc;
  text-align: left;
}
.rdw-doc-thumb {
  width: 4.5rem;
  height: 3.4rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #0e1116;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.rdw-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rdw-doc-meta strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.rdw-doc-meta span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--rdw-muted);
  text-transform: capitalize;
}
.rdw-status {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rdw-status.is-pending { background: #fff7ed; color: #c2410c; }
.rdw-status.is-verified { background: #ecfdf5; color: #047857; }
.rdw-status.is-rejected { background: #fef2f2; color: #b91c1c; }
.rdw-empty {
  margin-top: 1rem;
  padding: 1.1rem;
  border-radius: 1.1rem;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  border: 1px dashed #c7d2fe;
  color: #4338ca;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

/* Tips */
.rdw-tips {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.rdw-tips li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.4;
  padding: 0.55rem 0.65rem;
  border-radius: 0.85rem;
  background: #f8fafc;
}
.rdw-tips li::before {
  content: "✓";
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
}

/* Selfie camera */
.rdw-cam {
  position: relative;
  margin-top: 1.1rem;
  border-radius: 1.35rem;
  overflow: hidden;
  background: #0b1020;
  aspect-ratio: 3 / 4;
  max-height: min(42vh, 360px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.rdw-cam video,
.rdw-cam img,
.rdw-cam canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rdw-cam__ring {
  pointer-events: none;
  position: absolute;
  inset: 8% 14%;
  border: 2.5px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50% / 42%;
  box-shadow: 0 0 0 999px rgba(7, 12, 28, 0.42);
}
.rdw-cam__hint {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(7, 12, 28, 0.72);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.rdw-cam__hint.is-ok { background: rgba(4, 120, 87, 0.85); }
.rdw-cam__hint.is-bad { background: rgba(185, 28, 28, 0.85); }

/* Dropzone + preview */
.rdw-drop {
  margin-top: 1.1rem;
  border: 1.5px dashed #d1d5db;
  border-radius: 1.25rem;
  background: #f8fafc;
  padding: 1.45rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.rdw-drop:hover,
.rdw-drop.is-drag {
  border-color: var(--rdw-brand);
  background: #eef2ff;
  transform: translateY(-1px);
}
.rdw-drop__ico {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.55rem;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #132a8e, #1e40af);
  color: #fff;
  font-size: 1.15rem;
}
.rdw-drop strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
}
.rdw-drop span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--rdw-muted);
}

.rdw-preview {
  margin-top: 1.05rem;
  border-radius: 1.2rem;
  overflow: hidden;
  background: #0e1116;
  aspect-ratio: 16 / 10;
  position: relative;
  box-shadow: 0 12px 32px rgba(14, 17, 22, 0.18);
}
.rdw-preview img,
.rdw-preview embed,
.rdw-preview iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
}
.rdw-preview__badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rdw-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rdw-meta {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.rdw-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.rdw-pill.ok { background: #ecfdf5; color: #047857; }
.rdw-pill.warn { background: #fff7ed; color: #c2410c; }
.rdw-pill.bad { background: #fef2f2; color: #b91c1c; }

.rdw-fields {
  margin-top: 0.75rem;
  background: #f8fafc;
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
  font-size: 0.84rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
}
.rdw-fields dt {
  color: var(--rdw-muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rdw-fields dd {
  margin: 0.12rem 0 0;
  font-weight: 700;
}

.rdw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.rdw-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.88rem 1.25rem;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s var(--rdw-ease), box-shadow 0.18s, background 0.18s;
}
.rdw-btn:hover:not(:disabled) { transform: translateY(-1px); }
.rdw-btn:active:not(:disabled) { transform: translateY(0); }
.rdw-btn-primary {
  background: linear-gradient(135deg, #ff7a1a, #f97316);
  color: #fff;
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.38);
  flex: 1;
  min-width: 8rem;
}
.rdw-btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.45);
}
.rdw-btn-secondary {
  background: #eef2ff;
  color: var(--rdw-brand);
}
.rdw-btn-ghost {
  background: transparent;
  color: var(--rdw-muted);
}
.rdw-btn-dark {
  background: var(--rdw-brand);
  color: #fff;
  box-shadow: 0 12px 28px rgba(19, 42, 142, 0.28);
  flex: 1;
}
.rdw-btn--sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
}
.rdw-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.rdw-err {
  margin-top: 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}
.rdw-oknote {
  margin-top: 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.86rem;
  font-weight: 600;
}

.rdw-done-list {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}
.rdw-done-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eef0f3;
  font-size: 0.92rem;
  font-weight: 700;
}
.rdw-done-list li span:last-child {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rdw-muted);
}

/* Checkout success CTA overlay strip */
.rdw-next-steps {
  margin-top: 1.15rem;
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 1.35rem;
  background: linear-gradient(160deg, #0b1438 0%, #132a8e 55%, #1e3a8a 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(19, 42, 142, 0.28);
  animation: rdw-card-in 0.5s var(--rdw-ease) both;
}
.rdw-next-steps__kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}
.rdw-next-steps__title {
  margin: 0.35rem 0 0.2rem;
  font-family: "Plus Jakarta Sans", "DM Sans", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.rdw-next-steps__sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}
.rdw-next-steps__btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 1rem;
  padding: 0.95rem 1.1rem;
  font: 800 0.88rem/1 "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--rdw-ease), box-shadow 0.18s;
}
.rdw-next-steps__btn:hover { transform: translateY(-1px); }
.rdw-next-steps__btn--primary {
  background: #fff;
  color: var(--rdw-ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  margin-bottom: 0.55rem;
}
.rdw-next-steps__btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Hide SPA docs CTAs when we inject ours */
[data-rdw-checkout-patched] a[href="/dashboard/documents"],
[data-rdw-checkout-patched] a[href="/dashboard/trips"],
[data-rdw-checkout-patched] a[href="/search"] {
  display: none !important;
}

/* Confirmation page: clear sticky header so “Checkout done!” is visible */
html[data-rdw-confirmed="1"] #root > div > section.relative.overflow-hidden.bg-ink,
html[data-rdw-confirmed="1"] section.relative.overflow-hidden.bg-ink.text-white {
  padding-top: calc(4.75rem + env(safe-area-inset-top, 0px)) !important;
  scroll-margin-top: 5rem;
}
html[data-rdw-confirmed="1"] #root h1 {
  scroll-margin-top: 5.5rem;
}
@media (min-width: 768px) {
  html[data-rdw-confirmed="1"] #root > div > section.relative.overflow-hidden.bg-ink,
  html[data-rdw-confirmed="1"] section.relative.overflow-hidden.bg-ink.text-white {
    padding-top: calc(5.5rem + env(safe-area-inset-top, 0px)) !important;
  }
}

/* Sticky bottom: Next step · Add document */
.rdw-sticky-next {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  padding: 0.75rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid rgba(19, 42, 142, 0.1);
  box-shadow: 0 -12px 36px rgba(14, 17, 22, 0.12);
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s var(--rdw-ease), opacity 0.28s ease;
}
.rdw-sticky-next:not([hidden]) {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
.rdw-sticky-next__inner {
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.rdw-sticky-next__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.rdw-sticky-next__kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff7a1a;
}
.rdw-sticky-next__copy strong {
  font-family: "Plus Jakarta Sans", "DM Sans", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0e1116;
}
.rdw-sticky-next__btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font: 800 0.85rem/1 "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #ff7a1a, #f97316);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.35);
  cursor: pointer;
  transition: transform 0.18s var(--rdw-ease), box-shadow 0.18s;
}
.rdw-sticky-next__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.42);
}

/* Room so confirmation content isn't covered by sticky bar */
html.rdw-has-sticky-next #root {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  .rdw-sticky-next {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .rdw-sticky-next__inner {
    max-width: 44rem;
  }
}

/* Dashboard polish */
.rdw-dash-cta {
  margin: 0.75rem 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a1a, #f97316);
  color: #fff;
  font: 800 0.88rem "DM Sans", system-ui;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.3);
  transition: transform 0.18s var(--rdw-ease), box-shadow 0.18s;
}
.rdw-dash-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.38);
}

@media (min-width: 900px) {
  .rdw-root {
    background:
      radial-gradient(70% 55% at 12% 18%, rgba(255, 122, 26, 0.22), transparent 55%),
      radial-gradient(55% 45% at 88% 82%, rgba(99, 102, 241, 0.28), transparent 50%),
      linear-gradient(155deg, #050b22 0%, #0d1f6e 42%, #132a8e 72%, #1a348f 100%);
  }
  .rdw-top {
    padding: 1.35rem 2rem 0.65rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .rdw-brand {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
  }
  .rdw-close {
    width: 2.75rem;
    height: 2.75rem;
  }
  .rdw-progress {
    max-width: 1100px;
    padding: 0.35rem 2rem 1.1rem;
  }
  .rdw-steps {
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    backdrop-filter: blur(10px);
  }
  .rdw-steps__item {
    flex-direction: row;
    gap: 0.55rem;
    justify-content: center;
  }
  .rdw-steps__dot {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
  }
  .rdw-steps__item.is-active .rdw-steps__dot {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
  }
  .rdw-steps__lab {
    display: inline;
    font-size: 0.72rem;
  }

  .rdw-body {
    padding: 0.5rem 2rem 2.25rem;
    /* Desktop scroll must work inside the modal stage */
    overflow-y: auto;
  }
  .rdw-shell {
    max-width: 1060px;
    padding-bottom: 1.25rem;
  }

  .rdw-card,
  .rdw-card--wide {
    padding: 1.85rem 1.9rem 1.9rem;
    border-radius: 1.85rem;
    box-shadow:
      0 40px 90px rgba(0, 0, 0, 0.38),
      0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  .rdw-hero-band__aside {
    display: block;
  }
  .rdw-orb {
    width: 5.5rem;
    height: 5.5rem;
  }

  .rdw-title {
    font-size: 2rem;
    letter-spacing: -0.04em;
  }
  .rdw-sub {
    font-size: 1rem;
    max-width: 36rem;
  }

  /* Two-column: guidance | capture */
  .rdw-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: 1.75rem;
    align-items: start;
  }
  .rdw-layout__copy {
    position: sticky;
    top: 0;
    padding-right: 0.35rem;
  }
  .rdw-sidepanel {
    margin-top: 1.25rem;
    padding: 1rem 1.05rem;
    border-radius: 1.2rem;
    background: linear-gradient(165deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e0e7ff;
  }
  .rdw-tips {
    gap: 0.5rem;
  }
  .rdw-tips li {
    background: #fff;
    border: 1px solid #eef0f3;
  }

  .rdw-layout__stage {
    padding: 1.1rem;
    border-radius: 1.45rem;
    background:
      radial-gradient(80% 60% at 100% 0%, rgba(255, 122, 26, 0.08), transparent 55%),
      #f8fafc;
    border: 1px solid #e8ebf2;
  }

  .rdw-cam {
    max-height: 420px;
    aspect-ratio: 4 / 3;
    border-radius: 1.25rem;
  }
  .rdw-drop {
    min-height: 14rem;
    display: grid;
    place-content: center;
    gap: 0.15rem;
    border-radius: 1.35rem;
    border-width: 2px;
  }
  .rdw-preview {
    aspect-ratio: 16 / 11;
    border-radius: 1.25rem;
    min-height: 280px;
  }

  .rdw-doc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-top: 1.35rem;
  }
  .rdw-doc-card {
    grid-template-columns: 5.25rem 1fr auto;
    padding: 0.85rem;
    border-radius: 1.2rem;
    transition: transform 0.2s var(--rdw-ease), box-shadow 0.2s;
  }
  .rdw-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(19, 42, 142, 0.1);
  }

  .rdw-actions {
    margin-top: 1.35rem;
    gap: 0.7rem;
  }
  .rdw-actions--stage {
    margin-top: 1rem;
  }
  .rdw-btn {
    padding: 0.95rem 1.35rem;
    font-size: 0.92rem;
  }
  .rdw-btn-primary {
    min-width: 9.5rem;
  }
}

@media (min-width: 1200px) {
  .rdw-shell { max-width: 1120px; }
  .rdw-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 2rem;
  }
  .rdw-cam { max-height: 460px; }
}

@media (max-width: 767px) {
  .rdw-root.is-open {
    height: 100svh;
    max-height: 100svh;
  }
  .rdw-body {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
  .rdw-cam {
    max-height: min(38svh, 320px);
  }
  .rdw-actions {
    position: sticky;
    bottom: 0;
    padding-top: 0.35rem;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
  }
  /* On phone, keep tips after the stage feels cramped — show compact under copy is fine */
  .rdw-layout__stage .rdw-actions {
    position: static;
    background: none;
  }
}

html[data-rdw-open="1"],
html[data-rdw-open="1"] body {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}
html[data-rdw-open="1"] .rdw-body {
  touch-action: pan-y;
}

@media (prefers-reduced-motion: reduce) {
  .rdw-root,
  .rdw-card,
  .rdw-btn,
  .rdw-next-steps {
    animation: none !important;
    transition: none !important;
  }
}
