/* Relify onboarding — Stage 6 UI refinement
   Larger scrollable setup modal, real Relify wordmark and centered loading states. */

:root {
  --ro-bg: #ffffff;
  --ro-panel: #f1f2f5;
  --ro-panel-deep: #e7e9ee;
  --ro-text: #101114;
  --ro-muted: #6f7480;
  --ro-soft-text: #9499a4;
  --ro-line: #e5e7eb;
  --ro-control: #f7f7f8;
  --ro-primary: #111318;
  --ro-primary-hover: #252932;
  --ro-focus: rgba(17, 19, 24, 0.14);
  --ro-shadow: 0 34px 90px rgba(15, 23, 42, 0.22), 0 10px 28px rgba(15, 23, 42, 0.10);
}

html.dark {
  --ro-bg: #141518;
  --ro-panel: #1b1d22;
  --ro-panel-deep: #22252b;
  --ro-text: #f4f5f7;
  --ro-muted: #a6aab4;
  --ro-soft-text: #7f8490;
  --ro-line: #2c3038;
  --ro-control: #1e2025;
  --ro-primary: #f3f4f6;
  --ro-primary-hover: #ffffff;
  --ro-focus: rgba(255, 255, 255, 0.13);
  --ro-shadow: 0 34px 90px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.24);
}

body.ro-onboarding-open {
  overflow: hidden !important;
}

#relifyOnboardingHost {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: none;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

#relifyOnboardingHost.is-open {
  display: grid;
  pointer-events: auto;
}

.ro-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.26);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}

html.dark .ro-backdrop {
  background: rgba(0, 0, 0, 0.58);
}

#relifyOnboardingHost.is-visible .ro-backdrop {
  opacity: 1;
}

.ro-modal {
  position: relative;
  width: min(1220px, calc(100vw - 56px));
  height: min(780px, calc(100dvh - 56px));
  min-height: min(620px, calc(100dvh - 56px));
  max-height: calc(100dvh - 56px);
  display: grid;
  grid-template-columns: minmax(380px, 40%) minmax(0, 60%);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: var(--ro-bg);
  color: var(--ro-text);
  box-shadow: var(--ro-shadow);
  opacity: 0;
  transform: translateY(10px) scale(0.992);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ro-modal:focus,
.ro-modal:focus-visible {
  outline: none;
}

html.dark .ro-modal {
  border-color: rgba(255, 255, 255, 0.08);
}

#relifyOnboardingHost.is-visible .ro-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ro-visual {
  position: relative;
  min-height: 100%;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 18% 16%, rgba(77, 92, 138, 0.10), transparent 34%),
    linear-gradient(145deg, var(--ro-panel) 0%, #eceef2 100%);
  border-right: 1px solid rgba(17, 24, 39, 0.05);
}

html.dark .ro-visual {
  background:
    radial-gradient(circle at 18% 16%, rgba(120, 132, 180, 0.12), transparent 34%),
    linear-gradient(145deg, #1d2026 0%, #191b20 100%);
  border-right-color: rgba(255, 255, 255, 0.05);
}

.ro-visual-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ro-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 34px;
}

.ro-brand-logo {
  display: block;
  width: auto;
  height: 36px;
  max-width: 164px;
  object-fit: contain;
}

.ro-brand-logo-dark { display: none; }
html.dark .ro-brand-logo-light { display: none; }
html.dark .ro-brand-logo-dark { display: block; }

.ro-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--ro-muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

html.dark .ro-step-pill {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.ro-artboard {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 1 / 1;
  margin: 22px auto 18px;
  display: grid;
  place-items: center;
}

.ro-artboard::before,
.ro-artboard::after {
  content: "";
  position: absolute;
  border-radius: 28px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.ro-artboard::before {
  width: 72%;
  height: 70%;
  transform: translate(-18px, 16px) rotate(-4deg);
}

.ro-artboard::after {
  width: 74%;
  height: 70%;
  transform: translate(20px, -8px) rotate(4deg);
}

html.dark .ro-artboard::before,
html.dark .ro-artboard::after {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.20);
}


.ro-illustration-img {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 220ms ease;
}

.ro-artboard.has-image::before,
.ro-artboard.has-image::after,
.ro-artboard.has-image .ro-artboard-card {
  opacity: 0;
}

.ro-artboard.has-image .ro-illustration-img {
  opacity: 1;
  transform: translateY(0);
}

.ro-artboard-card {
  position: relative;
  z-index: 2;
  width: 76%;
  min-height: 66%;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(17, 24, 39, 0.09);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(0);
  transition: transform 240ms ease;
}

#relifyOnboardingHost.is-visible .ro-artboard-card {
  animation: roFloat 5s ease-in-out 500ms infinite;
}

html.dark .ro-artboard-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(27, 29, 34, 0.96);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.28);
}

.ro-artboard-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: transparent;
}

.ro-artboard-brand {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.ro-artboard-brand-dark { display: none; }
html.dark .ro-artboard-brand-light { display: none; }
html.dark .ro-artboard-brand-dark { display: block; }

.ro-artboard-lines { display: grid; gap: 8px; }
.ro-artboard-line {
  height: 8px;
  border-radius: 999px;
  background: #e9ebef;
}
.ro-artboard-line:nth-child(1) { width: 62%; }
.ro-artboard-line:nth-child(2) { width: 86%; }
.ro-artboard-line:nth-child(3) { width: 72%; }

html.dark .ro-artboard-line { background: #30343c; }

.ro-artboard-actions {
  display: flex;
  gap: 7px;
}

.ro-artboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
}

.ro-artboard-dot.is-on { background: #111827; }
html.dark .ro-artboard-dot { background: #3a3f49; }
html.dark .ro-artboard-dot.is-on { background: #f3f4f6; }

.ro-visual-copy {
  max-width: 300px;
}

.ro-visual-title {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.ro-visual-text {
  margin: 0;
  color: var(--ro-muted);
  font-size: 11.5px;
  line-height: 1.58;
}

.ro-main {
  min-width: 0;
  min-height: 0;
  padding: 42px 48px 46px;
  background: var(--ro-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 153, 164, 0.42) transparent;
}

.ro-main::-webkit-scrollbar { width: 6px; }
.ro-main::-webkit-scrollbar-track { background: transparent; }
.ro-main::-webkit-scrollbar-thumb {
  background: rgba(148, 153, 164, 0.40);
  border-radius: 999px;
}

.ro-topbar {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.ro-progress-label {
  color: var(--ro-soft-text);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ro-progress-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ro-progress-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #dfe2e7;
  transition: width 180ms ease, background 180ms ease;
}

.ro-progress-dot.is-done { background: #9aa1ad; }
.ro-progress-dot.is-current {
  width: 18px;
  background: var(--ro-text);
}

html.dark .ro-progress-dot { background: #343841; }
html.dark .ro-progress-dot.is-done { background: #777e8c; }
html.dark .ro-progress-dot.is-current { background: #f3f4f6; }

.ro-view-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ro-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  opacity: 1;
  transform: translateX(0);
}

.ro-view.is-entering {
  animation: roEnter 200ms cubic-bezier(.2,.8,.2,1) both;
}

.ro-view.is-leaving {
  animation: roLeave 120ms ease both;
}

.ro-kicker {
  margin: 0 0 10px;
  color: var(--ro-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ro-title {
  margin: 0;
  max-width: 500px;
  color: var(--ro-text);
  font-size: clamp(23px, 2.2vw, 28px);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.ro-copy {
  margin: 12px 0 0;
  max-width: 500px;
  color: var(--ro-muted);
  font-size: 12.5px;
  line-height: 1.62;
}

.ro-summary {
  margin-top: 24px;
  border: 1px solid var(--ro-line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--ro-bg);
}

.ro-summary-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--ro-line);
}

.ro-summary-row:last-child { border-bottom: 0; }

.ro-summary-index {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ro-control);
  color: var(--ro-muted);
  font-size: 10px;
  font-weight: 700;
}

.ro-summary-copy { min-width: 0; }
.ro-summary-copy strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ro-text);
  font-size: 11.5px;
  font-weight: 600;
}
.ro-summary-copy span {
  display: block;
  color: var(--ro-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.ro-summary-state {
  color: var(--ro-soft-text);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ro-summary-state.is-done { color: #16803c; }
html.dark .ro-summary-state.is-done { color: #79d69c; }

.ro-scaffold {
  margin-top: 25px;
  display: grid;
  gap: 12px;
}

.ro-scaffold-row {
  min-height: 47px;
  border-radius: 11px;
  border: 1px solid var(--ro-line);
  background: var(--ro-control);
}

.ro-scaffold-row.short { width: 66%; }

.ro-stage-note {
  margin-top: 17px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--ro-line);
  background: var(--ro-control);
  color: var(--ro-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.ro-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--ro-line);
}

.ro-footer-note {
  max-width: 270px;
  color: var(--ro-soft-text);
  font-size: 10px;
  line-height: 1.45;
}

.ro-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.ro-btn {
  min-height: 39px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--ro-line);
  background: var(--ro-bg);
  color: var(--ro-text);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.ro-btn:hover { background: var(--ro-control); }
.ro-btn:active { transform: translateY(1px); }
.ro-btn:disabled { cursor: not-allowed; }
.ro-btn:disabled:not(.is-loading) { opacity: 0.58; }
.ro-btn:focus-visible {
  outline: 3px solid var(--ro-focus);
  outline-offset: 2px;
}

.ro-btn.primary {
  border-color: var(--ro-primary);
  background: var(--ro-primary);
  color: var(--ro-bg);
}

.ro-btn.primary:hover {
  border-color: var(--ro-primary-hover);
  background: var(--ro-primary-hover);
}

html.dark .ro-btn.primary { color: #111318; }

.ro-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.ro-error {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.05);
  color: #b42318;
  font-size: 11px;
  line-height: 1.5;
}

html.dark .ro-error {
  border-color: rgba(248, 113, 113, 0.18);
  background: rgba(248, 113, 113, 0.07);
  color: #fca5a5;
}

@keyframes roEnter {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes roLeave {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-7px); }
}

@keyframes roFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (max-width: 820px) {
  #relifyOnboardingHost { padding: 14px; }

  .ro-modal {
    width: min(760px, calc(100vw - 28px));
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    border-radius: 18px;
  }

  .ro-visual {
    min-height: 190px;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  }

  .ro-artboard {
    display: none;
  }

  .ro-visual-copy {
    margin-top: 28px;
    max-width: 100%;
  }

  .ro-main {
    padding: 25px 22px 22px;
    overflow: visible;
  }

  .ro-topbar { margin-bottom: 23px; }
  .ro-footer { align-items: flex-end; }
}

@media (max-width: 540px) {
  #relifyOnboardingHost { padding: 0; }

  .ro-modal {
    width: 100vw;
    min-height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .ro-visual {
    min-height: 152px;
    padding: 18px;
  }

  .ro-visual-copy { margin-top: 20px; }
  .ro-visual-title { font-size: 14px; }
  .ro-visual-text { font-size: 10.5px; }

  .ro-main { padding: 22px 18px 20px; }
  .ro-title { font-size: 24px; }
  .ro-copy { font-size: 12px; }

  .ro-summary-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .ro-summary-state {
    grid-column: 2;
    margin-top: -5px;
  }

  .ro-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ro-footer-note { max-width: none; }
  .ro-actions { width: 100%; margin-left: 0; }
  .ro-btn { flex: 1; }
}


@media (min-width: 821px) and (max-height: 760px) {
  #relifyOnboardingHost { padding: 18px; }
  .ro-modal {
    width: min(1180px, calc(100vw - 36px));
    height: calc(100dvh - 36px);
    min-height: 0;
    max-height: calc(100dvh - 36px);
  }
  .ro-visual { padding: 26px 30px; overflow-y: auto; }
  .ro-artboard { width: min(100%, 315px); margin: 12px auto 10px; }
  .ro-main { padding: 30px 42px 28px; }
  .ro-topbar { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .ro-backdrop,
  .ro-modal,
  .ro-view,
  .ro-artboard-card,
  .ro-btn,
  .ro-progress-dot {
    animation: none !important;
    transition: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Stage 4 — live onboarding forms
   ───────────────────────────────────────────────────────────── */
.ro-form {
  flex: 1;
  min-height: 0;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
}

.ro-form-scroll {
  overflow: visible;
  padding-right: 0;
  margin-right: 0;
}

.ro-form-scroll::-webkit-scrollbar { width: 5px; }
.ro-form-scroll::-webkit-scrollbar-track { background: transparent; }
.ro-form-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 153, 164, 0.42);
  border-radius: 999px;
}

.ro-grid {
  display: grid;
  gap: 13px;
}

.ro-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ro-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ro-field {
  display: block;
  margin-bottom: 14px;
  min-width: 0;
}

.ro-field > span {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--ro-text);
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 600;
}

.ro-field > span b {
  color: #b42318;
  font-size: 10px;
  font-weight: 700;
}

.ro-field > span em,
.ro-optional {
  color: var(--ro-soft-text);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
}

.ro-field small {
  display: block;
  margin-top: 5px;
  color: var(--ro-soft-text);
  font-size: 9.5px;
  line-height: 1.45;
}

.ro-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--ro-line);
  border-radius: 9px;
  outline: 0;
  background: var(--ro-bg);
  color: var(--ro-text);
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ro-input:hover { border-color: #cdd1d8; }
.ro-input:focus {
  border-color: #9da3ae;
  box-shadow: 0 0 0 3px var(--ro-focus);
}

html.dark .ro-input:hover { border-color: #414752; }
html.dark .ro-input:focus { border-color: #686f7c; }

.ro-input::placeholder { color: var(--ro-soft-text); }
.ro-input:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  background: var(--ro-control);
}

.ro-select {
  appearance: auto;
  padding-right: 8px;
}

/* Shared FancySelect inside onboarding. */
.ro-modal .fancy-dd__wrap {
  width: 100%;
  min-width: 0;
}

.ro-modal .fancy-dd__btn {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 11px !important;
  border: 1px solid var(--ro-line) !important;
  border-radius: 9px !important;
  background: var(--ro-bg) !important;
  color: var(--ro-text) !important;
  font-family: inherit !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.ro-modal .fancy-dd__btn:hover,
.ro-modal .fancy-dd__btn[aria-expanded="true"] {
  background: var(--ro-control) !important;
  border-color: #cdd1d8 !important;
}

html.dark .ro-modal .fancy-dd__btn:hover,
html.dark .ro-modal .fancy-dd__btn[aria-expanded="true"] {
  border-color: #414752 !important;
}

/* Shared phone picker: keep the flag/calling-code control visually aligned with onboarding inputs. */
.ro-modal .relify-phone-field {
  height: 40px !important;
  border-color: var(--ro-line) !important;
  border-radius: 9px !important;
  background: var(--ro-bg) !important;
  box-shadow: none;
}

.ro-modal .relify-phone-field:focus-within {
  border-color: #9da3ae !important;
  box-shadow: 0 0 0 3px var(--ro-focus) !important;
}

.ro-modal .relify-phone-country-trigger {
  min-width: 100px !important;
  border-radius: 9px 0 0 9px !important;
  border-right-color: var(--ro-line) !important;
  color: var(--ro-text) !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
}

.ro-modal .relify-phone-local {
  border-radius: 0 9px 9px 0 !important;
  color: var(--ro-text) !important;
  font-family: inherit !important;
  font-size: 11.5px !important;
}

.ro-profile-upload-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  margin-bottom: 19px;
  padding: 12px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-control);
}

.ro-avatar-preview {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 17px;
  border: 1px solid var(--ro-line);
  background: var(--ro-bg);
  display: grid;
  place-items: center;
}

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

.ro-avatar-fallback {
  color: var(--ro-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ro-profile-upload-copy {
  min-width: 0;
}

.ro-profile-upload-copy > strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--ro-text);
  font-size: 10.5px;
  font-weight: 600;
}

.ro-profile-upload-copy > span {
  display: block;
  color: var(--ro-muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.ro-inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 7px;
}

.ro-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ro-text);
  font: inherit;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ro-link-btn.muted { color: var(--ro-muted); }
.ro-link-btn:hover { opacity: 0.66; }
.ro-hidden-input { display: none !important; }

.ro-account-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 2px;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-line);
}

.ro-account-strip > div {
  min-width: 0;
  padding: 10px 11px;
  background: var(--ro-control);
}

.ro-account-strip span,
.ro-account-strip strong {
  display: block;
  min-width: 0;
}

.ro-account-strip span {
  margin-bottom: 3px;
  color: var(--ro-soft-text);
  font-size: 8.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.ro-account-strip strong {
  overflow: hidden;
  color: var(--ro-text);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-upload-box {
  min-height: 180px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 22px;
  border: 1px dashed #c7cbd2;
  border-radius: 14px;
  background: var(--ro-control);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ro-upload-box:hover,
.ro-upload-box.is-dragging {
  border-color: #8e95a1;
  background: var(--ro-bg);
}

.ro-upload-box.is-dragging { transform: scale(0.995); }
.ro-upload-box.has-file { border-style: solid; }

html.dark .ro-upload-box { border-color: #3d424c; }
html.dark .ro-upload-box:hover,
html.dark .ro-upload-box.is-dragging { border-color: #68707d; }

.ro-upload-preview {
  min-height: 74px;
  display: grid;
  place-items: center;
}

.ro-logo-img {
  width: auto;
  max-width: 190px;
  max-height: 76px;
  display: block;
  object-fit: contain;
}

.ro-upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-bg);
  color: var(--ro-muted);
}

.ro-upload-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ro-upload-copy strong {
  display: block;
  color: var(--ro-text);
  font-size: 11.5px;
  font-weight: 600;
}

.ro-upload-copy span,
.ro-upload-copy small {
  display: block;
  margin-top: 4px;
  color: var(--ro-muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.ro-upload-copy small {
  color: var(--ro-soft-text);
  font-size: 9px;
}

.ro-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  color: var(--ro-muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.ro-info-row strong { color: var(--ro-text); font-weight: 600; }
.ro-info-dot {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #89909c;
}

.ro-section-label {
  display: block;
  margin: 4px 0 10px;
  color: var(--ro-soft-text);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ro-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.ro-section-head .ro-section-label { margin-bottom: 9px; }

.ro-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  color: var(--ro-muted);
  font-size: 9.5px;
  font-weight: 500;
  cursor: pointer;
}

.ro-check input {
  width: 13px;
  height: 13px;
  accent-color: var(--ro-primary);
}

/* Super Admin organisation tax setup. */
.ro-tax-section-head {
  align-items: center;
  margin-top: 10px;
}

.ro-check-strong {
  margin-bottom: 9px;
  color: var(--ro-text);
  font-weight: 600;
}

.ro-tax-panel {
  margin: 0 0 8px;
  padding: 15px 15px 7px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-control);
}

.ro-tax-panel[hidden] {
  display: none !important;
}

.ro-tax-panel .ro-input,
.ro-tax-panel .fancy-dd__btn {
  background: var(--ro-bg) !important;
}

.ro-tax-rules {
  display: grid;
  gap: 2px;
  padding-top: 2px;
}

.ro-tax-rules .ro-check {
  width: fit-content;
  margin-bottom: 8px;
}

@media (max-width: 540px) {
  .ro-tax-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .ro-tax-panel {
    padding: 13px 12px 5px;
  }
}

.ro-footer-sticky {
  /* Keep actions after the form content instead of floating over the last
     inputs. The right pane itself is already the scroll container. */
  position: static;
  bottom: auto;
  z-index: auto;
  flex: 0 0 auto;
  margin-top: 22px;
  padding-top: 18px;
  padding-bottom: 4px;
  background: var(--ro-bg) !important;
  background-color: var(--ro-bg) !important;
  isolation: auto;
  box-shadow: none;
}

.ro-footer-sticky::before { content: none; }
html.dark .ro-footer-sticky { box-shadow: none; }

.ro-btn.is-loading {
  position: relative;
  justify-content: center;
  align-items: center;
  color: transparent !important;
  pointer-events: none;
}

.ro-btn.is-loading:disabled {
  opacity: 1;
}

.ro-btn-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: roSpin 620ms linear infinite;
  box-sizing: border-box;
}

html.dark .ro-btn.primary .ro-btn-spinner {
  border-color: rgba(17, 19, 24, 0.28);
  border-top-color: #111318;
}

.ro-btn:not(.primary) .ro-btn-spinner {
  border-color: rgba(17, 19, 24, 0.22);
  border-top-color: var(--ro-text);
}

html.dark .ro-btn:not(.primary) .ro-btn-spinner {
  border-color: rgba(255, 255, 255, 0.24);
  border-top-color: var(--ro-text);
}

.ro-ready-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.ro-ready-list > div {
  min-height: 45px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-control);
}

.ro-ready-list strong {
  color: var(--ro-text);
  font-size: 10.5px;
  font-weight: 600;
}

.ro-ready-list > div > span:last-child {
  color: var(--ro-soft-text);
  font-size: 9px;
  font-weight: 600;
}

.ro-ready-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ro-bg);
  color: var(--ro-muted);
  font-size: 10px;
  font-weight: 700;
}

.ro-ready-check.is-done {
  background: rgba(22, 128, 60, 0.10);
  color: #16803c;
}

html.dark .ro-ready-check.is-done {
  background: rgba(121, 214, 156, 0.10);
  color: #79d69c;
}

.ro-guide-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
}

.ro-guide-preview > div {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-control);
}

.ro-guide-preview strong,
.ro-guide-preview span { display: block; }
.ro-guide-preview strong {
  margin-bottom: 5px;
  color: var(--ro-text);
  font-size: 10.5px;
  font-weight: 600;
}
.ro-guide-preview span {
  color: var(--ro-muted);
  font-size: 9.5px;
  line-height: 1.45;
}

@keyframes roSpin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .ro-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-form-scroll { overflow: visible; padding-right: 0; margin-right: 0; }
  .ro-footer-sticky { position: static; }
}

@media (max-width: 540px) {
  .ro-grid.two,
  .ro-grid.three,
  .ro-account-strip,
  .ro-guide-preview { grid-template-columns: 1fr; }

  .ro-profile-upload-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }
  .ro-avatar-preview { width: 50px; height: 50px; border-radius: 15px; }
  .ro-upload-box { min-height: 150px; padding: 18px; }
  .ro-section-head { align-items: flex-start; flex-direction: column; gap: 0; }
  .ro-ready-list > div { grid-template-columns: 22px minmax(0, 1fr); }
  .ro-ready-list > div > span:last-child { grid-column: 2; margin-top: -4px; }
}


/* ─────────────────────────────────────────────────────────────
   Stage 5 — completion + Quick Relify guide
   ───────────────────────────────────────────────────────────── */
.ro-success-hero {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
}

.ro-success-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(22, 128, 60, 0.10);
  color: #16803c;
  border: 1px solid rgba(22, 128, 60, 0.12);
}

.ro-success-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.dark .ro-success-mark {
  background: rgba(121, 214, 156, 0.10);
  border-color: rgba(121, 214, 156, 0.12);
  color: #79d69c;
}

.ro-completion-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 10px 12px;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-control);
  color: var(--ro-muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.ro-completion-meta strong {
  color: var(--ro-text);
  font-weight: 700;
}

.ro-ready-list-detailed > div {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.ro-ready-copy {
  min-width: 0;
}

.ro-ready-copy strong,
.ro-ready-copy small {
  display: block;
}

.ro-ready-copy small {
  margin-top: 2px;
  color: var(--ro-muted);
  font-size: 9px;
  line-height: 1.42;
}

.ro-guide-view {
  overflow: hidden;
}

.ro-guide-head {
  flex: 0 0 auto;
}

.ro-guide-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 19px;
  padding-right: 7px;
  margin-right: -7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 153, 164, 0.45) transparent;
}

.ro-guide-scroll::-webkit-scrollbar { width: 5px; }
.ro-guide-scroll::-webkit-scrollbar-track { background: transparent; }
.ro-guide-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 153, 164, 0.42);
  border-radius: 999px;
}

.ro-assistant-callout,
.ro-billing-callout {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-control);
}

.ro-assistant-callout {
  background:
    linear-gradient(135deg, rgba(49, 46, 129, 0.035), transparent 56%),
    var(--ro-control);
}

.ro-assistant-orb,
.ro-billing-callout-icon,
.ro-guide-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--ro-line);
  background: var(--ro-bg);
  color: var(--ro-text);
  font-weight: 700;
}

.ro-assistant-orb,
.ro-billing-callout-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 9px;
  letter-spacing: -0.02em;
}

.ro-assistant-callout > span:nth-child(2),
.ro-billing-callout > span:nth-child(2) {
  min-width: 0;
}

.ro-assistant-callout strong,
.ro-assistant-callout small,
.ro-billing-callout strong,
.ro-billing-callout small {
  display: block;
}

.ro-assistant-callout strong,
.ro-billing-callout strong {
  color: var(--ro-text);
  font-size: 10px;
  font-weight: 650;
}

.ro-assistant-callout small,
.ro-billing-callout small {
  margin-top: 2px;
  color: var(--ro-muted);
  font-size: 9px;
  line-height: 1.45;
}

.ro-text-action {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--ro-text);
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.ro-text-action:hover { opacity: 0.62; }
.ro-text-action:focus-visible {
  outline: 3px solid var(--ro-focus);
  outline-offset: 3px;
  border-radius: 5px;
}

.ro-guide-section {
  margin-top: 18px;
}

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

.ro-guide-section-head > span {
  color: var(--ro-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ro-guide-section-head > small {
  color: var(--ro-soft-text);
  font-size: 8.5px;
  font-weight: 500;
}

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

.ro-guide-grid-subscription {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ro-guide-card {
  min-height: 92px;
  padding: 10px 11px;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-bg);
}

.ro-guide-card.is-assistant {
  background: linear-gradient(145deg, rgba(49, 46, 129, 0.035), transparent 62%), var(--ro-bg);
}

.ro-guide-card.is-billing {
  border-color: rgba(37, 99, 235, 0.20);
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.045), transparent 60%), var(--ro-bg);
}

html.dark .ro-guide-card.is-billing {
  border-color: rgba(96, 165, 250, 0.20);
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.055), transparent 60%), var(--ro-bg);
}

.ro-guide-card-top {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.ro-guide-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 7.5px;
  letter-spacing: -0.03em;
}

.ro-guide-eyebrow {
  color: var(--ro-soft-text);
  font-size: 7.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.ro-guide-card > strong,
.ro-guide-card > span {
  display: block;
}

.ro-guide-card > strong {
  margin-bottom: 3px;
  color: var(--ro-text);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.ro-guide-card > span {
  color: var(--ro-muted);
  font-size: 8.8px;
  line-height: 1.45;
}

.ro-billing-callout {
  grid-template-columns: 34px minmax(0, 1fr);
  margin-top: 11px;
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.035);
}

html.dark .ro-billing-callout {
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(96, 165, 250, 0.05);
}

.ro-guide-footer {
  flex: 0 0 auto;
  margin-top: 14px;
}

.ro-guide-footer .ro-footer-note {
  max-width: 245px;
}

@media (max-width: 820px) {
  .ro-guide-scroll {
    overflow: visible;
    padding-right: 0;
    margin-right: 0;
  }
  .ro-guide-view { overflow: visible; }
  .ro-guide-grid-subscription { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-guide-footer { position: static; }
}

@media (max-width: 620px) {
  .ro-completion-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .ro-guide-grid,
  .ro-guide-grid-subscription {
    grid-template-columns: 1fr;
  }

  .ro-assistant-callout {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ro-assistant-callout .ro-text-action {
    grid-column: 2;
    justify-self: start;
    padding-top: 0;
  }
}

@media (max-width: 540px) {
  .ro-success-hero {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .ro-success-mark { width: 42px; height: 42px; border-radius: 13px; }
  .ro-ready-list-detailed > div { grid-template-columns: 22px minmax(0, 1fr); }
  .ro-ready-list-detailed > div > span:last-child { grid-column: 2; margin-top: -4px; }
  .ro-guide-footer .ro-actions { flex-wrap: wrap; }
  .ro-guide-footer .ro-btn { min-width: calc(50% - 5px); }
  .ro-guide-footer .ro-btn.primary { min-width: 100%; order: -1; }
}

/* =========================================================
   Stage 6 — dedicated Branch Administrator onboarding
   ========================================================= */
.ro-assignment-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 13px;
  border: 1px solid var(--ro-line);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.035), transparent 62%),
    var(--ro-control);
}

.ro-assignment-card.is-compact {
  margin-top: 15px;
  padding: 10px 12px;
}

.ro-assignment-icon,
.ro-branch-scope-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-bg);
  color: var(--ro-text);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.ro-assignment-main,
.ro-assignment-meta {
  min-width: 0;
}

.ro-assignment-eyebrow,
.ro-assignment-main strong,
.ro-assignment-main small,
.ro-assignment-meta span,
.ro-assignment-meta small {
  display: block;
}

.ro-assignment-eyebrow {
  margin-bottom: 2px;
  color: var(--ro-soft-text);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.075em;
}

.ro-assignment-main strong {
  overflow: hidden;
  color: var(--ro-text);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-assignment-main small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ro-muted);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-assignment-meta {
  text-align: right;
}

.ro-assignment-meta span {
  color: var(--ro-text);
  font-size: 8.5px;
  font-weight: 650;
}

.ro-assignment-meta small {
  margin-top: 2px;
  max-width: 150px;
  overflow: hidden;
  color: var(--ro-soft-text);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-scope-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-bg);
}

.ro-scope-note strong {
  color: var(--ro-text);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.ro-scope-note span {
  color: var(--ro-muted);
  font-size: 8.8px;
  line-height: 1.5;
}

.ro-branch-scope-banner {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 11px;
  padding: 10px 11px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-control);
}

.ro-branch-scope-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.ro-branch-scope-banner > span:nth-child(2) {
  min-width: 0;
}

.ro-branch-scope-banner strong,
.ro-branch-scope-banner small {
  display: block;
}

.ro-branch-scope-banner strong {
  overflow: hidden;
  color: var(--ro-text);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ro-branch-scope-banner small {
  margin-top: 2px;
  color: var(--ro-muted);
  font-size: 8.6px;
  line-height: 1.45;
}

.ro-access-count {
  padding: 5px 7px;
  border: 1px solid var(--ro-line);
  border-radius: 999px;
  background: var(--ro-bg);
  color: var(--ro-muted);
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.ro-access-empty {
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed var(--ro-line);
  border-radius: 11px;
  background: var(--ro-bg);
}

.ro-access-empty strong,
.ro-access-empty span {
  display: block;
}

.ro-access-empty strong {
  color: var(--ro-text);
  font-size: 9.5px;
  font-weight: 650;
}

.ro-access-empty span {
  margin-top: 3px;
  color: var(--ro-muted);
  font-size: 8.6px;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .ro-assignment-card,
  .ro-branch-scope-banner {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .ro-assignment-meta,
  .ro-access-count {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .ro-assignment-meta small {
    max-width: 100%;
  }

  .ro-scope-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Onboarding country uses FancySelect as a plain text country picker. */
.ro-modal .fancy-dd__label {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Keep enough bottom room for native/mobile browser UI after the last action row. */
.ro-form-scroll {
  padding-bottom: 8px;
}

/* ─────────────────────────────────────────────────────────────
   Onboarding intro redesign — compact welcome → trial morph
   ───────────────────────────────────────────────────────────── */
.ro-modal {
  transition:
    width 560ms cubic-bezier(.22,1,.36,1),
    height 560ms cubic-bezier(.22,1,.36,1),
    border-radius 560ms cubic-bezier(.22,1,.36,1),
    opacity 200ms ease,
    transform 220ms cubic-bezier(.2,.8,.2,1);
}

.ro-modal.is-expanded {
  width: min(1120px, calc(100vw - 56px));
  height: min(720px, calc(100dvh - 56px));
  min-height: min(620px, calc(100dvh - 56px));
  grid-template-columns: minmax(340px, 38%) minmax(0, 62%);
}

.ro-modal.is-compact {
  width: min(500px, calc(100vw - 40px));
  height: min(560px, calc(100dvh - 40px));
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 54% 46%;
  border-radius: 22px;
}

/* Permanent Relify onboarding artwork.
   Prefer onboarding_bg.png; keep the .jpg as a silent fallback for the current asset name. */
.ro-visual {
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background-color: #08070d;
  background-image: url("../img/onboarding_bg.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  border-right-color: rgba(255,255,255,.12);
}

html.dark .ro-visual {
  background-color: #08070d;
  background-image: url("../img/onboarding_bg.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  border-right-color: rgba(255,255,255,.10);
}

/* The supplied artwork already carries the visual movement; do not layer the
   old generated ribbons over it. */
.ro-visual::before,
.ro-visual::after {
  display: none !important;
}

.ro-visual > * { position: relative; z-index: 2; }
.ro-visual-title,
.ro-visual-text { color: #fff; }
.ro-visual-text { opacity: .78; }

.ro-step-pill {
  color: rgba(255,255,255,.88);
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html.dark .ro-step-pill {
  color: rgba(255,255,255,.88);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
}

.ro-brand-logo { max-width: 176px; height: 40px; }
.ro-brand-logo-light,
html.dark .ro-brand-logo-dark { display: block; }
.ro-brand-logo-dark,
html.dark .ro-brand-logo-light { display: none; }

/* Compact hello card — intentionally close to the reference proportions. */
.ro-modal.is-compact .ro-visual {
  min-height: 0;
  padding: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(255,255,255,.16);
  display: grid;
  place-items: center;
}
.ro-modal.is-compact .ro-visual-top,
.ro-modal.is-compact .ro-visual-copy { display: none; }
.ro-modal.is-compact .ro-artboard {
  display: grid !important;
  width: 100%;
  height: 100%;
  margin: 0;
  aspect-ratio: auto;
}
.ro-modal.is-compact .ro-artboard::before,
.ro-modal.is-compact .ro-artboard::after { display: none; }
.ro-modal.is-compact .ro-artboard-card {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none !important;
  display: grid;
  place-items: center;
}
.ro-modal.is-compact .ro-artboard-lines,
.ro-modal.is-compact .ro-artboard-actions { display: none; }
.ro-modal.is-compact .ro-artboard-icon { width: 110px; height: 110px; }
.ro-modal.is-compact .ro-artboard-brand-light { display: none !important; }
.ro-modal.is-compact .ro-artboard-brand-dark {
  display: block !important;
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 14px 28px rgba(23,17,94,.20));
}
.ro-modal.is-compact .ro-main {
  padding: 28px 34px 22px;
  overflow: hidden;
  align-items: stretch;
  justify-content: center;
}
.ro-modal.is-compact .ro-topbar { display: none; }
.ro-modal.is-compact .ro-view-wrap { justify-content: center; }
.ro-welcome-view {
  justify-content: center;
  text-align: center;
}
.ro-welcome-copy .ro-title {
  max-width: none;
  margin-inline: auto;
  font-size: 25px;
}
.ro-welcome-copy .ro-copy {
  max-width: 360px;
  margin: 10px auto 0;
  font-size: 11.5px;
  line-height: 1.55;
}
.ro-welcome-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}
.ro-welcome-cta { min-width: 92px; }
.ro-welcome-save-note {
  display: block;
  margin-top: 10px;
  color: var(--ro-soft-text);
  font-size: 9.5px;
}

/* Trial screen — split composition inspired by the supplied reference. */
.ro-modal[data-view="trial"] .ro-artboard::before,
.ro-modal[data-view="trial"] .ro-artboard::after { display: none !important; }
.ro-modal[data-view="trial"] .ro-artboard {
  display: grid;
  place-items: center;
}
.ro-modal[data-view="trial"] .ro-artboard-card {
  position: static !important;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  animation: none !important;
}
.ro-modal[data-view="trial"] .ro-artboard-lines,
.ro-modal[data-view="trial"] .ro-artboard-actions { display: none !important; }
.ro-modal[data-view="trial"] .ro-artboard-icon { width: 124px; height: 124px; }
.ro-modal[data-view="trial"] .ro-artboard-brand-light { display: none !important; }
.ro-modal[data-view="trial"] .ro-artboard-brand-dark {
  display: block !important;
  width: 104px;
  height: 104px;
  filter: drop-shadow(0 18px 34px rgba(25,15,100,.26));
}
.ro-trial-view { justify-content: flex-start; }
.ro-trial-brandline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--ro-muted);
  font-size: 10.5px;
}
.ro-trial-brandline strong { color: var(--ro-text); font-weight: 700; }
.ro-trial-mark {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg,#7c3aed,#3b82f6);
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}
.ro-trial-title { max-width: 560px; font-size: clamp(25px,2.35vw,31px); }
.ro-trial-copy { max-width: 570px; }
.ro-trial-stats {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
}
.ro-trial-stats > div {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ro-control) 72%, transparent);
}
.ro-trial-stats strong,
.ro-trial-stats span { display: block; }
.ro-trial-stats strong { color: var(--ro-text); font-size: 11px; line-height: 1.35; }
.ro-trial-stats span { margin-top: 3px; color: var(--ro-soft-text); font-size: 9.5px; }
.ro-trial-feature-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px 24px;
}
.ro-trial-feature {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 4px 0;
}
.ro-trial-feature-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #7c7f89;
}
.ro-trial-feature-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
html.dark .ro-trial-feature-icon { color: #aeb4c5; }
.ro-trial-feature strong,
.ro-trial-feature small { display: block; }
.ro-trial-feature strong { color: var(--ro-text); font-size: 10.8px; line-height: 1.35; }
.ro-trial-feature small { margin-top: 2px; color: var(--ro-muted); font-size: 9.6px; line-height: 1.45; }
.ro-trial-footer { margin-top: auto; }

/* Keep setup views on the same coloured visual system. */
.ro-modal.is-expanded .ro-visual { color: #fff; }
.ro-modal.is-expanded .ro-visual-copy { max-width: 310px; }

/* One uninterrupted morph: spinner stays inside the same dialog while size changes. */
.ro-morph-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at 75% 24%, rgba(130,196,255,.42), transparent 26%),
    linear-gradient(145deg,#5e22df,#3f67ed 68%,#69aaff);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 170ms ease, visibility 0s linear 170ms;
}
.ro-morph-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.30);
  border-top-color: #fff;
  animation: roSpin .72s linear infinite;
  filter: drop-shadow(0 6px 16px rgba(28,15,100,.20));
}

.ro-modal.is-morphing .ro-morph-loader {
  opacity: 1;
  visibility: visible;
  transition: opacity 170ms ease, visibility 0s;
}

/* Direction-aware slide transitions for every onboarding screen change. */
.ro-view.is-entering.is-entering-forward { animation: roEnterForward 300ms cubic-bezier(.22,1,.36,1) both; }
.ro-view.is-entering.is-entering-back { animation: roEnterBack 300ms cubic-bezier(.22,1,.36,1) both; }
.ro-view.is-exiting-left { animation: roExitLeft 170ms ease both !important; }
.ro-view.is-exiting-right { animation: roExitRight 170ms ease both !important; }

@keyframes roEnterForward { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:translateX(0); } }
@keyframes roEnterBack { from { opacity:0; transform:translateX(-24px); } to { opacity:1; transform:translateX(0); } }
@keyframes roExitLeft { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(-20px); } }
@keyframes roExitRight { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(20px); } }
@keyframes roTrialLogoFloat { 0%,100% { transform:translateY(0) scale(1); } 50% { transform:translateY(-7px) scale(1.015); } }
@keyframes roSpin { to { transform:rotate(360deg); } }

@media (max-width: 820px) {
  .ro-modal.is-expanded {
    width: min(760px, calc(100vw - 28px));
    height: min(92dvh, 760px);
    min-height: 0;
    max-height: calc(100dvh - 28px);
    grid-template-columns: 1fr;
    grid-template-rows: 180px minmax(0,1fr);
  }
  .ro-modal.is-expanded .ro-visual {
    min-height: 0;
    height: 180px;
    padding: 18px 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
  }
  .ro-modal.is-expanded .ro-artboard { display: none; }
  .ro-modal.is-expanded .ro-visual-copy { margin-top: auto; }
  .ro-modal.is-expanded .ro-main { min-height: 0; overflow-y: auto; padding: 24px 22px 22px; }
  .ro-trial-feature-grid { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 540px) {
  #relifyOnboardingHost { padding: 10px; }
  .ro-modal.is-compact {
    width: calc(100vw - 20px);
    height: min(600px, calc(100dvh - 20px));
    min-height: 0;
    border-radius: 20px;
    grid-template-rows: 48% 52%;
  }
  .ro-modal.is-expanded {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    min-height: 0;
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
    grid-template-rows: 150px minmax(0,1fr);
  }
  .ro-modal.is-expanded .ro-visual { height: 150px; min-height: 0; padding: 16px 18px; }
  .ro-modal.is-compact .ro-main { padding: 24px 24px 20px; }
  .ro-modal.is-compact .ro-artboard-icon { width: 88px; height: 88px; }
  .ro-modal.is-compact .ro-artboard-brand-dark { width: 74px; height: 74px; }
  .ro-welcome-copy .ro-title { font-size: 23px; }
  .ro-trial-stats { grid-template-columns: 1fr; gap: 6px; }
  .ro-trial-stats > div { min-height: 52px; }
  .ro-trial-title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ro-modal,
  .ro-morph-loader,
  .ro-morph-spinner,
  .ro-view.is-entering.is-entering-forward,
  .ro-view.is-entering.is-entering-back,
  .ro-view.is-exiting-left,
  .ro-view.is-exiting-right {
    animation: none !important;
    transition: none !important;
  }
}


/* ─────────────────────────────────────────────────────────────
   Onboarding visual alignment refinement
   Keep the Relify illustration perfectly centred and completely static.
   Content/page transitions still animate; only the decorative visual is fixed.
   ───────────────────────────────────────────────────────────── */
.ro-artboard {
  align-items: center !important;
  justify-items: center !important;
}

.ro-artboard-card {
  animation: none !important;
  transition: none !important;
}

#relifyOnboardingHost.is-visible .ro-artboard-card,
.ro-modal[data-view="trial"] .ro-artboard-card,
.ro-modal.is-compact .ro-artboard-card {
  animation: none !important;
}

/* Explicit centring avoids intrinsic-image/canvas whitespace or grid sizing
   from visually pulling the mark toward one side in the compact welcome card. */
.ro-modal.is-compact .ro-artboard-card,
.ro-modal[data-view="trial"] .ro-artboard-card {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  place-items: center !important;
}

.ro-artboard-icon {
  display: grid !important;
  place-items: center !important;
  margin: 0 auto !important;
}

.ro-artboard-brand,
.ro-illustration-img {
  object-position: center center !important;
  margin: 0 auto !important;
  animation: none !important;
}

.ro-illustration-img {
  transform: none !important;
  transition: opacity 180ms ease !important;
}

.ro-artboard.has-image .ro-illustration-img {
  transform: none !important;
}


/* The left visual always uses the white Relify wordmark on the dark artwork. */
.ro-visual .ro-brand-logo-light {
  display: none !important;
}
.ro-visual .ro-brand-logo-dark {
  display: block !important;
}

/* Welcome + trial place the symbol directly on the dark artwork, so keep it white. */
.ro-modal.is-compact .ro-artboard-brand-light,
.ro-modal[data-view="trial"] .ro-artboard-brand-light {
  display: none !important;
}
.ro-modal.is-compact .ro-artboard-brand-dark,
.ro-modal[data-view="trial"] .ro-artboard-brand-dark {
  display: block !important;
}

/* Setup screens place the symbol on a white paper card, so use the black mark. */
.ro-modal:not(.is-compact):not([data-view="trial"]) .ro-artboard-brand-light {
  display: block !important;
  filter: brightness(0) saturate(100%) !important;
  opacity: .98;
}
.ro-modal:not(.is-compact):not([data-view="trial"]) .ro-artboard-brand-dark {
  display: none !important;
}


/* Trial artwork: symbol only. Do not render/position the paper card in this view. */
.ro-modal[data-view="trial"] .ro-artboard-card {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
}
.ro-modal[data-view="trial"] .ro-artboard::before,
.ro-modal[data-view="trial"] .ro-artboard::after { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   Welcome logo + white morph loader + fade transitions
   ───────────────────────────────────────────────────────────── */

/* Dedicated welcome-card logo, centred on the artwork */
.ro-modal .ro-visual > .ro-welcome-logo {
  position: absolute !important;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: none;
  width: 92px;
  height: 92px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .35));
}
.ro-modal.is-compact .ro-visual > .ro-welcome-logo { display: block; }
.ro-modal.is-compact .ro-artboard { display: none !important; }

/* White loader instead of the purple gradient */
.ro-morph-loader {
  background: #ffffff;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}
html.dark .ro-morph-loader { background: var(--ro-bg); }
.ro-modal.is-morphing .ro-morph-loader {
  transition: opacity 200ms ease, visibility 0s;
}
.ro-morph-spinner {
  border-color: rgba(17, 19, 24, .14);
  border-top-color: #111318;
  filter: none;
}
html.dark .ro-morph-spinner {
  border-color: rgba(255, 255, 255, .18);
  border-top-color: #ffffff;
}

/* Content fades out before the resize and fades back in after */
.ro-modal > .ro-visual,
.ro-modal > .ro-main {
  transition: opacity 260ms ease;
}
.ro-modal.is-morphing > .ro-visual,
.ro-modal.is-morphing > .ro-main {
  opacity: 0;
  transition: opacity 200ms ease;
}
/* ─────────────────────────────────────────────────────────────
   Setup screens: centred stacked cards with black logo
   (all expanded views except Trial; desktop only)
   ───────────────────────────────────────────────────────────── */
@media (min-width: 821px) {
  /* Fixed-size artboard, vertically centred between header and copy */
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard {
    position: relative !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: min(100%, 340px) !important;
    height: 300px !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    margin: auto !important;
  }

  /* Two tilted cards behind */
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard::before,
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    z-index: 0 !important;
    width: 72% !important;
    height: 66% !important;
  }
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard::before {
    transform: translate(calc(-50% - 18px), calc(-50% + 16px)) rotate(-4deg) !important;
  }
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard::after {
    transform: translate(calc(-50% + 20px), calc(-50% - 8px)) rotate(4deg) !important;
  }

  /* Front card, centred and always on top */
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard-card {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    z-index: 2 !important;
    width: 76% !important;
    height: 68% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transform: translate(-50%, -50%) !important;
    opacity: 1 !important;
  }

  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard-icon {
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto !important;
  }

  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard-lines {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard-actions {
    display: flex !important;
  }

  /* Black logo on the white card */
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard-brand-light {
    display: block !important;
    width: 46px !important;
    height: 46px !important;
    filter: brightness(0) saturate(100%) !important;
    opacity: 1 !important;
  }
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard-brand-dark {
    display: none !important;
  }
}

/* Short desktop screens: slightly smaller artwork */
@media (min-width: 821px) and (max-height: 760px) {
  .ro-modal.is-expanded:not([data-view="trial"]) .ro-artboard {
    width: min(100%, 290px) !important;
    height: 250px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   Branch Administrator onboarding
   ───────────────────────────────────────────────────────────── */

/* Branch-access intro uses the same clean symbol-only artwork treatment as Trial. */
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard::before,
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard::after {
  display: none !important;
}
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard {
  display: grid !important;
  place-items: center !important;
}
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-card {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  animation: none !important;
}
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-lines,
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-actions {
  display: none !important;
}
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-icon {
  width: 124px !important;
  height: 124px !important;
}
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-brand-light {
  display: none !important;
}
.ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-brand-dark {
  display: block !important;
  width: 104px !important;
  height: 104px !important;
  filter: drop-shadow(0 18px 34px rgba(25,15,100,.26));
}

.ro-branch-access-view {
  justify-content: flex-start;
}
.ro-branch-access-head .ro-copy {
  max-width: 580px;
}
.ro-branch-access-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}
.ro-branch-access-summary > span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-subtle-bg);
}
.ro-branch-access-summary small,
.ro-branch-access-summary strong {
  display: block;
  min-width: 0;
}
.ro-branch-access-summary small {
  margin-bottom: 3px;
  color: var(--ro-soft-text);
  font-size: 9px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.ro-branch-access-summary strong {
  overflow: hidden;
  color: var(--ro-text);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ro-branch-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px 18px;
  margin-top: 22px;
}
.ro-branch-access-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
}
.ro-branch-access-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(79,70,229,.07);
  color: #5f57d8;
}
.ro-branch-access-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
html.dark .ro-branch-access-icon {
  background: rgba(129,140,248,.12);
  color: #b5bafc;
}
.ro-branch-access-card strong,
.ro-branch-access-card small {
  display: block;
}
.ro-branch-access-card strong {
  color: var(--ro-text);
  font-size: 10.8px;
  line-height: 1.35;
}
.ro-branch-access-card small {
  margin-top: 3px;
  color: var(--ro-muted);
  font-size: 9.6px;
  line-height: 1.5;
}
.ro-branch-access-footer {
  margin-top: auto;
}

/* Optional branch-specific logo editor inside the assigned-clinic step. */
.ro-branch-logo-section {
  display: grid;
  grid-template-columns: 78px minmax(0,1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--ro-line);
  border-radius: 14px;
  background: var(--ro-subtle-bg);
  transition: border-color 160ms ease, background 160ms ease;
}
.ro-branch-logo-section.is-dragging {
  border-color: rgba(79,70,229,.45);
  background: rgba(79,70,229,.045);
}
.ro-branch-logo-preview {
  width: 78px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ro-line);
  border-radius: 11px;
  background: var(--ro-bg);
}
.ro-branch-logo-img {
  max-width: 88%;
  max-height: 82%;
  object-fit: contain;
}
.ro-branch-logo-placeholder {
  width: 28px;
  height: 28px;
  color: var(--ro-muted);
}
.ro-branch-logo-placeholder svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ro-branch-logo-copy {
  min-width: 0;
}
.ro-branch-logo-copy > span,
.ro-branch-logo-copy > small {
  display: block;
}
.ro-branch-logo-copy > span {
  margin-top: 4px;
  color: var(--ro-muted);
  font-size: 9.7px;
  line-height: 1.45;
}
.ro-branch-logo-copy > small {
  margin-top: 3px;
  color: var(--ro-soft-text);
  font-size: 9px;
}
.ro-branch-logo-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ro-branch-logo-title-row > strong {
  color: var(--ro-text);
  font-size: 10.6px;
}
.ro-branch-logo-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--ro-line);
  border-radius: 999px;
  background: var(--ro-bg);
  color: var(--ro-muted);
  font-size: 8.6px;
  font-weight: 600;
  line-height: 1.25;
}
.ro-branch-logo-copy .ro-inline-actions {
  margin-top: 8px;
}

.ro-input.is-readonly,
.ro-input[readonly] {
  cursor: default;
  background: var(--ro-subtle-bg);
  color: var(--ro-muted);
}

@media (max-width: 820px) {
  .ro-modal.is-expanded[data-view="branch_access"] .ro-artboard {
    min-height: 170px !important;
  }
  .ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-icon {
    width: 92px !important;
    height: 92px !important;
  }
  .ro-modal.is-expanded[data-view="branch_access"] .ro-artboard-brand-dark {
    width: 78px !important;
    height: 78px !important;
  }
  .ro-branch-access-summary,
  .ro-branch-access-grid {
    grid-template-columns: 1fr;
  }
  .ro-branch-access-summary {
    gap: 6px;
    margin-top: 16px;
  }
  .ro-branch-access-grid {
    gap: 2px;
    margin-top: 14px;
  }
  .ro-branch-access-card {
    padding: 8px 0;
  }
  .ro-branch-logo-section {
    grid-template-columns: 64px minmax(0,1fr);
    gap: 11px;
    padding: 10px;
  }
  .ro-branch-logo-preview {
    width: 64px;
    height: 58px;
  }
  .ro-branch-logo-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 520px) {
  .ro-branch-logo-section {
    grid-template-columns: 1fr;
  }
  .ro-branch-logo-preview {
    width: 100%;
    height: 76px;
  }
}


/* ─────────────────────────────────────────────────────────────
   Profile form polish — preserve identity rows + phone clarity
   ───────────────────────────────────────────────────────────── */

/* The phone picker owns the calling code. The visible national-number
   placeholder should therefore look like a placeholder, not saved data. */
.ro-modal .relify-phone-local::placeholder {
  color: #a7adb7 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
}

html.dark .ro-modal .relify-phone-local::placeholder {
  color: #777f8c !important;
}

/* Profile children must never be flex-shrunk when an error is inserted.
   Let the main panel scroll instead, so Email/Username values remain visible. */
.ro-form[data-ro-form="profile"] > * {
  flex-shrink: 0;
}

.ro-form[data-ro-form="profile"] .ro-account-strip {
  min-height: 52px;
}

.ro-form[data-ro-form="profile"] .ro-account-strip > div {
  min-height: 50px;
}

.ro-form[data-ro-form="profile"] .ro-account-strip strong {
  min-height: 14px;
  line-height: 1.35;
}

.ro-form[data-ro-form="profile"] .ro-error {
  flex-shrink: 0;
}

/* Give expanded onboarding a little more breathing room for inline errors,
   while still staying viewport-safe. */
@media (min-width: 821px) {
  .ro-modal.is-expanded {
    width: min(1160px, calc(100vw - 48px));
    height: min(760px, calc(100dvh - 48px));
    min-height: min(640px, calc(100dvh - 48px));
  }
}


/* Phone picker placeholder — Chrome/WebKit uses -webkit-text-fill-color on
   .relify-phone-local, so override that too or the placeholder looks like data. */
.ro-modal .relify-phone-local::placeholder {
  color: #b0b5bd !important;
  -webkit-text-fill-color: #b0b5bd !important;
  opacity: 1 !important;
  font-weight: 400 !important;
}

html.dark .ro-modal .relify-phone-local::placeholder {
  color: #7f8792 !important;
  -webkit-text-fill-color: #7f8792 !important;
}


/* Branch review footer breathing room.
   Keep the note/actions visually away from the modal's bottom edge. */
.ro-modal[data-view="branch"] .ro-footer-sticky {
  padding-bottom: 26px;
}

@media (max-width: 820px) {
  .ro-modal[data-view="branch"] .ro-footer-sticky {
    padding-bottom: 20px;
  }
}


/* Assigned clinic card: show the clinic/branch logo when onboarding has one. */
.ro-assignment-icon.ro-assignment-icon-logo {
  overflow: hidden;
  padding: 5px;
  background: #fff;
}

.ro-assignment-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.ro-assignment-logo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}


/* =========================================================
   Doctor / Locum Doctor onboarding
   ========================================================= */
.ro-clinical-form {
  margin-top: 16px;
}

.ro-textarea {
  min-height: 74px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  line-height: 1.45;
}

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

.ro-clinical-asset-card {
  min-width: 0;
}

.ro-clinical-upload {
  min-height: 190px;
  padding: 16px;
}

.ro-clinical-upload .ro-upload-preview {
  width: 100%;
  min-height: 86px;
}

.ro-clinical-asset-img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 86px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

.ro-clinical-remove {
  margin-top: 7px;
}

.ro-required-inline {
  color: #dc2626;
  font-weight: 700;
}

html.dark .ro-required-inline {
  color: #f87171;
}

@media (max-width: 820px) {
  .ro-clinical-assets {
    grid-template-columns: 1fr;
  }

  .ro-clinical-upload {
    min-height: 155px;
  }
}


.ro-signature-card {
  position: relative;
}

.ro-signature-methods {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 9px;
  padding: 3px;
  border: 1px solid var(--ro-line);
  border-radius: 9px;
  background: var(--ro-control);
}

.ro-signature-method {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ro-muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ro-signature-method:hover {
  color: var(--ro-text);
}

.ro-signature-method.is-active {
  background: var(--ro-surface);
  color: var(--ro-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.ro-signature-pad-shell {
  padding: 13px;
  border: 1px solid var(--ro-line);
  border-radius: 12px;
  background: var(--ro-control);
}

.ro-signature-pad-head,
.ro-signature-pad-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ro-signature-pad-head {
  margin-bottom: 10px;
}

.ro-signature-pad-head > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.ro-signature-pad-head strong {
  color: var(--ro-text);
  font-size: 11px;
  font-weight: 700;
}

.ro-signature-pad-head small,
.ro-signature-pad-actions > span {
  color: var(--ro-soft-text);
  font-size: 9.5px;
  line-height: 1.4;
}

.ro-signature-pad {
  display: block;
  width: 100%;
  height: 150px;
  border: 1px dashed var(--ro-line);
  border-radius: 10px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.ro-signature-pad-actions {
  margin-top: 10px;
}

.ro-signature-use-btn {
  min-height: 34px;
  flex: 0 0 auto;
}

html.dark .ro-signature-pad {
  background: #fff;
}

@media (max-width: 820px) {.ro-signature-pad {
    height: 135px;
  }

  .ro-signature-pad-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* =========================================================
   Onboarding polish — shared footer spacing, signature tabs,
   aligned clinical cards and Relify single-date fields
   ========================================================= */

/* Every expanded onboarding screen gets the same safe space under its
   note + action row. This applies to Profile, Credentials, Signature,
   Branch, Branding, Ready and Guide instead of fixing screens one by one. */
.ro-modal.is-expanded .ro-footer {
  padding-bottom: 28px;
}

.ro-modal.is-expanded .ro-main {
  scroll-padding-bottom: 28px;
}

/* Signature method switch belongs above BOTH cards so Signature and Stamp
   begin on the exact same horizontal line. */
.ro-signature-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 10px;
}

.ro-clinical-assets {
  align-items: stretch;
}

.ro-clinical-asset-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ro-clinical-asset-card > .ro-clinical-upload {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
}

.ro-signature-pad-shell {
  flex: 1 1 auto;
  min-height: 190px;
}

/* Minimal / modern segmented pill.
   Inactive = transparent, hover = subtle fill, active = white pill. */
.ro-signature-methods {
  margin: 0;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--ro-line);
  border-radius: 10px;
  background: var(--ro-control);
}

.ro-signature-method {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ro-muted);
  box-shadow: none;
  transform: none;
  transition:
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.ro-signature-method:hover:not(.is-active) {
  background: rgba(17, 24, 39, 0.055);
  color: var(--ro-text);
}

.ro-signature-method.is-active {
  background: #ffffff !important;
  color: #111318 !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.035);
}

html.dark .ro-signature-methods {
  background: #24272d;
  border-color: #373c45;
}

html.dark .ro-signature-method:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.075);
  color: #f5f6f8;
}

html.dark .ro-signature-method.is-active {
  background: #ffffff !important;
  color: #111318 !important;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Shared Relify single-date trigger inside onboarding.
   RelifyDatePicker.mount() supplies the actual calendar popup/behaviour. */
.ro-relify-date-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 11px;
  text-align: left;
  cursor: pointer;
  line-height: 1;
}

.ro-relify-date-btn:hover {
  background: var(--ro-control);
}

.ro-relify-date-btn:focus,
.ro-relify-date-btn:focus-visible {
  border-color: #9da3ae;
  box-shadow: 0 0 0 3px var(--ro-focus);
}

.ro-relify-date-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  stroke: var(--ro-muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ro-modal .ro-relify-date-btn .relify-date-segments {
  min-width: 0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ro-text);
}

.ro-modal .ro-relify-date-btn .relify-date-segments span[data-part] {
  color: var(--ro-text);
}

.ro-modal .ro-relify-date-btn .relify-date-segments .sep {
  color: var(--ro-soft-text);
}

html.dark .ro-relify-date-btn {
  background: var(--ro-bg) !important;
  color: var(--ro-text) !important;
}

html.dark .ro-relify-date-btn:hover {
  background: var(--ro-control) !important;
}

html.dark .ro-relify-date-btn .relify-date-segments,
html.dark .ro-relify-date-btn .relify-date-segments span[data-part] {
  color: var(--ro-text) !important;
}

@media (max-width: 820px) {
  .ro-modal.is-expanded .ro-footer {
    padding-bottom: 20px;
  }

  .ro-modal.is-expanded .ro-main {
    scroll-padding-bottom: 20px;
  }

  .ro-signature-toolbar {
    margin-bottom: 9px;
  }

  .ro-signature-pad-shell {
    min-height: 155px;
  }
}


/* Relify DatePicker is appended to document.body, outside the onboarding host.
   Keep its calendar and month/year panels above the high-z-index onboarding modal. */
body.ro-onboarding-open .relify-datepicker,
body.ro-onboarding-open .rdp-month-panel,
body.ro-onboarding-open .rdp-year-panel {
  z-index: 2147483646 !important;
}


/* ─────────────────────────────────────────────────────────────
   FIX — compact Welcome card must have an opaque white content panel.
   The dashboard/backdrop must never bleed through the lower half.
   Keep dark mode using its normal onboarding surface.
   ───────────────────────────────────────────────────────────── */
html:not(.dark) .ro-modal.is-compact[data-view="welcome"] {
  background-color: #ffffff !important;
}

html:not(.dark) .ro-modal.is-compact[data-view="welcome"] .ro-main,
html:not(.dark) .ro-modal.is-compact[data-view="welcome"] .ro-view-wrap,
html:not(.dark) .ro-modal.is-compact[data-view="welcome"] .ro-welcome-view {
  background-color: #ffffff !important;
}

/* Ensure the artwork/white-panel join stays crisp. */
html:not(.dark) .ro-modal.is-compact[data-view="welcome"] .ro-visual {
  border-bottom-color: rgba(17, 24, 39, 0.08) !important;
}
