/* ====================================================================
   MANUFAKTUR X STUDIO - admin design layer (2026-10 redesign)
   Loaded LAST. Structure and visual language follow open-source commerce
   admin systems (Medusa UI, Shopify Polaris): warm mineral surfaces, bordered
   sections instead of shadows, IBM Plex Sans, sentence case, one accent used
   sparingly, dark neutral primary buttons. The old storefront theme
   (bright.css + the first half of studio.css) is re-toned through its own
   variables below, so every legacy component inherits the new system.
   ==================================================================== */

:root{
  /* authoritative tokens */
  --sx-bg:#f3f2ee; --sx-sidebar:#eeefea; --sx-surface:#fffefa; --sx-subtle:#f8f8f4;
  --sx-hover:#eaece5; --sx-pressed:#dce1d7;
  --sx-text:#24322d; --sx-text-2:#526059; --sx-muted:#68736b; --sx-disabled:#969f95;
  --sx-border:#e0e3da; --sx-border-strong:#ccd3c7; --sx-border-control:#8a978c;
  --sx-brand:#ec5a1c; --sx-brand-ink:#ad3d0c; --sx-brand-soft:#fff3ed;
  --sx-primary:#293c33; --sx-primary-hover:#1e3027;
  --sx-danger:#be123c;
  --sx-r-control:8px; --sx-r-panel:12px; --sx-r-overlay:16px;
  --sx-shadow-control:0 1px 2px rgb(36 50 45 / 5%);
  --sx-shadow-pop:0 4px 8px rgb(36 50 45 / 5%), 0 12px 28px rgb(36 50 45 / 9%);
  --sx-shadow-modal:0 8px 24px rgb(36 50 45 / 8%), 0 24px 64px rgb(36 50 45 / 14%);
  --sx-font:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --sx-mono:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;

  /* legacy theme variables, re-toned (bright.css / studio.css read these) */
  --bg:var(--sx-bg); --surface:var(--sx-surface); --white:var(--sx-surface); --bg-soft:var(--sx-subtle); --bg-band:var(--sx-hover);
  --navy:var(--sx-text); --navy-2:var(--sx-primary); --ink:var(--sx-text); --muted:var(--sx-muted);
  --accent:var(--sx-brand); --accent-2:var(--sx-brand); --accent-ink:var(--sx-brand-ink);
  --line:var(--sx-border); --line-strong:var(--sx-border-strong);
  --shadow-sm:none; --shadow:var(--sx-shadow-control); --shadow-lg:var(--sx-shadow-modal);
  --r:var(--sx-r-control); --r-lg:var(--sx-r-panel);
  --fh:var(--sx-font); --fb:var(--sx-font);
  --ok:#047857; --ok-ink:#065f46; --ok-bg:#d1fae5; --ok-line:#a7f3d0;
}

/* ---------- base ---------- */
html,body{background:var(--sx-bg)}
body{font-family:var(--sx-font); font-size:13px; line-height:20px; color:var(--sx-text); -webkit-font-smoothing:antialiased}
#appView,#loginView,.modal-ov,.toast-stack{font-family:var(--sx-font)}
/* Sentence case everywhere in the app; the storefront theme uppercased almost everything. */
#appView *, #loginView *, .modal-ov *, .toast-stack *{text-transform:none !important; letter-spacing:normal}
#appView .brand, #loginView .brand{text-transform:uppercase !important}
h1,h2,h3,h4{font-family:var(--sx-font); letter-spacing:0; line-height:1.3}
.num,.money{font-variant-numeric:tabular-nums; white-space:nowrap}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--sx-brand-ink); outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none !important; animation:none !important}}

/* wordmark: Archivo only here */
.brand{font-family:'Archivo',var(--sx-font); font-weight:800; font-size:15px; letter-spacing:.02em; color:var(--sx-text)}
.brand .star{color:var(--sx-brand); font-style:italic}

/* ---------- buttons ---------- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:32px; padding:5px 12px;
  font:500 13px/20px var(--sx-font); border-radius:var(--sx-r-control); border:1px solid var(--sx-primary);
  background:var(--sx-primary); color:var(--sx-surface); box-shadow:var(--sx-shadow-control); cursor:pointer;
  transition:background-color .12s,border-color .12s,color .12s; transform:none !important; white-space:nowrap; text-decoration:none}
.btn:hover{background:var(--sx-primary-hover); border-color:var(--sx-primary-hover); box-shadow:var(--sx-shadow-control)}
.btn .arrow{display:none}
.btn-ghost,.btn.btn-ghost{background:var(--sx-surface); color:var(--sx-text); border-color:var(--sx-border-strong)}
.btn-ghost:hover,.btn.btn-ghost:hover{background:var(--sx-hover); color:var(--sx-text); border-color:var(--sx-border-strong)}
.btn-plain{background:transparent; border-color:transparent; color:var(--sx-text-2); box-shadow:none}
.btn-plain:hover{background:var(--sx-hover); border-color:transparent; color:var(--sx-text)}
.btn-danger{background:var(--sx-surface); color:var(--sx-danger); border-color:var(--sx-border-strong)}
.btn-sm{min-height:28px; padding:3px 10px; font-size:13px}
.btn-lg{min-height:40px; padding:9px 16px}
.btn[disabled],.btn:disabled{opacity:.5; cursor:not-allowed}
@media (max-width:767px){ .btn{min-height:40px} .btn-sm{min-height:36px} }

/* ---------- form controls ---------- */
.ds-input,.ds-select,.field input,.field select,.field textarea,input.ds-input,textarea.ds-input,select.ds-select{
  font:400 13px/20px var(--sx-font); color:var(--sx-text); background:var(--sx-surface); border:1px solid var(--sx-border-strong);
  border-radius:var(--sx-r-control); padding:7px 10px; min-height:36px; box-shadow:var(--sx-shadow-control); box-sizing:border-box}
.ds-input:focus,.ds-select:focus,.field input:focus,.field textarea:focus{border-color:var(--sx-text-2); outline:2px solid var(--sx-border); outline-offset:0}
.ds-label,.field label{font:500 13px/20px var(--sx-font) !important; color:var(--sx-text) !important; margin:0 0 6px; display:block}
.ds-hint,.ds-field-hint{font-size:12px !important; line-height:18px !important; color:var(--sx-muted) !important}
.ds-field{margin-bottom:16px}
@media (max-width:767px){ .ds-input,.ds-select,.field input,.field select,.field textarea{font-size:16px; min-height:44px} }
.form-err{background:#ffe4e6; border:1px solid #fecdd3; color:#9f1239; border-radius:var(--sx-r-control); padding:8px 12px; font-size:13px}
.form-ok{background:#d1fae5; border:1px solid #a7f3d0; color:#065f46; border-radius:var(--sx-r-control); padding:8px 12px; font-size:13px}

/* ---------- app shell ---------- */
.studio-shell{display:flex; align-items:stretch; min-height:100dvh}
.studio-sidebar{position:sticky; top:0; flex:0 0 232px; width:232px; height:100dvh; display:flex; flex-direction:column;
  background:var(--sx-sidebar); border-right:1px solid var(--sx-border); padding:0; overflow-y:auto; box-sizing:border-box}
.sb-top{padding:16px 16px 12px; border-bottom:1px solid var(--sx-border)}
.sb-brand{display:flex; align-items:baseline; gap:8px; text-decoration:none}
.sb-studio{font-size:12px; font-weight:500; color:var(--sx-muted)}
.sb-shop{margin-top:6px; font-size:13px; font-weight:500; color:var(--sx-text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.sb-nav{flex:1 1 auto; padding:12px}
.studio-nav{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:1px}
.studio-nav .sb-group{font-size:12px; line-height:18px; color:var(--sx-muted); padding:16px 8px 4px; font-weight:500}
.studio-nav a{display:flex; align-items:center; gap:10px; min-height:34px; padding:0 8px; border-radius:var(--sx-r-control);
  font:500 13px/20px var(--sx-font); color:var(--sx-text-2); text-decoration:none; background:transparent; border:0; box-shadow:none; position:relative}
.studio-nav a::before,.studio-nav a::after{content:none !important; display:none !important}
.studio-nav a:hover{background:var(--sx-hover); color:var(--sx-text)}
.studio-nav a.active{background:var(--sx-brand-soft); color:var(--sx-brand-ink)}
.studio-nav a .nav-ic{width:18px; height:18px; flex:0 0 18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round}
.nav-label{flex:1 1 auto; min-width:0}
.nav-badge{margin-left:auto; min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:var(--sx-text); color:var(--sx-surface);
  font-size:11px; font-weight:600; line-height:20px; text-align:center; font-variant-numeric:tabular-nums}
.sb-foot{padding:8px 12px 12px; border-top:1px solid var(--sx-border)}
.sb-account{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 8px 0}
.sb-logout{background:none; border:0; padding:4px 0; font:500 13px/20px var(--sx-font); color:var(--sx-text-2); cursor:pointer}
.sb-logout:hover{color:var(--sx-text)}
.sb-support,.studio-foot{display:none !important}

.studio-content{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; min-height:100dvh}
.studio-topbar{position:sticky; top:0; z-index:40; display:flex !important; align-items:center; gap:16px; min-height:64px; padding:12px 24px;
  background:var(--sx-surface); border-bottom:1px solid var(--sx-border); box-sizing:border-box}
.tb-titles{flex:1 1 auto; min-width:0; display:grid; grid-template-columns:auto auto 1fr; align-items:center; column-gap:10px}
.tb-titles .tb-crumbs{grid-column:1 / -1}
.tb-titles .tb-badge{justify-self:start}
.tb-crumbs{display:flex; flex-wrap:wrap; gap:6px; font-size:12px; line-height:18px; color:var(--sx-muted)}
.tb-crumbs:empty{display:none}
.tb-crumbs a{color:var(--sx-muted); text-decoration:none}
.tb-crumbs a:hover{color:var(--sx-text)}
.tb-crumbs .sep{color:var(--sx-disabled)}
.tb-title{margin:0; font:600 18px/28px var(--sx-font); letter-spacing:-.01em; color:var(--sx-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.tb-actions{display:flex; align-items:center; gap:8px; flex:0 0 auto}
.studio-burger{display:none; width:36px; height:36px; border:1px solid var(--sx-border); border-radius:var(--sx-r-control); background:var(--sx-surface); align-items:center; justify-content:center; padding:0; cursor:pointer}
.studio-burger svg{width:18px; height:18px}

.studio-main{width:100%; max-width:1280px; margin:0 auto; padding:24px; box-sizing:border-box; min-height:0}
.studio-main.wrap{padding:24px !important}
.studio-main > div > * + *{margin-top:0}
.view-stack{display:flex; flex-direction:column; gap:24px}
.page-desc{margin:0 0 16px; font-size:13px; line-height:20px; color:var(--sx-text-2); max-width:760px}

/* legacy page heads/eyebrows: the top bar owns the title now */
.page-head .eyebrow,.eyebrow{display:none !important}
.page-head{margin:0 0 16px}
.page-head h1{display:none}
.page-head p{margin:0; font-size:13px; line-height:20px; color:var(--sx-text-2); max-width:760px}
.page-head-row{display:block}

@media (max-width:1023px){
  .studio-sidebar{position:fixed; left:0; top:0; z-index:60; width:min(304px,calc(100vw - 32px)); transform:translateX(-102%); transition:transform .18s ease; box-shadow:var(--sx-shadow-modal)}
  .studio-shell.nav-open .studio-sidebar{transform:none}
  .studio-scrim{position:fixed; inset:0; background:rgb(36 50 45 / 40%); z-index:55; display:none}
  .studio-shell.nav-open ~ .studio-scrim{display:block}
  .studio-burger{display:inline-flex}
  .studio-topbar{padding:10px 16px; gap:12px}
}
@media (max-width:767px){
  .studio-main,.studio-main.wrap{padding:16px !important}
  .studio-topbar{flex-wrap:wrap}
  .tb-actions{width:100%; order:3; flex-wrap:wrap; min-width:0}
  .tb-actions:empty{display:none}
  .tb-actions .btn{flex:1 1 auto}
  .tb-title{font-size:16px; line-height:24px}
}

/* ---------- section container ---------- */
.ui-section,.ds-section{background:var(--sx-surface); border:1px solid var(--sx-border); border-radius:var(--sx-r-panel); box-shadow:none; padding:0; margin:0 0 16px; overflow:hidden}
.ds-section{padding:20px}
.ui-section-head{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 20px; border-bottom:1px solid var(--sx-border)}
.ui-section-head h2{margin:0; font:600 14px/20px var(--sx-font); color:var(--sx-text)}
.ui-section-head .sub{display:block; font:400 12px/18px var(--sx-font); color:var(--sx-muted); margin-top:2px}
.ui-section-actions{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.ui-section-body{padding:20px}
.ui-section-body.flush{padding:0}
.ui-section-foot{display:flex; justify-content:flex-end; gap:8px; padding:12px 20px; border-top:1px solid var(--sx-border); background:var(--sx-subtle)}
.ds-h,.ds-section h3,.ds-section .ds-h{font:600 14px/20px var(--sx-font) !important; color:var(--sx-text) !important; margin:0 0 12px}
@media (max-width:767px){ .ui-section-head{padding:12px 16px} .ui-section-body{padding:16px} .ds-section{padding:16px} }

/* ---------- key-value rows ---------- */
.kv{margin:0}
.kv-row{display:grid; grid-template-columns:minmax(160px,35%) 1fr; gap:12px; padding:12px 20px; border-bottom:1px solid var(--sx-border); align-items:baseline}
.kv-row:last-child{border-bottom:0}
.kv-row dt{color:var(--sx-text-2); font-size:13px}
.kv-row dd{margin:0; color:var(--sx-text); font-size:13px}
.kv-row dd.money{text-align:right}
@media (max-width:767px){ .kv-row{grid-template-columns:1fr; gap:4px; padding:12px 16px} .kv-row dd.money{text-align:left} }

/* ---------- data table ---------- */
.ui-toolbar{display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:12px 16px; border-bottom:1px solid var(--sx-border)}
.ui-toolbar .ui-search{width:280px; max-width:100%}
.ui-toolbar .ui-count{margin-left:auto; font-size:12px; color:var(--sx-muted)}
.ui-table-wrap{overflow-x:auto}
table.ui-table{width:100%; border-collapse:collapse; font-size:13px}
.ui-table th{height:36px; padding:8px 16px; text-align:left; font:500 12px/18px var(--sx-font); color:var(--sx-text-2); background:var(--sx-subtle); border-bottom:1px solid var(--sx-border); white-space:nowrap}
.ui-table td{padding:10px 16px; border-bottom:1px solid var(--sx-border); vertical-align:middle; color:var(--sx-text)}
.ui-table tr:last-child td{border-bottom:0}
.ui-table th.r,.ui-table td.r{text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap}
.ui-table tbody tr.row-link{cursor:pointer; transition:background-color .12s}
.ui-table tbody tr.row-link:hover{background:var(--sx-hover)}
.ui-table a.rec{color:var(--sx-text); font-weight:500; text-decoration:none}
.ui-table a.rec:hover{text-decoration:underline}
.ui-table .sub{display:block; font-size:12px; line-height:18px; color:var(--sx-muted)}
.ui-table .muted{color:var(--sx-muted)}
.ui-cell-prod{display:flex; align-items:center; gap:12px; min-width:200px}
.ui-thumb{width:40px; height:40px; flex:0 0 40px; border-radius:6px; background:var(--sx-hover); border:1px solid var(--sx-border); box-sizing:border-box; padding:3px; object-fit:contain; display:block}
.ui-thumb.sm{width:32px; height:32px; flex-basis:32px}
.ui-table-note{padding:10px 16px; font-size:12px; color:var(--sx-muted); border-top:1px solid var(--sx-border); background:var(--sx-subtle)}
.ui-skel{display:block; height:12px; border-radius:4px; background:linear-gradient(90deg,var(--sx-hover),var(--sx-pressed),var(--sx-hover)); background-size:200% 100%; animation:sxsk 1.2s infinite}
@keyframes sxsk{to{background-position:-200% 0}}
/* mobile: tables become record lists */
.ui-cards{display:none}
  .ui-card{display:block; padding:12px 16px; border-bottom:1px solid var(--sx-border); text-decoration:none; color:inherit}
  .ui-card:last-child{border-bottom:0}
  .ui-card-top{display:flex; align-items:center; gap:12px}
  .ui-card-title{font-weight:500; flex:1 1 auto; min-width:0}
  .ui-card-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px}
  .ui-card-grid .k{display:block; font-size:12px; color:var(--sx-muted)}
  .ui-card-grid .v{display:block; font-weight:500; font-variant-numeric:tabular-nums}
@media (max-width:767px){
  .ui-table-wrap.cardable{display:none}
  .ui-cards{display:block}
  .ui-toolbar .ui-search{width:100%}
}

/* ---------- status badges (one system) ---------- */
.badge{display:inline-flex; align-items:center; gap:6px; min-height:22px; padding:1px 7px; border-radius:6px; border:1px solid; font:500 12px/18px var(--sx-font); white-space:nowrap}
.badge::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.8}
.badge.neutral{background:var(--sx-hover); border-color:var(--sx-border); color:var(--sx-text-2)}
.badge.info{background:#dbeafe; border-color:#bfdbfe; color:#1e40af}
.badge.attention{background:#fff7ed; border-color:#fed7aa; color:#9a3412}
.badge.success{background:#d1fae5; border-color:#a7f3d0; color:#065f46}
.badge.problem{background:#ffe4e6; border-color:#fecdd3; color:#9f1239}
/* legacy chips map onto the badge look */
.status-chip{display:inline-flex; align-items:center; min-height:22px; padding:1px 7px; border-radius:6px; border:1px solid; font:500 12px/18px var(--sx-font) !important}
.status-chip.on{background:#d1fae5; border-color:#a7f3d0; color:#065f46}
.status-chip.off{background:var(--sx-hover); border-color:var(--sx-border); color:var(--sx-text-2)}

/* ---------- tabs ---------- */
.ui-tabs{display:flex; gap:0; border-bottom:1px solid var(--sx-border); margin:0 0 20px; overflow-x:auto; scrollbar-width:none}
.ui-tabs::-webkit-scrollbar{display:none}
.ui-tab{appearance:none; background:none; border:0; border-bottom:2px solid transparent; margin-bottom:-1px; min-height:40px; padding:0 16px;
  font:500 13px/20px var(--sx-font); color:var(--sx-text-2); cursor:pointer; white-space:nowrap; text-decoration:none; display:inline-flex; align-items:center}
.ui-tab:hover{color:var(--sx-text)}
.ui-tab[aria-selected="true"]{color:var(--sx-text); border-bottom-color:var(--sx-brand)}

/* ---------- segmented control ---------- */
.ui-seg,.seg{display:inline-flex; padding:3px; gap:2px; background:var(--sx-hover); border-radius:var(--sx-r-control); border:0}
.ui-seg button,.seg button{appearance:none; border:0; background:transparent; border-radius:4px; min-height:26px; padding:2px 10px; font:500 13px/20px var(--sx-font); color:var(--sx-text-2); cursor:pointer; box-shadow:none}
.ui-seg button.on,.seg button.on{background:var(--sx-surface); color:var(--sx-text); box-shadow:var(--sx-shadow-control)}

/* ---------- empty / error / loading ---------- */
.ui-empty{padding:40px 24px; min-height:176px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:6px; box-sizing:border-box}
.ui-empty h3{margin:0; font:600 14px/20px var(--sx-font); color:var(--sx-text)}
.ui-empty p{margin:0; font-size:13px; color:var(--sx-muted); max-width:420px}
.ui-empty .btn{margin-top:10px}
.state{background:var(--sx-surface); border:1px solid var(--sx-border); border-radius:var(--sx-r-panel); padding:40px 24px; text-align:center}
.state h3{font:600 14px/20px var(--sx-font); margin:0 0 6px}
.state p{font-size:13px; color:var(--sx-muted); margin:0 auto 12px; max-width:440px}
.skeleton-grid{display:grid; grid-template-columns:1fr; gap:8px}
.skeleton-grid .sk{height:44px; border-radius:var(--sx-r-panel); background:linear-gradient(90deg,var(--sx-surface),var(--sx-hover),var(--sx-surface)); background-size:200% 100%; animation:sxsk 1.2s infinite; border:1px solid var(--sx-border)}

/* ---------- stat cards ---------- */
.ui-stats{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:0 0 16px}
.ui-stat{background:var(--sx-surface); border:1px solid var(--sx-border); border-radius:var(--sx-r-panel); padding:16px}
.ui-stat .k{display:block; font-size:12px; line-height:18px; color:var(--sx-text-2)}
.ui-stat .v{display:block; font:600 24px/32px var(--sx-font); color:var(--sx-text); font-variant-numeric:tabular-nums; margin-top:4px}
.ui-stat .s{display:block; font-size:12px; color:var(--sx-muted); margin-top:2px}
.stat-cards{gap:16px}
.stat-card{background:var(--sx-surface) !important; border:1px solid var(--sx-border) !important; border-radius:var(--sx-r-panel) !important; box-shadow:none !important; padding:16px !important}
.stat-card .stat-label{font:400 12px/18px var(--sx-font) !important; color:var(--sx-text-2) !important}
.stat-card .stat-value{font:600 24px/32px var(--sx-font) !important; color:var(--sx-text) !important}
.stat-card.accent{background:var(--sx-surface) !important}
@media (max-width:767px){ .ui-stats{grid-template-columns:1fr} }

/* ---------- task rows (dashboard) ---------- */
.ui-rows{list-style:none; margin:0; padding:0}
.ui-rows > li{border-bottom:1px solid var(--sx-border)}
.ui-rows > li:last-child{border-bottom:0}
.ui-rows a.ui-row{display:flex; align-items:center; gap:12px; padding:12px 20px; text-decoration:none; color:var(--sx-text)}
.ui-rows a.ui-row:hover{background:var(--sx-hover)}
.ui-row .grow{flex:1 1 auto; min-width:0}
.ui-row .count{font:600 14px/20px var(--sx-font); font-variant-numeric:tabular-nums; min-width:24px; text-align:right}
.ui-row .go{color:var(--sx-muted); font-size:12px}
.ui-row .sub{display:block; font-size:12px; color:var(--sx-muted)}

/* ---------- dialogs / drawers / toasts ---------- */
.modal-ov{background:rgb(36 50 45 / 40%) !important}
.modal-card{border-radius:var(--sx-r-overlay) !important; box-shadow:var(--sx-shadow-modal) !important; border:1px solid var(--sx-border); padding:20px !important}
.toast-stack{top:76px !important; right:16px !important; bottom:auto !important}
.toast{background:var(--sx-surface) !important; color:var(--sx-text) !important; border:1px solid var(--sx-border) !important; border-radius:var(--sx-r-panel) !important; box-shadow:var(--sx-shadow-pop) !important; font-size:13px !important; max-width:360px}

/* ---------- detail page layout ---------- */
.ui-detail{display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:16px; align-items:start}
.ui-detail > .main,.ui-detail > .side{display:flex; flex-direction:column; gap:16px; min-width:0}
.ui-detail .ui-section{margin:0}
@media (max-width:1199px){ .ui-detail{grid-template-columns:1fr} }

/* ---------- showroom indicator ---------- */
.tb-showroom{display:inline-flex; align-items:center; gap:8px; font-size:12px; color:var(--sx-text-2); cursor:pointer; user-select:none}
.tb-showroom input{margin:0}
body.showroom .tb-showroom{color:var(--sx-text); font-weight:500}
body.showroom .seller-only{display:none !important}

/* ---------- login ---------- */
#loginView.auth-wrap{background:var(--sx-sidebar) !important; min-height:100dvh; display:flex; align-items:flex-start; justify-content:center; padding:96px 16px 32px; box-sizing:border-box}
#loginView .auth-card{width:100%; max-width:400px; background:var(--sx-surface); border:1px solid var(--sx-border); border-radius:var(--sx-r-panel); box-shadow:none; padding:32px; box-sizing:border-box}
#loginView .auth-brand{display:flex; align-items:baseline; gap:8px; justify-content:flex-start; margin:0 0 24px}
#loginView .studio-tag{background:none; color:var(--sx-muted); padding:0; margin:0; font:500 12px/18px var(--sx-font)}
#loginView h1{font:600 18px/28px var(--sx-font); text-align:left; margin:0}
#loginView .auth-sub{text-align:left; color:var(--sx-text-2); font-size:13px; margin:2px 0 20px}
#loginView .field{margin-bottom:16px}
#loginView form .btn[type=submit]{width:100%; min-height:40px}
#loginView .auth-toggle{text-align:center; font-size:13px; color:var(--sx-text-2); margin-top:20px}
#loginView .auth-toggle button,#loginView .auth-forgot button{color:var(--sx-text); font-weight:500; text-decoration:underline; text-underline-offset:2px}
@media (max-width:767px){ #loginView.auth-wrap{padding:24px 16px} #loginView .auth-card{padding:24px} }

/* ---------- misc legacy re-tones ---------- */
.margin-preset,.prod-tab,.gs-chip,.sp-type{border-radius:var(--sx-r-control) !important}
.price-summary .k,.mo-sr .k,.lp-l,.mo-price-cap,.mo-profit-cap,.ds-cap{font:500 12px/18px var(--sx-font) !important; color:var(--sx-text-2) !important}
.price-summary .v,.mo-sr .v{font:600 16px/24px var(--sx-font) !important; color:var(--sx-text) !important; font-variant-numeric:tabular-nums}
.mo-price-card{background:var(--sx-surface) !important; color:var(--sx-text) !important; border:1px solid var(--sx-border) !important; box-shadow:none !important}
.mo-price-value{color:var(--sx-text) !important; font:600 24px/32px var(--sx-font) !important}
.mo-price-hint,.mo-showroom{color:var(--sx-muted) !important}
.mo-profit{background:var(--sx-subtle) !important; border:1px solid var(--sx-border) !important; box-shadow:none !important}
.mo-profit-val{color:#065f46 !important; font:600 20px/28px var(--sx-font) !important}
.mo-steps .mo-step{border-radius:var(--sx-r-control) !important}

/* ---------- product detail ---------- */
.pd-live{display:grid; grid-template-columns:minmax(0,1fr) 280px; align-items:stretch}
.pd-live-frame{border-right:1px solid var(--sx-border); background:var(--sx-subtle)}
.pd-frame{display:block; width:100%; height:600px; border:0}
.pd-live-side .kv-row{grid-template-columns:1fr; gap:2px}
.pd-live-side .kv-row dd{text-align:left !important; font-weight:600; font-size:16px; line-height:24px}
.pd-code{margin:0; padding:12px; background:var(--sx-subtle); border:1px solid var(--sx-border); border-radius:var(--sx-r-control); font:12px/18px var(--sx-mono); white-space:pre-wrap; word-break:break-all; color:var(--sx-text)}
.kit-inline{border:0 !important; padding:0 !important; margin:0 !important; background:none !important}
.kit-inline > summary{display:none}
.kit-inline .kit-grid{margin-top:0}
.legacy-rules{margin:12px 0 0}
.ui-section-foot .ds-hint{align-self:center}
@media (max-width:899px){ .pd-live{grid-template-columns:1fr} .pd-live-frame{border-right:0; border-bottom:1px solid var(--sx-border)} .pd-frame{height:440px} }

/* round-1 polish */
.ui-toolbar .ds-select,.ui-toolbar .ds-input{width:auto; margin:0}
.ui-toolbar .ui-search{width:280px}
.sb-brand,.sb-top .brand-lockup{border:0 !important; padding:0 !important; margin:0 !important; box-shadow:none !important}
.sb-brand::after,.sb-brand::before{display:none !important; content:none !important}
.view-stack > .ui-section,.view-stack > section{margin:0}
.view-stack > div > .ui-stats{margin:0}
.tb-title-row{display:flex; align-items:center; gap:10px; min-width:0}
.tb-title-row .badge{flex:0 0 auto}

/* ---------- round 2: sales records, review drawers and billing ---------- */
.ui-record-sub{display:block;margin-top:4px;color:var(--sx-muted);font-size:12px;overflow-wrap:anywhere}
.ui-record-button.btn{padding:0;min-height:28px;border:0;background:none;box-shadow:none;color:var(--sx-text);text-align:left;white-space:normal;font-weight:500}
.ui-record-button:hover{text-decoration:underline}
.ui-prewrap{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.ui-detail dd,.ui-drawer dd{overflow-wrap:anywhere;min-width:0}
.ui-share{display:grid;gap:12px;min-width:0}
.ui-share input{width:100%;min-width:0;box-sizing:border-box}
.ui-share-actions{display:flex;align-items:start;gap:8px;flex-wrap:wrap}
.ui-overflow{position:relative;font-size:13px}
.ui-overflow summary{cursor:pointer;padding:6px 8px;min-height:30px;box-sizing:border-box;color:var(--sx-text-2)}
.ui-overflow[open] > .btn{display:block;margin-top:8px}
.ui-notice{border:1px solid var(--sx-border);border-radius:var(--sx-r-control);padding:12px 16px;margin:12px 0;font-size:13px;line-height:20px}
.ui-notice.attention{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
.ui-check{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:20px;padding:12px 0}
.ui-check input{flex:0 0 auto;margin:3px 0}
.ui-drawer-overlay{position:fixed;inset:0;background:rgb(36 50 45 / 40%);z-index:120;display:flex;justify-content:flex-end}
.ui-drawer{width:560px;max-width:100%;height:100dvh;background:var(--sx-sidebar);box-shadow:var(--sx-shadow-modal);display:flex;flex-direction:column;box-sizing:border-box}
.ui-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;background:var(--sx-surface);border-bottom:1px solid var(--sx-border);flex:0 0 auto}
.ui-drawer-head h2{font:600 18px/26px var(--sx-font);margin:0}
.ui-drawer-head h2:focus{outline:none}
.ui-drawer-body{padding:20px;overflow-y:auto;overscroll-behavior:contain;flex:1 1 auto;min-height:0}
.ui-drawer-body .ui-section:last-child{margin-bottom:0}
.ui-drawer-body .ds-input,.ui-drawer-body .ds-select{width:100%;box-sizing:border-box;max-width:100%}
.ui-drawer-foot{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:16px 20px max(16px,env(safe-area-inset-bottom));background:var(--sx-surface);border-top:1px solid var(--sx-border);flex:0 0 auto}
.ui-drawer-foot:empty{display:none}
.ui-drawer .kv-row{grid-template-columns:minmax(130px,44%) 1fr;padding:10px 16px}
.ui-drawer .ui-section-body:not(.flush) > .kv .kv-row{padding-left:0;padding-right:0}
.ui-drawer .ds-hint{margin:8px 0}
.ui-billing-period .ds-field{margin:0;max-width:260px}
.ui-tab[aria-current="page"]{color:var(--sx-text);border-bottom-color:var(--sx-brand)}
@media (max-width:767px){
  .ui-card-button{width:100%;border:0;border-bottom:1px solid var(--sx-border);border-radius:0;background:var(--sx-surface);font:inherit;text-align:left;cursor:pointer}
  .ui-sales-cards .ui-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ui-card-title{overflow-wrap:anywhere}
  .ui-share-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .ui-share-actions .btn{white-space:normal}
  .ui-drawer{width:100%}
  .ui-drawer-head{padding:12px 16px}
  .ui-drawer-body{padding:16px}
  .ui-drawer-foot{padding-left:16px;padding-right:16px}
  .ui-drawer-foot .btn{flex:1 1 100%;white-space:normal;min-height:40px}
  .ui-drawer .kv-row{grid-template-columns:1fr;gap:4px}
  .ui-drawer .mo-grid-2{grid-template-columns:1fr}
  .ui-toolbar .ui-search{width:100%}
}
.ui-drawer-overlay,.ui-drawer-overlay *{text-transform:none !important;letter-spacing:normal}
.kv-row.seller-only{white-space:normal}

/* Wide sales tables use the same record cards on showroom tablets. */
@media (max-width:1023px){
  .ui-sales-list .ui-table-wrap.cardable{display:none}
  .ui-sales-cards{display:block}
  .ui-sales-cards .ui-card-button{width:100%;border:0;border-bottom:1px solid var(--sx-border);border-radius:0;background:var(--sx-surface);font:inherit;text-align:left;cursor:pointer}
  .ui-sales-cards .ui-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- round-3: integration / support / settings re-tones ---------- */
.ig-lead{margin:0 0 12px}
.ig-lead .im-lead-h,.ig-lead h2{font:600 14px/20px var(--sx-font) !important; margin:0 0 2px; color:var(--sx-text)}
.ig-accordion{display:flex; flex-direction:column; gap:8px; margin-bottom:16px}
.ig-accordion > *{background:var(--sx-surface); border:1px solid var(--sx-border) !important; border-radius:var(--sx-r-panel) !important; box-shadow:none !important}
.ig-accordion h3,.ig-accordion .ig-acc-title{font:600 14px/20px var(--sx-font) !important}
.inst-intro,.ig-contact,.sp-chat{display:none}
.opt-card{border-radius:var(--sx-r-panel) !important; box-shadow:none !important; border:1px solid var(--sx-border) !important; background:var(--sx-surface) !important}
.opt-card.on{border-color:var(--sx-text) !important; background:var(--sx-subtle) !important}
.opt-card .opt-radio{border-color:var(--sx-border-control) !important}
.opt-card.on .opt-radio{border-color:var(--sx-text) !important; box-shadow:inset 0 0 0 4px var(--sx-text) !important; background:var(--sx-surface) !important}
.opt-card .opt-title{font:500 13px/20px var(--sx-font) !important; color:var(--sx-text) !important}
.opt-card .opt-desc{font-size:12px !important; line-height:18px !important; color:var(--sx-muted) !important}
.integ-status{padding:20px}
.sp-contact{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap}
.sp-contact .btn{min-height:32px}
.sp-typeseg{display:inline-flex !important; flex-wrap:wrap; gap:2px; padding:3px; background:var(--sx-hover); border-radius:var(--sx-r-control); border:0 !important; margin-bottom:16px}
.sp-type{border:0 !important; background:transparent !important; box-shadow:none !important; min-height:28px; padding:3px 10px !important; font:500 13px/20px var(--sx-font) !important; color:var(--sx-text-2) !important; border-radius:4px !important}
.sp-type.on{background:var(--sx-surface) !important; color:var(--sx-text) !important; box-shadow:var(--sx-shadow-control) !important}
.shop-form{max-width:880px}
.shop-form .ui-tabs{margin-bottom:16px}
.ds-savebar{position:static !important; background:none !important; box-shadow:none !important; padding:0 !important; border:0 !important}
.design-wrap{gap:16px !important; align-items:start}
.ds-form .ui-tabs{margin-bottom:12px}
.ds-preview{border:1px solid var(--sx-border) !important; border-radius:var(--sx-r-panel) !important; box-shadow:none !important}
.ds-section-head{margin:0 0 12px}
.key-list,.keys-list{border:0 !important}
.ai-brief{background:none !important; border:0 !important; box-shadow:none !important; padding:0 !important; margin:0 !important}
.ai-brief-h{font:600 13px/20px var(--sx-font) !important; margin:0 0 2px !important}
.shop-form .ds-section{margin:0 0 16px !important}
.sp-contact{flex-direction:row !important; align-items:center; text-align:left; padding:20px !important}
.sp-contact-t strong{font:600 14px/20px var(--sx-font) !important; color:var(--sx-text) !important}
.sp-contact-actions{display:flex; gap:8px; flex-wrap:wrap}
.sp-contact-person{font-size:12px; color:var(--sx-muted); width:100%}
.sp-submit .btn{min-width:0 !important; padding:5px 16px !important}
.sp-form .ds-field{margin-bottom:16px}

/* ---------- round 4: focused editors and the in-store offer workflow ---------- */
.ui-content-editor{border:0;background:none}
.ui-content-editor .adv-inner{padding:0}
.ui-content-editor .adv-body{display:block}
.ui-content-editor .ds-params{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 24px}
.ui-content-editor .ds-input-row{display:grid;grid-template-columns:minmax(120px,1fr) auto;gap:8px}
.ui-content-editor .ds-hide-toggle{grid-column:1/-1;justify-self:start;border-radius:var(--sx-r-control);min-height:32px;font:500 12px/18px var(--sx-font)}
.ui-content-editor .ds-reset{min-height:32px}
.ui-content-editor .ds-pc-save{padding-top:16px;border-top:1px solid var(--sx-border)}
.ui-css-reference{margin-top:16px;border-top:1px solid var(--sx-border);padding-top:12px}
.ui-css-reference summary{cursor:pointer;font-weight:500;min-height:32px}
.ui-css-reference .ds-css-ref{margin-top:12px}
.ui-preview-jump{display:none}
.ds-preview{scroll-margin-top:128px;min-width:0}
.ds-preview:focus{outline:2px solid var(--sx-brand-ink);outline-offset:3px}
.design-wrap .ds-form{min-width:0;gap:0}
.design-wrap .ds-input-row{min-width:0}
.design-wrap .ds-section:last-child{margin-bottom:0}

.mo-steps{list-style:none;margin:0 0 20px;padding:0;gap:0;flex-wrap:nowrap;border-bottom:1px solid var(--sx-border)}
.mo-steps .mo-step{flex:1;min-width:0;border:0;border-bottom:2px solid transparent;border-radius:0 !important;box-shadow:none;background:none;padding:10px 8px;gap:8px}
.mo-step-num{width:22px;height:22px;font:500 12px/20px var(--sx-font);border-color:var(--sx-border);background:var(--sx-surface)}
.mo-step-label{font:500 13px/18px var(--sx-font);color:var(--sx-muted)}
.mo-steps .mo-step.on{background:none;border-bottom-color:var(--sx-brand)}
.mo-step.on .mo-step-num{background:var(--sx-primary);border-color:var(--sx-primary);color:var(--sx-surface)}
.mo-step.on .mo-step-label{color:var(--sx-text)}
.mo-step.done .mo-step-num{background:var(--sx-subtle);border-color:var(--sx-border);color:var(--sx-text-2)}
.mo-wrap .ds-section{overflow:visible}
.mo-config-grid{grid-template-columns:minmax(0,1fr) 240px;gap:16px}
.mo-viewer{min-width:0;border-color:var(--sx-border);border-radius:var(--sx-r-panel)}
.mo-price-card{padding:16px;border-radius:var(--sx-r-panel);top:88px}
.mo-price-value{margin-top:4px}
.mo-profit{margin-top:12px;padding:12px;border-radius:var(--sx-r-control)}
.mo-profit-sub{font-size:12px;line-height:18px;color:var(--sx-text-2);margin-top:4px}
.mo-actions{gap:8px;padding-top:16px;border-top:1px solid var(--sx-border)}
.mo-actions .btn{min-height:36px}
.mo-actions .mo-alternative{margin-left:auto;color:var(--sx-text-2);font-size:12px}
.mo-wrap .mo-success{max-width:760px;margin:auto}
.ui-drawer .mfx-as{margin:0;max-width:none;border:1px solid var(--sx-border);border-radius:var(--sx-r-panel);box-shadow:none;background:var(--sx-surface)}
.ui-drawer .mfx-as-head{background:var(--sx-subtle);color:var(--sx-text);padding:16px;border-bottom:1px solid var(--sx-border)}
.ui-drawer .mfx-as-brand,.ui-drawer .mfx-as-person{display:none}
.ui-drawer .mfx-as-h1{font:600 14px/20px var(--sx-font)}
.ui-drawer .mfx-as-h2{color:var(--sx-text-2);font-size:12px}
.ui-drawer .mfx-as-c{color:var(--sx-text-2);font-weight:400;border-color:var(--sx-border)}
.ui-drawer .mfx-as-msgs{min-height:0;padding:16px}
.ui-drawer .mfx-as-b{font-size:13px;border-radius:var(--sx-r-control);max-width:95%}
.ui-drawer .mfx-as-b.ai{background:var(--sx-subtle);color:var(--sx-text)}
.ui-drawer .mfx-as-b.me,.ui-drawer .mfx-as-send{background:var(--sx-primary);color:var(--sx-surface)}
.ui-drawer .mfx-as-chip,.ui-drawer .mfx-as-inp,.ui-drawer .mfx-as-send{border-radius:var(--sx-r-control);font:500 13px/20px var(--sx-font)}
.ui-drawer .mfx-as-chip{border:1px solid var(--sx-border);padding:8px 12px;color:var(--sx-text-2)}
.ui-drawer .mfx-as-bar{padding:12px;gap:8px}
.ui-drawer .mfx-as-send{padding:8px 12px}
@media(max-width:1023px){
  .mo-config-grid{grid-template-columns:1fr}
  .mo-price-card{position:static;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:16px}
  .mo-price-cap,.mo-price-value,.mo-price-hint{grid-column:1}
  .mo-price-card .mo-profit{grid-column:2;grid-row:1/4;margin:0;padding:0 0 0 16px;border:0 !important;border-left:1px solid var(--sx-border) !important;border-radius:0;background:none !important}
  .mo-price-card .mo-profit-val{font-size:18px !important;line-height:26px !important}
  .mo-actions{position:sticky;bottom:0;z-index:5;background:var(--sx-surface);padding:12px 0 max(12px,env(safe-area-inset-bottom));box-shadow:0 -6px 12px rgb(36 50 45 / 3%)}
  .mo-actions .btn{min-height:40px}
  .ui-preview-jump{display:inline-flex}
  .design-wrap{grid-template-columns:1fr !important}
}
@media(max-width:560px){
  .mo-step-label{display:block;font-size:11px;overflow-wrap:anywhere}
  .mo-steps .mo-step{padding:8px 3px;gap:5px}
  .mo-steps .mo-step-num{width:19px;height:19px;flex:0 0 19px;font-size:11px}
  .mo-wrap .ds-section{padding:16px}
  .mo-actions{display:grid;grid-template-columns:auto minmax(0,1fr)}
  .mo-actions .btn{white-space:normal}
  .mo-actions .mo-alternative{grid-column:1/-1;justify-self:center;margin:0;min-height:32px;border:0;box-shadow:none;background:none}
  .mo-price-card{padding:12px;column-gap:12px}
  .mo-price-value{font-size:20px !important;line-height:28px !important}
  .mo-price-card .mo-profit{padding-left:12px}
  .mo-price-cap,.mo-profit-cap{font-size:11px !important;line-height:16px !important}
  .mo-price-hint,.mo-profit-sub{font-size:11px;line-height:16px}
  .design-wrap .ds-section{padding:16px}
  .ds-preview .ds-cap-row{flex-wrap:wrap}
  .ui-drawer .mfx-as-chip{width:100%}
}
/* Route and wizard resets must not inherit the storefront's smooth page scroll. */
html{scroll-behavior:auto}
@media(max-width:560px){.mo-actions .btn:only-child{grid-column:1/-1}}

@media(max-width:700px){.ui-content-editor .ds-params{grid-template-columns:1fr}}
.ds-preset{border-radius:var(--sx-r-control);box-shadow:none;font:500 13px/20px var(--sx-font);min-height:32px}

/* 2026-10-06: sales tabs, Sonderanfertigung cards, preview picker */
a.ui-tab{text-decoration:none; display:inline-flex; align-items:center}
.ui-sales-tabs{margin:0 0 16px}
.sx-opts{display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px}
.sx-opt{display:flex; flex-direction:column; gap:8px; align-items:flex-start}
.sx-opt .btn{margin-top:auto}
.sx-opt-tag{font:500 11px/16px var(--sx-font); color:var(--sx-text-2); background:var(--sx-bg-subtle,var(--sx-hover)); border:1px solid var(--sx-border,var(--sx-border)); border-radius:999px; padding:1px 8px}
.sx-opt-title{font:600 15px/22px var(--sx-font); margin:0; color:var(--sx-text,var(--sx-text))}
.sx-steps{list-style:none; counter-reset:sx; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px}
.sx-steps li{counter-increment:sx; display:flex; flex-direction:column; gap:4px; padding-left:36px; position:relative}
.sx-steps li::before{content:counter(sx); position:absolute; left:0; top:0; width:24px; height:24px; border-radius:999px; background:var(--sx-brand-soft); color:var(--sx-brand-ink); font:600 12px/24px var(--sx-font); text-align:center}
.ds-preview .ds-prev-product{width:auto; min-width:180px; max-width:240px; margin:0}
.ds-preview .ds-prev-reload{margin-left:auto}

/* Integration: platform-led setup with persistent product context. */
.integration-setup{max-width:1280px;margin:0 auto}
.integration-setup .ds-select{max-width:420px;min-height:40px;width:100%}
.integration-copy{margin:0 0 12px;color:var(--sx-text-2);font:400 13px/21px var(--sx-font);overflow-wrap:anywhere}
.integration-copy:last-child{margin-bottom:0}
.integration-product-bar{position:sticky;top:64px;z-index:8;display:flex;align-items:center;gap:16px;padding:12px 16px;margin-bottom:16px;border:1px solid var(--sx-border);border-radius:var(--sx-r-panel);background:var(--sx-surface);box-shadow:var(--sx-shadow-control)}
.integration-product-bar label{font-weight:500;white-space:nowrap}
.integration-flow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));list-style:none;margin:0 0 16px;padding:0;border:1px solid var(--sx-border);border-radius:var(--sx-r-control);background:var(--sx-subtle)}
.integration-flow li{padding:16px;min-width:0}
.integration-flow li+li{border-left:1px solid var(--sx-border)}
.integration-flow strong{display:block;margin-bottom:6px;font-weight:600;color:var(--sx-text)}
.integration-setup .kv{margin:0 0 16px}
.integration-setup .kv-row{grid-template-columns:minmax(110px,.5fr) minmax(0,1fr)}
.integration-workspace{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}
.integration-workspace>div,.integration-status{min-width:0}
.integration-status{position:sticky;top:140px}
.integration-status .ui-section-head{align-items:flex-start;gap:8px;flex-wrap:wrap}
.integration-status .kv-row{grid-template-columns:1fr;gap:4px}
.integration-status .kv-row dd{overflow-wrap:anywhere}
.integration-status .integration-readiness{font-size:13px;line-height:20px;padding-top:16px;border-top:1px solid var(--sx-border);margin:16px 0 8px}
.integration-status .ui-section-body>strong{display:block;margin:16px 0 8px}
.integration-status .btn{white-space:normal;text-align:left}
.integration-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px;overflow:visible}
.integration-tabs .ui-tab{display:flex;align-items:flex-start;gap:8px;text-align:left;white-space:normal;padding:10px 8px;line-height:18px}
.integration-step-number{font:500 12px/22px var(--sx-font);width:22px;flex:0 0 22px;text-align:center;border-radius:var(--sx-r-control);background:var(--sx-pressed);color:var(--sx-text)}
.integration-tabs [aria-selected=true] .integration-step-number{background:var(--sx-primary);color:var(--sx-surface)}
.integration-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:16px}
.integration-field{display:flex;flex-direction:column;align-items:flex-start;gap:10px;margin-bottom:20px}
.integration-field .ds-input{width:100%;max-width:440px}
.integration-field .integration-copy{margin:0}
.integration-code{margin:12px 0 16px;max-width:100%;min-width:0;border:1px solid var(--sx-border);border-radius:var(--sx-r-control);overflow:hidden;background:var(--sx-subtle)}
.integration-code-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border-bottom:1px solid var(--sx-border)}
.integration-code-head strong{font-weight:500}
.integration-code pre{margin:0;padding:14px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--sx-text);font:400 12px/19px var(--sx-mono);max-height:360px;overflow:auto}
.integration-details{border-top:1px solid var(--sx-border);margin:16px 0;padding-top:8px}
.integration-details summary{cursor:pointer;min-height:36px;padding:8px 0;font-weight:500}
.integration-setup [role=tabpanel]{scroll-margin-top:156px}
@media(max-width:1100px){.integration-workspace{grid-template-columns:minmax(0,1fr) 280px}.integration-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:850px){.integration-workspace{grid-template-columns:1fr}.integration-status{position:static}.integration-flow{grid-template-columns:1fr}.integration-flow li+li{border-left:0;border-top:1px solid var(--sx-border)}}
@media(max-width:560px){.integration-product-bar{top:56px;padding:10px 12px;gap:8px;flex-direction:column;align-items:stretch}.integration-setup .kv-row{grid-template-columns:1fr;gap:4px}.integration-tabs .ui-tab{font-size:12px}.integration-actions{align-items:flex-start}.integration-code-head{align-items:flex-start}.integration-setup [role=tabpanel]{scroll-margin-top:180px}}

/* 2026-10-06: one dropdown style everywhere (native selects looked cramped) */
select.ds-select,.field select,#viewRoot select,.ui-drawer select{
  -webkit-appearance:none; appearance:none; padding:8px 38px 8px 12px !important; min-height:38px;
  background:var(--sx-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px !important; cursor:pointer; line-height:20px}
select.ds-select:hover,#viewRoot select:hover{border-color:var(--sx-border-control)}

/* icons */
.ic{display:inline-flex; flex:none; align-items:center; justify-content:center}
.ic svg{width:100%; height:100%; display:block}
.ic-btn{width:15px; height:15px; margin-left:-2px}
.btn-sm .ic-btn{width:14px; height:14px}
.ic-head{width:28px; height:28px; padding:6px; box-sizing:border-box; margin-right:10px; border-radius:7px;
  background:var(--sx-brand-soft); color:var(--sx-brand-ink); vertical-align:middle}
.ui-section-head h2,h3.ds-h,h3.sx-opt-title{display:flex; align-items:center}
.ic-empty{width:44px; height:44px; padding:11px; box-sizing:border-box; border-radius:999px; margin:0 auto 12px;
  background:var(--sx-hover); color:var(--sx-text-2)}
.ui-empty{display:flex; flex-direction:column; align-items:center}
.tb-icon{width:22px; height:22px; color:var(--sx-text-2); flex:none; display:inline-flex}
.tb-icon svg{width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.8}
.tb-icon[hidden]{display:none}

/* ---------- Studio finish: paper, mineral ink, quiet hierarchy ---------- */
body{font-size:14px;line-height:22px}
#appView .tb-title{font-size:22px;line-height:30px;letter-spacing:-.025em}
.studio-topbar{background:var(--sx-surface);padding-inline:28px}
.studio-main,.studio-main.wrap{padding:28px !important}
.sb-top{padding:22px 18px 18px}
.sb-shop{margin-top:10px;font-weight:400}
.sb-nav{padding:16px 12px}
.studio-nav{gap:3px}
.studio-nav a{min-height:40px;padding-inline:12px;font-weight:400}
.studio-nav a.active{background:var(--sx-surface);color:var(--sx-text);font-weight:600;box-shadow:var(--sx-shadow-control)}
.studio-nav a.active .nav-ic{color:var(--sx-brand)}
.studio-nav .sb-group{padding:22px 12px 7px;font-size:11px}
.sb-foot{padding:12px;border-color:var(--sx-border-strong)}
.page-desc{font-size:14px;line-height:23px;margin-bottom:22px;max-width:72ch}
.tb-icon{color:var(--sx-brand)}
.tb-title-row{gap:12px}

.ui-section,.ds-section,.state,.ui-stat,.ui-drawer-head,.ui-drawer-foot,
.ui-card-button,.studio-burger,.ui-thumb,.mo-step-num{background:var(--sx-surface)}
.ui-section,.ds-section{margin-bottom:20px}
.ui-section-head{padding:18px 22px;gap:16px}
.ui-section-head h2,.ds-h,.ds-section h3,.ds-section .ds-h{font-size:15px !important;line-height:22px !important;font-weight:600}
.ui-section-head .sub{margin-top:5px;line-height:19px}
.ui-section-body{padding:22px}
.ui-section-body.flush{padding:0}
.ds-section{padding:22px}
.ui-section-foot{padding:14px 22px}
/* Nested empty states and editors are content, not another framed panel. */
.ui-section-body > .state,.ds-section > .state{border:0;background:transparent;border-radius:0}
.ui-section-body > .ui-section{border:0;border-radius:0;box-shadow:none;margin:0}
.ui-section-body > .ui-section > .ui-section-head{padding-inline:0}
.ui-section-body > .ui-section > .ui-section-body{padding-inline:0}
.ic-head{width:30px;height:30px;padding:7px;margin-right:10px;border-radius:var(--sx-r-control);background:var(--sx-brand-soft);color:var(--sx-brand-ink)}
.ic-empty{width:48px;height:48px;padding:13px;border-radius:999px;background:var(--sx-brand-soft);color:var(--sx-brand-ink);margin-bottom:14px}
.ic-btn{width:16px;height:16px}
.ui-empty,.state{padding:48px 24px;min-height:220px}
.ui-empty h3,.state h3{font-size:17px;line-height:24px;font-weight:500}
.ui-empty p,.state p{max-width:42ch;line-height:21px}
.ui-empty .btn{margin-top:14px}

.btn{min-height:36px;padding:7px 14px;gap:8px;font-weight:500}
.btn-sm{min-height:32px;padding:5px 11px}
.btn-ghost,.btn.btn-ghost,.btn-danger{background:var(--sx-surface)}
.btn-plain{background:transparent;box-shadow:none}
.btn:disabled{box-shadow:none}
.ds-input,.ds-select,.field input,.field select,.field textarea,input.ds-input,textarea.ds-input,select.ds-select{
  min-height:40px;padding:9px 12px;background:var(--sx-surface);box-shadow:inset 0 1px 2px rgb(36 50 45 / 3%)}
.ds-input:focus,.ds-select:focus,.field input:focus,.field select:focus,.field textarea:focus,
.mfx-as-inp:focus,.embed-scope-select:focus,.sur-sel:focus{
  border-color:var(--sx-brand-ink);outline:2px solid var(--sx-brand-ink);outline-offset:2px;box-shadow:none}
.margin-input:focus-within,.sur-amt:focus-within,.min-field:focus-within{border-color:var(--sx-brand-ink);box-shadow:none}
.ds-input::placeholder,.field input::placeholder,.field textarea::placeholder{color:var(--sx-muted);opacity:1}
select.ds-select,.field select,#viewRoot select,.ui-drawer select{background-color:var(--sx-surface) !important;min-height:40px}
.ds-field{margin-bottom:20px}
.ds-input-row > .ds-input{min-width:0}
.ds-reset,.ds-preset,.ds-hide-toggle{border-radius:var(--sx-r-control);background:var(--sx-surface);font-family:var(--sx-font)}
.ds-reset:hover{border-color:var(--sx-border-control);color:var(--sx-text)}
.ui-toolbar{padding:16px 20px;gap:10px;background:var(--sx-surface)}
.ui-table th{height:40px;background:var(--sx-subtle)}
.ui-table td{padding-block:14px}
.ui-table a.rec{font-weight:500;font-size:14px}
.ui-thumb{width:44px;height:44px;flex-basis:44px;border-radius:var(--sx-r-control);padding:4px}
.ui-table .sub{margin-top:2px}
.ui-card{padding:18px}
.ui-card-grid{gap:12px;margin-top:14px}
.ui-card-grid .v{margin-top:3px}
.ui-rows a.ui-row{padding:16px 22px}
.ui-row .grow > span:first-child{font-weight:500}
.ui-row .sub{margin-top:3px;line-height:19px}
.ui-row .count{font-size:18px;line-height:24px}
/* Status stays legible, but repeated state labels no longer dominate the list. */
.badge,.status-chip{border-radius:var(--sx-r-control);border-color:transparent;font-weight:400}
.badge::before{content:none}
.badge.neutral,.status-chip.off{background:var(--sx-hover);color:var(--sx-text-2);border-color:transparent}
.badge.success,.status-chip.on{background:#e8efe5;color:#3f6147;border-color:transparent}
.badge.info{background:#e8eef0;color:#365763;border-color:transparent}
.badge.attention{background:#f7edda;color:#826123;border-color:transparent}
.badge.problem{background:#f8e8e3;color:#9d4133;border-color:transparent}
.sx-opt-tag{background:transparent;border:0;border-radius:0;padding:0;color:var(--sx-muted)}

/* One quiet metric strip, not three competing cards. */
.ui-stats{gap:0;background:var(--sx-subtle);border:1px solid var(--sx-border);border-radius:var(--sx-r-panel);overflow:hidden}
.ui-stat{border:0;border-radius:0;background:transparent;padding:22px 24px;min-width:0}
.ui-stat + .ui-stat{border-left:1px solid var(--sx-border)}
#appView .ui-stat .v{font-size:30px;line-height:38px;font-weight:500;letter-spacing:-.035em}
.ui-stat .s{margin-top:6px}
.ui-stat .v{position:relative;white-space:nowrap}
.sx-counting{color:transparent !important}
.sx-count-visual{position:absolute;inset:0;color:var(--sx-text);pointer-events:none;user-select:none;font:inherit;letter-spacing:inherit}
/* Anchor the left edge of the metric strip, including animated numbers. */
.ui-stats > .ui-stat:first-child .v,.ui-stats > .ui-stat:first-child .sx-count-visual{color:var(--sx-brand-ink)}

.ui-tabs{position:relative;gap:8px;margin-bottom:24px}
.ui-tab{min-height:44px;padding-inline:14px;flex-shrink:0}
.ui-tab[aria-selected=true],.ui-tab[aria-current=page]{font-weight:600;color:var(--sx-text);border-bottom-color:var(--sx-brand)}
.ui-tabs.sx-tabs-ready > .ui-tab{border-bottom-color:transparent}
.sx-tab-indicator{position:absolute;left:0;top:0;height:2px;border-radius:2px;background:var(--sx-brand);pointer-events:none}
.ui-seg,.seg,.sp-typeseg{border-radius:var(--sx-r-control)}
.ui-seg button,.seg button,.sp-type{border-radius:6px !important}
.ui-seg button.on,.seg button.on,.sp-type.on{background:var(--sx-surface) !important}
.design-wrap{gap:24px !important}
.ds-preview{background:var(--sx-surface);overflow:hidden}
.integration-product-bar{background:var(--sx-surface)}
.integration-flow{background:var(--sx-subtle)}
.integration-tabs{gap:0}
.integration-tabs .ui-tab{flex-shrink:1}
.sx-opts{gap:20px;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
.sx-opt{padding:24px;gap:14px}
.sx-opt-title{font-size:18px;line-height:25px}
.sp-contact{background:var(--sx-subtle) !important}
/* The existing file-picker button is the full clickable upload area. */
.sp-file-row{align-items:stretch;gap:8px}
.sp-file-row .btn.btn-ghost{flex:1 1 100%;min-height:80px;padding:20px;white-space:normal;
  border:1px dashed var(--sx-brand-ink);background:var(--sx-subtle);color:var(--sx-text);box-shadow:none}
.sp-file-row .btn.btn-ghost:not(:disabled):hover{background:var(--sx-brand-soft);border-color:var(--sx-brand-ink);box-shadow:none;translate:none}
.sp-file-row .btn .ic-btn{width:20px;height:20px;margin-left:0;color:var(--sx-brand)}
.sp-file-name{flex:1 1 100%;min-width:0;overflow-wrap:anywhere}
.sp-file-name:empty{display:none}

.mfx-modal-overlay,.modal-ov,.ui-drawer-overlay{background:rgb(36 50 45 / 32%) !important}
.ui-drawer-overlay{overflow:clip}
.mfx-modal-card,.modal-card{box-sizing:border-box;background:var(--sx-surface);border:1px solid var(--sx-border);border-radius:var(--sx-r-overlay) !important;box-shadow:var(--sx-shadow-modal) !important;padding:28px !important;max-width:min(100%,520px)}
.modal-card.modal-wide{max-width:680px}
.mfx-modal-h{font:600 20px/28px var(--sx-font)}
.ui-drawer-head,.ui-drawer-foot{padding:20px 24px}
.ui-drawer-body{padding:24px}
.toast{background:var(--sx-surface) !important;min-width:0;padding:16px 20px;line-height:21px;animation:none}
.toast.ok{border-color:#b9cdb6 !important}
.toast.err{border-color:#deb4a9 !important}
.sx-copy-success{color:#3f6147 !important;border-color:#94b58e !important;background:#e8efe5 !important}
.sx-motion-exit,.sx-motion-exit *{pointer-events:none !important;user-select:none !important}
#loginView.auth-wrap{background:var(--sx-bg) !important}
#loginView .auth-card{background:var(--sx-surface);border-radius:var(--sx-r-overlay);padding:36px}
#loginView .auth-brand .brand{font-size:15px;line-height:22px}
#loginView .auth-lang-mount{position:static;display:flex;justify-content:flex-end;margin-bottom:20px}
#loginView h1{font-size:26px;line-height:34px;font-weight:500}
#loginView .auth-sub{margin:8px 0 28px}

/* Shimmer only communicates loading and stops after a short wait. */
.ui-skel,.skeleton-grid .sk{background:linear-gradient(100deg,var(--sx-hover) 20%,var(--sx-surface) 45%,var(--sx-hover) 70%);background-size:240% 100%;animation:sxsk 1.6s ease-out 3}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
  .btn:not(:disabled){transition:translate 150ms ease-out,background-color 150ms ease-out,border-color 150ms ease-out,box-shadow 150ms ease-out}
  .btn:not(:disabled):hover{translate:0 -1px}
  .btn:not(:disabled):active{translate:0 0}
  .ui-row .go{transition:translate 150ms ease-out}
  .ui-row:hover .go{translate:2px 0}
}

@media(min-width:1024px){.studio-sidebar{flex-basis:240px;width:240px}}
@media(max-width:1023px){
  .studio-topbar{padding-inline:20px}
  .studio-sidebar{visibility:hidden;transition:transform 180ms ease-out,visibility 180ms}
  .studio-shell.nav-open .studio-sidebar{visibility:visible}
}
@media(max-width:767px){
  .studio-main,.studio-main.wrap{padding:20px 16px !important}
  .studio-topbar{padding:12px 16px;gap:10px}
  #appView .tb-title{font-size:20px;line-height:28px}
  .tb-titles{min-width:0}
  .tb-actions{gap:8px}
  .tb-actions .btn{white-space:normal;min-width:0}
  .studio-burger{width:44px;height:44px;flex:0 0 44px}
  .studio-nav a{min-height:44px}
  .sb-logout,.tb-showroom{min-height:44px;display:inline-flex;align-items:center}
  #appView button:not(.pw-toggle),#appView .btn,.ui-drawer button,.modal-card button,.mfx-modal-card button,
  .ui-tab,.ds-reset,.ds-reset-link,.ds-hide-toggle,.ds-preset,.ui-overflow summary,.ui-css-reference summary,
  #loginView button,.mfx-as-chip{min-height:44px;min-width:44px}
  #appView .ds-input,#appView select,.field input,.field select,.field textarea,.ui-drawer .ds-input,.ui-drawer .ds-select{min-height:44px;font-size:16px}
  #appView input[type=checkbox],#appView input[type=radio]{min-height:0}
  .ui-section-head{padding:16px;gap:12px;flex-wrap:wrap}
  .ui-section-body,.ds-section{padding:18px 16px}
  .ui-section-body.flush{padding:0}
  .ui-section-foot{padding:14px 16px;flex-wrap:wrap}
  .ui-section-head > div,.ui-section-actions,.ui-section-body,.ds-field{min-width:0;max-width:100%}
  .ui-section-head h2{overflow-wrap:anywhere}
  .ui-rows a.ui-row{padding:16px;gap:10px}
  .ui-stat{padding:18px 20px}
  .ui-stat + .ui-stat{border-left:0;border-top:1px solid var(--sx-border)}
  #appView .ui-stat .v{font-size:28px;line-height:36px}
  .ui-toolbar{padding:16px}
  .ui-toolbar .ui-search{width:100%}
  .ui-empty,.state{padding:40px 20px}
  .ui-empty .btn{white-space:normal}
  .ui-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ui-card-grid .v{overflow-wrap:anywhere}
  .ui-tabs{gap:0;max-width:100%}
  .ui-tab{padding-inline:12px}
  .ui-drawer-head,.ui-drawer-foot{padding:16px}
  .ui-drawer-body{padding:20px 16px}
  .toast-stack{left:16px;right:16px !important;max-width:none;width:auto}
  .toast{box-sizing:border-box;max-width:100%;overflow-wrap:anywhere}
  .mfx-modal-card,.modal-card{padding:24px !important}
  .mfx-modal-actions{flex-wrap:wrap}
  .sx-opts,.sx-steps{grid-template-columns:minmax(0,1fr)}
  .ds-preview .ds-prev-product{min-width:0;max-width:100%;flex:1 1 160px}
  .design-wrap .ds-color-pair{min-width:0}
  .ui-content-editor .ds-input-row{grid-template-columns:minmax(0,1fr) auto}
  .ui-content-editor .ds-hide-toggle{white-space:normal}
  .integration-tabs{gap:0}
  .integration-tabs .ui-tab{padding:12px 8px}
  .integration-product-bar{position:static}
  #viewRoot :where(input,select,textarea,pre){max-width:100%;box-sizing:border-box}
  #loginView .auth-card{padding:28px 24px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important;transition:none !important;scroll-behavior:auto !important}
  .sx-motion-exit{display:none !important}
}
