/* MOMENT / 当下 — desktop client visual system. No external font or asset dependency. */
:root {
  color-scheme: light;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --ink: #222222;
  --ink-strong: #121212;
  --muted: #7a7a7a;
  --muted-light: #a3a3a3;
  --line: #e3e3e3;
  --line-strong: #cacaca;
  --sidebar: #181818;
  --sidebar-ink: #d7d7d7;
  --danger: #9d4541;
  --danger-bg: #fbefed;
  --warning: #8a6c32;
  --warning-bg: #f7f3e9;
  --success: #5f5f5f;
  --success-bg: #f1f1f1;
  --radius: 6px;
  --sidebar-width: 224px;
  --topbar-height: 72px;
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
button:disabled { opacity: .42; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
svg, img { display: block; max-width: 100%; }
button svg, .btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--ink-strong); font-weight: 600; }
::selection { background: #e1e1e1; color: #121212; }
:focus-visible { outline: 2px solid #565656; outline-offset: 3px; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #c6c6c6 transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 10px; background: #c6c6c6; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Shell */
.app-shell { display: flex; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { flex: 0 0 var(--sidebar-width); width: var(--sidebar-width); display: flex; flex-direction: column; min-height: 0; color: var(--sidebar-ink); background: var(--sidebar); border-right: 1px solid #2a2a2a; overflow-y: hidden; scrollbar-color: #454545 transparent; }
#navigation { overflow-y: auto; min-height: 0; flex: 1; scrollbar-width: thin; }
.sidebar > .brand, .sidebar-bottom { flex-shrink: 0; }
.bar-track.signed { position: relative; }
.bar-track.signed::after { content: ''; position: absolute; left: -5px; right: -5px; top: 50%; border-top: 1px solid #d2cfc8; }
.bar-track.signed .bar-fill { position: absolute; bottom: 50%; width: 100%; }
.bar-track.signed .bar-fill.negative { top: 50%; bottom: auto; background: repeating-linear-gradient(135deg,#858580 0px,#858580 3px,#c7c6bf 3px,#c7c6bf 6px); }
.sidebar .brand { display: flex; align-items: center; gap: 13px; min-height: 110px; padding: 28px 23px; text-decoration: none; }
.sidebar .brand img, .sidebar .brand > svg { width: 39px; height: 43px; object-fit: contain; flex: 0 0 auto; filter: brightness(0) invert(1); }
.brand-name { color: #f5f5f5; font-size: 18px; font-weight: 600; letter-spacing: .14em; line-height: 1.35; }
.brand-cn { margin-top: 5px; color: #888888; font-size: 9px; font-weight: 400; letter-spacing: .11em; }
.nav-group { margin: 5px 0 14px; padding: 0 12px; }
.nav-label { padding: 13px 13px 8px; color: #797979; font-size: 10px; font-weight: 500; letter-spacing: .16em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; margin: 3px 0; padding: 10px 13px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #aaaaaa; text-align: left; font-size: 12px; font-weight: 400; letter-spacing: .015em; text-decoration: none; transition: background .16s, color .16s; }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .76; }
.nav-item:hover { color: #f7f7f7; background: #252525; }
.nav-item.active, .nav-item[aria-current="page"] { background: #373737; border-color: #444444; color: #fffef7; }
.nav-item.active::before, .nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 2px; background: #bfbfbf; }
.nav-item.active svg { opacity: 1; }
.nav-item .badge { margin-left: auto; padding: 1px 6px; background: #444444; color: #d4d4d4; border-color: #555555; font-size: 9px; }
.sidebar-bottom { margin-top: auto; padding: 20px 24px 23px; border-top: 1px solid #2f2f2f; color: #878787; font-size: 10px; line-height: 1.8; }
.sidebar-bottom strong { display: block; margin-bottom: 3px; color: #bfbfbf; font-size: 11px; font-weight: 500; }
.sidebar-bottom .data-status { color: #b2b2b2; }
.sidebar-bottom .data-status::before { background: #a4a4a4; }
.main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.topbar { flex: 0 0 var(--topbar-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--topbar-height); padding: 0 36px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; color: var(--muted); font-size: 11px; letter-spacing: .03em; }
.breadcrumb strong, .breadcrumb b { color: var(--ink); font-weight: 500; }
.breadcrumb > span + span::before { content: "/"; margin-right: 11px; color: #c0c0c0; }
.top-actions { display: flex; align-items: center; gap: 17px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.top-actions .btn { min-height: 32px; padding: 5px 10px; font-size: 11px; }
#content { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 32px 36px 44px; }
.page { width: 100%; max-width: 1580px; margin: 0 auto; animation: enter .22s ease-out; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 26px; }
.eyebrow { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.page-head h1 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.25; letter-spacing: -.045em; }
.page-head p { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.7; max-width: 720px; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }

/* Opening dashboard */
.hero-panel { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 194px; margin-bottom: 22px; padding: 32px 35px; overflow: hidden; background: #eaeaea; border: 1px solid #dedede; border-radius: var(--radius); }
.hero-copy { position: relative; z-index: 1; max-width: 70%; }
.hero-copy .eyebrow { color: #7c7c7c; margin-bottom: 13px; }
.hero-copy h1, .hero-copy h2 { font-size: clamp(27px, 3.2vw, 42px); font-weight: 500; letter-spacing: -.055em; line-height: 1.2; }
.hero-copy p { margin-top: 13px; max-width: 580px; color: #797979; font-size: 12px; line-height: 1.8; }
.hero-copy .hero-actions { justify-content: flex-start; gap: 12px; margin-top: 24px; }
.hero-actions .btn { min-height: 44px; min-width: 128px; padding: 11px 20px; font-size: 12px; font-weight: 600; }
.hero-actions .btn.secondary { background: #fff; color: #222; border-color: #7a7a7a; }
.hero-actions .btn.secondary:hover:not(:disabled) { background: #f5f5f5; border-color: #222; color: #121212; }
.hero-actions .btn.secondary:active:not(:disabled) { background: #e5e5e5; border-color: #222; }
.hero-mark { position: absolute; display: flex; align-items: center; justify-content: center; right: 38px; top: 50%; width: 220px; height: 220px; transform: translateY(-50%); color: #cccccc; font-family: Georgia, serif; font-size: 220px; font-weight: 500; line-height: 1; pointer-events: none; }
.hero-mark img, .hero-mark svg { width: 100%; height: 100%; opacity: .105; filter: brightness(0); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card { position: relative; min-height: 122px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.stat-label svg { width: 16px; height: 16px; color: #a0a0a0; }
.stat-value { margin-top: 11px; color: var(--ink-strong); font-size: 30px; font-weight: 500; letter-spacing: -.055em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.stat-note { margin-top: 8px; color: var(--muted-light); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel { margin-top: 22px; }
.dashboard-grid > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 63px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.panel-head p, .panel-head .muted { color: var(--muted-light); font-size: 10px; }
.panel-head .btn { min-height: 28px; padding: 3px 8px; font-size: 10px; }
.panel-body { padding: 23px; }
.panel-body > p { color: var(--muted); font-size: 12px; }
.chart-bars { display: flex; align-items: flex-end; gap: clamp(10px, 2vw, 27px); min-height: 160px; height: 180px; padding: 5px 7px 0; border-bottom: 1px solid var(--line); }
.chart-bar { position: relative; display: flex; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; gap: 7px; }
.bar-fill { width: 100%; max-width: 45px; min-height: 2px; height: var(--bar-height, 40%); background: #cacaca; border-radius: 3px 3px 0 0; transition: height .35s ease; }
.chart-bar:nth-last-child(1) .bar-fill { background: #474747; }
.chart-bar span, .chart-bar small { flex: 0 0 auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.chart-bar .bar-value { color: #6d6d6d; font-size: 9px; font-variant-numeric: tabular-nums; }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 13px; min-height: 62px; padding: 13px 0; border-bottom: 1px solid #efefef; }
.rank-row:first-child { padding-top: 0; }
.rank-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rank-index { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex: 0 0 auto; background: #f3f3f3; color: #929292; font-size: 10px; font-variant-numeric: tabular-nums; }
.rank-info { min-width: 0; flex: 1; font-size: 11px; }
.rank-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rank-info p, .rank-info small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.rank-value { margin-left: auto; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Tables and list controls */
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 17px; }
.panel > .toolbar { margin: 0; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex: 1 1 auto; align-items: center; flex-wrap: wrap; gap: 9px; }
.search-input, .select { min-height: 42px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.search-input { width: min(100%, 300px); min-width: 160px; }
.search-input::placeholder { color: #a3a3a3; }
.select { min-width: 130px; padding-right: 28px; }
.location-filter { display:inline-flex; justify-content:space-between; align-items:center; gap:18px; padding-right:13px; text-align:left; }
.location-options { display:grid; gap:8px; }
#dialog:has(.location-options) { max-width:460px; }
.btn.location-option { display:flex; justify-content:space-between; min-height:50px; padding:13px 16px; text-align:left; }
.btn.location-option.active { background:var(--ink); border-color:var(--ink); color:var(--surface); }
.location-option small { font-size:11px; opacity:.8; }
.search-input:focus, .select:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #717171; box-shadow: 0 0 0 2px #e9e9e9; }
.segmented { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px; min-height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: #eeeeee; }
.seg { min-height: 32px; padding: 6px 12px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--muted); font-size: 11px; white-space: nowrap; }
.seg.active, .seg[aria-selected="true"] { color: var(--ink); background: var(--surface); border-color: #dedede; }
.table-wrap { width: 100%; overflow: auto; background: var(--surface); }
.page > .table-wrap { border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
thead { color: #8a8a8a; background: #fafafa; }
th { height: 42px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
td { height: 66px; padding: 13px 18px; border-bottom: 1px solid #efefef; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafafa; }
tbody tr.selected { background: #f3f3f3; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
td .btn + .btn { margin-left: 3px; }
td:has(.btn) { white-space: nowrap; }
td input[type="checkbox"], th input[type="checkbox"] { width: 15px; height: 15px; accent-color: #474747; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 185px; }
.product-glyph { display: flex; align-items: center; justify-content: center; width: 40px; height: 44px; flex: 0 0 auto; overflow: hidden; border: 1px solid #eaeaea; border-radius: 3px; background: #f4f4f4; color: #9a9a9a; font-size: 18px; }
.product-glyph img { width: 100%; height: 100%; object-fit: cover; }
.product-glyph svg { width: 23px; height: 23px; }
.product-name { color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.5; }
.product-meta { margin-top: 4px; color: #969696; font-size: 10px; line-height: 1.5; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 60px; padding: 15px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.pagination .btn { min-width: 32px; min-height: 32px; padding: 5px 9px; font-size: 10px; }
.tabs { display: flex; align-items: center; gap: 23px; margin-bottom: 22px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { position: relative; min-height: 44px; padding: 10px 0 13px; border: 0; background: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.tab.active, .tab[aria-selected="true"] { color: var(--ink-strong); font-weight: 500; }
.tab.active::after, .tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #404040; }

/* Buttons and status */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 4px; background: white; color: var(--ink); font-size: 11px; font-weight: 500; line-height: 1.4; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover:not(:disabled) { border-color: #a2a2a2; background: #f7f7f7; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: #2a2a2a; border-color: #2a2a2a; color: #fff; }
.btn.primary:hover:not(:disabled) { background: #414141; border-color: #414141; }
.btn.secondary { background: white; }
.btn.ghost { border-color: transparent; background: transparent; color: #767676; }
.btn.ghost:hover:not(:disabled) { border-color: #e6e6e6; background: #f2f2f2; color: #424242; }
.btn.danger { background: var(--danger-bg); border-color: #eccdca; color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: #f6e1de; border-color: #d9aaa5; }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.btn.icon { width: 36px; min-height: 36px; padding: 8px; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; padding: 3px 7px; border: 1px solid #e4e4e4; border-radius: 3px; background: #f2f2f2; color: #7f7f7f; font-size: 10px; font-weight: 400; line-height: 1.5; white-space: nowrap; }
.badge.success { color: var(--success); background: var(--success-bg); border-color: #dddddd; }
.badge.warning { color: var(--warning); background: var(--warning-bg); border-color: #e7ddc3; }
.badge.danger { color: var(--danger); background: var(--danger-bg); border-color: #ebd2ce; }
.badge.dark { color: white; background: #434343; border-color: #434343; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.02em; }
.amount { font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 250px; padding: 42px 24px; text-align: center; color: var(--muted); }
.empty-state h2, .empty-state h3, .empty-state strong { color: #6a6a6a; font-size: 14px; font-weight: 500; }
.empty-state p { max-width: 470px; font-size: 12px; line-height: 1.8; }
.empty-state .btn { margin-top: 10px; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 53px; height: 57px; margin-bottom: 7px; border: 1px solid #e7e7e7; border-radius: 5px; background: #f5f5f5; color: #a0a0a0; font-size: 25px; }
.empty-icon svg { width: 25px; height: 25px; }
.notice { display: flex; align-items: flex-start; gap: 9px; padding: 13px 16px; margin-bottom: 18px; border: 1px solid #e0e0e0; border-left: 3px solid #919191; border-radius: 3px; background: #f4f4f4; color: #737373; font-size: 11px; line-height: 1.8; }
.notice svg { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto; }
.notice.warning { background: var(--warning-bg); color: var(--warning); border-color: #e5dcc6; border-left-color: #b89b5f; }
.notice p + p { margin-top: 4px; }
.data-status { display: inline-flex; align-items: center; gap: 6px; color: #909090; font-size: 10px; line-height: 1.4; }
.data-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.progress { height: 4px; width: 100%; overflow: hidden; border-radius: 2px; background: #efefef; }
.progress-fill { width: var(--progress, 0%); height: 100%; border-radius: inherit; background: #8a8a8a; transition: width .25s; }

/* Forms and transaction previews */
dialog, #dialog { width: min(740px, calc(100vw - 44px)); max-height: min(90vh, 900px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #d8d8d8; border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 22px 80px #1d1d1d26; }
dialog::backdrop { background: #1919195e; backdrop-filter: blur(2px); }
dialog[open] { display: flex; flex-direction: column; }
.dialog-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 28px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2, .dialog-head h3 { font-size: 19px; font-weight: 500; letter-spacing: -.035em; }
.dialog-head p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.dialog-head .btn { min-height: 30px; padding: 5px 9px; }
.dialog-body { flex: 1 1 auto; min-height: 0; padding: 25px 28px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 9px; padding: 18px 28px; border-top: 1px solid var(--line); background: #fafafa; }
.dialog-actions .muted { margin-right: auto; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; }
.field > span, .field > label { color: #717171; font-size: 11px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #dbdbdb; border-radius: 4px; background: #fff; color: var(--ink); font-size: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.7; }
.field input::placeholder, .field textarea::placeholder { color: #aaaaaa; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f6f6f6; color: #a1a1a1; }
.field input[readonly] { color: #7f7f7f; background: #f7f7f7; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #bd6d64; background: #fff8f6; }
.field input[type="checkbox"], .field input[type="radio"] { width: 17px; min-height: 17px; height: 17px; padding: 0; accent-color: #656565; }
.field > small, .field .hint { color: #9c9c9c; font-size: 10px; font-weight: 400; line-height: 1.6; }
.preset-field { align-self: start; }
.product-form-grid > .field > span { min-height: 19px; display: flex; align-items: center; }
.preset-field-head { display: flex; align-items: center; justify-content: space-between; min-height: 19px; gap: 8px; }
.preset-field-head > label { color: #717171; font-size: 11px; font-weight: 500; }
.preset-field-head .preset-trigger { min-height: 19px; padding: 1px 9px; border: 1px solid #ddd; border-radius: 3px; font-size: 10px; line-height: 16px; }
.preset-trigger[aria-expanded="true"] { background: #222; color: #fff; border-color: #222; }
.preset-panel { padding: 12px; border: 1px solid #dedede; border-radius: 4px; background: #f8f8f7; }
.preset-panel[hidden], .preset-editor[hidden] { display: none; }
.preset-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.preset-panel-head > strong { font-size: 11px; font-weight: 500; }
.preset-panel .btn.small { min-height: 26px; padding: 4px 7px; font-size: 10px; }
.preset-panel input { min-height: 36px; padding: 8px 10px; font-size: 11px; }
.preset-list { max-height: 210px; overflow-y: auto; margin: 8px 0 10px; }
.preset-empty { margin: 10px 0; color: #888; font-size: 11px; line-height: 1.7; }
.preset-item { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid #e6e6e6; padding: 3px 0; }
.preset-option { flex: 1; min-width: 0; padding: 8px; text-align: left; justify-content: flex-start; }
.preset-option:hover { background: #eaeae8; }
.preset-option > span { min-width: 0; }
.preset-option strong, .preset-option small { display: block; white-space: normal; overflow-wrap: anywhere; }
.preset-option strong { font-weight: 500; font-size: 12px; }
.preset-option small { font-size: 10px; color: #858585; margin-top: 3px; }
.preset-editor { border-top: 1px solid #ddd; padding-top: 12px; }
.preset-editor .field + .field { margin-top: 10px; }
.preset-editor-actions { display: flex; justify-content: flex-end; gap: 5px; margin-top: 12px; }
.preset-remove-note { width: 100%; color: #777; font-size: 10px; }
.preset-panel .inline-error { font-size: 11px; margin-top: 10px; }
.span-2 { grid-column: 1 / -1; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 13px; border: 1px solid #e1e1e1; border-radius: 4px; background: #fff; color: #8c8c8c; font-size: 11px; cursor: pointer; }
.choice:hover { background: #f6f6f6; }
.choice.selected, .choice[aria-pressed="true"] { color: #4d4d4d; border-color: #9c9c9c; background: #f4f4f4; }
.matrix-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.matrix-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 50px; padding: 8px 10px; border: 1px solid #e4e4e4; border-radius: 3px; background: #fafafa; color: #888888; font-size: 11px; }
.matrix-cell input { width: 54px; min-height: 35px; padding: 6px; text-align: center; background: white; }
.matrix-cell.selected { background: #f2f2f2; border-color: #b4b4b4; }
.preview-list { overflow: hidden; border: 1px solid #e6e6e6; border-radius: 4px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 95px auto; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #efefef; font-size: 11px; }
.line-row:last-child { border-bottom: 0; }
.line-row > div { min-width: 0; }
.line-row input { min-height: 40px; width: 100%; padding: 8px 10px; border: 1px solid #e1e1e1; border-radius: 3px; }
.inline-error { margin-top: 8px; padding: 9px 12px; border-left: 2px solid #ba6d61; background: #fcf0eb; color: var(--danger); font-size: 11px; line-height: 1.7; }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); font-size: 12px; }
.summary-line strong { font-size: 19px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; }
.metric-split > * + * { padding-left: 25px; border-left: 1px solid var(--line); }
.metric-split strong { display: block; margin-top: 7px; font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }
.flow-steps { display: flex; align-items: stretch; gap: 0; margin: 0 0 23px; padding: 0; list-style: none; }
.step { position: relative; display: flex; flex: 1; flex-direction: column; gap: 5px; padding: 11px 13px; border-bottom: 2px solid #e6e6e6; color: #a0a0a0; font-size: 10px; }
.step strong { font-size: 11px; font-weight: 500; }
.step.active { color: #626262; border-bottom-color: #767676; background: #f6f6f6; }
.keycap { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid #e2e2e2; border-bottom-width: 2px; border-radius: 3px; color: #969696; font-family: var(--mono); font-size: 9px; }

/* Settings and identity */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.settings-card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.settings-card h2, .settings-card h3 { margin-bottom: 9px; font-size: 15px; font-weight: 500; }
.settings-card > p { margin-bottom: 20px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.settings-card .field + .field { margin-top: 16px; }
.settings-card .btn { margin-top: 17px; }
.brand-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; min-height: 180px; padding: 25px; border: 1px solid #e5e5e5; background: #f7f7f7; color: #464646; }
.brand-preview img, .brand-preview > svg { width: 180px; max-height: 100px; object-fit: contain; }
.brand-preview .brand-name { color: var(--ink); font-size: 23px; }
.brand-preview .brand-cn { color: var(--muted); }
.brand-preview small { color: #9e9e9e; font-size: 10px; letter-spacing: .05em; }

/* Labels: screen proof and 50 × 30 mm printed output */
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; align-items: start; }
.label-card { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; width: 50mm; height: 30mm; max-width: 100%; margin: 0 auto; padding: 2mm; border: 1px solid #d9d9d9; background: #fff; color: #000; overflow: hidden; }
.label-brand { color: #111; font-size: 10px; font-weight: 650; letter-spacing: .06em; line-height: 1.15; }
.label-meta { display: flex; justify-content: space-between; gap: 4px; color: #333; font-size: 8px; line-height: 1.25; }
.label-meta span { min-width: 0; overflow-wrap: anywhere; }
.barcode { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding: 0 1mm; color: #000; }
.barcode svg { width: 100%; height: 11mm; max-height: 100%; }
.barcode .mono, .barcode small { max-width: 100%; overflow: hidden; font-family: var(--mono); font-size: 8px; line-height: 1.15; white-space: nowrap; }
.print-zone { display: none; }

/* Shared views added by the application shell. */
.avatar { display: flex; align-items: center; justify-content: center; width: 31px; height: 31px; border: 1px solid #d7d7d3; border-radius: 50%; background: #edede9; color: #51514d; font-size: 11px; font-weight: 600; }
.sidebar-edition { margin-bottom: 7px; color: #aaa; font-size: 9px; letter-spacing: .12em; }
.sidebar-version { margin-top: 10px; color: #6f6f6b; font-size: 9px; }
.sidebar-bottom .muted { color: #858580; }
.breadcrumb > span + span::before { content: none; margin: 0; }
.breadcrumb > span:first-child { color: #b2b2ae; }
.breadcrumb > span:last-child { color: #555550; }
.product-glyph img { width: 29px; height: 36px; padding: 2px; object-fit: contain; }
.stat-trend { display: inline-flex; align-items: center; gap: 4px; color: #77776f; font-size: 10px; }
.stat-trend.negative { color: #9a5950; }
.overview-note { display: flex; align-items: center; gap: 8px; margin-top: 15px; color: #92928a; font-size: 10px; }
.overview-note::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #a7a79f; flex: 0 0 auto; }
.toolbar-search { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 180px; }
.toolbar-search .search-input { width: min(100%, 320px); }
.tag-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #e2e2dc; border-radius: 3px; background: #f5f5f1; color: #84847b; font-size: 10px; white-space: nowrap; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 25px; }
.detail-grid > div { min-width: 0; padding-bottom: 13px; border-bottom: 1px solid #e9e9e3; }
.detail-grid small, .detail-grid dt { display: block; margin-bottom: 5px; color: #96968b; font-size: 10px; }
.detail-grid strong, .detail-grid dd { margin: 0; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.chart-axis { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 9px 7px 0; color: #a0a092; font-size: 9px; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 180px; padding: 25px; color: #98988d; font-size: 11px; text-align: center; }
.date-label { color: #929287; font-size: 10px; font-variant-numeric: tabular-nums; }
.transfer-card { padding: 20px 22px; margin-bottom: 12px; border: 1px solid #e0e0d8; border-radius: var(--radius); background: #fff; }
.transfer-card:last-child { margin-bottom: 0; }
.transfer-card > header, .transfer-card > footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.transfer-card > footer { margin-top: 16px; padding-top: 14px; border-top: 1px solid #ecece5; }
.transfer-route { display: flex; align-items: center; gap: 16px; margin: 15px 0; font-size: 15px; font-weight: 500; }
.transfer-route .muted, .transfer-route svg { color: #b0b0a5; font-size: 15px; font-weight: 400; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: #757569; font-size: 11px; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; margin: 0; accent-color: #55554b; }
.metrics-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 17px 0; }
.metrics-row > div { min-width: 0; }
.metrics-row > div + div { padding-left: 20px; border-left: 1px solid #e3e3d9; }
.metrics-row small { display: block; margin-bottom: 6px; color: #939385; font-size: 10px; }
.metrics-row strong { font-size: 23px; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.workflow-info { margin-top: 18px; padding: 15px 17px; border: 1px solid #e3e3d8; border-radius: 4px; background: #f7f7f0; color: #868677; font-size: 11px; line-height: 1.8; }
.workflow-info strong { display: block; margin-bottom: 4px; color: #5b5b50; font-size: 12px; font-weight: 500; }
.money-input { text-align: right; font-variant-numeric: tabular-nums; }
.sku-picker { position: relative; margin-top: 21px; }
.sku-picker .search-input { width: 100%; }
.picker-results:not(:empty) { display: grid; margin-top: 7px; padding: 5px; border: 1px solid #ddd; border-radius: 4px; background: #fff; }
.picker-results > p { padding: 10px; font-size: 11px; }
.btn.picker-option { justify-content: flex-start; min-height: 42px; padding: 9px 11px; border: 0; border-radius: 2px; text-align: left; white-space: normal; font-size: 11px; font-weight: 400; }
.btn.picker-option:hover { background: #f1f1ed; }
.cart-lines:not(:empty) { margin: 18px 0; border: 1px solid #e2e2dc; border-radius: 4px; overflow: hidden; }
.cart-lines .line-row { grid-template-columns: minmax(0, 1fr) 90px auto; }
.cart-lines .line-row:has(> :nth-child(4)) { grid-template-columns: minmax(0, 1fr) 70px 110px auto; }
.cart-lines .product-cell { min-width: 0; gap: 9px; }
.cart-lines .product-glyph { width: 32px; height: 38px; }
.cart-lines .product-name { font-size: 11px; }
.cart-lines .product-meta { font-size: 9px; }
.cart-lines .line-row > div > small { display: block; margin-top: 5px; font-size: 9px; }
.cart-lines .field > span { font-size: 9px; }
.cart-lines .field input { min-height: 42px; padding: 8px; }
.matrix-cell input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 0; accent-color: #4d4d45; }
.matrix-cell:has(input:checked) { background: #eeeee7; border-color: #b9b9aa; color: #5d5d4f; }
.dialog-body form > h3 { margin: 25px 0 7px; font-size: 13px; font-weight: 500; }
.dialog-body form > p { margin: 0 0 13px; font-size: 11px; }
.dialog-body form > .field + .field { margin-top: 16px; }
.dialog-body form > .dialog-actions { margin: 22px -28px -25px; }
.dialog-body form > .dialog-actions + .inline-error:not([hidden]) { margin-top: 35px; }
.dialog-body > p { margin-bottom: 18px; }
.dialog-feedback { flex-shrink:0; padding:0 24px 18px; }
.dialog-feedback .toast { width:100%; max-width:none; box-sizing:border-box; }
.dialog-feedback .toast + .toast { margin-top:6px; }
.hero-mark:is(img, svg) { object-fit: contain; opacity: .11; filter: brightness(0); }
.hero-copy .page-actions { justify-content: flex-start; }
.dashboard-grid + .dashboard-grid { margin-top: 22px; }
.page > .data-status:last-child { margin-top: 21px; }
.settings-grid > .panel + .panel { margin-top: 0; }
.settings-grid .panel-body > div > p + p { margin-top: 10px; }
.settings-grid .panel-body .page-actions { margin-top: 19px; justify-content: flex-start; }
.settings-grid .panel-body > div > .btn { margin-top: 17px; }
.settings-grid .brand-preview p { max-width: 310px; font-size: 11px; text-align: center; line-height: 1.7; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.transfer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.transfer-grid > .panel + .panel { margin-top: 0; }
.transfer-card.panel { padding: 0; margin: 0; }
.transfer-card .panel-head .transfer-route { margin: 0; font-size: 13px; }
.transfer-card .panel-body > p { margin: 10px 0; font-size: 12px; }
.transfer-card .page-actions { margin-top: 17px; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.btn.task-row { display: flex; justify-content: flex-start; min-height: 44px; padding: 11px 12px; border: 1px solid #e7e7e2; background: #fafaf7; font-size: 11px; font-weight: 400; }
.btn.task-row > span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
.task-row strong { font-size: 10px; color: #79796f; font-weight: 400; }
.task-list .notice { margin: 7px 0 0; padding: 11px 12px; font-size: 10px; }
.chart-bars { height: 188px; min-height: 188px; align-items: flex-end; gap: clamp(4px, .65vw, 12px); padding: 0 3px; border-bottom: 0; }
.chart-bar { height: auto; gap: 6px; flex: 1 1 0; min-width: 5px; }
.bar-track { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 140px; border-bottom: 1px solid #deded8; }
.bar-fill { width: 62%; min-width: 3px; max-width: 34px; min-height: 0; }
.chart-bar:last-child .bar-fill { background: #41413d; }
.bar-count { display: block; min-height: 14px; font-size: 9px; line-height: 14px; font-variant-numeric: tabular-nums; }
.chart-bar .date-label { display: block; height: 16px; min-height: 16px; font-size: 8px; line-height: 16px; }
.panel-body .summary-line:first-child { border-top: 0; padding: 0 0 15px; font-size: 10px; }
.copies-input { width: 90px !important; min-height: 42px; padding: 8px 10px; border: 1px solid #cfcfc5; border-radius: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.help-list { padding-left: 20px; margin: 0; color: #707063; font-size: 12px; line-height: 1.9; }
.help-list li { padding-left: 5px; margin-bottom: 14px; }
.help-list li::marker { color: #a0a08f; font-size: 10px; }
.label-code { color: #111; font-size: 8px; line-height: 1.1; text-align: center; letter-spacing: .03em; }
.label-grid + .notice { margin-top: 21px; }
td > div > small { display: block; margin-top: 4px; font-size: 10px; }
.dialog-body > h3 { margin: 21px 0 9px; font-size: 13px; }
.dialog-body > h3:first-child { margin-top: 0; }

/* Transient states */
.toast-container { position: fixed; z-index: 1000; right: 26px; bottom: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; width: min(390px, calc(100vw - 40px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; padding: 13px 16px; border: 1px solid #454545; border-radius: 5px; color: #f9f9f9; background: #383838; font-size: 12px; line-height: 1.7; box-shadow: 0 5px 18px #27272720; pointer-events: auto; animation: enter .2s ease-out; }
.toast.error { background: #6f3f35; border-color: #825043; }
.toast svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 3px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 11px; min-height: 180px; color: #919191; font-size: 12px; }
.spinner { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid #e4e4e4; border-top-color: #747474; border-radius: 50%; animation: spin .7s linear infinite; }
.btn .spinner { width: 13px; height: 13px; border-width: 1.5px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1600px) {
  #content { padding: 38px 48px 50px; }
  .topbar { padding-inline: 48px; }
  .hero-panel { min-height: 216px; padding-inline: 40px; }
  .stat-card { min-height: 135px; padding: 23px 25px; }
  .stat-value { font-size: 34px; }
}
@media (max-width: 1280px) {
  #content { padding: 28px 28px 38px; }
  .topbar { padding-inline: 28px; }
  .page-head { gap: 18px; margin-bottom: 23px; }
  .stat-grid { gap: 12px; }
  .stat-card { padding: 18px; min-height: 117px; }
  .stat-value { font-size: 27px; }
  .hero-panel { min-height: 181px; padding: 28px; }
  .hero-mark { width: 185px; height: 185px; right: 24px; }
  .dashboard-grid { gap: 18px; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
  .panel-head { padding-inline: 19px; }
  .panel-body { padding: 19px; }
  td, th { padding-inline: 14px; }
  .matrix-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  :root { --sidebar-width: 194px; }
  .sidebar .brand { padding-inline: 20px; gap: 10px; }
  .brand-name { font-size: 15px; }
  .sidebar .brand img { width: 32px; }
  .nav-group { padding-inline: 9px; }
  .nav-item { padding-inline: 11px; gap: 9px; font-size: 11px; }
  #content { padding: 25px 23px 35px; }
  .topbar { padding-inline: 23px; }
  .top-actions { gap: 10px; }
  .page-head { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .page-actions { justify-content: flex-start; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid > .panel + .panel { margin-top: 0; }
  .stat-card { padding: 17px 15px; }
  .stat-value { font-size: 25px; }
  .hero-copy { max-width: 78%; }
  .hero-mark { right: 12px; opacity: .7; }
  .settings-grid { gap: 16px; }
  .settings-card { padding: 20px; }
  .transfer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --topbar-height: 60px; }
  .app-shell { display: block; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { width: 100%; min-height: 0; max-height: none; display: block; overflow: visible; border-right: 0; }
  .sidebar .brand { min-height: 70px; padding: 15px 21px; }
  .sidebar .brand img { width: 31px; height: 35px; }
  .brand-name { font-size: 16px; }
  .brand-cn { font-size: 9px; margin-top: 3px; }
  .sidebar nav { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 10px 10px; }
  .nav-group { display: flex; gap: 3px; padding: 0 5px; margin: 0; flex: 0 0 auto; }
  .nav-label, .sidebar-bottom { display: none; }
  .nav-item { width: auto; min-height: 39px; margin: 0; padding: 9px 12px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .nav-item svg { width: 15px; height: 15px; }
  .main { overflow: visible; }
  .topbar { min-height: 60px; padding: 0 20px; }
  .top-actions { font-size: 10px; }
  .top-actions .data-status { display: none; }
  .breadcrumb { font-size: 10px; }
  #content { overflow: visible; padding: 25px 20px 35px; }
  .page-head h1 { font-size: 26px; }
  .hero-panel { min-height: 180px; padding: 26px 23px; }
  .hero-copy { max-width: 85%; }
  .hero-copy h1, .hero-copy h2 { font-size: 31px; }
  .hero-mark { width: 165px; height: 165px; right: -20px; opacity: .55; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 19px; }
  .stat-value { font-size: 29px; }
  .toolbar { align-items: stretch; }
  .filters { width: 100%; }
  .search-input { flex: 1 1 100%; width: 100%; }
  .select { flex: 1; min-width: 120px; }
  .segmented { max-width: 100%; overflow-x: auto; }
  table { min-width: 680px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  dialog, #dialog { width: calc(100vw - 26px); max-height: 92vh; max-height: 92dvh; }
  .dialog-head { padding: 19px 21px; }
  .dialog-body { padding: 21px; }
  .dialog-actions { padding: 16px 21px; flex-wrap: wrap; }
  .dialog-actions .muted { flex: 1 1 100%; }
  .form-grid { gap: 16px; }
  .field input, .field select, .field textarea, .search-input, .select { font-size: 16px; }
  .field > span, .field > label { font-size: 12px; }
  .matrix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-steps { overflow-x: auto; }
  .step { flex: 1 0 100px; padding-inline: 10px; }
  .toast-container { right: 20px; bottom: 20px; }
  .toolbar-search { flex: 1 1 100%; }
  .toolbar-search .search-input { width: 100%; }
  .dialog-body form > .dialog-actions { margin: 22px -21px -21px; }
  .cart-lines .line-row, .cart-lines .line-row:has(> :nth-child(4)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; }
  .cart-lines .line-row > div:first-child { grid-column: 1 / -1; }
  .metrics-row { gap: 13px; }
  .metrics-row > div + div { padding-left: 13px; }
}
@media (max-width: 440px) {
  .top-actions { gap: 7px; }
  .top-actions > .muted { display: none; }
  .hero-copy h1, .hero-copy h2 { font-size: 27px; }
  .hero-copy p { font-size: 11px; }
  .page-actions { width: 100%; }
  .page-actions > .btn { flex: 1; padding-inline: 10px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .line-row { grid-template-columns: minmax(0, 1fr) 72px auto; gap: 8px; padding-inline: 10px; }
  .metric-split { gap: 15px; }
  .metric-split > * + * { padding-left: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  @page { size: 50mm 30mm; margin: 0; }
  html, body { min-width: 0; width: auto; height: auto; background: white; }
  body.printing { margin: 0; padding: 0; }
  body.printing > :not(.print-zone) { display: none !important; }
  body.printing * { visibility: hidden !important; box-shadow: none !important; }
  body.printing .print-zone, body.printing .print-zone * { visibility: visible !important; }
  body.printing .print-zone { display: block !important; position: static !important; width: 50mm !important; margin: 0 !important; padding: 0 !important; background: white; }
  body.printing .print-zone .label-grid { display: block; margin: 0; padding: 0; }
  body.printing .print-zone .label-card { width: 50mm; max-width: none; height: 30mm; min-height: 30mm; margin: 0; padding: 2mm; border: 0; border-radius: 0; break-inside: avoid; break-after: page; page-break-after: always; color: black; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing .print-zone .label-card:last-child { break-after: auto; page-break-after: auto; }
  body.printing .print-zone .label-brand { font-size: 8pt; }
  body.printing .print-zone .label-meta { font-size: 6.5pt; }
  body.printing .print-zone .barcode svg { width: 100%; height: 11mm; }
  body.printing .print-zone .barcode .mono, body.printing .print-zone .barcode small { font-size: 6pt; }
  body.printing .print-zone .label-code { font-size: 6pt; }
}

/* Studio extension: images, dense forms and records. */
.studio-photo{width:68px;height:88px;object-fit:cover;background:#f1f0ed;border:1px solid #e5e3df;display:block}
.product-glyph img.product-photo{width:100%;height:100%;padding:0;object-fit:cover}
.photo-upload{min-width:0;margin:8px 0 4px;padding:20px;border:1px solid #dedede;border-radius:4px;background:#fafafa}
.photo-upload-label{display:block;margin-bottom:14px;color:#555;font-size:12px;font-weight:500}
.photo-upload-layout{display:flex;align-items:center;gap:22px}
.photo-upload-preview{display:flex;align-items:center;justify-content:center;flex:0 0 120px;height:150px;padding:8px;border:1px solid #e4e4e4;background:#f0f0ef;overflow:hidden}
.photo-upload-preview img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.photo-upload-preview span{font-size:11px;line-height:1.8;text-align:center}
.photo-upload-controls{flex:1;min-width:0}.photo-upload-controls input[type="file"]{width:100%;padding:10px;background:#fff;font-size:12px}
.photo-upload-controls p{margin:10px 0;font-size:11px;line-height:1.8}
.photo-upload-controls .btn[hidden]{display:none}
.sku-picker-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:10px 0 16px}
.sku-picker-head h3{margin:0}.sku-picker-head>strong{font-size:11px;font-weight:400;color:#777}
.sku-picker-results{max-height:320px;overflow:auto;margin-top:14px}
.sku-picker-chosen{margin-top:18px;border-top:1px solid #ddd}
.sku-picker-item{display:flex;align-items:center;gap:14px;padding:13px 0;border-bottom:1px solid #e5e5e5}
.sku-picker-item .studio-photo{width:48px;height:62px;flex:0 0 48px;font-size:10px}
.sku-picker-detail{flex:1;min-width:0;font-size:12px;line-height:1.7;overflow-wrap:anywhere}
.sku-picker-detail>strong{font-weight:500}.sku-picker-detail>.muted{font-size:11px}
.sku-picker-item>.btn{flex:0 0 auto}.sku-picker-empty{padding:20px 14px;background:#f6f6f5;color:#777;font-size:12px;line-height:1.8}
@media(max-width:600px){.photo-upload{padding:14px}.photo-upload-layout{align-items:stretch;flex-direction:column;gap:14px}.photo-upload-preview{flex:none;width:100%;height:170px}.sku-picker-head{align-items:flex-start;flex-direction:column;gap:6px}}
.studio-placeholder{display:flex;align-items:center;justify-content:center;font-size:11px;color:#8a8883}
.studio-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:20px}
.studio-media-card{padding:14px;border:1px solid #e1dfda;background:#fbfaf8;min-width:0}
.studio-media-card .studio-photo{width:100%;height:230px;object-fit:contain}
.studio-media-card h3{font-size:15px;margin:14px 0 8px}
.studio-media-card p{white-space:pre-wrap;font-size:13px;line-height:1.6}
.studio-json{font:11px/1.5 ui-monospace,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-width:330px;max-height:180px;overflow:auto;background:#f6f5f2;padding:10px}
.studio-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));align-items:end;gap:14px}
.studio-filter-grid .field{margin:0}
.picker-option{display:block;width:100%;text-align:left;border-bottom:1px solid #eeece8;padding:10px 12px;white-space:normal}
.picker-toolbar,.picker-pages{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:10px 0}
.picker-toolbar>.search-input{flex:1;min-width:200px}.picker-pages{justify-content:flex-end}
.scan-status{min-height:24px;color:#666;font-size:12px;line-height:1.8;margin:12px 0}
.scan-failure{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:14px;border:1px solid #999;background:#f1f1f0;margin:8px 0;font-size:12px}.scan-failure>span{flex:1;min-width:180px;overflow-wrap:anywhere}
.shopfloor-picker-item{display:grid;grid-template-columns:minmax(180px,1fr) 110px minmax(140px,auto);align-items:center;gap:18px;width:100%}.shopfloor-picker-spec{font-size:12px}
.shopfloor-lines .shopfloor-line{display:grid;grid-template-columns:minmax(180px,1fr) 110px auto;gap:16px;align-items:center;padding:20px 0;border-bottom:1px solid #e0e0df}
.shopfloor-lines .shopfloor-line.is-sale{grid-template-columns:minmax(170px,1fr) 76px 130px 100px auto}
.shopfloor-line-product{min-width:0;overflow-wrap:anywhere}.shopfloor-line-spec{color:#777;font-size:12px;margin-top:8px;line-height:1.7}
.shopfloor-line-price{min-width:0}.shopfloor-line-price .btn{margin-top:8px;white-space:normal;font-size:11px}.shopfloor-line-subtotal{text-align:right;font-variant-numeric:tabular-nums;font-size:13px}
.shopfloor-line input{min-width:0;width:100%}.shopfloor-line .field{margin:0}.shopfloor-line .field>span{font-size:11px}
.draft-summary{margin:22px 0;padding:20px;background:#efefed;border:1px solid #dededb}.draft-summary-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.draft-summary-head h3{margin:0;font-size:14px}.draft-summary-metrics{display:flex;flex-wrap:wrap;gap:12px 24px;font-size:13px;line-height:1.8}
.next-product-toggle{display:flex;align-items:center;gap:10px;font-size:12px;color:#555}.next-product-toggle input{width:16px;height:16px}
.next-product-toggle{flex-wrap:wrap;margin:18px 0}.next-product-toggle small{flex-basis:100%;margin-left:26px}
.stock-line-context{display:block;margin-top:10px;padding-top:8px;border-top:1px solid #eee;color:#777;font-size:11px;line-height:1.8}.stock-line-context strong{display:block;color:#555;font-weight:500}.stock-line-context span{display:block;white-space:normal}
.shopfloor-line-spec,.shopfloor-line-product>small,.shopfloor-line-subtotal>small{display:block}
.quick-find-links{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 24px}.quick-find-result{display:block;width:100%;padding:16px;text-align:left;margin:8px 0;white-space:normal}.quick-find-product{display:grid;grid-template-columns:minmax(150px,1fr) 120px 160px;align-items:center;gap:18px}.quick-find-results{max-height:430px;overflow:auto}.quick-find-result:hover{border-color:#333;background:#f2f2f0}
.sku-detail-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}.sku-detail-header .product-glyph{width:90px;height:112px}.sku-detail-header .product-name{font-size:20px}.sku-detail-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 26px;font-size:13px;margin-bottom:22px}.sku-detail-facts p{margin:6px 0;overflow-wrap:anywhere}
@media(max-width:760px){.shopfloor-lines .shopfloor-line,.shopfloor-lines .shopfloor-line.is-sale{grid-template-columns:minmax(60px,1fr) minmax(90px,1fr) auto;gap:12px}.shopfloor-line-product{grid-column:1/-1}.shopfloor-line-subtotal{text-align:left}.shopfloor-picker-item,.quick-find-product{grid-template-columns:minmax(0,1fr) auto;gap:8px}.shopfloor-picker-item>small,.quick-find-product>small{grid-column:1/-1}.sku-detail-facts{grid-template-columns:1fr}.sku-detail-header .product-glyph{width:60px;height:78px}}
@media(max-width:800px){.studio-filter-grid{grid-template-columns:repeat(2,minmax(120px,1fr))}.studio-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.studio-media-card .studio-photo{height:180px}}
@media(max-width:480px){.studio-filter-grid,.studio-card-grid{grid-template-columns:1fr}.studio-json{max-width:200px}}
