:root{
      --traySpace: 0px; /* auto-set by JS */

      --bg:#878787c7;
      --text:#f4f6fb;
      --muted: rgba(255, 255, 255, 0.997);
      --stroke: rgba(255,255,255,.14);
      --divider: rgba(255,255,255,.10);

      --glass: rgb(14, 18, 12);
      --glass2: rgba(51, 80, 194, 0.72);

      --noteBg: rgba(0,0,0,.22);
      --noteBorder: rgba(255,255,255,.10);

      --accent: rgba(148, 71, 169, 0.74);

      --btnIcon: url("/img/share_white.png");
      --openIcon: url("/img/open_white.png");

      --pillIconSize: 46px;

      --trayW: 560px;
       --accentText: rgba(244,246,251,.92);
  --btnBg: rgba(110, 110, 110, 0.165);
  --btnBorder: rgba(255,255,255,.14);
  --sbTrack: rgba(255,255,255,.10);
  --sbThumb: rgba(255,255,255,.22);
  --sbThumbHover: rgba(255,255,255,.30);
    }

 html[data-theme="light"]{
  --text: #0b0b0c;
  --muted: rgb(0, 0, 0);
  --btnIcon: url("/img/share_black.png");
  --openIcon: url("/img/open_black.png");
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: none;
  background: rgb(60 59 59);
}

body.autoWelcomeBg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background-image: var(--autoWelcomeBg);
  background-size: cover;
  background-position: center;

  filter: blur(34px) saturate(1.25);
  transform: scale(1.08);
  opacity: 0.55;
}

    body{
      font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
      color: var(--text);
      -webkit-overflow-scrolling: touch;
    }

    /* Center preview (page never scrolls) */
/* ===== 02. Derived page backdrop ===== */
.pageBg{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(
      1200px 900px at 50% 42%,
      rgba(0,0,0,.05),
      rgba(0,0,0,.78) 72%,
      rgba(0,0,0,.94) 100%
    ),
    var(--pageBgImg, none);
  background-color:#4d4d4d;
  background-position:50% 50%;
  background-repeat:no-repeat;
  background-size:cover;
  filter:blur(52px) saturate(1.18) brightness(.82);
  transform:scale(1.18);
  opacity:.98;
  will-change:transform, filter;
  backface-visibility:hidden;
}

.pageBg::after{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(
    1200px 900px at 50% 42%,
    rgba(0,0,0,0),
    rgba(0,0,0,.42) 60%,
    rgba(0,0,0,.78) 100%
  );
}

html[data-theme="light"] .pageBg{
  filter:blur(46px) saturate(1.1) brightness(.92);
}

html[data-theme="light"] .pageBg::after{
  background:radial-gradient(
    1200px 900px at 50% 42%,
    rgba(255,255,255,.06),
    rgba(0,0,0,.35) 72%,
    rgba(0,0,0,.65) 100%
  );
}


    .stage{
      height: 100dvh;
      display:flex;
      align-items:center;
      justify-content:center;
      padding: 18px 0; /* no tray padding; viewer height handles clearance */
    }

    .viewer{
      position:relative;
      aspect-ratio:2 / 3;
      height:min(calc(100dvh - 36px), 720px);
      min-height:320px;
      width:auto;
      max-width:min(92vw, 560px);
      border-radius:26px;
      border:1px solid var(--stroke);
      overflow:hidden;
      transition:filter .18s ease, opacity .18s ease, transform .18s ease;
    }

    .viewer > img{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      display:block;
      object-fit:var(--bgFit, cover);
      object-position:50% 50%;
    }

    .overlay{ position:absolute; inset:0; pointer-events:none; }
    .tile{ position:absolute; pointer-events:none; }
    .tileImg{
      position:absolute; inset:0;
      width:100%; height:100%;
      object-fit:cover;
      border-radius:18px;
      display:block;
    }

    /* ===== Tray ===== */
 .sheetModal{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom,0px));

  display: flex;
  justify-content: center;   /* keep centering tray */
  align-items: flex-end;

  pointer-events: none;
  z-index: 1000;
}

    .trayWrap{
      pointer-events:auto;
      position:relative;
      width:min(var(--trayW), calc(100vw - 24px));
      max-width:100%;
    }

    .trayWrap.trayCollapsed .sheet{
      display:none;
    }

    /* Buttons OUTSIDE the tray, docked to its top edge */
    .trayDock{
      position:absolute;
      right: 14px;
      top: -68px; /* sits above the tray */
      display:flex;
      gap:8px;
      padding:8px;
      border-radius:18px;
      border:1px solid var(--stroke);
      background: rgb(71, 73, 70);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      z-index: 1001;
    }

.sheet{
  width:100%;
  border:1px solid var(--stroke);
  border-radius:8px;

  background:var(--glass);

  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);

  overflow:hidden;
  display:flex;
  flex-direction:column;

  max-height:min(56dvh, 560px);

  box-shadow:
    0 12px 32px rgba(0,0,0,.22);
}
    .sheetTop{
      padding:12px 12px 10px;
      border-bottom: 1px solid var(--divider);
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:10px;
      background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
    }
.helpPageViews{
  display:none;
  align-items:center;
  gap:5px;
  white-space:nowrap;
}

.helpPill.open .helpPageViews{
  display:flex;
}

.helpPageViewsLabel{
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:.65;
}

#defaultPageViews{
  font-size:14px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}
    .amount {
  font-weight:950;
  font-size:1.05rem;
  letter-spacing:.01em;
  color: var(--muted);
}
    .meta{ font-size:.82rem; color:var(--muted); padding-top:4px; opacity:.9; }

    .sheetBody{
      padding:12px;
      flex:1;
      min-height:0;               /* ✅ required for flex scroll */
      overflow:auto;              /* ✅ tray scrolls here */
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      touch-action: pan-y;
      scrollbar-gutter: stable;
    }
    .styleNeutralGraph{
  position:relative;
  width:100%;
  height:34px;
  border-radius:999px;
  background:linear-gradient(
    90deg,
    #fff 0%,
    #808080 50%,
    #000 100%
  );
  border:1px solid rgba(127,127,127,.35);
  cursor:pointer;
  touch-action:none;
}

.styleNeutralVial{
  position:absolute;
  top:50%;
  left:50%;
  width:18px;
  height:18px;
  border:2px solid #fff;
  border-radius:999px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.5),
    0 2px 8px rgba(0,0,0,.3);
  transform:translate(-50%, -50%);
  pointer-events:none;
}
.pill,
.pillinner{
  color:var(--pill-text, var(--text));
}

.pillTop,
.pillTopinner,
.pillLeft,
.pillLeftinner,
.pill button{
  color:inherit;
}

    .pills{ display:grid; gap:6px; }
    .pill{
      display:flex; justify-content:space-between; align-items:center; gap:10px;
      padding:12px 12px;
      border-radius:16px;
      border:1px solid rgba(255,255,255,.12);
      background: var(--glass2);
      color: rgba(0, 0, 0, 0.895);
      text-decoration:none;
    }
    .pillIcon{
      width: var(--pillIconSize);
      height: var(--pillIconSize);
      flex: 0 0 var(--pillIconSize);
      display:block;
      object-fit: contain;
    }
    .pillLeft{ display:flex; flex-direction:column; gap:2px; min-width:0; }
    .pillTop{ font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; font-weight:900; color:var(--muted); }
    .pillBot{ font-size:.95rem; font-weight:900; opacity:.92; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:44ch; }
    .pillRight{ font-weight:900; opacity:.75; }

    /* Dock button styling (compact) */
    .iconBtn{
      width: 74px;
      height: 56px;
      display:flex;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      gap:6px;
      padding:8px 10px;
      border-radius:14px;
      border:1px solid rgba(255,255,255,.12);
      background: rgba(17,24,38,.55);
      color:#e8eef7;
      cursor:pointer;
      user-select:none;
      font: 700 12px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial;
    }
    .iconBtn:active{ transform: translateY(1px); }

    .iconBtn .iconPng{
      width:22px;
      height:22px;
      object-fit:contain;
      display:block;
      filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
    }
    .iconBtn .iconLbl{
      font-size:14px;
      opacity:.9;
      white-space:nowrap;
    }

    @media (max-width: 420px){
      .trayDock{ right: 10px; top: -52px; padding:6px; gap:6px; }
      .iconBtn{ width:68px; height:54px; padding:8px 8px; }
      .iconBtn .iconLbl{ font-size:10px; }
      .iconBtn .iconPng{ width:17px; height:17px; }
    }

    /* ===== Toast ===== */
    .toast{
      position:fixed;
      left:50%;
      bottom: calc(16px + env(safe-area-inset-bottom,0px));
      transform: translateX(-50%);
      background: rgba(10,12,16,.86);
      border: 1px solid rgba(255,255,255,.14);
      color: rgba(255,255,255,.92);
      padding: 10px 12px;
      border-radius: 999px;
      font-size: 16px;
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      z-index: 999950;
    }
    .toast.show{
      opacity: 1;
      transform: translateX(-50%) translateY(-4px);
    }
#headlineText {
  cursor: pointer;
  user-select: none;
}
.sheetMask{
  position:fixed;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:10px;

  background:rgba(89, 51, 105, 0.22);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);

  opacity:0;
  visibility:hidden;
  pointer-events:none;

  transition:opacity .28s ease, visibility .28s ease;
  z-index:999980;
}

.sheetMask.show{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.editSheet{
  width:min(520px, calc(100vw - 16px));
  max-height:min(78dvh, 620px);

  display:flex;
  flex-direction:column;
  overflow:hidden;

  border-radius:10px 10px 0 0;
  border:1px solid rgba(0,0,0,.10);
  border-bottom:0;

  background:rgba(200, 200, 200, 0.96);

  box-shadow:
    0 -8px 28px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.9);

  transform:translateY(70px);
  opacity:0;

  transition:
    transform .32s cubic-bezier(.16,1,.3,1),
    opacity .22s ease;
}

.sheetMask.show .editSheet{
  transform:translateY(0);
  opacity:1;
}
.sheetHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;

  padding:10px 12px 12px;
  position:sticky;
  top:0;
  z-index:5;

  background:rgba(167, 167, 167, 0.536);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);

  border-bottom:1px solid rgba(0,0,0,.08);
}

.sheetHeader::before{
  content:"";
  position:absolute;
  top:6px;
  left:50%;
  width:42px;
  height:5px;
  border-radius:999px;
  transform:translateX(-50%);
  background:rgba(0,0,0,.18);
}

.sheetHeader .t{
  padding-top:8px;
  font-weight:900;
  font-size:13px;
  letter-spacing:.02em;
  color:rgba(0,0,0,.78);
}

.sheetHeader .x{
  width:auto;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.08);
  color:rgba(0,0,0,.72);
  cursor:pointer;
  font-weight:900;
}.sheetHeader{
  position:sticky;
  top:0;
  z-index:5;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;

  min-height:44px;
  padding:7px 9px;

  background:rgba(255,255,255,.94);
  border-bottom:1px solid rgba(0,0,0,.08);
}

.sheetHeader::before{
  display:none;
}

.sheetHeader .t{
  padding:0;
  font-size:12px;
  font-weight:850;
  color:rgba(0,0,0,.76);
}

.sheetHeader .x{
  min-height:30px;
  padding:5px 9px;

  border-radius:6px;
  border:1px solid rgba(0,0,0,.08);

  background:rgba(0,0,0,.05);
  color:rgba(0,0,0,.72);

  font-size:12px;
  font-weight:800;
}

.sheetGrid{
  display:grid;
  gap:7px;

  flex:1;
  min-height:0;
  overflow:auto;
justify-content: space-around;
  padding:8px 10px 12px;

  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
}


.sheetGrid label{
  display:block;
  margin:7px 0 4px;

  font-size:16px;
  font-weight:800;
  line-height:1.15;

  color:rgba(0,0,0,.62);
}

.sheetGrid input,
.sheetGrid textarea,
.sheetGrid select{
  width:100%;
  min-height:38px;

  padding:8px 9px;

  border-radius:7px;
  border:1px solid rgba(0,0,0,.11);

  background:rgba(245,245,247,.96);
  color:rgba(0,0,0,.88);

  font:inherit;
  font-size:14px;
  outline:none;
}
.sheetGrid input:focus,
.sheetGrid textarea:focus,
.sheetGrid select:focus{
  border-color:color-mix(in srgb, var(--accent) 55%, rgba(0,0,0,.14));
  box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.sheetGrid textarea{
  min-height:72px;
  resize:vertical;
}

.sheetGrid .small{
  font-size:12px;
  color:rgba(0,0,0,.48);
  line-height:1.25;
  margin-top:6px;
}

.sheetGrid .divider{
  height:1px;
  background:rgba(0,0,0,.08);
  margin:12px 0;
}

.btnRow{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

.btnRow button{
  flex:1 1 200px;
  cursor:pointer;
  font-weight:900;
  min-height:44px;
  border-radius:14px;
  color:rgba(0,0,0,.84);
}

.primary{
  color:#fff;
  background:var(--accent);
  border-color:color-mix(in srgb, var(--accent) 80%, #000);
}

.danger{
  color:#c82727;
  background:rgba(255,60,60,.10);
  border-color:rgba(255,60,60,.24);
}

    /* ===== Avatar add button ===== */
    .addAvatarBtn{
      position:absolute;
      top: 32px;
      right: 12px;
      width: 122px;
      height: 52px;
      border-radius: 999px;
      border: 1px solid rgba(179, 139, 9, 0);
      background: rgba(125, 92, 255, 0);
      color: rgba(255,255,255,.92);
      font-weight: 950;
      font-size: 16px;
      display:grid;
      place-items:center;
      cursor:pointer;
      z-index: 50;
      pointer-events:auto;
    }
  .tileAvatar{
  pointer-events:auto;

  /*
    Tile wrapper controls location.
    Change only this value to resize the visible avatar.
  */
  --avatarImageScale: .78;
}

.tileAvatar .tileImg{
  inset:50%;
  width:100%;
  height:100%;

  border-radius:999px;
  object-fit:cover;

  transform:
    translate(-50%, -50%)
    scale(var(--avatarImageScale));

  transform-origin:center;
}
    /* ===== Crop modal (centered, never "lost") ===== */
    .cropModal{
      position:fixed;
      inset:0;
      z-index: 1000002;
      display:flex;
      align-items:center;
      justify-content:center;
      padding: 14px 14px calc(14px + env(safe-area-inset-bottom,0px));
    }
    .cropModal[hidden]{ display:none; }

    .cropBackdrop{
      position:absolute; inset:0;
      background: rgba(0,0,0,.55);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    .cropSheet{
      position:relative;
      width: min(92vw, 520px);
      max-height: calc(100dvh - 28px - env(safe-area-inset-bottom,0px));
      border-radius: 22px;
      background: rgba(17,24,38,.92);
      border: 1px solid rgba(255,255,255,.10);
      box-shadow: 0 30px 80px rgba(0,0,0,.55);
      overflow:hidden;
      display:flex;
      flex-direction:column;
    }

    .cropTop{
      display:flex;
      align-items:center;
      justify-content:space-between;
      padding: 12px 14px;
      border-bottom: 1px solid rgba(255,255,255,.08);
      flex: 0 0 auto;
    }
    .cropTitle{ font-weight: 850; color: rgba(255,255,255,.92); }
    .cropClose{
      width: 36px; height: 36px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.06);
      color: rgba(255,255,255,.9);
      cursor:pointer;
    }

    .cropStage{
      padding: 14px;
      flex: 1;
      min-height: 0;
      display:flex;
      align-items:center;
      justify-content:center;
    }
    .cropFrame{
      width: 100%;
      aspect-ratio: 1/1;
      border-radius: 18px;
      background: rgba(0,0,0,.25);
      border: 1px solid rgba(255,255,255,.10);
      overflow:hidden;
      position:relative;
      touch-action: none;
    }
    #cropImg{
      position:absolute;
      left:50%; top:50%;
      transform: translate(-50%,-50%) scale(1.12);
      transform-origin: center center;
      will-change: transform;
      user-select:none;
      -webkit-user-drag:none;
      max-width:none;
    }

    .cropControls{
      padding: 12px 14px 14px;
      border-top: 1px solid rgba(255,255,255,.08);
      flex: 0 0 auto;
    }
    .cropZoomRow{
      display:flex;
      align-items:center;
      gap: 12px;
      color: rgba(232,238,247,.78);
      font-weight: 750;
    }
    #cropZoom{ width: 100%; }

    .cropBtns{
      display:flex;
      gap: 10px;
      margin-top: 12px;
    }
    .btnGhost, .btnSolid{
      flex:1;
      height: 44px;
      border-radius: 14px;
      font-weight: 850;
      cursor:pointer;
    }
    .btnGhost{
      border: 1px solid rgba(255,255,255,.12);
      background: rgba(255,255,255,.06);
      color: rgba(255,255,255,.88);
    }
    .btnSolid{
      border: 1px solid rgba(80,255,159,.40);
      background: rgba(80,255,159,.26);
      color: rgba(232,255,245,.95);
    }

    .addBgBtn{
  position:absolute;
  top: 29px;
  left: 12px;

  width: 122px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(179, 139, 9, 0);
  background: rgba(125, 92, 255, 0);
  color: rgba(255,255,255,.92);
  font-weight: 950;
  font-size: 16px;
  display:grid;
  place-items:center;
  cursor:pointer;
  z-index: 50;
  pointer-events:auto;
}

/* ===== Build blur state (safe) ===== */
html.is-building .viewer{
  filter: blur(6px) saturate(.95);
  opacity: .88;
  transform: scale(.995);
  pointer-events: none;
  transition: filter .18s ease, opacity .18s ease, transform .18s ease;
}

/* Never let build state affect modals / overlays */
html.is-building .cropModal,
html.is-building .sheetMask,
html.is-building .styleDock,
html.is-building .toast{
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto;
}
/* --- HELP overlay image --- */
.helpImg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;            /* match your main img behavior */
  z-index:4;                   /* above bg, below buttons/tray */
  opacity:0;
  pointer-events:none;         /* do not block the UI */
  transition:opacity .18s ease;
}
.viewer.showHelp .helpImg{ opacity:1; }

/* --- HELP pill (floats OUTSIDE the card preview) --- */
.helpPill{
  position: fixed;           /* positioned by JS to sit on viewer top-right */
  z-index: 999910;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(138, 43, 193, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  transform: translateX(-100%); /* anchor to right edge (we set left in JS) */
  transition: padding .18s ease, transform .18s ease, opacity .18s ease;
}

/* little tap target for the icon */
.helpToggle{
  width: 38px;
  height: 38px;

  border-radius: 999px;

  border: 1px solid rgba(255,255,255,.18);

  /* richer glass core */
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255,255,255,.22),
    rgba(255,255,255,.08) 60%,
    rgba(0,0,0,.25)
  );

  color: rgba(255,255,255,.95);
  font-weight: 900;
  font-size: 16px;
  line-height: 1;

  display: grid;
  place-items: center;

  cursor: pointer;
  user-select: none;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 10px 30px rgba(0,0,0,.4),
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.25);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease;
}

/* soft glow ring */
.helpToggle::before{
  content:"";
  position:absolute;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(120,180,255,.35),
    transparent 60%
  );
  opacity:0;
  transform: scale(.8);
  transition: opacity .2s ease, transform .2s ease;
}

/* hover = “UI wakes up” effect */
.helpToggle:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.3);
  box-shadow:
    0 14px 45px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.22);
}

.helpToggle:hover::before{
  opacity:1;
  transform: scale(1);
}

/* pressed state */
.helpToggle:active{
  transform: scale(.96);
}

.helpMoreBtn{
  height: 38px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.10);
  color:#fff;
  font-weight: 900;
  padding: 0 14px;
  cursor:pointer;
  user-select:none;

  /* collapsed by default */
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events:none;
  transition: max-width .18s ease, opacity .18s ease, padding .18s ease;
  padding-left:0;
  padding-right:0;
}

.helpPill.open .helpMoreBtn{
  max-width: 120px;
  opacity: 1;
  pointer-events:auto;
  padding-left:14px;
  padding-right:14px;
}

/* overlay image: visible when pill is open */


/* --- HELP modal --- */
.helpModal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:flex-end;
  justify-content:center;
  background:rgba(0,0,0,.55);
}
.helpModal.open{ display:flex; }

.helpCard{
  width:min(720px, 100%);
  border-radius:18px 18px 0 0;
  background:rgba(16,16,18,.98);
  color:#fff;
  padding:14px 14px 18px;
  box-shadow:0 -20px 50px rgba(0,0,0,.5);
}

.helpHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:4px 2px 10px;
}
.helpMyPageBtn{
  position: relative;
  height: 38px;
  padding: 0 16px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);

  /* richer glass */
  background: linear-gradient(
    135deg,
    rgba(255,255,255,.14),
    rgba(255,255,255,.06)
  );

  color: rgba(255,255,255,.92);
  font-weight: 800;
  letter-spacing: .2px;

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 10px 30px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.12);

  cursor: pointer;
  user-select: none;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease;
}

/* subtle highlight sweep */
.helpMyPageBtn::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,.18) 40%,
    transparent 60%
  );
  opacity:0;
  transform: translateX(-30%);
  transition: opacity .25s ease, transform .6s ease;
}

/* hover = premium lift */
.helpMyPageBtn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.26);
  box-shadow:
    0 14px 40px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.16);
}

.helpMyPageBtn:hover::before{
  opacity:1;
  transform: translateX(30%);
}

/* click feel */
.helpMyPageBtn:active{
  transform: translateY(0px) scale(.98);
}
.helpTitle{ font-size:16px; font-weight:800; }

.helpClose{
  border:0;
  border-radius:999px;
  padding:8px 10px;
  background:rgba(255,255,255,.08);
  color:#fff;
}

.helpSection{ padding:10px 2px; border-top:1px solid rgba(255,255,255,.08); }
.helpH{ font-weight:800; margin-bottom:6px; }
.helpP{ opacity:.92; line-height:1.35; }
.helpList{ margin:6px 0 0 18px; opacity:.92; }
.hideWhileSheet{ display:none !important; }

.toast--anchored{
  position: fixed;
  z-index: 9999;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.2;
  background: rgba(0,0,0,.78);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast--anchored.show{
  opacity: 1;
  transform: translateY(0);
}
/*build steps*/
.tutorialGlow {
  position: relative;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.85),
    0 0 18px rgba(0, 122, 255, 0.45);
  animation: tutorialPulse 1.8s ease-in-out infinite;
}

.tutorialGlow::after {
  content: attr(data-tutorial-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.88);
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 10001;
}

@keyframes tutorialPulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.75),
      0 0 14px rgba(0, 122, 255, 0.35);
  }

  50% {
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.95),
      0 0 24px rgba(0, 122, 255, 0.62);
  }
}
.bgCatalogTab{
  position:absolute;
  top:78px;
  left:14px;
  z-index:50;
  width:40px;
  height:40px;
  border-radius:12px;
  border:0;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
}

.bgCatalogTab img{
  width:18px;
  opacity:.9;
}

.bgCatalogPanel{
  position:absolute;
  top:124px; /* was 60px; now sits under the tab (78 + 40 + ~6) */
  left:14px;
  width:120px;
  padding:10px;
  border-radius:16px;
  background:rgba(0,0,0,.6);
  backdrop-filter:blur(12px);
  z-index:9999999;
  animation:fadeIn .18s ease;

  /* NEW: scroll */
  max-height: min(52vh, 360px);
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.28) rgba(255,255,255,.08);
}

/* ===== Scrollbar styling (panel only) ===== */

/* Chrome / Edge / Safari */
.bgCatalogPanel::-webkit-scrollbar{
  width:10px;
}
.bgCatalogPanel, .bgGrid{
  overscroll-behavior: contain;
  touch-action: pan-y; /* tells browser this area is for vertical scroll */
}

.bgCatalogPanel::-webkit-scrollbar-track{
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

.bgCatalogPanel::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.22);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.35); /* gives it that “floating pill” look */
}

.bgCatalogPanel::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.34);
}

.bgGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.bgGrid img{
  width:100%;
  aspect-ratio:9/16;
  object-fit:cover;
  border-radius:10px;
  cursor:pointer;
  opacity:.85;
  transition:.15s ease;
}

.bgGrid img:hover{
  opacity:1;
  transform:scale(1.03);
}

@keyframes fadeIn{
  from{opacity:0; transform:translateY(-6px);}
  to{opacity:1; transform:translateY(0);}
}
.helpTool{
  display:flex;
  gap:10px;
  align-items:center;
  cursor:pointer;
}

.helpTool:hover{
  opacity:.85;
}

.helpIcon{
  width:22px;
  height:22px;
  object-fit:contain;
}
.avatarClear {
  position: absolute;
  top: 12%;
  right: 12%;

  width: 24px;
  height: 24px;
  padding: 0;

  border: none;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  line-height: 1;

  background: rgba(232, 13, 27, 0.65);
  color: white;

  cursor: pointer;

  z-index: 10;
}
.pillMenu .moveRow {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.pillMenu .upBtn,
.pillMenu .downBtn {
  width: 34px;
  height: 34px;
  min-width: 24px;
  padding: 0;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.pillMenu .openBtn,
.pillMenu .deleteBtn{
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;

  border: 0;
  border-radius: 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
}

.pillMenu .openBtn{
  background: rgba(255,255,255,.16);
  color: #fff;
}

.pillMenu .openBtn:hover{
  background: rgba(255,255,255,.24);
}

.pillMenu .deleteBtn{
  background: rgba(255,59,48,.14);
  color: #ff453a;
}

.pillMenu .deleteBtn:hover{
  background: rgba(255,59,48,.22);
}

.pillMenu .divider{
  width: 100%;
  height: 1px;
  margin: 6px 0;
  background: rgba(255,255,255,.14);
}
.trayToggleBtn {
  position: absolute;
  left: -18px;
  top: 10px;

  width: 22px;
  height: 34px;
  padding: 0;

  border: 1px solid rgba(255,255,255,.22);
  border-right: 0;
  border-radius: 10px 0 0 10px;

  background: rgba(20,20,24,.82);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 10;
}

#trayToggleIcon {
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.trayToggleBtn .iconLbl {
  display: none;
}
.styleDock{
  position:fixed;
  top:8%;
  right:2%;
  z-index:10001;

  width:18%;
  max-width:90%;
  padding:.7%;

  box-sizing:border-box;
  overflow:visible;

  border:.08rem solid rgba(255,255,255,.14);
  border-radius:.8rem;

  background:rgba(12,14,18,.92);

  -webkit-backdrop-filter:blur(.8rem);
  backdrop-filter:blur(.8rem);

  box-shadow:
    0 .7rem 2rem rgba(0,0,0,.32),
    inset 0 .04rem 0 rgba(255,255,255,.06);

  color:#fff;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  opacity:0;
  visibility:hidden;
  pointer-events:none;

  transform:translateY(-3%) scale(.98);
  -webkit-transform:translateY(-3%) scale(.98);

  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility .18s ease;

  -webkit-transition:
    opacity .18s ease,
    -webkit-transform .18s ease,
    visibility .18s ease;

  isolation:isolate;
}

.styleDock.show{
  opacity:1;
  visibility:visible;
  pointer-events:auto;

  transform:translateY(0) scale(1);
  -webkit-transform:translateY(0) scale(1);
}

.styleDockHead{
  position:relative;
  z-index:20;

  display:flex;
  align-items:center;
  justify-content:space-between;

  width:100%;
  gap:4%;

  margin:0 0 2%;
  padding:0 0 3%;

  box-sizing:border-box;
  border-bottom:.08rem solid rgba(255,255,255,.1);
}

.styleDockTitle{
  flex:1;
  min-width:0;

  font-size:.72rem;
  line-height:1;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.styleClose{
  position:relative;
  z-index:30;

  flex:0 0 13%;
  width:13%;
  aspect-ratio:1 / 1;
  padding:0;

  display:flex;
  align-items:center;
  justify-content:center;

  border:.08rem solid rgba(255,255,255,.14);
  border-radius:28%;

  background:rgba(255,255,255,.1);
  color:inherit;

  font:inherit;
  font-size:1rem;
  font-weight:700;
  line-height:1;

  cursor:pointer;

  appearance:none;
  -webkit-appearance:none;

  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;

  pointer-events:auto;
  user-select:none;
  -webkit-user-select:none;
}

.styleClose:hover{
  background:rgba(255,255,255,.16);
}

.styleClose:active{
  transform:scale(.92);
  -webkit-transform:scale(.92);
}

.styleRow{
  width:100%;
  min-height:2.2rem;

  display:grid;
  grid-template-columns:minmax(0, 1fr) 43%;
  align-items:center;
  gap:5%;

  padding:1.5% 0;

  box-sizing:border-box;
}

.styleLabel{
  min-width:0;

  color:rgba(255,255,255,.78);

  font-size:.62rem;
  line-height:1.1;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.styleHr{
  width:100%;
  height:.06rem;

  margin:2% 0;

  border:0;
  background:rgba(255,255,255,.1);
}

.styleDock input[type="color"]{
  justify-self:end;

  width:32%;
  aspect-ratio:1.25 / 1;
  padding:1.5%;

  box-sizing:border-box;

  border:.08rem solid rgba(255,255,255,.16);
  border-radius:24%;

  background:rgba(255,255,255,.06);

  cursor:pointer;

  appearance:none;
  -webkit-appearance:none;
}

.styleDock input[type="color"]::-webkit-color-swatch-wrapper{
  padding:0;
}

.styleDock input[type="color"]::-webkit-color-swatch{
  border:0;
  border-radius:18%;
}

.styleDock input[type="color"]::-moz-color-swatch{
  border:0;
  border-radius:18%;
}

.styleDock input[type="range"]{
  justify-self:end;

  width:100%;
  height:.24rem;
  margin:0;
  padding:0;

  border:0;
  border-radius:999rem;
  background:transparent;

  cursor:pointer;

  appearance:none;
  -webkit-appearance:none;
}

.styleDock input[type="range"]::-webkit-slider-runnable-track{
  width:100%;
  height:.24rem;

  border-radius:999rem;
  background:rgba(255,255,255,.2);
}

.styleDock input[type="range"]::-webkit-slider-thumb{
  width:.85rem;
  height:.85rem;
  margin-top:-.3rem;

  border:.1rem solid #111;
  border-radius:50%;

  background:#fff;
  box-shadow:0 .1rem .35rem rgba(0,0,0,.35);

  appearance:none;
  -webkit-appearance:none;
}

.styleDock input[type="range"]::-moz-range-track{
  width:100%;
  height:.24rem;

  border:0;
  border-radius:999rem;

  background:rgba(255,255,255,.2);
}

.styleDock input[type="range"]::-moz-range-thumb{
  width:.85rem;
  height:.85rem;

  border:.1rem solid #111;
  border-radius:50%;

  background:#fff;
  box-shadow:0 .1rem .35rem rgba(0,0,0,.35);
}

.styleDock select{
  justify-self:end;

  width:100%;
  min-height:1.7rem;
  padding:0 14% 0 8%;

  box-sizing:border-box;

  border:.08rem solid rgba(255,255,255,.14);
  border-radius:.45rem;

  background-color:rgba(255,255,255,.08);
  color:#fff;

  font:inherit;
  font-size:.65rem;
  font-weight:700;
  text-transform:capitalize;

  cursor:pointer;
  outline:0;

  appearance:none;
  -webkit-appearance:none;
}

.styleDock select option{
  background:#12141c;
  color:#fff;
}

.styleDock button:focus-visible,
.styleDock input:focus-visible,
.styleDock select:focus-visible{
  outline:.1rem solid rgba(255,255,255,.9);
  outline-offset:.1rem;
}

@media (max-width:48rem){
  .styleDock{
    top:9%;
    right:3%;

    width:54%;
    max-width:82%;
    padding:2%;

    border-radius:.75rem;
  }

  .styleDockHead{
    margin-bottom:1%;
    padding-bottom:3%;
  }

  .styleDockTitle{
    font-size:.68rem;
  }

  .styleClose{
    flex-basis:12%;
    width:12%;
  }

  .styleRow{
    min-height:2rem;
    grid-template-columns:minmax(0, 1fr) 44%;
    gap:4%;
    padding:1.5% 0;
  }

  .styleLabel{
    font-size:.58rem;
  }

  .styleDock input[type="color"]{
    width:30%;
  }

  .styleDock select{
    min-height:1.65rem;
  }
}