/* ============================================================================
   PokeVend — mobile-first dark UI. 390px target width.
   Zero external assets: system font stack, inline SVG icons, no webfonts.
   ========================================================================== */

:root {
  --bg:            #0A0A12;
  --bg-sunken:     #07070E;
  --surface:       #131320;
  --surface-2:     #1B1B2E;
  --surface-3:     #24243A;
  --border:        #26263A;
  --border-strong: #34344E;

  --text:          #F2F2F8;
  --text-dim:      #C0C0D4;
  --text-muted:    #8A8AA3;

  --accent:        #7C5CFC;
  --accent-2:      #4C6FFF;
  --grad:          linear-gradient(135deg, #7C5CFC, #4C6FFF);
  --accent-dim:    #4a3a96;
  --accent-ink:    #ffffff;
  --success:       #22C55E;
  --success-bg:    rgba(34, 197, 94, .12);
  --danger:        #EF4444;
  --danger-bg:     rgba(239, 68, 68, .12);
  --amber:         #d9a127;
  --amber-bg:      rgba(217, 161, 39, .12);
  --violet:        #a78bfa;
  --violet-bg:     rgba(124, 92, 252, .14);

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 16px;

  --tab-h: 60px;
  --header-h: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shadow: 0 8px 28px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  padding-top: calc(var(--header-h) + var(--safe-t));
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }
p { margin: 0 0 .6em; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.skip-link {
  position: fixed; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .5rem .8rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- header -- */

.app-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-header__title {
  font-size: 1.05rem; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header__actions { display: flex; align-items: center; gap: 4px; flex: none; }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--radius);
  color: var(--text-dim); cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ----------------------------------------------------------------- views -- */

.view-root {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 12px 24px;
  outline: none;
}

.view-section { margin-bottom: 20px; }
.view-section:last-child { margin-bottom: 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.section-head h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 700; }
.section-head__aside { font-size: .8rem; color: var(--text-muted); }

/* ------------------------------------------------------------- tab bar --- */

.tab-bar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tab-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: .68rem; font-weight: 600; letter-spacing: .01em;
  padding: 0; min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn[aria-current="page"] { color: var(--accent); }
.tab-btn__badge {
  position: absolute; transform: translate(14px, -12px);
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center;
}

/* Center slot: raised gradient scan circle floating above the bar. */
.tab-btn--scan { overflow: visible; }
.scan-fab {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  margin-top: -26px;
  box-shadow: 0 6px 18px rgba(124, 92, 252, .45), 0 2px 6px rgba(0, 0, 0, .4);
  border: 3px solid var(--bg);
}
.scan-fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn--scan:active .scan-fab { transform: translateY(1px); }
.tab-btn--scan[aria-current="page"] .scan-fab { box-shadow: 0 6px 22px rgba(124, 92, 252, .65), 0 2px 6px rgba(0, 0, 0, .4); }
.tab-btn--scan .tab-btn__badge { transform: translate(20px, -34px); z-index: 1; }

/* ------------------------------------------------------------- surfaces -- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}
.card + .card { margin-top: 10px; }
.card--flush { padding: 0; overflow: hidden; }

.empty {
  text-align: center; padding: 28px 16px;
  color: var(--text-muted); font-size: .9rem;
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.empty strong { display: block; color: var(--text-dim); font-size: .95rem; margin-bottom: 4px; }
.empty__icon {
  width: 40px; height: 40px; margin: 0 auto 10px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
}
.empty__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty__action { margin-top: 12px; display: flex; justify-content: center; }

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: .92rem; font-weight: 600; cursor: pointer;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn--primary { background: var(--grad); border-color: var(--accent); color: var(--accent-ink); }
.btn--danger  { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn--ghost   { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn--block   { display: flex; width: 100%; }
.btn--sm      { min-height: 34px; padding: 0 10px; font-size: .82rem; border-radius: var(--radius-sm); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* ------------------------------------------------------------- big scan -- */

.scan-drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100%; min-height: 180px; padding: 24px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  color: var(--text); cursor: pointer; text-align: center;
}
.scan-drop:active { border-color: var(--accent); }
.scan-drop__icon {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
}
.scan-drop__icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scan-drop__title { font-size: 1.05rem; font-weight: 700; }
.scan-drop__hint { font-size: .82rem; color: var(--text-muted); max-width: 26ch; }
.scan-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* --------------------------------------------------------------- chips --- */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px;
  font-size: .7rem; font-weight: 650; line-height: 1.5;
  background: var(--surface-3); color: var(--text-dim);
  border: 1px solid transparent; white-space: nowrap;
}
.chip--stale   { background: var(--amber-bg);   color: var(--amber);   border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.chip--eur     { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }
/* Gain/loss pills: tinted bg at ~12% alpha, arrow glyph prefix rendered in text. */
.chip--gain { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); font-variant-numeric: tabular-nums; }
.chip--loss { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); font-variant-numeric: tabular-nums; }
.chip--flat { background: var(--surface-3); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chip--ok      { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.chip--danger  { background: var(--danger-bg);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.chip--accent  { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.chip--variant { background: var(--surface-3); color: var(--text); text-transform: capitalize; }

/* filter chip row */
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-btn {
  flex: none; min-height: 34px; padding: 0 12px;
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------------- forms -- */

.field { display: block; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: .78rem; font-weight: 650; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px;
}
.field__req { color: var(--danger); font-weight: 700; }
.field__hint { font-size: .76rem; color: var(--text-muted); margin-top: 5px; }
.field__error { font-size: .78rem; color: var(--danger); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--bg-sunken); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 1rem; /* >=16px prevents iOS zoom-on-focus */
  appearance: none;
}
.textarea { min-height: 72px; resize: vertical; line-height: 1.4; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%237d8b9c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  padding-right: 32px;
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: .5; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

.input--money { font-family: var(--mono); letter-spacing: .01em; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-grid > .field { margin-bottom: 0; }

.search-bar { position: relative; margin-bottom: 10px; }
.search-bar .input { padding-left: 38px; }
.search-bar__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-muted);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  pointer-events: none;
}

/* --------------------------------------------------- variant radio list -- */

.variant-list { display: flex; flex-direction: column; gap: 8px; }

.variant-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; min-height: 56px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer;
}
.variant-row:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-sunken));
}
.variant-row input[type="radio"] {
  appearance: none; flex: none;
  width: 22px; height: 22px; margin: 0; border-radius: 50%;
  border: 2px solid var(--border-strong); background: transparent; cursor: pointer;
}
.variant-row input[type="radio"]:checked {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 46%, transparent 48%);
}
.variant-row__body { flex: 1 1 auto; min-width: 0; }
.variant-row__name { display: block; font-weight: 650; text-transform: capitalize; }
.variant-row__meta { display: block; font-size: .74rem; color: var(--text-muted); margin-top: 2px; }
.variant-row__price { flex: none; text-align: right; }
.variant-row__price .money { font-size: 1rem; font-weight: 700; }

.variant-unpicked svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.variant-unpicked {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--amber);
  background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 10px;
}

/* ---------------------------------------------------------------- money -- */

.money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.money--pos { color: var(--success); }
.money--neg { color: var(--danger); }
.money--big { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.money--muted { color: var(--text-muted); font-weight: 500; }

.price-block { display: flex; flex-direction: column; gap: 3px; }
.price-block__row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.provenance {
  display: block;
  font-size: .7rem; color: var(--text-muted); line-height: 1.35;
}
.provenance--inline { display: inline; }

.price-missing { font-size: .8rem; color: var(--text-muted); font-style: italic; }

/* ------------------------------------------------------- advisory panel -- */

.advisory {
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-left-width: 4px;
  background: var(--amber-bg);
  border-radius: var(--radius);
  padding: 12px;
}
.advisory__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.advisory__badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--amber);
}
.advisory__badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.advisory__stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.advisory__stat {
  flex: 1 1 90px;
  background: color-mix(in srgb, #000 22%, transparent);
  border-radius: var(--radius-sm); padding: 7px 9px;
}
.advisory__stat dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.advisory__stat dd { margin: 2px 0 0; font-size: .98rem; font-weight: 700; }
.advisory__list { margin: 0 0 8px; padding-left: 0; }
.advisory__list li {
  position: relative; padding-left: 20px; margin-bottom: 4px;
  font-size: .82rem; color: var(--text-dim);
}
.advisory__list li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 8px; height: 4px; border-left: 2px solid var(--amber); border-bottom: 2px solid var(--amber);
  transform: rotate(-45deg);
}
.advisory__list--caveats li::before {
  content: "!"; border: 0; transform: none; left: 6px; top: 0;
  width: auto; height: auto; color: var(--amber); font-weight: 800; font-size: .8rem;
}
.advisory__sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 8px 0 4px; font-weight: 700; }
.advisory__disclaimer {
  display: block; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--amber) 40%, transparent);
  font-size: .78rem; font-weight: 700; color: var(--amber);
}

/* ------------------------------------------------------------ list rows -- */

.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; min-height: 68px;
  background: var(--surface); border: 0; border-bottom: 1px solid var(--border);
  color: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.row__thumb {
  flex: none; width: 44px; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden;
  background: var(--surface-3);
  display: grid; place-items: center;
}
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__thumb--empty::after {
  content: ""; width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border-strong);
}
.row__body { flex: 1 1 auto; min-width: 0; }
.row__title {
  font-weight: 650; font-size: .95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row__sub {
  font-size: .76rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row__chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.row__right { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row__cost { font-size: .72rem; color: var(--text-muted); }
.row svg, svg.row__right {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted);
}

/* --------------------------------------------------------- candidate card */

.candidates { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.candidate {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; text-align: left; color: inherit;
}
.candidate:active { border-color: var(--accent); }
.candidate__img {
  width: 100%; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
}
.candidate__img img { width: 100%; height: 100%; object-fit: contain; }
.candidate__name { font-size: .82rem; font-weight: 650; line-height: 1.25; }
.candidate__set { font-size: .7rem; color: var(--text-muted); }
.candidate__price { font-size: .76rem; }

/* --------------------------------------------------------------- sheets -- */

.sheet-root:empty { display: none; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 5, 10, .66);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .16s ease-out;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow);
  animation: sheet-up .2s cubic-bezier(.2, .8, .3, 1);
}
.sheet__grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
.sheet__head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); flex: none;
}
.sheet__title { flex: 1 1 auto; font-size: 1rem; font-weight: 700; min-width: 0; }
.sheet__body { flex: 1 1 auto; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.sheet__foot {
  flex: none; display: flex; gap: 8px; padding: 12px;
  padding-bottom: calc(12px + var(--safe-b));
  border-top: 1px solid var(--border); background: var(--surface);
}
.sheet__foot > .btn { flex: 1 1 auto; }

@keyframes sheet-up { from { transform: translateY(14%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------- detail sheet -- */

.detail-hero { display: flex; gap: 12px; margin-bottom: 14px; }
.detail-hero__img {
  flex: none; width: 108px; aspect-ratio: 63 / 88;
  border-radius: 8px; overflow: hidden; background: var(--surface-3);
}
.detail-hero__img img { width: 100%; height: 100%; object-fit: contain; }
.detail-hero__body { flex: 1 1 auto; min-width: 0; }
.detail-hero__name { font-size: 1.1rem; font-weight: 700; }
.detail-hero__sub { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.detail-hero__chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv__k { font-size: .78rem; color: var(--text-muted); flex: none; }
.kv__v { text-align: right; min-width: 0; }

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.price-tile {
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 10px; text-align: center;
}
.price-tile__label { font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.price-tile__value { font-size: 1.02rem; margin-top: 3px; }
.price-tile--ask   { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.price-tile--offer { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-out {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 42px; padding: 0 12px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-dim);
  font-size: .86rem; font-weight: 600; text-decoration: none;
}
.link-out svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------- trade --- */

.trade-cols { display: grid; grid-template-columns: 1fr; gap: 10px; }
.trade-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.trade-col__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.trade-col__title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.trade-col--out .trade-col__title { color: var(--danger); }
.trade-col--in  .trade-col__title { color: var(--success); }
.trade-col__total { font-size: .9rem; }
.trade-col__body { padding: 8px; }
.trade-col__body .row { border-radius: var(--radius-sm); }

.trade-line {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-bottom: 1px solid var(--border);
}
.trade-line:last-child { border-bottom: 0; }
.trade-line__body { flex: 1 1 auto; min-width: 0; }
.trade-line__name { font-size: .88rem; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-line__meta { font-size: .72rem; color: var(--text-muted); }
.trade-line__value { flex: none; width: 96px; }
.trade-line__value .input { min-height: 38px; padding: 6px 8px; font-size: .9rem; text-align: right; }
.trade-line__remove {
  flex: none; width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); display: grid; place-items: center; cursor: pointer;
}
.trade-line__remove svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.trade-line > svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted);
}

.trade-summary {
  position: sticky; bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
}
.trade-summary__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 10px; }
.trade-summary__cell { min-width: 0; }
.trade-summary__cell dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.trade-summary__cell dd { margin: 2px 0 0; }
.trade-diff {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius); margin-bottom: 10px;
  font-weight: 700;
}
.trade-diff--even  { background: var(--surface-3); color: var(--text-dim); }
.trade-diff--favor { background: var(--success-bg); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); }
.trade-diff--against { background: var(--danger-bg); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.trade-diff__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* ---------------------------------------------------------------- stats -- */

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.stat-tile--wide { grid-column: 1 / -1; }
.stat-tile__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 700; }
.stat-tile__value { margin-top: 5px; }
.stat-tile__sub { font-size: .74rem; color: var(--text-muted); margin-top: 3px; }

/* -------------------------------------------------------------- banners -- */

.banner-stack { position: sticky; top: 0; z-index: 25; max-width: 560px; margin: 0 auto; padding: 0 12px; }
.banner-stack:empty { display: none; }
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin-top: 10px;
  border-radius: var(--radius); font-size: .85rem;
  border: 1px solid transparent;
}
.banner--offline { background: var(--amber-bg); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.banner--error   { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.banner__icon { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.banner__body { flex: 1 1 auto; min-width: 0; }
.banner__title { font-weight: 700; }
.banner__msg { color: inherit; opacity: .88; }
.banner__actions { display: flex; gap: 6px; margin-top: 8px; }
.banner__actions .btn { min-height: 32px; padding: 0 10px; font-size: .8rem; }

/* --------------------------------------------------------------- toasts -- */

.toast-root {
  position: fixed; left: 0; right: 0; z-index: 70;
  bottom: calc(var(--tab-h) + var(--safe-b) + 10px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 12px; pointer-events: none;
}
.toast {
  width: 100%; max-width: 420px;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-radius: var(--radius);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  color: var(--text); font-size: .86rem; box-shadow: var(--shadow);
  animation: fade-in .16s ease-out;
}
.toast--success { border-color: color-mix(in srgb, var(--success) 50%, transparent); }
.toast--error   { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.toast--info    { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.toast__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.toast--success .toast__dot { background: var(--success); }
.toast--error   .toast__dot { background: var(--danger); }
.toast--info    .toast__dot { background: var(--accent); }

/* ------------------------------------------------------------- skeleton -- */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.skeleton-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.skeleton-row__thumb { width: 44px; height: 60px; flex: none; }
.skeleton-row__lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.skeleton-line { height: 11px; }
.skeleton-line--short { width: 45%; }
.skeleton-line--mid { width: 70%; }

.spinner {
  width: 18px; height: 18px; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-loading { display: flex; align-items: center; gap: 9px; padding: 18px; justify-content: center; color: var(--text-muted); font-size: .86rem; }

/* ------------------------------------------------------------ pagination */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.pager__info { font-size: .78rem; color: var(--text-muted); }

/* -------------------------------------------------------------- pending -- */

.pending-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.pending-row:last-child { border-bottom: 0; }
.pending-row__thumb { width: 40px; height: 54px; border-radius: 5px; overflow: hidden; background: var(--surface-3); flex: none; }
.pending-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pending-row__body { flex: 1 1 auto; min-width: 0; }
.pending-row__actions { display: flex; gap: 6px; flex: none; }

/* ----------------------------------------------------------- responsive -- */

@media (min-width: 600px) {
  .trade-cols { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: var(--radius-lg); border-bottom: 1px solid var(--border); max-height: 86dvh; }
  .sheet__foot { padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------- portfolio hero + chart -- */

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px 12px;
  overflow: hidden;
}
.hero__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; }
.hero__value {
  font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px;
}
.hero__chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.hero__note { font-size: .68rem; color: var(--text-muted); margin-top: 6px; }

.range-tabs {
  display: flex; gap: 4px; margin-top: 12px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.range-tab {
  flex: 1 1 0; min-height: 30px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-muted);
  font-size: .74rem; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.range-tab[aria-pressed="true"] { background: var(--grad); color: #fff; }

/* Charts are hand-rolled inline SVG; the SVG itself is always sized by CSS. */
.chart-wrap { position: relative; width: 100%; height: 150px; margin-top: 10px; }
.chart-wrap--spark { height: 84px; margin-top: 6px; }
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-minmax {
  position: absolute; left: 0; font-size: .64rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums; pointer-events: none;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 0 4px; border-radius: 4px;
}
.chart-minmax--max { top: 0; }
.chart-minmax--min { bottom: 0; }
.chart-caption { font-size: .7rem; color: var(--text-muted); margin-top: 6px; text-align: center; }
.chart-dot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent);
}
.chart-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--text-muted); font-size: .8rem;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.chart-empty svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ----------------------------------------------------------- movers rail -- */

.rail {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { display: none; }
.mover-card {
  flex: none; width: 118px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; text-align: left; color: inherit;
}
.mover-card:active { border-color: var(--accent); }
.mover-card__img {
  width: 100%; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
}
.mover-card__img img { width: 100%; height: 100%; object-fit: contain; }
.mover-card__name { font-size: .76rem; font-weight: 650; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover-card__price { font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mover-card__asof { font-size: .62rem; color: var(--text-muted); }

/* ---------------------------------------------------------- ranked lists -- */

.rank {
  flex: none; width: 22px; text-align: center;
  font-size: .8rem; font-weight: 800; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- inventory grid --- */

.view-toggle { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex: none; }
.view-toggle__btn {
  min-height: 34px; padding: 0 12px; border: 0; background: transparent;
  color: var(--text-muted); cursor: pointer; display: grid; place-items: center;
}
.view-toggle__btn[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.view-toggle__btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-card {
  display: flex; flex-direction: column; gap: 5px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; text-align: left; color: inherit;
  min-width: 0;
}
.grid-card:active { border-color: var(--accent); }
.grid-card__img {
  width: 100%; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
}
.grid-card__img img { width: 100%; height: 100%; object-fit: contain; }
.grid-card__name { font-size: .68rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-card__value { font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid-card__value--none { color: var(--text-muted); font-weight: 500; }
.grid-card .chip { align-self: flex-start; }

/* ------------------------------------------------------- completion bars -- */

.meter { width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 3px; background: var(--grad); }

.set-row__logo {
  flex: none; width: 56px; height: 34px; border-radius: 6px;
  background: var(--surface-3); display: grid; place-items: center; overflow: hidden;
}
.set-row__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-row__logo--empty { font-size: .62rem; color: var(--text-muted); font-weight: 700; letter-spacing: .04em; }
.set-row__meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.set-row__pct { flex: none; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-dim); }

/* ------------------------------------------------------ set detail grid --- */

.setgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.setgrid-card {
  display: flex; flex-direction: column; gap: 5px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 0;
}
.setgrid-card__img {
  width: 100%; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center; position: relative;
}
.setgrid-card__img img { width: 100%; height: 100%; object-fit: contain; }
.setgrid-card--unowned .setgrid-card__img img { opacity: .34; filter: grayscale(.7); }
.setgrid-card__owned {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--success); color: #fff; display: grid; place-items: center;
}
.setgrid-card__owned svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.setgrid-card__name { font-size: .68rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setgrid-card__num { font-size: .62rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.setgrid-card__actions { display: flex; gap: 4px; }
.setgrid-card__actions .btn { flex: 1 1 0; min-height: 28px; padding: 0 4px; font-size: .68rem; border-radius: var(--radius-sm); }

/* -------------------------------------------------------- fairness meter -- */

.fairness {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
}
.fairness__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fairness__verdict { font-size: .95rem; font-weight: 800; }
.fairness__verdict--fair { color: var(--text-dim); }
.fairness__verdict--you { color: var(--success); }
.fairness__verdict--them { color: var(--danger); }
.fairness__bar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.fairness__center { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--border-strong); }
.fairness__fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; }
.fairness__fill--you { background: var(--success); }
.fairness__fill--them { background: var(--danger); }
.fairness__scale { display: flex; justify-content: space-between; font-size: .62rem; color: var(--text-muted); margin-top: 4px; }
.fairness__note { font-size: .7rem; color: var(--text-muted); margin-top: 8px; }

/* --------------------------------------------------------------- alerts --- */

.alert-dir { display: flex; gap: 6px; }
.status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.status-dot--armed { background: var(--accent); }
.status-dot--triggered { background: var(--danger); }
.status-dot--acked { background: var(--text-muted); }

/* ------------------------------------------------------------- more hub --- */

.hub-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px; min-height: 54px;
  background: var(--surface); border: 0; border-bottom: 1px solid var(--border);
  color: inherit; text-align: left; cursor: pointer; text-decoration: none;
  font-size: .95rem; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.hub-row:last-child { border-bottom: 0; }
.hub-row:active { background: var(--surface-2); }
.hub-row__icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent);
}
.hub-row__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hub-row__body { flex: 1 1 auto; min-width: 0; }
.hub-row__sub { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 500; margin-top: 1px; }
.hub-row > svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--text-muted); }

/* ----------------------------------------------------------- segments ----- */

.seg-tabs { display: flex; gap: 4px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.seg-tab {
  flex: 1 1 0; min-height: 34px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-muted);
  font-size: .8rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.seg-tab[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg-tab__count {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: .6rem; font-weight: 800; line-height: 16px;
}

/* Light-mode courtesy: the app is dark-first, but respect an explicit light preference. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f5fa; --bg-sunken: #ffffff; --surface: #ffffff; --surface-2: #ededf6; --surface-3: #e1e1ef;
    --border: #d8d8e8; --border-strong: #bfbfd6;
    --text: #16161f; --text-dim: #3d3d52; --text-muted: #6b6b85;
    --accent-ink: #ffffff;
    --amber: #9a6d00;
    color-scheme: light;
  }
}

/* ============================================================ wave 3: batch */

.scan-drop--compact { padding: 18px 16px; }
.scan-drop--compact .scan-drop__icon svg { width: 26px; height: 26px; }

.chip--warn {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 40%, transparent);
}

.pending-row[role="button"] { cursor: pointer; }
.pending-row[role="button"]:active { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* =========================================================== wave 3: labels */

.label-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.label-pick-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.label-pick-row .row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.label-preview { overflow-x: auto; padding: 6px 0; }

/* One physical label: 2.625in × 1in. On screen the preview shows the same box
 * at CSS-inch scale with a dashed outline; in print the cells are absolutely
 * positioned on the .label-page. */
.label-cell {
  width: 2.625in;
  height: 1in;
  padding: 0.06in 0.12in;
  box-sizing: border-box;
  overflow: hidden;
  background: #fff;
  color: #000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.label-cell--preview { border: 1px dashed var(--border); border-radius: 4px; background: #fff; flex: none; }
.label-cell__name {
  font-size: 10pt; font-weight: 700; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label-cell__sub {
  font-size: 7pt; color: #444; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label-cell__row { display: flex; align-items: baseline; justify-content: space-between; }
.label-cell__price { font-size: 14pt; font-weight: 800; letter-spacing: -0.02em; }
.label-cell__code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 7pt; color: #555; }

.label-cell--cal { border: 1px dashed #999; }
.label-cell__cal { margin: auto; font-size: 9pt; color: #777; }

/* Print sheet: hidden on screen, the only thing on paper. */
#label-print-root { display: none; }
.label-page {
  position: relative;
  width: 8.5in;
  height: 11in;
  background: #fff;
  page-break-after: always;
}
.label-page .label-cell { position: absolute; }

@media print {
  @page { size: letter; margin: 0; }
  body > *:not(#label-print-root) { display: none !important; }
  #label-print-root { display: block !important; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
}

/* Suggested ask on inventory grid tiles */
.grid-card__ask {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

/* ====================================================== wave 5: typeahead */

.typeahead { position: relative; }
.typeahead__drop {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface);
  max-height: 320px;
  overflow-y: auto;
}
.typeahead__row {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.typeahead__row:last-child { border-bottom: 0; }
.typeahead__row:active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.typeahead__name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typeahead__set { color: var(--text-muted); flex: none; font-size: 12.5px; }
.typeahead__note { padding: 8px 12px; font-size: 12.5px; color: var(--text-muted); }
