.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 16px; font-weight: 600;
  min-height: 44px;
}
.btn:focus-visible { outline: 3px solid #fff6; outline-offset: 2px; }
.btn.secondary { background: #24344f; }
.icon-btn {
  appearance: none; background: transparent; border: 0; color: var(--text);
  font-size: 22px; width: 44px; height: 44px; border-radius: 8px; cursor: pointer;
}
input {
  background: #0e1626; color: var(--text);
  border: 1px solid #243149; border-radius: 10px;
  padding: 12px 14px; font-size: 16px; min-height: 44px;
}
.pill {
  font-size: 12px; color: var(--muted);
  border: 1px solid #243149; border-radius: 999px; padding: 2px 10px;
}
.pill.offline { color: var(--warn); border-color: var(--warn); }

/* Inventory tag states (plan §13.4) — each visually distinct. */
.tag-state { padding: 16px; border-radius: var(--radius); font-weight: 700; }
.tag-state.found   { background: rgba(46,204,113,.15); color: var(--ok); }
.tag-state.already { background: rgba(241,196,15,.15); color: var(--warn); }
.tag-state.unknown { background: rgba(138,150,171,.15); color: var(--muted); }
.tag-state.tamper  { background: rgba(231,76,60,.18);  color: var(--danger); }

.toast-host { position: fixed; left: 0; right: 0; bottom: 16px; display: grid; gap: 8px; justify-items: center; pointer-events: none; z-index: 50; }
.toast { background: #1c2840; color: var(--text); padding: 10px 16px; border-radius: 999px; box-shadow: 0 6px 24px #0008; }
.toast.warn { background: #3a2c12; color: var(--warn); }

/* cards & rows */
.card { background: var(--surface); border: 1px solid #1f2c45; border-radius: var(--radius); padding: 14px 16px; }
.list { display: grid; gap: 10px; margin: 12px 0; }
.row-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; color: var(--text); font-size: 16px; width: 100%; }
.row-main { font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.small { font-size: 13px; }

/* button variants */
.btn.secondary { background: #24344f; }
.btn.ghost { background: transparent; border: 1px solid #2a3a58; color: var(--text); }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: 14px; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 6px 0; font-size: 14px; }

/* tile grid (project home tabs) */
.tab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0; }
.tile { display: grid; gap: 6px; place-items: center; padding: 16px 8px; background: var(--surface); border: 1px solid #1f2c45; border-radius: var(--radius); color: var(--text); cursor: pointer; font-size: 13px; min-height: 80px; }
.tile-icon { font-size: 24px; }
.tile-muted { opacity: .55; }
.tile:focus-visible { outline: 3px solid #fff6; outline-offset: 2px; }

/* forms */
.field { display: grid; gap: 6px; margin: 12px 0; }
.field > span { font-size: 14px; color: var(--muted); }
.form-input, select.form-input { background: #0e1626; color: var(--text); border: 1px solid #243149; border-radius: 10px; padding: 12px 14px; font-size: 16px; min-height: 44px; width: 100%; }
input[type="search"] { background: #0e1626; color: var(--text); border: 1px solid #243149; border-radius: 10px; padding: 12px 14px; font-size: 16px; min-height: 44px; width: 100%; }

/* asset rows + preview table */
.search-results { margin-top: 10px; }
.asset-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid #1f2c45; border-radius: var(--radius); }
.preview-table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.preview-table th, .preview-table td { border-bottom: 1px solid #1f2c45; padding: 8px 10px; text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.preview-table th { color: var(--muted); position: sticky; top: 0; background: var(--surface); }

/* assign flow */
.assign-status { margin-top: 14px; }
.assign-status .card { display: grid; gap: 10px; }
.assign-status .ok { color: var(--ok); font-weight: 600; }

/* inventory + dashboard */
.pill.live { color: var(--ok); border-color: var(--ok); }
.gauge { text-align: center; margin: 14px 0; }
.gauge-num { font-size: 40px; font-weight: 800; line-height: 1.1; }
.inventory .tag-state { margin: 14px 0; min-height: 64px; display: grid; place-items: center; text-align: center; font-size: 18px; }
.note-card { display: flex; gap: 8px; align-items: center; }
.note-card input { flex: 1; }
.feed { gap: 8px; }
.feed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-left: 4px solid #2a3a58; }
.feed-row.found   { border-left-color: var(--ok); }
.feed-row.unknown { border-left-color: var(--muted); }
.feed-row.tamper  { border-left-color: var(--danger); }

/* ── Phase 4: QR transfer · scan-to-pair · tap-to-open ── */
.qr-wrap { display: grid; place-items: center; margin: 16px 0; }
.qr-canvas { width: 260px; height: 260px; max-width: 80vw; max-height: 80vw; background: #fff; border-radius: 8px; image-rendering: pixelated; }
.qr-video { width: 320px; max-width: 90vw; aspect-ratio: 1; object-fit: cover; background: #000; border-radius: 8px; }
.transfer-recv .tag-state { margin: 12px 0; min-height: 56px; display: grid; place-items: center; text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.info { background: rgba(79,140,255,.12); color: var(--accent); border-radius: var(--radius); }
.kv { display: grid; gap: 6px; margin-top: 10px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #1f2c45; }
.kv-key { color: var(--muted); }
.kv-val { font-weight: 600; text-align: right; word-break: break-word; }
