@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  src: url('../vendor/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --ink: #1b1f2a;
  --ink-2: #4a505c;
  --ink-3: #737986;
  --line: #e5e5e1;
  --line-strong: #cfcfca;
  --primary: #1b1f2a;
  --primary-hover: #30364560;
  --focus: #2563eb;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --success: #15703d;
  --success-bg: #e6f5ec;
  --warn: #93590b;
  --warn-bg: #fdf2dc;
  --info: #1f55b8;
  --info-bg: #e8effb;
  --neutral-bg: #eeeeeb;
  --radius: 10px;
  --radius-sm: 7px;
  --side: 224px;
  --nav-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#main:focus { outline: none; }
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Kerangka ---------- */
#sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px;
}
#main { margin-left: var(--side); min-height: 100vh; padding: 28px 32px 48px; }
.app-mark { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-weight: 700; font-size: 15px; }
.app-mark i { width: 28px; height: 28px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.app-mark .ic { width: 16px; height: 16px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--neutral-bg); color: var(--ink); font-weight: 600; }
.side-note { margin-top: auto; padding: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
#bottomnav { display: none; }

.page { max-width: 1120px; margin: 0 auto; }
.page-wide { max-width: 1500px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; line-height: 1.25; }
.page-head p { color: var(--ink-3); font-size: 13px; }
.head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.head-left h1 { overflow-wrap: anywhere; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg); border-color: #b9b9b3; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #333949; border-color: #333949; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: #f0b8b2; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #912018; border-color: #912018; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--neutral-bg); border-color: transparent; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }

/* ---------- Kartu & form ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.section h2 { font-size: 14.5px; font-weight: 700; margin-bottom: 14px; }
.section-hint { color: var(--ink-3); font-size: 12.5px; margin: -10px 0 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: grid; gap: 12px; }
.field { display: block; min-width: 0; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field-label em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.input {
  display: block; width: 100%; min-height: 38px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.input:hover { border-color: #b0b0aa; }
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.input::placeholder { color: #9a9ea8; }
textarea.input { resize: vertical; min-height: 70px; }
select.input { appearance: auto; }
.input.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.num { text-align: right; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

.seg { display: inline-flex; padding: 2px; background: var(--neutral-bg); border-radius: var(--radius-sm); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #0000001f; }

/* ---------- Pilihan brand ---------- */
.thumb { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-lg { width: 52px; height: 52px; border-radius: 10px; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: #a9a9a3; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .thumb { width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; font-size: 9px; }
.brand-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brand-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13px; text-align: left; cursor: pointer;
}
.brand-opt span:last-child { min-width: 0; overflow-wrap: anywhere; }
.brand-opt:hover { border-color: #a9a9a3; }
.brand-opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stat { padding: 14px 16px; }
.stat-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.stat-value { font-size: 20px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.stat-value.danger { color: var(--danger); }
.stat-sub { font-size: 12px; color: var(--ink-3); }

/* ---------- Daftar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search .ic { position: absolute; left: 10px; top: 10px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 34px; }
.filter-row { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-row button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.filter-row button:hover { color: var(--ink); background: var(--neutral-bg); }
.filter-row button[aria-pressed="true"] { color: var(--ink); background: var(--neutral-bg); }

.doc-table { overflow: hidden; }
.doc-row {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(150px, 1.1fr) minmax(140px, 1.3fr) 100px 100px 130px 124px;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
a.doc-row:hover { background: #fbfbfa; }
.doc-row.head { border-top: 0; padding-block: 9px; font-size: 12px; font-weight: 600; color: var(--ink-3); background: #fafaf8; }
.doc-num { font-weight: 600; overflow-wrap: anywhere; }
.doc-sub { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.doc-cust { font-weight: 500; overflow-wrap: anywhere; }
.doc-amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-date { font-size: 13px; color: var(--ink-2); }
.doc-status { justify-self: start; }
.m-label { display: none; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tone-neutral { background: var(--neutral-bg); color: var(--ink-2); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-success { background: var(--success-bg); color: var(--success); }

.empty { text-align: center; padding: 48px 20px; }
.empty h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.empty p { color: var(--ink-3); margin: 0 auto 16px; max-width: 42ch; }

.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 14px; }
.notice > div { flex: 1; min-width: 0; }
.notice h3 { font-size: 14px; font-weight: 700; }
.notice p { font-size: 13px; color: var(--ink-2); }
.notice-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.simple-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.simple-row:first-child { border-top: 0; }
.simple-row > .grow { flex: 1; min-width: 0; }
.simple-row .title { font-weight: 600; overflow-wrap: anywhere; }
.simple-row .sub { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.simple-row .amt { font-weight: 600; white-space: nowrap; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.brand-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.brand-card:hover { border-color: var(--line-strong); }
.brand-card h2 { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.brand-card p { font-size: 12.5px; color: var(--ink-3); }
.brand-card .missing { color: var(--warn); margin-top: 4px; }
.brand-card .complete { color: var(--success); margin-top: 4px; }

/* ---------- Editor ---------- */
.ed-tabs { display: none; margin-bottom: 12px; }
.ed-tabs .seg { display: flex; }
.ed-tabs .seg button { flex: 1; }
.ed-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-preview { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: var(--radius); }

.pv { --s: .6; display: grid; gap: 12px; justify-items: center; }
.pv-page {
  width: calc(793.7px * var(--s)); height: calc(1122.5px * var(--s));
  overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 4px;
}
.pv-page .sheet { transform: scale(var(--s)); transform-origin: 0 0; }

.items-head, .item { display: grid; grid-template-columns: minmax(0, 1fr) 62px 104px 104px 38px; gap: 6px; }
.items-head { padding: 7px 8px; margin-bottom: 6px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; }
.items-head span:nth-child(n+2) { text-align: right; }
.item { margin-bottom: 6px; align-items: start; }
.item-cap { display: none; }
.item-amt { min-height: 38px; display: flex; align-items: center; justify-content: flex-end; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.qty-total { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; padding: 8px 10px; background: var(--neutral-bg); border-radius: var(--radius-sm); font-weight: 600; }
.qty-total span { margin-right: auto; color: var(--ink-2); font-size: 13.5px; }
.qty-total b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty-total .input { width: 76px; min-height: 34px; padding: 5px 8px; }
.discount-row { display: flex; gap: 8px; }
.discount-row .seg { flex-shrink: 0; align-self: stretch; }
.discount-row .input { flex: 1; min-width: 0; }
.totals { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--ink-2); font-size: 13.5px; }
.totals div b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.totals .grand { padding-top: 8px; font-size: 16px; font-weight: 700; color: var(--ink); }
.totals .grand b { font-weight: 800; }
.ed-mobilebar { display: none; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.detail-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.balance-label { font-size: 12.5px; color: var(--ink-3); }
.balance { font-size: 26px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; color: var(--ink-2); }
.kv b { font-weight: 600; color: var(--ink); text-align: right; overflow-wrap: anywhere; min-width: 0; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .wide { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--ink-3); }

/* ---------- Upload ---------- */
.upload { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); transition: background .12s, border-color .12s; }
.upload.drag { background: var(--info-bg); border-color: var(--info); }
.upload-thumb { width: 72px; height: 72px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--bg); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; }
.upload-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.upload-body { flex: 1; min-width: 0; }
.upload-body b { display: block; font-size: 13.5px; font-weight: 600; }
.upload-body small { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.upload-actions .btn { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.file-btn { position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 0; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
input[type="color"] { width: 38px; height: 34px; padding: 2px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; }
.tpl-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl { padding: 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13px; text-align: left; }
.tpl[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tpl i { display: block; height: 44px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 4px; position: relative; overflow: hidden; }
.tpl-clean i::after { content: ''; position: absolute; left: 8px; right: 8px; top: 20px; height: 2px; background: var(--c); }
.tpl-band i::after { content: ''; position: absolute; inset: 0 0 auto; height: 22px; background: var(--c); }
.bank-row { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr 38px; gap: 8px; margin-bottom: 8px; align-items: end; }

/* ---------- Dialog & toast ---------- */
dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink);
  box-shadow: 0 18px 50px #0000003d;
}
dialog::backdrop { background: #11141b73; }
.dlg-body { padding: 20px; }
.dlg-body h2 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.dlg-body > p { color: var(--ink-2); margin-bottom: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; background: #fafaf8; border-top: 1px solid var(--line); }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; box-shadow: 0 6px 20px #00000033; }
.toast.err { background: var(--danger); }

/* ---------- Responsif ---------- */
@media (max-width: 1360px) {
  .ed-tabs { display: block; }
  .ed-layout { grid-template-columns: minmax(0, 1fr); }
  .ed-layout[data-tab="form"] .ed-preview, .ed-layout[data-tab="preview"] .ed-form { display: none; }
  .ed-preview { position: static; max-height: none; overflow: visible; }
  .ed-form { max-width: 760px; width: 100%; margin: 0 auto; }
}
@media (max-width: 1040px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; grid-row: 1; }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  #sidebar { display: none; }
  #main { margin-left: 0; padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
  #bottomnav {
    position: fixed; inset: auto 0 0 0; z-index: 20;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  #bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h); color: var(--ink-3); font-size: 11px; font-weight: 600; }
  #bottomnav a[aria-current="page"] { color: var(--ink); }
  #bottomnav .ic { width: 21px; height: 21px; }
  body.is-editing #bottomnav { display: none; }
  body.is-editing #main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }

  .input { min-height: 44px; font-size: 16px; }
  .btn { min-height: 44px; font-size: 14px; }
  .btn-icon { width: 44px; }
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 20px; }
  .search { max-width: none; flex-basis: 100%; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .filter-row button { white-space: nowrap; min-height: 36px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .section { padding: 14px; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .stat-value { font-size: 17px; }

  .doc-row.head { display: none; }
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px; }
  .doc-row:first-of-type { border-top: 0; }
  .doc-c-main { grid-column: 1; }
  .doc-c-cust { grid-column: 1; grid-row: 2; }
  .doc-c-date, .doc-c-due { display: none; }
  .doc-amt { grid-column: 2; grid-row: 1; }
  .doc-status { grid-column: 2; grid-row: 2; justify-self: end; }

  .grid-3 { grid-template-columns: 1fr 1fr; }
  .items-head { display: none; }
  .item {
    grid-template-columns: 72px minmax(0, 1fr) 44px;
    grid-template-areas: "desc desc del" "qty price price" "amt amt amt";
    gap: 8px; padding: 10px; margin-bottom: 8px;
    background: #fafaf8; border: 1px solid var(--line); border-radius: var(--radius-sm);
  }
  .item-cap { display: block; }
  .item .sr-only { display: none; }
  .item-desc { grid-area: desc; }
  .item-qty { grid-area: qty; }
  .item-price { grid-area: price; }
  .item-amt { grid-area: amt; min-height: 22px; font-size: 14px; }
  .item-del { grid-area: del; align-self: end; }
  .qty-total .input { min-height: 44px; }
  .bank-row { grid-template-columns: 1fr 1fr; padding: 10px; background: #fafaf8; border: 1px solid var(--line); border-radius: var(--radius-sm); }
  .bank-row .span-all { grid-column: 1 / -1; }

  .head-actions.ed-desktop { display: none; }
  .ed-mobilebar {
    position: fixed; inset: auto 0 0 0; z-index: 20;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .ed-mobilebar .sum { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-3); line-height: 1.25; }
  .ed-mobilebar .sum b { display: block; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
  #toasts { bottom: calc(var(--nav-h) + 16px); }

  dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; max-height: 90dvh; border-radius: 14px 14px 0 0; }
  .dlg-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1; }
}
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.keep { grid-template-columns: 1fr 1fr; }
  .brand-pick { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
