/* Components (design 4) */
/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--h-md); padding-inline: 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: var(--fw-medium) var(--fs-14)/1 var(--font-ui); text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { box-shadow: var(--shadow-press); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--pay { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn--pay:hover { background: color-mix(in oklab, var(--brand) 85%, black); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-hover); }
.btn--danger-quiet { background: transparent; border-color: transparent; color: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { height: var(--h-sm); padding-inline: 10px; font-size: var(--fs-13); }
.btn--lg { height: var(--h-lg); padding-inline: 18px; }
.btn--xl { height: var(--h-xl); padding-inline: 18px; font-size: var(--fs-16); }
.btn--2xl { height: var(--h-2xl); font-size: var(--fs-18); font-weight: 700; }
.btn--block { width: 100%; }
.wa-btn { background: #1F7A4D; border-color: #1F7A4D; color: #fff; }
.wa-btn:hover { background: #18663F; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text-2); padding: 0; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.kbd { font: 11px var(--font-mono); border: 1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: 4px; padding: 0 4px; margin-inline-start: auto; direction: ltr; unicode-bidi: isolate; }
@media (pointer: coarse) and (hover: none) { .kbd { display: none; } }
@media (pointer: coarse), (max-width: 860px) { .icon-btn { width: 44px; height: 44px; } }

/* ---------- fields ---------- */
.field { display: grid; gap: var(--sp-1); min-width: 0; border: 0; padding: 0; margin: 0; }
.field > label, .field legend { font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.req { color: var(--negative); margin-inline-start: 2px; }
.field-help { font-size: var(--fs-12); color: var(--text-3); }
.field-error { font-size: var(--fs-12); color: var(--negative); }
.input { width: 100%; height: var(--h-md); padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus-visible { box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--negative); }
.input.num { text-align: end; }
.input--sm { height: var(--h-sm); }
.select { appearance: auto; }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group .input { flex: 1; border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group > :last-child:not(.input) { border-start-start-radius: 0; border-end-start-radius: 0; }
.input-suffix, .input-prefix { display: inline-flex; align-items: center; padding-inline: 10px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text-2); font-size: var(--fs-13); white-space: nowrap; }
.input-suffix { border-inline-start: 0; border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); }
.input-prefix { border-inline-end: 0; border-start-start-radius: var(--r-sm); border-end-start-radius: var(--r-sm); }
.input-group .input-prefix + .input { border-radius: 0; }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .field--wide, .form-grid .ml-group, .form-grid .switch-row { grid-column: 1 / -1; }
.ml-group { display: grid; gap: var(--sp-2); }
.ml-item { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: var(--sp-2); }
.ml-lang { font-size: var(--fs-12); color: var(--text-3); }
.form-error { margin-block-end: var(--sp-3); }

/* ---------- switch ---------- */
.switch-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; flex-wrap: wrap; }
.switch-row .field-help { flex-basis: 100%; padding-inline-start: 56px; }
.switch { appearance: none; width: 44px; height: 24px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; margin: 0; flex: none; transition: background var(--dur-1); }
.switch::after { content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: inset-inline-start var(--dur-1); }
.switch:checked { background: var(--primary); }
.switch:checked::after { inset-inline-start: 22px; }
.switch-label { flex: 1; min-width: 0; }
.ftoggle { display: flex; align-items: center; gap: var(--sp-4); width: 100%; min-height: 88px; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); font: inherit; text-align: start; }
.ftoggle[aria-checked="true"] { border: 2px solid var(--primary); background: var(--primary-soft); padding: calc(var(--sp-4) - 1px); }
.ftoggle-ic { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--surface-3); display: grid; place-items: center; flex: none; }
.ftoggle-ic .ic { width: 24px; height: 24px; }
.ftoggle[aria-checked="true"] .ftoggle-ic { background: var(--primary); color: var(--primary-ink); }
.ftoggle-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.ftoggle-title { font-size: var(--fs-16); font-weight: 600; }
.ftoggle-desc { font-size: var(--fs-13); color: var(--text-2); }
.ftoggle-track { width: 60px; height: 32px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; flex: none; }
.ftoggle-track::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: inset-inline-start var(--dur-1); }
.ftoggle[aria-checked="true"] .ftoggle-track { background: var(--primary); }
.ftoggle[aria-checked="true"] .ftoggle-track::after { inset-inline-start: 31px; }
.ftoggle--compact { min-height: 72px; }
.fgrid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

/* ---------- data table ---------- */
.list-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-end; margin-block-end: var(--sp-3); }
.tb-search { position: relative; display: flex; align-items: center; min-width: 200px; flex: 0 1 280px; }
.tb-search .ic { position: absolute; inset-inline-start: 10px; color: var(--text-3); pointer-events: none; }
.tb-search .input { padding-inline-start: 34px; }
.tb-search--lg { flex: 1 1 100%; margin-block-end: var(--sp-3); }
.tb-field { display: grid; gap: 2px; font-size: var(--fs-12); color: var(--text-2); }
.tb-label { font-weight: 600; }
.tb-check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--h-sm); }
.tb-count { font-size: var(--fs-13); align-self: center; }
.dt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.dtable th { position: sticky; inset-block-start: 0; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-12); font-weight: 600; text-align: start; padding: 8px 12px; border-block-end: 1px solid var(--line); white-space: nowrap; }
.dtable td { padding: 6px 12px; border-block-end: 1px solid var(--line); height: var(--row-h); vertical-align: middle; }
:root[data-density="comfortable"] .dtable td { height: var(--row-h-comfy); }
.dtable tbody tr:last-child td { border-block-end: 0; }
.dtable tbody tr:hover { background: var(--surface-2); }
.dtable tr[data-href] { cursor: pointer; }
.dtable tr.is-selected { background: var(--primary-soft); }
.dtable tfoot td { font-weight: 700; background: var(--surface-2); border-block-start: 1px solid var(--line); }
.dtable .input { height: var(--h-sm); }
.dtable .cell-sub { display: block; font-size: var(--fs-12); color: var(--text-3); }
.pager { display: flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; margin-block-start: var(--sp-3); }
@media (max-width: 639px) {
  .dt-wrap { border: 0; background: none; overflow: visible; }
  .dtable, .dtable tbody, .dtable tr, .dtable td, .dtable tfoot { display: block; width: 100%; }
  .dtable thead { display: none; }
  .dtable tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-block-end: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
  .dtable td { border: 0; height: auto; padding: 2px 0; display: flex; justify-content: space-between; gap: var(--sp-3); text-align: end; }
  .dtable td::before { content: attr(data-label); color: var(--text-3); font-size: var(--fs-12); text-align: start; flex: none; max-width: 45%; }
  .dtable td.td-main { font-weight: 600; font-size: var(--fs-15); text-align: start; }
  .dtable td.td-main::before { display: none; }
  .dtable td:empty { display: none; }
  .list-toolbar .tb-search { flex: 1 1 100%; }
}

/* ---------- dialogs / drawers ---------- */
dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); }
dialog::backdrop { background: var(--scrim); }
.dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border-radius: var(--r-lg); box-shadow: var(--shadow-3); z-index: var(--z-modal); }
.dialog--sm { width: min(400px, calc(100vw - 24px)); }
.dialog--md { width: min(560px, calc(100vw - 24px)); }
.dialog--lg, .dialog--wide { width: min(760px, calc(100vw - 24px)); }
.dialog--xl { width: min(920px, calc(100vw - 24px)); }
.drawer { margin-inline-end: 0; margin-block: 0; height: 100vh; max-height: 100vh; width: min(480px, 100vw); box-shadow: var(--shadow-3); }
.drawer--wide { width: min(760px, 100vw); }
.dlg-form { display: flex; flex-direction: column; max-height: inherit; height: 100%; }
.dialog .dlg-form { max-height: calc(100vh - 32px); }
.dlg-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) var(--sp-3) var(--sp-5); border-block-end: 1px solid var(--line); }
.dlg-title { flex: 1; font-size: var(--fs-18); font-weight: 700; display: flex; align-items: center; gap: var(--sp-2); }
.dlg-body { padding: var(--sp-5); overflow-y: auto; flex: 1; display: grid; gap: var(--sp-4); align-content: start; }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-block-start: 1px solid var(--line); flex-wrap: wrap; }
.dialog.is-closing, .drawer.is-closing { opacity: 0; transition: opacity var(--dur-1); }
.confirm { display: grid; gap: var(--sp-3); justify-items: start; }
.confirm-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.confirm-ic--warn, .confirm-ic--delete { background: var(--negative-bg); color: var(--negative); }
.confirm-summary { font-weight: 600; }
.approval { z-index: var(--z-approval); }
.approval-reason { font-weight: 600; }
@media (max-width: 639px) { .dialog { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; margin: 0; } .dialog--sm { height: auto; max-height: 100vh; margin: auto; border-radius: var(--r-lg); width: calc(100vw - 16px); } }

/* ---------- toasts ---------- */
.toasts { position: fixed; inset-block-end: var(--sp-4); inset-inline-end: var(--sp-4); z-index: var(--z-toast); display: grid; gap: var(--sp-2); width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast-stack { display: grid; gap: var(--sp-2); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-2); background: var(--carbon-800); color: #fff; padding: var(--sp-3); border-radius: var(--r-md); box-shadow: var(--shadow-2); border-inline-start: 4px solid var(--brand-on-dark); }
.toast--error { border-inline-start-color: #F4A196; }
.toast--info { border-inline-start-color: #9CC3EC; }
.toast--warning { border-inline-start-color: var(--accent); }
.toast-msg { flex: 1; }
.toast-action { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: var(--r-sm); padding: 4px 8px; font: inherit; }
.toast-close { background: none; border: 0; color: #fff; opacity: .7; padding: 4px; display: grid; }
.toast.is-leaving { opacity: 0; transition: opacity var(--dur-2); }
@media (max-width: 639px) { .toasts { inset-block-end: calc(var(--bottomnav-h) + var(--sp-3)); inset-inline: var(--sp-3); width: auto; } }

/* ---------- badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding-inline: 8px; border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge .ic { width: 12px; height: 12px; }
.badge--positive { background: var(--positive-bg); color: var(--positive); }
.badge--negative { background: var(--negative-bg); color: var(--negative); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge--accent { background: var(--accent); color: var(--accent-ink); }
.badge--owed { background: var(--owed-bg); color: var(--owed); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding-inline: 10px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text); border: 0; font: inherit; font-size: var(--fs-13); white-space: nowrap; }
.chip[aria-pressed="true"], .chip.is-active { background: var(--primary); color: var(--primary-ink); }
@media (pointer: coarse) { .chip { height: 36px; } }

/* ---------- tabs, seg ---------- */
.tabs { display: flex; gap: var(--sp-1); border-block-end: 1px solid var(--line); margin-block-end: var(--sp-4); overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; color: var(--text-2); text-decoration: none; border-block-end: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab[aria-selected="true"] { color: var(--primary); border-block-end-color: var(--primary); }
.tab-count { font-size: var(--fs-12); background: var(--surface-3); border-radius: var(--r-pill); padding: 0 6px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; padding: 6px 12px; border-radius: 4px; color: var(--text-2); font: inherit; min-height: 32px; }
.seg-btn[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }

/* ---------- cards, kv, stat, alert, empty ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); min-width: 0; }
.card-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-block-end: 1px solid var(--line); }
.card-title { font-size: var(--fs-16); font-weight: 600; flex: 1; }
.card-body { padding: var(--sp-4); display: grid; gap: var(--sp-3); }
.cards { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.kv { display: grid; gap: var(--sp-2); margin: 0; }
.kv-row { display: flex; justify-content: space-between; gap: var(--sp-3); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: end; }
.stats { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-block-end: var(--sp-4); }
.stat { display: grid; gap: 2px; padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); text-decoration: none; min-width: 0; }
a.stat:hover { border-color: var(--line-strong); }
.stat-label { font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.stat-value { font-size: var(--fs-24); font-weight: 700; font-family: var(--font-num); overflow-wrap: anywhere; }
.stat-sub { font-size: var(--fs-12); color: var(--text-3); }
.stat--hero .stat-value { font-size: var(--fs-32); }
.alert { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: 1px solid transparent; flex-wrap: wrap; }
.alert > span { flex: 1; min-width: 0; }
.alert--info { background: var(--info-bg); color: var(--info); }
.alert--warning { background: var(--warning-bg); color: var(--warning); }
.alert--danger { background: var(--negative-bg); color: var(--negative); }
.alert--success { background: var(--positive-bg); color: var(--positive); }
.empty { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-10) var(--sp-4); text-align: center; color: var(--text-2); }
.empty-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; }
.empty-ic .ic { width: 32px; height: 32px; }
.empty-title { font-size: var(--fs-16); font-weight: 600; color: var(--text); }
.skel-list { display: grid; gap: var(--sp-2); }
.skel { height: 36px; border-radius: var(--r-sm); background: var(--surface-3); animation: pulse 1.2s infinite alternate; }

/* ---------- keypad / pinpad ---------- */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); direction: ltr; }
.key { height: var(--key-h); border-radius: var(--r-lg); border: 0; background: var(--surface-3); color: var(--text); font: var(--fw-semibold) var(--fs-24)/1 var(--font-num); display: grid; place-items: center; }
.key:active { box-shadow: var(--shadow-press); background: var(--line-strong); }
.key--fn { font-size: var(--fs-18); color: var(--text-2); }
.key--enter { background: var(--brand); color: var(--brand-ink); }
.pinpad { display: grid; gap: var(--sp-3); justify-items: center; outline: none; }
.pinpad-label { font-weight: 600; }
.pin-dots { display: flex; gap: var(--sp-3); direction: ltr; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-2); }
.pin-dot.is-on { background: var(--text); border-color: var(--text); }
.pinpad.is-wrong .pin-dot { border-color: var(--negative); }
.pinpad.is-wrong .pin-dots { animation: shake 240ms; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pin-msg { color: var(--negative); min-height: 1.4em; font-size: var(--fs-13); }
.keypad--pin { width: 100%; max-width: 280px; }

/* ---------- picker ---------- */
.picker { position: relative; }
.picker-pop { position: absolute; inset-inline: 0; inset-block-start: calc(100% + 4px); margin: 0; padding: var(--sp-1); list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); z-index: var(--z-dropdown); max-height: 360px; overflow-y: auto; }
.picker-opt { display: grid; gap: 2px; padding: var(--sp-2); border-radius: var(--r-sm); cursor: pointer; }
.picker-opt.is-active, .picker-opt:hover { background: var(--primary-soft); }
.picker-name { font-weight: 600; }
.picker-meta { font-size: var(--fs-12); color: var(--text-3); }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.pick-head { font-size: var(--fs-12); color: var(--text-3); font-weight: 600; padding: var(--sp-1) 0; }
.pick-item { display: flex; gap: var(--sp-2); align-items: center; width: 100%; min-height: 48px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; text-align: start; flex-wrap: wrap; }
.pick-item:hover { background: var(--surface-2); }
.pick-name { font-weight: 600; flex: 1; }
.pick-empty { padding: var(--sp-3); }

/* ---------- camera scanner ---------- */
.camscan { display: grid; gap: var(--sp-3); }
.camscan-view { position: relative; background: #000; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 3; }
.camscan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camscan-frame { position: absolute; inset-block: 25%; inset-inline: 15%; }
.camscan-frame span { position: absolute; width: 24px; height: 24px; border-color: #fff; border-style: solid; border-width: 0; }
.camscan-frame span:nth-child(1) { inset-block-start: 0; inset-inline-start: 0; border-block-start-width: 3px; border-inline-start-width: 3px; }
.camscan-frame span:nth-child(2) { inset-block-start: 0; inset-inline-end: 0; border-block-start-width: 3px; border-inline-end-width: 3px; }
.camscan-frame span:nth-child(3) { inset-block-end: 0; inset-inline-start: 0; border-block-end-width: 3px; border-inline-start-width: 3px; }
.camscan-frame span:nth-child(4) { inset-block-end: 0; inset-inline-end: 0; border-block-end-width: 3px; border-inline-end-width: 3px; }
.camscan-view.is-hit { box-shadow: 0 0 0 4px var(--positive); }
.camscan-tools { display: flex; gap: var(--sp-2); }
.camscan-msg { color: var(--text-2); }

/* ---------- denominations ---------- */
.denoms { display: grid; gap: var(--sp-2); }
.denom-row { display: grid; grid-template-columns: minmax(70px, 1fr) auto auto minmax(90px, 1fr); align-items: center; gap: var(--sp-2); }
.denom-note { font-weight: 600; }
.denom-sum { text-align: end; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper .input { width: 64px; text-align: center; height: 40px; }
.denom-total { display: flex; justify-content: space-between; border-block-start: 1px solid var(--line); padding-block-start: var(--sp-2); }

/* ---------- charts ---------- */
.chart { margin: 0; }
.chart-svg { width: 100%; height: auto; display: block; }
:root[dir="rtl"] .ch-plot { transform: scaleX(-1); transform-origin: 322px 0; }
.ch-grid { stroke: var(--chart-grid); stroke-width: 1; }
.ch-axis { fill: var(--chart-axis); font: 11px var(--font-num); }
.ch-bar { fill: var(--chart-1); }
.ch-bar--hi { fill: var(--chart-1); stroke: var(--chart-today); stroke-width: 2; }
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.barlist-row { display: grid; grid-template-columns: minmax(80px, 1.2fr) 2fr auto; gap: var(--sp-2); align-items: center; font-size: var(--fs-13); }
.barlist-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { background: var(--surface-3); border-radius: 4px; height: 8px; overflow: hidden; display: block; }
.barlist-svg { width: 100%; height: 8px; display: block; }
:root[dir="rtl"] .barlist-svg { transform: scaleX(-1); }
.barlist-val { text-align: end; white-space: nowrap; }
.sparkline { width: 100%; height: 24px; display: block; }
.spark-line { fill: none; stroke: var(--chart-1); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
:root[dir="rtl"] .sparkline { transform: scaleX(-1); }

/* ---------- barcode / qr ---------- */
.barcode svg, .qr svg { display: block; background: #fff; }
.qr { display: inline-block; background: #fff; padding: 4px; border-radius: var(--r-sm); }
.qr svg { width: 200px; height: 200px; }
.copyfield { display: flex; gap: var(--sp-2); align-items: center; }
.copyfield .input { font-family: var(--font-mono); }

.swatches { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); display: grid; place-items: center; color: #fff; padding: 0; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--text); }
.check-tiles { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.check-tile { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); min-height: 48px; }
.check-tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.diff { display: grid; gap: var(--sp-1); font-size: var(--fs-13); }
.diff-row { display: grid; grid-template-columns: 140px 1fr 1fr; gap: var(--sp-2); border-block-end: 1px solid var(--line); padding-block: 4px; }
.diff-row .is-changed { background: var(--warning-bg); }
.diff pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: var(--fs-12); }
