/* ===== Theme tokens ===== */
:root{
  --ink:#0e1116;
  --panel:#11151c;
  --muted:#2a2f3a;
  --line:#222734;
  --accent:#50e3a4;
  --accent2:#67b3ff;
  --danger:#ff6b6b;
  --warn:#ffd166;
  --ok:#95f985;
  --text:#e6edf3;
  --sub:#a8b3bd;
  --ghost:#7a8591;
  --chip:#1b2230;
  --chip2:#273044;
  --dock-width:300px;
  --appbar-height:60px;
}

html,body{height:100%;margin:0}
body{
  display:grid;grid-template-rows:auto 1fr;
  min-height:100dvh;
  background:linear-gradient(180deg,#0b1017,#0e131b 40%,#0b1119);
  color:var(--text);
  font:14px/1.2 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

body.cart-open{overflow:hidden;}

/* ===== Header ===== */
header{
  display:flex;gap:.75rem;align-items:center;
  padding:.6rem .8rem;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#0f141d,#0c1119);
}
header h1{font-size:14px;margin:0;letter-spacing:.4px;color:var(--sub);font-weight:600}
.badge{font-size:12px;background:var(--chip2);color:var(--accent2);padding:.15rem .45rem;border:1px solid #2c3a53;border-radius:999px}

/* Mobile header optimizations */
@media (max-width:760px){
  header{
    padding:.5rem .6rem;
    gap:.5rem;
  }
  .appbar .brand{
    font-size:16px;
    gap:.5rem;
  }
  .badge{
    font-size:11px;
    padding:.12rem .4rem;
  }
}

@media (max-width:520px){
  header{
    padding:.45rem .5rem;
    gap:.4rem;
  }
  .appbar .brand{
    font-size:15px;
  }
  .appbar .btn,
  #exportstl{
    padding:.38rem .5rem;
    font-size:12px;
  }
}

/* ===== Two-column layout ===== */
.row{
  display:grid;
  grid-template-columns:var(--dock-width) 1fr;
  gap:0;
  /* let the content flow under whatever header height we have */
  min-height:0;
}
/* Make the dock column able to shrink and its content scroll on tablets */
aside{
  border-right:1px solid var(--line);
  background:radial-gradient(1200px 400px at -400px -200px,#131b28,transparent),linear-gradient(180deg,#0f141d,#0c1118);
  display:flex;               /* allow a flex child (#dock) to fill & scroll */
  flex-direction:column;
  min-height:0;               /* critical so inner overflow works */
}
main{position:relative}

/* ===== Left dock ===== */
#dock{
  display:flex;flex-direction:column;
  /* replaced rigid 100% height with flexible, scrollable container */
  flex:1 1 auto;
  height:auto;
  min-height:0;               /* let it shrink inside grid/flex parents */
  overflow-y:auto;            /* scroll when panels exceed viewport */
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;       /* hide scrollbar in Firefox */
  -ms-overflow-style:none;    /* hide scrollbar in legacy Edge */
  padding-bottom:env(safe-area-inset-bottom,12px);
}
#dock::-webkit-scrollbar{display:none}

body.drag-scroll-active{user-select:none}

#dock.drag-scroll-active{cursor:grabbing}
.panel{padding:.8rem;border-bottom:1px solid var(--line)}
.panel h3{margin:.2rem 0 .6rem;font-size:12px;color:#8b99aa;letter-spacing:.4px;text-transform:uppercase}

/* Buttons / chips / helpers */
button,.btn{
  background:#162030;border:1px solid #223145;color:#cfe4ff;
  padding:.4rem .6rem;border-radius:.5rem;cursor:pointer;font-size:13px;display:inline-block;text-align:center
}
.btn.primary,button.primary{
  background:linear-gradient(180deg,#3ba980,#2c7d93);
  border-color:#45cba0;
  color:#041116;
  font-weight:600;
  box-shadow:0 10px 24px rgba(27,202,150,.22);
}
.btn.ghost{
  background:rgba(22,32,48,.35);
  border-color:#2b3952;
  color:#bbcee9;
}
.btn.ghost:hover{border-color:#3c5279;background:rgba(30,44,70,.45);}
.btn.emphasis{
  background:linear-gradient(180deg,#355a9c,#27487d);
  border-color:#3f6bbd;
  color:#f2f6ff;
  font-weight:600;
  box-shadow:0 14px 28px rgba(54,104,193,.28);
}
.btn-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-right:.35rem;
  font-size:15px;
}
.btn-icon + .btn-label{display:inline-block;}
.dock-toggle{display:none}
.dock-close{display:none}
.btn{ display:inline-flex; align-items:center; margin:0; position:relative; }
.btn[hidden],button[hidden]{display:none!important;}

/* --- UPDATED: Smooth Racing Orange Trail Animation --- */
@keyframes rotate-trail {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn-pulse-orange {
  position: relative;
  overflow: hidden;          /* Clips the spinning gradient outside the button */
  border-color: transparent !important; /* Hide actual border so gradient shows */
  background: #162030;       /* Fallback background */
  z-index: 1;                /* Create stacking context */
  transition: transform 0.2s ease;
}

/* The Trail (Spinning Gradient) */
.btn-pulse-orange::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  /* Massive size ensures corners are covered even on wide buttons */
  width: 150vmax;
  height: 150vmax;
  /*
     The Effect:
     1. Tail starts fading in at 50% (180deg behind head) for a long, smooth streak.
     2. Ramps to bright orange, then White hot at the front (100%).
  */
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    transparent 50%,
    rgba(255, 153, 0, 0.2) 65%,
    rgba(255, 153, 0, 0.9) 95%,
    #ffffff 100%
  );
  /* Center and spin */
  transform: translate(-50%, -50%);
  /* 1s is fast enough to hide the speed difference between corners and straight edges */
  animation: rotate-trail 1s linear infinite;
  will-change: transform;
  z-index: -2;
}

/* The Mask (Inner button color) */
.btn-pulse-orange::after {
  content: '';
  position: absolute;
  /* inset defines border thickness. Increased to 2px for better visibility on corners */
  inset: 2px;
  background: #162030; /* Match your theme's button background color */
  border-radius: inherit;
  z-index: -1;
}

/* Ensure text/icon sits on top of the animation effects */
.btn-pulse-orange .btn-icon,
.btn-pulse-orange .btn-label {
  position: relative;
  z-index: 2;
}

/* Shiny sweep animation for buttons */
.btn--pulse {
  position: relative;
  overflow: hidden;
}
.btn--pulse::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.2);
  transform: translateX(-100%);
  animation: shine 3s infinite;
}
@keyframes shine {
  20% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

button:hover,.btn:hover{border-color:#2f4a71}
button[data-kind=danger]{border-color:#704040;color:#ff7f7f}
.help{font-size:12px;color:#7f8b98;margin-top:.4rem}
.kbd{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:#141b26;border:1px solid #263247;padding:.1rem .25rem;border-radius:.3rem;color:#a8c6ff}
.chip{display:inline-flex;align-items:center;gap:.35rem;background:var(--chip);border:1px solid #273142;border-radius:999px;padding:.1rem .5rem;color:#aab8cc;font-size:12px}
.sep{height:1px;background:#222a3a;margin:.5rem 0}
.switch{display:inline-flex;gap:.5rem;align-items:center;border:1px solid #223145;background:#162030;color:#cfe4ff;padding:.3rem .6rem;border-radius:.5rem}
.switch input{accent-color:var(--accent)}

/* Inputs */
label{display:block;color:#a1adba;font-size:12px;margin:.4rem 0 .2rem}
input[type=text],input[type=number],input[type=search],select{
  width:100%;box-sizing:border-box;background:#111826;border:1px solid #263247;color:#d7e3ee;
  border-radius:.4rem;padding:.38rem .5rem;font-size:13px
}
.style-callout{
  position:relative;
  margin:0 0 .95rem;
  padding:.9rem .95rem;
  background:linear-gradient(180deg,#101828,#0c121d);
  border:1px solid rgba(103,179,255,.45);
  border-radius:.9rem;
  box-shadow:0 14px 32px rgba(4,9,18,.55),inset 0 1px 0 rgba(255,255,255,.04);
  overflow:hidden;
}
.style-callout::before{
  content:'';
  position:absolute;
  inset:-1px;
  pointer-events:none;
  background:
    radial-gradient(240px 140px at 18% 0%,rgba(103,179,255,.18),transparent 60%),
    radial-gradient(220px 160px at 88% 20%,rgba(80,227,164,.14),transparent 62%);
  opacity:.85;
}
.style-callout > *{position:relative;z-index:1;}
.style-callout__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  margin-bottom:.35rem;
}
.style-callout__eyebrow{
  font-size:11px;
  letter-spacing:.5px;
  text-transform:uppercase;
  color:#9fb2cd;
}
.style-callout__badge{
  font-size:11px;
  color:var(--accent);
  background:rgba(80,227,164,.14);
  border:1px solid rgba(80,227,164,.42);
  padding:.18rem .55rem;
  border-radius:999px;
  white-space:nowrap;
}
.style-callout__label{
  display:block;
  color:#dce7f5;
  font-weight:600;
  font-size:13px;
  margin:.2rem 0 .25rem;
}
.style-callout__label-sub{
  display:block;
  color:#9ab2cf;
  font-size:12px;
  font-weight:500;
  margin-top:.1rem;
}
.style-callout__select{
  margin-top:.15rem;
  border-color:#3c4f6a;
  background:#0d1624;
  color:#e6edf3;
  box-shadow:0 6px 18px rgba(2,6,14,.4);
  font-weight:600;
}
.style-callout__select option{
  background:#0d1624;
  color:#e6edf3;
}
.style-callout__select:focus{
  outline:2px solid var(--accent2);
  box-shadow:0 0 0 2px rgba(103,179,255,.35),0 8px 20px rgba(8,19,35,.65);
}
.style-callout__hint{
  color:#90a4bd;
  font-size:12px;
  margin:.45rem 0 0;
  line-height:1.45;
}
input[type=range]{width:100%}
.hidden-file{position:fixed;left:-9999px;top:auto;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}

/* ===== Viewport area ===== */
#viewer{position:absolute;inset:0;background:#0a0f16}
#viewer > canvas#viewport{position:absolute;inset:0;display:block}

/* Non-interactive overlay strip (optional; empty by default) */
#overlay{
  position:absolute;left:0;top:0;right:0;
  pointer-events:none;
  padding:.6rem;
  display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;
}
#overlay .chip{backdrop-filter:blur(6px);background:rgba(21,29,44,.72);border-color:#2c3751}

.design-save-hud{
  position:absolute;
  top:clamp(8px,1.8vw,14px);
  left:clamp(8px,1.8vw,14px);
  display:grid;
  grid-template-columns:1fr auto auto;
  grid-auto-rows:auto;
  align-items:center;
  gap:clamp(4px,1vw,10px);
  padding:clamp(6px,1.2vw,10px) clamp(10px,1.6vw,16px);
  background:rgba(12,17,26,.78);
  backdrop-filter:blur(14px) saturate(1.1);
  border:1px solid rgba(82,118,168,.45);
  border-radius:12px;
  box-shadow:0 12px 28px rgba(2,6,14,.5);
  max-width:min(94vw,360px);
  z-index:40;
  pointer-events:auto;
}
@media (max-width:760px){
  .design-save-hud{
    top:8px;
    left:8px;
    padding:8px 12px;
    gap:6px;
    max-width:calc(100vw - 16px - 60px);
  }
  .design-save-hud input{
    font-size:12px;
    padding:.3rem .5rem;
  }
}
@media (max-width:520px){
  .design-save-hud{
    top:6px;
    left:6px;
    padding:6px 10px;
    gap:5px;
    border-radius:10px;
  }
  .design-save-hud input{
    font-size:11px;
    padding:.28rem .45rem;
  }
  #designSaveButton,
  #designShareButton{
    width:28px;
    height:28px;
    min-width:28px;
  }
}
.design-save-hud[data-state="saved"]{
  border-color:rgba(69,203,160,.55);
  box-shadow:0 14px 32px rgba(27,202,150,.18);
}
.design-save-hud input{
  flex:1 1 auto;
  min-width:0;
  background:rgba(15,23,37,.92);
  color:#e8f1ff;
  border:1px solid rgba(74,108,160,.55);
  border-radius:10px;
  padding:.35rem .55rem;
  font-size:12.75px;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.design-save-hud input::placeholder{color:rgba(180,198,222,.6);}
.design-save-hud input:hover{border-color:rgba(102,146,210,.7);background:rgba(17,26,40,.95);}
.design-save-hud input:focus-visible{
  outline:2px solid rgba(102,173,255,.65);
  outline-offset:2px;
  border-color:rgba(110,170,255,.95);
  box-shadow:0 0 0 2px rgba(80,140,220,.25);
  background:rgba(18,28,46,.98);
}
.artwork-persist-alert{
  margin:8px 0 0;
  padding:.65rem .85rem;
  border-radius:12px;
  border:1px solid rgba(255,136,154,.45);
  background:rgba(255,136,154,.15);
  color:#ffe2e7;
  font-size:.9rem;
  line-height:1.35;
  display:flex;
  flex-direction:column;
  gap:.25rem;
}
.artwork-persist-alert[hidden]{display:none;}
.artwork-persist-alert__title{font-weight:600;font-size:.95rem;}
.artwork-persist-alert__body{margin:0;color:#ffe2e7;opacity:.9;font-size:.85rem;}
.design-overwrite-confirm{
  margin:8px 0 0;
  padding:.75rem .95rem;
  border-radius:14px;
  border:1px solid rgba(128,167,255,.4);
  background:rgba(61,93,145,.25);
  color:#e7eeff;
  display:flex;
  flex-direction:column;
  gap:.4rem;
}
.design-overwrite-confirm[hidden]{display:none;}
.design-overwrite-confirm__title{font-weight:600;font-size:.95rem;}
.design-overwrite-confirm__body{margin:0;font-size:.85rem;color:rgba(231,238,255,.9);}
.design-overwrite-confirm{grid-column:1 / -1; margin-left:1px; margin-right:1px;}
.design-overwrite-confirm__actions{display:flex;gap:.4rem;flex-wrap:wrap;}
.design-overwrite-confirm__actions .btn{flex:0 0 auto;}
.design-save-hud.design-save-hud--confirm{
  box-shadow:0 16px 32px rgba(2,6,14,.65);
}
#designSaveButton,
#designShareButton{
  width:32px;
  height:32px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:0;
  border:1px solid rgba(82,118,168,.55);
  background:rgba(17,26,42,.9);
  color:#cfe4ff;
  font-size:16px;
  transition:background .2s ease,border-color .2s ease,transform .2s ease,box-shadow .2s ease;
  cursor:pointer;
}
#designSaveButton .design-save-button-icon,
#designShareButton .design-share-button-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:1.2em;
  height:1.2em;
  line-height:1;
}

#designShareButton[data-state="success"]{
  border-color:rgba(69,203,160,.75);
  color:#c8ffe9;
}
#designShareButton[data-state="error"]{
  border-color:rgba(203,96,96,.75);
  color:#ffc4c4;
}
#designShareButton[data-state="loading"] .design-share-button-icon{
  animation:design-save-spin 1s linear infinite;
}

#designShareButton .design-share-button-icon svg{
  width:18px;
  height:18px;
  filter:drop-shadow(0 0 4px rgba(0,255,153,.45));
}
#printedControlsDesktopSlot{
  display:flex;
  margin-right:auto;
}

#printedControlsDesktopSlot[data-printed-empty="true"]{
  display:none;
}

.printed-controls{
  display:flex;
  align-items:center;
  gap:.55rem;
  margin-right:auto;
  pointer-events:auto;
  padding:.45rem .6rem;
  border-radius:.75rem;
  border:1px solid rgba(56,72,98,.65);
  background:linear-gradient(135deg, rgba(17,24,38,.88), rgba(20,33,53,.78));
  box-shadow:0 18px 36px rgba(12,18,30,.36);
  backdrop-filter:blur(6px);
  max-width:100%;
  overflow:visible;
}
.printed-controls__price{
  display:flex;
  align-items:center;
  gap:.4rem;
  min-width:0;
}
.printed-price{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:0;
  min-width:0;
  position:relative;
  overflow:visible;
}
.printed-price__chip{
  display:inline-flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  padding:.32rem .75rem;
  border-radius:999px;
  background:linear-gradient(135deg, rgba(28,42,63,.95), rgba(32,48,70,.88));
  border:1px solid rgba(58,88,132,.8);
  color:#f3f6ff;
  font-size:13px;
  font-weight:600;
  letter-spacing:.01em;
  transition:background .22s ease,border-color .22s ease,box-shadow .22s ease,color .22s ease,transform .18s ease,border-radius .18s ease,padding .24s ease;
  position:relative;
  z-index:2;
  overflow:visible;
}
.printed-price__chip:focus-visible{
  outline:none;
}
.printed-price__chip:disabled{
  opacity:.55;
  cursor:default;
  box-shadow:none;
}
.printed-price__summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.45rem;
  width:100%;
}
.printed-price__value{
  display:flex;
  align-items:center;
  gap:.25rem;
  white-space:nowrap;
  flex:1;
}
.printed-price__arrow{
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:6px solid rgba(255,153,0,.9);
  transition:transform .22s ease;
}
.printed-price--expandable .printed-price__chip{
  cursor:pointer;
}
.printed-price--expandable .printed-price__chip:not(:disabled):hover,
.printed-price--expandable .printed-price__chip:not(:disabled):focus-visible,
.printed-price.is-expanded .printed-price__chip{
  border-color:rgba(255,153,0,.85);
  background:linear-gradient(135deg, rgba(32,46,68,.98), rgba(36,56,84,.9));
  color:#fff7ec;
  border-bottom-left-radius:0;
  border-bottom-right-radius:0;
  border-bottom-width:0;
  padding-bottom:.5rem;
}
.printed-price.is-expanded .printed-price__arrow{
  transform:rotate(180deg);
}
.printed-price__breakdown{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.65rem;
  font-size:12px;
  letter-spacing:.01em;
  line-height:1.2;
  opacity:0;
  transform:translateY(-8px);
  transition:opacity .22s ease,transform .24s ease,padding .24s ease,border-color .24s ease,gap .24s ease;
  pointer-events:none;
  padding:0;
  margin:0;
  align-self:stretch;
  border-top:0;
  position:absolute;
  left:0;
  right:0;
  top:100%;
  z-index:1;
  border-radius:0 0 .95rem .95rem;
}
.printed-price__breakdown::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:0;
  bottom:0;
  background:linear-gradient(135deg, rgba(26,40,60,.95), rgba(30,46,68,.9));
  box-shadow:0 16px 34px rgba(4,9,16,.5);
  opacity:0;
  transition:opacity .22s ease;
  pointer-events:none;
  z-index:-2;
  border-radius:inherit;
}
.printed-price__breakdown::after{
  content:"";
  position:absolute;
  left:-1px;
  right:-1px;
  top:-1px;
  bottom:-1px;
  border:1px solid rgba(255,153,0,.7);
  border-top:0;
  border-top-left-radius:0;
  border-top-right-radius:0;
  border-bottom-left-radius:.85rem;
  border-bottom-right-radius:.85rem;
  opacity:0;
  transition:opacity .22s ease,border-color .24s ease;
  pointer-events:none;
  z-index:-1;
}
.printed-price.is-expanded{
  z-index:20;
}
.printed-price.is-expanded .printed-price__breakdown{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
  padding:.75rem .95rem .55rem;
  gap:.75rem;
}
.printed-price.is-expanded .printed-price__breakdown::before{
  opacity:1;
}
.printed-price.is-expanded .printed-price__breakdown::after{
  opacity:1;
  border-color:rgba(255,153,0,.85);
}
.printed-price__breakdown-title{
  display:block;
  font-size:10.75px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:rgba(157,184,223,.7);
}
.printed-price__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
  padding:.4rem 0;
  border-bottom:1px solid rgba(255,213,154,.16);
}
.printed-price__row:last-of-type{
  border-bottom:0;
  padding-bottom:0;
}
.printed-price__row-heading{
  display:flex;
  flex-direction:column;
  gap:.15rem;
  min-width:0;
  flex:1;
  align-items:flex-start;
  text-align:left;
}
.printed-price__row-value{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.12rem;
  min-width:0;
  flex:0 0 auto;
  text-align:right;
  padding-right:0;
  margin-right:0;
}
.printed-price__value-label{
  font-size:10.5px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(157,184,223,.58);
}
.printed-price__label{
  font-weight:700;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(255,213,154,.9);
}
.printed-price__metric{
  color:#d1e4ff;
  font-weight:600;
  font-size:11.5px;
  white-space:nowrap;
}
.printed-price__metric--sub{
  font-size:11px;
  font-weight:500;
  color:rgba(157,184,223,.78);
}
.printed-price__amount{
  color:#ffe6c2;
  font-weight:700;
  font-size:12px;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.printed-price__piece--muted{
  color:rgba(157,184,223,.55);
}
#printedPriceDisplay .chip,
.printed-controls__price .chip{
  font-size:12px;
  white-space:nowrap;
}
#printedPriceDisplay .chip:not(.printed-price__chip),
.printed-controls__price .chip:not(.printed-price__chip){
  color:#fff;
}
.printed-controls__actions{
  display:flex;
  align-items:center;
  gap:.4rem;
  flex-wrap:wrap;
}
.printed-controls__actions .btn{
  font-size:12.5px;
  padding:.35rem .7rem;
  border-radius:.65rem;
  box-shadow:0 10px 22px rgba(12,18,30,.18);
}
.printed-controls__actions .btn.primary{
  box-shadow:0 14px 34px rgba(80,227,164,.22);
}
.printed-controls__actions .btn.primary:disabled{
  box-shadow:none;
}

.printed-controls--mobile{
  background:none;
  border:none;
  box-shadow:none;
  padding:0;
  margin-right:0;
  gap:.3rem;
  flex-wrap:nowrap;
  align-items:center;
  width:100%;
}

.printed-controls--mobile .printed-controls__price{
  order:0;
  flex:1 1 auto;
  min-width:0;
}

.printed-controls--mobile .printed-price{
  width:100%;
}

.printed-controls--mobile .printed-price__chip{
  width:100%;
}

.printed-controls--mobile .printed-price__summary{
  width:100%;
  min-width:0;
}

.printed-controls--mobile .printed-price__value{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.printed-controls--mobile .printed-controls__actions{
  order:1;
  flex-wrap:nowrap;
  flex:0 0 auto;
}

.printed-controls--mobile .printed-controls__actions .btn{
  box-shadow:none;
  font-size:11.5px;
  padding:.28rem .55rem;
  white-space:nowrap;
}
.printed-controls__buy.btn.ghost{
  border-color:rgba(60,82,113,.6);
  color:#9fb4ce;
  background:rgba(18,28,44,.6);
}
.printed-controls__buy.btn.ghost:hover{
  border-color:#3c5279;
  background:rgba(32,46,68,.75);
  color:#cfe4ff;
}

@media (max-width:780px){
  .printed-controls{
    flex-wrap:wrap;
    align-items:flex-start;
    gap:.4rem;
    padding:.4rem .5rem;
    font-size:12px;
  }
  .printed-price{
    width:100%;
  }
  .printed-controls--mobile{
    flex-wrap:nowrap;
    align-items:center;
    padding:0;
    gap:.3rem;
  }
  .printed-controls--mobile .printed-price{
    width:100%;
  }
  .printed-price__chip{
    font-size:11px;
    padding:.25rem .5rem;
  }
  .printed-price__value{
    font-size:11.5px;
  }
  .printed-price__breakdown{
    flex-wrap:wrap;
  }
  .printed-controls__actions{
    width:100%;
    justify-content:flex-start;
  }
  .printed-controls__actions .btn{
    font-size:11.5px;
    padding:.3rem .6rem;
  }
  .printed-controls--mobile .printed-controls__actions{
    width:auto;
  }
  .printed-controls--mobile .printed-controls__actions .btn{
    padding:.28rem .55rem;
  }
}

/* Even more compact on very small screens */
@media (max-width:520px){
  .printed-controls{
    padding:.35rem .45rem;
    gap:.35rem;
  }
  .printed-price__chip{
    font-size:10.5px;
    padding:.2rem .45rem;
  }
  .printed-controls__actions .btn{
    font-size:11px;
    padding:.28rem .55rem;
  }
}

/* ===== Cart button ===== */
.cart-button{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  background:var(--chip);
  border:1px solid #273142;
  color:#d5e6ff;
  padding:.45rem .8rem;
  border-radius:.55rem;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow:0 10px 24px rgba(15,24,37,.22);
}
.cart-button:hover{
  border-color:#3a4f6a;
  box-shadow:0 14px 28px rgba(15,24,37,.32);
  background:rgba(27,36,53,.92);
}
.cart-button--fab{
  position:fixed;
  bottom:1.6rem;
  right:1.6rem;
  z-index:110;
  border-radius:999px;
  padding:.65rem 1rem;
  background:linear-gradient(135deg, rgba(26,41,66,.95), rgba(33,53,84,.88));
  box-shadow:0 20px 46px rgba(11,18,30,.48);
}
.cart-button--fab:hover{
  background:linear-gradient(135deg, rgba(30,48,78,.98), rgba(42,66,105,.9));
}
.cart-button--fab .cart-button__icon{font-size:18px;}
.cart-button--fab .cart-button__count{background:rgba(80,227,164,.25);}
@media (max-width:640px){
  .cart-button--fab{
    bottom:1rem;
    right:1rem;
    padding:.55rem .85rem;
  }
}
@media (max-width:520px){
  .cart-button--fab{
    gap:.35rem;
  }
  .cart-button--fab .cart-button__label{
    display:none;
  }
}
.cart-button__icon{font-size:16px;line-height:1;}
.cart-button__label{letter-spacing:.2px;}
.cart-button__count{
  min-width:1.6em;
  padding:.1rem .4rem;
  border-radius:999px;
  background:rgba(80,227,164,.18);
  color:var(--accent);
  border:1px solid rgba(80,227,164,.4);
  text-align:center;
  font-size:12px;
}

.acct-strip__printed .cart-button{
  flex:0 0 auto;
}

/* ===== Cart panel ===== */
.cart-panel{
  position:fixed;
  inset:0;
  z-index:120;
  display:flex;
  justify-content:flex-end;
  pointer-events:none;
}
.cart-panel__scrim{
  flex:1;
  background:rgba(6,9,15,.65);
  opacity:0;
  transition:opacity .24s ease;
}
.cart-panel__drawer{
  width:min(420px,100%);
  max-width:100%;
  background:linear-gradient(180deg,#0f141d,#0b1119);
  border-left:1px solid var(--line);
  transform:translateX(100%);
  transition:transform .28s ease, box-shadow .28s ease;
  display:flex;
  flex-direction:column;
  gap:0;
  pointer-events:auto;
}
.cart-panel.is-open{pointer-events:auto;}
.cart-panel.is-open .cart-panel__scrim{opacity:1;}
.cart-panel.is-open .cart-panel__drawer{transform:translateX(0);box-shadow:-24px 0 48px rgba(2,6,14,.65);}
.cart-panel__header{
  display:flex;
  justify-content:space-between;
  gap:.9rem;
  padding:.85rem 1.1rem .75rem;
  border-bottom:1px solid var(--line);
}
.cart-panel__header h2{
  margin:.1rem 0 0;
  font-size:1.25rem;
  line-height:1.2;
}
.cart-panel__eyebrow{
  margin:0;
  font-size:11px;
  letter-spacing:.24em;
  text-transform:uppercase;
  color:#7d8a9b;
}
.cart-panel__sub{
  margin:.25rem 0 0;
  font-size:11px;
  color:#8093ad;
  max-width:28ch;
  line-height:1.35;
}
.cart-panel__close{
  background:#151d2b;
  border:1px solid #273142;
  color:#9fb2c9;
  width:32px;
  height:32px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  cursor:pointer;
}
.cart-panel__close:hover{border-color:#3a4f6a;color:#cfe4ff;}
.cart-panel__content{
  padding:.75rem 1.1rem;
  overflow-y:auto;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
}
.cart-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.65rem;
}
.cart-item{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:.65rem;
  padding:.65rem;
  border:1px solid rgba(55,69,96,.45);
  border-radius:12px;
  background:rgba(14,20,31,.65);
  box-shadow:0 10px 20px rgba(2,6,14,.35);
}
.cart-item__thumb{
  width:64px;
  height:64px;
  border-radius:10px;
  overflow:hidden;
  background:#101722;
  border:1px solid rgba(80,99,132,.4);
}
.cart-item__thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.cart-item__body{display:flex;flex-direction:column;gap:.35rem;min-width:0;}
.cart-item__title{font-size:14px;font-weight:600;color:#e9f1ff;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
.cart-item__meta{font-size:11px;color:#8da2bb;display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;}
.cart-item__dot{color:#41516a;}
.cart-item__lock{display:inline-flex;align-items:center;gap:.3rem;padding:.18rem .5rem;border-radius:999px;border:1px solid rgba(98,126,170,.45);background:rgba(20,32,48,.7);color:#a9c1ff;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;}
.cart-item__lock::before{content:'\1f512';font-size:12px;}
.cart-item__controls{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;}
.cart-item__price{
  align-self:center;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.2rem;
  text-align:right;
}
.cart-item__price-total{font-weight:600;color:#f2f6ff;font-size:13px;line-height:1.2;}
.cart-item__price-original{font-size:12px;color:#9aa9c6;text-decoration:line-through;}
.cart-item__discount-note{
  font-size:11px;
  color:#88d9a0;
  line-height:1.3;
  max-width:220px;
  white-space:normal;
}
.cart-qty{
  display:inline-flex;
  align-items:center;
  background:#131b28;
  border:1px solid rgba(66,92,134,.55);
  border-radius:999px;
  padding:.08rem;
  gap:.25rem;
}
.cart-qty__btn{
  background:transparent;
  border:none;
  color:#cfe4ff;
  width:24px;
  height:24px;
  border-radius:999px;
  font-size:15px;
  line-height:1;
  cursor:pointer;
}
.cart-qty__btn:hover{background:rgba(103,179,255,.15);}
.cart-qty__value{
  min-width:1.6em;
  text-align:center;
  font-weight:600;
  color:#e9f1ff;
  font-variant-numeric:tabular-nums;
}
.cart-rename{
  background:rgba(103,179,255,.12);
  border:1px solid rgba(103,179,255,.35);
  color:#cfe4ff;
  height:26px;
  padding:0 .6rem;
  border-radius:8px;
  font-size:12px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  white-space:nowrap;
}
.cart-rename:hover{background:rgba(103,179,255,.18);border-color:rgba(103,179,255,.55);}
.cart-rename[hidden]{display:none!important;}
.cart-remove{
  background:rgba(255,107,107,.12);
  border:1px solid rgba(255,107,107,.35);
  color:var(--danger);
  width:26px;
  height:26px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.cart-remove:hover{background:rgba(255,107,107,.18);border-color:rgba(255,107,107,.55);}
.cart-remove__icon{font-size:14px;}
.cart-remove--hidden{display:none!important;}

.cart-item--readonly .cart-qty__btn{opacity:.45;cursor:default;}
.cart-item--readonly .cart-item__price-total{color:#cbd6eb;}
.cart-item--readonly .cart-item__discount-note{color:#9aa9c6;}
.cart-panel[data-cart-readonly="true"] .cart-panel__sub::after{content:'Shared cart preview (read-only)';display:block;font-size:11px;color:#8fa2ba;margin-top:.2rem;}
.cart-panel[data-cart-readonly="true"] [data-cart-kind="custom_fee"] [data-cart-lock],
.cart-panel[data-cart-readonly="true"] [data-cart-kind="custom_fee"] [data-cart-qty-group]{display:none!important;}

.cart-panel__admin-actions{display:flex;flex-wrap:wrap;gap:.55rem;margin-bottom:.9rem;}
.cart-panel__admin-actions[hidden]{display:none!important;}
.cart-panel__admin-btn{font-size:13px;padding:.45rem .75rem;line-height:1.2;}

.cart-empty{
  margin:auto;
  text-align:center;
  padding:2rem 1rem 3rem;
  max-width:260px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.6rem;
  color:#92a6c1;
}
.cart-empty--hidden{display:none!important;}
.cart-empty__icon{font-size:32px;line-height:1;}
.cart-empty__title{margin:0;font-size:16px;font-weight:600;color:#dde8ff;}
.cart-empty__body{margin:0;font-size:13px;color:#8fa0b6;}

.cart-panel__footer{
  padding:.75rem 1.1rem 1.05rem;
  border-top:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:.6rem;
  background:rgba(9,13,20,.85);
}
.cart-panel__summary{
  display:grid;
  grid-template-columns:auto 1fr;
  column-gap:.65rem;
  row-gap:.25rem;
  font-size:12px;
  color:#9dadc6;
  align-items:center;
}
.cart-panel__row{
  display:contents;
}
.cart-panel__summary span,
.cart-panel__summary strong{
  line-height:1.3;
}
.cart-panel__summary span:first-child{color:inherit;opacity:.92;}
.cart-panel__summary span:last-child,
.cart-panel__summary strong{
  justify-self:end;
  text-align:right;
}
.cart-panel__summary [data-cart-item-count]{font-weight:600;color:#d6e4ff;}
.cart-panel__row--subtotal{color:#e5edff;font-size:13px;}
.cart-panel__row--subtotal strong{font-size:16px;}
.cart-panel__row--discount{font-size:12px;color:#88d9a0;}
.cart-panel__row--discount span:last-child{color:#7ec894;font-weight:600;}
.cart-panel__row--total{font-size:14px;color:#f0f5ff;font-weight:600;}
.cart-panel__row--total strong{font-size:17px;}
.cart-panel__coupon{
  margin:4px 0;
  border:1px solid rgba(143,169,201,.18);
  border-radius:9px;
  padding:.55rem .7rem;
  background:rgba(12,19,32,.45);
  box-shadow:none;
  display:flex;
  flex-direction:column;
  gap:.55rem;
}
.cart-panel__coupon-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;background:none;border:none;color:#cfe4ff;font-weight:600;font-size:12px;padding:0;cursor:pointer;letter-spacing:.04em;text-transform:uppercase;gap:.4rem;}
.cart-panel__coupon-toggle:focus{outline:2px solid rgba(135,178,255,.45);outline-offset:3px;}
.cart-panel__coupon-icon{display:inline-flex;align-items:center;justify-content:center;transition:transform .2s ease;color:#8aa7cb;font-size:14px;}
.cart-panel__coupon-toggle[aria-expanded="true"] .cart-panel__coupon-icon{transform:rotate(90deg);}
.cart-panel__coupon-body{margin-top:0;display:flex;flex-direction:column;gap:.45rem;}
.cart-panel__coupon-body[hidden]{display:none!important;}
.cart-panel__coupon--expanded .cart-panel__coupon-body{display:flex;}
.cart-panel__coupon-form{display:flex;gap:.5rem;align-items:center;}
.cart-panel__coupon-input{flex:1;padding:6px 10px;border-radius:6px;border:1px solid rgba(143,169,201,.35);background:#0f1724;color:#e9f1ff;font-size:12px;}
.cart-panel__coupon-input::placeholder{color:rgba(207,228,255,.45);}
.cart-panel__coupon-input:focus{outline:none;border-color:#87b2ff;box-shadow:0 0 0 2px rgba(135,178,255,.25);}
.cart-panel__coupon-apply{padding:6px 12px;font-size:12px;}
.cart-panel__coupon-message{font-size:11px;margin:0;color:#cfe4ff;}
.cart-panel__coupon-message[data-success="true"]{color:#8dd2a8;}
.cart-panel__coupon-message[data-success="false"]{color:#ffb7c1;}
.cart-panel__coupon-chip{margin-top:0;display:flex;align-items:center;justify-content:space-between;gap:.6rem;}
.cart-panel__coupon-chip[hidden]{display:none!important;}
.cart-panel__coupon:not(.cart-panel__coupon--expanded) .cart-panel__coupon-chip{display:none;}
.cart-panel__coupon-pill{display:inline-flex;align-items:center;gap:6px;background:rgba(135,178,255,.16);border:1px solid rgba(135,178,255,.4);color:#e0ecff;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:600;}
.cart-panel__coupon-remove{font-size:11px;padding:6px 10px;}
.cart-panel__checkout{
  align-self:center;
  font-size:13px;
  letter-spacing:.26px;
  padding:.55rem 1.6rem;
  width:auto;
  max-width:100%;
  justify-content:center;
  transition:opacity .2s ease,color .2s ease;
}
.cart-panel__checkout--stripe{
  background:linear-gradient(135deg,#635bff,#5146ff);
  border-color:#7268ff;
  color:#fff;
  font-weight:600;
  box-shadow:0 12px 24px rgba(70,59,200,.28);
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.6rem 1.75rem;
  letter-spacing:.32px;
}
.cart-panel__checkout-logo{
  width:22px;
  height:22px;
  border-radius:6px;
  display:block;
  box-shadow:0 4px 12px rgba(12,9,50,.26);
  flex-shrink:0;
}
.cart-panel__checkout-label{display:inline-flex;align-items:center;}
.cart-panel__checkout--stripe:hover{
  border-color:#8077ff;
  box-shadow:0 18px 38px rgba(70,59,200,.42);
}
.cart-panel__checkout--stripe[disabled]{
  background:linear-gradient(135deg,#5146ff,#453ac8);
  border-color:#5b52e5;
  box-shadow:none;
  color:rgba(255,255,255,.78);
}
.cart-panel__checkout--stripe[data-loading]{
  box-shadow:none;
}
.cart-panel__checkout[disabled]{opacity:.75;cursor:not-allowed;}
.cart-panel__checkout:not([disabled]){opacity:1;cursor:pointer;}
.cart-panel__checkout[data-loading]{cursor:progress;}
.cart-panel__note{margin:0;font-size:10.5px;color:#6f809a;line-height:1.3;text-align:center;}

.admin-free{border:1px solid rgba(120,145,175,.28);border-radius:.85rem;background:rgba(10,16,26,.4);padding:.85rem;display:flex;flex-direction:column;gap:.65rem;}
.admin-free__head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;}
.admin-free__title{margin:0;font-size:15px;color:#e5efff;}
.admin-free__status{font-size:12px;color:#9fb2cd;background:rgba(15,22,34,.65);border:1px dashed rgba(120,145,175,.35);padding:.6rem .75rem;border-radius:.65rem;}
.admin-free__status[data-kind="error"]{color:#ffb3b3;border-color:rgba(255,99,99,.35);background:rgba(40,12,16,.6);}
.admin-free__current{font-size:12px;color:#dce9ff;background:rgba(12,20,30,.75);border:1px solid rgba(120,145,175,.2);border-radius:.65rem;padding:.55rem .65rem;display:flex;gap:.6rem;align-items:center;min-height:48px;}
.admin-free__current img{max-width:64px;max-height:64px;width:auto;height:auto;display:block;border-radius:.45rem;border:1px solid rgba(120,145,175,.25);}
.admin-free__actions{display:flex;gap:.5rem;flex-wrap:wrap;}
.admin-free__list{display:flex;flex-direction:column;gap:.4rem;}
.admin-free__item{display:flex;gap:.5rem;align-items:center;padding:.45rem .5rem;border:1px solid rgba(120,145,175,.28);border-radius:.6rem;background:rgba(8,12,18,.6);}
.admin-free__item img{width:44px;height:44px;object-fit:cover;border-radius:.4rem;border:1px solid rgba(120,145,175,.28);}
.admin-free__item-title{font-size:13px;color:#e5efff;margin:0;}
.admin-free__id{font-size:11px;color:#8fa6c0;}
.admin-free__empty{font-size:12px;color:#8fa6c0;}
.admin-free-wrapper{display:flex;flex-direction:column;gap:0;border:1px solid rgba(120,145,175,.28);border-radius:.85rem;background:rgba(10,16,26,.4);overflow:hidden;max-height:none;}
.admin-free-wrapper .admin-panel__tool{border:none;border-radius:0;border-bottom:1px solid rgba(120,145,175,.2);background:transparent;flex-shrink:0;}
.admin-free-wrapper .admin-panel__tool:hover{background:rgba(20,30,45,.5);}
.admin-free-wrapper .admin-panel__tool[aria-expanded="true"]{background:rgba(15,25,40,.6);}
.admin-free-wrapper .admin-free{border:none;border-radius:0;background:transparent;overflow-y:auto;overflow-x:hidden;max-height:400px;overscroll-behavior:contain;scrollbar-width:none;-ms-overflow-style:none;}
.admin-free-wrapper .admin-free::-webkit-scrollbar{display:none;}
.admin-free-wrapper .admin-free[hidden]{display:none;}

.admin-panel{
  position:fixed;
  inset:0;
  z-index:110;
  display:flex;
  justify-content:flex-end;
  pointer-events:none;
}
.admin-panel__scrim{
  flex:1;
  background:rgba(6,9,15,.5);
  opacity:0;
  transition:opacity .24s ease;
}
.admin-panel__drawer{
  width:min(320px,100%);
  max-width:100%;
  background:linear-gradient(180deg,#101723,#0c131d);
  border-left:1px solid var(--line);
  transform:translateX(100%);
  transition:transform .24s ease, box-shadow .24s ease;
  display:flex;
  flex-direction:column;
  gap:0;
  pointer-events:auto;
}
.admin-panel.is-open{pointer-events:auto;}
.admin-panel.is-open .admin-panel__scrim{opacity:1;}
.admin-panel.is-open .admin-panel__drawer{transform:translateX(0);box-shadow:-20px 0 40px rgba(3,8,18,.55);}
.admin-panel__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.25rem;
  border-bottom:1px solid var(--line);
}
.admin-panel__titles{display:flex;flex-direction:column;gap:.35rem;}
.admin-panel__eyebrow{
  margin:0;
  font-size:11px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:#7d8a9b;
}
.admin-panel__header h2{
  margin:0;
  font-size:18px;
  color:#e5efff;
}
.admin-panel__close{
  background:#151d2b;
  border:1px solid #273142;
  color:#9fb2c9;
  width:30px;
  height:30px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  cursor:pointer;
}
.admin-panel__close:hover{border-color:#3a4f6a;color:#cfe4ff;}
.admin-panel__content{
  padding:1rem 1.25rem 1.4rem;
  display:flex;
  flex-direction:column;
  gap:.75rem;
  overflow-y:auto;
  overflow-x:hidden;
  flex:1;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
}
.admin-panel__tool{
  display:flex;
  align-items:center;
  gap:.75rem;
  justify-content:flex-start;
  width:100%;
  text-align:left;
}
.admin-panel__tool-icon{
  font-size:20px;
  line-height:1;
}
.admin-panel__tool-text{
  flex:1;
  font-size:14px;
}
.admin-panel__tool.btn{padding:.55rem .8rem;}
.admin-panel__tool.btn.ghost{border:1px solid rgba(120,145,175,.32);background:rgba(15,23,35,.55);}
.admin-panel__tool.btn.ghost:hover{border-color:rgba(150,180,215,.6);color:#e2edff;}
.admin-panel__tool.is-active{border-color:rgba(150,180,215,.75);background:rgba(58,108,228,.22);color:#e8f0ff;}
.admin-panel__preset-wrapper{
  display:flex;
  flex-direction:column;
  gap:0;
  border:1px solid rgba(120,145,175,.28);
  border-radius:.85rem;
  background:rgba(10,16,26,.4);
  overflow:hidden;
  max-height:none;
}
.admin-panel__preset-wrapper .admin-panel__tool{
  border:none;
  border-radius:0;
  border-bottom:1px solid rgba(120,145,175,.2);
  background:transparent;
  flex-shrink:0;
}
.admin-panel__preset-wrapper .admin-panel__tool:hover{
  background:rgba(20,30,45,.5);
}
.admin-panel__preset-wrapper .admin-panel__tool[aria-expanded="true"]{
  background:rgba(15,25,40,.6);
}
.admin-panel__preset{
  border:none;
  border-radius:0;
  background:transparent;
  padding:.85rem;
  display:flex;
  flex-direction:column;
  gap:.65rem;
  overflow-y:auto;
  overflow-x:hidden;
  max-height:400px;
  overscroll-behavior:contain;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.admin-panel__preset::-webkit-scrollbar{
  display:none;
}
.admin-panel__preset[hidden]{
  display:none;
}
.admin-panel__preset-fields{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}
.admin-panel__preset .admin-field span{
  font-size:12px;
  color:#9fb2cd;
}
.admin-panel__preset .admin-field input{
  width:100%;
}
.admin-panel__preset-status{
  font-size:12px;
  color:#9fb2cd;
}
.admin-panel__preset textarea{
  min-height:160px;
  border:1px solid rgba(120,145,175,.4);
  border-radius:.6rem;
  background:#050a12;
  color:#e9f2ff;
  padding:.65rem;
  font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,'Roboto Mono','Source Code Pro',monospace;
  resize:vertical;
}
.admin-panel__preset-actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
}
.admin-panel__preset-actions .btn{
  flex:0 0 auto;
}

.admin-export-wrapper{
  display:flex;
  flex-direction:column;
  gap:0;
  border:1px solid rgba(120,145,175,.28);
  border-radius:.85rem;
  background:rgba(10,16,26,.4);
  overflow:hidden;
}
.admin-export-wrapper .admin-panel__tool{
  border:none;
  border-radius:0;
  border-bottom:1px solid rgba(120,145,175,.2);
  background:transparent;
  flex-shrink:0;
}
.admin-export-wrapper .admin-panel__tool:hover{
  background:rgba(20,30,45,.5);
}
.admin-export-wrapper .admin-panel__tool[aria-expanded="true"]{
  background:rgba(15,25,40,.6);
}
.admin-export{
  border:none;
  border-radius:0;
  background:transparent;
  padding:.85rem;
  display:flex;
  flex-direction:column;
  gap:.75rem;
}
.admin-export[hidden]{
  display:none;
}
.admin-export__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.75rem;
  flex-wrap:wrap;
}
.admin-export__title{
  margin:0;
  font-size:15px;
  color:#e5efff;
}
.admin-export__sub{
  margin:.25rem 0 0;
  font-size:12px;
  color:#8fa6c0;
  max-width:32ch;
}
.admin-export__actions{
  display:flex;
  gap:.5rem;
  align-items:center;
  flex-wrap:wrap;
}
.admin-export__row{
  display:flex;
  gap:.65rem;
  align-items:flex-start;
}
.admin-export__label{
  min-width:72px;
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#9fb2cd;
  padding-top:.35rem;
}
.admin-export__chips{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
}
.admin-export__chip{
  padding:.45rem .7rem;
  font-size:13px;
}
.admin-export__chip.is-active,
.admin-export__chip[aria-pressed="true"]{
  border-color:rgba(150,180,215,.75);
  background:rgba(58,108,228,.18);
  color:#e8f0ff;
}
.admin-export__options{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
  border-top:1px solid rgba(120,145,175,.2);
  padding-top:.6rem;
}
.admin-export__toggle{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  font-size:12.5px;
  color:#c9d7f0;
  background:rgba(15,22,34,.65);
  border:1px solid rgba(120,145,175,.3);
  border-radius:.6rem;
  padding:.4rem .65rem;
}
.admin-export__toggle input{
  accent-color:#6ea8ff;
}

.admin-free{
  border:1px solid rgba(120,145,175,.28);
  border-radius:.85rem;
  background:rgba(10,16,26,.4);
  padding:.85rem;
  display:flex;
  flex-direction:column;
  gap:.65rem;
}
.admin-free__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
}
.admin-free__title{
  margin:0;
  font-size:15px;
  color:#e5efff;
}
.admin-free__controls{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}
.admin-free__field select{
  width:100%;
}
.admin-free__actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
}
.admin-free__status{
  font-size:12px;
  color:#9fb2cd;
  background:rgba(15,22,34,.65);
  border:1px dashed rgba(120,145,175,.35);
  padding:.6rem .75rem;
  border-radius:.65rem;
}
.admin-free__status[data-kind="error"]{
  color:#ffb3b3;
  border-color:rgba(255,99,99,.35);
  background:rgba(40,12,16,.6);
}
.admin-free__list{
  display:flex;
  flex-direction:column;
  gap:.4rem;
}
.admin-free__item{
  display:flex;
  gap:.5rem;
  align-items:center;
  padding:.45rem .5rem;
  border:1px solid rgba(120,145,175,.28);
  border-radius:.6rem;
  background:rgba(8,12,18,.6);
}
.admin-free__item img{
  width:44px;
  height:44px;
  object-fit:cover;
  border-radius:.4rem;
  border:1px solid rgba(120,145,175,.28);
}
.admin-free__item-title{font-size:13px;color:#e5efff;margin:0;}
.admin-free__id{font-size:11px;color:#8fa6c0;}
.admin-free__empty{font-size:12px;color:#8fa6c0;}

.admin-orbit-overlay{
  position:absolute;
  top:1.2rem;
  right:1.2rem;
  width:min(320px,calc(100% - 2.4rem));
  padding:1rem 1.1rem 1.1rem;
  border-radius:.9rem;
  background:linear-gradient(180deg,rgba(19,27,38,.95),rgba(11,17,27,.92));
  border:1px solid var(--line);
  box-shadow:0 22px 46px rgba(6,12,24,.55);
  display:flex;
  flex-direction:column;
  gap:.85rem;
  color:var(--text);
  z-index:90;
  pointer-events:none;
  opacity:0;
  transform:translateY(-12px);
  transition:opacity .22s ease,transform .22s ease;
}
.admin-orbit-overlay.is-open{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
}
.admin-orbit-overlay[hidden]{display:none;}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .admin-orbit-overlay{
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    background:linear-gradient(180deg,rgba(17,24,35,.82),rgba(11,17,27,.78));
  }
}
.admin-orbit-overlay__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}
.admin-orbit-overlay__titles{display:flex;flex-direction:column;gap:.2rem;}
.admin-orbit-overlay__eyebrow{
  margin:0;
  font-size:10.5px;
  letter-spacing:.32em;
  text-transform:uppercase;
  color:rgba(155,178,208,.75);
}
.admin-orbit-overlay__title{
  margin:0;
  font-size:16px;
  font-weight:600;
  letter-spacing:.4px;
  color:#f3f6ff;
}
.admin-orbit-overlay__close{
  background:rgba(20,28,40,.65);
  border:1px solid rgba(120,145,175,.32);
  color:#d9e6ff;
  width:32px;
  height:32px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  cursor:pointer;
  transition:border-color .2s ease,background .2s ease,color .2s ease,transform .2s ease;
}
.admin-orbit-overlay__close:hover{
  border-color:rgba(150,185,230,.6);
  background:rgba(32,44,64,.8);
  color:#fff;
  transform:translateY(-1px);
}
.admin-orbit-overlay__close:focus-visible{
  outline:2px solid var(--accent2);
  outline-offset:2px;
}
.admin-orbit-overlay__body{
  display:flex;
  flex-direction:column;
  gap:.75rem;
}
.admin-orbit-overlay__hint{
  margin:0;
  font-size:12.5px;
  color:rgba(171,189,211,.8);
  line-height:1.5;
}
.admin-orbit-overlay__axis{
  display:flex;
  flex-direction:column;
  gap:.5rem;
}
.admin-orbit-overlay__axis-label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
  font-weight:600;
  color:#f0f6ff;
}
.admin-orbit-overlay__axis-name{
  font-size:12px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:rgba(158,179,204,.85);
}
.admin-orbit-overlay__value{
  font-size:13px;
  color:var(--accent2);
  min-width:3.5ch;
  text-align:right;
}
.admin-orbit-overlay__slider{
  position:relative;
  display:flex;
  align-items:center;
  padding:.35rem .5rem;
  border-radius:999px;
  border:1px solid rgba(120,145,175,.3);
  background:rgba(12,18,30,.65);
  transition:border-color .2s ease,box-shadow .2s ease;
}
.admin-orbit-overlay__slider:focus-within{
  border-color:rgba(118,170,255,.75);
  box-shadow:0 0 0 3px rgba(103,179,255,.2);
}
.admin-orbit-overlay__slider input[type=range]{
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  background:transparent;
  height:20px;
  cursor:pointer;
}
.admin-orbit-overlay__slider input[type=range]:focus{outline:none;}
.admin-orbit-overlay__slider input[type=range]::-webkit-slider-runnable-track{
  height:6px;
  border-radius:999px;
  background:linear-gradient(90deg,rgba(80,227,164,.6),rgba(103,179,255,.85));
}
.admin-orbit-overlay__slider input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  border:3px solid rgba(103,179,255,.9);
  box-shadow:0 8px 18px rgba(103,179,255,.35);
  margin-top:-6px;
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.admin-orbit-overlay__slider input[type=range]::-webkit-slider-thumb:hover{
  transform:scale(1.05);
}
.admin-orbit-overlay__slider input[type=range]::-moz-range-track{
  height:6px;
  border-radius:999px;
  background:linear-gradient(90deg,rgba(80,227,164,.6),rgba(103,179,255,.85));
}
.admin-orbit-overlay__slider input[type=range]::-moz-range-thumb{
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  border:3px solid rgba(103,179,255,.9);
  box-shadow:0 8px 18px rgba(103,179,255,.35);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.admin-orbit-overlay__slider input[type=range]::-moz-range-thumb:hover{
  transform:scale(1.05);
}
.admin-orbit-overlay__footer{
  display:flex;
  justify-content:flex-end;
}
.admin-orbit-overlay__reset.btn{
  font-size:12.5px;
  padding:.45rem .9rem;
  border-radius:.6rem;
  border-color:rgba(120,145,175,.35);
  background:rgba(14,21,32,.55);
}
.admin-orbit-overlay__reset.btn:hover{
  border-color:rgba(150,185,230,.55);
}
@media (max-width:720px){
  .admin-orbit-overlay{
    top:auto;
    bottom:1.2rem;
    right:1.2rem;
    left:1.2rem;
    width:auto;
  }
}

@media (max-width:720px){
  .cart-item{
    grid-template-columns:100px 1fr;
    grid-template-rows:auto auto;
  }
  .cart-item__price{grid-column:2/3;justify-self:flex-end;}
}
#designSaveButton:hover:not(:disabled){
  background:rgba(26,38,62,.95);
  border-color:rgba(118,170,255,.7);
  box-shadow:0 8px 20px rgba(4,12,26,.4);
}
#designSaveButton:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}
#designSaveButton[data-state="dirty"],
#designSaveButton[data-state="saving"]{
  border-color:rgba(248,196,90,.8);
  color:#ffd97a;
}
#designSaveButton[data-state="saving"] .design-save-button-icon{animation:design-save-spin 1.2s linear infinite;}
#designSaveButton[data-state="saved"]{
  background:linear-gradient(180deg,#3ba980,#2c7d93);
  border-color:#45cba0;
  color:#041116;
  box-shadow:0 10px 24px rgba(27,202,150,.22);
}
#designSaveButton[data-state="error"],
#designSaveButton[data-state="offline"]{
  border-color:rgba(255,119,119,.75);
  color:#ff9b9b;
}
#designSaveButton[data-state="requires-auth"]{
  border-color:rgba(122,158,255,.78);
  color:#bfd3ff;
}

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

/* Drag target & placeholder text */
#droptarget{position:absolute;inset:.6rem;border:1px dashed #334058;border-radius:.75rem;display:none;place-content:center;color:#9fb3c6;background:rgba(22,28,40,.35)}
#droptarget.show{display:grid}
#placeholder{
  position:absolute;inset:0;display:grid;place-content:center;
  color:#9fb3c6;text-align:center;padding:20px
}

/* ===== Quick start overlay ===== */
/* --- Mini Quick Start Overlay --- */
.quick-start{position:fixed;inset:0;z-index:9000;display:none;align-items:center;justify-content:center;padding:20px;background:radial-gradient(140% 120% at 50% 50%,rgba(8,13,22,.85) 0,rgba(8,13,22,.7) 40%,rgba(8,13,22,0) 76%);pointer-events:none;backdrop-filter:blur(2px);}
.quick-start.is-hidden{display:none}
.quick-start.is-visible{display:flex}

/* Mini panel - compact & centered */
.quick-start__mini-panel{position:relative;width:min(95vw,1100px);max-height:min(96vh,950px);background:linear-gradient(180deg,rgba(15,22,38,.96),rgba(10,16,28,.94));border:1px solid rgba(84,112,160,.45);border-radius:20px;box-shadow:0 30px 80px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.04) inset;padding:30px 32px 20px;display:flex;flex-direction:column;gap:22px;overflow-y:auto;overflow-x:hidden;pointer-events:auto;backdrop-filter:blur(20px);}
.quick-start__mini-panel::before{content:"";position:absolute;inset:-180px -140px 60% -140px;background:radial-gradient(closest-side,rgba(62,126,255,.18),rgba(62,126,255,0));opacity:.75;pointer-events:none;mix-blend-mode:screen;}

/* Close button */
.quick-start__close{position:absolute;top:12px;right:12px;width:32px;height:32px;border-radius:999px;background:rgba(20,30,46,.92);border:1px solid rgba(76,105,150,.48);color:#8fa2c0;font-size:17px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s ease;z-index:10;}
.quick-start__close:hover{color:#fff;border-color:rgba(118,167,255,.85);background:rgba(24,38,62,.98);transform:scale(1.05);}

/* Header */
.quick-start__mini-header{text-align:center;margin-bottom:10px;}
.quick-start__eyebrow{text-transform:uppercase;letter-spacing:1.6px;font-size:11px;color:#81b2ff;font-weight:600;margin:0 0 10px;}
.quick-start__mini-title{margin:0;font-size:17px;line-height:1.35;font-weight:600;color:#e8f0ff;letter-spacing:.2px;}

/* Three horizontal panels container */
.quick-start__mini-panels{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;grid-auto-rows:minmax(0,1fr);gap:20px;align-items:stretch;flex:1;min-height:0;overflow-y:visible;padding:12px 8px 12px;}
.quick-start__mini-panels::-webkit-scrollbar{width:6px}
.quick-start__mini-panels::-webkit-scrollbar-thumb{background:rgba(114,148,206,.35);border-radius:999px}
.quick-start__mini-panels{scrollbar-width:thin;scrollbar-color:rgba(114,148,206,.45) transparent}

/* Individual instruction card */
.quick-start__mini-card{position:relative;display:flex;flex-direction:column;gap:12px;padding:20px 18px;background:rgba(18,28,44,.88);border:1px solid rgba(70,102,150,.42);border-radius:14px;box-shadow:0 8px 24px rgba(7,11,20,.45);transition:all .25s ease;justify-content:space-between;flex:1;min-height:0;}
.quick-start__mini-card:hover{transform:translateY(-3px);border-color:rgba(118,168,255,.65);box-shadow:0 14px 32px rgba(7,12,22,.6);}

/* Step badge */
.quick-start__mini-step-badge{position:absolute;top:-10px;left:14px;width:28px;height:28px;border-radius:999px;background:linear-gradient(180deg,#5baeff,#3f7dff);display:grid;place-content:center;font-weight:700;color:#03122b;font-size:12px;box-shadow:0 8px 18px rgba(57,122,255,.42);letter-spacing:.3px;z-index:2;}

/* Card title */
.quick-start__mini-card-title{margin:0;font-size:14.5px;font-weight:600;color:#f4f7ff;letter-spacing:.15px;line-height:1.3;}
.quick-start__mini-card-title--center{text-align:center;}

/* Feature list */
.quick-start__mini-features{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px;font-size:12.5px;color:#b0c2db;}
.quick-start__mini-features li{display:flex;gap:8px;align-items:center;line-height:1.4;}
.quick-start__mini-features li span{flex-shrink:0;font-size:14px;}
.quick-start__mini-icon{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:18px;line-height:1;}

/* Mini hero image */
.quick-start__mini-hero{margin:6px 0 0;padding:0;border-radius:12px;overflow:hidden;background:rgba(10,18,32,.8);border:1px solid rgba(92,130,190,.38);}
.quick-start__mini-hero-img{width:100%;height:160px;object-fit:cover;display:block;border-radius:12px 12px 0 0;}
.quick-start__mini-hero-caption{font-size:11px;color:#95adc8;text-align:center;padding:8px 10px;margin:0;background:rgba(8,14,26,.9);}

/* Hint text (Panels 2 & 3) */
.quick-start__mini-hint{margin:6px 0 0;font-size:10.5px;line-height:1.45;color:#8ca5c4;font-style:italic;}

/* Actions */
.quick-start__mini-actions{display:flex;flex-direction:column;gap:8px;margin-top:8px;}
.quick-start__mini-actions .btn-sm{padding:.5rem .8rem;font-size:12px;font-weight:600;border-radius:8px;}

/* Neon-green arrow */
.quick-start__mini-arrow{display:flex;align-items:center;justify-content:center;color:#00ff88;font-size:32px;flex-shrink:0;filter:drop-shadow(0 0 12px rgba(0,255,136,.6));align-self:center;}
.quick-start__mini-arrow svg{width:32px;height:32px;stroke:currentColor;animation:pulse-arrow 2s ease-in-out infinite;}

@keyframes pulse-arrow{
  0%,100%{opacity:1;transform:translateX(0)}
  50%{opacity:.7;transform:translateX(4px)}
}

/* Footer */
.quick-start__mini-footer{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;padding-top:10px;border-top:1px solid rgba(70,102,150,.3);}
.quick-start__mini-cta{padding:.65rem 1.5rem;font-size:13.5px;font-weight:600;}
.quick-start__mini-secondary{padding:.6rem 1.3rem;font-size:12.5px;font-weight:600;color:#d0dcf6;}

/* Inline trigger button */
.quick-start-inline{
  justify-content:center;
  gap:.35rem;
  background:rgba(30,42,64,.6);
  border-color:#334665;
  color:#dbe7ff;
}

/* Carousel navigation arrows (mobile only) */
.quick-start__carousel-nav{display:none;}

/* Responsive - Mobile carousel */
@media (max-width:768px){
  .quick-start__mini-panel{width:min(92vw,400px);max-height:min(88vh,520px);padding:18px 16px;gap:12px;}
  .quick-start__mini-header{margin-bottom:6px;}
  .quick-start__eyebrow{font-size:10px;letter-spacing:1.4px;margin-bottom:6px;}
  .quick-start__mini-title{font-size:14.5px;}

  /* Carousel container */
  .quick-start__mini-panels{
    position:relative;
    display:flex;
    gap:0;
    padding:0;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-snap-type:x mandatory;
    scroll-behavior:smooth;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .quick-start__mini-panels::-webkit-scrollbar{display:none;}

  /* Cards in carousel */
  .quick-start__mini-card{
    flex:0 0 100%;
    scroll-snap-align:center;
    padding:16px 14px;
    gap:10px;
  }
  .quick-start__mini-arrow{display:none;}

  /* Navigation arrows */
  .quick-start__carousel-nav{
    display:flex;
    gap:10px;
    justify-content:center;
    align-items:center;
    margin-top:8px;
  }
  .quick-start__carousel-btn{
    width:36px;
    height:36px;
    border-radius:50%;
    background:rgba(30,45,70,.85);
    border:1px solid rgba(90,120,170,.5);
    color:#a0b8d8;
    font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:all .2s ease;
  }
  .quick-start__carousel-btn:hover{
    background:rgba(40,58,88,.95);
    border-color:rgba(118,167,255,.75);
    color:#fff;
  }
  .quick-start__carousel-btn:disabled{
    opacity:.3;
    cursor:not-allowed;
  }

  /* Dots indicator */
  .quick-start__carousel-dots{
    display:flex;
    gap:8px;
  }
  .quick-start__carousel-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:rgba(100,130,180,.4);
    border:1px solid rgba(100,130,180,.3);
    transition:all .3s ease;
    cursor:pointer;
  }
  .quick-start__carousel-dot.active{
    width:24px;
    border-radius:4px;
    background:rgba(91,174,255,.85);
    border-color:rgba(91,174,255,.6);
  }

  /* Adjust sizes */
  .quick-start__mini-card-title{font-size:13.5px;}
  .quick-start__mini-step-badge{width:26px;height:26px;font-size:11px;top:-9px;left:12px;}
  .quick-start__mini-features{gap:7px;font-size:12px;}
  .quick-start__mini-icon{width:20px;height:20px;font-size:17px;}
  .quick-start__mini-hero-img{height:130px;}
  .quick-start__mini-hero-caption{font-size:10.5px;padding:7px 9px;}
  .quick-start__mini-footer{gap:10px;padding-top:10px;}
  .quick-start__mini-cta{padding:.6rem 1.3rem;font-size:13px;}
  .quick-start__mini-secondary{padding:.55rem 1.1rem;font-size:12px;}
}

/* Responsive - Very small screens */
@media (max-width:480px){
  .quick-start__mini-panel{width:min(94vw,360px);max-height:min(90vh,480px);padding:14px 12px;gap:10px;}
  .quick-start__eyebrow{font-size:9.5px;letter-spacing:1.2px;margin-bottom:5px;}
  .quick-start__mini-title{font-size:13.5px;}
  .quick-start__mini-card{padding:14px 12px;gap:8px;}
  .quick-start__mini-card-title{font-size:12.5px;}
  .quick-start__mini-step-badge{width:24px;height:24px;font-size:10.5px;top:-8px;left:10px;}
  .quick-start__mini-features{font-size:11px;gap:6px;}
  .quick-start__mini-icon{width:18px;height:18px;font-size:15px;}
  .quick-start__mini-hero-img{height:110px;}
  .quick-start__mini-hero-caption{font-size:9.5px;padding:6px 7px;}
  .quick-start__mini-footer{gap:8px;padding-top:8px;}
  .quick-start__mini-cta{padding:.5rem 1.1rem;font-size:12px;}
  .quick-start__mini-secondary{padding:.45rem .9rem;font-size:11px;}
  .quick-start__mini-hint{font-size:10px;}
  .quick-start__carousel-btn{width:32px;height:32px;font-size:16px;}
  .quick-start__carousel-dot{width:7px;height:7px;}
  .quick-start__carousel-dot.active{width:20px;}
}

/* --- Accordion panels (left dock) --- */
#dock details.panel {
  margin: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #111826;
  overflow: visible;          /* avoid clipping helper text / checkboxes */
  padding: 0;
}
#dock details.panel > summary {
  list-style: none;
  cursor: pointer;
  padding: .55rem .7rem;
  display: flex; align-items: center; gap: .5rem;
  color: #8b99aa; font-size: 12px; letter-spacing: .4px; text-transform: uppercase;
  background: linear-gradient(180deg,#111826,#0f1622);
}
#dock details.panel > summary::-webkit-details-marker { display: none; }
#dock details.panel > summary::before {
  content: "▸"; color: var(--ghost);
  transform: rotate(0deg);
  transition: transform .15s ease;
}
#dock details.panel[open] > summary::before { transform: rotate(90deg); }
#dock details.panel .panel-body {
  padding: .6rem .8rem .8rem;
  border-top: 1px solid var(--line);
}
#panel-file .toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:.45rem;
}
#panel-file .toolbar--primary{
  margin-bottom:.55rem;
}
#panel-file .toolbar--primary .btn,
#panel-file .toolbar--primary label.btn{
  flex:1 1 150px;
  justify-content:center;
}
#panel-file .toolbar--secondary{
  gap:.5rem;
}
#panel-file .toolbar--secondary .btn{
  flex:1 1 150px;
  justify-content:center;
}
#panel-file .toolbar--secondary .btn:first-child{
  min-width:0;
}
#panel-file .toolbar--secondary #tbSave{
  min-width:0;
}
#panel-file .toolbar--secondary #tbSave .btn-icon{margin-right:.3rem;}
#dock .help.small { font-size: 11.5px; color: var(--ghost); }

/* Slightly tighter gaps in grid triplets */
#dock .grid-3 input[type="number"],
#dock .grid-3 input[type="range"] { margin-top: .15rem; }

.ai-generate {
  margin-top: .9rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: .45rem;
}
.ai-generate label {
  font-size: 12px;
  letter-spacing: .35px;
  text-transform: uppercase;
  color: #8b99aa;
}
.ai-generate__controls {
  display: grid;
  grid-template-columns: 1fr; /* stack input and button; button below */
  gap: .5rem;
  align-items: stretch;
}
.ai-generate__controls input[type="search"] {
  flex: 1;
  width: 100%;
  background: #0d1522;
  border: 1px solid #263247;
  color: #d7e3ee;
  border-radius: .55rem;
  padding: .45rem .7rem;
  font-size: 14px;
}
.ai-generate__controls input[type="search"]:focus {
  outline: none;
  border-color: #3c5b8f;
  box-shadow: 0 0 0 1px rgba(60, 91, 143, .45);
}
.ai-generate__controls button {
  min-width: 0;      /* allow full-width on small layouts */
  width: 100%;       /* place button on its own row */
  justify-content: center;
}
.ai-generate__hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--ghost);
  line-height: 1.4;
}


.layer-control {
  display: grid;
  grid-template-rows: auto auto auto;
  align-items: start;
  gap: .35rem;
}

.layer-control__header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .35rem 0 0;
}

.layer-control__header:first-child {
  margin-top: 0;
}

.layer-control__header .layer-color-chip {
  margin-left: auto;
}

.layer-control input[type="number"],
.layer-control input[type="range"] {
  margin-top: 0;
}

.layer-control__slider-row {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.layer-control__slider-row input[type="range"] {
  flex: 1;
}

.layer-control__chip {
  display: none;
  padding: .15rem .45rem;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(143, 162, 186, .16);
  color: #a8bfd8;
  white-space: nowrap;
  pointer-events: none;
}

.layer-control__chip.is-visible {
  display: inline-flex;
  align-items: center;
}

.layer-control__header label {
  flex: 1;
  margin: 0;
}

.layer-color-chip {
  --chip-width: 1.4rem;
  --chip-height: .85rem;
  width: var(--chip-width);
  height: var(--chip-height);
  border-radius: .4rem;
  border: 1px solid rgba(255, 255, 255, .32);
  background: var(--chip-color, #1565c0);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), 0 0 0 1px rgba(6, 12, 20, .75);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s ease, box-shadow .2s ease;
  position: relative;
}

.layer-color-chip::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, .45);
  pointer-events: none;
}

.layer-color-chip:hover {
  transform: scale(1.05);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), 0 0 0 1px rgba(120, 190, 255, .45);
}

.layer-color-chip:focus-visible {
  outline: 2px solid #5aa5ff;
  outline-offset: 2px;
}

.panel-section + .panel-section {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}

.toggle-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.segmented-field {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.segmented-field__label {
  font-size: 13px;
  font-weight: 600;
  color: #9fb3c8;
}

.segmented-field__group {
  display: flex;
  gap: .4rem;
  padding: .35rem;
  border-radius: .7rem;
  border: 1px solid #223145;
  background: rgba(17, 26, 43, .92);
}

.segmented-field__option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .4rem .65rem;
  border-radius: .55rem;
  border: 1px solid transparent;
  background: transparent;
  color: #b7c7dd;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.segmented-field__option[aria-checked="true"] {
  background: linear-gradient(180deg,#1f2a3d,#152030);
  border-color: #3a516d;
  color: #e5f0ff;
  box-shadow: 0 12px 26px rgba(15,22,36,.45);
}

.segmented-field__option:focus-visible {
  outline: 2px solid #6489ff;
  outline-offset: 2px;
}

.segmented-field__hint {
  margin: 0;
  font-size: 12px;
  color: #7e8fa8;
  line-height: 1.4;
}

.size-label-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.size-adjust-note {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  pointer-events: none;
}

.size-adjust-note.is-visible {
  opacity: 1;
  visibility: visible;
}

.toggle-stack {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-top: .9rem;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .5rem .65rem;
  border-radius: .7rem;
  border: 1px solid #223145;
  background: rgba(17, 24, 38, .85);
  color: #d4e4f6;
  cursor: pointer;
  font-size: 13px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.toggle-control:hover {
  border-color: #31507a;
  background: rgba(20, 30, 46, .92);
}

.toggle-control__track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(33, 45, 64, .9);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(64, 90, 128, .55);
  transition: background .2s ease, box-shadow .2s ease;
}

.toggle-control__thumb {
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #5f7ca6;
  transform: translateX(0);
  transition: transform .2s ease, background .2s ease;
}

.toggle-control__label {
  flex: 1;
  text-align: left;
  color: #c5d6ec;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.checkbox-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.toggle-control.is-active {
  border-color: #3f6bbd;
  background: rgba(27, 42, 66, .95);
  box-shadow: 0 16px 28px rgba(11, 18, 30, .35);
}

.toggle-control.is-active .toggle-control__track {
  background: linear-gradient(180deg, rgba(111, 178, 255, .55), rgba(73, 121, 201, .75));
  box-shadow: inset 0 0 0 1px rgba(118, 168, 255, .75);
}

.toggle-control.is-active .toggle-control__thumb {
  transform: translateX(16px);
  background: var(--accent);
}

.connector-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  align-items: start;
  margin-bottom: .7rem;
}

.btn-toggle {
  background: rgba(22, 32, 48, .55);
  border-color: #2b3952;
  color: #c8daf5;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}

.btn-toggle .btn-icon {
  margin-right: .35rem;
  font-size: 15px;
}

.btn-toggle.is-active {
  background: linear-gradient(180deg,#3ba980,#2c7d93);
  border-color: #45cba0;
  color: #041116;
  box-shadow: 0 10px 24px rgba(27,202,150,.22);
}

.btn-toggle.is-active .btn-icon {
  color: #041116;
}

/* App bar cleanup */
.appbar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.appbar .spacer{margin-left:auto}
.appbar .help-pop{display:none}

/* App page brand: same size as homepage */
.appbar .brand {
  font-weight: 800;
  color: var(--headline);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: 18px;
  text-decoration: none;
}
.appbar .brand__accent {
  color: var(--accent2);
}
.appbar .spark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* Account strip layout (mobile-first: stacked) */
.acct-strip{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.55rem;
  padding:.55rem .65rem;
  background:#111826;
  border:1px solid var(--line);
  border-radius:.9rem;
  width:min(340px,100%);
  box-shadow:0 16px 34px rgba(8,12,20,.28);
  margin-left:-.15rem;
}
.acct-strip__info,
.acct-strip__auth{
  display:flex;
  align-items:center;
  gap:.35rem;
  width:100%;
  justify-content:flex-start;
  flex-wrap:nowrap;
  min-width:0;
}
.acct-strip__auth[data-printed-placement="mobile"]{
  gap:.4rem;
}
.acct-strip__auth[data-printed-placement="mobile"]>*{
  flex:0 0 auto;
}
.acct-strip__auth[data-printed-placement="mobile"] .printed-controls{
  order:0;
  flex:1 1 auto;
  min-width:0;
}
.acct-strip__auth[data-printed-placement="mobile"] #creditBadge{
  order:1;
}
.acct-strip__auth[data-printed-placement="mobile"] #acctAuthSlot{
  order:2;
}
.acct-strip__auth[data-printed-placement="mobile"] #btnSignOut{
  order:3;
}
.acct-strip__actions{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.35rem;
  width:100%;
}
.acct-strip__actions>button{width:100%;}

.acct-strip__credit{
  font-size:11.5px;
  padding:.45rem .6rem;
  white-space:nowrap;
}

.acct-strip__auth-slot{
  display:flex;
  align-items:center;
}

.acct-strip__auth-slot button,
.acct-strip__signout{
  font-size:11.5px;
  padding:.45rem .6rem;
  border-radius:.65rem;
  white-space:nowrap;
}
/* Printed row now: [Printed price][Order Printed Cutter] */
.acct-strip__printed{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
}

/* Make primary action stand out; secondary keeps compact width */
#acctStrip #orderPrintedBtn.btn.primary{
  font-weight:600;
}
#btnBuy.btn{
  /* optional: slightly quieter than primary */
  opacity:.9;
}

#buyCreditsStandalone{
  display:flex;
  flex:0 0 auto;
  width:100%;
}

#buyCreditsStandalone .btn{
  width:100%;
}

/* On very narrow screens, keep chip on its own line if needed */
@media (max-width:420px){
  .acct-strip__printed{
    gap:.4rem;
  }
  #acctStrip #printedPriceChip{
    flex-basis:100%;
  }
}

/* Desktop: compact row so header stays short */
@media (min-width:1100px){
  .acct-strip{
    flex-direction:row;
    align-items:center;
    gap:.5rem;
    padding:.4rem .55rem;
    width:auto;
    margin-left:0;
  }
  .acct-strip__info,
  .acct-strip__auth,
  .acct-strip__actions{
    flex-direction:row;
    align-items:center;
    gap:.4rem;
    width:auto;
  }
  .acct-strip__actions>button{width:auto;}
}

@media (min-width:1100px){
  #buyCreditsStandalone{
    width:auto;
    align-items:center;
  }
  #buyCreditsStandalone .btn{
    width:auto;
  }
}

@media (max-width: 920px){
  .acct-strip{
    width:100%;
    margin-left:0;
  }
}

@media (max-width:760px){
  .acct-strip{
    padding:.5rem .55rem;
    gap:.45rem;
  }
  .acct-strip__auth{
    gap:.3rem;
  }
  .acct-strip__actions button,
  #exportstl{
    font-size:12px;
    padding:.4rem .55rem;
  }
  .acct-strip__credit{
    font-size:11px;
    padding:.16rem .5rem;
  }
  .acct-strip__auth-slot button,
  .acct-strip__signout{
    font-size:11px;
    padding:.28rem .5rem;
  }
  .chip{
    font-size:11px;
    padding:.08rem .45rem;
  }
}

@media (max-width:520px){
  .acct-strip{
    padding:.4rem .45rem;
    gap:.35rem;
  }
  .acct-strip__actions button,
  #exportstl{
    font-size:11.5px;
    padding:.35rem .5rem;
  }
}

/* === Tablet polish === */

/* 1) Let the app bar wrap on smaller widths so the big button never gets cut off */
#exportstl { flex: 0 0 auto; }                 /* don't shrink the buttons */
/* compact header sizing; matches existing toolbar button style */
.appbar .btn,
#exportstl {
  padding:.45rem .6rem;
  border-radius:.5rem;
}
@media (max-width: 920px) {
  #exportstl { flex: 0 0 auto; }
}

/* 2) Grid children must be allowed to shrink inside .row to avoid clipping */
.row > aside, .row > main { min-width: 0; }

/* 3) Make the 3-column slider grids more robust across tablets */
.grid-3 { 
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .4rem;
  align-items: start;
}
/* collapse to 2 cols on medium tablets, 1 col on phones */
@media (max-width: 1100px){
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px){
  .grid-3 { grid-template-columns: 1fr; }
}

/* === Phone drawer for the left dock === */
@media (max-width: 760px){
  /* Keep grid one-column; make main tall so viewer can fill */
  .row{
    grid-template-columns: 1fr;
    min-height: calc(100dvh - var(--appbar-height, 60px));
  }
  main{
    order:1;
    /* Match the remaining viewport height after accounting for the header */
    min-height: calc(100dvh - var(--appbar-height, 60px));
    height: calc(100dvh - var(--appbar-height, 60px));
  }
  aside{
    order:2;
    /* Don't use display:none - it prevents the fixed #dock drawer from rendering */
    /* The drawer is hidden off-screen by default via transform: translateX(-102%) */
  }

  /* Turn #dock into a slide-in drawer that sits above the viewport */
  #dock{
    position: fixed;
    inset: 0 auto 0 0;               /* left edge */
    width: min(88vw, 400px);
    max-width: 100%;
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 70;                      /* above toolbar */
    box-shadow: 4px 0 32px rgba(0,0,0,.55);
    background: #0f141d;             /* same as aside theme */
    border-right: 1px solid var(--line);
  }
  #dock.open{
    transform: translateX(0);
  }

  /* Tap target to close: top-right "X" button we'll add in HTML */
  #dock .dock-close{
    position: sticky;
    top: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
    padding: .6rem .7rem;
    z-index: 2;
    background: linear-gradient(180deg,#0f141d,#0c1118);
    border-bottom: 1px solid var(--line);
  }
  #dock .dock-close .btn{
    font-size: 13px;
    padding: .4rem .65rem;
  }

  /* Dim the app behind the drawer using a backdrop on <body> */
  body.mobile-drawer-open::after{
    content:""; position: fixed; inset: 0;
    background: rgba(0,0,0,.42); z-index: 60;
  }

  /* Floating Tools button (we'll add in HTML) */
  .dock-toggle{
    display:inline-flex; align-items:center; justify-content:center;
    position: fixed; left: 1rem; bottom: 1rem;
    z-index: 65;
    background:#141b26; border:1px solid #263247; color:#cfe4ff;
    border-radius: .7rem; padding: .6rem .8rem; font-size: 14px;
    box-shadow:0 10px 24px rgba(15,24,37,.32);
    transition:background .2s ease, border-color .2s ease, box-shadow .2s ease;
  }
  .dock-toggle:hover{
    background:#1a2538;
    border-color:#2f4a71;
    box-shadow:0 14px 28px rgba(15,24,37,.42);
  }

  .dock-close{display:flex}
}

/* Additional mobile refinements for very small screens */
@media (max-width: 520px){
  #dock{
    width: min(92vw, 360px);
  }

  /* Move viewport-info up to avoid Tools button */
  .viewport-info{
    bottom: 3.2rem;
    left: .5rem;
  }

  /* Make panels more compact */
  .panel{
    padding: .6rem;
  }
  .panel h3{
    margin: .15rem 0 .5rem;
    font-size: 11px;
  }
}

/* Full-width drawer on extra small screens */
@media (max-width: 400px){
  #dock{
    width: 100%;
    max-width: calc(100vw - 40px);
  }
}

/* 4) If the toolbar inside the viewer ever overflows, allow wrapping */
.viewport-toolbar button { flex: 0 0 auto; }


/* Popover chip */
.help-pop{position:relative}
.help-pop > summary{list-style:none;cursor:pointer}
.help-pop > summary::-webkit-details-marker{display:none}
.help-pop > summary.chip{padding:.25rem .55rem;border:1px solid var(--line);border-radius:999px}
.help-pop[open] > summary.chip{background:#111826}

/* Popover panel */
.help-pop .pop{
  position:absolute;right:0;top:calc(100% + 8px);
  min-width:280px;max-width:360px;
  background:#0f1622;border:1px solid var(--line);border-radius:.6rem;
  padding:.6rem .75rem;box-shadow:0 10px 25px rgba(0,0,0,.45);z-index:20
}
.help-pop .pop-row{font-size:12.5px;color:#cbd5e1;margin:.2rem 0}
.help-pop .pop-row strong{color:#9fb0c4;font-weight:600}


/* Brand link behaves like homepage logo */
.appbar .brand a { color: inherit; text-decoration: none; }

/* Hide legacy acct strip chips except Credits */
#acctStrip #acctEmail,
#acctStrip #btnSignOut { display:none !important; }




/* ===== In-viewport toolbar & HUD ===== */
.viewport-toolbar-stack{
  position:absolute;
  top:.6rem;
  right:.6rem;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:.45rem;
  pointer-events:none;
  z-index:20;
  max-width:calc(100% - 1.2rem);
}
.viewport-toolbar{
  display:flex;
  gap:.3rem;
  flex-wrap:wrap;
  justify-content:flex-end;
  pointer-events:auto;
  width:100%;
  max-width:100%;
}
.viewport-toolbar button{
  background:#141b26;
  border:1px solid #263247;
  color:#cfe4ff;
  border-radius:.4rem;
  padding:.3rem .45rem;
  font-size:13px;
  transition:background .2s ease,border-color .2s ease,box-shadow .2s ease,color .2s ease;
}
.viewport-toolbar button.is-on,
.viewport-toolbar button[aria-pressed="true"]{
  color:#cfe4ff;
  border-color:rgba(255,153,0,.85);
  background:#141b26;
  box-shadow:0 0 0 1px rgba(255,153,0,.38),0 0 14px rgba(255,136,0,.52);
}
.viewport-info{position:absolute;bottom:.6rem;left:.6rem;font-size:12px;color:#7f8b98;z-index:15}

/* Make viewport toolbar more compact on mobile */
@media (max-width:760px){
  .viewport-toolbar-stack{
    top:.5rem;
    right:.5rem;
    gap:.35rem;
    max-width:calc(100% - 1rem);
  }
  .viewport-toolbar{
    gap:.25rem;
  }
  .viewport-toolbar button{
    padding:.25rem .38rem;
    font-size:12px;
    border-radius:.35rem;
  }
  .viewport-info{
    bottom:.5rem;
    left:.5rem;
    font-size:11px;
  }
}

@media (max-width:520px){
  .viewport-toolbar button{
    padding:.22rem .35rem;
    font-size:11px;
  }
}

/* ===== Details elements (if used) ===== */
details{border:1px solid #263247;background:#111826;border-radius:.6rem;margin:.5rem 0}
details summary{cursor:pointer;font-weight:700;color:#cfe4ff;padding:.5rem .6rem;list-style:none}
details > *:not(summary){padding:.6rem}

/* ===== Responsive ===== */
@media (max-width: 920px){
  .row{grid-template-columns:1fr}
  aside{order:2}
  main{order:1;min-height:60vh}
}

/* === Cookie Cutter Designs overlay ===================================== */
.designs-overlay { position: fixed; inset: 0; z-index: 60; display: none; }
.designs-overlay.open { display: grid; }

.designs-scrim {
  position: absolute; inset: 0;
  background: rgba(7,10,16,.72);
  backdrop-filter: blur(6px);
}

.designs-panel {
  position: relative; z-index: 1;
  margin: 5vh auto; max-width: 980px; width: calc(100% - 32px);
  background: linear-gradient(180deg,#0f141d,#0c1119);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.45);
  display: grid; grid-template-rows: auto 1fr;
}

.designs-head {
  display:flex; align-items:center; gap:.6rem;
  padding:.7rem .8rem; border-bottom:1px solid var(--line);
}
.designs-head h3 {
  margin:0; font-size:14px; color:var(--sub); letter-spacing:.4px; text-transform:uppercase;
}
.designs-head .spacer { margin-left:auto; }
.designs-head input[type="search"] {
  width: 280px; max-width: 40vw;
  background:#111826; border:1px solid #263247; color:#d7e3ee;
  border-radius:.5rem; padding:.42rem .55rem; font-size:13px;
}
.designs-close {
  background:#162030; border:1px solid #223145; color:#cfe4ff;
  border-radius:.5rem; padding:.35rem .6rem; font-size:13px; cursor:pointer;
}

.designs-grid {
  padding:.8rem; overflow:auto;
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.6rem;
}
@media (max-width:980px){ .designs-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:680px){ .designs-grid{ grid-template-columns:repeat(2,1fr); } }

/* Keep rows packed at the top; don't stretch them vertically */
.designs-grid{
  align-content: start;   /* ← key line */
  /* optional: also keep columns packed to the left */
  justify-content: start; /* or use: place-content: start; */
}



.design-card {
  display:flex; flex-direction:column; gap:.45rem;
  background:#111826; border:1px solid #263247; border-radius:.6rem; padding:.5rem;
  cursor:pointer; transition:border-color .15s ease, transform .06s ease;
}
.design-card:hover { border-color:#2f4a71; transform: translateY(-1px); }

/* Square thumbnail tiles (new) */
.design-card .thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;          /* force a square tile */
  background: #0b1119;          /* neutral dark pad behind art */
  border-radius: .4rem;
  overflow: hidden;
  display: grid;
  place-items: center;           /* center the image if it doesn’t fill */
}
.design-card__badge-row{
  min-height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.design-card__badge{
  background:#1d9b63;
  color:#f5fff7;
  font-size:11px;
  font-weight:700;
  padding:.25rem .6rem;
  border-radius:999px;
  letter-spacing:.03em;
  box-shadow:0 2px 4px rgba(0,0,0,.2);
}
.design-card .thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain;           /* no cropping; keep aspect */
  image-rendering: auto;
  display: block;
  background: transparent;
}

/* Prevent tall stretching of single-row grids */
.designs-grid{
  padding:.8rem; overflow:auto;
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.6rem;
  align-items: start;              /* ← new: cards keep intrinsic height */
}

/* Fallback: keep images square even without .thumb wrapper */
.design-card img{
  width:100%;
  aspect-ratio:1 / 1;
  height:auto;
  object-fit:contain;
  border-radius:.4rem;
  background:#0b1119;
  display:block;
}


.design-card .title {
  font-size:13px; color:#cfe1fb; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.designs-empty { padding:1rem; color:var(--ghost); }

/* === Designs overlay: two-column layout (sidebar + grid) === */
.designs-panel { display: grid; grid-template-rows: auto 1fr; }
.designs-body {
  display: grid;
  grid-template-columns: 220px 1fr;           /* sidebar | grid */
  gap: .8rem;
  padding: .8rem;
  min-height: 320px;
}

@media (max-width: 760px){
  .designs-body { grid-template-columns: 1fr; }
}

/* Sidebar styled like your left dock panels */
.designs-nav {
  border: 1px solid var(--line);
  background: #111826;
  border-radius: .6rem;
  overflow: hidden;
}

.designs-nav .nav-head {
  padding: .55rem .7rem;
  color: #8b99aa;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg,#111826,#0f1622);
}

.trace-tuner { position: fixed; inset: 0; z-index: 85; display: none; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 28px); }
.trace-tuner.is-open { display: flex; }
.trace-tuner__scrim { position: absolute; inset: 0; background: rgba(6,10,18,.78); backdrop-filter: blur(10px); }
.trace-tuner__panel { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); max-height: calc(100vh - 32px); background: radial-gradient(140% 120% at 14% 0%, rgba(38,86,126,.18) 0%, rgba(9,14,22,.96) 50%, rgba(7,12,20,.98) 100%); border: 1px solid rgba(92,138,214,.55); border-radius: 18px; box-shadow: 0 34px 80px rgba(4,8,20,.7); padding: clamp(18px,2vw,26px); display: grid; gap: 16px; overflow: hidden; }
.trace-tuner__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.trace-tuner__eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .2px; font-size: 11px; color: rgba(210,224,255,.72); }
.trace-tuner__title { margin: 0; font-size: 16px; color: #f4f7ff; letter-spacing: .2px; }
.trace-tuner__close { border: 1px solid rgba(116,156,228,.55); width: 36px; height: 36px; border-radius: 12px; background: rgba(12,18,30,.92); color: #e7efff; display: grid; place-items: center; font-size: 20px; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .2s ease; }
.trace-tuner__close:hover { transform: translateY(-1px); border-color: rgba(156,198,255,.85); background: rgba(22,32,48,.96); color: #fff; }
.trace-tuner__body { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(14px,2vw,20px); align-items: start; }
.trace-tuner__previews { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.trace-tuner__preview-card { background: linear-gradient(154deg, rgba(26,34,54,.92) 0%, rgba(18,24,40,.98) 100%); border: 1px solid rgba(76,120,194,.5); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(96,142,224,.15); padding: 12px; display: grid; gap: 8px; }
.trace-tuner__preview-label { font-size: 12px; letter-spacing: .3px; color: rgba(213,226,255,.72); text-transform: uppercase; }
.trace-tuner__preview-frame { position: relative; min-height: 220px; background: radial-gradient(120% 120% at 40% 10%, rgba(46,72,118,.2) 0%, rgba(14,20,36,.95) 42%, rgba(10,14,24,.98) 100%); border: 1px dashed rgba(108,148,220,.35); border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.trace-tuner__preview-img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; box-shadow: 0 16px 40px rgba(4,10,24,.55); }
.trace-tuner__preview-status { color: rgba(210,224,255,.72); font-size: 13px; text-align: center; padding: 8px 12px; }
.trace-tuner__svg { max-width: 100%; max-height: 340px; width: auto; height: auto; display: block; filter: drop-shadow(0 12px 28px rgba(10,16,32,.45)); }
.trace-tuner__controls { background: linear-gradient(164deg, rgba(20,30,50,.92) 0%, rgba(14,20,32,.98) 100%); border: 1px solid rgba(74,118,192,.55); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(122,168,248,.08), 0 18px 40px rgba(4,8,20,.6); padding: 14px 16px; display: grid; gap: 12px; }
.trace-tuner__mode { display: grid; gap: 8px; }
.trace-tuner__mode-label { font-size: 12px; letter-spacing: .2px; color: rgba(200,218,248,.76); }
.trace-tuner__mode-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 2px; border-radius: 12px; background: rgba(12,18,30,.9); border: 1px solid rgba(96,138,216,.4); }
.trace-tuner__mode-btn { border: 0; padding: 8px 10px; border-radius: 10px; background: transparent; color: #d6e4ff; font-size: 12px; letter-spacing: .1px; cursor: pointer; transition: background .16s ease, transform .12s ease, color .16s ease; }
.trace-tuner__mode-btn:hover { background: rgba(44,72,128,.35); color: #fff; transform: translateY(-1px); }
.trace-tuner__mode-btn.is-active { background: linear-gradient(135deg, #3d7be0 0%, #2e64c6 100%); color: #fff; box-shadow: 0 12px 26px rgba(40,90,190,.45); }
.trace-tuner__slider-row { display: grid; gap: 6px; }
.trace-tuner__slider-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.trace-tuner__slider-header label { color: #e4edff; font-size: 13px; }
.trace-tuner__value { font-size: 12px; color: rgba(206,222,255,.78); }
.trace-tuner__controls input[type=range] { width: 100%; accent-color: #6aa4ff; }
.trace-tuner__toggle { display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgba(210,226,255,.8); cursor: pointer; }
.trace-tuner__toggle input { width: 16px; height: 16px; accent-color: #6ea8ff; }
.trace-tuner__actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.trace-tuner__action-group { display: grid; grid-template-columns: repeat(2, auto); gap: 8px; justify-content: end; }
.trace-tuner.is-busy .trace-tuner__panel { opacity: .96; }
.trace-tuner-open #dock { pointer-events: none; }
@media (max-width: 1100px) {
  .trace-tuner__body { grid-template-columns: 1fr; }
  .trace-tuner__previews { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .trace-tuner__panel { padding: 14px; max-height: calc(100vh - 14px); }
  .trace-tuner__head { flex-direction: column; align-items: flex-start; }
  .trace-tuner__actions { grid-template-columns: 1fr; }
  .trace-tuner__action-group { grid-template-columns: 1fr; }
}
body.trace-tuner-open { overflow: hidden; }

.ai-picker { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: clamp(20px,4vw,36px); }
.ai-picker.is-open { display: flex; }
.ai-picker__scrim { position: absolute; inset: 0; background: rgba(7,10,16,.78); backdrop-filter: blur(10px); }
.ai-picker__panel { position: relative; z-index: 1; width: min(1320px, calc(100% - 64px)); max-height: calc(100vh - 64px); background: radial-gradient(160% 160% at 50% 0%, rgba(28,46,96,.22) 0%, rgba(12,18,34,.96) 42%, rgba(6,10,20,.98) 100%); border: 1px solid rgba(72,114,194,.5); border-radius: 24px; box-shadow: 0 42px 96px rgba(4,8,20,.68); padding: clamp(22px,2.2vw,30px); display: grid; grid-template-rows: auto 1fr; gap: clamp(18px,1.8vh,24px); overflow: hidden; }
.ai-picker__head { position: relative; display: grid; gap: clamp(12px,1.4vh,18px); }
.ai-picker__close { position: absolute; top: -6px; right: -6px; width: 38px; height: 38px; border-radius: 14px; border: 1px solid rgba(90,130,206,.6); background: rgba(14,22,38,.92); color: #e4ecff; display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .12s ease; box-shadow: 0 16px 32px rgba(6,10,20,.55); }
.ai-picker__close:focus-visible { outline: none; border-color: rgba(146,188,255,.85); box-shadow: 0 0 0 3px rgba(80,120,210,.4); }
.ai-picker__close:hover { background: rgba(32,46,78,.96); border-color: rgba(130,172,244,.75); color: #fff; transform: translateY(-1px); }
.ai-picker__head-main { display: flex; flex-wrap: wrap; gap: clamp(12px,1.8vw,18px); align-items: center; justify-content: space-between; padding-right: 44px; }
.ai-picker__headings { display: grid; gap: 6px; }
.ai-picker__head h3 { margin: 0; font-size: 15px; letter-spacing: 0; text-transform: none; color: #e6efff; font-weight: 600; }
.ai-picker__title-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; background: rgba(96,132,210,.22); border: 1px solid rgba(134,178,255,.45); box-shadow: inset 0 0 0 1px rgba(134,178,255,.2), 0 12px 28px rgba(12,20,46,.45); text-transform: uppercase; letter-spacing: .5px; color: inherit; }
.ai-picker__title-chip::before { content: "✨"; font-size: 14px; }
.ai-picker__subtitle { margin: 0; font-size: 13px; color: rgba(214,227,255,.75); letter-spacing: .2px; }
.ai-picker__headings { flex: 1 1 clamp(280px, 40vw, 520px); }
.ai-picker__search { margin: 0; flex: 0 1 clamp(320px, 32vw, 420px); }
.ai-picker__search-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 14px; background: rgba(20,28,48,.92); border: 1px solid rgba(90,130,206,.45); box-shadow: inset 0 0 0 1px rgba(58,94,166,.2), 0 14px 28px rgba(6,10,20,.5); }
.ai-picker__search-field input[type=search] { flex: 1; min-width: 0; background: transparent; border: 0; color: #f1f6ff; font-size: 13px; outline: none; padding: 6px 0; }
.ai-picker__search-field:focus-within { border-color: rgba(132,172,246,.75); box-shadow: inset 0 0 0 1px rgba(92,138,222,.55), 0 0 0 4px rgba(72,118,216,.28), 0 22px 46px rgba(6,10,20,.6); }
.ai-picker__search-field input[type=search]::placeholder { color: rgba(205,219,243,.55); }
.ai-picker__refresh { padding: 0; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; box-shadow: 0 16px 32px rgba(49,95,255,.28); }
.ai-picker__grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  grid-auto-rows: 1fr;
  gap: clamp(18px,1.6vw,22px);
  align-items: stretch;
  justify-items: stretch;
  padding: 0 clamp(6px,1vw,18px) clamp(20px,4vh,32px);
  overflow-y: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}
.ai-picker__tile { position: relative; display: grid; grid-template-rows: minmax(0,1fr) auto auto; gap: 14px; padding: 18px; background: linear-gradient(184deg, rgba(24,36,60,.96) 0%, rgba(14,22,40,.99) 100%); border: 1px solid rgba(66,104,170,.6); border-radius: 20px; box-shadow: 0 26px 52px rgba(4,8,20,.62); transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease; }
.ai-picker__tile.is-ready:hover { border-color: rgba(118,168,255,.8); box-shadow: 0 22px 48px rgba(10,20,40,.65); transform: translateY(-2px); }
.ai-picker__thumb { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: rgba(240,245,255,.9); border: 1px solid rgba(174,196,232,.5); box-shadow: inset 0 0 0 1px rgba(208,222,248,.45); }
.ai-picker__preview { width: 100%; height: 100%; display: none; align-items: center; justify-content: center; background: transparent; }
.ai-picker__preview > svg,
.ai-picker__preview > img,
.ai-picker__preview > canvas { max-width: 90%; max-height: 90%; width: auto; height: auto; display: block; filter: drop-shadow(0 8px 18px rgba(17,27,44,.28)); }
.ai-picker__tile.is-ready .ai-picker__preview { display: flex; }
.ai-picker__tile.is-switching .ai-picker__preview { opacity: .45; }
.ai-picker__spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(160,198,255,.22); border-top-color: #88b5ff; animation: ai-picker-spin .8s linear infinite; }
.ai-picker__tile:not(.is-loading) .ai-picker__spinner { display: none; }
.ai-picker__tile.is-switching .ai-picker__spinner { display: block; }
.ai-picker__retry { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 12px; background: rgba(13,20,34,.92); border: 1px solid rgba(118,158,228,.6); color: #d6e4ff; font-size: 16px; display: none; align-items: center; justify-content: center; cursor: pointer; transition: background .2s ease,border-color .2s ease,color .2s ease; }
.ai-picker__retry:hover { background: rgba(24,34,53,.95); border-color: rgba(148,188,248,.75); color: #fff; }
.ai-picker__tile.is-error .ai-picker__retry { display: flex; }
.ai-picker__status { font-size: 12px; color: rgba(199,214,239,.8); min-height: 32px; display: flex; align-items: center; justify-content: center; text-align: center; }
.ai-picker__status:empty::after { content: '\00a0'; }
.ai-picker__tile.is-error .ai-picker__status { color: #f6bcbc; }
.ai-picker__tile.is-ready .ai-picker__status { color: #d9e6ff; }
.ai-picker__actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: center; justify-items: stretch; }
.ai-picker__actions .btn { min-width: 0; padding: 8px 12px; font-size: 12px; line-height: 1.2; justify-content: center; }
.ai-picker__status { grid-column: 1 / -1; min-height: 24px; }
.ai-picker__draw[aria-busy="true"] { opacity: .65; pointer-events: none; }
.ai-picker__tile.is-loading .ai-picker__select,
.ai-picker__tile.is-error .ai-picker__select { opacity: .55; pointer-events: none; }
.ai-picker__tile.is-loading .ai-picker__draw,
.ai-picker__tile.is-error .ai-picker__draw { opacity: .55; pointer-events: none; }
.ai-picker__modes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 2px; background: rgba(14,22,38,.88); border-radius: 999px; border: 1px solid rgba(74,118,196,.45); }
.ai-picker__mode { position: relative; flex: 1 1 auto; min-width: 0; padding: 6px 10px; font-size: 11px; line-height: 1.3; border-radius: 999px; border: 1px solid transparent; background: transparent; color: #cfe1fb; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .12s ease; letter-spacing: .2px; }
.ai-picker__mode:hover:not([disabled]) { background: rgba(36,52,82,.96); color: #fff; transform: translateY(-1px); }
.ai-picker__mode.is-active { background: rgba(58,108,228,.95); border-color: rgba(108,148,228,.8); color: #fff; box-shadow: inset 0 0 0 1px rgba(162,192,255,.5); }
.ai-picker__mode:disabled { opacity: .45; cursor: default; transform: none; }
.ai-picker__mode[aria-busy="true"] { opacity: .6; cursor: progress; }
.ai-picker__mode[data-mode-state="error"]:not(.is-active) { border-color: rgba(214,92,92,.75); color: #f6c7c7; }
.ai-picker__mode[data-mode-state="error"]:not(.is-active):hover:not([disabled]) { background: rgba(86,26,30,.85); border-color: rgba(230,124,124,.85); color: #fff; }

@media (max-width: 960px){
  .ai-picker__grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px){
  .ai-picker { align-items: flex-start; }
  .ai-picker__panel { width: calc(100% - 32px); max-height: calc(100vh - 32px); height: calc(100vh - 32px); padding: 20px; }
}

@media (max-width: 560px){
  .ai-picker { padding: 16px; }
  .ai-picker__panel {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    height: calc(100vh - 16px);
    padding: 18px;
    gap: 16px;
  }
  .ai-picker__head-main { flex-direction: column; align-items: stretch; padding-right: 0; }
  .ai-picker__close { top: -4px; right: -4px; }
  .ai-picker__headings { flex-basis: auto; }
  .ai-picker__search { flex: 1 1 auto; }
  .ai-picker__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
    padding: 0 clamp(6px,4vw,18px) clamp(20px,10vh,36px);
  }
  .ai-picker__actions { grid-template-columns: 1fr; }
}

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

body.ai-picker-open { overflow: hidden; }

.designs-tree {
  padding: .4rem .4rem .6rem;
  display: grid;
  gap: .35rem;
}

/* Top-level groups mimic <details.panel>/<summary> look */
.cat-top {
  border: 1px solid var(--line);
  background: #0f1622;
  border-radius: .5rem;
  overflow: hidden;
}
.cat-top summary {
  cursor: pointer;
  list-style: none;
  padding: .45rem .55rem;
  color: #cfe1fb;
  display: flex; align-items: center; gap: .4rem;
}
.cat-top summary::-webkit-details-marker { display: none; }
.cat-top summary .count {
  margin-left: auto;
  color: var(--ghost);
  font-size: 12px;
}

/* Subcategory list */
.cat-sub {
  border-top: 1px solid var(--line);
  background: #111826;
  padding: .35rem;
  display: grid; gap: .3rem;
}
.cat-sub button {
  text-align: left;
  background: #141b26;
  border: 1px solid #263247;
  color: #cfe1fb;
  border-radius: .4rem;
  padding: .32rem .45rem;
  font-size: 13px;
  cursor: pointer;
}
.cat-sub button:hover { border-color:#2f4a71; }
.cat-sub button.is-active {
  border-color:#2f4a71;
  box-shadow: 0 0 0 1px rgba(103,179,255,.15) inset;
}

/* “All” filter button */
.cat-all {
  margin: .35rem .35rem 0;
  display: block;
  width: calc(100% - .7rem);
  text-align: center;
  background:#162030;
  border:1px solid #223145;
  color:#cfe4ff;
  border-radius:.45rem;
  padding:.35rem .45rem;
  font-size:13px;
  cursor:pointer;
}
.cat-all:hover { border-color:#2f4a71; }

/* Grid keeps cards at intrinsic height (no tall stretch) */
.designs-grid {
  align-items: start; /* already added earlier; repeat here for clarity */
}

/* Square thumbnail wrapper (already added; kept for completeness) */
.design-card .thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0b1119;
  border-radius: .4rem;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.design-card .thumb img{
  width: 100%; height: 100%; object-fit: contain; display: block;
}

/* Account menu should never show until logged in */
.acctMenuRoot { display: none !important; }

/* Only show it when it's inside our strip AND marked as logged in */
#acctStrip .acctMenuRoot.logged-in { display: inline-flex !important; }

/* We only want Credits visible next to the auth control; keep email & the old Sign out hidden */
#acctStrip #acctEmail,
#acctStrip #btnSignOut { display: none !important; }

.export-confirm{display:flex;flex-direction:column;gap:1.1rem;}
.export-confirm__card{display:flex;gap:1rem;align-items:flex-start;padding:1rem;border-radius:16px;background:linear-gradient(165deg,rgba(17,27,43,.94),rgba(10,16,28,.94));border:1px solid rgba(102,142,198,.28);box-shadow:inset 0 0 0 1px rgba(38,58,92,.35);flex-wrap:wrap;}
.export-confirm__thumb{width:152px;max-width:100%;aspect-ratio:4/3;border-radius:12px;overflow:hidden;background:radial-gradient(circle at 30% 30%,rgba(92,143,211,.38),rgba(14,22,36,.9));border:1px solid rgba(116,166,233,.3);box-shadow:0 14px 30px rgba(5,9,18,.45);display:flex;align-items:center;justify-content:center;}
.export-confirm__thumb img{display:block;width:100%;height:100%;object-fit:cover;}
.export-confirm__thumb--empty{font-size:12px;color:#8da2bb;letter-spacing:.02em;text-transform:uppercase;background:rgba(18,28,44,.72);border-style:dashed;}
.export-confirm__details{display:flex;flex-direction:column;gap:.5rem;min-width:0;flex:1 1 220px;}
.export-confirm__eyebrow{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:#7fa8e0;font-weight:600;}
.export-confirm__title{margin:0;font-size:18px;font-weight:600;color:#f4f8ff;letter-spacing:-.01em;}
.export-confirm__meta{display:flex;flex-wrap:wrap;gap:.5rem;font-size:12.5px;color:#9fb3c6;align-items:center;}
.export-confirm__meta-sep{color:#41516a;}
.export-confirm__meta-item--free{display:inline-flex;gap:.4rem;align-items:center;color:#72f0b5;}
.export-confirm__summary{display:flex;flex-wrap:wrap;gap:.9rem;padding:.9rem 1rem;border-radius:14px;background:rgba(14,22,36,.78);border:1px solid rgba(87,128,189,.28);box-shadow:inset 0 0 0 1px rgba(32,49,78,.32);}
.export-confirm__summary-item{display:flex;flex-direction:column;gap:.25rem;min-width:140px;}
.export-confirm__summary-label{font-size:12px;color:#7f97b7;text-transform:uppercase;letter-spacing:.08em;}
.export-confirm__summary-value{font-size:16px;color:#e8f1ff;font-weight:600;}
.export-confirm__summary-value--free{color:#72f0b5;}
.export-confirm__strike{text-decoration:line-through;opacity:.55;}
.export-confirm__free{font-weight:700;}
.export-confirm__checklist{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:.35rem;}
.export-confirm__check{display:flex;gap:.45rem;align-items:flex-start;padding:.4rem .6rem;border-radius:10px;background:rgba(15,23,38,.65);border:1px solid rgba(71,108,168,.26);}
.export-confirm__check-icon{display:inline-flex;width:20px;height:20px;border-radius:999px;background:rgba(74,191,141,.16);color:#66f1b6;font-size:12px;font-weight:700;align-items:center;justify-content:center;margin-top:.15rem;line-height:1;}
.export-confirm__check-icon--warn{background:transparent;color:#ffd034;font-size:14px;font-weight:700;width:20px;height:20px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;margin-top:.15rem;margin-left:0;padding:0;}
.export-confirm__check-text{font-size:12px;color:#9fb3c6;line-height:1.35;}
.export-confirm__check-text strong{display:inline;font-size:12px;color:#f1f6ff;font-weight:600;margin-right:.3rem;}
.buy-credits{display:flex;flex-direction:column;gap:1rem;max-width:520px;width:100%;}
.buy-credits__card{padding:1.1rem;border-radius:18px;background:linear-gradient(165deg,rgba(17,27,45,.96),rgba(5,9,18,.92));border:1px solid rgba(92,139,207,.35);box-shadow:inset 0 0 0 1px rgba(32,53,93,.38);}
.buy-credits__eyebrow{display:block;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:#7fa8e0;margin-bottom:.45rem;}
.buy-credits__title{margin:0 0 .4rem;font-size:20px;font-weight:600;color:#f4f8ff;letter-spacing:-.015em;}
.buy-credits__text{margin:0;font-size:13.5px;color:#a9bed9;line-height:1.55;}
.buy-credits__section{display:flex;flex-direction:column;gap:.35rem;}
.buy-credits__section-label{font-size:12px;color:#7f97b7;text-transform:uppercase;letter-spacing:.12em;}
.buy-credits__options{display:flex;flex-direction:column;gap:.65rem;}
.buy-credits__option{display:block;cursor:pointer;position:relative;}
.buy-credits__option-input{position:absolute;opacity:0;pointer-events:none;}
.buy-credits__option-body{display:flex;gap:.75rem;align-items:flex-start;padding:.85rem 1rem;border-radius:16px;background:rgba(13,20,34,.9);border:1px solid rgba(68,104,164,.45);box-shadow:inset 0 0 0 1px rgba(25,38,64,.78);transition:background .2s,border-color .2s,box-shadow .2s;}
.buy-credits__option:hover .buy-credits__option-body{border-color:rgba(118,167,244,.75);}
.buy-credits__option-indicator{width:18px;height:18px;border-radius:999px;border:2px solid rgba(118,152,205,.72);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:.2rem;position:relative;}
.buy-credits__option-indicator::after{content:'';width:8px;height:8px;border-radius:999px;background:#7ed3ff;opacity:0;transition:opacity .2s;}
.buy-credits__option-input:checked + .buy-credits__option-body{border-color:rgba(127,208,255,.92);box-shadow:0 0 0 1px rgba(111,195,255,.42),inset 0 0 0 1px rgba(33,56,96,.92);}
.buy-credits__option-input:checked + .buy-credits__option-body .buy-credits__option-indicator{border-color:#7ed3ff;}
.buy-credits__option-input:checked + .buy-credits__option-body .buy-credits__option-indicator::after{opacity:1;}
.buy-credits__option-content{flex:1;display:flex;flex-direction:column;gap:.25rem;}
.buy-credits__option-line{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;}
.buy-credits__option-title{font-size:15px;font-weight:600;color:#f2f7ff;}
.buy-credits__option-price{margin-left:auto;font-size:15px;font-weight:600;color:#b6e2ff;}
.buy-credits__option-sub{font-size:12px;color:#8fa6c6;}
.buy-credits__note{margin:0;font-size:12px;color:#7f97b7;}
@media (max-width:600px){
  .export-confirm__card{padding:.85rem;gap:.85rem;}
  .export-confirm__thumb{width:100%;max-height:180px;}
  .export-confirm__summary{flex-direction:column;gap:.7rem;}
  .buy-credits__card{padding:.95rem;}
}

.toast-stack{position:fixed;top:16px;right:16px;display:flex;flex-direction:column;gap:.6rem;z-index:120;pointer-events:none;}
.toast{min-width:220px;max-width:320px;background:rgba(15,22,32,.95);color:#e6edf7;border:1px solid #2f4059;border-radius:12px;padding:.75rem 1rem;box-shadow:0 18px 38px rgba(0,0,0,.35);font-size:13px;line-height:1.45;pointer-events:auto;opacity:0;transform:translateY(-10px);animation:toast-in .25s ease forwards;}
.toast--success{border-color:#2d8f66;color:#dff9ee;}
.toast--error{border-color:#bf4a52;color:#ffd6d6;}
.toast__headline{margin:0;font-weight:600;font-size:13.5px;}
.toast__body{margin:.35rem 0 0;font-size:12.5px;color:#a9b7c8;}
.toast[data-leaving="true"]{animation:toast-out .18s ease forwards;}
@keyframes toast-in{to{opacity:1;transform:translateY(0);}}
@keyframes toast-out{to{opacity:0;transform:translateY(-8px);}}

.order-items {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  color: #9fb3c6;
  font-size: 13px;
  line-height: 1.4;
}
.order-items li + li {
  margin-top: 0.25rem;
}

/* ===== Custom Color Picker Popover ===== */
.color-picker-popover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: none; /* keep app sharp when picker is open */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.color-picker-popover[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.color-picker-popover__content {
  background: linear-gradient(180deg, #1a2332, #141c28);
  border: 1px solid rgba(114, 150, 205, 0.25);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 340px;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.color-picker-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2ebf8;
  font-weight: 600;
  font-size: 15px;
}

.color-picker-popover__close {
  background: transparent;
  border: none;
  color: #9fb3c6;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.color-picker-popover__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.color-picker-popover__body {
  padding: 18px;
}

/* Preview & Hex Input */
.color-picker-preview {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.color-picker-preview__swatch {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.color-picker-preview__hex {
  flex: 1;
  background: #0c1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e8f0fa;
  font-size: 16px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  padding: 12px 14px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.color-picker-preview__hex::placeholder {
  color: #5a6b7e;
  opacity: 1;
}

.color-picker-preview__hex:focus {
  outline: none;
  border-color: rgba(103, 179, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(103, 179, 255, 0.15);
  background: #0f141b;
}

.color-picker-preview__hex.error {
  border-color: rgba(255, 100, 100, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 100, 100, 0.15);
}

/* Saturation/Lightness Gradient Picker */
.color-picker-gradient {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 8px;
  margin-bottom: 14px;
  cursor: crosshair;
  background: linear-gradient(to bottom, transparent, #000),
              linear-gradient(to right, #fff, transparent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  user-select: none;
}

.color-picker-gradient__handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4),
              inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.08s ease;
}

.color-picker-gradient:active .color-picker-gradient__handle {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Hue Slider */
.color-picker-hue {
  margin-bottom: 16px;
  height: 14px;
  border-radius: 7px;
  position: relative;
  background: linear-gradient(to right,
    #ff0000 0%, #ffff00 17%, #00ff00 33%,
    #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.color-picker-hue input[type="range"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.color-picker-hue::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  top: 50%;
  left: var(--hue-position, 0%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* RGB Inputs */
.color-picker-rgb {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.color-picker-rgb__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-picker-rgb__group label {
  color: #9fb3c6;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-picker-rgb__group input {
  background: #0c1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #e8f0fa;
  font-size: 14px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  padding: 8px 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.color-picker-rgb__group input:focus {
  outline: none;
  border-color: rgba(103, 179, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(103, 179, 255, 0.12);
  background: #0f141b;
}

/* Remove spinners for number inputs */
.color-picker-rgb__group input::-webkit-outer-spin-button,
.color-picker-rgb__group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.color-picker-rgb__group input[type=number] {
  -moz-appearance: textfield;
}
