    *{ box-sizing:border-box; -webkit-tap-highlight-color: transparent; }

/* Step bar: step indicator + theme toggle in same row */
.stepBar{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 10px 16px;
  background: rgba(0,0,0,.12);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
}
.stepBar .stepIndicator{
  flex: 1;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  min-width: 0;
}
.stepBarTrailing{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Step-aware BACK control (yellow primary, same family as .btn) */
.hubBackLink{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--btnText, #1a1400);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.1;
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  box-shadow:
    0 10px 18px rgba(0,0,0,.25),
    inset 0 2px 0 rgba(255,255,255,.35);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.hubBackLink:hover{
  filter: brightness(1.05);
}
.hubBackLink:active{
  transform: translateY(1px) scale(.99);
  box-shadow:
    0 8px 14px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.25);
}
.hubBackLink:focus-visible{
  outline: 2px solid rgba(109,224,255,.95);
  outline-offset: 2px;
}
.settingsTopBtn{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.2);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s ease, border-color .15s ease;
}
.settingsTopBtn:hover{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.35);
}
.settingsTopBtn:focus-visible{
  outline: 2px solid rgba(109,224,255,.9);
  outline-offset: 2px;
}

/* Theme toggle — glyphs live inside the sliding knob (optically centered) */
.themeToggleWrap{
  position: relative;
  width: 68px;
  height: 34px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
  transition: border-color .2s;
}
.themeToggleWrap:hover{
  border-color: rgba(255,255,255,.35);
}
.themeToggleWrap .themeToggleKnob{
  position: absolute;
  left: 4px;
  top: 50%;
  margin-top: -13px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .25s ease;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 2;
}
.themeToggleWrap .themeToggleGlyph{
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  user-select: none;
  transform: translateY(-0.5px);
}
.themeToggleWrap .themeToggleGlyphMoon{
  display: none;
}
.themeToggleWrap.dark .themeToggleGlyphSun{
  display: none;
}
.themeToggleWrap.dark .themeToggleGlyphMoon{
  display: flex;
}
.themeToggleWrap.dark .themeToggleKnob{
  transform: translateX(34px);
  background: linear-gradient(180deg, rgba(0,255,213,.9), rgba(0,255,213,.7));
  box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.4);
}
    :root{
      --bg1:#6de0ff; --bg2:#4c6fff;
      --panel: rgba(0,0,0,.18);
      --panel2: rgba(0,0,0,.22);
      --stroke: rgba(255,255,255,.16);
      --shadow: 0 14px 34px rgba(0,0,0,.35);

      --btnYellow:#ffdd55;
      --btnYellow2:#ffd22e;
      --btnText:#222;

      --muted: rgba(255,255,255,.85);
      --loBlueLine: rgba(109,224,255,0.70);

      /* ✅ Watermark scale (JS updates this) */
      --wmScale: 1;
    }

    html,body{ height:100%; margin:0; font-size: 20px; }
body{
  font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  background: radial-gradient(circle at top, var(--bg1), var(--bg2));
  color:#fff;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding: 12px 0 16px;
  overscroll-behavior:none;
}


    .container{
      max-width:1100px;
      margin:0 auto;
      padding:20px;
      width:100%;
      box-sizing:border-box;
    }
    .wrap.container{ width:100%; }

    .heroHeader{
      display:flex;
      align-items:center;
      justify-content:center;
      gap:6px;
      width:100%;
      margin:0 0 0;
      height:130px;
    }

    .heroTagline{
      margin: -8px auto 12px;
      padding: 0 12px;
      max-width: 720px;
      text-align: center;
      font-family: "Baloo 2", system-ui, sans-serif;
      font-size: clamp(18px, 2.8vw, 26px);
      font-weight: 800;
      letter-spacing: 0.04em;
      line-height: 1.2;
      color: #fff;
      text-shadow:
        0 0 20px rgba(109, 224, 255, 0.55),
        0 2px 12px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(76, 111, 255, 0.35);
    }
    body.dark .heroTagline{
      color: rgba(255, 255, 255, 0.96);
      text-shadow:
        0 0 18px rgba(0, 255, 213, 0.45),
        0 2px 14px rgba(0, 0, 0, 0.55),
        0 0 36px rgba(0, 255, 213, 0.25);
    }
    .heroHeader .headerImg{
      height:100%;
      width:auto;
      max-width:55%;
      display:block;
      border-radius:14px;
      filter:drop-shadow(0 12px 24px rgba(0,0,0,.3));
      object-fit:contain;
    }
    .heroHeader .headerLogo,
    .heroHeader .headerLeft{
      height:100%;
      width:auto;
      min-width:50px;
      display:block;
      object-fit:contain;
      border-radius:14px;
      flex-shrink:0;
    }
    @media (max-width: 520px){
      .heroHeader{ height:100px; gap:6px; }
    }

    .panel{
      width:100%;
      max-width:100%;
      background: linear-gradient(180deg, var(--panel2), var(--panel));
      border: 1px solid var(--stroke);
      box-shadow: var(--shadow);
      border-radius: 16px;
      padding: 16px;
      margin: 8px 0;
      backdrop-filter: blur(8px);
      overflow: hidden;
      box-sizing: border-box;
    }

    .lbl{
      display:block;
      font-weight: 850;
      font-size: 20px;
      letter-spacing:.3px;
      text-transform: uppercase;
      color: var(--muted);
      margin: 2px 0 6px;
    }

    .row{ margin-bottom: 8px; }
    .topSection{
      display:flex;
      flex-direction:column;
      gap: 20px;
      margin-bottom: 8px;
      min-width: 0;
      max-width: 100%;
    }
    .walletInputRow{
      display:flex;
      flex-direction:column;
      gap:10px;
      min-width:0;
      max-width:100%;
    }
    .walletInputRow .input{ width:100%; max-width:100%; box-sizing:border-box; min-width:0; }
    .chainRow{ margin-top:10px; min-width:0; max-width:100%; }
    .chainRow .input{ max-width:100%; box-sizing:border-box; }
    .row.two{
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    @media (max-width: 520px){
      .row.two{ grid-template-columns: 1fr; }
    }

    .input{
      width:100%;
      border-radius: 14px;
      padding: 12px 12px;
      border: 1px solid rgba(255,255,255,.18);
      background: rgba(76,111,255,.20);
      color:#fff;
      outline:none;
      font-size: 20px;
    }
    .input::placeholder{ color: rgba(255,255,255,.70); }

    /* ✅ iPhone zoom fix: any input/select under 16px causes Safari zoom on focus */
    @media (max-width: 900px){
      .input{ font-size: 20px; }
    }

    select.input{
      appearance:none;
      background-color: rgba(76,111,255,.20);
      background-image:
        linear-gradient(45deg, transparent 50%, rgba(255,255,255,.85) 50%),
        linear-gradient(135deg, rgba(255,255,255,.85) 50%, transparent 50%);
      background-position:
        calc(100% - 18px) calc(1em + 2px),
        calc(100% - 13px) calc(1em + 2px);
      background-size: 5px 5px, 5px 5px;
      background-repeat:no-repeat;
      padding-right: 32px;
    }
    select.input option{
      background: #4c6fff;
      color: #fff;
    }

    .btn{
      border:0;
      border-radius: 15px;
      padding: 14px 18px;
      font-size: 20px;
      font-weight: 950;
      letter-spacing: .2px;
      background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
      color: var(--btnText);
      cursor:pointer;
      box-shadow: 0 10px 18px rgba(0,0,0,.25);
      transition: transform .06s ease, opacity .15s ease;
      user-select:none;
      white-space: nowrap;
    }
    .btn:active{ transform: translateY(1px) scale(.99); }
    .btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

    .actions{
      display:flex;
      gap:12px;
      flex-wrap: wrap;
      align-items:center;
      justify-content:space-evenly;
    }
    .actionRow{
      display:flex;
      justify-content:center;
      flex-wrap: wrap;
      gap:12px;
      margin:16px 0 8px;
      min-width:0;
      max-width:100%;
    }
    .actionRow .btn{
      flex:1;
      min-width:120px;
      max-width:100%;
      padding:14px 16px;
      font-size:19px;
      box-sizing:border-box;
    }
    .collectionsCard{
      padding:16px;
      border-radius:16px;
      background: radial-gradient(circle at 50% 0%, rgba(109, 224, 255, 0.16), rgba(76, 111, 255, 0.14));
      border:1px solid rgba(109, 224, 255, 0.28);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      margin-top:8px;
    }
    .collectionsCard .collectionsTop{ margin-bottom:8px; }
    .collectionsCardGrid{
      display:flex;
      flex-direction:column;
      gap:12px;
    }
    .collectionsRow{
      display:flex;
      align-items:flex-start;
      gap:10px;
      flex-wrap:wrap;
    }
    .collectionsRow .searchWrap,
    .collectionsRow .addContractInputWrap{ flex:1; min-width:180px; }
    .collectionsRowBtns{
      display:flex;
      gap:10px;
      flex-shrink:0;
      align-items:center;
    }
    .collectionsRow #selectAllBtn,
    .collectionsRow #selectNoneBtn,
    .collectionsRow #addContractBtn{ min-width:130px; }
    /* Narrow screens: tightened in global iPhone block below (avoid tall single column) */

    .status{
      margin-top: 10px;
      color: rgba(255,255,255,.95);
      font-size: 20px;
      white-space: pre-wrap;
    }
    #imageProgressBarWrap{
      width:100%;
      height:10px;
      background:rgba(255,255,255,0.15);
      border-radius:999px;
      overflow:hidden;
      margin-top:6px;
    }
    #imageProgressBar{
      height:100%;
      width:0%;
      background:linear-gradient(90deg,#ff4d4d,#ffd84d,#4caf50);
      border-radius:999px;
      transition:width 0.3s ease;
    }

    /* Multi-wallet UI */
    .walletTools{
      display:flex;
      gap:10px;
      flex-wrap: wrap;
      align-items:center;
      margin-top: 8px;
    }
    .walletList{
      margin-top: 10px;
      background: rgba(76,111,255,.14);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 14px;
      padding: 10px;
    }
    .walletChip{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding: 10px 10px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
      margin-bottom: 8px;
    }
    .walletChip:last-child{ margin-bottom:0; }
.walletAddr{
  font-weight: 900;
  font-size: 20px;
      overflow:hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
    }
.walletMeta{
  font-size: 18px;
  opacity: .9;
}
    .chipBtns{ display:flex; gap:8px; flex:0 0 auto; }
    .btnSmall{
      border:0;
      border-radius: 13px;
      padding: 9px 12px;
      font-size: 18px;
      font-weight: 950;
      background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
      color: var(--btnText);
      cursor:pointer;
      box-shadow: 0 10px 18px rgba(0,0,0,.18);
      white-space: nowrap;
    }

    /* Collections */
    .collectionsTop{
      display:flex;
      gap:10px;
      align-items:end;
      flex-wrap: wrap;
    }
    .collectionsTop .searchWrap{
      flex: 1 1 320px;
      min-width: 220px;
    }
    .collectionsTop .miniBtns{
      display:flex;
      gap:10px;
      flex: 0 0 auto;
    }

    .collectionList{
      margin-top: 10px;
      background: rgba(76,111,255,.14);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 14px;
      padding: 10px;
      max-height: 280px;
      overflow:auto;
    }
    .collectionItem{
      display:flex;
      align-items:center;
      gap:10px;
      padding: 10px 10px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
      margin-bottom: 8px;
    }
    .collectionItem:last-child{ margin-bottom: 0; }
    .collectionName{ font-weight: 900; line-height: 1.15; }
    .hint{ font-size: 18px; opacity:.9; margin-top: 6px; }

    /* Stage */
    .stageWrap{ margin-top: 8px; }
    .gridStageCollapsibles{
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 12px;
    }
    .gridStageCollapsibles .stageLayoutSection{
      margin: 0;
    }
    .stage{
      position:relative;
      background: rgba(0,0,0,.18);
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 18px;
      box-shadow: var(--shadow);
      overflow:hidden;
    }
    .stageMetaRow{
      padding: 8px 12px 10px;
      border-bottom: 1px solid rgba(255,255,255,.12);
      background: rgba(0,0,0,.08);
    }
    .stageMeta{ font-size: 19px; opacity:.95; text-align:center; width:100%; }

    /* Grid status bar - below grid, shows image loading + retry */
    .stageFooter.gridStatusBar{
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-top: 1px solid rgba(255,255,255,.14);
      background: rgba(0,0,0,.1);
      flex-wrap: wrap;
    }
    .gridStatusContent{
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
    }
    .gridStatusHint{
      font-size: 21px;
      font-weight: 700;
      color: rgba(255,255,255,.9);
      font-style: italic;
      opacity: 0.95;
    }
    .gridStatusText{
      font-size: 18px;
      font-weight: 800;
      color: rgba(255,255,255,.95);
    }
    .gridStatusProgressWrap{
      height: 6px;
      background: rgba(0,0,0,.2);
      border-radius: 4px;
      overflow: hidden;
    }
    .gridStatusProgress{
      height: 100%;
      background: linear-gradient(90deg, var(--btnYellow), var(--btnYellow2));
      border-radius: 4px;
      transition: width 0.2s ease;
    }
    .gridStatusRetryArea{
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .gridStatusRetryHint{
      font-size: 17px;
      font-weight: 700;
      color: rgba(255,255,255,.85);
    }
    .gridExportBar{
      display: flex;
      justify-content: stretch;
      padding: 14px 16px;
      border-top: 1px solid rgba(255,255,255,.14);
      background: rgba(0,0,0,.1);
    }
    .gridExportBar .btn{
      width: 100%;
      font-size: 19px;
      font-weight: 800;
    }
    .stageFooterBtn{
      flex: 1;
      min-width: 140px;
      padding: 12px 20px;
      font-size: 19px;
      font-weight: 800;
    }

    /* Grid */
    .gridWrap{
      position: relative;
      max-width: min(920px, 100%);
      margin-left: auto;
      margin-right: auto;
      --flexGridGap: 0px;
    }
    .grid{
      display:grid;
      gap: var(--flexGridGap, 0px) !important;
      background: rgba(0,0,0,.08);
    }
    .grid[data-layout-mode="template"]{
      gap: var(--flexGridGap, 0px) !important;
    }
    .grid[data-layout-mode="template"] .tile{
      aspect-ratio: 1 / 1;
      min-height: 0;
      min-width: 0;
    }
    .gridStack .tile{
      touch-action: none;
    }
    .tile{
      position:relative;
      width:100%;
      aspect-ratio: 1/1;
      overflow:hidden;
      border-radius: 0 !important;
      background: rgba(0,0,0,.10);
    }
    .tile img{
      width:102%;
      height:102%;
      max-width: none;
      object-fit: cover;
      object-position: center;
      display:block;
      margin:-1%;
      border-radius: 0 !important;
      user-select:none;
      -webkit-user-drag:none;
    }
    .fillerText{
      width:100%; height:100%;
      display:flex;
      justify-content:center;
      align-items:center;
      font-weight: 950;
      letter-spacing:.2px;
      color: rgba(255,255,255,0.92);
      background: rgba(0,0,0,0.22);
      font-size: 25px;
    }

    /* ✅ Watermark — absolutely in .gridStack; JS sets px box (contain + 1px bleed) aligned to first tile */
.watermarkGrid{
  position:absolute;
  left:0;
  top:0;
  z-index:9999;
  pointer-events:none;
  display:block;
  width: 80px;
  height: auto;
  max-width:none;
  max-height:none;
  box-sizing:border-box;
  image-rendering: auto;
  opacity: 1;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  object-fit: contain;
  object-position: left top;
}

.stage.settings-canvas--light .watermarkGrid,
.stage.settings-canvas--dark .watermarkGrid{
  background: transparent;
  box-shadow: none;
  filter: none;
}


    /* Pointer drag reorder */
    body.gridPointerDragActive{
      cursor: grabbing !important;
      user-select: none;
      -webkit-user-select: none;
    }
    .tile.tile--dragSource{
      opacity: 0.35;
      transform: scale(0.98);
      transition: opacity 0.12s ease, transform 0.12s ease;
    }
    .tile.tile--dragGhost{
      box-shadow: 0 12px 28px rgba(0,0,0,.45);
      border-radius: 4px;
      transform: scale(1.06);
      outline: 2px solid rgba(255,221,85,0.9);
      outline-offset: 2px;
    }
    .tile.tile--dropTarget{
      outline: 3px solid rgba(109, 224, 255, 0.95);
      outline-offset: -3px;
      z-index: 2;
    }
    body.dark .tile.tile--dropTarget{
      outline-color: rgba(0, 255, 213, 0.95);
    }
    .tile:not(.tile--dragSource):hover{
      transform:scale(1.02);
      transition:transform 0.15s ease;
    }
    body.gridPointerDragActive .gridStack .tile:not(.tile--dragGhost):hover{
      transform: none;
    }
    .tile[data-kind="empty"]{
      background:#ffffff !important;
      background-image:none !important;
      border:2px dashed rgba(0,0,0,0.1);
    }
/* ===== BUTTONS UPGRADE (OVERRIDE) ===== */
.btn, .btnSmall{
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  box-shadow:
    0 10px 18px rgba(0,0,0,.25),
    inset 0 2px 0 rgba(255,255,255,.35);
  transform: translateY(0);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}

.btn:hover, .btnSmall:hover{
  filter: brightness(1.05);
}

.btn:active, .btnSmall:active{
  transform: translateY(1px) scale(.99);
  box-shadow:
    0 8px 14px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.25);
}

.btn:disabled{
  opacity: .55;
  cursor:not-allowed;
  box-shadow: none;
  border-color: rgba(255,255,255,.18);
}

/* Action rows: default flex wrap; phone-specific layouts use grids in iPhone block */
/* =========================================
   Collections: compact scroll + nicer rows
   (CSS-only, does NOT affect JS buttons)
   ========================================= */

/* Make the collections panel more compact overall */
#controlsPanel.panel{
  padding: 12px;
}

/* Keep the top row (search + buttons) tidy */
.collectionsTop{
  align-items: center;
  gap: 10px;
}

/* Collections scroll: 2 columns + tall viewport for 4–6 rows */
.collectionList.collections-container{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 60vh;
  min-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  border-radius: 14px;
  background: radial-gradient(circle at top, rgba(109, 224, 255, 0.2), rgba(76, 111, 255, 0.18));
  border: 1px solid rgba(109, 224, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-overflow-scrolling: touch;
}
body.dark .collectionList.collections-container{
  background: radial-gradient(circle at top, rgba(0, 255, 213, 0.12), rgba(76, 111, 255, 0.16));
  border-color: rgba(0, 255, 213, 0.28);
}
/* Phones / narrow viewports: one collection per row (desktop ≥860px uses full-width span instead) */
@media (max-width: 859px){
  .collectionList.collections-container{
    grid-template-columns: 1fr;
  }
}
.collectionList.collections-container .collectionItem{
  margin-bottom: 0;
}

/* Wins over `.container .collectionItem` (horizontal chip layout) */
#collectionsList > .collectionItem{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

/* Row styling — card stacks one body row (logo + main column) */
.collectionItem{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 12px 10px;
  gap: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(109, 224, 255, 0.22);
}
body.dark .collectionItem{
  border-color: rgba(0, 255, 213, 0.22);
  background: rgba(0, 0, 0, 0.14);
}

/* Main row (logo + text/actions) fills card */
.collectionItem > .collectionItemBody{
  flex: 1;
  min-width: 0;
}

/* Name on left */
.collectionName{
  font-weight: 950;
  font-size: 21px;
  line-height: 1.15;
}

/* ✅ Count badge — stands out on the right */
.collectionCount{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 950;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 2px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.5);
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.3px;
  opacity: 1;
}
body.dark .collectionCount{
  background: linear-gradient(180deg, rgba(0,255,213,.35), rgba(0,255,213,.25));
  color: rgba(255,255,255,.98);
  border-color: rgba(0,255,213,.5);
  box-shadow: 0 2px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(0,255,213,.3);
}

/* Collection item: whole box clickable, no checkbox */
.collectionItem{
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.collectionItem.selected{
  box-shadow: 0 0 0 2px rgba(109, 224, 255, 0.9), 0 0 24px rgba(109, 224, 255, 0.5);
  border-color: rgba(109, 224, 255, 0.6);
  background: rgba(109, 224, 255, 0.12);
}
body.dark .collectionItem.selected{
  box-shadow: 0 0 0 2px rgba(0, 255, 213, 0.95), 0 0 24px rgba(0, 255, 213, 0.55);
  border-color: rgba(0, 255, 213, 0.5);
  background: rgba(0, 255, 213, 0.1);
}
/* Manual NFT picks: green glow so “I chose these” reads vs Select-all (blue) */
.collectionItem.selected.collectionItem--manualPicks{
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.95), 0 0 26px rgba(46, 204, 113, 0.55);
  border-color: rgba(46, 204, 113, 0.65);
  background: rgba(46, 204, 113, 0.14);
}
body.dark .collectionItem.selected.collectionItem--manualPicks{
  box-shadow: 0 0 0 2px rgba(80, 220, 140, 0.95), 0 0 28px rgba(46, 200, 120, 0.45);
  border-color: rgba(80, 220, 140, 0.6);
  background: rgba(46, 200, 120, 0.12);
}

/* Trait Order collapsible section */
.traitOrderSection .traitOrderSectionHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,.12);
  border-radius: 10px;
  margin-bottom: 0;
  border: 1px solid rgba(255,255,255,.1);
}
.traitOrderHeaderText{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.traitOrderHeaderTitle{
  line-height: 1.15;
}
.traitOrderHeaderHint{
  display: block;
  font-size: 14px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
  max-width: 42rem;
}
body.dark .traitOrderHeaderHint{
  color: rgba(0, 255, 213, 0.85);
}
.traitOrderSection .traitOrderSectionHeader:hover{
  background: rgba(0,0,0,.16);
}
.traitOrderContent{
  max-height: 2000px;
  overflow: hidden;
  padding: 14px 0 0;
  transition: max-height 0.35s ease, padding 0.25s ease, visibility 0.2s ease, opacity 0.2s ease;
}
.traitOrderSection.collapsed .traitOrderContent{
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Layout (collections step) + stage layout — same collapsible pattern as trait order */
.layoutSection .layoutSectionHeader,
.stageLayoutSection .stageLayoutSectionHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,.12);
  border-radius: 10px;
  margin-bottom: 0;
  border: 1px solid rgba(255,255,255,.1);
}
.layoutSectionHeaderText,
.stageLayoutSectionHeaderText{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.layoutSectionHeaderTitle,
.stageLayoutSectionHeaderTitle{
  line-height: 1.15;
}
.layoutSectionHeaderHint,
.stageLayoutSectionHeaderHint{
  display: block;
  font-size: 14px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
  max-width: 42rem;
}
body.dark .layoutSectionHeaderHint,
body.dark .stageLayoutSectionHeaderHint{
  color: rgba(0, 255, 213, 0.85);
}
.layoutSection .layoutSectionHeader:hover,
.stageLayoutSection .stageLayoutSectionHeader:hover{
  background: rgba(0,0,0,.16);
}
.layoutSection{
  margin-top: 12px;
}
.stageLayoutSection{
  margin: 10px 0 8px;
}
.layoutSectionContent,
.stageLayoutSectionContent{
  max-height: 2000px;
  overflow: hidden;
  padding: 14px 0 0;
  transition: max-height 0.35s ease, padding 0.25s ease, visibility 0.2s ease, opacity 0.2s ease;
}
.layoutSection.collapsed .layoutSectionContent,
.stageLayoutSection.collapsed .stageLayoutSectionContent{
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.layoutSection .layoutPickerWrap{
  margin-top: 0;
}

/* Build Grid button - full width under collections */
    .layoutPickerWrap{
      margin-top: 14px;
      margin-bottom: 10px;
    }
    .layoutPickerWrap .lbl{
      display: block;
      margin-bottom: 8px;
      font-weight: 800;
    }
    .layoutPickerBtns{
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .layoutPickerBtn{
      flex: 1;
      min-width: 120px;
      max-width: 100%;
      opacity: 0.92;
    }
    .layoutPickerBtn--active{
      outline: 3px solid rgba(109, 224, 255, 0.85);
      outline-offset: 2px;
      opacity: 1;
      filter: brightness(1.06);
    }
    body.dark .layoutPickerBtn--active{
      outline-color: rgba(0, 255, 213, 0.85);
    }
    .layoutPickerBtn:disabled,
    .layoutPickerBtn.layoutPickerBtn--soon:disabled{
      opacity: 0.5;
      cursor: not-allowed;
      filter: grayscale(0.35);
      pointer-events: none;
    }
    .layoutPickerBtn.layoutPickerBtn--soon{
      font-weight: 750;
      font-size: 16px;
    }
    .srOnly{
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .customImagesSection{
      margin-top: 16px;
      margin-bottom: 10px;
      padding-top: 14px;
      border-top: 1px solid rgba(255,255,255,.14);
    }
    .customImagesToolbar{
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }
    .customImagesList{
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
      min-height: 0;
      padding: 10px;
      border-radius: 14px;
      background: rgba(255, 180, 60, 0.08);
      border: 1px dashed rgba(255, 200, 100, 0.35);
    }
    body.dark .customImagesList{
      background: rgba(0, 255, 213, 0.06);
      border-color: rgba(0, 255, 213, 0.22);
    }
    .customImageCard.customImageCard--import{
      position: relative;
      width: 108px;
      flex-shrink: 0;
      border-radius: 12px;
      overflow: visible;
      cursor: pointer;
      border: 2px solid rgba(255,255,255,.22);
      background: rgba(0,0,0,.2);
      box-shadow: 0 4px 14px rgba(0,0,0,.2);
      transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    }
    .customImageCard--import:focus-visible{
      outline: 3px solid rgba(109, 224, 255, 0.9);
      outline-offset: 3px;
    }
    .customImageCard--import:hover{
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(0,0,0,.28);
    }
    .customImageCardThumb{
      position: relative;
      aspect-ratio: 1 / 1;
      width: 100%;
      border-radius: 10px;
      overflow: hidden;
      background: rgba(0,0,0,.25);
    }
    .customImageCardBadgeLogo{
      position: absolute;
      left: 4px;
      bottom: 4px;
      z-index: 2;
      font-size: 9px;
      font-weight: 900;
      padding: 2px 6px;
      border-radius: 4px;
      background: rgba(0, 0, 0, 0.72);
      color: rgba(255, 255, 255, 0.95);
      letter-spacing: 0.06em;
      text-transform: uppercase;
      pointer-events: none;
      line-height: 1.2;
    }
    .customImageCardThumb img{
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .customImageCardRemove{
      position: absolute;
      top: -6px;
      right: -6px;
      z-index: 3;
      width: 28px;
      height: 28px;
      padding: 0;
      border-radius: 999px;
      border: 2px solid rgba(255,255,255,.85);
      background: linear-gradient(180deg, #ff5a5a, #d32f2f);
      color: #fff;
      font-size: 18px;
      font-weight: 900;
      line-height: 1;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,.35);
    }
    .customImageCardRemove:hover{
      filter: brightness(1.08);
    }
    .customImageCardHint{
      font-size: 12px;
      font-weight: 800;
      text-align: center;
      padding: 6px 4px 2px;
      color: rgba(255,255,255,.88);
      letter-spacing: 0.02em;
    }
    .customImageCard--selected{
      border-color: rgba(109, 224, 255, 0.95);
      box-shadow: 0 0 0 2px rgba(109, 224, 255, 0.35), 0 8px 22px rgba(0,0,0,.25);
    }
    body.dark .customImageCard--selected{
      border-color: rgba(0, 255, 213, 0.9);
      box-shadow: 0 0 0 2px rgba(0, 255, 213, 0.3), 0 8px 22px rgba(0,0,0,.35);
    }
    .stageLayoutBar{
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      margin: 0 0 8px;
      padding: 10px 12px;
      background: rgba(0,0,0,.06);
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.1);
    }
    .stageLayoutBarLabel{
      margin: 0;
      font-weight: 800;
      flex-shrink: 0;
    }
    .stageLayoutPickerBtns{
      flex: 1;
      min-width: 0;
    }
    .gridStack{
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 0;
      width: 100%;
      max-width: min(920px, 100%);
      margin-left: auto;
      margin-right: auto;
    }
    .buildGridRow{
  margin-top: 16px;
  width: 100%;
}
.buildGridRow .btn{
  width: 100%;
  box-sizing: border-box;
}

@keyframes gridBuildMegaGlow{
  0%, 100%{
    box-shadow:
      0 0 0 2px rgba(255, 221, 85, 0.55),
      0 0 22px rgba(255, 213, 79, 0.45),
      0 0 48px rgba(255, 193, 7, 0.35),
      0 10px 22px rgba(0, 0, 0, 0.28);
  }
  50%{
    box-shadow:
      0 0 0 3px rgba(255, 235, 150, 0.85),
      0 0 32px rgba(255, 221, 85, 0.65),
      0 0 64px rgba(255, 193, 7, 0.48),
      0 12px 26px rgba(0, 0, 0, 0.32);
  }
}

/* Retry row - on grid step */
.buildExportRow{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 16px;
  background: rgba(0,0,0,.08);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  width: 100%;
  box-sizing: border-box;
}
.buildExportRow .btn{
  flex: 1;
  min-width: 0;
}

/* Step indicator */
.stepIndicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 10px 16px;
  background: rgba(0,0,0,.12);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
}
.stepItem {
  font-size: 17px;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  padding: 6px 14px;
  border-radius: 10px;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stepItem.active {
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 2px 8px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.5);
}
.stepItem.completed {
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 2px 6px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.4);
}
.stepConnector {
  color: rgba(255,255,255,.35);
  font-size: 15px;
}
@media (max-width: 520px) {
  .stepBar { gap: 6px; padding: 8px; }
  .stepIndicator { gap: 4px; }
  .stepItem { font-size: 15px; }
  .stepConnector { display: none; }
  .hubBackLink { font-size: 14px; padding: 7px 10px; }
}

/* Step navigation */
.stepNav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 0 4px;
}
.stepNav .btn:only-child {
  margin-left: auto;
}
@media (max-width: 520px) {
  .stepNav {
    flex-wrap: wrap;
  }
  .stepNav .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}

/* Global status bar - visible on all steps */
#globalStatusBar {
  min-height: 40px;
}
@media (max-width: 520px) {
  #globalStatusBar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

/* Wallet step: title → textarea → chain → load (full width stack; no chip list) */
.walletFlowStack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.walletFlowTitle {
  margin: 0;
  padding: 0;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
body.dark .walletFlowTitle {
  color: rgba(255, 255, 255, 0.98);
}

.walletFlowStack .input.wallet-flow-field {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 213, 79, 0.85);
  background-color: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
body.dark .walletFlowStack .input.wallet-flow-field {
  background-color: rgba(0, 0, 0, 0.48);
  border-color: rgba(255, 235, 59, 0.88);
}

/* Keep custom select chevron from `select.input` but surface matches wallet box */
.walletFlowStack select.input.wallet-flow-field {
  background-color: rgba(0, 0, 0, 0.28);
}
body.dark .walletFlowStack select.input.wallet-flow-field {
  background-color: rgba(0, 0, 0, 0.48);
}

.walletFlowChainLbl {
  margin: 6px 0 0;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
body.dark .walletFlowChainLbl {
  color: rgba(255, 255, 255, 0.98);
}

.walletFlowLoadBtn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 16px;
}

/* Wallet validation hint */
.walletValidationHint {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 1.25em;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  align-self: stretch;
}
.walletInputRow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.walletInputRow .input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.wallet-textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.45;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Monaco, monospace;
  font-size: 15px;
  padding: 12px 14px;
  color: rgba(245, 248, 252, 0.96);
}
@media (max-width: 900px) {
  .walletFlowStack .wallet-textarea {
    font-size: 16px;
  }
}
.wallet-textarea::placeholder {
  color: rgba(160, 170, 185, 0.88);
  font-size: 14px;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .walletFlowStack .wallet-textarea::placeholder {
    font-size: 15px;
  }
}

/* Soft pulse on chain dropdown */
@keyframes chainSelectSoftPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.35),
      0 0 12px rgba(109, 224, 255, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.5),
      0 0 18px rgba(109, 224, 255, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

select#chainSelect.chainSelectGlow,
#chainSelect.chainSelectGlow {
  position: relative;
  border-radius: 10px;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Baloo 2", ui-sans-serif, system-ui, sans-serif;
  animation: chainSelectSoftPulse 2.4s ease-in-out infinite;
}
@media (max-width: 900px) {
  .walletFlowStack select#chainSelect.chainSelectGlow {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  select#chainSelect.chainSelectGlow,
  #chainSelect.chainSelectGlow {
    animation: none;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.42),
      0 0 14px rgba(109, 224, 255, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

/* Onboarding ring — light neutral */
.walletFlowStack #walletInput.guideGlow {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 16px rgba(109, 224, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.walletFlowStack #walletInput.guideGlow::after {
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.75);
}
body.dark .walletFlowStack #walletInput.guideGlow {
  box-shadow:
    0 0 0 2px rgba(0, 255, 213, 0.55),
    0 0 18px rgba(0, 255, 213, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Touch-friendly minimum tap targets (44px) */
@media (pointer: coarse) {
  .btn, .btnSmall {
    min-height: 44px;
    min-width: 44px;
  }
  .stepItem {
    min-height: 36px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
  }
}

/* Build Grid glow + pulse when trait changed (needs rebuild) */
@keyframes buildGridGlowPulse {
  0%, 100% {
    box-shadow: 0 10px 18px rgba(0,0,0,.25), 0 0 20px rgba(255,221,85,.6);
    filter: brightness(1.1);
  }
  50% {
    box-shadow: 0 10px 18px rgba(0,0,0,.25), 0 0 32px rgba(255,221,85,.9);
    filter: brightness(1.2);
  }
}
.btn.buildGridGlow{
  animation: buildGridGlowPulse 1.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .btn.buildGridGlow{
    animation: none;
    box-shadow: 0 10px 18px rgba(0,0,0,.25), 0 0 24px rgba(255,221,85,.7);
  }
}

.collectionTraitControls{
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(0,0,0,.08);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
}
/* Per-collection trait controls — flex on wide screens; 2-column grid on phones (see iPhone block) */
.trait-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.collection-trait-control{
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.collection-trait-control--dragging{
  opacity: 0.72;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.collection-trait-control--dropTarget{
  box-shadow:
    0 0 0 2px rgba(109, 224, 255, 0.95),
    0 6px 20px rgba(109, 224, 255, 0.35);
}
body.dark .collection-trait-control--dropTarget{
  box-shadow:
    0 0 0 2px rgba(0, 255, 213, 0.9),
    0 6px 20px rgba(0, 255, 213, 0.28);
}
.collection-trait-dragRow{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: grab;
  touch-action: none;
}
.collection-trait-dragRow:active{
  cursor: grabbing;
}
.collection-trait-dragHandle{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--btnText);
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.1);
  line-height: 1;
  user-select: none;
}
.collection-trait-control .collection-name{
  font-weight: 900;
  font-size: 19px;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  opacity: 1;
  color: var(--btnText);
}
/* Trait select: same height as main .btn, text fits comfortably */
.collection-trait-control .trait-type{
  width: 100%;
  min-width: 140px;
  max-width: 220px;
  min-height: 46px;
  margin-top: 4px;
  background: rgba(255,255,255,0.95);
  color: var(--btnText);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
}
.collection-trait-control .trait-type:focus{
  outline: 2px solid var(--btnYellow2);
}
/* Collapsible sections - clean bar, yellow arrow, fully hide content when collapsed */
.walletSectionHeader,
.collectionsSectionHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  font-weight: 800;
  font-size: 21px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,.12);
  border-radius: 10px;
  margin-bottom: 0;
  border: 1px solid rgba(255,255,255,.1);
}
.walletSectionHeader:hover,
.collectionsSectionHeader:hover{
  background: rgba(0,0,0,.16);
}
.collapseIcon{
  font-size: 25px;
  color: var(--btnYellow);
  transition: transform 0.25s ease;
}
.walletSection:not(.collapsed) .walletSectionHeader .collapseIcon,
.collectionsSection:not(.collapsed) .collectionsSectionHeader .collapseIcon,
.traitOrderSection:not(.collapsed) .traitOrderSectionHeader .collapseIcon,
.layoutSection:not(.collapsed) .layoutSectionHeader .collapseIcon,
.stageLayoutSection:not(.collapsed) .stageLayoutSectionHeader .collapseIcon{
  transform: rotate(90deg);
}
.walletSection .walletSectionContent{
  max-height: 2000px;
  overflow: hidden;
  padding: 14px 12px 14px;
  min-width: 0;
  transition: max-height 0.35s ease, padding 0.25s ease, visibility 0.2s ease, opacity 0.2s ease;
}
.walletSection.collapsed .walletSectionContent{
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.collectionsSection .collectionsCard{
  max-height: 2000px;
  transition: max-height 0.35s ease, padding 0.25s ease, visibility 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
  padding-top: 12px;
}
.collectionsSection.collapsed .collectionsCard{
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   Make the lower page keep the “blue vibe”
   ========================================= */

/* Stage background to match body blue gradient more */
.stage{
  background: radial-gradient(circle at top, rgba(109,224,255,.25), rgba(76,111,255,.28)) !important;
  border-color: rgba(255,255,255,.18);
}

/* Grid area slightly bluer (instead of grey/black) */
.grid{
  background: rgba(76,111,255,.10);
}

/* Top-of-stage: red→green bar while grid images load (no spinning LO) */
.grid-stage-image-loading{
  flex-shrink: 0;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(109, 224, 255, 0.18);
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}
.grid-stage-image-loading.grid-stage-image-loading--empty{
  display: none;
}
.grid-stage-image-loading-inner{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.grid-stage-image-loading-barTrack{
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
.grid-stage-image-loading-barFill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff3b30 0%, #ff9800 35%, #ffeb3b 58%, #8bc34a 82%, #43a047 100%);
  box-shadow: 0 0 12px rgba(67, 160, 71, 0.35);
  transition: width 0.2s ease;
}
.grid-stage-image-loading-hint{
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
}
.grid-stage-image-loading.grid-stage-image-loading--done .grid-stage-image-loading-barFill{
  width: 100% !important;
}

/* Tiles slightly clearer against blue */
.tile{
  background: rgba(0,0,0,.12);
}
/* ==========================
   LO FUN HEADINGS
   ========================== */

h1, h2{
  letter-spacing: .5px;
  text-shadow:
    0 2px 0 rgba(0,0,0,.35),
    0 4px 10px rgba(0,0,0,.35);
}

/* Main page title pop */
h1{
  font-size: 30px;
}

/* Sub headings */
h2{
  font-size: 24px;
}

/* FORCE Baloo everywhere (wins over earlier rules) */
html, body, button, input, select, textarea {
  font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
}
/* ==========================
   LO ARCADE MOTION (CSS ONLY)
   Safe: no functionality changes
   ========================== */

/* 1) Background shimmer */
body::before{
  content:"";
  position: fixed;
  inset: -40%;
  pointer-events:none;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.14), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.10), transparent 45%),
    linear-gradient(120deg, transparent 0%, rgba(255,255,255,.07) 25%, transparent 50%);
  filter: blur(20px);
  opacity: .35;
  transform: translate3d(0,0,0);
  animation: loShimmer 10s ease-in-out infinite;
}

@keyframes loShimmer{
  0%   { transform: translate(-6%, -4%) rotate(0deg); }
  50%  { transform: translate(6%, 4%) rotate(8deg); }
  100% { transform: translate(-6%, -4%) rotate(0deg); }
}

/* 2) Panels: soft breathing glow */
.panel{
  position: relative;
}
.panel::after{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: 18px;
  pointer-events:none;
  background: radial-gradient(circle at top, rgba(109,224,255,.25), transparent 55%);
  opacity:.35;
  animation: panelGlow 4.5s ease-in-out infinite;
}
@keyframes panelGlow{
  0%,100%{ opacity:.22; }
  50%    { opacity:.42; }
}

/* 3) Buttons: gentle sparkle pulse (idle) */
.btn, .btnSmall{
  position: relative;
  overflow: hidden;
}
.btn::after, .btnSmall::after{
  content:"";
  position:absolute;
  top:-40%;
  left:-60%;
  width: 50%;
  height: 180%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  transform: rotate(18deg);
  opacity: 0;
animation: none !important;
  pointer-events:none;
}
@keyframes btnSweep{
  0%,55% { left:-60%; opacity:0; }
  60%    { opacity:.25; }
  85%    { left:130%; opacity:.10; }
  100%   { left:130%; opacity:0; }
}

/* 4) Stage meta strip “scan” sweep */
.stageMetaRow{
  position: relative;
  overflow: hidden;
}
.stageMetaRow::after{
  content:"";
  position:absolute;
  inset:-40% -60%;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.18) 40%, transparent 70%);
  transform: rotate(12deg);
  animation: headerSweep 5.5s ease-in-out infinite;
  pointer-events:none;
  opacity:.22;
}
@keyframes headerSweep{
  0%,60% { transform: translateX(-40%) rotate(12deg); opacity:0; }
  70%    { opacity:.22; }
  100%   { transform: translateX(40%) rotate(12deg); opacity:0; }
}

/* ==========================
   Primary CTA pulse (guides user to next step)
   ========================== */
.primaryCTA {
  animation: pulseCTALight 1.4s ease-in-out infinite;
}
body.dark .primaryCTA {
  animation: pulseCTADark 1.4s ease-in-out infinite;
}
@keyframes pulseCTALight {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px rgba(255,255,255,.3), 0 0 18px rgba(255, 220, 80, 0.65), 0 10px 18px rgba(0,0,0,.25);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(255,255,255,.6), 0 0 42px rgba(255, 240, 100, 1), 0 10px 18px rgba(0,0,0,.25);
  }
}
@keyframes pulseCTADark {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px rgba(0,255,213,.4), 0 0 20px rgba(0, 255, 213, 0.65), 0 10px 18px rgba(0,0,0,.35);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(0,255,213,.75), 0 0 48px rgba(0, 255, 230, 1), 0 10px 18px rgba(0,0,0,.35);
  }
}
@media (prefers-reduced-motion: reduce) {
  .primaryCTA {
    animation: none;
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(255, 200, 50, 0.65);
  }
  body.dark .primaryCTA {
    box-shadow: 0 0 24px rgba(0, 255, 213, 0.6);
  }
}

/* Build button: large yellow glow (wins over .primaryCTA pulse on same element) */
#gridBuildBtn.btn:not(:disabled){
  animation: gridBuildMegaGlow 1.8s ease-in-out infinite !important;
  transform: none !important;
}
@media (prefers-reduced-motion: reduce){
  #gridBuildBtn.btn:not(:disabled){
    animation: none !important;
    box-shadow:
      0 0 0 2px rgba(255, 221, 85, 0.7),
      0 0 28px rgba(255, 213, 79, 0.5),
      0 0 52px rgba(255, 193, 7, 0.38),
      0 10px 22px rgba(0, 0, 0, 0.28);
  }
}
.collection-actions-build.btn.btnPrimary:not(:disabled){
  animation: gridBuildMegaGlow 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce){
  .collection-actions-build.btn.btnPrimary:not(:disabled){
    animation: none;
    box-shadow:
      0 0 0 2px rgba(255, 221, 85, 0.7),
      0 0 28px rgba(255, 213, 79, 0.45),
      0 10px 20px rgba(0, 0, 0, 0.3);
  }
}

/* ==========================
   Button hierarchy
   ========================== */
.btnPrimary {
  min-width: 176px;
  padding: 15px 20px;
  font-size: 20px;
}
.btnSecondary {
  padding: 9px 12px;
  font-size: 16px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.18);
}
.btnSecondary:hover {
  background: rgba(255,255,255,.15);
}
body.dark .btnSecondary {
  background: rgba(0,255,213,.08);
  border-color: rgba(0,255,213,.25);
  color: rgba(0,255,213,.95);
}

/* ==========================
   Empty states
   ========================== */
.emptyState {
  font-size: 21px;
  font-weight: 800;
  color: rgba(255,255,255,.9);
  padding: 14px 0;
  transition: opacity 0.2s ease;
}

/* Pulse retry button when images failed */
.pulseAlert{
  animation:pulseGlow 1.5s ease-in-out infinite;
}
@keyframes pulseGlow{
  0%,100%{ box-shadow:0 0 0 rgba(255,0,0,0.5); }
  50%{ box-shadow:0 0 14px rgba(255,0,0,0.85); }
}
@media (prefers-reduced-motion: reduce){
  .pulseAlert{ animation:none; }
}

/* Retry button loading state */
.btn.retryLoading{
  opacity: 0.85;
  pointer-events: none;
}

/* Smooth transitions (selective for performance) */
.tile,.btn,.btnSmall,.panel,.heroHeader{
  transition:transform 0.2s ease,box-shadow 0.2s ease,opacity 0.2s ease,border-color 0.2s ease;
}

/* Respect reduced motion (important for accessibility) */
@media (prefers-reduced-motion: reduce){
  body::before,
  .panel::after,
  .btn::after, .btnSmall::after,
  .stageMetaRow::after{
    animation: none !important;
  }
}
/* Bigger collection names (NO layout growth) */
.collectionName{
  font-size: 21px !important;
  line-height: 1.05;            /* tighter so row height stays same */
  font-weight: 900;
}
/* Guided glow (NO pulse) */
.guideGlow{
  position: relative;
  outline: none;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px rgba(46, 204, 113, 0.90),
    0 0 22px rgba(46, 204, 113, 0.65);
  animation: none !important;
  pointer-events: auto; /* ✅ allows interaction */
}

/* Little green dot (NO pulse) */
.guideGlow::after{
  content:"";
  position:absolute;
  top:-6px; right:-6px;
  width:12px; height:12px;
  border-radius:999px;
  background: rgba(46, 204, 113, 1);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.85);
  pointer-events:none; /* ✅ never blocks taps */
}
/* ==========================
   DARK / NEON THEME (toggle)
   ========================== */
body.dark{
  /* Background */
  --bg1:#05060f;
  --bg2:#0b0f2a;

  /* Panels */
  --panel: rgba(0,0,0,.55);
  --panel2: rgba(0,0,0,.78);
  --stroke: rgba(0,255,213,.22);
  --shadow: 0 18px 40px rgba(0,0,0,.55);

  /* Button becomes neon */
  --btnYellow:#00ffd5;
  --btnYellow2:#00c2a3;
  --btnText:#001a14;

  /* Text */
  --muted: rgba(255,255,255,.78);
  --loBlueLine: rgba(0,255,213,0.55);
}

/* Optional: make stage/grid feel more “arcade neon” in dark mode */
body.dark .stage{
  background: radial-gradient(circle at top, rgba(0,255,213,.16), rgba(11,15,42,.55)) !important;
  border-color: rgba(0,255,213,.25) !important;
}

body.dark .panel{
  border-color: rgba(0,255,213,.18) !important;
}

body.dark .btn, body.dark .btnSmall{
  box-shadow:
    0 0 0 1px rgba(0,255,213,.35),
    0 10px 18px rgba(0,0,0,.35),
    0 0 18px rgba(0,255,213,.28),
    inset 0 2px 0 rgba(255,255,255,.18);
}
/* Dark mode: change the guideGlow from green -> neon cyan */
body.dark .guideGlow{
  box-shadow:
    0 0 0 2px rgba(0,255,213,.95),
    0 0 26px rgba(0,255,213,.75),
    0 0 40px rgba(0,255,213,.45);
}
/* Dark mode: change the little guide dot colour too */
body.dark .guideGlow::after{
  background: rgba(0,255,213,1);
  box-shadow: 0 0 12px rgba(0,255,213,.9);
}
/* Collections search: keep green guide ring in dark mode too */
#collectionSearch.guideGlow{
  box-shadow:
    0 0 0 2px rgba(46, 204, 113, 0.95),
    0 0 22px rgba(46, 204, 113, 0.65),
    0 0 36px rgba(46, 204, 113, 0.35);
}
body.dark #collectionSearch.guideGlow{
  box-shadow:
    0 0 0 2px rgba(46, 204, 113, 0.95),
    0 0 24px rgba(46, 204, 113, 0.7),
    0 0 40px rgba(46, 204, 113, 0.4);
}
body.dark #collectionSearch.guideGlow::after{
  background: rgba(46, 204, 113, 1);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.9);
}
/* Dark mode: step indicator uses neon cyan */
body.dark .stepItem.active,
body.dark .stepItem.completed{
  background: linear-gradient(180deg, rgba(0,255,213,.4), rgba(0,255,213,.3));
  color: rgba(255,255,255,.98);
  border-color: rgba(0,255,213,.5);
  box-shadow: 0 2px 8px rgba(0,0,0,.35), inset 0 1px 0 rgba(0,255,213,.3);
}
body.dark .tile[data-kind="empty"]{
  background:rgba(255,255,255,0.08) !important;
  border-color:rgba(0,255,213,0.2);
}
/* ==========================
   Tabs bar
   ========================== */
.tabsBar{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.tabBtn{
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 950;
  cursor: pointer;
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  box-shadow: 0 10px 18px rgba(0,0,0,.15);
  transition: transform .08s ease, filter .15s ease;
}

.tabBtn:hover{
  filter: brightness(1.05);
}

.tabBtn:active{
  transform: translateY(1px);
}

.tabBtn.active{
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText);
  border-color: rgba(255,255,255,.28);
}

@media (max-width: 640px){
  #setupPanel.panel,
  #controlsPanel.panel{
    padding: 12px 10px;
    margin: 6px 0;
  }
  .topSection{
    gap: 14px;
  }

  .walletInputRow{
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }
  .walletInputRow .input{
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    max-width: none;
  }
  .walletValidationHint{
    width: 100%;
    text-align: left;
    margin-top: 2px !important;
  }

  .collectionsRow{
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }
  .collectionsRow .searchWrap{
    flex: 1 1 100%;
    min-width: 0;
  }
  .collectionsRowBtns{
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .collectionsRowBtns .btn{
    width: 100%;
    min-width: 0 !important;
    white-space: normal;
    line-height: 1.2;
    font-size: 16px;
    padding: 12px 8px;
  }

  /* Collection cards: full-width name, readable buttons (iPhone / small phones) */
  .collectionLogoWrap{
    width: 72px;
    height: 72px;
    border-radius: 10px;
  }
  .collectionItemHeader{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .collectionNameRow{
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }
  .collectionName{
    font-size: 18px !important;
    line-height: 1.3 !important;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }
  .collectionSelectionInline{
    white-space: normal;
  }
  .collectionCount{
    margin-left: 0;
    align-self: flex-start;
    font-size: 16px;
    padding: 5px 10px;
  }
  .collectionItemActions{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }
  .collectionItemActions .collectionActionBtn{
    flex: none;
    min-width: 0;
    width: 100%;
    font-size: 15px;
    padding: 12px 8px;
    white-space: normal;
    line-height: 1.2;
    min-height: 44px;
  }
  /* Third action = Add logo — full row so label isn’t crushed */
  .collectionItemActions .collectionBtnPickLogo{
    grid-column: 1 / -1;
  }
  .collectionItemActions .collectionBtnSelectNone{
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
    padding: 8px 8px;
  }

  .layoutPickerBtns{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .layoutPickerBtn{
    min-width: 0 !important;
    width: 100%;
    font-size: 15px;
    padding: 12px 8px;
    white-space: normal;
    line-height: 1.2;
  }

  .buildExportRow{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    margin: 8px 0;
  }
  .buildExportRow .btn{
    flex: none;
    width: 100%;
    min-width: 0;
    font-size: 14px;
    padding: 12px 8px;
    white-space: normal;
    line-height: 1.2;
  }

  .collectionTraitControls.trait-row{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }
  .collection-trait-control{
    min-width: 0;
    padding: 8px 10px;
  }
  .collection-trait-control .trait-type{
    max-width: none;
    width: 100%;
    min-width: 0;
    font-size: 15px;
    padding: 10px 8px;
    min-height: 44px;
  }
  .collection-trait-control .collection-name{
    font-size: 15px;
  }
  .collection-trait-dragHandle{
    width: 26px;
    height: 32px;
    font-size: 12px;
  }

  .manual-selection-toolbar{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
  }
  .manual-selection-toolbar .btn{
    width: 100%;
    min-width: 0;
    font-size: 15px;
    padding: 12px 8px;
    white-space: normal;
    line-height: 1.2;
  }
  .manual-selection-toolbar .manual-selection-retry-failed{
    grid-column: 1 / -1;
  }

  .traitOrderHeaderHint{
    font-size: 12px;
    line-height: 1.35;
  }
}

/* ==========================
   TILE PLACEHOLDER (OVERRIDE)
   Put this at the VERY END of the CSS so it wins.
   ========================== */

/* LO.png while NFT art is still loading */
.tile{
  background-image: url("../assets/images/LO.png") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Show <img> (placeholder or loaded NFT) - tile.png loaded in JS before fetch */
.tile img{
  opacity: 1 !important;
  transition: opacity .15s ease !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* When loaded, remove background so img shows through */
.tile.isLoaded{
  background-image: none !important;
}

/* When missing/failed, keep LO placeholder */
.tile.isMissing{
  background-image: url("../assets/images/LO.png") !important;
}

/* Retry in progress — subtle loading pulse on tile */
.tile.isRetrying{
  animation: tileRetryPulse 0.8s ease-in-out infinite;
}
@keyframes tileRetryPulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.6; }
}

  /* Full-screen loading: LO + status inside a spinning ring + hint */
  #loadingOverlay{
    display:none;
    position:fixed;
    inset:0;
    z-index:99999;
    background:rgba(11,18,32,.82);
    backdrop-filter:blur(8px);
    -webkit-backdrop-filter:blur(8px);
    justify-content:center;
    align-items:center;
    padding:24px;
  }
  #loadingOverlay.visible{
    display:flex;
  }
  #loadingOverlay .loading-overlay-inner{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap: 18px;
    max-width: min(380px, 92vw);
    width: 100%;
  }
  #loadingOverlay .loading-overlay-orbit{
    position: relative;
    width: min(268px, 78vw);
    height: min(268px, 78vw);
    max-width: 100%;
    display: grid;
    place-items: center;
    margin: 0 auto;
  }
  #loadingOverlay .loading-overlay-ring{
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,.14);
    border-top-color: #ffdd55;
    border-right-color: rgba(255, 221, 85, 0.42);
    box-sizing: border-box;
    pointer-events: none;
    animation: flexgridLoadingRingSpin 0.95s linear infinite;
  }
  @keyframes flexgridLoadingRingSpin{
    to { transform: rotate(360deg); }
  }
  @media (prefers-reduced-motion: reduce){
    #loadingOverlay .loading-overlay-ring{
      animation-duration: 1.75s;
    }
  }
  #loadingOverlay .loading-overlay-orbitCenter{
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 70%;
    text-align: center;
  }
  #loadingOverlay .loading-overlay-lo-img{
    display:block;
    width:min(140px, 38vw);
    height:auto;
    aspect-ratio:1;
    object-fit:contain;
    filter:drop-shadow(0 8px 28px rgba(0,0,0,.4));
    animation: none !important;
  }
  #loadingOverlay .loading-overlay-status{
    margin: 0;
    padding: 0 4px;
    font-family: "Baloo 2", system-ui, sans-serif;
    font-size: clamp(15px, 3.6vw, 18px);
    font-weight: 800;
    color: rgba(255,255,255,.95);
    text-align: center;
    line-height: 1.25;
    min-height: 1.25em;
  }
  #loadingOverlay .loading-overlay-status:empty{
    display: none;
  }
  #loadingOverlay .loading-overlay-hint{
    margin: 0;
    font-family: system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.78);
    text-align: center;
    letter-spacing: 0.02em;
  }

/* ==========================
   Disclaimer overlay (first visit)
   ========================== */
.disclaimer-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  transition: opacity .3s ease;
}
.disclaimer-overlay.hidden{
  opacity: 0;
  pointer-events: none;
}
.disclaimer-modal{
  max-width: 520px;
  width: 100%;
  background: #4c6fff;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 24px;
  padding: 32px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  position: relative;
}
.disclaimer-back-link{
  display: inline-flex;
  align-items: center;
  margin: -8px 0 12px;
  font-weight: 800;
  font-size: 16px;
  color: rgba(255,255,255,.95);
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background .15s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.disclaimer-back-link:hover{
  background: rgba(0,0,0,.12);
}
.disclaimer-back-link:focus-visible{
  outline: 2px solid rgba(255,221,85,.95);
  outline-offset: 2px;
}
.disclaimer-header{
  width: 100%;
  height: auto;
  margin: -8px 0 16px;
  display: block;
}
.disclaimer-title{
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  line-height: 1.25;
}
.disclaimer-text{
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255,255,255,.95);
}
.disclaimer-socials{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
}
.disclaimer-link{
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  border: 2px solid rgba(0,0,0,.15);
  border-radius: 12px;
  color: var(--btnText);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  transition: filter .2s, transform .08s;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.disclaimer-link:hover{
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.disclaimer-continue{
  width: 100%;
  padding: 16px 28px;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText);
  border: 2px solid rgba(0,0,0,.15);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.disclaimer-continue:hover{
  filter: brightness(1.05);
}

/* ==========================
   Collection selection (all / manual / none)
   ========================== */
.collectionItem{
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.collectionItemBody{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
/* Fixed square — every collection logo the same size */
.collectionLogoWrap{
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.collectionLogoThumb{
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.collectionLogoPlaceholder{
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
}
.collectionItemMain{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.collectionItemHeader{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.collectionNameRow{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
  flex: 1;
}
.collectionSelectionInline{
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
body.dark .collectionSelectionInline{
  color: rgba(0, 255, 213, 0.82);
}
.collectionItemActions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.collectionActionBtn{
  flex: 1;
  min-width: 0;
}
.collectionBtnSelectNone{
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  text-decoration: underline;
  padding: 6px 8px;
  font-family: inherit;
}
.collectionBtnSelectNone:hover{
  color: #fff;
}
.collectionBtnPickLogo.collectionBtnPickLogo--on{
  background: linear-gradient(180deg, #5ee3a8, #2bbd7e) !important;
  color: #0d2818 !important;
  border: 2px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow:
    0 2px 10px rgba(46, 204, 113, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  font-weight: 950;
}
body.dark .collectionBtnPickLogo.collectionBtnPickLogo--on{
  background: linear-gradient(180deg, rgba(0, 255, 213, 0.55), rgba(0, 200, 170, 0.45)) !important;
  color: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(0, 255, 213, 0.65) !important;
  box-shadow:
    0 2px 12px rgba(0, 255, 213, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.collectionBtnPickLogo:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}
@media (min-width: 860px){
  .collectionItem{
    grid-column: 1 / -1;
  }
}

/* ==========================
   Manual NFT selection modal
   ========================== */
.manual-selection-overlay{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Same cyan→blue as body, with a light dim so the modal reads on top */
  background:
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
    radial-gradient(circle at top, var(--bg1), var(--bg2));
  backdrop-filter: blur(10px);
}
body.dark .manual-selection-overlay{
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    radial-gradient(circle at top, var(--bg1), var(--bg2));
}
.manual-selection-overlay.hidden{
  display: none;
}
.manual-selection-modal{
  width: 100%;
  max-width: min(920px, 100vw - 24px);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  /* Match stage / page “blue vibe” (see .stage + body) */
  background: radial-gradient(circle at top, rgba(109, 224, 255, 0.32), rgba(76, 111, 255, 0.36));
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(109, 224, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
body.dark .manual-selection-modal{
  background: radial-gradient(circle at top, rgba(0, 255, 213, 0.2), rgba(11, 15, 42, 0.62));
  border-color: rgba(0, 255, 213, 0.32);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 255, 213, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.manual-selection-header{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 16px 14px;
  border-bottom: 1px solid rgba(109, 224, 255, 0.28);
  flex-shrink: 0;
  background: rgba(76, 111, 255, 0.14);
}
.manual-selection-headerTop{
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
body.dark .manual-selection-header{
  border-bottom-color: rgba(0, 255, 213, 0.22);
  background: rgba(0, 0, 0, 0.22);
}
.manual-selection-headerMain{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
  width: 100%;
}
.manual-selection-headerBanner{
  width: 100%;
  max-width: 520px;
  height: 86px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 520px){
  .manual-selection-headerBanner{
    height: 78px;
  }
}
.manual-selection-title{
  margin: 0;
  font-size: 22px;
  font-weight: 950;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
  min-width: 0;
}
.manual-selection-close{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.2);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.manual-selection-close:hover{
  background: rgba(255,255,255,.12);
}
.manual-selection-toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(109, 224, 255, 0.22);
  flex-shrink: 0;
  background: rgba(76, 111, 255, 0.1);
}
body.dark .manual-selection-toolbar{
  border-bottom-color: rgba(0, 255, 213, 0.18);
  background: rgba(0, 0, 0, 0.18);
}
.manual-selection-retry-failed.hidden{
  display: none !important;
}
.manual-selection-loading{
  flex-shrink: 0;
  padding: 14px 18px 16px;
  border-bottom: 1px solid rgba(109, 224, 255, 0.2);
  background: rgba(76, 111, 255, 0.08);
}
body.dark .manual-selection-loading{
  border-bottom-color: rgba(0, 255, 213, 0.16);
  background: rgba(0, 0, 0, 0.2);
}
.manual-selection-loading.manual-selection-loading--empty{
  display: none;
}
.manual-selection-kid-note{
  display: none;
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 650;
}
.manual-selection-kid-note-line1{
  display: block;
}
.manual-selection-kid-note-line2{
  display: block;
  margin-top: 10px;
}
.manual-selection-kid-note strong{
  color: rgba(109, 224, 255, 0.98);
  font-weight: 900;
}
body.dark .manual-selection-kid-note strong{
  color: rgba(0, 255, 213, 0.95);
}
.manual-selection-loading.manual-selection-loading--busy .manual-selection-kid-note{
  display: block;
}
.manual-selection-loading--waitNfts .manual-selection-kid-note{
  display: none !important;
}
.manual-selection-nfts-waiting{
  grid-column: 1 / -1;
  padding: 20px 14px 28px;
  text-align: center;
  max-width: 26rem;
  margin: 0 auto;
}
.manual-selection-nfts-waiting-title{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.3;
}
.manual-selection-nfts-waiting-hint{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}
.manual-selection-nfts-waiting-hint strong{
  color: rgba(109, 224, 255, 0.98);
}
body.dark .manual-selection-nfts-waiting-hint strong{
  color: rgba(0, 255, 213, 0.95);
}
.manual-selection-nfts-waiting--timeout .manual-selection-nfts-waiting-title{
  color: rgba(255, 200, 120, 0.95);
}
.manual-selection-loading-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.manual-selection-load-label{
  font-weight: 800;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
}
.manual-selection-load-fraction{
  font-weight: 900;
  font-size: 15px;
  color: rgba(109, 224, 255, 0.95);
  font-variant-numeric: tabular-nums;
}
body.dark .manual-selection-load-fraction{
  color: rgba(0, 255, 213, 0.9);
}
.manual-selection-progress-track{
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  border: 1px solid rgba(109, 224, 255, 0.25);
}
.manual-selection-progress-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  /* Hue is driven in JS (red → green) while loading */
  background: linear-gradient(90deg, hsl(0, 78%, 52%), hsl(12, 76%, 50%));
  transition: width 0.2s ease-out, background 0.25s ease-out, box-shadow 0.25s ease-out;
  box-shadow: 0 0 12px hsla(0, 82%, 55%, 0.5);
}
body.dark .manual-selection-progress-fill{
  /* Initial frame before first updateManualModalLoadProgress tick */
  background: linear-gradient(90deg, hsl(0, 78%, 50%), hsl(12, 74%, 48%));
  box-shadow: 0 0 12px hsla(0, 80%, 50%, 0.45);
}
.manual-selection-scroll{
  flex: 1;
  min-height: 200px;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  background: rgba(76, 111, 255, 0.08);
}
body.dark .manual-selection-scroll{
  background: rgba(0, 0, 0, 0.12);
}
.manual-selection-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}
.manual-nft-tile{
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid rgba(255,255,255,.2);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0,0,0,.25);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.manual-nft-tile--error{
  border-color: rgba(255, 120, 100, 0.65);
}
.manual-nft-tile--error::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(120, 30, 30, 0.22);
  pointer-events: none;
  z-index: 1;
}
.manual-nft-tile-retry{
  position: absolute;
  bottom: 4px;
  right: 4px;
  z-index: 4;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, rgba(109, 224, 255, 0.95), rgba(76, 111, 255, 0.92));
  color: #0a1628;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.manual-nft-tile-retry:hover{
  filter: brightness(1.08);
}
body.dark .manual-nft-tile-retry{
  background: linear-gradient(180deg, rgba(0, 255, 213, 0.85), rgba(76, 111, 255, 0.88));
  color: rgba(10, 22, 40, 0.98);
}
.manual-nft-tile img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  position: relative;
  z-index: 0;
}
.manual-nft-tile--selected{
  border-color: var(--btnYellow);
  box-shadow:
    0 0 0 2px rgba(255, 220, 60, 0.95),
    0 0 18px rgba(255, 210, 40, 0.55),
    0 0 28px rgba(255, 200, 30, 0.35);
  transform: scale(1.03);
}
body.dark .manual-nft-tile--selected{
  /* Keep yellow in dark mode so picks read clearly on neon blues */
  border-color: #ffe566;
  box-shadow:
    0 0 0 2px rgba(255, 229, 102, 0.95),
    0 0 18px rgba(255, 220, 80, 0.5),
    0 0 28px rgba(255, 200, 40, 0.32);
}
.manual-selection-footer{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(109, 224, 255, 0.26);
  background: rgba(76, 111, 255, 0.14);
  flex-shrink: 0;
}
body.dark .manual-selection-footer{
  border-top-color: rgba(0, 255, 213, 0.2);
  background: rgba(0, 0, 0, 0.24);
}
.manual-selection-count{
  font-weight: 900;
  font-size: 18px;
  color: rgba(255,255,255,.95);
}
.manual-selection-footer-btns{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 520px){
  .manual-selection-grid{
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
  }
  .manual-selection-footer{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  .manual-selection-count{
    font-size: 16px;
    text-align: center;
    width: 100%;
  }
  .manual-selection-footer-btns{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .manual-selection-footer-btns .btn{
    width: 100%;
    min-width: 0;
    font-size: 16px;
    padding: 12px 10px;
    white-space: normal;
    line-height: 1.2;
  }
}

/* ==========================
   Settings drawer (⚙️)
   ========================== */
.settings-overlay{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.settings-overlay.visible{
  opacity: 1;
  pointer-events: auto;
}
.settings-panel{
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 100vw);
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  background: #151820;
  color: #f4f6fb;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.35);
  border-left: 1px solid rgba(255,255,255,0.08);
}
.settings-panel.open{
  transform: translateX(0);
}
.settings-panel-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.settings-panel-title{
  margin: 0;
  font-size: 22px;
  font-weight: 950;
}
.settings-panel-close{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.settings-panel-close:hover{
  background: rgba(255,255,255,0.12);
}
.settings-panel-scroll{
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 28px;
}
.settings-section{
  margin-bottom: 22px;
}
.settings-section-title{
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.55);
}
.settings-about-line{
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 850;
}
.settings-about-sub{
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255,255,255,0.75);
}
.settings-hint{
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
}
.settings-section--comingSoon{
  pointer-events: none;
  opacity: 0.95;
}
.settings-coming-soon{
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0.02em;
  color: rgba(255, 221, 85, 0.95);
}
.settings-hint--muted{
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}
.settings-segment{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.settings-seg-btn{
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.settings-seg-btn--on{
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText);
  border-color: rgba(0,0,0,0.12);
}
.settings-toggle{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}
.settings-toggle input{
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.settings-layout-picker{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.settings-layout-picker .layoutPickerBtn{
  width: 100%;
}
.settings-fullbtn{
  width: 100%;
  margin-bottom: 8px;
}
.settings-btn-muted{
  opacity: 0.9;
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  box-shadow: none !important;
}
.settings-linkbtn{
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
}
.settings-linkbtn:hover{
  background: rgba(255,255,255,0.14);
}

@media (max-width: 520px){
  .settings-panel{
    width: 100%;
    max-width: 100%;
  }
}

/* Stage canvas modes (settings) */
.stage.settings-canvas--light{
  background: linear-gradient(180deg, #f8fafc, #e8ecf4) !important;
  border-color: rgba(0,0,0,0.08) !important;
}
.stage.settings-canvas--light .stageMetaRow{
  border-bottom-color: rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.5);
}
.stage.settings-canvas--light .stageMeta{
  color: rgba(26,29,38,0.75);
}
.stage.settings-canvas--light .stageLayoutBar{
  border-color: rgba(0,0,0,0.08);
}
.stage.settings-canvas--dark{
  background: linear-gradient(180deg, #0d0f14, #050608) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.stage.settings-canvas--dark .stageMetaRow{
  border-bottom-color: rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
}

.gridStack--tileBorders .tile{
  outline: 1px solid rgba(255,255,255,0.14);
  outline-offset: -1px;
}
.stage.settings-canvas--light .gridStack--tileBorders .tile{
  outline-color: rgba(0,0,0,0.12);
}

.stageCaptionOverlay{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  z-index: 6;
  max-width: calc(100% - 24px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  text-align: center;
  line-height: 1.3;
  pointer-events: none;
}
.stage.settings-canvas--light .stageCaptionOverlay{
  background: rgba(255,255,255,0.92);
  color: #1a1d26;
}
.stageCaptionOverlay--shadow{
  text-shadow: 0 2px 8px rgba(0,0,0,0.55);
}
.stage.settings-canvas--light .stageCaptionOverlay--shadow{
  text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

/* ==========================
   GIF export modals
   ========================== */
.grid-gif-options-modal{
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(109, 224, 255, 0.16), rgba(0,0,0,0) 58%),
    radial-gradient(120% 120% at 85% 0%, rgba(255, 221, 85, 0.12), rgba(0,0,0,0) 55%),
    rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}
.grid-gif-options-modal.hidden{
  display: none;
}

/* ==========================
   Donation modal (post-export)
   ========================== */
.donation-modal{
  position: fixed;
  inset: 0;
  z-index: 100001;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(109, 224, 255, 0.16), rgba(0,0,0,0) 58%),
    radial-gradient(120% 120% at 85% 0%, rgba(255, 221, 85, 0.12), rgba(0,0,0,0) 55%),
    rgba(0,0,0,0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.donation-content{
  width: 100%;
  max-width: 420px;
  background: #4c6fff;
  color: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 0;
  text-align: center;
  box-shadow: 0 16px 60px rgba(0,0,0,0.45);
  position: relative;
  border: 1px solid rgba(109, 224, 255, 0.28);
  box-shadow:
    0 18px 60px rgba(0,0,0,0.55),
    0 0 0 2px rgba(255, 221, 85, 0.10),
    0 0 32px rgba(109, 224, 255, 0.18);
  overflow: hidden;
}
.donation-close-x{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.82);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.donation-close-x:hover{ filter: brightness(1.08); }
.donation-content .btn{
  border-color: rgba(255,255,255,0.22);
}
.donation-content .btn:hover{
  filter: brightness(1.05);
}
.donation-content #copyWalletBtn.btn{
  background: linear-gradient(180deg, rgba(109, 224, 255, 0.95), rgba(76, 111, 255, 0.92));
  color: #0a1628;
  border-color: rgba(255,255,255,0.35);
}
.donation-body{
  padding: 18px 16px 16px;
}
.donation-title{
  margin: 0 0 10px;
  font-weight: 900;
  font-size: 1.15rem;
  color: rgba(255, 221, 85, 0.98);
  text-shadow: 0 2px 16px rgba(0,0,0,0.45);
}
.donation-text{
  margin: 0 0 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: inherit;
  opacity: 0.9;
}
.wallet-box{
  margin: 12px 0 14px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(109, 224, 255, 0.20);
  border-radius: 12px;
  word-break: break-all;
  display: grid;
  gap: 10px;
  background: rgba(109, 224, 255, 0.08);
}
.wallet-box .wallet-label{
  font-size: 12px;
  font-weight: 900;
  color: rgba(109, 224, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wallet-box .wallet-address{
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.98);
  text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}

/* Donation buttons: make Close feel like LO primary (yellow) */
.donation-content #closeDonationModal.btn{
  background: linear-gradient(180deg, var(--btnYellow), var(--btnYellow2));
  color: var(--btnText, #1a1400);
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 10px 18px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.32);
}
.donation-content #closeDonationModal.btn:hover{ filter: brightness(1.06); }
.grid-gif-options-panel{
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  border: 1px solid rgba(109, 224, 255, 0.28);
  background: #4c6fff;
  box-shadow: 0 18px 60px rgba(0,0,0,0.58);
  box-shadow:
    0 18px 60px rgba(0,0,0,0.58),
    0 0 0 2px rgba(255, 221, 85, 0.10),
    0 0 34px rgba(109, 224, 255, 0.16);
  padding: 14px 14px 16px;
  overflow: hidden;
}

/* Shared banner sizing across popups (Share/GIF/Donation) */
.flexgrid-modal-banner{
  display: block;
  width: 100%;
  height: 108px;
  object-fit: contain;
  object-position: center center;
  padding: 4px 10px 8px;
  margin: 0;
  background: rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-sizing: border-box;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.42));
}

/* The Animation export modal should not have a darker strip under the header image. */
.grid-gif-options-panel .flexgrid-modal-banner{
  background: transparent;
  border-bottom: none;
}

/* Share + Donation popups: remove the dark strip behind the header banner */
.flexgrid-share-modal .flexgrid-share-banner{
  background: transparent;
  border-bottom: none;
}
.donation-content .flexgrid-modal-banner{
  background: transparent;
  border-bottom: none;
}
@media (max-width: 520px){
  .flexgrid-modal-banner{
    height: 92px;
    padding: 3px 8px 6px;
  }
}

.grid-gif-options-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.grid-gif-options-title{
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: rgba(255, 221, 85, 0.98);
  text-shadow: 0 2px 16px rgba(0,0,0,0.45);
}

.grid-gif-options-close{
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.82);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.grid-gif-options-close:hover{
  color: #fff;
}

.grid-gif-options-summary{
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 800;
  color: rgba(255,255,255,0.88);
}

.grid-gif-options-label{
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: rgba(255,255,255,0.86);
}
.grid-gif-options-label--section{
  margin-top: 12px;
}

.grid-gif-options-input{
  width: 100%;
  padding: 10px 12px;
  box-sizing: border-box;
  border-radius: 12px;
  background: rgba(109, 224, 255, 0.08);
  border: 1px solid rgba(109, 224, 255, 0.22);
  color: #fff;
  font: inherit;
  margin-bottom: 8px;
}
.grid-gif-options-input:focus{
  outline: none;
  border-color: rgba(255, 221, 85, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 221, 85, 0.14);
}

.grid-gif-options-speed-scale{
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(255,255,255,0.65);
  margin: 0 2px 4px;
}

.grid-gif-options-range-row{
  margin-bottom: 10px;
}

.grid-gif-options-range{
  width: 100%;
}

.grid-gif-options-duration{
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.82);
  font-weight: 800;
  min-height: 1.1em;
}

/* Blue/yellow accent for export-type toggle + donation copy button */
#gridGifOptionsModal .btn.btnSmall{
  border-color: rgba(109, 224, 255, 0.26);
}
#gridGifOptionsModal .btn.btnSmall.btnPrimary{
  box-shadow: 0 0 0 2px rgba(255, 221, 85, 0.22), 0 10px 22px rgba(0,0,0,0.35);
}
.grid-gif-options-actions .btn.btnPrimary{
  box-shadow: 0 0 0 2px rgba(255, 221, 85, 0.22), 0 10px 22px rgba(0,0,0,0.35);
}
.donation-modal .btn.btnSmall{
  border-color: rgba(109, 224, 255, 0.26);
}

.grid-gif-options-actions{
  display: flex;
  gap: 10px;
}
.grid-gif-options-actions .btn{
  flex: 1;
}

.grid-gif-creating-modal{
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}
.grid-gif-creating-modal.hidden{
  display: none;
}
.grid-gif-creating-panel{
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.78);
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  padding: 16px;
  text-align: center;
}
.grid-gif-creating-title{
  margin: 0 0 12px;
  font-size: 1.0rem;
  font-weight: 900;
}
.grid-gif-creating-spinner{
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.18);
  border-top-color: rgba(223,255,0,0.75);
  animation: gridGifSpin 0.75s linear infinite;
}
@keyframes gridGifSpin{
  to{ transform: rotate(360deg); }
}

/* ==========================
   Collection-first grid + modal
   ========================== */
/* IMPORTANT: `#collectionsList` used to be a grid itself (old UI).
   In collection-first mode, we render our own `.collection-grid` inside it,
   so the parent must be a normal block container; otherwise the grid only
   occupies one column (looks like half width). */
.collectionList.collections-container{
  display: block;
}

.collection-grid{
  display: grid;
  /* Wide panels: auto-fit; phones get explicit columns below (logos must fit cells) */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 6px 0 2px;
  width: 100%;
  align-items: stretch;
  justify-items: stretch;
}
/* Typical phone portrait: one card per row — scroll vertically, no overlap */
@media (max-width: 520px){
  .collection-grid{
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 4px;
  }
}
/* Large phone / small tablet: two columns; logos scale to cell (see .collection-card rules) */
@media (min-width: 521px) and (max-width: 859px){
  .collection-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-top: 4px;
  }
}
@media (min-width: 860px){
  .collection-grid{
    /* Desktop/Mac: always show a few across (no single-column) */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

.collection-card{
  appearance: none;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.12);
  border-radius: 16px;
  padding: 10px 10px 10px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  min-width: 0; /* grid/flex: allow column to shrink so contents don't overflow neighbors */
}
.collection-card{
  min-height: 330px; /* tighter overall height */
}
@media (max-width: 520px){
  .collection-card{
    /* Single-column layout: height follows content (fixed min was for multi-column tile look) */
    min-height: 0;
  }
}
.collection-card:hover{
  transform: translateY(-2px);
  border-color: rgba(109,224,255,.45);
  box-shadow: 0 14px 28px rgba(0,0,0,.22), 0 0 0 1px rgba(109,224,255,.12);
  background: rgba(109,224,255,.08);
}
body.dark .collection-card:hover{
  border-color: rgba(0,255,213,.35);
  box-shadow: 0 14px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(0,255,213,.10);
  background: rgba(0,255,213,.06);
}
.collection-card:active{
  transform: translateY(-1px) scale(.99);
}
.collection-card:focus-visible{
  outline: 3px solid rgba(109,224,255,.9);
  outline-offset: 3px;
}
body.dark .collection-card:focus-visible{
  outline-color: rgba(0,255,213,.9);
}

.collection-card--disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.collection-card-logo{
  /* Fluid: never wider than the card column (prevents overlap on 2–3 column phone grids) */
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
}
.collection-card-logo.collectionLogoWrap{
  border-radius: 14px;
}
/* Ensure the actual logo wrapper (and its <img>) scales inside cards */
.collection-card .collectionLogoWrap{
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
}
@media (max-width: 859px){
  .collection-card-logo,
  .collection-card .collectionLogoWrap{
    max-width: min(220px, 100%);
  }
}
.collection-card-name{
  font-weight: 950;
  font-size: 20px;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 520px){
  .collection-card-name{
    font-size: 18px;
  }
}
.collection-card-meta{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 850;
  color: rgba(255,255,255,.82);
}
.collection-card-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.16);
  font-variant-numeric: tabular-nums;
}
.collection-card-selection{
  opacity: .95;
}

.collection-card.selected{
  border-color: rgba(255, 221, 85, 0.95);
  /* Yellow ring around the whole card (including its padding area) */
  box-shadow:
    0 0 0 3px rgba(255, 221, 85, 0.95),
    0 14px 30px rgba(0,0,0,.22);
  background: rgba(255, 221, 85, 0.10);
}
body.dark .collection-card.selected{
  border-color: rgba(255, 235, 120, 0.95);
  box-shadow:
    0 0 0 3px rgba(255, 235, 120, 0.95),
    0 14px 32px rgba(0,0,0,.28);
  background: rgba(255, 235, 120, 0.08);
}
.collection-card.collection-card--manualPicks{
  border-color: rgba(255, 221, 85, 0.95);
  box-shadow:
    0 0 0 3px rgba(255, 221, 85, 0.95),
    0 14px 30px rgba(0,0,0,.22);
  background: rgba(255, 221, 85, 0.10);
}

.collection-card-remove{
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.20);
}
.collection-card-remove:hover{
  background: rgba(0,0,0,.48);
  border-color: rgba(255,255,255,.32);
}
.collection-card-remove:active{
  transform: translateY(1px);
}
body.dark .collection-card-remove{
  background: rgba(0,0,0,.45);
  border-color: rgba(0,255,213,.22);
}

/* Collection actions modal */
.collection-actions-overlay{
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* Match the first-visit disclaimer overlay */
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}
body.dark .collection-actions-overlay{
  background: rgba(0,0,0,.6);
}
.collection-actions-overlay.hidden{
  display: none;
}
.collection-actions-modal{
  width: 100%;
  max-width: 520px;
  /* Match `.disclaimer-modal` (first popup) */
  border-radius: 24px;
  border: 2px solid rgba(255,255,255,.3);
  background: #4c6fff;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  overflow: hidden;
  transform: scale(.96);
  opacity: 1;
  transition: transform .18s ease;
  pointer-events: auto;
}
body.dark .collection-actions-modal{
  /* Keep the same brand blue as the first popup even in dark mode */
  background: #4c6fff;
  border-color: rgba(255,255,255,.3);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.collection-actions-overlay.visible .collection-actions-modal{
  transform: scale(1);
}
.collection-actions-header{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  /* Same solid blue as the modal shell */
  background: #4c6fff;
}
body.dark .collection-actions-header{
  background: #4c6fff;
}
.collection-actions-headerRow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 0;
}
.collection-actions-topBanner{
  width: 100%;
  height: 86px;
  object-fit: contain;
  background: transparent;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
@media (max-width: 520px){
  .collection-actions-topBanner{
    height: 78px;
  }
}
.collection-actions-title{
  margin: 0;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 12px;
}
@media (max-width: 520px){
  .collection-actions-title{
    font-size: 22px;
    white-space: normal; /* allow 2 lines on iPhone */
  }
}
.collection-actions-back{
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.collection-actions-back:hover{
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.collection-actions-close{
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.82);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.collection-actions-close:hover{
  color: #fff;
}
.collection-actions-body{
  padding: 14px 14px 16px;
  /* Same solid blue as the modal shell */
  background: #4c6fff;
}
body.dark .collection-actions-body{
  background: #4c6fff;
}
.collection-actions-summary{
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: rgba(255,255,255,0.82);
  line-height: 1.35;
}
.collection-actions-btns{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.collection-actions-btns .collection-actions-choice{
  font-weight: 900;
  font-size: 17px;
  border-radius: 14px;
  border: 2px solid rgba(255, 221, 85, 0.95);
  background: rgba(0, 0, 0, 0.14);
  color: #fff;
  box-shadow: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.collection-actions-btns .collection-actions-choice:hover:not(:disabled){
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffe566;
}
.collection-actions-btns .collection-actions-choice--active{
  background: linear-gradient(180deg, #ffeb7a, #ffdd55 40%, #f0c020);
  color: #1a1400;
  border-color: #e6b010;
  text-shadow: none;
}
/* Active choice stays solid yellow — do not dim / wash out on hover (.btn:hover uses filter). */
.collection-actions-btns .collection-actions-choice--active:hover:not(:disabled),
.collection-actions-btns .collection-actions-choice--active:focus-visible:not(:disabled){
  background: linear-gradient(180deg, #ffeb7a, #ffdd55 40%, #f0c020);
  color: #1a1400;
  border-color: #e6b010;
  text-shadow: none;
  filter: none;
}
.collection-actions-btns .collection-actions-choice:disabled{
  opacity: 0.42;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.12);
}
.collection-actions-btns .collection-actions-choice--active:disabled{
  opacity: 0.42;
}
body.dark .collection-actions-btns .btn.collection-actions-choice{
  box-shadow: none;
}
body.dark .collection-actions-btns .btn.collection-actions-choice.collection-actions-choice--active{
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
body.dark .collection-actions-btns .btn.collection-actions-choice.collection-actions-choice--active:hover:not(:disabled),
body.dark .collection-actions-btns .btn.collection-actions-choice.collection-actions-choice--active:focus-visible:not(:disabled){
  filter: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.collection-actions-build{
  width: 100%;
}

/* ---------- Post-export: Share + Follow on X (only after successful PNG/GIF) ---------- */
.flexgrid-share-overlay{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  z-index: 100050;
  box-sizing: border-box;
}
.flexgrid-share-modal{
  background: #4c6fff;
  color: #fff;
  padding: 0;
  border-radius: 18px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.flexgrid-share-banner{
  display: block;
  width: 100%;
  height: 108px;
  object-fit: contain;
  object-position: center center;
  padding: 4px 10px 8px;
  margin: 0;
  background: rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-sizing: border-box;
}
.flexgrid-share-inner{
  padding: 18px 20px 20px;
}
.flexgrid-share-content h2{
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 950;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.flexgrid-share-sub{
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}
.flexgrid-share-buttons{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.flexgrid-share-btn{
  display: block;
  padding: 14px 16px;
  min-height: 48px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
  box-sizing: border-box;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.flexgrid-share-btn--primary,
.flexgrid-share-btn--secondary{
  background: linear-gradient(180deg, #ffeb7a, #ffdd55 45%, #f0c020);
  color: #1a1400;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}
.flexgrid-share-btn--primary:hover,
.flexgrid-share-btn--secondary:hover{
  filter: brightness(1.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}
.flexgrid-share-close{
  margin-top: 14px;
  padding: 10px 14px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  width: 100%;
  border-radius: 10px;
}
.flexgrid-share-close:hover{
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.flexgrid-share-close:focus-visible,
.flexgrid-share-btn:focus-visible{
  outline: 3px solid rgba(255, 235, 120, 0.95);
  outline-offset: 2px;
}
@media (max-width: 520px){
  .flexgrid-share-modal{
    border-radius: 16px;
  }
  .flexgrid-share-banner{
    height: 92px;
    padding: 3px 8px 6px;
  }
  .flexgrid-share-inner{
    padding: 16px 16px 18px;
  }
  .flexgrid-share-content h2{
    font-size: 20px;
  }
}
