:root{
  --bg:#0f172a; --panel:#ffffff; --ink:#334155; --heading:#0f172a; --muted:#64748b;
  --line:#e2e8f0; --primary:#2563eb; --primary-d:#1d4ed8; --danger:#dc2626;
  --ok:#16a34a; --warn:#d97706; --soft:#f8fafc; --bg-page:#edf1f7;
  /* "UDON Iris" palette — the app's signature gradient family (see memory:
     udon-color-palette). Iris = everyday primary actions; Twilight = the big
     launch/submit CTA; lavender ring = focus/glow accents. */
  --iris-a:#6d6af8; --iris-b:#9a5cf5;         /* primary gradient (periwinkle→orchid) */
  --iris-a-d:#5a57ea; --iris-b-d:#8747e6;     /* hover (deepened) */
  --twilight-a:#8b5cf6; --twilight-b:#4338ca; /* submit/launch gradient (violet→indigo) */
  --iris-ink:#1e1b4b;                          /* deep indigo ink (dark chrome) */
  --iris-ring:rgba(154,92,245,.28);            /* lavender glow ring */
}
*{box-sizing:border-box}
body{margin:0;font:15px/1.5 "Geist",-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);background:var(--bg-page)}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.topbar{display:grid;grid-template-columns:1fr minmax(0,auto) 1fr;align-items:center;gap:12px;
  background:var(--panel);color:var(--ink);padding:10px 20px;
  border-bottom:1px solid var(--line);box-shadow:0 1px 3px rgba(15,23,42,.05)}
.topbar-left{justify-self:start}
.topbar-center{justify-self:center;min-width:0}
.topbar-right{justify-self:end;display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.topbar .brand{display:inline-flex;align-items:center;gap:9px;color:#000;font-weight:700;font-size:18px;letter-spacing:-.02em}
.topbar .brand:hover{text-decoration:none}
.brand-icon{width:24px;height:24px;border-radius:6px;display:block;flex:none}
/* scoped so it styles only the logged-out Log in / Register links, not the account chip */
.topbar-right>a:not(.account-chip){color:var(--muted)}
.topbar-right>a:not(.account-chip):hover{color:var(--ink)}

/* ── Glow-menu center nav (vanilla port of 21st.dev/spoonyvu/glow-menu) ─
   A translucent rounded pill of menu links with an animated blue "glow" bloom
   that glides behind the active — or hovered/focused — item. `.tl-glow` is
   injected by base.html; JS sets its width/transform, this CSS springs it into
   place. No-JS fallback: the active item keeps a static tinted pill. */
.tubelight-nav{position:relative;display:flex;align-items:center;gap:4px;
  background:var(--soft);border:1px solid var(--line);
  border-radius:999px;padding:5px;
  box-shadow:inset 0 1px 2px rgba(15,23,42,.03);max-width:100%;overflow-x:auto;scrollbar-width:none}
.tubelight-nav::-webkit-scrollbar{display:none}
.tl-glow{position:absolute;top:4px;bottom:4px;left:0;width:0;border-radius:999px;
  background:linear-gradient(180deg,#eff6ff,#dbe8ff);
  box-shadow:0 0 0 1px rgba(37,99,235,.16),0 2px 10px rgba(37,99,235,.30),
             0 0 22px 2px rgba(59,130,246,.30);
  opacity:0;pointer-events:none;z-index:0;
  transition:transform .38s cubic-bezier(.34,1.42,.5,1),
             width .38s cubic-bezier(.34,1.42,.5,1),opacity .25s ease}
.tubelight-nav.glow-ready .tl-glow{opacity:1}
.tl-item{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;
  padding:7px 17px;border-radius:999px;font-size:13.5px;font-weight:600;line-height:1;
  color:var(--muted);white-space:nowrap;transition:color .2s ease}
.tl-item:hover{color:var(--ink);text-decoration:none}
.tl-item.active{color:var(--primary-d)}
.tubelight-nav.glow-ready .tl-item:hover,
.tubelight-nav.glow-ready .tl-item:focus-visible{color:var(--primary-d)}
/* no-JS fallback: static hover/active tint when the glow can't animate */
.tubelight-nav:not(.glow-ready) .tl-item:hover{background:rgba(15,23,42,.05)}
.tubelight-nav:not(.glow-ready) .tl-item.active{background:#eff6ff}
@media(prefers-reduced-motion:reduce){.tl-glow{transition:opacity .2s ease}}
/* centered, prominent, clickable account chip → /account */
.account-chip{display:inline-flex;align-items:center;gap:8px;color:var(--ink);font-weight:700;font-size:15px;
  background:var(--soft);border:1px solid var(--line);
  padding:6px 14px;border-radius:999px;transition:background .15s,border-color .15s}
.account-chip:hover{background:#f1f5f9;border-color:#cbd5e1;text-decoration:none}
.account-chip .acct-icon{display:inline-flex;align-items:center;color:#22c55e}
.account-chip:hover .acct-icon{color:#4ade80}
.account-chip .acct-role{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;
  background:var(--primary);color:#fff;padding:2px 7px;border-radius:999px}
/* instant hover tooltip + Guide toggle */
.uds-tip{position:fixed;z-index:9999;max-width:280px;background:#111827;color:#fff;
  padding:7px 10px;border-radius:8px;font:500 12.5px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  box-shadow:0 8px 24px rgba(0,0,0,.28);pointer-events:none;display:none;white-space:normal}
/* Guide toggle — pressable "keycap" toggle (Uiverse-inspired). GREEN when ON:
   green is reserved for utility toggles, distinguishing them from the iris
   action buttons. Inset shadow = popped out; hover/on flips it to pressed-in
   and the label lifts 2px. */
.guide-toggle{position:relative;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;
  gap:6px;cursor:pointer;user-select:none;height:32px;min-width:86px;padding:2px 12px;
  border:none;border-radius:8px;background:rgba(15,23,42,.12);color:#54657a;
  font-size:13px;font-weight:700;
  box-shadow:rgba(0,0,0,.15) 0 2px 1px 0 inset,rgba(255,255,255,.6) 0 1px 1px 0;
  transition:color .3s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1),
             box-shadow .3s cubic-bezier(.25,.8,.25,1)}
.guide-toggle .g-ic,.guide-toggle .g-tx{pointer-events:none;
  transition:transform .3s cubic-bezier(.25,.8,.25,1)}
.guide-toggle .g-ic{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;
  border-radius:50%;border:1.5px solid currentColor;font-size:10px;font-weight:800;line-height:1}
.guide-toggle:hover{background:#334155;color:#fff;
  box-shadow:rgba(0,0,0,.23) 0 -4px 1px 0 inset,rgba(255,255,255,.17) 0 -1px 1px 0,rgba(0,0,0,.17) 0 2px 4px 1px}
.guide-toggle:hover .g-ic,.guide-toggle:hover .g-tx{transform:translateY(-2px)}
.guide-toggle.on{background:#2d6737;color:#fff;
  box-shadow:rgba(0,0,0,.23) 0 -4px 1px 0 inset,rgba(255,255,255,.17) 0 -1px 1px 0,rgba(0,0,0,.17) 0 2px 4px 1px}
.guide-toggle.on .g-ic,.guide-toggle.on .g-tx{transform:translateY(-2px)}
.guide-toggle.on:hover{background:#34723f;
  box-shadow:rgba(0,0,0,.26) 0 -4px 1px 0 inset,rgba(255,255,255,.17) 0 -1px 1px 0,rgba(0,0,0,.15) 0 3px 6px 2px}
/* language switcher */
.lang-menu{position:relative}
.lang-menu>summary{list-style:none;cursor:pointer;color:var(--muted);font-size:13px;
  display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:8px;
  border:1px solid var(--line)}
.lang-menu>summary::-webkit-details-marker{display:none}
.lang-menu>summary:hover{color:var(--ink);background:#f1f5f9}
.lang-pop{position:absolute;right:0;top:calc(100% + 6px);z-index:50;min-width:140px;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:6px;
  box-shadow:0 10px 30px rgba(0,0,0,.18)}
.lang-pop a{display:block;color:var(--text,#1f2937);padding:8px 12px;border-radius:7px;font-size:14px}
.lang-pop a:hover{background:#f1f5f9;text-decoration:none}
.lang-pop a.on{font-weight:700;color:var(--primary);background:#eff6ff}
@media(max-width:760px){
  .topbar{grid-template-columns:1fr auto;row-gap:8px}
  .topbar-center{grid-column:1/-1;grid-row:2;justify-self:center}
}
.container{max-width:1400px;margin:32px auto;padding:0 24px}
h1{font-size:28px;line-height:1.2;margin:0 0 18px}

/* ── Auth pages (login): branded split card on a soft gradient field ───────── */
.container.auth-main{max-width:none;margin:0;padding:0}
.auth-wrap{position:relative;min-height:calc(100dvh - 120px);display:grid;place-items:center;
  padding:40px 16px;overflow:hidden}
.auth-wrap::before,.auth-wrap::after{content:"";position:absolute;border-radius:50%;
  filter:blur(70px);opacity:.5;z-index:0;pointer-events:none}
.auth-wrap::before{width:420px;height:420px;background:#bfdbfe;top:-130px;left:-90px}
.auth-wrap::after{width:380px;height:380px;background:#c7d2fe;bottom:-130px;right:-70px}
.auth-card{position:relative;z-index:1;display:grid;grid-template-columns:1.05fr 1fr;
  width:min(880px,100%);background:#fff;border:1px solid var(--line);border-radius:20px;
  box-shadow:0 24px 60px rgba(15,23,42,.15),0 4px 12px rgba(15,23,42,.06);overflow:hidden}
.auth-brand{background:linear-gradient(155deg,#1d4ed8,#2563eb 45%,#3b82f6);color:#fff;
  padding:42px 36px;display:flex;flex-direction:column;gap:16px}
.auth-logo{width:52px;height:52px;border-radius:13px;background:rgba(255,255,255,.16);padding:8px;box-sizing:border-box}
.auth-brand-name{font-size:22px;font-weight:800;letter-spacing:-.02em}
.auth-brand-tag{margin:0;font-size:14px;line-height:1.55;color:rgba(255,255,255,.9)}
.auth-brand-points{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-direction:column;gap:11px}
.auth-brand-points li{position:relative;padding-left:27px;font-size:13.5px;line-height:1.4;color:rgba(255,255,255,.94)}
.auth-brand-points li::before{content:"✓";position:absolute;left:0;top:1px;width:18px;height:18px;
  display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.22);
  border-radius:50%;font-size:11px;font-weight:800}
.auth-form{padding:42px 40px;display:flex;flex-direction:column}
.auth-form h1{margin:0 0 4px;font-size:24px}
.auth-sub{margin:0 0 20px;color:var(--muted);font-size:14px}
.auth-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.auth-field>span{font-size:13px;font-weight:600;color:var(--ink)}
.auth-input{position:relative;display:flex;align-items:center}
.auth-input>svg{position:absolute;left:12px;color:var(--muted);pointer-events:none}
.auth-input input{width:100%;padding:11px 12px 11px 38px;border:1px solid var(--line);border-radius:10px;
  font:inherit;font-size:14px;color:var(--ink);background:#fff;transition:border-color .15s,box-shadow .15s}
.auth-input input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
.auth-eye{position:absolute;right:7px;background:none;border:0;cursor:pointer;color:var(--muted);
  padding:6px;border-radius:7px;line-height:0;display:flex}
.auth-eye:hover{color:var(--ink);background:#f1f5f9}
.auth-eye.on{color:var(--primary)}
.auth-submit{margin-top:6px;width:100%;justify-content:center;padding:12px;font-size:15px;border-radius:10px}
.auth-form .hint,.auth-form .error{margin:0 0 14px}
.auth-alt{margin:18px 0 0;font-size:14px;color:var(--muted);text-align:center}
@media(max-width:720px){
  .auth-card{grid-template-columns:1fr;width:min(440px,100%)}
  .auth-brand{display:none}
  .auth-form{padding:32px 26px}
}

/* ── Blocking loader overlay (for slow AI / UDON / trend actions) ──────────── */
.app-loader{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;
  background:rgba(237,241,247,.66);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
.app-loader.show{display:flex}
.app-loader-box{display:flex;flex-direction:column;align-items:center;gap:16px;background:#fff;
  border:1px solid var(--line);border-radius:16px;padding:26px 34px;box-shadow:0 20px 50px rgba(15,23,42,.18)}
.loader-msg{font-size:14px;font-weight:600;color:var(--ink);text-align:center;max-width:280px;line-height:1.4}
.loader-msg:empty{display:none}
.dots-loader{display:flex;align-items:center;justify-content:center}
.dots-loader .dot{height:16px;width:16px;margin-right:10px;border-radius:50%;background:#b3d4fc;
  animation:loader-pulse 1.5s infinite ease-in-out}
.dots-loader .dot:last-child{margin-right:0}
.dots-loader .dot:nth-child(1){animation-delay:-.3s}
.dots-loader .dot:nth-child(2){animation-delay:-.1s}
.dots-loader .dot:nth-child(3){animation-delay:.1s}
.dots-loader .dot:nth-child(4){animation-delay:.3s}
.dots-loader .dot:nth-child(5){animation-delay:.5s}
@keyframes loader-pulse{
  0%{transform:scale(.8);background:#b3d4fc;box-shadow:0 0 0 0 rgba(178,212,252,.7)}
  50%{transform:scale(1.2);background:#6793fb;box-shadow:0 0 0 10px rgba(178,212,252,0)}
  100%{transform:scale(.8);background:#b3d4fc;box-shadow:0 0 0 0 rgba(178,212,252,.7)}
}
@media(prefers-reduced-motion:reduce){.dots-loader .dot{animation-duration:2.6s}}
h2{font-size:20px;line-height:1.3;margin:0 0 14px}
.muted{color:var(--muted)}
.small{font-size:13px}
.error{background:#fef2f2;color:var(--danger);padding:10px 12px;border-radius:8px;border:1px solid #fecaca}
.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;
  padding:22px;margin-bottom:20px;box-shadow:0 1px 2px rgba(15,23,42,.05),0 4px 16px rgba(15,23,42,.03)}
.card.narrow{max-width:380px;margin:48px auto}
.card.empty{text-align:center;padding:40px}
.row{display:flex;gap:12px}
.row.gap{gap:12px}.row.between{justify-content:space-between}.row.center{align-items:center}
.spacer{flex:1}
.right{text-align:right}
label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted);font-weight:600}
input,select{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;
  color:var(--ink);background:#fff}
input:focus,select:focus{outline:2px solid #bfdbfe;border-color:var(--primary)}
form label{margin-bottom:12px}
.btn{display:inline-flex;align-items:center;gap:6px;cursor:pointer;border:1px solid var(--line);
  background:#fff;color:var(--ink);padding:9px 14px;border-radius:8px;font-weight:600;font-size:14px}
.btn:hover{background:#f3f4f6}
.btn.primary{background:linear-gradient(135deg,var(--iris-a),var(--iris-b));
  border-color:transparent;color:#fff;box-shadow:0 2px 8px rgba(122,92,245,.28)}
.btn.primary:hover{background:linear-gradient(135deg,var(--iris-a-d),var(--iris-b-d));
  box-shadow:0 4px 14px rgba(122,92,245,.38)}
/* The big "launch" CTA (Submit to UDON team) — deeper twilight gradient. */
.btn.primary.btn-launch{background:linear-gradient(135deg,var(--twilight-a),var(--twilight-b));
  box-shadow:0 2px 10px rgba(79,56,202,.32)}
.btn.primary.btn-launch:hover{background:linear-gradient(135deg,#7c4ef3,#3b31b8);
  box-shadow:0 4px 16px rgba(79,56,202,.42)}
.btn.danger{color:var(--danger);border-color:#fecaca}
.btn.danger:hover{background:#fef2f2}
.btn.ghost{border-color:transparent;background:transparent}
.btn.small{padding:5px 9px;font-size:13px}
.impersonate-bar{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;
  background:#7c2d12;color:#fff;padding:7px 14px;font-size:13px}
.impersonate-bar .muted{color:#fed7aa}
.impersonate-bar .btn{background:#fff;color:#7c2d12;border-color:#fff;font-weight:600}
.btn.udon{background:var(--ok);border-color:#15803d;color:#fff;font-weight:600}
.btn.udon:hover{background:#15803d}
/* UDON import card */
label.inline{display:inline-flex;align-items:center;gap:6px;margin:0}
label.inline>span{color:var(--muted);font-size:13px}
/* Toggle-switch setting row: a pill switch + label, left-aligned horizontal
   (overrides the global column-flex label). Use on a <label> wrapping a
   checkbox + <span>. */
.switch-field{flex-direction:row;align-items:center;justify-content:flex-start;
  gap:11px;margin:0 0 10px;cursor:pointer}
.switch-field input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:none;margin:0;
  position:relative;width:40px;height:23px;padding:0;border:none;border-radius:999px;
  background:#cbd5e1;cursor:pointer;transition:background .18s}
.switch-field input[type=checkbox]::before{content:"";position:absolute;top:2px;left:2px;
  width:19px;height:19px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.28);
  transition:transform .18s}
.switch-field input[type=checkbox]:checked{background:var(--primary)}
.switch-field input[type=checkbox]:checked::before{transform:translateX(17px)}
.switch-field input[type=checkbox]:focus-visible{outline:2px solid #bfdbfe;outline-offset:2px}
.switch-field>span{color:var(--ink);font-size:13px;font-weight:500}
.warn-box{margin:0 0 10px;padding:8px 11px;border-radius:8px;font-size:13px;line-height:1.4;
  background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.logbox{margin:8px 0 0;padding:12px 14px;border-radius:8px;background:#0b1020;color:#d6e2ff;
  font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre-wrap;
  word-break:break-word;max-height:460px;overflow:auto;border:1px solid #1e293b}
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th,.table td{padding:10px;border-bottom:1px solid var(--line);text-align:left}
.table th.right,.table td.right{text-align:right}
.table th.center,.table td.center{text-align:center}
.table th{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.badge{padding:3px 9px;border-radius:999px;font-size:12px;font-weight:700;text-transform:uppercase}
.badge.draft{background:#fef3c7;color:#92400e}
.badge.submitted{background:#dbeafe;color:#1e40af}
.badge.processed{background:#dcfce7;color:#166534}
.badge.uploaded{background:#16a34a;color:#fff}
/* platform-coded sales rows: Faire slightly gray, FashionGo plain white */
tr.plat-faire>td{background:#f3f4f6}
tr.plat-fashiongo>td{background:#fff}
/* segmented filter (All / Faire / FashionGo) */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.seg-btn{border:none;background:#fff;padding:5px 12px;font-size:13px;cursor:pointer;color:var(--ink)}
.seg-btn+.seg-btn{border-left:1px solid var(--line)}
.seg-btn.on{background:var(--primary);color:#fff}
/* AI trend-fit scores. Appended into the style .field-grid, so it must span the
   whole row — otherwise it's squeezed into one grid column and the chips wrap. */
.trend-fit{grid-column:1/-1;margin:6px 0 2px;font-size:12px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
/* Editor: each score line (shared / personal) is a full-width row so the two
   stack. The submission-view cell has bare .tf chips (no .tf-row) → they stay
   inline pills, NOT stretched full-width bars. */
.trend-fit .tf-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;flex-basis:100%}
.trend-fit .tf-row.tf-personal .tf-lbl{color:#7c3aed}   /* private board = violet label */
.trend-fit .tf-lbl{color:var(--muted);font-weight:600}
.trend-fit .tf{padding:2px 7px;border-radius:999px;font-weight:700;font-size:11px;white-space:nowrap}
.trend-fit .tf.hi{background:#dcfce7;color:#166534}
.trend-fit .tf.mid{background:#fef9c3;color:#854d0e}
.trend-fit .tf.lo{background:#fee2e2;color:#991b1b}
.trend-fit .tf-kw{color:var(--muted);font-size:11px;flex-basis:100%}
/* aligned control row (label stacked over input; button bottom-aligned) */
.field-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.field-row>label{display:flex;flex-direction:column;gap:3px;margin:0}
.field-row>label[hidden]{display:none}   /* the flex rule above would otherwise defeat [hidden] */
.field-row>label>span{font-size:12px;color:var(--muted)}
.field-row>label>input,.field-row>label>select{height:34px}
.field-row>button{height:34px}
/* email campaign creator output */
.email-out{border:1px solid var(--line);border-radius:10px;padding:12px 14px;background:#fafafa}
.email-field{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.email-field .ef-lbl{font-size:11px;text-transform:uppercase;color:var(--muted);font-weight:700;min-width:58px}
.email-field .ef-val{flex:1;font-weight:600}
.email-body{background:#fff;border:1px solid var(--line);border-radius:8px;padding:12px 16px;margin:8px 0}
.email-body p{margin:0 0 10px;line-height:1.55}
/* admin: per-user password reset popover (Users & roles) */
.pw-set{position:relative;display:inline-block}
.pw-set>summary{list-style:none;cursor:pointer}
.pw-set>summary::-webkit-details-marker{display:none}
.pw-pop{position:absolute;right:0;top:calc(100% + 6px);z-index:50;width:240px;text-align:left;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.18)}
.pw-pop input{font:inherit}
/* Company reassignment popover on the Users page (opens under the company name). */
.co-set{position:relative;display:inline-block}
.co-set>summary{list-style:none;cursor:pointer}
.co-set>summary::-webkit-details-marker{display:none}
.co-set>summary:hover{color:var(--ink)}
.co-set>summary .co-edit{opacity:0;font-size:11px;margin-left:2px}
.co-set>summary:hover .co-edit,.co-set[open]>summary .co-edit{opacity:.6}
.co-pop{position:absolute;left:0;top:calc(100% + 6px);z-index:50;width:260px;text-align:left;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.18)}
.co-pop input{font:inherit}
/* In-editor AI-feedback popover + rating buttons */
.fb-set{position:relative;display:inline-block}
.fb-set>summary{list-style:none;cursor:pointer}
.fb-set>summary::-webkit-details-marker{display:none}
.fb-pop{position:absolute;right:0;top:calc(100% + 6px);z-index:50;width:280px;text-align:left;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.18)}
.fb-pop textarea,.fb-pop input{width:100%;font:inherit}
.fb-rate.on{background:var(--primary);color:#fff;border-color:var(--primary)}
/* AI-feedback history page */
.fb-row{border-top:1px solid var(--line);padding:14px 0}
.fb-row:first-of-type{border-top:none;padding-top:4px}
.fb-row .fb-gen{background:#f8fafc;border:1px solid var(--line);border-radius:8px;padding:6px 9px;margin:6px 0}
/* "Your feedback shapes the AI" banner + the learned-guidelines block */
.fb-impact{border-left:4px solid var(--primary)}
.fb-learned{white-space:pre-wrap;font:13px/1.55 inherit;background:#f8fafc;border:1px solid var(--line);
  border-radius:8px;padding:10px 12px;margin:8px 0 0;color:var(--ink);overflow-x:auto}
/* The AI name/description loaded by the style picker — a labeled panel */
.fb-picked{margin:12px 0;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#f8fafc}
.fb-picked-label{text-transform:uppercase;letter-spacing:.03em;font-size:11px;font-weight:700;color:var(--muted);margin-bottom:6px}
.fb-picked-name{font-weight:600;color:var(--heading)}
.fb-picked-desc{color:var(--ink);margin-top:3px;font-size:13px;line-height:1.5}
/* Submission→style picker (with thumbnails) on the AI-feedback add form */
.style-pick{position:relative}
.style-pick-btn{width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:8px;
  padding:8px 10px;cursor:pointer;font:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.style-pick-btn:disabled{color:var(--muted);cursor:default;background:#f8fafc}
.style-pick-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:40;max-height:340px;overflow-y:auto;
  background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.18)}
.style-pick-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:none;border:0;
  border-bottom:1px solid var(--line);padding:8px 10px;cursor:pointer;font:inherit}
.style-pick-item:last-child{border-bottom:none}
.style-pick-item:hover{background:#f1f5f9}
.style-pick-item img{width:40px;height:40px;object-fit:cover;border-radius:6px;flex:none;background:#f1f5f9}
.style-pick-noimg{width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:6px;
  background:#f1f5f9;color:var(--muted);flex:none}
.style-pick-lbl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Mailchimp push panel under a generated campaign */
.mc-panel:not(:empty){margin-top:14px;border-top:1px solid var(--line);padding-top:12px}
.mc-head{font-weight:700;font-size:13px;color:var(--ink);margin-bottom:8px}
.mc-test{display:inline-flex;align-items:center;gap:6px;align-self:center;font-size:13px;
  color:var(--ink);font-weight:500}
.mc-test input{width:auto;margin:0}
.chip .tf{margin-left:4px;padding:1px 6px;border-radius:999px;font-size:10px;font-weight:700}
.chip .tf.hi{background:#dcfce7;color:#166534}.chip .tf.mid{background:#fef9c3;color:#854d0e}.chip .tf.lo{background:#fee2e2;color:#991b1b}
.badge.approved{background:#dcfce7;color:#166534}
.badge.revision{background:#fef3c7;color:#92400e}
.badge.rejected{background:#fee2e2;color:#991b1b}
.badge.onboarding{background:#e0e7ff;color:#3730a3}
.badge.active{background:#dcfce7;color:#166534}
.badge.at_risk{background:#fef3c7;color:#92400e}
.badge.paused{background:#e5e7eb;color:#374151}
.badge.cancelled{background:#fee2e2;color:#991b1b}

/* KPI cards */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.kpi{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;
  box-shadow:0 1px 2px rgba(15,23,42,.05),0 4px 16px rgba(15,23,42,.03)}
.kpi .label{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.kpi .value{font-size:26px;font-weight:800;margin-top:4px}
.kpi .sub{font-size:13px;margin-top:2px}
.delta.up{color:var(--ok)} .delta.down{color:var(--danger)} .delta.flat{color:var(--muted)}
/* horizontal bars (dashboard infographics) */
.bars{display:flex;flex-direction:column;gap:11px}
.bar-row{display:grid;grid-template-columns:minmax(110px,160px) 1fr max-content;
  align-items:center;gap:12px;font-size:13px}
.bar-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.bar-amt{white-space:nowrap;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}
/* backward-compat for portal bars using plain <span> + .right */
.bar-row>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar-row>.right{white-space:nowrap;font-variant-numeric:tabular-nums}
.bar-row.is-zero .bar-amt{color:var(--muted);font-weight:500}
.bar-row .badge{white-space:nowrap}
.bar-track{background:#eef2f7;border-radius:999px;height:22px;overflow:hidden;min-width:60px}
.bar-fill{height:100%;background:var(--primary);border-radius:999px;min-width:3px;
  display:flex;align-items:center;justify-content:flex-end;
  transition:width .45s cubic-bezier(.4,0,.2,1)}
.bar-fill .bar-in{color:#fff;font-size:11px;font-weight:700;padding:0 9px;
  font-variant-numeric:tabular-nums;letter-spacing:.02em}
.empty-hint{padding:18px 4px;text-align:center}

/* upload-status strip (expanded, one tile per status) */
.status-strip{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}
.status-tile{background:var(--soft);border:1px solid var(--line);border-radius:10px;
  padding:14px 12px;text-align:center}
.status-tile .status-n{font-size:26px;font-weight:800;line-height:1.1;margin-bottom:6px}
@media(max-width:820px){.status-strip{grid-template-columns:repeat(2,1fr)}}

/* honeypot: visually hidden, off-screen, not announced */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
/* Cloudflare Turnstile spacing */
.cf-turnstile{margin:4px 0 14px}
.cols-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
@media(max-width:820px){.kpis{grid-template-columns:repeat(2,1fr)}.cols-2{grid-template-columns:1fr}}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{font-size:11px;font-weight:700;background:#eef2f7;color:#475569;border-radius:999px;padding:2px 8px}
/* Trend-board colour coding — TYPE (kind) + DIRECTION each get an intuitive hue.
   Unknown values fall back to the neutral .chip / .dir base. */
.chip.kind-color{background:#f3e8ff;color:#7c3aed}
.chip.kind-season{background:#fef3c7;color:#b45309}
.chip.kind-category{background:#d1fae5;color:#047857}
.chip.kind-style{background:#e0f2fe;color:#0369a1}
.chip.kind-fabric,.chip.kind-material{background:#ffe4e6;color:#be123c}
.chip.kind-print,.chip.kind-pattern{background:#fce7f3;color:#a21caf}
.dir{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;
  border-radius:999px;padding:2px 9px;white-space:nowrap}
.dir-up{background:#dcfce7;color:#15803d}
.dir-down{background:#fee2e2;color:#b91c1c}
.dir-new{background:#dbeafe;color:#2563eb}
.dir-flat{background:#f1f5f9;color:#64748b}
/* Bare (no-pill) direction arrow for the compact portal overview chips. */
.dir-mark{font-weight:800}
.dir-mark.dir-up{background:none;color:#15803d}
.dir-mark.dir-down{background:none;color:#b91c1c}
.dir-mark.dir-new{background:none;color:#2563eb}
.dir-mark.dir-flat{background:none;color:#64748b}
.stats{display:flex;gap:28px;margin-bottom:14px}
.stats .num{font-size:26px;font-weight:800;display:block}
.stats .lbl{color:var(--muted);font-size:13px}
.kv{display:grid;grid-template-columns:160px 1fr;gap:6px 16px;margin:12px 0}
.kv dt{color:var(--muted);font-weight:600}.kv dd{margin:0}
code{background:#f1f5f9;padding:1px 6px;border-radius:5px;font-size:13px}

/* ── editor layout (left nav + main) ────────────────────────────────── */
.container.wide{max-width:1840px}

/* ── combobox (searchable category / color inputs) ──────────────────── */
.combo{position:relative;width:100%}
.combo > input{width:100%}
.combo-menu{position:absolute;top:100%;left:0;right:0;z-index:40;background:#fff;
  border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.14);
  max-height:248px;overflow:auto;margin-top:3px;padding:3px}
.combo-item{padding:7px 10px;font-size:13px;cursor:pointer;color:var(--ink);border-radius:6px}
.combo-item:hover,.combo-item.active{background:#eff6ff;color:var(--primary-d)}
.combo-empty{padding:7px 10px;font-size:12px;color:var(--muted)}
.combo-caret{position:absolute;right:8px;top:50%;transform:translateY(-50%);
  pointer-events:none;color:var(--muted);font-size:11px}
.combo > input{padding-right:24px}
.editor-layout{display:grid;grid-template-columns:230px 1fr;gap:20px;align-items:start}
.editor-main{min-width:0}
.style-nav{position:sticky;top:16px;background:var(--panel);border:1px solid var(--line);
  border-radius:12px;padding:14px;box-shadow:0 1px 2px rgba(15,23,42,.05),0 4px 16px rgba(15,23,42,.03);max-height:calc(100dvh - 32px);
  display:flex;flex-direction:column;gap:10px}
.nav-head{display:flex;flex-direction:column;gap:8px}
.nav-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.nav-actions .btn{justify-content:center;width:100%}
.nav-actions [data-span2]{grid-column:1/-1}
/* Sidebar batch keys — soft rounded "keys" that lift on hover, matching the new
   button language. Neutral (expand/collapse), teal gradient (AI = teal accent),
   soft red→filled red (delete all). */
.btn.tiny{padding:7px 8px;font-size:12px;font-weight:600;border-radius:8px;
  background:#fff;border:1px solid var(--line);color:var(--ink);
  box-shadow:0 1px 2px rgba(15,23,42,.06);
  transition:background .18s ease,color .18s ease,border-color .18s ease,
             box-shadow .18s ease,transform .18s ease}
.btn.tiny:hover{background:#f1f5f9;transform:translateY(-1px);
  box-shadow:0 3px 8px rgba(15,23,42,.12)}
.btn.tiny.ai-accent{background:linear-gradient(135deg,#14b8a6,#0f766e);
  border-color:transparent;color:#fff;font-weight:700;
  box-shadow:0 2px 8px rgba(15,118,110,.30)}
.btn.tiny.ai-accent:hover{background:linear-gradient(135deg,#10a396,#0c5f58);
  box-shadow:0 4px 12px rgba(15,118,110,.40)}
.btn.tiny.ai-accent[data-running]{background:#b91c1c;border-color:#b91c1c}
.btn.tiny.danger{background:#fff5f5;border-color:#fecaca;color:var(--danger)}
.btn.tiny.danger:hover{background:var(--danger);border-color:var(--danger);color:#fff;
  box-shadow:0 4px 12px rgba(220,38,38,.35)}
.ai-fill-status{margin:2px 0 0;min-height:16px}
/* sidebar style search */
.nav-search{position:relative}
.nav-search input{width:100%;padding:7px 10px 7px 30px;border:1px solid var(--line);border-radius:8px;
  font:inherit;font-size:13px;color:var(--ink);background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 9px 50%}
.nav-search input:focus{outline:2px solid #bfdbfe;border-color:var(--primary)}
.nav-empty{margin:2px 0 0;text-align:center}
.btn.full{width:100%;justify-content:center}
.nav-list{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:3px}
.nav-item{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:6px 9px;border-radius:7px;cursor:pointer;font-size:13px;font-weight:600;
  border:1px solid transparent;counter-increment:navi}
.nav-item[hidden]{display:none}   /* author display:flex would else beat [hidden], so search couldn't hide rows */
.nav-item::before{content:counter(navi) ".";color:var(--muted);font-weight:600;margin-right:2px}
.nav-list{counter-reset:navi}
.nav-item:hover{background:#f1f5f9}
.nav-item.active{background:#eff6ff;border-color:#bfdbfe;color:var(--primary-d)}
/* Sidebar issue flags: RED = blocking error (missing style #/price), YELLOW =
   warning (a color with no images). Placed after .active so they stay visible
   even on the currently-open style. A trailing dot marks it at a glance. */
.nav-item.nav-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.nav-item.nav-warn::after{content:"";width:8px;height:8px;border-radius:50%;background:#f59e0b;flex:0 0 auto}
.nav-item.nav-error{background:#fef2f2;border-color:#fecaca;color:#b91c1c}
.nav-item.nav-error::before{color:#dc2626}
.nav-item.nav-error::after{content:"";width:8px;height:8px;border-radius:50%;background:#dc2626;flex:0 0 auto}
.nav-item.unnamed .nav-no{color:var(--muted);font-weight:500;font-style:italic}
.nav-no{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-meta{font-size:11px;color:var(--muted);background:#f1f5f9;border-radius:999px;
  min-width:18px;text-align:center;padding:0 5px}
.nav-meta:empty{display:none}
/* Hover-only quick-delete 'x' on each style in the sidebar list. */
.nav-del{flex:none;border:0;background:none;color:var(--muted);cursor:pointer;font-size:12px;
  line-height:1;padding:2px 5px;border-radius:5px;opacity:0;transition:opacity .12s,color .12s,background .12s}
.nav-item:hover .nav-del,.nav-item:focus-within .nav-del{opacity:1}
.nav-del:hover,.nav-del:focus-visible{color:#dc2626;background:#fee2e2;opacity:1}
@media(max-width:820px){
  .editor-layout{grid-template-columns:1fr}
  .style-nav{position:static;max-height:none;flex-direction:row;flex-wrap:wrap;align-items:center}
  .nav-list{flex-direction:row;flex-wrap:wrap}
  .nav-del{opacity:1}   /* no hover on touch — always show */
}

/* collapse */
.caret{border:none;background:none;cursor:pointer;font-size:16px;color:var(--muted);
  padding:6px 9px;border-radius:7px;transition:transform .15s,background .15s;line-height:1}
.caret:hover{background:#e7eef7;color:var(--primary)}
.style-card.collapsed .caret{transform:rotate(-90deg)}
/* Section headers (Batch defaults / bulk import): caret points right when collapsed. */
.section-toggle .caret[aria-expanded="false"]{transform:rotate(-90deg)}
.style-card.collapsed .field-grid,
.style-card.collapsed .colors-head,
.style-card.collapsed .colors,
.style-card.collapsed .etc-section,
.style-card.collapsed .add-color{display:none}
.style-card.collapsed{padding-bottom:14px}
.style-card.collapsed .style-card-head{border-bottom:none;margin-bottom:0;padding-bottom:0}
.style-summary{white-space:nowrap}
.style-card.collapsed .style-no-field span{display:none}

/* ── editor ─────────────────────────────────────────────────────────── */
/* Aligned label/field grid: labels stack above inputs, columns line up. */
.field-grid{display:grid;gap:12px 14px;align-items:end}
.field-grid label{font-size:12px;color:var(--muted);font-weight:600;margin:0;gap:5px}
.field-grid label>span{display:flex;align-items:center;gap:6px;min-height:18px}
.field-grid input,.field-grid select{width:100%}
.defaults-grid{grid-template-columns:1.4fr 1fr 1fr 1fr 1.2fr}
.style-grid{grid-template-columns:repeat(4,1fr)}
/* Color | Preorder | delete-button. `align-items:end` bottom-aligns the 32px bin
   with the field inputs so it sits level on the same row (no magic offsets). */
.color-grid{grid-template-columns:2fr 1.2fr auto;align-items:end}
.span-2{grid-column:span 2}
.span-full{grid-column:1/-1}
.field-grid textarea{width:100%;font:inherit;padding:8px 10px;border:1px solid var(--line);
  border-radius:8px;color:var(--ink);background:#fff;resize:vertical;min-height:64px}
.field-grid textarea:focus{outline:2px solid #bfdbfe;border-color:var(--primary)}
.desc-field>span .desc-count{margin-left:auto;font-variant-numeric:tabular-nums}
/* AI Fill highlights a category it set (so the client sees what we changed); the
   highlight clears once they edit the field. When the AI's pick isn't in the
   client's list we show a free-text "Recommended category:" hint instead. */
input.ai-filled{background:#eef5ff;border-color:#93c5fd;box-shadow:inset 0 0 0 1px #bfdbfe}
input.ai-rec{background:#fffbeb;border-color:#fcd34d}
.cat-rec{display:block;margin-top:3px;font-size:11px;font-weight:500;line-height:1.3;
  color:#b45309}
.cat-rec[hidden]{display:none}   /* an author display:block would else beat [hidden] and misalign the grid row */
/* Required-field highlight (style # / price) flagged by the pre-submit check. */
input.field-error{border-color:var(--danger)!important;background:#fef2f2;
  box-shadow:0 0 0 2px rgba(220,38,38,.18)}
input.field-error:focus{outline:none;border-color:var(--danger)!important;
  box-shadow:0 0 0 2px rgba(220,38,38,.28)}
input.field-error::placeholder{color:#f19a9a}
/* Possible-typo highlight (color names) — yellow: advisory, never blocks submit. */
input.field-warn{border-color:#f59e0b!important;background:#fffbeb;
  box-shadow:0 0 0 2px rgba(245,158,11,.18)}
input.field-warn:focus{outline:none;border-color:#f59e0b!important;
  box-shadow:0 0 0 2px rgba(245,158,11,.28)}
/* Collapsible "Etc." (optional fabric + badge), between Description and Colors. */
.etc-section{margin:14px 0 4px;border:1px solid var(--line);border-radius:8px;background:#fbfcfe}
.etc-section>summary{cursor:pointer;padding:9px 12px;font-size:12px;font-weight:600;
  color:var(--muted);list-style:none;display:flex;align-items:center;gap:8px}
.etc-section>summary::-webkit-details-marker{display:none}
.etc-section>summary::before{content:"▸";font-size:11px;color:var(--muted)}
.etc-section[open]>summary::before{content:"▾"}
.etc-section>summary:hover{color:var(--ink)}
.etc-grid{grid-template-columns:2fr 1fr;padding:2px 12px 14px}
.paste-hint{margin:0 0 6px;padding:5px 9px;border-radius:6px;font-size:12px;line-height:1.3;
  background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.stats-pager{display:flex;align-items:center;justify-content:center;gap:12px;margin:8px 0}
.stats-pager .stats-pageinfo{min-width:54px;text-align:center;font-variant-numeric:tabular-nums}

/* tooltips: any label with a title gets a help cursor */
label[title]{cursor:help}
.field-grid label[title] input,.field-grid label[title] select{cursor:auto}

/* required + tags (color-coded guidance) */
.req{color:var(--danger);font-style:normal;font-weight:800}
.tag{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;
  padding:1px 6px;border-radius:999px;line-height:1.5}
.tag-green{background:#dcfce7;color:#166534}
.tag-amber{background:#fef3c7;color:#92400e}
.tag-grey{background:#eef2f7;color:#64748b}
.tag-blue{background:#dbeafe;color:#1e40af}
.hint{margin:12px 0 0;padding:8px 12px;background:#eff6ff;border:1px solid #bfdbfe;
  border-radius:8px;color:#1e3a8a;font-size:13px}

/* sections, color-accented */
.section-defaults{border-top:4px solid var(--ok)}
.section-bulk{border-top:4px solid var(--primary)}
.bulk-map{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:12px 0}
.bulk-map label{font-size:12px;color:var(--muted);font-weight:600;gap:5px}
#bulk-text{width:100%;font:13px/1.5 ui-monospace,Menlo,Consolas,monospace;
  padding:10px 12px;border:1px solid var(--line);border-radius:8px;margin-bottom:12px;resize:vertical}
#bulk-text:focus{outline:2px solid #bfdbfe;border-color:var(--primary)}
@media(max-width:900px){.bulk-map{grid-template-columns:repeat(2,1fr)}}

/* bulk import: upload/paste sources + column mapping */
.import-sources{display:grid;grid-template-columns:1fr auto 1.3fr;gap:16px;align-items:center;margin:14px 0}
.import-file{border:1.5px dashed #93c5fd;border-radius:10px;padding:16px 14px;background:#f5f9ff;
  gap:8px;cursor:pointer;color:var(--ink)}
.import-file span{font-size:13px;color:var(--ink);font-weight:600}
.import-file input[type=file]{font-size:13px}
.import-or{color:var(--muted);font-weight:700;text-align:center}
.import-paste{display:flex;flex-direction:column;gap:8px}
.import-paste #bulk-text{margin-bottom:0}
.import-headeropt{flex-direction:row;align-items:center;gap:7px;color:var(--ink);font-weight:600;font-size:13px;margin:0}
.map-grid{display:flex;flex-direction:column;gap:8px;max-height:400px;overflow:auto}
.map-row{display:grid;grid-template-columns:1fr 240px;gap:14px;align-items:center;
  padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:#fff}
.map-row .col-head{font-weight:700;font-size:13px}
.map-row .col-sample{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.map-row select{width:100%}
@media(max-width:760px){.import-sources{grid-template-columns:1fr}.import-or{padding:2px 0}.map-row{grid-template-columns:1fr}}
.section-head h2{display:flex;align-items:center;gap:10px;margin-bottom:4px}
/* whole section header is a click target (collapse/expand) */
.section-toggle{cursor:pointer;border-radius:8px;transition:background .15s}
.section-toggle:hover{background:#f8fafc}
.section-toggle .section-head{cursor:pointer}
.style-card{border-left:4px solid var(--primary);padding-top:14px}
.style-card-head{display:flex;align-items:center;
  gap:12px;margin-bottom:14px;padding:6px 8px 12px;border-bottom:1px dashed var(--line);
  cursor:pointer;border-radius:8px 8px 0 0}
.style-card-head:hover{background:#f8fafc}
.style-card-head input,.style-card-head .style-no-field{cursor:auto}
.style-summary{cursor:pointer}
.style-no-field{max-width:260px}
.style-no-field input{font-size:17px;font-weight:700;letter-spacing:.02em}
.colors-head{margin:18px 0 10px}
.colors-head h3{font-size:14px;margin:0;text-transform:uppercase;letter-spacing:.04em;color:#0f766e}

/* colors */
.colors{margin:0 0 12px;display:flex;flex-direction:column;gap:14px}
.color-block{position:relative;border:1px solid #cdeae3;border-left:4px solid #14b8a6;border-radius:10px;
  padding:14px;background:#f6fefb}
/* Animated trash-bin delete (Uiverse-inspired) — universal red, lid swings open
   on hover. Sized ~32px to sit level with the .btn.small row (AI Fill/Feedback). */
.bin-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  width:32px;height:32px;flex:none;border-radius:9px;background:#ff5f5f;
  border:2px solid #ffc9c9;cursor:pointer;transition:background .3s,transform .3s}
.bin-top{width:12px;transform-origin:right;transition:transform .3s}
.bin-bottom{width:9px}
.bin-button:hover{background:#f21f1f}
.bin-button:hover .bin-top{transform:rotate(45deg)}
.bin-button:active{transform:scale(.9)}
/* Bin is the 3rd grid cell in .color-head — nudge it up a touch so its centre
   lines up with the input (input is ~5px taller than the 32px bin). */
.color-head>.del-color{margin-bottom:3px}
.color-head input.c-name{font-weight:700}
.dropzone .ai-main{margin-top:10px}

/* dropzone */
.dropzone{margin-top:12px;border:2px dashed #cbd5e1;border-radius:10px;padding:12px;background:#fff}
.dropzone.drag{border-color:var(--primary);background:#eff6ff}
.drop-label{cursor:pointer;color:var(--muted);font-weight:500;display:block;text-align:center;padding:10px}
.drop-label u{color:var(--primary)}
.thumbs{display:flex;flex-wrap:wrap;gap:8px}
.thumbs:not(:empty){margin-bottom:8px}
.thumb{position:relative;width:84px;height:84px;border-radius:8px;overflow:hidden;
  border:1px solid var(--line);background:#f1f5f9}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb .x{position:absolute;top:2px;right:2px;background:rgba(0,0,0,.6);color:#fff;border:none;
  border-radius:50%;width:20px;height:20px;cursor:pointer;font-size:12px;line-height:1}
.thumb .x:hover{background:var(--danger)}
.thumb .seq{position:absolute;bottom:0;left:0;background:rgba(0,0,0,.6);color:#fff;
  font-size:11px;padding:1px 5px;border-top-right-radius:6px}
.thumb.is-main{outline:3px solid var(--primary);outline-offset:-1px}
.thumb.is-main::after{content:"MAIN";position:absolute;top:2px;left:2px;
  background:var(--primary);color:#fff;font-size:9px;font-weight:800;
  padding:1px 4px;border-radius:4px;letter-spacing:.03em}
.thumb.is-flagged{outline:3px solid var(--warn);outline-offset:-1px}
.thumb.is-flagged .seq{background:var(--warn)}
.btn.ai-main,.btn.ai-style{border-color:#c7d2fe;color:#4338ca;background:#eef2ff}
.btn.ai-main:hover,.btn.ai-style:hover{background:#e0e7ff}
.btn.ai-main:disabled,.btn.ai-style:disabled{opacity:.6;cursor:default}

/* QA panel */
.qa-panel h3{margin:0;font-size:15px}
.qa-list{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:5px}
.qa-item{font-size:13px;padding:7px 10px;border-radius:7px;border:1px solid var(--line)}
.qa-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.qa-warn{background:#fffbeb;border-color:#fde68a;color:#92400e}
.qa-info{background:#eff6ff;border-color:#bfdbfe;color:#1e3a8a}
.qa-ok{color:var(--ok);font-weight:600;font-size:14px}

/* The editor page drops the container's bottom margin so the sticky action bar
   sits FLUSH against the bottom edge (no floating page-bg gap under it). The bar
   is full-bleed to the content edges with a solid bg + top shadow so it reads as
   an attached toolbar rather than a floating pill. */
.container.editor-page{margin-bottom:0;padding-bottom:0}
.sticky-actions{position:sticky;bottom:0;background:var(--soft);align-items:center;
  padding:14px 16px;border-top:1px solid var(--line);
  box-shadow:0 -6px 18px rgba(15,23,42,.06);z-index:5}
#save-status{white-space:nowrap}
/* Toast — transient centered notice (e.g. "review before submitting"). */
.toast{position:fixed;left:50%;bottom:84px;transform:translateX(-50%) translateY(12px);
  background:#0f172a;color:#fff;padding:12px 18px;border-radius:10px;font-size:14px;font-weight:500;
  line-height:1.4;max-width:min(90vw,460px);text-align:center;box-shadow:0 10px 30px rgba(15,23,42,.28);
  z-index:200;opacity:0;pointer-events:none;transition:opacity .25s ease,transform .25s ease}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
/* Back-to-top — deep-indigo circle with a lavender ring; on hover it expands
   into an iris-gradient pill, the arrow flies up and the label slides in
   (Uiverse-inspired, recolored to the UDON Iris palette). */
#back-to-top{position:fixed;right:18px;bottom:18px;z-index:70;width:46px;height:46px;
  border-radius:50%;border:none;background:var(--iris-ink);cursor:pointer;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 0 0 4px var(--iris-ring),0 8px 22px rgba(30,27,75,.28);
  transition:width .3s ease,border-radius .3s ease,background .3s ease;
  animation:nudge-in .2s ease-out}
#back-to-top svg{width:13px;transition:transform .3s ease}
#back-to-top svg path{fill:#fff}
#back-to-top::before{position:absolute;content:attr(data-label);color:#fff;font-weight:600;
  font-size:0;bottom:-20px;white-space:nowrap}
#back-to-top:hover{width:132px;border-radius:50px;
  background:linear-gradient(135deg,var(--iris-a),var(--iris-b))}
#back-to-top:hover svg{transform:translateY(-220%)}
#back-to-top:hover::before{font-size:13px;bottom:unset;transition:.3s ease}
/* On the editor page the sticky action bar owns the bottom edge — lift the
   arrow above it so it never covers the Save/Submit buttons. */
#back-to-top.above-actions{bottom:80px}
/* Unsaved-changes save-draft reminder toast (editor page only — sits ABOVE the
   lifted back-to-top arrow, which sits above the sticky action bar). */
.save-nudge{position:fixed;right:18px;bottom:136px;z-index:80;display:flex;align-items:center;gap:10px;
  max-width:440px;background:#fff;border:1px solid var(--line);border-left:4px solid var(--primary);
  border-radius:12px;padding:12px 14px;box-shadow:0 12px 34px rgba(0,0,0,.22);
  animation:nudge-in .25s ease-out}
.save-nudge-txt{font-size:13px;line-height:1.4;color:var(--ink)}
@keyframes nudge-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

@media(max-width:900px){
  .defaults-grid,.style-grid,.etc-grid{grid-template-columns:repeat(2,1fr)}
  .color-grid{grid-template-columns:1fr 1fr auto}   /* keep the delete button on the row */
  .span-2{grid-column:span 2}
}

/* ============================================================
   Baseline-UI craft layer — global polish pass.
   Adapted from ui-skills.com/skills/ibelick/baseline-ui to this
   app's vanilla CSS: typography rendering, data alignment, a single
   visible focus ring, and motion discipline. Additive + low-risk —
   no layout, color, or structure changes; safe to remove as a unit.
   ============================================================ */

/* Typography — balanced headings, tidy body wrapping, crisper rendering */
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
h1,h2,h3{color:var(--heading);letter-spacing:-.02em;text-wrap:balance}
p,li,.muted,.small{text-wrap:pretty}

/* Data — tabular figures so digits line up in tables, KPIs and deltas */
.table td,.table th,.kpi .value,.kpi .sub,.delta,.status-n,.email-field .ef-val,
.stats-pageinfo,.bar-row{font-variant-numeric:tabular-nums}

/* Accessibility — one consistent focus ring for keyboard users only
   (:focus-visible leaves mouse clicks untouched) */
a:focus-visible,button:focus-visible,.btn:focus-visible,summary:focus-visible,
.seg-btn:focus-visible,.account-chip:focus-visible,.guide-toggle:focus-visible,
[tabindex]:focus-visible{outline:2px solid var(--primary);outline-offset:2px}

/* Skip link — visually hidden until focused; lets keyboard users jump past the
   nav straight to the main content (#main) */
.skip-link{position:absolute;left:8px;top:-48px;z-index:200;background:var(--primary);
  color:#fff;padding:8px 14px;border-radius:8px;text-decoration:none;
  transition:top .15s ease}
.skip-link:focus{top:8px}

/* Feel — buttons ease on hover and give a subtle press (transform only,
   so it never animates layout) */
.btn{transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease}
.btn:active{transform:translateY(1px) scale(.97)}
.seg-btn{transition:background .15s ease,color .15s ease}

/* ── Function-flavored button icons (Uiverse-inspired, per-action animation) ──
   Each action animates like what it DOES: add spins the + in, save stamps the
   disk down, write scribbles the pen, update spins the arrows, go nudges the
   arrow forward, launch lifts the rocket off. */
.b-ic{display:inline-flex;line-height:0}
.b-ic svg{width:15px;height:15px;display:block;transition:transform .3s ease}
.btn-add:hover .b-ic svg{transform:rotate(90deg) scale(1.18)}
@keyframes b-stamp{0%{transform:translateY(-3px) scale(1.08)}55%{transform:translateY(1.5px) scale(.92)}100%{transform:translateY(0) scale(1)}}
.btn-save:hover .b-ic svg{animation:b-stamp .45s ease}
@keyframes b-write{0%,100%{transform:rotate(-6deg)}25%{transform:rotate(5deg) translate(1.5px,-1px)}50%{transform:rotate(-4deg) translate(3px,0)}75%{transform:rotate(5deg) translate(1.5px,-1px)}}
.btn-write:hover .b-ic svg{animation:b-write .8s ease-in-out infinite}
@keyframes b-spin{to{transform:rotate(360deg)}}
.btn-update:hover .b-ic svg{animation:b-spin .9s linear infinite}
@keyframes b-nudge{0%,100%{transform:translateX(0)}50%{transform:translateX(4px)}}
.btn-go:hover .b-ic svg{animation:b-nudge .7s ease-in-out infinite}
@keyframes b-launch{from{transform:translate(0,1px) rotate(0deg)}to{transform:translate(2px,-3px) rotate(10deg)}}
.btn-launch:hover .b-ic svg{animation:b-launch .5s ease-in-out infinite alternate}
@media(prefers-reduced-motion:reduce){
  .btn:hover .b-ic svg{animation:none;transform:none}
}

/* Touch — remove the 300ms double-tap-zoom delay on interactive controls */
button,.btn,a,summary,.seg-btn,[role="button"]{touch-action:manipulation}

/* Motion discipline — honour the OS "reduce motion" preference */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important;scroll-behavior:auto!important}
}

/* ============================================================
   Interface-design refinement layer — dashboards/admin/SaaS.
   Adapted from ui-skills.com/skills/dammyjay93/interface-design:
   quiet internal borders (card edges stay findable), an anchored
   table header, scannable row hover, calm elevation. Tuned to the
   existing blue/teal palette; metadata text stays at AA-safe --muted.
   ============================================================ */
:root{
  --line-soft:#eef1f5;   /* internal separators, quieter than --line */
}

/* Data tables are the dominant element on the portal + company pages.
   Header anchored with a faint fill + the stronger --line divider; rows
   separated by the quieter --line-soft; last row drops its rule so the
   card bottom reads clean; a whisper hover makes long tables scannable. */
.table th{background:#fbfcfe}
.table td{border-bottom-color:var(--line-soft)}
.table tbody tr:last-child>td{border-bottom-color:transparent}
.table tbody tr{transition:background .12s ease}
.table tbody tr:hover>td{background:#f6f8fb}
.table tfoot th{background:#fbfcfe;border-top:1px solid var(--line)}

/* KPI hero numbers — tighten the big value so it reads as one unit */
.kpi .value{letter-spacing:-.01em}

/* Selectable pills (platforms / our service). The display-only .chip is
   left untouched; this is the interactive variant — the whole pill is the
   control, with a clear checked state. The "svc" accent marks OUR service
   so it sits in the same row as the marketplaces yet stays distinct. */
.chip-toggle{display:inline-flex;align-items:center;gap:7px;cursor:pointer;user-select:none;
  font-size:13px;font-weight:600;color:var(--ink);background:#fff;border:1px solid var(--line);
  border-radius:999px;padding:6px 13px;
  transition:background .15s ease,border-color .15s ease,color .15s ease}
.chip-toggle:hover{background:#f6f8fb}
.chip-toggle input{margin:0;width:auto;accent-color:var(--primary)}
.chip-toggle:has(input:checked){background:#eff6ff;border-color:#bfdbfe;color:var(--primary-d)}
.chip-toggle.svc input{accent-color:var(--ok)}
.chip-toggle.svc:has(input:checked){background:#ecfdf5;border-color:#bbf7d0;color:#15803d}

/* ── AI Studio ─────────────────────────────────────────────────────────── */
.studio-meter{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border:1px solid var(--line);
  border-radius:999px;background:#fff;font-variant-numeric:tabular-nums}
.studio-meter strong{font-size:16px}
.studio-grid{grid-template-columns:2fr 1fr}
.studio-grid.presets{grid-template-columns:repeat(5,1fr)}
.studio-work{display:grid;grid-template-columns:minmax(260px,380px) 1fr;gap:18px;align-items:start}
.studio-result img{width:100%;border-radius:10px;border:1px solid var(--line);background:#f8fafc}
.studio-next{display:flex;flex-direction:column;gap:12px}
.st-next-block{border:1px solid var(--line);border-radius:10px;padding:12px;background:#fbfcfe}
.st-next-block strong{display:block;margin-bottom:2px}
.st-next-block input[type=file]{display:block;margin:8px 0;max-width:100%}
.gal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.gal-item{margin:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff}
.gal-item img{width:100%;aspect-ratio:3/4;object-fit:cover;display:block;background:#f1f5f9}
.gal-item figcaption{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:7px 9px;font-size:12px}
.gal-label{font-weight:700}
.gal-actions{margin-left:auto;display:inline-flex;gap:8px;align-items:center}
.gal-actions a{text-decoration:none}
.gal-actions .st-use,.gal-actions .st-attach{border:1px solid var(--line);background:#fff;
  border-radius:6px;padding:2px 7px;font-size:11px;cursor:pointer}
.gal-actions .st-use:hover,.gal-actions .st-attach:hover{background:#eff6ff;border-color:var(--primary)}
@media(max-width:900px){
  .studio-grid,.studio-grid.presets{grid-template-columns:repeat(2,1fr)}
  .studio-work{grid-template-columns:1fr}
}
.st-base-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  aspect-ratio:3/4;border:2px dashed #cbd5e1;border-radius:10px;background:#f8fafc;
  color:var(--muted);font-size:13px;text-align:center;padding:14px}
.btn[hidden]{display:none}                /* inline-flex above would else beat [hidden] */
.btn:disabled{opacity:.5;cursor:not-allowed;filter:saturate(.4)}
.st-base-empty[hidden]{display:none}      /* display:flex above would else beat [hidden] */
/* AI Studio "Add to submission" modal */
.st-modal{position:fixed;inset:0;z-index:80;background:rgba(15,23,42,.45);
  display:flex;align-items:center;justify-content:center;padding:20px}
.st-modal[hidden]{display:none}
.st-modal-card{background:#fff;border-radius:12px;padding:18px 20px;width:min(420px,100%);
  box-shadow:0 24px 60px rgba(15,23,42,.25)}
.st-modal-card select{width:100%}
