/* Pokémon Trading — UI shell design system.
   Plain CSS, no CDN, no build step, no JS (the mobile menu is a <details>).
   Self-hosted Inter (variable weight; OFL licence in static/fonts/OFL.txt).
   Light theme, neutral greys, one accent colour. 8px spacing grid, 14px base
   text, tabular numerals for money, 1px borders, 6-8px radii.
   Colour pairs meet WCAG AA contrast on their backgrounds. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-subtle: #fafbfc;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;

  /* The one accent colour. */
  --accent: #3b5bdb;
  --accent-hover: #364fc7;
  --accent-tint: rgba(59, 91, 219, 0.08);

  /* Badge tones: dark text on light tinted backgrounds (AA contrast). */
  --tone-neutral-bg: #f2f4f7;
  --tone-neutral-fg: #364152;
  --tone-neutral-border: #e4e7ec;
  --tone-info-bg: #eef2ff;
  --tone-info-fg: #3538cd;
  --tone-info-border: #c7d2fe;
  --tone-warn-bg: #fffaeb;
  --tone-warn-fg: #854d0e;
  --tone-warn-border: #fedf89;
  --tone-ok-bg: #ecfdf3;
  --tone-ok-fg: #077a48;
  --tone-ok-border: #a6f4c5;
  --tone-bad-bg: #fef3f2;
  --tone-bad-fg: #b42318;
  --tone-bad-border: #fecdca;

  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);

  --sidebar-width: 232px;
  --topbar-height: 52px;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem; /* 14px base */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-width: 0;
}

h1, h2, h3 { font-weight: 600; color: var(--text); }
h2 { font-size: 0.875rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 0.8125rem; margin: 0 0 0.5rem; font-weight: 500; color: var(--text-muted); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

svg { flex-shrink: 0; }

/* Demo banner — only rendered in demo mode. */
.demo-banner {
  background: #fef0c7;
  color: #93370d;
  border-bottom: 1px solid #fedf89;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 60;
}

/* ---------- Application shell (authenticated) ---------- */

.wordmark {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }

.sidebar {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-direction: column;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  height: var(--topbar-height);
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar .nav { flex: 1; overflow-y: auto; padding: 0.5rem; }

.sidebar__footer {
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--border);
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4375rem 0.625rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.nav__icon { width: 1rem; height: 1rem; color: var(--text-muted); }

a.nav__item:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.nav__item[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 500;
}
.nav__item[aria-current="page"] .nav__icon { color: var(--accent); }

.nav__item--soon { color: var(--text-muted); cursor: not-allowed; }
.nav__item--soon .nav__icon { opacity: 0.7; }

/* Top bar. */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--topbar-height);
  padding: 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}

body.auth .topbar { display: none; }

.topbar__brand { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }

.topbar__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__brand + .topbar__title:not(:empty) {
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mobile menu (no JS: native <details>). */
.mobile-menu { position: relative; }

.mobile-menu__toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--surface);
}
.mobile-menu__toggle::-webkit-details-marker { display: none; }
.mobile-menu__toggle svg { width: 1.125rem; height: 1.125rem; }
.mobile-menu[open] .mobile-menu__toggle { background: var(--bg); }

.mobile-menu__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(17.5rem, calc(100vw - 1.5rem));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  z-index: 50;
}

.mobile-menu__signout {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Content area. */
.frame { min-width: 0; }

.content {
  max-width: 70rem;
  padding: 1.5rem 1rem 2rem;
  margin: 0 auto;
}

.content-footer {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.content-footer p { margin: 0; }

@media (min-width: 1024px) {
  body.app .sidebar { display: flex; }
  body.app .topbar { padding-left: 1.5rem; }
  body.app .topbar, body.app .frame { margin-left: var(--sidebar-width); }
  body.app .topbar__brand, body.app .mobile-menu { display: none; }
  body.app .topbar__brand + .topbar__title:not(:empty) {
    border-left: 0;
    padding-left: 0;
    color: var(--text);
    font-weight: 600;
  }
  .content { padding: 1.5rem 1.5rem 2rem; }
  .content-footer { padding: 1rem 1.5rem 2rem; }
}

.page-intro, .page-note { color: var(--text-muted); max-width: 65ch; }
.page-intro { margin: 0 0 1rem; }
.page-note { font-size: 0.8125rem; }

/* ---------- Cards and metrics ---------- */

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  min-width: 0;
}

.metric__value {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  overflow-wrap: anywhere;
}

.metric__value--empty {
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted);
}

.metric__note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Secondary original-currency display next to a DKK amount. */
.amount-original {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Data tables ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.table-card { overflow-x: auto; }
/* Tables inside panels scroll horizontally on narrow viewports instead of
   overflowing the document (375px mobile). */
.table-scroll { overflow-x: auto; max-width: 100%; }

/* Grid/flex children may not shrink below content size by default; without
   this, wide selects and tables push panels past the viewport on mobile. */
.panel, .form-field { min-width: 0; }
.form-field select { width: 100%; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-subtle);
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table .data-table__primary { font-weight: 500; }
.data-table .data-table__muted { color: var(--text-muted); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  border: 1px solid;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
}

/* Long machine tokens (e.g. missing-info codes) must wrap on narrow
   screens instead of widening the page (375px overflow, PR #48 QA). */
.badge--wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

.badge::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.badge--neutral { background: var(--tone-neutral-bg); color: var(--tone-neutral-fg); border-color: var(--tone-neutral-border); }
.badge--info { background: var(--tone-info-bg); color: var(--tone-info-fg); border-color: var(--tone-info-border); }
.badge--warn { background: var(--tone-warn-bg); color: var(--tone-warn-fg); border-color: var(--tone-warn-border); }
.badge--ok { background: var(--tone-ok-bg); color: var(--tone-ok-fg); border-color: var(--tone-ok-border); }
.badge--bad { background: var(--tone-bad-bg); color: var(--tone-bad-fg); border-color: var(--tone-bad-border); }
.badge--unknown { border-style: dashed; border-color: currentColor; }

/* ---------- Buttons and forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.375rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.btn__icon { width: 1rem; height: 1rem; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--ghost {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover { background: var(--bg); color: var(--text); }

.btn--block { display: flex; width: 100%; }

/* Sign-in (anonymous visitors). */
body.auth .frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.auth .content { width: 100%; }
body.auth .content-footer { text-align: center; border-top: 0; }

.auth-wordmark {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  max-width: 22.5rem;
  margin: 0 auto;
}

.auth-card h1 { font-size: 1rem; margin: 0 0 0.25rem; }

.auth-card__hint {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0 0 1rem;
}

.form-field { margin-bottom: 1rem; }

.form-field label {
  display: block;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-field input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.form-field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.form-field__hint {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-field__error, .form-errors {
  color: var(--tone-bad-fg);
  font-size: 0.8125rem;
}

.form-errors {
  background: var(--tone-bad-bg);
  border: 1px solid var(--tone-bad-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.form-errors p { margin: 0; }

/* ---------- Inventory and storage screens (issue #23) ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Search/filter toolbar above tables. */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.toolbar input[type="search"] {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.toolbar select,
.bulk-actions select,
.form-field select {
  padding: 0.45rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  max-width: 100%;
}

.toolbar input[type="search"]:focus-visible,
.toolbar select:focus-visible,
.bulk-actions select:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.toolbar__clear { font-size: 0.8125rem; }

/* Confirmation notices after a successful action. */
.flash {
  background: var(--tone-ok-bg);
  border: 1px solid var(--tone-ok-border);
  color: var(--tone-ok-fg);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  margin: 0 0 1rem;
}

/* Empty states inside cards. */
.empty-state { padding: 2rem 1.5rem; text-align: center; }
.empty-state h2 { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.empty-state p { margin: 0 auto; max-width: 42ch; color: var(--text-muted); }
.empty-state--slim { padding: 1.25rem 1rem; }

/* Table refinements. */
.data-table__sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.data-table__check { width: 2rem; padding-right: 0; }
.data-table__check input { accent-color: var(--accent); }

/* Bulk move bar under the inventory table. */
.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bulk-actions label { font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.bulk-actions input[type="text"] {
  flex: 1 1 10rem;
  min-width: 0;
  padding: 0.45rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

/* Breadcrumbs and detail header. */
.breadcrumbs { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.breadcrumbs span { margin: 0 0.25rem; }

.detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.detail-header__title { font-size: 1.125rem; margin: 0; }
.detail-header__sub { margin: 0.125rem 0 0; color: var(--text-muted); font-size: 0.8125rem; }
.detail-header__badges { display: flex; flex-wrap: wrap; gap: 0.375rem; }

/* Two-column panel layout on wide screens. */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .detail-grid { grid-template-columns: repeat(2, 1fr); align-items: start; }
}

.panel { padding: 1rem; min-width: 0; }
.panel__title { margin: 0 0 0.75rem; font-size: 0.875rem; }
.panel__subtitle { margin: 1rem 0 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); }
.panel__tag {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--tone-neutral-bg);
  border: 1px solid var(--tone-neutral-border);
  border-radius: 4px;
  padding: 0.0625rem 0.375rem;
  vertical-align: middle;
}

/* Key-value lists. */
.kv { margin: 0; }
.kv > div {
  display: grid;
  grid-template-columns: minmax(8rem, 2fr) 3fr;
  gap: 0.5rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-size: 0.8125rem; color: var(--text-muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Collapsible action forms (transitions, mark ready). */
.action {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: var(--surface-subtle);
}

.action summary {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
.action summary::-webkit-details-marker { display: none; }
.action summary::after {
  content: "";
  position: absolute;
  right: 0.875rem;
  top: 50%;
  width: 0.4375rem;
  height: 0.4375rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-65%) rotate(45deg);
}
.action[open] summary::after { transform: translateY(-35%) rotate(225deg); }
.action[open] summary { border-bottom: 1px solid var(--border); }
.action form, .action .form-errors { margin: 0.75rem; }

/* Form extras. */
.form-field textarea {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.form-field__hint { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--text-muted); }

.btn--danger {
  border-color: var(--tone-bad-border);
  background: var(--tone-bad-bg);
  color: var(--tone-bad-fg);
}
.btn--danger:hover { border-color: var(--tone-bad-fg); }

/* Storage tree. */
.tree { list-style: none; margin: 0; padding: 0; }

.tree__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0 0.375rem calc(var(--depth, 0) * 1.25rem);
  border-bottom: 1px solid var(--border);
}
.tree__item:last-child { border-bottom: 0; }
.tree__count { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.tree__unassigned {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Financial pause banner (accounting). */
.pause-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--tone-warn-border);
  border-radius: 10px;
  background: var(--tone-warn-bg);
}
.pause-banner__title {
  margin: 0;
  flex-basis: 100%;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tone-warn-fg);
}
.pause-banner__body {
  margin: 0;
  flex: 1 1 24rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.pause-banner__action { white-space: nowrap; }

.form-field--check label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  color: var(--text);
}
.form-field--check input[type="checkbox"] {
  width: auto;
  margin-top: 0.125rem;
  accent-color: var(--accent);
}

/* Dashboard metric annotations. */
.metric__suffix {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric__flag { display: block; color: var(--tone-warn-fg); }

/* Copy-paste Cardmarket helper (issue #57). Buttons are hidden until
   static/js/copy.js enables them; the readonly values stay selectable. */
.copy-field__row { display: flex; align-items: stretch; gap: 0.5rem; }
.copy-field__row .copy-field__value { flex: 1; min-width: 0; }
.copy-field__btn { flex: 0 0 auto; white-space: nowrap; }
.copy-field__btn--done { color: var(--tone-ok-fg, inherit); }

.checklist { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.checklist li { margin: 0.25rem 0; }
.checklist .checklist__done::marker { content: "✓ "; color: var(--tone-ok-fg, currentColor); }
.checklist .checklist__todo::marker { content: "✗ "; color: var(--tone-bad-fg, currentColor); }
.checklist .checklist__manual { list-style: none; }
.checklist .checklist__manual label { display: inline-flex; gap: 0.4rem; align-items: baseline; cursor: pointer; }

/* Offline intake (issue #68). Mobile-first: stacked panels, native inputs. */
.intake-form .panel { margin-bottom: 1rem; }
.action__body { margin: 0.75rem; }
.photo-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.photo-thumb {
  width: 7rem;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
}

/* Picking (issue #71). Mobile-first sold queue: big slot code, one-handed confirm. */
.panel__title--spaced { margin-top: 1.5rem; }
.pick-list { display: grid; grid-template-columns: 1fr; gap: 0.75rem; max-width: 40rem; }
.pick-unit__slot {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.pick-unit__body { display: flex; gap: 0.75rem; align-items: flex-start; }
.pick-unit__thumb {
  flex: 0 0 auto;
  width: 5rem;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
}
.pick-unit__thumb--empty {
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--bg);
  text-align: center;
}
.pick-unit__facts { flex: 1; min-width: 0; }
.pick-unit__id { margin: 0; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pick-unit__name { margin: 0.125rem 0 0.5rem; }
.pick-unit__identity { display: block; font-size: 0.8125rem; color: var(--text-muted); }
.pick-unit__confirm { margin-top: 0.75rem; }
.pick-unit__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick-unit__actions .btn { flex: 1 1 auto; }
.pick-unit__done { margin-top: 0.75rem; display: flex; align-items: center; gap: 0.75rem; }

/* Collection review (issue #73) */
.collection-rows__title { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0.5rem; }
.collection-row { margin-bottom: 1rem; }
.collection-row__title { display: flex; align-items: center; gap: 0.5rem; }
.collection-row__grid { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 720px) {
  .collection-row__grid { grid-template-columns: repeat(2, 1fr); }
  .collection-row__grid .form-field:first-child { grid-column: 1 / -1; }
}
.collection-row__alloc {
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}
.collection-row__tools { margin-top: 0.5rem; }
.bulk-controls { display: grid; grid-template-columns: 1fr; gap: 0.5rem 1rem; align-items: end; }
@media (min-width: 720px) {
  .bulk-controls { grid-template-columns: 1fr auto 1fr auto; }
}
.form-field div[id^="id_allocation_method"] { display: grid; gap: 0.5rem; }
.form-field div[id^="id_allocation_method"] label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 400;
}
.data-table--nowrap th,
.data-table--nowrap td { white-space: nowrap; }
.allocation-sum { font-weight: 600; }
.allocation-sum--bad { color: var(--danger, #b4232c); }
