:root {
  color-scheme: light;
  --bg: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #f7f7f4;
  --surface-3: #ecece7;
  --ink: #111111;
  --muted: #6f6f69;
  --muted-2: #94948d;
  --line: #deded8;
  --line-strong: #c9c9c1;
  --inverse: #ffffff;
  --positive: #0f6c3f;
  --positive-bg: #e7f4ec;
  --warning: #986400;
  --warning-bg: #fbf1d7;
  --danger: #a12a2a;
  --danger-bg: #f9e9e9;
  --shadow: 0 18px 50px rgba(20, 20, 16, .07);
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 252px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0c;
  --surface: #171716;
  --surface-2: #1d1d1b;
  --surface-3: #252522;
  --ink: #f5f5f2;
  --muted: #aaa9a1;
  --muted-2: #7f7e77;
  --line: #30302c;
  --line-strong: #44443f;
  --inverse: #111111;
  --positive: #84d5a8;
  --positive-bg: #173727;
  --warning: #e4bd62;
  --warning-bg: #3f3218;
  --danger: #ee9a9a;
  --danger-bg: #442323;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.loading-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; gap: 18px; text-align: center; background: var(--bg); }
.loading-screen p { margin: 0; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.loading-mark, .brand-monogram { display: grid; place-items: center; color: #fff; background: #111; font-weight: 800; line-height: 1; }
.loading-mark { width: 54px; height: 54px; border-radius: 15px; margin: auto; font-size: 25px; animation: breathe 1.5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .72; } }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 44%) 1fr; background: #0f0f0f; }
.auth-panel { background: var(--surface); color: var(--ink); display: flex; flex-direction: column; justify-content: center; padding: clamp(38px, 8vw, 110px); position: relative; }
.auth-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 54px; }
.brand-monogram { width: 42px; height: 42px; border-radius: 11px; font-size: 19px; flex: none; }
.auth-brand h1 { margin: 1px 0 0; font-size: 18px; letter-spacing: .11em; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.eyebrow.inverse { color: rgba(255,255,255,.6); }
.auth-copy { max-width: 390px; margin: 0 0 30px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.stack-form { display: grid; gap: 17px; max-width: 390px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 12px 13px; outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 9%, transparent); }
textarea { resize: vertical; }
.auth-meta { position: absolute; left: clamp(38px, 8vw, 110px); bottom: 42px; display: grid; gap: 2px; }
.auth-meta span { color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.auth-meta strong { font-size: 11px; letter-spacing: .08em; }
.form-message { min-height: 22px; max-width: 390px; margin: 15px 0 0; color: var(--danger); }
.form-message.success { color: var(--positive); }
.auth-art { position: relative; min-height: 100vh; overflow: hidden; color: #fff; background: #111; }
.auth-grid { position: absolute; inset: -20%; opacity: .16; transform: rotate(-10deg); background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px); background-size: 74px 74px; }
.auth-art::after { content: ""; position: absolute; width: 48vw; height: 48vw; max-width: 680px; max-height: 680px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; right: -15%; top: 10%; box-shadow: inset 0 0 0 90px rgba(255,255,255,.02), inset 0 0 0 180px rgba(255,255,255,.02); }
.auth-art-copy { position: absolute; z-index: 2; left: 9%; bottom: 9%; }
.auth-art-copy .eyebrow { color: rgba(255,255,255,.55); }
.auth-art-copy > p:last-child { margin: 15px 0 0; font-size: clamp(42px, 5.4vw, 84px); font-weight: 750; line-height: .98; letter-spacing: -.055em; }

.button { border: 1px solid transparent; border-radius: 10px; min-height: 42px; padding: 10px 16px; font-size: 12px; font-weight: 750; letter-spacing: .01em; transition: transform .12s ease, background .12s ease, border-color .12s ease, opacity .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { color: #fff; background: #111; border-color: #111; }
html[data-theme="dark"] .button-primary { color: #111; background: #f5f5f2; border-color: #f5f5f2; }
.button-secondary { background: var(--surface); border-color: var(--line-strong); }
.button-secondary:hover { border-color: var(--ink); }
.button-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button-quiet:hover { color: var(--ink); background: var(--surface-2); }
.button-wide { width: 100%; margin-top: 4px; }
.button-small { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.icon-button { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 700; }
.icon-button:hover { border-color: var(--ink); }
.text-button { width: auto; font-size: 11px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 50; display: flex; flex-direction: column; padding: 24px 18px 18px; color: #f5f5f2; background: #111; border-right: 1px solid rgba(255,255,255,.05); }
.side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 8px; }
.side-brand .brand-monogram { background: #fff; color: #111; }
.side-brand span:last-child { display: grid; line-height: 1.15; }
.side-brand small { color: rgba(255,255,255,.48); font-size: 8px; font-weight: 800; letter-spacing: .2em; }
.side-brand strong { margin-top: 4px; font-size: 13px; letter-spacing: .09em; }
.shop-chip { display: flex; align-items: center; gap: 10px; min-height: 57px; margin: 26px 4px 28px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.11); border-radius: 13px; background: rgba(255,255,255,.045); }
.shop-chip > span:last-child { display: grid; min-width: 0; }
.shop-chip small { color: rgba(255,255,255,.42); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.shop-chip strong { overflow: hidden; margin-top: 2px; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; letter-spacing: .03em; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #777; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.status-dot.connected { background: #65d393; }
.status-dot.error { background: #ef7d7d; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 43px; padding: 8px 12px; color: rgba(255,255,255,.58); border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 12px; font-weight: 650; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #111; background: #fff; }
.nav-icon { display: inline-grid; place-items: center; width: 18px; font-size: 17px; font-weight: 400; }
.side-footer { margin-top: auto; display: grid; gap: 12px; padding: 18px 5px 0; border-top: 1px solid rgba(255,255,255,.1); }
.compact-toggles { display: flex; gap: 6px; }
.sidebar .icon-button { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.045); }
.sidebar .icon-button:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.signout-button { padding: 0; color: rgba(255,255,255,.5); border: 0; background: transparent; text-align: left; font-size: 11px; font-weight: 650; }
.signout-button:hover { color: #fff; }
.version-mark { color: rgba(255,255,255,.24); font-size: 9px; font-weight: 700; letter-spacing: .16em; }

.mobile-header { display: none; }
.main-area { min-height: 100vh; margin-left: var(--sidebar); padding: 31px clamp(24px, 3.3vw, 56px) 70px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; max-width: 1440px; margin: 0 auto 30px; }
.page-header h1 { margin: 0; font-size: clamp(29px, 3vw, 44px); line-height: 1; letter-spacing: -.045em; }
.page-subtitle { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.header-actions { display: flex; gap: 8px; }
.view { display: none; max-width: 1440px; margin: 0 auto; }
.view.active { display: block; animation: reveal .2s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.dark-card { color: #fff; border-color: #111; background: #111; }
.hero-dashboard { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; min-height: 210px; padding: clamp(27px, 4vw, 48px); overflow: hidden; position: relative; }
.hero-dashboard::after { content: ""; position: absolute; width: 330px; height: 330px; right: -80px; top: -180px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.02); }
.hero-dashboard > * { position: relative; z-index: 1; }
.hero-dashboard h2 { max-width: 760px; margin: 8px 0 10px; font-size: clamp(28px, 3.1vw, 47px); line-height: 1.03; letter-spacing: -.045em; }
.hero-dashboard p:not(.eyebrow) { max-width: 680px; margin: 0; color: rgba(255,255,255,.58); font-size: 13px; }
.hero-status-block { display: grid; justify-items: end; gap: 10px; min-width: 155px; color: rgba(255,255,255,.5); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 5px 10px; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .1em; white-space: nowrap; }
.status-badge.neutral { color: var(--muted); background: var(--surface-3); }
.dark-card .status-badge.neutral { color: rgba(255,255,255,.68); background: rgba(255,255,255,.1); }
.status-badge.success { color: var(--positive); background: var(--positive-bg); }
.dark-card .status-badge.success { color: #93e5b6; background: rgba(101,211,147,.13); }
.status-badge.warning { color: var(--warning); background: var(--warning-bg); }
.status-badge.error { color: var(--danger); background: var(--danger-bg); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.metric-card { min-height: 142px; padding: 20px 22px; display: flex; flex-direction: column; }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-card strong { margin-top: auto; font-size: 35px; line-height: 1; letter-spacing: -.04em; }
.metric-card small { margin-top: 6px; color: var(--muted-2); font-size: 10px; }
.two-column-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 14px; }
.setup-card, .two-column-grid > .card, .ownership-card, .settings-card, .theme-controls, .preview-card, .content-card { padding: 24px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.card-heading h2, .section-intro h2, .control-card h2, .ownership-card h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.025em; }
.subtle-pill { display: inline-flex; min-height: 26px; align-items: center; padding: 4px 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 76px; padding: 13px 0; border-top: 1px solid var(--line); }
.setup-step:first-child { border-top: 0; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 10px; font-weight: 800; }
.setup-step.complete .step-number { color: #fff; border-color: #111; background: #111; }
html[data-theme="dark"] .setup-step.complete .step-number { color: #111; border-color: #fff; background: #fff; }
.setup-step strong { display: block; font-size: 12px; }
.setup-step p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.step-state { color: var(--muted-2); font-size: 10px; font-weight: 800; }
.setup-step.complete .step-state { color: var(--positive); }
.operation-progress { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.progress-track { height: 4px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-track span { display: block; width: 10%; height: 100%; background: var(--ink); transition: width .25s ease; }
.operation-progress p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.activity-list { min-height: 292px; }
.activity-item { display: grid; grid-template-columns: 9px 1fr auto; gap: 11px; align-items: start; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-mark { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--muted-2); }
.activity-mark.success { background: var(--positive); }
.activity-mark.warning { background: var(--warning); }
.activity-mark.error { background: var(--danger); }
.activity-item strong { display: block; font-size: 11px; }
.activity-item p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.activity-item time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.empty-state { color: var(--muted); font-size: 11px; }
.ownership-card { margin-top: 14px; }
.ownership-card > div:first-child { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 20px; }
.ownership-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ownership-grid > div { min-height: 130px; padding: 20px; border-left: 1px solid var(--line); }
.ownership-grid > div:first-child { border-left: 0; }
.ownership-grid span { color: var(--muted-2); font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.ownership-grid strong { display: block; margin-top: 16px; font-size: 13px; }
.ownership-grid p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }

.toolbar { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; flex: 1; min-width: 230px; }
.search-field input { padding-right: 35px; }
.search-field > span:last-child { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.toolbar select { width: auto; min-width: 155px; }
.table-summary { display: flex; justify-content: space-between; gap: 20px; margin: 17px 0 11px; color: var(--muted); font-size: 10px; }
.table-summary > span:first-child { color: var(--ink); font-weight: 750; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.data-table { width: 100%; min-width: 930px; border-collapse: collapse; }
.data-table th { height: 41px; padding: 0 14px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 13px 14px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.product-cell { display: flex; align-items: center; gap: 12px; max-width: 410px; }
.product-thumb { width: 49px; height: 58px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); object-fit: cover; }
.product-thumb-placeholder { display: grid; place-items: center; color: var(--muted-2); font-size: 16px; }
.product-cell strong { display: block; overflow: hidden; max-width: 305px; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.product-cell small { display: block; margin-top: 3px; color: var(--muted); }
.classification-stack { display: grid; gap: 3px; }
.classification-stack strong { font-size: 10px; }
.classification-stack small { color: var(--muted); }
.mini-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-tag { display: inline-flex; padding: 3px 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 8px; }
.state-text { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.state-text.success { color: var(--positive); }
.state-text.warning { color: var(--warning); }
.state-text.muted { color: var(--muted); }
.merch-flags { display: flex; gap: 4px; }
.merch-flag { padding: 3px 6px; border-radius: 5px; background: var(--surface-3); color: var(--muted); font-size: 8px; font-weight: 750; }
.merch-flag.active { background: var(--ink); color: var(--inverse); }
.table-action { min-height: 30px; padding: 5px 9px; }
.empty-cell { height: 180px; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 13px; }
.pagination span { color: var(--muted); font-size: 10px; }

.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-intro h2 { max-width: 700px; font-size: 23px; }
.inline-actions, .button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.category-groups { display: grid; gap: 14px; }
.category-group { overflow: hidden; }
.category-group-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.category-group-header h3 { margin: 0; font-size: 14px; }
.category-group-header small { color: var(--muted); }
.category-row { display: grid; grid-template-columns: 38px minmax(180px, 1.2fr) minmax(100px, .5fr) 110px 110px 110px; gap: 12px; align-items: center; min-height: 67px; padding: 11px 18px; border-top: 1px solid var(--line); }
.category-group-header + .category-row { border-top: 0; }
.order-buttons { display: flex; gap: 3px; }
.order-buttons button { width: 29px; height: 29px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.category-title-inputs { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(90px, .8fr); gap: 7px; }
.category-title-inputs input { padding: 8px 10px; font-size: 10px; }
.category-count { color: var(--muted); font-size: 10px; }
.category-handle { overflow: hidden; color: var(--muted-2); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.mini-switch-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.mini-switch-label input { width: auto; }

.nav-layout { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .68fr); }
.navigation-tree { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.nav-tree-item { border-top: 1px solid var(--line); }
.nav-tree-item:first-child { border-top: 0; }
.nav-tree-line { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 10px 15px; }
.nav-tree-line strong { font-size: 11px; }
.nav-tree-line small { color: var(--muted); }
.nav-tree-children { margin: 0; padding: 0 15px 10px 35px; list-style: none; }
.nav-tree-children li { display: flex; justify-content: space-between; padding: 7px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.control-card { align-self: start; }
.switch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 38px; align-items: center; gap: 10px; margin: 14px 0; color: var(--ink); }
.switch-row > span:first-child { display: grid; }
.switch-row strong { font-size: 11px; }
.switch-row small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); transition: background .15s ease; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .15s ease; }
.switch-row input:checked + .switch { background: #111; }
html[data-theme="dark"] .switch-row input:checked + .switch { background: #f5f5f2; }
html[data-theme="dark"] .switch-row input:checked + .switch::after { background: #111; }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row.compact { grid-template-columns: minmax(0, 1fr) auto 38px; min-height: 43px; margin: 0; padding: 0 2px; }
.divider { height: 1px; margin: 21px 0; background: var(--line); }
.caption { color: var(--muted); font-size: 10px; line-height: 1.65; }
.system-meta { display: grid; gap: 8px; margin-top: 18px; }
.system-meta > div { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 9px; }
.system-meta strong { color: var(--ink); }

.theme-preset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.theme-preset { display: grid; gap: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.theme-preset:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.theme-preset.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.preset-mini { aspect-ratio: 1.35; padding: 8px; overflow: hidden; border-radius: 8px; background: #f7f7f4; color: #111; }
.preset-mini.dark { background: #101010; color: #fff; }
.preset-mini .pm-head { display: flex; justify-content: space-between; height: 8px; border-bottom: 1px solid currentColor; font-size: 4px; font-weight: 800; }
.preset-mini .pm-hero { width: 68%; height: 22px; margin: 9px 0; border-left: 2px solid currentColor; background: color-mix(in srgb, currentColor 6%, transparent); }
.preset-mini .pm-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; }
.preset-mini .pm-grid i { display: block; aspect-ratio: .8; background: color-mix(in srgb, currentColor 12%, transparent); }
.theme-preset strong { font-size: 10px; }
.theme-preset small { color: var(--muted); font-size: 8px; }
.theme-editor-grid { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(520px, 1.25fr); gap: 14px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.compact-heading { margin-top: 2px; }
.sortable-list { display: grid; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.sortable-item { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 44px; padding: 7px 10px; border-top: 1px solid var(--line); }
.sortable-item:first-child { border-top: 0; }
.sortable-item label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 10px; }
.sortable-item label input { width: auto; }
.drag-mark { color: var(--muted-2); }
.sort-buttons { display: flex; gap: 3px; }
.sort-buttons button { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 7px; background: transparent; }
.preview-card { min-width: 0; }
.theme-preview { overflow: hidden; min-height: 520px; border: 1px solid #d8d8d2; border-radius: 12px; background: #fff; color: #111; transition: background .2s, color .2s; }
.preview-announcement { padding: 7px 12px; color: #fff; background: #111; text-align: center; font-size: 6px; font-weight: 700; letter-spacing: .15em; }
.preview-header { display: flex; justify-content: space-between; align-items: center; padding: 17px 22px; border-bottom: 1px solid #ddd; }
.preview-header strong { font-size: 10px; letter-spacing: .08em; }
.preview-header span { font-size: 6px; }
.preview-hero { min-height: 250px; padding: 44px 35px; background: #f0f0ec; }
.preview-hero small { font-size: 6px; letter-spacing: .16em; }
.preview-hero h3 { margin: 12px 0 20px; font-size: 29px; line-height: .98; letter-spacing: -.05em; }
.preview-hero button { padding: 8px 12px; color: #fff; border: 0; background: #111; font-size: 6px; font-weight: 800; }
.preview-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 18px 22px; }
.preview-products span { display: block; aspect-ratio: .78; background: linear-gradient(135deg, #eee, #d7d7d0); }
.theme-preview[data-preset="editorial"] .preview-header { padding: 24px; justify-content: center; flex-wrap: wrap; gap: 12px; }
.theme-preview[data-preset="editorial"] .preview-header span { width: 100%; text-align: center; }
.theme-preview[data-preset="editorial"] .preview-hero { padding-left: 12%; }
.theme-preview[data-preset="editorial"] .preview-hero h3 { font-family: Georgia, serif; font-weight: 400; font-size: 34px; }
.theme-preview[data-preset="grid"] .preview-hero { min-height: 155px; padding: 28px 32px; }
.theme-preview[data-preset="grid"] .preview-hero h3 { font-size: 23px; }
.theme-preview[data-preset="grid"] .preview-products { grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 10px; }
.theme-preview[data-preset="mono-dark"] { color: #fff; border-color: #333; background: #101010; }
.theme-preview[data-preset="mono-dark"] .preview-announcement { color: #111; background: #fff; }
.theme-preview[data-preset="mono-dark"] .preview-header { border-color: #333; }
.theme-preview[data-preset="mono-dark"] .preview-hero { background: #181818; }
.theme-preview[data-preset="mono-dark"] .preview-hero button { color: #111; background: #fff; }
.theme-preview[data-preset="mono-dark"] .preview-products span { background: linear-gradient(135deg, #292929, #3b3b3b); }
.theme-preview[data-preset="contrast"] .preview-hero { color: #fff; background: #111; }
.theme-preview[data-preset="contrast"] .preview-hero button { color: #111; background: #fff; }
.language-columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 28px; }
.language-columns > div { display: grid; gap: 13px; align-content: start; }
.language-badge { justify-self: start; padding: 4px 8px; color: var(--inverse); border-radius: 5px; background: var(--ink); font-size: 9px; font-weight: 850; }
.content-card { margin-top: 14px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.settings-card { display: grid; align-content: start; gap: 13px; }
.settings-card .card-heading { margin-bottom: 5px; }
.wide-card { grid-column: 1 / -1; }
.detail-list { margin: 0; display: grid; }
.detail-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-top: 1px solid var(--line); }
.detail-list > div:first-child { border-top: 0; }
.detail-list dt { color: var(--muted); font-size: 10px; }
.detail-list dd { margin: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; }
.scope-list { display: flex; flex-wrap: wrap; gap: 5px; }
.scope { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 8px; }
.scope.missing { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: var(--danger-bg); }
.market-list { display: grid; gap: 7px; }
.market-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; }
.market-item strong { font-size: 10px; }
.market-item small { color: var(--positive); font-size: 8px; font-weight: 800; }
.range-field { display: grid; grid-template-columns: 1fr 50px; align-items: center; gap: 10px; }
.range-field input { padding: 0; border: 0; box-shadow: none; accent-color: var(--ink); }
.range-field output { color: var(--ink); font-size: 11px; font-weight: 800; text-align: right; }
.suffix-field, .prefix-field { display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prefix-field { grid-template-columns: auto 1fr; }
.suffix-field input, .prefix-field input { border: 0; background: transparent; box-shadow: none; }
.suffix-field span, .prefix-field span { padding: 0 13px; color: var(--muted); font-size: 10px; }
.admin-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.admin-link { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; padding: 15px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); text-align: left; }
.admin-link:hover { border-color: var(--ink); }
.admin-link span { font-size: 11px; font-weight: 750; }
.admin-link small { grid-column: 1; color: var(--muted); font-size: 9px; }
.admin-link b { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 14px; }
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.health-item { min-height: 78px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.health-item span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.health-item strong { display: block; margin-top: 13px; font-size: 11px; }
.health-item strong.ok { color: var(--positive); }
.health-item strong.bad { color: var(--danger); }

.modal-dialog { width: min(650px, calc(100vw - 32px)); max-height: 88vh; overflow: auto; padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.3); }
.modal-dialog::backdrop { background: rgba(0,0,0,.58); backdrop-filter: blur(3px); }
.modal-dialog form { display: grid; gap: 16px; padding: 25px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 0; font-size: 21px; }
.product-edit-meta { display: flex; gap: 13px; padding: 12px; border-radius: 11px; background: var(--surface-2); }
.product-edit-meta img, .product-edit-meta .product-thumb-placeholder { width: 58px; height: 68px; border-radius: 8px; }
.product-edit-meta strong { display: block; }
.product-edit-meta small { display: block; margin-top: 4px; color: var(--muted); }
.modal-toggle-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 5px; }

.toast-region { position: fixed; z-index: 2000; right: 22px; bottom: 22px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 13px 15px; color: #fff; border-radius: 11px; background: #111; box-shadow: 0 16px 48px rgba(0,0,0,.22); font-size: 11px; animation: toast-in .2s ease; }
.toast.success { background: #145d38; }
.toast.error { background: #8b2424; }
.toast.warning { background: #7c570d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.mobile-nav-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); }

@media (max-width: 1180px) {
  :root { --sidebar: 220px; }
  .theme-preset-grid { grid-template-columns: repeat(3, 1fr); }
  .theme-editor-grid { grid-template-columns: 1fr; }
  .preview-card { order: -1; }
  .settings-grid { grid-template-columns: 1fr; }
  .wide-card { grid-column: auto; }
  .health-grid { grid-template-columns: repeat(2,1fr); }
  .category-row { grid-template-columns: 35px minmax(220px,1fr) 90px 95px 95px; }
  .category-row .category-handle { display: none; }
}

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; padding: 45px clamp(25px, 8vw, 70px); }
  .auth-meta { left: clamp(25px, 8vw, 70px); }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px; color: #fff; background: #111; }
  .mobile-header .icon-button { color: #fff; border-color: rgba(255,255,255,.2); background: transparent; }
  .mobile-brand { display: flex; align-items: baseline; gap: 6px; }
  .mobile-brand strong { font-size: 11px; letter-spacing: .1em; }
  .mobile-brand small { color: rgba(255,255,255,.4); font-size: 8px; }
  .main-area { margin-left: 0; padding: 24px 17px 60px; }
  .page-header { align-items: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column-grid, .nav-layout { grid-template-columns: 1fr; }
  .ownership-grid { grid-template-columns: 1fr; }
  .ownership-grid > div { border-left: 0; border-top: 1px solid var(--line); }
  .ownership-grid > div:first-child { border-top: 0; }
  .products-toolbar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .category-row { grid-template-columns: 35px minmax(0,1fr) 80px 85px; }
  .category-row .category-home, .category-row .category-menu { display: none; }
  .admin-link-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .page-header { display: block; }
  .header-actions { margin-top: 16px; }
  .hero-dashboard { min-height: 250px; display: block; }
  .hero-status-block { justify-items: start; margin-top: 28px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 120px; padding: 16px; }
  .metric-card strong { font-size: 29px; }
  .setup-card, .two-column-grid > .card, .ownership-card, .settings-card, .theme-controls, .preview-card, .content-card { padding: 18px; }
  .setup-step { grid-template-columns: 30px minmax(0,1fr); }
  .setup-step > :last-child { grid-column: 2; justify-self: start; }
  .table-summary { display: grid; }
  .section-intro { display: grid; align-items: start; }
  .inline-actions .button { flex: 1; }
  .theme-preset-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid.two, .language-columns, .modal-toggle-row { grid-template-columns: 1fr; }
  .theme-preview { min-height: 400px; }
  .preview-hero { min-height: 195px; padding: 33px 24px; }
  .preview-hero h3 { font-size: 24px; }
  .preview-header span { display: none; }
  .preview-products { padding: 12px; gap: 5px; }
  .category-row { grid-template-columns: 30px minmax(0,1fr) 64px; gap: 7px; padding: 10px; }
  .category-row .category-visible { display: none; }
  .category-title-inputs { grid-template-columns: 1fr; }
  .admin-link-grid, .health-grid { grid-template-columns: 1fr; }
  .toolbar select { flex: 1; min-width: 125px; }
  .toast-region { right: 16px; bottom: 16px; }
}

/* Storefront 1.0.1 theme activation clarity */
.theme-activation-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px 28px; align-items: center; margin-bottom: 14px; }
.theme-activation-card .card-heading { margin-bottom: 7px; }
.theme-activation-copy { margin: 0; max-width: 850px; color: var(--muted); line-height: 1.65; }
.theme-activation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.theme-activation-card > .caption { grid-column: 1 / -1; margin: -3px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .theme-activation-card { grid-template-columns: 1fr; }
  .theme-activation-actions { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .theme-activation-actions { display: grid; grid-template-columns: 1fr; }
  .theme-activation-actions .button { width: 100%; text-align: center; }
}
