/* ProBatcher Live Demo – ERP styles from skapa_annons.html + embedded overrides */

/* === Dark theme (match real app) === */
html.demo-embedded,
html.demo-embedded[data-theme="theme-darkblue"] {
    color-scheme: dark;
    --bg-main: #001122;
    --bg-card: #0f1a2e;
    --text-primary: #f1f5f9;
    --text-main: #f1f5f9;
    --text-light: #94a3b8;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(15, 23, 42, 0.65);
    --card-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --purple: #8b5cf6;
}

html.demo-embedded body.demo-embedded {
    background: #001122 !important;
    color: var(--text-primary) !important;
    padding-bottom: 88px !important;
    overflow-x: hidden !important;
}

/* KRITISKT: visa porslinsfälten (style.css döljer .col-dynamic utan show-*) */
html.demo-embedded body.show-porslin .col-porslin.col-dynamic,
html.demo-embedded .col-porslin.col-dynamic {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
}

/* Foto-rad: miniatyrer på egen rad, knappar under – aldrig sammanpressade */
html.demo-embedded .erp-photo-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 8px !important;
}
html.demo-embedded .demo-photo-strip {
    display: flex !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    min-height: 96px !important;
    gap: 8px !important;
    overflow-x: auto !important;
}
html.demo-embedded .demo-photo-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none;
}
html.demo-embedded .demo-photo-toolbar::-webkit-scrollbar { display: none; }
html.demo-embedded .demo-photo-toolbar .erp-photo-count {
    flex-shrink: 0;
}

html.demo-embedded #login-screen { display: none !important; }
html.demo-embedded .tab-nav { display: none !important; }
html.demo-embedded .profile-select {
    display: inline-block !important;
    max-width: 110px;
    font-size: 0.72rem !important;
    padding: 5px 10px !important;
}

html.demo-embedded .main-container {
    margin-top: 56px !important;
    padding: 0 6px !important;
    max-width: 100% !important;
}

html.demo-embedded header {
    background: linear-gradient(135deg, #0f172a 0%, #001122 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
}

html.demo-embedded #batchbot-icon,
html.demo-embedded #batchbot-icon i { color: #fff !important; }

html.demo-embedded #mobileMenuBtn,
html.demo-embedded #mobileMenuBtn i { color: #fff !important; }

html.demo-embedded,
html.demo-embedded body {
    overflow-y: auto !important;
    scrollbar-width: none !important;
    /* Fast mobilbredd – får aldrig krympa i landnings-iframe */
    width: 390px !important;
    min-width: 390px !important;
    max-width: 390px !important;
}
html.demo-embedded ::-webkit-scrollbar { display: none !important; }

/* Foto-tiles får aldrig bli smala streck i demot */
html.demo-embedded .demo-photo-thumb,
html.demo-embedded .sa-photo-tile,
html.demo-embedded .demo-photo-thumb.sa-photo-tile {
    width: 88px !important;
    height: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    flex: 0 0 88px !important;
    box-sizing: border-box !important;
}
html.demo-embedded .demo-photo-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
html.demo-embedded .erp-photo-strip,
html.demo-embedded .image-preview-container {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow-x: auto !important;
}

/* === ERP core from skapa_annons.html === */
/* ===== ERP CORE ===== */
.sa-wrap { padding-bottom: 100px; overflow: visible !important; }
#batcher-tab.tab-content.active { overflow: visible !important; }
.erp-topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; padding:0 2px; }
.erp-title { font-size:0.95rem; font-weight:800; color:var(--text-primary); display:flex; align-items:center; gap:8px; letter-spacing:-0.3px; }
.erp-title i { color:var(--accent); }
.erp-topbar-right { display:flex; align-items:center; gap:8px; }
.erp-progress-text { display:none !important; }
/* BatchBot – endast #batchbot-icon (hamburger påverkas inte) */
#batchbot-icon {
    width:24px !important; height:24px !important; min-width:24px !important; min-height:24px !important;
    padding:0 !important; margin:0 !important;
    border:none !important; outline:none !important; box-shadow:none !important;
    background:none !important; background-color:transparent !important;
    border-radius:0 !important;
    display:inline-flex !important; align-items:center !important; justify-content:center !important;
    color:var(--accent,#2563eb) !important; cursor:pointer; flex-shrink:0;
    line-height:1; transition:color 0.15s, transform 0.15s;
}
#batchbot-icon i {
    font-size:24px !important; width:24px !important; height:24px !important; line-height:24px !important;
    display:flex !important; align-items:center !important; justify-content:center !important;
    color:var(--accent,#2563eb) !important; border:none !important;
}
#batchbot-icon:hover { color:#60a5fa !important; transform:scale(1.06); filter:none; }
#batchbot-icon:hover i { color:#60a5fa !important; }
#batchbot-icon.inspect-active i { color:var(--accent,#2563eb) !important; }
/* Hamburgare – sidomeny, alltid synlig i header */
header button.burger, button.burger, #mobileMenuBtn.mobile-menu-btn {
    display:inline-flex !important; align-items:center !important; justify-content:center !important;
    background:transparent !important; border:none !important;
    color:#fff !important; font-size:1.4rem !important; padding:0 !important;
    box-shadow:none !important; width:auto !important; height:auto !important;
    cursor:pointer; flex-shrink:0;
}
header button.burger i, button.burger i, #mobileMenuBtn.mobile-menu-btn i { color:#fff !important; font-size:1.4rem !important; }
.erp-sonic-btn { height:26px; padding:0 10px; background:var(--input-bg); border:1px solid var(--border); border-radius:100px; font-size:0.7rem; font-weight:700; color:var(--text-light); cursor:pointer; display:flex; align-items:center; gap:4px; transition:all 0.2s; font-family:inherit; }
.erp-sonic-btn.sonic-active, body.sonic-on .erp-sonic-btn { background:linear-gradient(135deg,#f59e0b,#ef4444); color:white; border-color:transparent; box-shadow:0 2px 10px rgba(245,158,11,0.35); }
.erp-ring { width:36px; height:36px; position:relative; flex-shrink:0; }
.erp-ring svg { width:100%; height:100%; transform:rotate(-90deg); }
.sa-ring-bg { fill:none; stroke:var(--input-bg); stroke-width:3; }
.sa-ring-progress { fill:none; stroke:var(--accent); stroke-width:3; stroke-linecap:round; transition:stroke-dasharray 0.5s ease; }
.sa-ring-text { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-weight:800; font-size:0.6rem; color:var(--accent); }
/* CARDS */
.erp-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:10px 10px; margin-bottom:8px; box-shadow:var(--card-shadow); }
.erp-card-compact { padding: 6px 6px 4px; margin-bottom: 6px; }
/* PHOTO STRIP */
.erp-photo-card { display:flex; align-items:center; gap:6px; padding:6px 8px; position:relative; flex-wrap:nowrap; }
.erp-photo-strip { display:flex; align-items:center; gap:8px; flex:1; overflow-x:auto; overflow-y:hidden; min-height:96px; padding:6px 4px 6px 0; scrollbar-width:thin; scrollbar-color:rgba(148,163,184,0.45) transparent; position:relative; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; touch-action:pan-x; scroll-padding-right:8px; scroll-behavior:smooth; cursor:grab; }
.erp-photo-strip.is-scroll-dragging { cursor:grabbing; user-select:none; }
.erp-photo-strip::-webkit-scrollbar { height:6px; }
.erp-photo-strip::-webkit-scrollbar-thumb { background:rgba(148,163,184,0.45); border-radius:999px; }
.erp-photo-strip::-webkit-scrollbar-track { background:transparent; }
.sa-photo-drop-hint {
    position: absolute;
    left: 84px;
    right: 6px;
    top: 4px;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.18s ease, color 0.18s ease;
    z-index: 0;
    user-select: none;
}
.sa-photo-drop-hint i { font-size: 0.8rem; opacity: 0.65; }
.erp-photo-card.sa-photo-drop-active .sa-photo-drop-hint { opacity: 0.6; color: var(--accent); }
.erp-photo-card.sa-photo-drop-active { box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.32); }
@media (hover: hover) and (pointer: fine) {
    .erp-photo-card.sa-photo-strip-empty:hover .sa-photo-drop-hint { opacity: 0.2; }
}
.erp-photo-strip .sa-photo-tile { position: relative; z-index: 1; }
.erp-photo-meta { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.erp-photo-count { background:var(--accent); color:white; border-radius:100px; font-size:0.68rem; font-weight:700; padding:2px 8px; min-width:18px; text-align:center; }
.pb-upload-action-row > [role="button"]:hover { filter: brightness(1.08); }
.pb-upload-action-row > [role="button"]:active { transform: scale(0.98); }
#btn_mark_stamp.is-active { border-color: #E5B820 !important; background: rgba(229,184,32,0.15) !important; }
.erp-bb-btn { color:#10b981 !important; border-color:rgba(16,185,129,0.3) !important; }
.erp-bb-btn:hover { background:#10b981 !important; color:white !important; border-color:#10b981 !important; }
/* PHOTO ITEMS (legacy – script.js använder .sa-photo-tile) */
.sa-photo-item { width:88px; height:88px; background-size:cover; background-position:center; border-radius:10px; border:2px solid var(--border); flex-shrink:0; position:relative; cursor:grab; }
.sa-photo-item.is-main { border-color:var(--accent); }
.sa-photo-item-actions { display:none; position:absolute; top:-4px; right:-4px; }
.sa-photo-item:hover .sa-photo-item-actions { display:flex; }
.sa-photo-item-btn.delete {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
/* ICON BTN */
.erp-icon-btn { width:36px; height:36px; background:var(--input-bg); border:1px solid var(--border); border-radius:7px; color:var(--text-light); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:0.85rem; flex-shrink:0; transition:all 0.2s; font-family:inherit; }
.erp-icon-btn:hover { border-color:var(--accent); color:var(--accent); }
/* ERP ROWS */
.erp-row { display:flex; gap:6px; align-items:flex-end; flex-wrap:wrap; }
/* Publiceringsrad – flex, plattformar får plats (detaljer i style.css) */
.top-fields-row.erp-publish-bar {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}
#batcher-tab .erp-publish-bar {
    --pb-pub-lbl-h: 13px;
    --pb-pub-ctrl-h: 38px;
    justify-content: flex-start !important;
}
#batcher-tab .erp-publish-bar .erp-publish-lbl,
#batcher-tab .erp-publish-bar .erp-price-cell > .label {
    display: block !important;
    width: 100% !important;
    height: var(--pb-pub-lbl-h) !important;
    min-height: var(--pb-pub-lbl-h) !important;
    margin: 0 0 2px !important;
    padding: 0 !important;
    font-size: 0.5rem !important;
    font-weight: 800 !important;
    line-height: var(--pb-pub-lbl-h) !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    color: var(--text-light) !important;
    opacity: 0.75 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
}
#batcher-tab .erp-publish-bar .erp-label-spacer {
    visibility: hidden !important;
    pointer-events: none !important;
}
#batcher-tab .erp-publish-bar .erp-publish-col-id,
#batcher-tab .erp-publish-bar .erp-publish-col-qr,
#batcher-tab .erp-publish-bar .erp-publish-col-ident-extra .erp-price-cell {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 0 !important;
}
.sa-skick-damage-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
}
.sa-skick-damage-cell {
    flex: 1 1 0;
    min-width: 0;
}
.sa-skick-damage-cell--skick { flex: 1.15 1 0; }
#batcher-tab .part-skick-damage-row .sa-skick-trigger,
#batcher-tab .part-skick-damage-row .part-damage {
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    box-sizing: border-box !important;
}
#batcher-tab .part-skick-damage-row .sa-skick-btn-wrap { overflow: visible; }
.sa-skick-popover-host {
    position: absolute;
    width: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
}
#sa-skick-popover.sa-skick-popover.sa-skick-popover--body {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 0 !important;
    min-width: 240px;
    max-width: min(300px, calc(100vw - 24px));
    pointer-events: auto !important;
    display: flex !important;
}
#batcher-tab .part-foremal-col {
    flex: 1.1 1 0 !important;
    min-width: 0 !important;
    max-width: 42%;
}
#batcher-tab .part-skick-col {
    flex: 1 1 132px !important;
    min-width: 132px !important;
    max-width: 46%;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column;
}
#batcher-tab .part-row > div:first-child .part-skick-col,
#batcher-tab .part-row-head .part-skick-col {
    flex: 1 1 132px !important;
    min-width: 132px !important;
    flex-shrink: 0 !important;
}
#batcher-tab .part-skick-col .sa-skick-btn-wrap {
    overflow: visible;
    width: 100%;
    min-width: 0;
    flex: 1;
    position: relative;
    z-index: 2;
}
#batcher-tab .part-skick-col .part-skick-trigger {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 2;
}
#batcher-tab .part-skick-col .sa-skick-trigger {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 6px 0 8px !important;
    font-size: 0.62rem !important;
    gap: 2px;
    border: 1px solid var(--border, rgba(255,255,255,0.12)) !important;
    background: var(--bg-input, rgba(15,23,42,0.6)) !important;
    color: var(--text-primary, #f8fafc) !important;
}
#batcher-tab .part-skick-col .part-skick-btn-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    line-height: 1.15;
}
#batcher-tab .part-skick-col .sa-skick-chevron {
    font-size: 0.55rem;
    flex-shrink: 0;
}
#batcher-tab .erp-ident-bar .erp-cell-print {
    width: 48px;
    flex: 0 0 48px;
}
#batcher-tab .erp-ident-bar .erp-price-row-print {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    font-size: 1.75rem !important;
}
#batcher-tab .erp-ident-bar .erp-price-row-qr .erp-qr-icon {
    width: 34px !important;
    height: 34px !important;
}
#batcher-tab .erp-ident-bar.erp-publish-bar {
    margin-bottom: 0;
}
#batcher-tab .erp-ident-card {
    margin-top: 0;
}
.sa-skick-btn-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: visible;
}
.sa-skick-trigger {
    width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 0 10px !important;
    cursor: pointer !important;
    text-align: left !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
}
.sa-skick-btn-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sa-skick-chevron {
    flex-shrink: 0;
    font-size: 0.65rem;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
    transform: none;
}
#sa-skick-popover.sa-skick-popover {
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 8px !important;
    transform: none !important;
    min-width: 188px;
    width: max-content;
    max-width: min(280px, calc(100vw - 24px));
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sa-skick-popover[hidden] { display: none !important; }
.sa-skick-popover-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 6px 2px;
}
.sa-skick-popover-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: min(360px, 62vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sa-skick-popover-opt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.sa-skick-opt-main {
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.25;
    pointer-events: none;
}
.sa-skick-opt-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.35;
    pointer-events: none;
}
.sa-skick-popover-opt:hover {
    background: rgba(255, 255, 255, 0.08);
}
.sa-skick-popover-opt:hover .sa-skick-opt-main {
    color: #fff;
}
.sa-skick-popover-opt.is-active {
    background: rgba(37, 99, 235, 0.28);
}
.sa-skick-popover-opt.is-active .sa-skick-opt-main {
    color: #fff;
}
.sa-skick-popover-foot {
    padding: 6px 8px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 2px;
}
.sa-skick-popover-info {
    font-size: 0.72rem;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.sa-skick-popover-info:hover { color: #93c5fd; }
.sa-skick-btn-wrap.is-open .sa-skick-trigger {
    border-color: var(--accent, #3b82f6) !important;
}
.sa-skick-btn-wrap.is-open .sa-skick-chevron {
    opacity: 1;
    color: var(--accent, #3b82f6);
    transform: rotate(0deg) !important;
}
.sa-mall-btn-wrap {
    position: relative;
    flex: 0 0 50px;
    width: 50px;
    min-width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}
.sa-action-mall .sa-mall-icon {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: inherit;
    pointer-events: none;
}
.sa-mall-popover {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    min-width: 188px;
    max-width: min(260px, calc(100vw - 24px));
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sa-mall-popover[hidden] { display: none !important; }
.sa-mall-popover-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 6px 2px;
}
.sa-mall-popover-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sa-mall-popover-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.sa-mall-popover-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.sa-mall-popover-opt.is-active {
    background: rgba(37, 99, 235, 0.28);
    color: #fff;
}
.sa-mall-popover-opt-ico {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
}
.sa-mall-btn-wrap.is-open .sa-action-mall {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}
.erp-publish-col-ident-extra {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    flex-shrink: 1;
    overflow: visible;
}
.erp-publish-col-ident-extra .erp-price-cell {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}
.erp-publish-col-ident-extra .erp-cell-shelf { width: 36px; flex: 0 0 36px; }
.erp-publish-col-ident-extra .erp-cell-loc { width: 36px; flex: 0 0 36px; }
.erp-publish-col-ident-extra .erp-cell-weight { width: 58px; flex: 0 0 58px; align-items: stretch; }
#batcher-tab .erp-ident-bar .erp-cell-weight { width: 58px; flex: 0 0 58px; align-items: stretch; }
.erp-publish-col-ident-extra .erp-cell-print {
    width: 40px;
    flex: 0 0 40px;
}
.erp-publish-col-qr {
    flex: 0 0 38px;
    width: 38px;
}
.erp-publish-col-ident-extra .erp-cell-skick {
    flex: 1 1 88px;
    min-width: 88px;
    max-width: 140px;
}
#batcher-tab .erp-publish-bar .erp-price-row-qr,
#batcher-tab .erp-publish-bar .erp-price-row-print {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--pb-pub-ctrl-h) !important;
    height: var(--pb-pub-ctrl-h) !important;
    min-width: var(--pb-pub-ctrl-h) !important;
    min-height: var(--pb-pub-ctrl-h) !important;
    max-width: var(--pb-pub-ctrl-h) !important;
    max-height: var(--pb-pub-ctrl-h) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--accent, #2563eb) !important;
    cursor: pointer;
    flex-shrink: 0;
}
#batcher-tab .erp-publish-bar .erp-price-row-print {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    font-size: 1.28rem !important;
}
#batcher-tab .erp-publish-bar .erp-price-row-qr .erp-qr-icon {
    width: 32px !important;
    height: 32px !important;
}
#batcher-tab .erp-publish-col-id {
    flex: 0 0 46px !important;
    width: 46px !important;
    max-width: 46px !important;
}
#batcher-tab .erp-publish-col-id #sku,
#batcher-tab .erp-publish-bar .erp-publish-col-ident-extra .erp-cell-shelf .erp-inp,
#batcher-tab .erp-publish-bar .erp-publish-col-ident-extra .erp-cell-loc .erp-inp,
#batcher-tab .erp-publish-bar .erp-cell-skick .sa-skick-trigger {
    height: var(--pb-pub-ctrl-h) !important;
    min-height: var(--pb-pub-ctrl-h) !important;
    max-height: var(--pb-pub-ctrl-h) !important;
    box-sizing: border-box !important;
}
#batcher-tab .erp-publish-col-id #sku {
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
    text-align: center !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
}
#batcher-tab .erp-publish-bar:not(.erp-ident-bar) .erp-publish-col-id #sku {
    font-size: 0.68rem !important;
}
#batcher-tab .erp-publish-bar:not(.erp-ident-bar) .erp-publish-col-ident-extra .erp-cell-shelf .erp-inp,
#batcher-tab .erp-publish-bar:not(.erp-ident-bar) .erp-publish-col-ident-extra .erp-cell-loc .erp-inp {
    font-size: 0.72rem !important;
    text-align: center !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
}
#batcher-tab .erp-ident-bar #sku,
#batcher-tab .erp-ident-bar #shelf,
#batcher-tab .erp-ident-bar #shelf_location {
    font-size: 0.82rem !important;
    font-weight: 600;
    letter-spacing: normal;
    text-align: center !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
}
#batcher-tab .erp-publish-bar .erp-cell-skick .sa-skick-btn-wrap { overflow: visible; width: 100%; min-width: 0; }
#batcher-tab .erp-publish-bar .erp-cell-skick .sa-skick-trigger {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 8px !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
}
#batcher-tab .erp-publish-bar .erp-cell-skick .sa-skick-btn-label {
    font-size: inherit;
}
#batcher-tab .erp-publish-bar .erp-publish-col-qr,
#batcher-tab .erp-publish-bar .erp-publish-col-ident-extra .erp-cell-print {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
.sa-plat-btn-wrap { position: relative; flex-shrink: 0; }
.sa-plat-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 168px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sa-plat-popover[hidden] { display: none !important; }
.sa-plat-popover-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}
.sa-plat-popover-opts { display: flex; flex-direction: column; gap: 6px; }
.sa-plat-popover .platform-check { width: 100%; justify-content: flex-start; }
.sa-plat-btn-wrap.is-open .sa-action-plat {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}
.erp-price-row .label,
.erp-weight-row .label {
    display: block;
    width: 100% !important;
    margin: 0 0 4px;
    font-weight: 800;
    font-size: 0.5rem;
    line-height: 1.1;
    letter-spacing: 0;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}
.erp-weight-row { gap: 6px; align-items: flex-end; flex-wrap: nowrap; }
.erp-weight-row .erp-f-weight { width: 52px; flex: 0 0 52px; }
.erp-weight-row .erp-f-emb { flex: 1; min-width: 48px; max-width: 120px; }
.erp-weight-row .erp-emb-hint {
    height: 36px; min-height: 36px; display: flex; align-items: center;
    font-size: 0.65rem; font-weight: 700; color: var(--accent);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Prisblock: kompakt topprad + tätt fältgrid */
.erp-price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 6px 8px 8px 8px !important;
    margin-bottom: 6px !important;
    box-sizing: border-box;
}
.erp-price-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 4px 0;
    gap: 6px;
    flex-shrink: 0;
    min-height: 18px;
}
.erp-price-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}
.erp-price-format-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.erp-onlykopnu-lbl {
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0.85;
    white-space: nowrap;
    line-height: 1;
}
.erp-price-topbar-left .erp-kopnu-toggle {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
}
.erp-price-topbar-left .erp-track { width: 26px; height: 14px; }
.erp-price-topbar-left .erp-thumb { width: 10px; height: 10px; top: 1px; left: 1px; }
.erp-price-topbar-left input:checked + .erp-track .erp-thumb { left: 13px; }
.erp-price-topbar .erp-profit-line {
    margin: 0;
    padding: 0;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: right;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.erp-price-topbar .erp-profit-line.is-profit,
.erp-price-topbar .erp-profit-line.is-profit #profit_val,
.erp-price-topbar .erp-profit-line.is-profit strong {
    color: #10b981 !important;
}
.erp-price-topbar .erp-profit-line.is-negative,
.erp-price-topbar .erp-profit-line.is-negative #profit_val,
.erp-price-topbar .erp-profit-line.is-negative strong {
    color: var(--danger, #ef4444) !important;
}
/* Auktionsslut – döljs vid Enbart köp nu */
.erp-auction-schedule {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    width: 100%;
    margin: 0 0 4px 0;
    padding: 0;
    box-sizing: border-box;
}
.erp-auction-schedule--off .erp-auction-schedule-fields,
.erp-auction-schedule--off .erp-auction-schedule-chk { display: none !important; }
.erp-auction-schedule--off .erp-kopnu-schedule-hint { display: inline !important; }
.erp-auction-schedule-chk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0.85;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}
.erp-auction-schedule-chk input { margin: 0; flex-shrink: 0; }
.erp-auction-schedule-fields {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.erp-auction-f { display: flex; flex-direction: column; min-width: 0; flex: 1; max-width: 72px; }
.erp-auction-lbl {
    font-size: 0.45rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0.7;
    margin: 0 0 2px;
    line-height: 1;
}
.erp-inp-compact {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 4px !important;
    font-size: 0.72rem !important;
}
.erp-kopnu-schedule-hint {
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0.65;
    white-space: nowrap;
}
/* Prisrad: CSS Grid – fasta kolumnplatser även när Utrop döljs */
.erp-price-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}
.erp-price-cell {
    display: flex; flex-direction: column; justify-content: flex-end;
    min-width: 0;
}
.erp-cell-purchase { grid-column: 1; }
.erp-cell-utrop { grid-column: 2; }
.erp-cell-buynow { grid-column: 3; }
/* Utrop dold = behåll grid-plats (ingen display:none) */
.erp-price-cell--ghost {
    opacity: 0 !important;
    pointer-events: none !important;
}
.erp-price-row .label {
    text-transform: uppercase;
    margin: 0 0 3px;
    min-height: 9px;
    display: flex;
    align-items: flex-end;
}
.erp-price-row .label-spacer { visibility: hidden; pointer-events: none; }
.erp-price-row .erp-inp {
    height: 42px; min-height: 42px; max-height: 42px; margin: 0;
    width: 100%; padding-left: 4px; padding-right: 4px;
    font-size: 0.78rem; text-align: center; box-sizing: border-box;
}
.erp-price-row .erp-cell-qr {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    height: 39px !important;
    min-height: 39px !important;
    max-height: 39px !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    align-self: flex-end;
}
.erp-publish-col-ident-extra .erp-cell-qr {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
}
.erp-cell-qr .erp-price-row-qr,
.erp-publish-col-ident-extra .erp-cell-qr .erp-price-row-qr {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 39px !important;
    height: 39px !important;
    min-width: 39px !important;
    min-height: 39px !important;
    max-width: 39px !important;
    max-height: 39px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--accent, #2563eb) !important;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, transform 0.15s;
    flex-shrink: 0;
}
.erp-cell-qr .erp-price-row-qr .erp-qr-icon,
.erp-publish-col-ident-extra .erp-cell-qr .erp-price-row-qr .erp-qr-icon {
    width: 39px !important;
    height: 39px !important;
    display: block;
    color: inherit;
    pointer-events: none;
}
.erp-cell-qr .erp-price-row-qr:hover,
.erp-publish-col-ident-extra .erp-cell-qr .erp-price-row-qr:hover {
    color: #60a5fa !important;
    transform: scale(1.04);
    border: none !important;
    background: none !important;
}
.erp-profit-line strong { font-weight: 800; }
.field-header {
    font-size: 11px; font-weight: bold; letter-spacing: 0.5px;
    margin-bottom: 4px; color: var(--text-muted, var(--text-light));
    text-transform: uppercase; line-height: 1.2;
}
.sa-mall-tabs-wrap { margin-bottom: 8px; }
.erp-f { display:flex; flex-direction:column; min-width:0; }
.erp-f-grow { flex:1; min-width:58px; }
.erp-lbl { font-size:0.62rem; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:0.4px; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.erp-req { color:var(--danger); }
.erp-char { color:var(--accent); font-weight:600; }
.erp-inp { height:36px; padding:0 8px; font-size:0.82rem; border:1px solid var(--border); border-radius:7px; background:var(--input-bg); color:var(--text-primary); font-family:inherit; width:100%; box-sizing:border-box; transition:border-color 0.15s; }
.erp-inp:focus { border-color:var(--accent); outline:none; }
select.erp-inp { cursor:pointer; }
.erp-ro { opacity:0.55; cursor:default; }
.erp-inp-title { font-size:0.88rem; font-weight:600; }
/* MINI BUTTON */
.erp-mini-btn { background:var(--input-bg); border:1px solid var(--border); color:var(--text-light); padding:5px 11px; border-radius:7px; font-size:0.72rem; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:all 0.2s; font-family:inherit; }
.erp-mini-btn:hover { background:var(--accent); color:white; border-color:var(--accent); }
/* AI PIN */
.erp-ai-pin { position:absolute; right:5px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:0.9rem; padding:0; line-height:1; }
/* TEXTAREA */
.erp-textarea { width:100%; min-height:80px; max-height:130px; padding:8px; font-size:0.82rem; font-family:inherit; border:1px solid var(--border); border-radius:7px; background:var(--input-bg); color:var(--text-primary); resize:vertical; box-sizing:border-box; line-height:1.5; }
.erp-textarea:focus { border-color:var(--accent); outline:none; }
/* PRICE */
.erp-price-hdr { display:flex; align-items:center; gap:8px; }
.erp-toggle-mini { display:flex; align-items:center; gap:6px; cursor:pointer; user-select:none; }
.erp-toggle-mini input { display:none; }
.erp-track { width:32px; height:18px; background:var(--input-bg); border:1px solid var(--border); border-radius:100px; position:relative; transition:all 0.2s; flex-shrink:0; }
.erp-thumb { width:12px; height:12px; background:var(--text-light); border-radius:50%; position:absolute; top:2px; left:2px; transition:all 0.2s; }
.erp-toggle-mini input:checked + .erp-track { background:var(--accent); border-color:var(--accent); }
.erp-toggle-mini input:checked + .erp-track .erp-thumb { left:16px; background:white; }
.erp-toggle-lbl { font-size:0.62rem; font-weight:700; color:var(--text-light); text-transform:uppercase; letter-spacing:0.4px; }
.erp-profit-chip { font-size:0.75rem; font-weight:600; color:var(--text-light); background:var(--input-bg); padding:3px 10px; border-radius:100px; border:1px solid var(--border); }
.erp-price-hint { display:flex; align-items:center; gap:6px; padding:7px 10px; background:rgba(16,185,129,0.08); border:1px solid rgba(16,185,129,0.25); border-radius:8px; margin-top:6px; font-size:0.78rem; color:var(--success); cursor:pointer; }
.mk-lex-quick-panel { max-width: 420px !important; padding: 0 !important; }
.mk-lex-quick-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 18px 10px; border-bottom:1px solid rgba(148,163,184,0.15); }
.mk-lex-quick-header h3 { margin:0; font-size:1rem; font-weight:700; color:#f8fafc; }
.mk-lex-quick-close { background:transparent; border:none; color:#94a3b8; font-size:1.1rem; cursor:pointer; padding:4px 8px; }
.mk-lex-quick-body { padding:14px 18px 18px; }
.mk-lex-quick-img-wrap { margin-bottom:12px; text-align:center; }
.mk-lex-quick-img { max-width:100%; max-height:180px; border-radius:10px; object-fit:contain; cursor:zoom-in; background:rgba(0,0,0,0.2); }
.mk-lex-quick-facts { margin:0 0 14px; display:grid; gap:8px; }
.mk-lex-quick-facts div { display:grid; grid-template-columns:88px 1fr; gap:8px; font-size:0.82rem; }
.mk-lex-quick-facts dt { color:#94a3b8; font-weight:600; }
.mk-lex-quick-facts dd { margin:0; color:#e2e8f0; }
.mk-lex-quick-fun dd { font-style:italic; color:#cbd5e1; }
.mk-lex-quick-slots-label { display:block; font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:#94a3b8; margin-bottom:8px; }
.mk-lex-quick-slot-list { display:flex; flex-wrap:wrap; gap:6px; }
.mk-lex-quick-slot { border:1px solid rgba(56,189,248,0.35); background:rgba(56,189,248,0.08); color:#e2e8f0; border-radius:8px; padding:6px 10px; font-size:0.78rem; cursor:pointer; }
.mk-lex-quick-slot.is-active { background:rgba(56,189,248,0.22); border-color:#38bdf8; color:#f8fafc; }
.mk-lex-quick-slot:hover { background:rgba(56,189,248,0.18); }
.mk-lex-quick-empty { font-size:0.82rem; color:#94a3b8; margin:0; }
.sa-grid-measure-porslin { grid-template-columns:1fr 1fr 1fr 1.2fr 1.2fr; gap:4px; }
.sa-field-measure { min-width:0; }
.sa-field-measure input { padding:0 4px; }
.sa-field-drop { min-width: auto; flex-shrink: 0; }
.sa-field-drop select { padding: 0 28px 0 8px; font-size: 0.82rem; width: auto; max-width: none; }
.sa-field-drop.pb-picker-col,
#sa-dyn-porslin .pb-picker-col,
#partsContainer .part-repor-yta-row .col-wrapper {
    position: relative !important;
    overflow: visible !important;
}
#batcher-tab .erp-card,
#batcher-tab .part-row,
#batcher-tab #partsContainer {
    overflow: visible !important;
}
.pb-picker.is-open { z-index: 999999 !important; position: relative !important; }
.pb-picker__menu {
    position: absolute !important;
    z-index: 999999 !important;
}
#batcher-tab .col-porslin,
#batcher-tab .col-klader,
#batcher-tab .col-vaxter,
#batcher-tab .col-mobler,
#batcher-tab .col-skivor,
#batcher-tab .col-ovrigt,
#batcher-tab .col-custom {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
}
#batcher-tab .col-measure { flex: 0 0 58px !important; min-width: 58px !important; }
#batcher-tab .col-measure .part-measure { font-size: 0.88rem; font-weight: 700; text-align: center; }
#batcher-tab .col-skador { flex: 1 1 0 !important; min-width: 72px !important; max-width: 120px !important; }
#batcher-tab .col-skador .part-damage { font-size: 0.82rem; padding: 0 6px; }
#batcher-tab .col-vdn {
    flex: 0 0 50px !important;
    min-width: 46px !important;
    max-width: 54px !important;
}
#batcher-tab .col-vdn .part-vdn {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 0.78rem;
    padding: 0 4px;
    text-align: center;
    box-sizing: border-box;
}
#batcher-tab .col-farg { flex: 1 1 30%; min-width: 0; }
#batcher-tab .col-designer { flex: 1 1 40%; min-width: 0; }
#batcher-tab .part-skick-damage-row { margin-top: 2px; }
/* SONIC MODE */
body.sonic-on .erp-sonic-hide { display:none !important; }
/* ACTION BAR – mörk, sömlös botten (inga vita fläckar) */
.sa-action-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #0f172a !important;
    background-color: #0f172a !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) !important;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    z-index: 9999 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
.sa-action-bar .sa-mall-btn-wrap,
.sa-action-bar .sa-plat-btn-wrap {
    flex: 0 0 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
}
.sa-action-btn {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    margin: 0 !important;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
    line-height: 1 !important;
    vertical-align: middle;
}
.sa-action-teaser {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    padding: 0 !important;
    flex: 0 0 50px !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.75) !important;
}
.sa-action-teaser:hover { background: rgba(255, 255, 255, 0.15) !important; color: #fff !important; }
.sa-action-mall .sa-mall-icon,
.sa-action-plat i {
    display: block;
    width: 22px;
    height: 22px;
    font-size: 1.125rem;
    line-height: 1;
    text-align: center;
    pointer-events: none;
}
.sa-action-save {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    align-self: center !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    letter-spacing: 0.3px;
}
.sa-action-save:hover { filter: brightness(1.12); }
.sa-action-save:active { filter: brightness(1.05); }
/* LEGACY COMPAT (for addPartRow output) */
.sa-label { font-size:0.72rem; font-weight:700; color:var(--text-light); text-transform:uppercase; margin-bottom:3px; display:block; }
.sa-required { color:var(--danger); }
.sa-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-bottom:8px; }
.sa-grid-3 { grid-template-columns:repeat(3,1fr); }
.sa-grid-measure { grid-template-columns:repeat(3,1fr); }
.sa-grid-skick { grid-template-columns:1fr 2fr; }
.sa-field { display:flex; flex-direction:column; }
.sa-field-span-2 { grid-column:span 2; }
.sa-field-full { grid-column:1/-1; }
.sa-dynamic { display:block; }
.sa-mall-tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:10px; }
.sa-mall-tab { background:var(--input-bg); border:1px solid var(--border); color:var(--text-light); padding:5px 10px; border-radius:8px; font-size:0.75rem; font-weight:600; cursor:pointer; transition:all 0.2s; font-family:inherit; display:flex; align-items:center; gap:4px; }
.sa-mall-tab.active { background:var(--accent); color:white; border-color:var(--accent); }
.part-row { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:10px; margin-bottom:8px; }
/* END ERP STYLES */
/*
    }
    .sa-title {
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--text-primary);
        margin: 0 0 4px 0;
        display: flex;
        align-items: center;
        gap: 10px;
        letter-spacing: -0.5px;
    }
    .sa-title i { color: var(--accent); }
    .sa-subtitle {
        font-size: 0.85rem;
        color: var(--text-light);
        margin: 0;
        font-weight: 500;
    }
    .sa-progress-ring {
        width: 56px;
        height: 56px;
        position: relative;
        flex-shrink: 0;
    }
    .sa-progress-ring svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }
    .sa-ring-bg {
        fill: none;
        stroke: var(--input-bg);
        stroke-width: 3;
    }
    .sa-ring-progress {
        fill: none;
        stroke: url(#sa-gradient);
        stroke: var(--accent);
        stroke-width: 3;
        stroke-linecap: round;
        transition: stroke-dasharray 0.5s ease;
    }
    .sa-ring-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-weight: 800;
        font-size: 0.85rem;
        color: var(--accent);
    }

    /* SECTIONS */
    .sa-section {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 18px;
        margin-bottom: 14px;
        box-shadow: var(--card-shadow);
        transition: all 0.2s;
    }
    .sa-section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        gap: 10px;
        flex-wrap: wrap;
    }
    .sa-section-title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1rem;
        font-weight: 800;
        color: var(--text-primary);
        letter-spacing: -0.3px;
    }
    .sa-section-title i { color: var(--accent); }
    .sa-section-num {
        width: 26px;
        height: 26px;
        background: var(--accent);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.78rem;
        font-weight: 800;
        flex-shrink: 0;
    }
    .sa-section-counter {
        background: var(--input-bg);
        color: var(--text-light);
        font-size: 0.75rem;
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 100px;
    }

    .sa-mini-btn {
        background: var(--input-bg);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 6px 12px;
        border-radius: 100px;
        font-size: 0.78rem;
        font-weight: 600;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
        font-family: inherit;
    }
    .sa-mini-btn:hover {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }
    .sa-mini-btn i { font-size: 0.75rem; }

    /* FOTO-SEKTION */
    .sa-photo-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
        margin-bottom: 12px;
    }
    .sa-photo-add-btn {
        aspect-ratio: 1;
        background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(139,92,246,0.04));
        border: 2px dashed var(--border);
        border-radius: 12px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: var(--accent);
        font-family: inherit;
        transition: all 0.2s;
        padding: 10px;
        text-align: center;
    }
    .sa-photo-add-btn:hover {
        border-color: var(--accent);
        background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(139,92,246,0.06));
        transform: translateY(-2px);
    }
    .sa-photo-add-btn i { font-size: 1.8rem; }
    .sa-photo-add-btn span { font-weight: 700; font-size: 0.85rem; }
    .sa-photo-add-btn small { font-size: 0.7rem; color: var(--text-light); font-weight: 500; }
    
    .sa-photo-item {
        aspect-ratio: 1;
        border-radius: 12px;
        background-size: cover;
        background-position: center;
        position: relative;
        overflow: hidden;
        border: 1px solid var(--border);
    }
    .sa-photo-item::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.5), transparent 50%);
        opacity: 0;
        transition: opacity 0.2s;
    }
    .sa-photo-item:hover::before { opacity: 1; }
    .sa-photo-item-actions {
        position: absolute;
        bottom: 6px;
        right: 6px;
        display: flex;
        gap: 4px;
        opacity: 0;
        transition: opacity 0.2s;
    }
    .sa-photo-item:hover .sa-photo-item-actions { opacity: 1; }
    .sa-photo-item-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 8px;
        background: rgba(255,255,255,0.9);
        border: none;
        cursor: pointer;
        font-size: 0.85rem;
    }
    .sa-photo-item-btn.delete {
        color: #fff;
        background: #ef4444;
        font-size: 1rem;
    }
    .sa-photo-item.is-main::after {
        content: 'Huvudbild';
        position: absolute;
        top: 6px;
        left: 6px;
        background: var(--accent);
        color: white;
        padding: 2px 8px;
        border-radius: 100px;
        font-size: 0.65rem;
        font-weight: 700;
    }
    
    .sa-photo-tips {
        background: rgba(245,158,11,0.06);
        border: 1px solid rgba(245,158,11,0.2);
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 0.8rem;
        color: var(--text-primary);
        display: flex;
        gap: 10px;
        align-items: center;
    }
    .sa-photo-tips i { color: var(--warning); }

    /* FÄLT */
    .sa-field { display: flex; flex-direction: column; }
    .sa-field-full { grid-column: 1 / -1; }
    .sa-field-span-2 { grid-column: span 2; }
    .sa-label {
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .sa-required { color: var(--danger); }
    .sa-info {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        background: var(--input-bg);
        color: var(--text-light);
        border-radius: 50%;
        font-size: 0.65rem;
        font-weight: 800;
        cursor: help;
    }
    .sa-input-title {
        font-size: 1rem !important;
        font-weight: 700 !important;
        height: 44px !important;
    }
    .sa-textarea {
        min-height: 100px;
        height: auto;
        resize: vertical;
        padding: 12px !important;
        line-height: 1.5;
    }
    .sa-field-hint {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 4px;
        font-size: 0.72rem;
        color: var(--text-light);
        font-weight: 500;
    }
    .sa-ai-hint {
        color: var(--purple);
        font-weight: 700;
        cursor: pointer;
    }
    .sa-readonly {
        background: var(--input-bg) !important;
        font-weight: 800 !important;
        color: var(--text-primary) !important;
    }

    /* GRID-SYSTEM */
    .sa-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 12px;
    }
    .sa-grid:last-child { margin-bottom: 0; }
    .sa-grid-3 { grid-template-columns: 80px 1fr 1fr; }
    .sa-grid-weight { grid-template-columns: 1fr 1fr 1fr; }
    .sa-grid-measure { grid-template-columns: repeat(3, 1fr); }
    .sa-grid-skick { grid-template-columns: 1fr 2fr; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

    /* MALL-TABS (Pill-stil) */
    .sa-mall-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 14px;
        padding: 6px;
        background: var(--input-bg);
        border-radius: 12px;
    }
    .sa-mall-tab {
        background: transparent;
        border: none;
        padding: 8px 14px;
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-light);
        border-radius: 8px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
        font-family: inherit;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    .sa-mall-tab i { font-size: 0.85rem; }
    .sa-mall-tab:hover { color: var(--text-primary); }
    .sa-mall-tab.active {
        background: var(--bg-card);
        color: var(--accent);
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    /* DYNAMISKA SEKTIONER */
    .sa-dynamic {
        animation: fadeInUp 0.25s ease-out;
    }
    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .sa-add-part {
        width: 100%;
        background: transparent;
        border: 2px dashed var(--border);
        color: var(--accent);
        padding: 12px;
        border-radius: 10px;
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 14px;
        transition: all 0.2s;
        font-family: inherit;
    }
    .sa-add-part:hover {
        border-color: var(--accent);
        background: rgba(37,99,235,0.04);
    }

    /* PRISSÄTTNING */
    .sa-section-price {
        background: linear-gradient(135deg, var(--bg-card), var(--bg-card));
        border: 2px solid var(--accent);
        position: relative;
        overflow: hidden;
    }
    .sa-section-price::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--accent), var(--purple));
    }
    .sa-profit-indicator {
        font-size: 0.8rem;
        color: var(--text-light);
        font-weight: 600;
    }
    .sa-profit-indicator strong {
        color: var(--success);
        font-weight: 800;
        font-size: 0.95rem;
    }

    /* TOGGLE SWITCH */
    .sa-toggle {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 14px;
        user-select: none;
    }
    .sa-toggle input { display: none; }
    .sa-toggle-slider {
        width: 38px;
        height: 22px;
        background: var(--input-bg);
        border-radius: 100px;
        position: relative;
        transition: 0.2s;
        border: 1px solid var(--border);
    }
    .sa-toggle-slider::before {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 16px;
        height: 16px;
        background: white;
        border-radius: 50%;
        transition: 0.2s;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .sa-toggle input:checked + .sa-toggle-slider {
        background: var(--accent);
        border-color: var(--accent);
    }
    .sa-toggle input:checked + .sa-toggle-slider::before {
        transform: translateX(16px);
    }

    /* PRIS-KORT */
    .sa-price-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .sa-price-card {
        background: var(--input-bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px;
        transition: 0.2s;
    }
    .sa-price-card-highlight {
        background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(139,92,246,0.03));
        border-color: var(--accent);
        position: relative;
    }
    .sa-input-with-suffix {
        position: relative;
        display: flex;
        align-items: center;
    }
    .sa-input-with-suffix .input {
        padding-right: 36px;
        font-size: 1.05rem;
        font-weight: 800;
        text-align: right;
    }
    .sa-suffix {
        position: absolute;
        right: 12px;
        font-weight: 700;
        color: var(--text-light);
        font-size: 0.8rem;
        pointer-events: none;
    }
    .sa-price-card-highlight .sa-input-with-suffix .input { padding-right: 70px; }
    .sa-ai-btn {
        position: absolute;
        right: 4px;
        top: 4px;
        bottom: 4px;
        width: 32px;
        background: linear-gradient(135deg, var(--accent), var(--purple));
        border: none;
        border-radius: 6px;
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.2s;
    }
    .sa-ai-btn:hover { transform: scale(1.05); }

    .sa-price-hint {
        margin-top: 12px;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(135deg, var(--success), #059669);
        color: white;
        padding: 12px 16px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 0.85rem;
        box-shadow: 0 4px 14px rgba(16,185,129,0.3);
        transition: 0.2s;
    }
    .sa-price-hint:hover { transform: translateY(-1px); }
    .sa-price-hint-content { display: flex; align-items: center; gap: 8px; }
    .sa-price-hint i { font-size: 1.1rem; }

    #sa-review-section.mt-3 { margin-top: 12px; }
    #sa-review-section .erp-textarea { min-height: 120px; white-space: pre-wrap; }

    /* STICKY ACTION BAR */
    .sa-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        z-index: 100;
        border-top: 1px solid var(--border);
        box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
    }
    html.theme-dim .sa-action-bar, html.theme-dark .sa-action-bar { 
        background: rgba(15,23,42,0.95); 
    }
    .sa-action-btn {
        height: 50px;
        min-height: 50px;
        max-height: 50px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.95rem;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
        font-family: inherit;
        letter-spacing: 0.3px;
    }
    .sa-action-teaser {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        flex-shrink: 0;
        background: rgba(139,92,246,0.1);
        color: var(--purple);
        border: 1.5px solid rgba(139,92,246,0.3);
        font-size: 1.2rem;
    }
    .sa-action-teaser:hover {
        background: var(--purple);
        color: white;
        border-color: var(--purple);
    }
    .sa-action-save {
        flex: 1;
        background: linear-gradient(135deg, var(--success), #059669);
        color: white;
        box-shadow: 0 4px 14px rgba(16,185,129,0.3);
    }
    .sa-action-save:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(16,185,129,0.4);
    }
    .sa-action-save:active { transform: translateY(1px); }

    /* SONIC MODE - dölj sektioner */
    body.sonic-mode-active .sa-section:nth-child(2),
    body.sonic-mode-active .sa-section:nth-child(3),
    body.sonic-mode-active .sa-section:nth-child(4) {
        display: none;
    }

    /* ============================ */
    /* MOBILANPASSNING               */
    /* ============================ */
    @media (max-width: 768px) {
        .sa-section { padding: 14px; border-radius: 14px; }
        .sa-grid { grid-template-columns: repeat(2, 1fr); }
        .sa-grid-3 { grid-template-columns: 1fr 1fr; }
        .sa-grid-weight { grid-template-columns: repeat(2, 1fr); }
        .sa-grid-3 .sa-field:first-child { grid-column: 1 / -1; }
        .sa-field-span-2 { grid-column: 1 / -1; }
        .sa-grid-skick { grid-template-columns: 1fr; }
        .sa-grid-measure { grid-template-columns: repeat(2, 1fr); }
        
        .sa-mall-tab span { display: inline; }
        .sa-mall-tab { flex: 1 1 calc(33% - 4px); padding: 10px 6px; font-size: 0.75rem; }
        
        .sa-photo-grid { grid-template-columns: repeat(3, 1fr); }
        .sa-price-grid { grid-template-columns: 1fr; gap: 8px; }
        
        .sa-title { font-size: 1.25rem; }
        .sa-section-title { font-size: 0.9rem; }
        .sa-input-title { font-size: 0.95rem !important; }
    }

    @media (max-width: 480px) {
        .sa-page-header { gap: 10px; }
        .sa-progress-ring { width: 48px; height: 48px; }
        .sa-section { padding: 12px; }
        .sa-section-num { width: 22px; height: 22px; font-size: 0.7rem; }
        .sa-grid, .sa-grid-3, .sa-grid-weight, .sa-grid-measure { grid-template-columns: 1fr 1fr; gap: 8px; }
        .sa-photo-grid { grid-template-columns: repeat(2, 1fr); }
        .sa-mall-tab { flex: 1 1 calc(50% - 4px); }
        .sa-mall-tab i { display: none; }
        .sa-action-save { font-size: 0.85rem; }
    }
/* === Live part-row (matchar skapa_annons) === */
html.demo-embedded #partsContainer {
    margin-bottom: 8px;
}
html.demo-embedded .part-row.demo-part-live {
    background: rgba(15, 23, 42, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 10px !important;
    margin-bottom: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
html.demo-embedded .part-row .label {
    font-size: 0.55rem !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 1px !important;
}
html.demo-embedded .part-row .input,
html.demo-embedded .part-row .erp-inp,
html.demo-embedded .part-row select.erp-inp {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f1f5f9 !important;
    border-radius: 8px !important;
    height: 36px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}
html.demo-embedded .part-row .input::placeholder {
    color: #64748b !important;
    opacity: 1;
}
html.demo-embedded .part-row .btn-trash {
    background: #ef4444 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
html.demo-embedded .part-row .part-add-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
html.demo-embedded .part-repor-yta-row {
    display: flex !important;
    gap: 6px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    align-items: flex-end !important;
}
html.demo-embedded .part-repor-yta-row .pb-picker-col {
    flex: 1 1 0 !important;
    min-width: 0 !important;
}
html.demo-embedded .unit-placeholder {
    position: relative;
}
html.demo-embedded .col-measure .part-measure {
    font-weight: 800 !important;
    letter-spacing: -0.2px;
}
/* Visa cm-suffix visuellt via data-attr pseudo – värdet är redan ifyllt */
html.demo-embedded .col-measure {
    position: relative;
}
html.demo-embedded .col-measure::after {
    content: 'cm';
    position: absolute;
    right: 5px;
    bottom: 10px;
    font-size: 0.58rem;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}
html.demo-embedded .col-measure .part-measure {
    padding-right: 22px !important;
}

html.demo-embedded .erp-price-card {
    background: rgba(15, 23, 42, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 8px 10px 10px !important;
}
html.demo-embedded .erp-price-topbar-left .erp-track {
    width: 26px !important;
    height: 14px !important;
    background: #475569 !important;
    border-color: transparent !important;
}
html.demo-embedded .erp-price-topbar-left .erp-thumb {
    width: 10px !important;
    height: 10px !important;
    top: 1px !important;
    left: 1px !important;
    background: #fff !important;
}
html.demo-embedded .erp-onlykopnu-lbl {
    font-size: 0.5rem !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
}
html.demo-embedded .erp-price-topbar .erp-profit-line {
    font-size: 0.68rem !important;
    color: #34d399 !important;
}
html.demo-embedded .erp-price-topbar .erp-profit-line strong {
    color: #6ee7b7 !important;
    font-weight: 900;
}
html.demo-embedded .erp-price-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
}
html.demo-embedded .erp-price-cell .label {
    font-size: 0.55rem !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    margin-bottom: 2px !important;
}
html.demo-embedded .erp-price-cell .erp-inp {
    height: 38px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    text-align: center;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
}
html.demo-embedded .erp-cell-buynow .erp-inp {
    border-color: rgba(56, 189, 248, 0.45) !important;
}

/* === Demo-only visuals (proffsigt landningsdemo) === */
.demo-photo-thumb {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    flex: 0 0 88px;
    flex-shrink: 0;
    border: 2px solid rgba(59, 130, 246, 0.4);
    background: #0b1628;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.demo-photo-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
    border: none !important;
    border-radius: 10px;
    pointer-events: none;
}
.demo-photo-thumb.is-main {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 6px 18px rgba(0, 0, 0, 0.4);
}
.demo-photo-thumb .sa-photo-main-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: #2563eb;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    z-index: 2;
}

.demo-cam-btn {
    width: 70px;
    height: 70px;
    border: 2px dashed rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    cursor: default;
    color: #e2e8f0;
}
.demo-cam-btn i { font-size: 18px; color: #93c5fd; }
.demo-cam-btn span { font-size: 10px; font-weight: 700; color: #cbd5e1; text-align: center; line-height: 1.1; }
.demo-photo-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    overflow-x: auto;
    scrollbar-width: none;
}
.demo-photo-actions::-webkit-scrollbar { display: none; }
.demo-photo-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.demo-photo-side .demo-cam-btn {
    width: 70px;
    height: 52px;
}
.demo-cam-btn--damage {
    border-color: rgba(127, 29, 29, 0.7) !important;
    background: #2a1111 !important;
}
.demo-cam-btn--damage i { color: #f87171 !important; }
.demo-cam-btn--damage span { color: #fecaca !important; }
.demo-cam-btn--stamp i { color: #fff !important; }
.demo-cam-btn--manage i { color: #a78bfa !important; }
.demo-qty-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.88);
    color: #93c5fd;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.45);
}
.demo-cat-row { align-items: flex-end; gap: 6px; }
.demo-search-btn {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15,23,42,0.85);
    color: #93c5fd;
    cursor: pointer;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 0;
}
.demo-chk {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #cbd5e1;
}
.demo-mall-card { padding: 10px !important; }
.demo-price-totals {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 0.62rem;
    color: #93c5fd;
    font-weight: 600;
}
.demo-price-totals strong { color: #e0f2fe; font-weight: 800; }
.demo-ident-bar--full { flex-wrap: nowrap; overflow-x: auto; }
.demo-ident-weight { flex: 0 0 54px; }

.demo-form-card { padding-bottom: 8px; }
.demo-section-lbl {
    display: block;
    margin-bottom: 8px !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.5px;
}

.demo-tmpl-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.demo-tmpl-tabs::-webkit-scrollbar { display: none; }
.demo-tmpl-tab {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text-light);
    white-space: nowrap;
}
.demo-tmpl-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.demo-part-row {
    padding: 10px !important;
    margin-bottom: 0 !important;
    background: rgba(15, 23, 42, 0.35) !important;
}
.demo-part-top {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    margin-bottom: 8px;
}
.demo-part-foremal { flex: 1.1 1 0; min-width: 0; }
.demo-col-antal { flex: 0 0 56px; }
.demo-col-item { flex: 1.6 1 0; }
.demo-part-skick { flex: 1 1 118px; min-width: 110px; }
.demo-row { margin-top: 8px !important; flex-wrap: nowrap !important; }
.demo-row-measure .erp-f { flex: 1 1 0; }
.demo-inp-center { text-align: center !important; }
.demo-inp-strong { font-weight: 800 !important; }
.demo-inp-accent { border-color: rgba(2, 132, 199, 0.7) !important; box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.15); }

html.demo-embedded .demo-part-row .erp-inp,
html.demo-embedded .erp-price-card .erp-inp,
html.demo-embedded .erp-ident-card .erp-inp {
    height: 36px !important;
    font-size: 0.8rem !important;
    font-weight: 600;
}
html.demo-embedded .erp-inp-title {
    height: 40px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px;
}
html.demo-embedded .erp-lbl {
    font-size: 0.64rem !important;
    letter-spacing: 0.45px;
    margin-bottom: 3px !important;
    color: #94a3b8 !important;
}

.demo-skick-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.demo-skick-pill i { font-size: 0.55rem; color: var(--text-light); margin-left: 4px; }

.demo-price-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.demo-toggle-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
.demo-toggle-lbl {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-light);
}
.demo-toggle {
    width: 30px;
    height: 17px;
    border-radius: 100px;
    background: #475569;
    display: inline-block;
    position: relative;
}
.demo-toggle-knob {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.demo-price-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px !important;
}
.demo-profit {
    font-size: 0.74rem;
    font-weight: 700;
    color: #34d399;
    white-space: nowrap;
}
.demo-profit strong { font-weight: 900; color: #6ee7b7; }
.demo-price-hint {
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.68rem;
    font-weight: 600;
    color: #6ee7b7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-desc-card { margin-bottom: 12px; }
.demo-desc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.demo-desc-head .erp-lbl { margin: 0 !important; }
.demo-ai-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    font-size: 0.65rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.demo-desc {
    min-height: 110px;
    font-size: 0.74rem;
    line-height: 1.55;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: #e2e8f0;
    width: 100%;
    font-family: inherit;
    white-space: pre-line;
    font-weight: 500;
}

.demo-ident-bar {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}
.demo-ident-cell { display: flex; flex-direction: column; min-width: 0; }
.demo-ident-id { flex: 0 0 54px; }
.demo-ident-flex { flex: 1 1 0; }
.demo-lbl-spacer { visibility: hidden; }
.demo-ident-qr {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.demo-ident-qr svg { width: 28px; height: 28px; }
.demo-print-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html.demo-embedded .demo-ver {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-left: 4px;
    letter-spacing: 0;
}
html.demo-embedded .demo-app-btn {
    width: 64px;
    height: 64px;
    border: 1px solid #334466;
    border-radius: 8px;
    background: #112244;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    cursor: default;
}
html.demo-embedded .demo-app-btn i { font-size: 16px; color: #fff; }
html.demo-embedded .demo-app-btn span { font-size: 9px; color: #e2e8f0; font-weight: 600; }
html.demo-embedded .demo-app-btn--dmg {
    border-color: #7f1d1d;
    background: #2a1111;
}
html.demo-embedded .erp-price-hint {
    display: flex !important;
}
html.demo-embedded #sa-review-section .erp-textarea {
    min-height: 120px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #e2e8f0 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Granskning: alltid i dokumentflödet, staplad layout – aldrig sticky/fixed */
html.demo-embedded #sa-review-section,
html.demo-embedded #sa-review-section.sa-review-card {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    will-change: auto !important;
    margin-top: 10px !important;
    margin-bottom: 12px !important;
    box-sizing: border-box !important;
}
html.demo-embedded #sa-review-section .sa-review-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
}
html.demo-embedded #sa-review-section .sa-review-heading {
    margin: 0 !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: #94a3b8 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
html.demo-embedded #sa-review-section .sa-review-title-block,
html.demo-embedded #sa-review-section .sa-review-desc-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
}
html.demo-embedded #sa-review-section .sa-review-title-block .erp-inp-title {
    width: 100% !important;
    height: 42px !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px;
}
html.demo-embedded #sa-review-section .erp-char {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    font-size: 0.7rem !important;
}
html.demo-embedded .set-chk {
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}
html.demo-embedded .erp-publish-lbl,
html.demo-embedded .erp-ident-card .label {
    font-size: 0.55rem !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    text-transform: uppercase;
}
html.demo-embedded .erp-ident-bar {
    display: flex !important;
    align-items: flex-end !important;
    gap: 6px !important;
}
html.demo-embedded .erp-publish-col-ident-extra {
    display: flex !important;
    align-items: flex-end !important;
    gap: 6px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
html.demo-embedded .erp-price-row-qr,
html.demo-embedded .erp-price-row-print {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(15,23,42,0.85);
    color: #3b82f6;
    cursor: pointer;
}
/* Ta bort demo-only cm-pseudo – appen använder placeholder */
html.demo-embedded .col-measure::after { content: none !important; }

html.demo-embedded .sa-action-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: #0f172a !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.45) !important;
}
html.demo-embedded .sa-action-teaser {
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 12px !important;
}
html.demo-embedded .sa-action-save {
    flex: 1 1 auto !important;
    height: 50px !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45) !important;
    font-weight: 800 !important;
}
