/* Shop Storage — iOS-flavoured design system */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #111113;
  --muted: #6e6e73;
  --sep: rgba(60, 60, 67, 0.16);
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --danger: #ff3b30;
  --ok: #34c759;
  --fill: rgba(118, 118, 128, 0.12);
  --glass: rgba(249, 249, 251, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 56px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #98989f;
    --sep: rgba(84, 84, 88, 0.55);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.2);
    --danger: #ff453a;
    --fill: rgba(118, 118, 128, 0.26);
    --glass: rgba(24, 24, 26, 0.82);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
#app { min-height: 100dvh; }
.page { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px); animation: fade 0.18s ease; }
.page.no-tabs { padding-bottom: calc(var(--safe-bottom) + 28px); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.navbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 6px) 8px 6px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: calc(var(--safe-top) + 50px);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.15s;
}
.navbar.scrolled { border-bottom-color: var(--sep); }
.navbar .title { font-weight: 600; font-size: 17px; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.15s; text-align: center; }
.navbar.scrolled .title, .navbar.always-title .title { opacity: 1; }
.navbar .left { justify-self: start; display: flex; }
.navbar .right { justify-self: end; display: flex; gap: 2px; }
.nav-btn { color: var(--accent); display: inline-flex; align-items: center; gap: 2px; padding: 8px; border-radius: 10px; font-size: 17px; min-height: 40px; }
.nav-btn:active { opacity: 0.5; }
.nav-btn.danger { color: var(--danger); }

.wrap { padding: 0 16px; max-width: 760px; margin: 0 auto; }
.large-title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 10px; line-height: 1.1; word-break: break-word; }
.subtle { color: var(--muted); }
.small { font-size: 13px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 22px 16px 7px; font-weight: 500; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(var(--safe-bottom) + 4px);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--sep);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 500; padding: 4px 0; }
.tab svg.i { width: 25px; height: 25px; }
.tab.active { color: var(--accent); }
.tab:active { opacity: 0.6; }

/* ---------- lists & cards ---------- */
.group { background: var(--card); border-radius: var(--radius); margin: 0 16px; overflow: hidden; box-shadow: var(--shadow); }
.wrap > .group, .page > .group { max-width: 728px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 58px; position: relative; text-align: left; width: 100%; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 70px; right: 0; border-top: 0.5px solid var(--sep); }
.row.compact { min-height: 48px; }
.row.compact + .row.compact::before { left: 14px; }
.row.simple + .row.simple::before { left: 14px; }
button.row:active, a.row:active { background: var(--fill); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--muted); opacity: 0.6; width: 18px; height: 18px; }
.row .trail { color: var(--muted); font-size: 15px; }
.row .icon-lead { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.row .icon-lead svg.i { width: 18px; height: 18px; }

.thumb { width: 46px; height: 46px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; overflow: hidden; background-size: cover; background-position: center; }
.thumb svg.i { width: 24px; height: 24px; }
.thumb.item { background-color: var(--fill); color: var(--muted); }
.thumb.sm { width: 40px; height: 40px; border-radius: 10px; }

mark { background: rgba(255, 204, 0, 0.45); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 99px; }
button.chip:active { opacity: 0.6; }
.crumbs { display: flex; align-items: center; gap: 2px; overflow-x: auto; white-space: nowrap; padding: 0 16px 6px; margin: 0 -16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs button, .crumbs span.cur { font-size: 13.5px; padding: 4px 8px; border-radius: 8px; color: var(--accent); }
.crumbs span.cur { color: var(--muted); }
.crumbs .sepc { color: var(--muted); opacity: 0.5; font-size: 12px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; min-height: 46px; }
.btn:active { opacity: 0.75; transform: scale(0.99); }
.btn.secondary { background: var(--fill); color: var(--accent); }
.btn.danger { background: rgba(255, 59, 48, 0.12); color: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 5px; }
.input, .textarea {
  width: 100%; background: var(--fill); border: 0; border-radius: 11px; padding: 12px 14px; font-size: 17px; outline: none; -webkit-appearance: none; appearance: none;
}
.input:focus, .textarea:focus { box-shadow: 0 0 0 2px var(--accent); }
.textarea { min-height: 84px; resize: vertical; }
.searchbar { position: relative; }
.searchbar svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }
.searchbar .input { padding-left: 38px; border-radius: 12px; }
.searchbar .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; color: var(--muted); display: grid; place-items: center; }

.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 12px; }
.stepper button { width: 46px; height: 44px; font-size: 24px; color: var(--accent); display: grid; place-items: center; }
.stepper button:active { opacity: 0.4; }
.stepper .val { min-width: 54px; text-align: center; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }

.segmented { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; margin-bottom: 14px; }
.segmented button { flex: 1; padding: 8px; border-radius: 8px; font-weight: 500; font-size: 14.5px; }
.segmented button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); font-weight: 600; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch input { width: 51px; height: 31px; accent-color: var(--ok); }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 0 16px 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 16px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 8px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 12.5px; }

/* ---------- node detail ---------- */
.hero { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 6px; margin: 0 -16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hero::-webkit-scrollbar { display: none; }
.hero button { flex: none; scroll-snap-align: center; border-radius: 16px; overflow: hidden; height: 220px; background: var(--fill); box-shadow: var(--shadow); }
.hero button img { height: 100%; width: auto; max-width: 86vw; object-fit: cover; display: block; }
.hero button.only img { max-width: calc(100vw - 32px); }
.add-photo { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 110px; border-radius: 16px; border: 1.5px dashed var(--sep); color: var(--accent); font-weight: 600; background: var(--card); }
.add-photo:active { background: var(--fill); }
.kv { padding: 12px 14px; }
.kv + .kv { border-top: 0.5px solid var(--sep); }
.kv .k { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.kv .v { white-space: pre-wrap; word-break: break-word; }
.qty-card { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.qty-card .lbl { font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 13.5px; margin: 2px 0 12px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta svg.i { width: 15px; height: 15px; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px); z-index: 25;
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.45);
}
.fab:active { transform: scale(0.94); }
.fab svg.i { width: 28px; height: 28px; stroke-width: 2.2; }

.empty { text-align: center; padding: 48px 28px; color: var(--muted); }
.empty .big { width: 76px; height: 76px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .big svg.i { width: 38px; height: 38px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 20px; }
.empty p { margin: 0 0 18px; }

/* ---------- sheets & overlays ---------- */
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.4); animation: bd 0.2s ease; display: flex; align-items: flex-end; justify-content: center; }
@keyframes bd { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(var(--safe-bottom) + 16px);
  animation: up 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--sep); margin: 4px auto 10px; }
.sheet h2 { margin: 4px 0 14px; font-size: 20px; text-align: center; }
.sheet .group { margin: 0 0 12px; }
.sheet .actions .row { min-height: 52px; }
.sheet .actions .row::before { left: 14px !important; }
.row.danger { color: var(--danger); }
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 22px; } }

.viewer { position: fixed; inset: 0; z-index: 120; background: #000; display: flex; flex-direction: column; animation: bd 0.15s; }
.viewer .top { display: flex; justify-content: space-between; padding: calc(var(--safe-top) + 8px) 8px 8px; color: #fff; }
.viewer .top button { color: #fff; padding: 10px 14px; font-size: 16px; display: inline-flex; gap: 6px; align-items: center; }
.viewer .stage { flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: pinch-zoom; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .bottom { padding: 10px 16px calc(var(--safe-bottom) + 14px); display: flex; justify-content: center; gap: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 200;
  background: rgba(40, 40, 44, 0.94); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 15px; transition: all 0.25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(200, 40, 32, 0.96); }

.pending-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pending-photos .p { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; background: var(--fill); }
.pending-photos img { width: 100%; height: 100%; object-fit: cover; }
.pending-photos .p button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; display: grid; place-items: center; }
.pending-photos .p button svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.pending-photos .add { width: 74px; height: 74px; border-radius: 12px; border: 1.5px dashed var(--sep); display: grid; place-items: center; color: var(--accent); }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth .panel { width: 100%; max-width: 380px; }
.auth .logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 18px; display: block; box-shadow: 0 8px 24px rgba(0, 90, 220, 0.3); }
.auth h1 { text-align: center; margin: 0 0 4px; font-size: 30px; letter-spacing: -0.02em; }
.auth p.lead { text-align: center; color: var(--muted); margin: 0 0 24px; }
.err-text { color: var(--danger); font-size: 14px; margin: -4px 4px 12px; min-height: 0; }

/* ---------- scanner ---------- */
.scanner { position: relative; margin: 0 16px; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 62dvh; width: calc(100% - 32px); }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, 0.9); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.scanner .hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }

/* ---------- labels ---------- */
.label-sheet { display: grid; gap: 10px; padding: 16px; justify-content: center; }
.label-sheet.size-sm { grid-template-columns: repeat(auto-fill, 2in); }
.label-sheet.size-lg { grid-template-columns: repeat(auto-fill, 3.5in); }
.label { background: #fff; color: #000; border: 1px solid #ccc; border-radius: 8px; display: flex; align-items: center; gap: 0.1in; padding: 0.1in; break-inside: avoid; page-break-inside: avoid; overflow: hidden; }
.size-sm .label { height: 1in; }
.size-lg .label { height: 1.6in; gap: 0.16in; padding: 0.14in; }
.label .qr { flex: none; height: 100%; aspect-ratio: 1; }
.label .qr svg, .label .qr img { width: 100%; height: 100%; display: block; }
.label .txt { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.label .nm { font-weight: 800; line-height: 1.1; word-break: break-word; }
.size-sm .label .nm { font-size: 11pt; max-height: 0.62in; overflow: hidden; }
.size-lg .label .nm { font-size: 18pt; }
.label .pth { font-size: 7pt; color: #444; line-height: 1.15; max-height: 0.4in; overflow: hidden; }
.size-lg .label .pth { font-size: 9pt; max-height: 0.7in; }
.label .lid { font-size: 7pt; color: #777; font-family: ui-monospace, Menlo, monospace; }
@media print {
  body { background: #fff; }
  .no-print, .navbar, .tabbar, .toast, .fab { display: none !important; }
  .page { padding: 0; animation: none; }
  .label-sheet { padding: 0; gap: 0.08in; }
  .label { border: 1px dashed #aaa; border-radius: 0; }
  @page { margin: 0.4in; }
}

.activity-row .what { font-size: 15px; }
.activity-row .when { color: var(--muted); font-size: 12.5px; }
.link-list .row .icon-lead.blue { background: #0a84ff; } .link-list .row .icon-lead.green { background: #30b050; }
.link-list .row .icon-lead.orange { background: #ff9500; } .link-list .row .icon-lead.purple { background: #af52de; }
.link-list .row .icon-lead.gray { background: #8e8e93; } .link-list .row .icon-lead.red { background: #ff3b30; }
.link-list .row .icon-lead.teal { background: #30b0c7; }
.link-list .row::before { left: 56px !important; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--fill); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 800px) { .tabbar { left: 50%; right: auto; width: 480px; transform: translateX(-50%); border-radius: 20px 20px 0 0; border: 0.5px solid var(--sep); } .fab { right: calc(50% - 360px); } }

/* ---------- small additions ---------- */
a.row { color: inherit; }
.row .sub.clamp { white-space: normal; overflow: hidden; max-height: 2.8em; }
label.row { cursor: pointer; }
.row input[type="checkbox"] { accent-color: var(--accent); }
input[type="search"]::-webkit-search-cancel-button { display: none; }
:root { --seg-on: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --seg-on: #636366; } }
.segmented button.on { background: var(--seg-on); }

.navbar .left { min-width: 0; max-width: 100%; }
.navbar .left .nav-btn { min-width: 0; max-width: 100%; }
.nav-btn .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.wrap .stat-grid { margin: 0 0 18px; }

/* ---------- photo cropper ---------- */
.cropper { position: fixed; inset: 0; z-index: 150; background: #000; color: #fff; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; animation: bd 0.15s; }
.crop-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 6px) 6px 6px; }
.crop-top button { color: #fff; font-size: 17px; padding: 10px 14px; border-radius: 10px; }
.crop-top button.done { color: #ffd60a; font-weight: 700; }
.crop-top b { font-size: 16px; }
.crop-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; overflow: hidden; }
.crop-frame { position: relative; line-height: 0; touch-action: none; }
.crop-img { display: block; max-width: calc(100vw - 24px); max-height: calc(100dvh - 210px - var(--safe-top) - var(--safe-bottom)); width: auto; height: auto; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.58); cursor: move; touch-action: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 33.33% 0 / 1px 100% no-repeat,
  linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 66.66% 0 / 1px 100% no-repeat,
  linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 0 33.33% / 100% 1px no-repeat,
  linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)) 0 66.66% / 100% 1px no-repeat; }
.crop-h { position: absolute; width: 44px; height: 44px; display: grid; place-items: center; touch-action: none; }
.crop-h i { width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.crop-h.h-n i, .crop-h.h-s i { width: 28px; height: 6px; border-radius: 3px; }
.crop-h.h-e i, .crop-h.h-w i { width: 6px; height: 28px; border-radius: 3px; }
.h-nw { left: -22px; top: -22px; } .h-n { left: calc(50% - 22px); top: -22px; } .h-ne { right: -22px; top: -22px; }
.h-e { right: -22px; top: calc(50% - 22px); } .h-se { right: -22px; bottom: -22px; } .h-s { left: calc(50% - 22px); bottom: -22px; }
.h-sw { left: -22px; bottom: -22px; } .h-w { left: -22px; top: calc(50% - 22px); }
.crop-frame.locked .h-n, .crop-frame.locked .h-s, .crop-frame.locked .h-e, .crop-frame.locked .h-w { display: none; }
.crop-bottom { padding: 8px 12px calc(var(--safe-bottom) + 12px); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.crop-seg { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.crop-seg button { padding: 7px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 14px; font-weight: 500; }
.crop-seg button.on { background: #fff; color: #000; font-weight: 700; }
.crop-tools { display: flex; gap: 22px; }
.crop-tools button { color: #0a84ff; font-size: 16px; padding: 6px 10px; }

/* ---------- label images ---------- */
.label-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.label-card { background: var(--card); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.label-card img { width: calc(var(--lw, 40) * 4.5px); max-width: 100%; height: auto; background: #fff; border: 1px solid var(--sep); border-radius: 4px; image-rendering: auto; -webkit-touch-callout: default; }
.label-card .cap { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; }
.label-card .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-card .btn { min-height: 34px; padding: 6px 14px; font-size: 14px; }
@media print {
  .label-grid { display: flex; flex-wrap: wrap; gap: 3mm; }
  .label-card { box-shadow: none; padding: 0; background: none; break-inside: avoid; }
  .label-card img { width: calc(var(--lw, 40) * 1mm); border: 1px dashed #aaa; border-radius: 0; }
}

.printer-log { font: 12px/1.35 ui-monospace, Menlo, Consolas, monospace; min-height: 220px; white-space: pre; overflow: auto; }
