/* =========================
  ScanWin — style.css
========================= */


/* =========================
  Brand Tokens Start
========================= */
:root {
  /* Brand colors */
  --sw-violet: #6e5df8;
  --sw-violet-600: #5a47e8;
  --sw-violet-50: #f5f4fe;
  --sw-lime: #d4ff3f;

  /* Surfaces */
  --sw-bg-app: #fafafb;
  --sw-bg-dark: #1a0d2e;
  --sw-bg-card: #ffffff;

  /* Text */
  --sw-text: #1a1232;
  --sw-text-muted: #6b6f7b;
  --sw-text-faint: #9ca3af;

  /* Borders */
  --sw-border: #ece9e0;
  --sw-border-strong: #d9d5cb;

  /* Extended tokens (synced with merchant dashboard) */
  --sw-violet-500: #6d5ef7;
  --sw-violet-800: #3c3489;
  --sw-brand-subtle: #f5f4fe;
  --sw-brand-soft: #eeedfe;

  --sw-text-primary: #0f1020;
  --sw-text-secondary: #6b7280;
  --sw-text-tertiary: #9ca3af;

  --sw-surface: #ffffff;
  --sw-surface-muted: #f3f4f6;
  --sw-page: #fafafb;

  --sw-border-subtle: #f3f4f6;
  --sw-border-default: #e5e7eb;
  --sw-border-strong2: #d1d5db;

  --sw-success: #10b981;
  --sw-success-soft: #d1fae5;
  --sw-success-text: #065f46;
  --sw-emerald-600: #059669;
  --sw-warning-soft: #fef3c7;
  --sw-warning-text: #b45309;
  --sw-danger-soft: #fef2f2;
  --sw-danger-text: #dc2626;

  --sw-h1-size: 32px;
  --sw-h1-lh: 40px;
  --sw-h1-weight: 600;
  --sw-h1-ls: -1px; /* Figma Heading/H1 */
  --sw-h5-size: 16px;
  --sw-h5-lh: 24px;
  --sw-h5-weight: 600;
  --sw-h5-ls: 0; /* Figma Heading/H5 */
  --sw-bodyxs-size: 12px;
  --sw-bodyxs-lh: 16px;
  --sw-bodyxs-weight: 400; /* Figma Body/XS */

  --sw-space-1: 4px;
  --sw-space-2: 8px;
  --sw-space-3: 12px;
  --sw-space-4: 16px;
  --sw-space-5: 20px;
  --sw-space-6: 24px;
  --sw-space-8: 32px;
  --sw-space-10: 40px;

  --sw-radius-sm: 8px;
  --sw-radius-md: 10px;
  --sw-radius-lg: 16px;
  --sw-radius-xl: 20px;
}
/* =========================
  Brand Tokens End
========================= */


/* =========================
  Global Resets / Typography Start
========================= */
html,
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  color: var(--sw-text);
  background: var(--sw-bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Always reserve the vertical scrollbar gutter so navigating
   between a tall page (login) and a short page (forgot password)
   doesn't shift the showcase column horizontally. */
html {
  scrollbar-gutter: stable;
}

/* =========================
  Interactive focus states
  Visible keyboard focus on every clickable element. :focus-visible
  shows the ring for keyboard / assistive-tech users only — it does
  not flash on mouse click. outline-offset avoids any layout shift.
========================= */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--sw-violet-500);
  outline-offset: 2px;
}

/* Clickable controls show the pointer cursor. */
button:not(:disabled),
[role="button"],
[role="tab"],
[role="menuitem"] {
  cursor: pointer;
}

/* Re-skin Bootstrap primary button to ScanWin violet */
.btn-primary {
  --bs-btn-bg: var(--sw-violet);
  --bs-btn-border-color: var(--sw-violet);
  --bs-btn-hover-bg: var(--sw-violet-600);
  --bs-btn-hover-border-color: var(--sw-violet-600);
  --bs-btn-active-bg: var(--sw-violet-600);
  --bs-btn-active-border-color: var(--sw-violet-600);
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
}

/* Generic violet text-link helper */
.text-violet {
  color: var(--sw-violet) !important;
}

.text-violet:hover {
  color: var(--sw-violet-600);
}
/* =========================
  Global Resets / Typography End
========================= */


/* =========================
  App Shell — Sidebar Start
========================= */
.sw-sidebar {
  background: #fff;
  padding: 24px 16px;
  overflow-y: auto;
}

/* Drawer-only header (logo + X close button) */
.sw-sidebar__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.sw-sidebar__drawer-head .sw-sidebar__brand {
  margin: 0;
  padding: 0;
}
.sw-sidebar__close {
  width: 32px;
  height: 32px;
  background: none;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
}
.sw-sidebar__close:hover {
  background: #f3f4f6;
  color: #0f1020;
}

.sw-sidebar__drawer-foot {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sw-sidebar__drawer-foot-photo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: #18181b;
  flex-shrink: 0;
}
.sw-sidebar__drawer-foot-text {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}
.sw-sidebar__drawer-foot-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
}
.sw-sidebar__drawer-foot-role {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--sw-violet);
  margin-top: 2px;
}
.sw-sidebar__drawer-foot-chev {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

/* =========================
  Sidebar Drawer Profile Start
  Mobile-only: a rounded gray card pinned to the bottom of the
  sidebar drawer. Contains the user chip (always visible) and
  an expandable menu (View profile / Settings / Help & support
  / Log out). Tap the chip to toggle.
  Hidden on lg+ via responsive.css alongside drawer-foot chrome.
========================= */
.sw-drawer-profile {
  margin: auto 12px 12px 12px;
  margin-top: auto;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Chip — top of the gray card, always visible. <button> stripped
   of browser chrome so it visually matches the figma. */
.sw-drawer-profile__chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 4px 12px 4px 4px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.sw-drawer-profile__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  background: #18181b;
  flex-shrink: 0;
}

.sw-drawer-profile__id {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sw-drawer-profile__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  color: #0f1020;
}

.sw-drawer-profile__role {
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  color: var(--sw-violet);
}

.sw-drawer-profile__chev {
  width: 14px;
  height: 14px;
  color: var(--sw-text-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.sw-drawer-profile.is-open .sw-drawer-profile__chev {
  transform: rotate(180deg);
}

/* Expandable content — hidden by default, revealed when wrap is .is-open */
.sw-drawer-profile__expand {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.sw-drawer-profile.is-open .sw-drawer-profile__expand {
  display: flex;
}

.sw-drawer-profile__menu {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.sw-drawer-profile__sep {
  margin: 0;
  border: 0;
  border-top: 1px solid #d9d9d9;
}

.sw-drawer-profile__logout {
  padding: 8px;
}

.sw-drawer-profile__item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: #1a1232;
  text-decoration: none;
}

.sw-drawer-profile__item:hover,
.sw-drawer-profile__item:focus-visible,
.sw-drawer-profile__item:active {
  background: rgba(255, 255, 255, 0.6);
  color: #1a1232;
}

.sw-drawer-profile__item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--sw-text-muted);
}

.sw-drawer-profile__item-arrow {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: var(--sw-text-faint);
  flex-shrink: 0;
}

.sw-drawer-profile__item--danger {
  color: #ef4444;
}

.sw-drawer-profile__item--danger .sw-drawer-profile__item-icon {
  color: #ef4444;
}

.sw-drawer-profile__item--danger:hover,
.sw-drawer-profile__item--danger:focus-visible,
.sw-drawer-profile__item--danger:active {
  background: #fef2f2;
  color: #dc2626;
}

.sw-drawer-profile__item--danger:hover .sw-drawer-profile__item-icon,
.sw-drawer-profile__item--danger:focus-visible .sw-drawer-profile__item-icon,
.sw-drawer-profile__item--danger:active .sw-drawer-profile__item-icon {
  color: #dc2626;
}
/* =========================
  Sidebar Drawer Profile End
========================= */

.sw-sidebar.offcanvas {
  display: flex;
  flex-direction: column;
}
.sw-sidebar.offcanvas > nav,
.sw-sidebar.offcanvas > .sw-sidebar__group {
  flex-shrink: 0;
}

.sw-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  margin-bottom: 24px;
  text-decoration: none;
}

.sw-sidebar__brand-mark {
  width: 28px;
  height: 28px;
}

.sw-sidebar__brand-name {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: #0f1020;
}

.sw-sidebar__group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #b3b3bb;
  margin: 16px 12px 8px;
  text-transform: uppercase;
}

.sw-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sw-text-muted);
  text-decoration: none;
  transition:
    background 0.12s,
    color 0.12s;
  margin-bottom: 2px;
}

.sw-nav-item:hover,
.sw-nav-item:focus-visible {
  background: #f6f6f8;
  color: var(--sw-text);
}

.sw-nav-item.is-active {
  background: var(--sw-violet-50);
  color: var(--sw-violet);
  font-weight: 600;
}

.sw-nav-item__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
/* =========================
  App Shell — Sidebar End
========================= */


/* =========================
  App Shell — Main Column Start
========================= */
.sw-app {
  display: flex;
  min-height: 100vh;
  background: var(--sw-bg-app);
}

.sw-app__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sw-app__content {
  padding: 32px;
  padding-bottom: 16px;
  flex: 1;
}
/* =========================
  App Shell — Main Column End
========================= */


/* =========================
  App Shell — Topbar (Desktop) Start
========================= */
.sw-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.sw-topbar__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-topbar__title-kicker {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--sw-text-faint);
}

.sw-topbar__title-h {
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: -0.44px;
  color: #0f1020;
  margin: 0;
}

.sw-topbar__search {
  width: 280px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  color: var(--sw-text-faint);
  margin-left: auto;
}

.sw-topbar__search:focus-within {
  background: var(--sw-surface, #fff);
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
}

.sw-topbar__search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--sw-text);
}

.sw-topbar__search input::placeholder {
  color: var(--sw-text-faint);
}

.sw-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 8px 12px;
  background: linear-gradient(90deg, #f59e0a 0%, #ed4545 100%);
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  text-decoration: none;
}

.sw-streak__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sw-streak:hover {
  color: #fff;
  filter: brightness(1.05);
}

/* Bell button */
.sw-bell {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  color: var(--sw-text-muted);
}

.sw-bell:hover {
  background: #e9eaee;
  color: var(--sw-text);
}

.sw-bell__dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  border: 1.5px solid #fff;
}

/* Avatar menu — the trigger pill in the topbar. Becomes a
   <button> (was <a>) so it can open the avatar dropdown below
   it; .sw-user-menu-wrap is the positioning context. */
.sw-user-menu-wrap {
  position: relative;
  display: inline-block;
}

.sw-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: #f3f4f6;
  border: 1px solid #f3f4f6;
  border-radius: 999px;
  text-decoration: none;
  color: var(--sw-text);
  cursor: pointer;
  font: inherit;
  text-align: left; /* reset <button> default so name/brand align left */
}

.sw-user-menu:hover {
  background: #e9eaee;
  color: var(--sw-text);
}

.sw-user-menu__photo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #18181b;
  object-fit: cover;
  flex-shrink: 0;
}

.sw-user-menu__name {
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  color: #0f1020;
}

.sw-user-menu__role {
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  color: var(--sw-violet);
}

.sw-user-menu__chev {
  transition: transform 0.18s ease;
}

.sw-user-menu-wrap.is-open .sw-user-menu__chev {
  transform: rotate(180deg);
}

/* =========================
  Avatar Dropdown Start
  Opens beneath the topbar user-menu pill. Three sections
  separated by 1px lines: profile info, menu, log-out.
========================= */
.sw-user-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  width: 300px;
  background: #fff;
  border: 1px solid var(--sw-border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 10, 33, 0.12);
  overflow: hidden;
  z-index: 50;
  display: none;
}

.sw-user-menu-wrap.is-open .sw-user-dropdown {
  display: block;
}

.sw-user-dropdown__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fafafb;
}

.sw-user-dropdown__avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  background: #18181b;
  flex-shrink: 0;
}

.sw-user-dropdown__info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sw-user-dropdown__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sw-user-dropdown__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: #1a1232;
}

.sw-user-dropdown__handle {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #6b7280;
}

.sw-user-dropdown__tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  margin-top: 4px;
  background: var(--sw-violet-50);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.54px;
  color: var(--sw-violet);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.sw-user-dropdown__tier-badge {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #e0a82e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sw-user-dropdown__tier-badge svg {
  width: 7px;
  height: 7px;
}

.sw-user-dropdown__section {
  padding: 8px;
  border-top: 1px solid var(--sw-border);
}

.sw-user-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sw-user-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: #1a1232;
  text-decoration: none;
  transition: background 0.12s;
}

.sw-user-dropdown__item:hover,
.sw-user-dropdown__item:focus-visible {
  background: #f3f4f6;
  color: #1a1232;
}

.sw-user-dropdown__item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #6b7280;
}

.sw-user-dropdown__item-arrow {
  width: 12px;
  height: 12px;
  margin-left: auto;
  color: #9ca3af;
  flex-shrink: 0;
}

.sw-user-dropdown__item--danger {
  color: #ef4444;
}

.sw-user-dropdown__item--danger .sw-user-dropdown__item-icon {
  color: #ef4444;
}

.sw-user-dropdown__item--danger:hover,
.sw-user-dropdown__item--danger:focus-visible {
  background: #fef2f2;
  color: #dc2626;
}

.sw-user-dropdown__item--danger:hover .sw-user-dropdown__item-icon,
.sw-user-dropdown__item--danger:focus-visible .sw-user-dropdown__item-icon {
  color: #dc2626;
}
/* =========================
  Avatar Dropdown End
========================= */

.sw-btn-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: linear-gradient(90deg, #f59e0a 0%, #ed4545 100%);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.sw-btn-live:hover {
  color: #fff;
  filter: brightness(1.05);
}

.sw-btn-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
}

.sw-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sw-text-muted);
  border: 0;
}

.sw-icon-btn:hover {
  background: #e9eaee;
  color: var(--sw-text);
}
/* =========================
  App Shell — Topbar (Desktop) End
========================= */


/* =========================
  App Shell — Mobile Top Nav Start
========================= */
.sw-mobile-nav {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sw-mobile-nav .sw-sidebar__brand {
  margin: 0;
  padding: 0;
  gap: 4px;
}

.sw-mobile-nav .sw-sidebar__brand-mark {
  width: 32px;
  height: 32px;
}

.sw-mobile-nav .sw-sidebar__brand-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.42px;
}

.sw-mobile-nav__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sw-mobile-nav__right-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sw-mobile-nav .sw-bell {
  width: 33px;
  height: 32px;
}

.sw-mobile-nav .sw-bell__dot {
  top: 4px;
  right: 4px;
}

.sw-mobile-menu-btn {
  background: none;
  border: 0;
  padding: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f1020;
}
/* =========================
  App Shell — Mobile Top Nav End
====================== */


/* =========================
  Shared Card Chrome Start
  Reusable surface used across dashboard, campaigns,
  my-campaigns, links, analytics, profile, settings.
========================= */
.sw-card {
  background: #fff;
  border: 1px solid var(--sw-border-default);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 16, 32, 0.04);
}

.sw-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--sw-text);
  margin: 0 0 4px 0;
}

.sw-card__subtitle {
  font-size: 13px;
  color: var(--sw-text-muted);
  margin: 0;
}

.sw-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.sw-view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--sw-violet);
  text-decoration: none;
}

.sw-view-all:hover {
  color: var(--sw-violet-600);
}
/* =========================
  Shared Card Chrome End
========================= */


/* =========================
  Verification Badge Start
  Small pill rendered on every campaign card (list + grid) to
  show whether the creator's posted content has been verified by
  the system. Backed by campaign_participation.verification_status
  (enum: verified | awaiting). Flips to verified when the backend
  confirms the Social Share trigger or Video Completion event
  (PO Audit 4.2 / 5.1.4). While awaiting, payout stays locked.
  Lives in style.css so it can be reused by dashboard, my-campaigns
  and any future campaign-card surface.
========================= */
.sw-verify-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 12px;
  white-space: nowrap;
}

.sw-verify-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sw-verify-badge--verified {
  background: #d1fae5;
  color: #047857;
}

.sw-verify-badge--verified .sw-verify-badge__dot {
  background: #10b981;
}

.sw-verify-badge--awaiting {
  background: #fef3c7;
  color: #b45309;
}

.sw-verify-badge--awaiting .sw-verify-badge__dot {
  background: #f59e0b;
}
/* =========================
  Verification Badge End
========================= */


/* =========================
  Share Link Modal Start
  Single-instance modal triggered by any [data-share-trigger].
  Desktop: centered card with backdrop, slide+fade entrance.
  Mobile (<576px): bottom sheet that slides up from below.
  Both use the same DOM; the @media flips alignment + transform.
  Lives in style.css so any page can embed a #swShareModal and
  share-modal JS in main.js will wire it up automatically.
========================= */
.sw-share-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sw-share-modal.is-open {
  pointer-events: auto;
}

.sw-share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 16, 32, 0.5);
  opacity: 0;
  transition: opacity 0.22s ease-out;
}

.sw-share-modal.is-open .sw-share-modal__backdrop {
  opacity: 1;
}

.sw-share-modal__panel {
  position: relative;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 16, 32, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s ease-out;
}

.sw-share-modal.is-open .sw-share-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sw-share-modal__head {
  padding: 28px 28px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.sw-share-modal__head-text {
  flex: 1;
  min-width: 0;
}

.sw-share-modal__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  color: #0f1020;
  margin: 0 0 4px;
}

.sw-share-modal__subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #6b7280;
  margin: 0;
}

.sw-share-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 0;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-share-modal__close svg {
  width: 16px;
  height: 16px;
}

.sw-share-modal__close:hover {
  background: #e5e7eb;
  color: #0f1020;
}

.sw-share-modal__body {
  padding: 0 28px;
  overflow-y: auto;
  flex: 1;
}

.sw-share-modal__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  background: #F5F4FE;
  border: 1px solid #DDD9FC;
  border-radius: 10px;
  margin-bottom: 24px;
}

.sw-share-modal__link-thumb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sw-share-modal__link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sw-share-modal__link-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 16px;
  color: #0f1020;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-share-modal__link-url {
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-share-modal__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: #6D5EF7;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sw-share-modal__copy svg {
  width: 12px;
  height: 12px;
  color: #FFFFFF;
}

.sw-share-modal__copy:hover {
  background: var(--sw-violet-600);
}

.sw-share-modal__copy.is-copied {
  background: #d1fae5;
  border-color: #d1fae5;
  color: #047857;
}

.sw-share-modal__copy.is-copied svg {
  color: #047857;
}

.sw-share-modal__group {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.sw-share-modal__platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.sw-share-modal__platform {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: #0f1020;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}

.sw-share-modal__platform:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(15, 16, 32, 0.06);
  color: #0f1020;
  transform: translateY(-1px);
}

.sw-share-modal__platform-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.sw-share-modal__platform-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sw-share-modal__platform-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: #0f1020;
}

.sw-share-modal__platform-sub {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #6b7280;
}

.sw-share-modal__or {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.sw-share-modal__or::before,
.sw-share-modal__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ECE9E0;
}

.sw-share-modal__or span {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #9ca3af;
  text-transform: uppercase;
}

.sw-share-modal__alt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sw-share-modal__alt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  background: #F3F4F6;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #0f1020;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.sw-share-modal__alt-btn svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.sw-share-modal__alt-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #0f1020;
}

.sw-share-modal__foot {
  padding: 20px 28px;
  flex-shrink: 0;
}

.sw-share-modal__done {
  display: block;
  width: 100%;
  height: 44px;
  background: var(--sw-violet);
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.sw-share-modal__done:hover {
  background: var(--sw-violet-600);
}

body.sw-share-locked {
  overflow: hidden;
}

/* Mobile bottom-sheet variant */
@media (max-width: 575.98px) {
  .sw-share-modal {
    align-items: flex-end;
  }

  .sw-share-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .sw-share-modal.is-open .sw-share-modal__panel {
    transform: translateY(0);
  }

  .sw-share-modal__panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
  }

  .sw-share-modal__head {
    padding: 28px 28px 20px;
  }

  /* Body absorbs the bottom padding now that the footer is
     hidden on phones — keeps the Email/Messages row off the
     sheet edge. */
  .sw-share-modal__body {
    padding: 0 28px 28px;
  }

  /* Done button / footer is dropped on phones per the figma
     mobile spec (949:3080). X close, Escape, and a backdrop
     tap still dismiss the modal. */
  .sw-share-modal__foot {
    display: none;
  }

  /* Header subtitle wraps to 2 lines on phones — let the line
     box grow rather than truncate. */
  .sw-share-modal__subtitle {
    white-space: normal;
  }

  /* Platform tile: icon stacks above text (figma mobile layout).
     Inner spacing matches the 332px tile: 16L/R · 12T/B with
     12px between the icon and the text column. */
  .sw-share-modal__platform {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .sw-share-modal__platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .sw-share-modal__platform-icon svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-share-modal__backdrop,
  .sw-share-modal__panel {
    transition: none;
  }
}
/* =========================
  Share Link Modal End
========================= */


/* =========================
  Generate Link Modal Start
  Opens when [data-genlink-trigger] is tapped (currently the
  "Generate new link" button on My Links). Lets the creator pick
  a campaign, optionally customize the URL slug, and copy/save
  the resulting tracking link. Same shell pattern as the share
  modal: centered card on desktop, bottom-sheet on phones.
========================= */
.sw-genlink-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sw-genlink-modal.is-open {
  pointer-events: auto;
}

.sw-genlink-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 16, 32, 0.5);
  opacity: 0;
  transition: opacity 0.22s ease-out;
}

.sw-genlink-modal.is-open .sw-genlink-modal__backdrop {
  opacity: 1;
}

.sw-genlink-modal__panel {
  position: relative;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 16, 32, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s ease-out;
}

.sw-genlink-modal.is-open .sw-genlink-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sw-genlink-modal__head {
  padding: 28px 28px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.sw-genlink-modal__head-text {
  flex: 1;
  min-width: 0;
}

.sw-genlink-modal__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  color: #0f1020;
  margin: 0 0 4px;
}

.sw-genlink-modal__subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #6b7280;
  margin: 0;
}

.sw-genlink-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 0;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-genlink-modal__close svg {
  width: 16px;
  height: 16px;
}

.sw-genlink-modal__close:hover {
  background: #e5e7eb;
  color: #0f1020;
}

.sw-genlink-modal__body {
  padding: 0 28px 4px;
  flex: 1;
  /* Note: deliberately NOT overflow-y:auto. The dropdown menu
     is absolutely positioned inside this body, and an overflow
     context here would clip the menu (and force the body to
     scroll instead of letting the menu float over the slug +
     preview fields). The panel's max-height + overflow:hidden
     still caps the whole modal on short viewports. */
}

.sw-genlink-modal__field {
  margin-bottom: 18px;
}

.sw-genlink-modal__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  margin-bottom: 8px;
}

.sw-genlink-modal__label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.sw-genlink-modal__label-row .sw-genlink-modal__label {
  margin-bottom: 0;
}

.sw-genlink-modal__label-hint {
  font-size: 12px;
  font-weight: 400;
  color: #9ca3af;
}

/* Campaign select — custom listbox so the dropdown matches the
   design system instead of falling back to native browser UI.
   Markup is <button> + <ul role="listbox"> sibling inside a
   relative wrap. JS toggles .is-open on the wrap. */
.sw-genlink-modal__select-wrap {
  position: relative;
}

.sw-genlink-modal__select-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 64px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sw-genlink-modal__select-trigger:hover {
  border-color: #d1d5db;
}

.sw-genlink-modal__select-wrap.is-open .sw-genlink-modal__select-trigger,
.sw-genlink-modal__select-trigger:focus-visible {
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
  outline: 0;
}

.sw-genlink-modal__select-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sw-genlink-modal__select-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sw-genlink-modal__select-brand {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: #0f1020;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-genlink-modal__select-meta {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-genlink-modal__select-chev {
  width: 18px;
  height: 18px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.sw-genlink-modal__select-wrap.is-open .sw-genlink-modal__select-chev {
  transform: rotate(180deg);
}

/* Dropdown menu — absolutely positioned beneath the trigger.
   Capped at ~5 rows tall with scroll for longer lists. */
.sw-genlink-modal__select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 16, 32, 0.12);
  padding: 6px;
  margin: 0;
  list-style: none;
  /* Floats above the slug + preview fields below it. The body
     no longer creates an overflow context (see __body), so the
     menu can paint freely over its siblings. */
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out,
    visibility 0s linear 0.15s;
}

.sw-genlink-modal__select-wrap.is-open .sw-genlink-modal__select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out,
    visibility 0s;
}

.sw-genlink-modal__select-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.sw-genlink-modal__select-option:hover,
.sw-genlink-modal__select-option:focus-visible {
  background: #f3f4f6;
  outline: 0;
}

.sw-genlink-modal__select-option.is-selected {
  background: var(--sw-violet-50);
}

.sw-genlink-modal__select-option > img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sw-genlink-modal__select-check {
  width: 16px;
  height: 16px;
  color: var(--sw-violet);
  flex-shrink: 0;
  opacity: 0;
}

.sw-genlink-modal__select-option.is-selected .sw-genlink-modal__select-check {
  opacity: 1;
}

.sw-genlink-modal__select-option.is-selected .sw-genlink-modal__select-brand {
  color: var(--sw-violet);
}

/* Slug input with "scanwin.co/jr/" prefix */
.sw-genlink-modal__slug {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sw-genlink-modal__slug:focus-within {
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
}

.sw-genlink-modal__slug-prefix {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  flex-shrink: 0;
}

.sw-genlink-modal__slug-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #0f1020;
  min-width: 0;
}

.sw-genlink-modal__slug-input::placeholder {
  color: #c7c9d1;
}

/* YOUR LINK preview */
.sw-genlink-modal__group {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sw-genlink-modal__preview {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px 0 14px;
  background: #fafafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.sw-genlink-modal__preview-url {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0f1020;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-genlink-modal__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f1020;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sw-genlink-modal__copy svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
}

.sw-genlink-modal__copy:hover {
  background: #f3f4f6;
}

.sw-genlink-modal__copy.is-copied {
  background: #d1fae5;
  border-color: #d1fae5;
  color: #047857;
}

.sw-genlink-modal__copy.is-copied svg {
  color: #047857;
}

/* Footer: Cancel (ghost) + Generate (primary), right-aligned */
.sw-genlink-modal__foot {
  padding: 20px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.sw-genlink-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sw-genlink-modal__btn svg {
  width: 14px;
  height: 14px;
}

.sw-genlink-modal__btn--ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #0f1020;
}

.sw-genlink-modal__btn--ghost:hover {
  background: #f9fafb;
}

.sw-genlink-modal__btn--primary {
  background: var(--sw-violet);
  border: 1px solid var(--sw-violet);
  color: #fff;
}

.sw-genlink-modal__btn--primary:hover {
  background: var(--sw-violet-600);
  border-color: var(--sw-violet-600);
}

/* Loading state — replaces the button content with a 14px
   rotating ring + "Generating…" label. Disables click. */
.sw-genlink-modal__btn.is-loading {
  pointer-events: none;
  opacity: 0.92;
}

.sw-genlink-modal__btn.is-loading > svg,
.sw-genlink-modal__btn.is-loading > .sw-genlink-modal__btn-label {
  display: none;
}

.sw-genlink-modal__btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: sw-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.sw-genlink-modal__btn.is-loading .sw-genlink-modal__btn-spinner {
  display: inline-block;
}

.sw-genlink-modal__btn.is-loading::after {
  content: "Generating\2026";
}

@keyframes sw-spin {
  to { transform: rotate(360deg); }
}

body.sw-genlink-locked {
  overflow: hidden;
}

/* Mobile bottom-sheet variant */
@media (max-width: 575.98px) {
  .sw-genlink-modal {
    align-items: flex-end;
  }

  .sw-genlink-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .sw-genlink-modal.is-open .sw-genlink-modal__panel {
    transform: translateY(0);
  }

  /* Pull-handle indicator at top of bottom sheet */
  .sw-genlink-modal__panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
  }

  .sw-genlink-modal__head {
    padding: 28px 28px 20px;
  }

  .sw-genlink-modal__body {
    padding: 0 28px 4px;
  }

  .sw-genlink-modal__foot {
    padding: 16px 28px 24px;
    gap: 10px;
  }

  /* Cancel + Generate split 50/50 across the sheet width */
  .sw-genlink-modal__btn {
    flex: 1;
    height: 48px;
    padding: 0 12px;
  }

  .sw-genlink-modal__subtitle {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-genlink-modal__backdrop,
  .sw-genlink-modal__panel {
    transition: none;
  }
}
/* =========================
  Generate Link Modal End
========================= */


/* =========================
  QR Download Modal Start
  Opens when a Show-QR button is clicked on My Links. Renders a
  live QR preview, lets the creator pick a style (Branded / Plain)
  and size/format, then downloads. Same shell pattern as the
  share + genlink modals.
========================= */
.sw-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sw-qr-modal.is-open {
  pointer-events: auto;
}

.sw-qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 16, 32, 0.5);
  opacity: 0;
  transition: opacity 0.22s ease-out;
}

.sw-qr-modal.is-open .sw-qr-modal__backdrop {
  opacity: 1;
}

.sw-qr-modal__panel {
  position: relative;
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 16, 32, 0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s ease-out;
}

.sw-qr-modal.is-open .sw-qr-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.sw-qr-modal__head {
  padding: 28px 28px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.sw-qr-modal__head-text {
  flex: 1;
  min-width: 0;
}

.sw-qr-modal__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
  color: #0f1020;
  margin: 0 0 4px;
}

.sw-qr-modal__subtitle {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #6b7280;
  margin: 0;
}

.sw-qr-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 0;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-qr-modal__close svg {
  width: 16px;
  height: 16px;
}

.sw-qr-modal__close:hover {
  background: #e5e7eb;
  color: #0f1020;
}

.sw-qr-modal__body {
  padding: 0 28px 4px;
  flex: 1;
  /* Flex children default to min-height:auto, which refuses to
     shrink below content size. On shorter viewports that pushes
     the footer (Cancel + Download) past the panel's overflow:hidden
     boundary, hiding the buttons. min-height:0 + overflow-y:auto
     keeps the footer pinned and lets the body scroll if needed. */
  min-height: 0;
  overflow-y: auto;
}

/* QR Preview tile */
.sw-qr-modal__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  background: var(--sw-violet-50);
  border-radius: 16px;
  margin-bottom: 20px;
}

.sw-qr-modal__qr {
  position: relative;
  width: 200px;
  height: 200px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sw-qr-modal__qr-img {
  width: 100%;
  height: 100%;
  display: block;
}

.sw-qr-modal__qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--sw-violet);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  box-shadow: 0 0 0 4px #fff;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.sw-qr-modal__qr.is-plain .sw-qr-modal__qr-logo {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  pointer-events: none;
}

.sw-qr-modal__caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-qr-modal__caption-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #10b981;
  flex-shrink: 0;
}

/* Field + label shared */
.sw-qr-modal__field {
  margin-bottom: 18px;
}

.sw-qr-modal__field:last-child {
  margin-bottom: 0;
}

.sw-qr-modal__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  margin-bottom: 8px;
}

/* Style tabs (segmented control) */
.sw-qr-modal__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 12px;
}

.sw-qr-modal__tab {
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.sw-qr-modal__tab:hover {
  color: #0f1020;
}

.sw-qr-modal__tab.is-active {
  background: #fff;
  color: var(--sw-violet);
  box-shadow: 0 1px 3px rgba(15, 16, 32, 0.06);
}

/* Size + Format row */
.sw-qr-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Custom select (Size / Format) — same listbox pattern as
   genlink modal so it feels part of the design system. */
.sw-qr-modal__select {
  position: relative;
}

.sw-qr-modal__select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0f1020;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sw-qr-modal__select-trigger:hover {
  border-color: #d1d5db;
}

.sw-qr-modal__select.is-open .sw-qr-modal__select-trigger,
.sw-qr-modal__select-trigger:focus-visible {
  border-color: var(--sw-violet);
  box-shadow: 0 0 0 3px rgba(110, 93, 248, 0.15);
  outline: 0;
}

.sw-qr-modal__select-chev {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.sw-qr-modal__select.is-open .sw-qr-modal__select-chev {
  transform: rotate(180deg);
}

.sw-qr-modal__select-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 16, 32, 0.12);
  padding: 6px;
  margin: 0;
  list-style: none;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out,
    visibility 0s linear 0.15s;
}

.sw-qr-modal__select.is-open .sw-qr-modal__select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out,
    visibility 0s;
}

.sw-qr-modal__select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #0f1020;
  cursor: pointer;
  transition: background 0.12s;
}

.sw-qr-modal__select-option:hover,
.sw-qr-modal__select-option:focus-visible {
  background: #f3f4f6;
  outline: 0;
}

.sw-qr-modal__select-option.is-selected {
  background: var(--sw-violet-50);
  color: var(--sw-violet);
}

.sw-qr-modal__select-check {
  width: 16px;
  height: 16px;
  color: var(--sw-violet);
  flex-shrink: 0;
  opacity: 0;
}

.sw-qr-modal__select-option.is-selected .sw-qr-modal__select-check {
  opacity: 1;
}

/* Footer */
.sw-qr-modal__foot {
  padding: 20px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.sw-qr-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sw-qr-modal__btn svg {
  width: 14px;
  height: 14px;
}

.sw-qr-modal__btn--ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #0f1020;
}

.sw-qr-modal__btn--ghost:hover {
  background: #f9fafb;
}

.sw-qr-modal__btn--primary {
  background: var(--sw-violet);
  border: 1px solid var(--sw-violet);
  color: #fff;
}

.sw-qr-modal__btn--primary:hover {
  background: var(--sw-violet-600);
  border-color: var(--sw-violet-600);
}

/* Loading state on Download button */
.sw-qr-modal__btn.is-loading {
  pointer-events: none;
  opacity: 0.92;
}

.sw-qr-modal__btn.is-loading > svg,
.sw-qr-modal__btn.is-loading > .sw-qr-modal__btn-label {
  display: none;
}

.sw-qr-modal__btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: sw-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.sw-qr-modal__btn.is-loading .sw-qr-modal__btn-spinner {
  display: inline-block;
}

.sw-qr-modal__btn.is-loading::after {
  content: "Preparing\2026";
}

body.sw-qr-locked {
  overflow: hidden;
}

/* Mobile bottom-sheet variant */
@media (max-width: 575.98px) {
  .sw-qr-modal {
    align-items: flex-end;
  }

  .sw-qr-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .sw-qr-modal.is-open .sw-qr-modal__panel {
    transform: translateY(0);
  }

  .sw-qr-modal__panel::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
  }

  .sw-qr-modal__head {
    padding: 28px 28px 20px;
  }

  .sw-qr-modal__body {
    padding: 0 28px 4px;
  }

  .sw-qr-modal__foot {
    padding: 16px 28px 24px;
    gap: 12px;
  }

  /* Size + Format stay side-by-side on phones (per updated figma).
     Desktop default is also 1fr 1fr, so this override exists only
     to set the mobile-specific 12px gap. */
  .sw-qr-modal__row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Cancel + Download split 50/50 across the sheet width */
  .sw-qr-modal__btn {
    flex: 1;
    height: 48px;
    padding: 0 12px;
  }

  .sw-qr-modal__subtitle {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-qr-modal__backdrop,
  .sw-qr-modal__panel,
  .sw-qr-modal__qr-logo {
    transition: none;
  }
}
/* =========================
  QR Download Modal End
========================= */


/* =========================
  Toast Notification Start
  Lives in a single host element (#swToastRegion) at the end of
  <body>. main.js exposes window.swToast({ title, body, kind })
  for any page to push a notification. Each toast slides in from
  the right on desktop, from the top on mobile, and auto-dismisses
  after 3.5s (paused on hover).
========================= */
.sw-toast-region {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.sw-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 360px;
  max-width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 16, 32, 0.16);
  overflow: hidden;
  transform: translateX(110%);
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.22s ease-out;
}

.sw-toast.is-open {
  transform: translateX(0);
  opacity: 1;
}

.sw-toast.is-leaving {
  transform: translateX(110%);
  opacity: 0;
}

/* Colored accent stripe on the left edge per kind */
.sw-toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--sw-violet);
}

.sw-toast--success::before { background: #10b981; }
.sw-toast--error::before   { background: #ef4444; }
.sw-toast--info::before    { background: var(--sw-violet); }

.sw-toast__icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--sw-violet-50);
  color: var(--sw-violet);
}

.sw-toast--success .sw-toast__icon { background: #d1fae5; color: #047857; }
.sw-toast--error .sw-toast__icon   { background: #fee2e2; color: #b91c1c; }

.sw-toast__icon svg {
  width: 18px;
  height: 18px;
}

.sw-toast__text {
  flex: 1;
  min-width: 0;
}

.sw-toast__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: #0f1020;
  margin-bottom: 2px;
}

.sw-toast__body {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #6b7280;
  word-break: break-word;
}

.sw-toast__close {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: none;
  border: 0;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-toast__close svg {
  width: 14px;
  height: 14px;
}

.sw-toast__close:hover {
  background: #f3f4f6;
  color: #0f1020;
}

/* Auto-dismiss progress bar (thin line under the toast).
   The CSS animation drives the visual timer; the JS removes
   the toast after the same duration. */
.sw-toast__bar {
  position: absolute;
  left: 4px;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(110, 93, 248, 0.16);
  transform-origin: left center;
  animation: sw-toast-bar 3.5s linear forwards;
}

.sw-toast--success .sw-toast__bar { background: rgba(16, 185, 129, 0.18); }
.sw-toast--error .sw-toast__bar   { background: rgba(239, 68, 68, 0.18); }

.sw-toast:hover .sw-toast__bar {
  animation-play-state: paused;
}

@keyframes sw-toast-bar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Mobile: stack at top-center, slide from top */
@media (max-width: 575.98px) {
  .sw-toast-region {
    top: 16px;
    right: 16px;
    left: 16px;
    align-items: stretch;
    max-width: none;
  }

  .sw-toast {
    width: auto;
    transform: translateY(-120%);
  }

  .sw-toast.is-open {
    transform: translateY(0);
  }

  .sw-toast.is-leaving {
    transform: translateY(-120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-toast,
  .sw-toast__bar {
    transition: none;
    animation: none;
  }
}
/* =========================
  Toast Notification End
========================= */


/* =========================
  Notification Popup — Shared Start
  Desktop: floating card anchored below the bell (right side
  of the topbar). Click-outside or ESC to dismiss.
  Mobile: full-screen sheet that slides in from the right,
  topped by an appbar (back btn + title). Per figma desktop
  894:12346 and mobile 949:1692.
========================= */
.sw-notif-popup {
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
}

.sw-notif-popup.is-open {
  pointer-events: auto;
}

.sw-notif-popup__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.sw-notif-popup__panel {
  position: absolute;
  top: 62px;
  right: 32px;
  width: 420px;
  max-height: min(80vh, 720px);
  background: #fff;
  border: 1px solid #ece9e0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 10, 33, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.sw-notif-popup.is-open .sw-notif-popup__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Mobile-only appbar (hidden on desktop) */
.sw-notif-popup__appbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  flex-shrink: 0;
}

.sw-notif-popup__appbar-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: #0f1020;
}

.sw-notif-popup__back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1232;
  cursor: pointer;
  flex-shrink: 0;
}

.sw-notif-popup__back svg {
  width: 18px;
  height: 18px;
}

.sw-notif-popup__appbar-spacer {
  width: 32px;
  flex-shrink: 0;
}

/* Header */
.sw-notif-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ece9e0;
  flex-shrink: 0;
}

.sw-notif-popup__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-notif-popup__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.08px;
  color: #0f1020;
  margin: 0;
}

.sw-notif-popup__count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #f0ebff;
  color: #6e5df8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.sw-notif-popup__settings {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1232;
  cursor: pointer;
}

.sw-notif-popup__settings svg {
  width: 16px;
  height: 16px;
}

.sw-notif-popup__mark-read {
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #6e5df8;
  cursor: pointer;
}

/* Tabs */
.sw-notif-popup__tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid #ece9e0;
  flex-shrink: 0;
}

.sw-notif-popup__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #6b6f7b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sw-notif-popup__tab:hover {
  color: #1a1232;
}

.sw-notif-popup__tab.is-active {
  background: #f0ebff;
  color: #6e5df8;
  font-weight: 600;
}

.sw-notif-popup__tab-count {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: #f3f4f6;
  color: #1a1232;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.sw-notif-popup__tab.is-active .sw-notif-popup__tab-count {
  background: #6e5df8;
  color: #fff;
}

/* List */
.sw-notif-popup__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sw-notif-popup__item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f5f4fe;
  cursor: pointer;
  transition: background 0.15s;
}

.sw-notif-popup__item:last-child {
  border-bottom: 0;
}

.sw-notif-popup__item:hover {
  background: #f5f4fe;
}

/* Unread items get a slightly tinted bg */
.sw-notif-popup__item--unread {
  background: #fafafb;
}

.sw-notif-popup__avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.sw-notif-popup__avatar svg {
  width: 18px;
  height: 18px;
}

.sw-notif-popup__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-notif-popup__text {
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: #1a1232;
  margin: 0;
}

.sw-notif-popup__text strong {
  font-weight: 600;
}

.sw-notif-popup__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-notif-popup__time {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
}

.sw-notif-popup__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #6e5df8;
  flex-shrink: 0;
}

/* Mobile: full-screen sheet slides in from the right */
@media (max-width: 767.98px) {
  .sw-notif-popup__backdrop {
    background: #fafafb;
  }

  .sw-notif-popup__panel {
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    transform: translateX(24px);
    transform-origin: center;
  }

  .sw-notif-popup.is-open .sw-notif-popup__panel {
    transform: translateX(0);
  }

  .sw-notif-popup__appbar {
    display: flex;
    border-bottom: 0;
  }

  .sw-notif-popup__settings {
    display: none;
  }

  .sw-notif-popup__mark-read {
    display: inline-block;
  }

  /* On mobile the notification text is slightly larger per figma 949:1797 */
  .sw-notif-popup__text {
    font-size: 14px;
    line-height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-notif-popup__panel {
    transition: none;
  }
}
/* =========================
  Notification Popup — Shared End
========================= */
