/* ==========================================================================
   Penny General - design system
   Tokens (light) -> OS dark override -> manual [data-theme] override,
   then reset, typography and components.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e4e7ec;
  --border-strong: #cdd3dc;

  --text: #101319;
  --text-muted: #5b6472;
  --text-faint: #667085;

  --link: #1550c5;
  --link-hover: #10307a;

  /* Focus never rides the brand yellow: #f5c518 is 1.6:1 on white, under the
     3:1 WCAG 1.4.11 asks of a focus indicator. --focus is the highest-contrast
     ink in each theme instead. */
  --focus: #101319;

  --accent: #f5c518;
  --accent-contrast: #14140a;
  --accent-soft: #fff5d1;

  --ok: #14742f;
  --ok-soft: #e6f6ec;
  --warn: #9a5b06;
  --warn-soft: #fdf2e0;
  --danger: #bf2c25;
  --danger-soft: #fdecea;
  --info: #1560bd;
  --info-soft: #e9f1fd;

  /* The select chevron is an independent SVG document, so it cannot read
     currentColor - it ships once per theme, tinted like --text-faint. */
  --select-chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  /* Derived from --focus, so it re-resolves per theme without being restated. */
  --focus-ring: color-mix(in srgb, var(--focus) 22%, transparent);
  --shadow-sm: 0 1px 2px rgba(16, 19, 25, 0.06), 0 1px 3px rgba(16, 19, 25, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 19, 25, 0.05), 0 10px 26px rgba(16, 19, 25, 0.09);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0c0e13;
    --surface: #14171e;
    --surface-2: #1c202a;
    --border: #262b36;
    --border-strong: #3a414f;

    --text: #e8ebf2;
    --text-muted: #9aa3b3;
    --text-faint: #828d9f;

    --link: #8ab4f8;
    --link-hover: #b8d1fb;

    --focus: #e8ebf2;

    --accent: #f5c518;
    --accent-contrast: #14140a;
    --accent-soft: #2c2611;

    --ok: #4ade80;
    --ok-soft: #10251a;
    --warn: #fbbf24;
    --warn-soft: #2a2110;
    --danger: #fb7185;
    --danger-soft: #2d1519;
    --info: #60a5fa;
    --info-soft: #101f36;

    --select-chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%23828d9f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 30px rgba(0, 0, 0, 0.45);
  }
}

/* Manual choice wins over the OS preference. */
html[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e4e7ec;
  --border-strong: #cdd3dc;

  --text: #101319;
  --text-muted: #5b6472;
  --text-faint: #667085;

  --link: #1550c5;
  --link-hover: #10307a;

  --focus: #101319;

  --accent: #f5c518;
  --accent-contrast: #14140a;
  --accent-soft: #fff5d1;

  --ok: #14742f;
  --ok-soft: #e6f6ec;
  --warn: #9a5b06;
  --warn-soft: #fdf2e0;
  --danger: #bf2c25;
  --danger-soft: #fdecea;
  --info: #1560bd;
  --info-soft: #e9f1fd;

  --select-chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --shadow-sm: 0 1px 2px rgba(16, 19, 25, 0.06), 0 1px 3px rgba(16, 19, 25, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 19, 25, 0.05), 0 10px 26px rgba(16, 19, 25, 0.09);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c0e13;
  --surface: #14171e;
  --surface-2: #1c202a;
  --border: #262b36;
  --border-strong: #3a414f;

  --text: #e8ebf2;
  --text-muted: #9aa3b3;
  --text-faint: #828d9f;

  --link: #8ab4f8;
  --link-hover: #b8d1fb;

  --focus: #e8ebf2;

  --accent: #f5c518;
  --accent-contrast: #14140a;
  --accent-soft: #2c2611;

  --ok: #4ade80;
  --ok-soft: #10251a;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --danger: #fb7185;
  --danger-soft: #2d1519;
  --info: #60a5fa;
  --info-soft: #101f36;

  --select-chevron: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%23828d9f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; width: 100%; }

main.container,
main > .container { padding-bottom: 48px; }

img,
svg { max-width: 100%; }

img { height: auto; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Body links carry their own colour: at --text they were indistinguishable from
   the prose around them, and the old --border-strong underline was 1.5:1. */
a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, currentColor 60%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

:where(a, button, .btn, summary, [tabindex]):focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  margin: 0 0 8px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.011em;
  color: var(--text);
}

/* One scale, ~1.25 ratio: 13 / 15 / 18 / 20 / 28 / 34. h2 is declared here and
   nowhere else, so a section heading has the same rank on every page. */
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 0.9375rem; }

p { margin: 0 0 12px; }

strong { font-weight: 600; }

small { font-size: 0.8125rem; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  letter-spacing: 0;
}

.muted { color: var(--text-muted); }

.fineprint {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow { max-width: 780px; }

/* Data-heavy admin pages (sources, items, dashboard) use the whole viewport:
   a nine-column table has no business scrolling sideways on a desktop while
   200px of empty page sits on either side. */
.container.wide { max-width: none; padding-inline: 24px; }

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.container > .page-title { margin: 28px 0 20px; }

.page-head,
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 16px;
}

.page-head > .page-title,
.page-head > h1,
.page-head > h2,
.panel-head > .page-title,
.panel-head > h1,
.panel-head > h2 { margin: 0; }

.panel-head > h2 { color: var(--text); }

.page-head .btn-row,
.panel-head .btn-row { margin-top: 0; margin-bottom: 0; }

.crumbs {
  margin: 20px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.crumbs a { color: var(--text-muted); }

.crumbs a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   5. Header + navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Admin gets a thin accent rail so you always know which side you are on. */
.site-header.admin-header { box-shadow: inset 0 2px 0 var(--accent); }

.site-header > .container,
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.015em;
  border-radius: var(--radius);
}

.brand:hover { color: var(--text); }

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}

.brand-badge.big {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  font-size: 1.15rem;
  margin: 0 auto 14px;
}

.admin-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.nav-link,
.site-nav a,
.site-nav .linklike {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-link:hover,
.site-nav a:hover,
.site-nav .linklike:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.is-active,
.nav-link[aria-current="page"],
.site-nav a.is-active,
.site-nav a.active,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 600;
}

.inline-form { display: inline-flex; }

.linklike {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

/* Theme toggle -------------------------------------------------------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  overflow: hidden;
}

/* Light is a dot inside the ring, not an empty ring: with the label hidden at
   mobile widths an empty circle reads as an unchecked radio button. */
.theme-toggle-icon::before {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: currentColor;
}

.theme-toggle[data-mode="dark"] .theme-toggle-icon { background: currentColor; }

.theme-toggle[data-mode="system"] .theme-toggle-icon::before { display: none; }

.theme-toggle[data-mode="system"] .theme-toggle-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  clip-path: inset(0 0 0 50%);
}

.theme-toggle-text { letter-spacing: 0.01em; }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease,
    box-shadow 120ms ease, transform 80ms ease, opacity 120ms ease;
}

.btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  filter: brightness(0.95);
}

.btn-danger {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text);
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-block { width: 100%; }

/* Symmetric margins: without the bottom one the primary action sat flush
   against the help text underneath it. */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.btn-row form { display: inline-flex; }

.card-body > .btn-row:last-child,
.provider-body > .btn-row:last-child { margin-bottom: 0; }

@media (pointer: coarse) {
  .btn-sm { min-height: 40px; padding: 0 14px; }
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

label .fineprint {
  font-weight: 400;
  margin-left: 2px;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
select,
textarea {
  display: block;
  width: 100%;
  max-width: var(--field-max-width, 100%);
  min-height: 38px;
  padding: 8px 12px;
}

/* Utility for a field that should stay short (a store number, a page size).
   Set through a custom property so it lands regardless of selector weight. */
.input-narrow { --field-max-width: 8rem; }

textarea {
  min-height: 84px;
  line-height: 1.5;
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}

input::placeholder,
textarea::placeholder { color: var(--text-faint); }

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) { border-color: var(--border-strong); }

/* Text-like controls only: checkboxes and radios keep a real outline (see the
   :focus-visible rule in the base layer) instead of a square halo. The filter
   sits in :where() so this rule keeps the weight plain `input:focus` had, and
   .input-invalid still outranks it. */
input:where(:not([type="checkbox"]):not([type="radio"])):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--surface-2);
}

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  flex: none;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.input-invalid,
input.input-invalid,
select.input-invalid,
textarea.input-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field { margin-bottom: 18px; }

.field > .fineprint { margin: 6px 0 0; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 14px 0;
}

/* A provider card is only ~340px wide, so two columns inside it means two
   146px fields: labels wrap out of line with each other and placeholders
   truncate mid-token. Inside a card the pair always stacks. */
.provider-body .two-col { grid-template-columns: minmax(0, 1fr); }

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.check-label:hover { border-color: var(--border-strong); }

fieldset {
  margin: 20px 0;
  padding: 4px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

legend {
  padding: 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Vertical rhythm for stacked label/control pairs: any label that follows a
   sibling gets top spacing, the first one in its box never does. */
.form-card * + label:not(.check-label),
.login-card * + label:not(.check-label),
.provider-body * + label:not(.check-label),
fieldset * + label:not(.check-label) { margin-top: 16px; }

.form-card .fineprint,
fieldset .fineprint { margin-top: 6px; }

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-controls input,
.inline-controls select {
  width: auto;
  min-width: 0;
  min-height: 36px;
  font-size: 0.875rem;
}

/* Controls sitting on one row share a height (declared after the button
   section so it wins the tie, and re-stated for coarse pointers). */
.inline-controls .btn-sm { min-height: 36px; }

@media (pointer: coarse) {
  .inline-controls .btn-sm,
  .inline-controls input,
  .inline-controls select { min-height: 40px; }
}

.inline-controls input[type="search"],
.inline-controls input[type="text"] { flex: 1 1 200px; }

.inline-controls label { margin: 0; }

.filter-bar { margin: 0 0 16px; }

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}

.search-form input[type="search"],
.search-form input[type="text"] {
  flex: 1 1 240px;
  min-height: 40px;
}

.search-form select,
.filter-select {
  flex: 0 1 auto;
  width: auto;
  min-height: 40px;
}

.search-form .btn { min-height: 40px; }

/* --------------------------------------------------------------------------
   8. Cards + panels
   -------------------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.card-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.card-body { padding: 20px; }

.form-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}

.form-card > h2:first-child,
.form-card > h2 { margin-top: 0; }

.form-card > p:last-child,
.form-card > .fineprint:last-child { margin-bottom: 0; }

.form-card .btn-row:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */

.table-wrap,
.table-scroll {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

/* A `width: 100%` table always fits its wrapper, so the wrapper's overflow-x
   never engages and the browser resolves a nine-column layout by crushing
   columns instead. A min-width makes the wrapper scroll, which is the point of
   having one. `separate` (with zero spacing, so it looks identical) is what
   lets the first column stick while the rest scrolls under it. */
.table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: 0.875rem;
}

.table-wide { min-width: 1040px; }

/* In a full-width container there is room for every column, so drop the
   min-width that exists to make narrow viewports scroll, and let the cells
   share the space instead. */
.container.wide .table,
.container.wide .table-wide { min-width: 0; }
.container.wide .table-wrap { overflow-x: visible; }

/* Column sizing for the sources table: the long free-text columns (URL,
   status/error) absorb the slack, everything else takes what it needs. */
.container.wide .url-cell { max-width: none; width: 26%; }
.container.wide .err-cell { max-width: none; }
.container.wide .table th,
.container.wide .table td { padding-inline: 10px; }
/* A name like "Penny Pinchin' Mom" was wrapping to three lines and setting the
   row height; give it room to sit on one or two. */
.container.wide .table td:first-child { min-width: 9.5rem; }

.table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.table thead + tbody tr:first-child td { border-top: 0; }

/* Frozen first column: the name of the row you are about to act on must not
   scroll away before you reach the Actions cell. */
.table th:first-child,
.table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

.table th:first-child {
  z-index: 2;
  background: var(--surface-2);
}

.table tbody tr { transition: background-color 100ms ease; }

.table tbody tr:hover { background: var(--surface-2); }

.table tbody tr:hover td:first-child { background: var(--surface-2); }

.row-disabled td { opacity: 0.55; }

.table-empty,
.table td.table-empty,
.table td.muted {
  color: var(--text-muted);
  text-align: center;
  padding: 32px 14px;
}

/* A full-width empty row is not a column: it must not freeze. */
.table td.table-empty,
.table td.muted {
  position: static;
  box-shadow: none;
}

.url-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
}

/* One line with an ellipsis (the full text is on the cell's title): wrapped,
   an error message turned into ten single-word lines and set the row height
   for the whole table. */
.err-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--danger);
  font-size: 0.8125rem;
}

/* Buttons stay on one line so the Actions column stops driving row height. */
.actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.actions form { display: inline-flex; }

/* --------------------------------------------------------------------------
   10. Status pills + badges
   -------------------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-error { background: var(--danger-soft); color: var(--danger); }
.status-skipped { background: var(--surface-2); color: var(--text-muted); }
.status-running { background: var(--info-soft); color: var(--info); }

.status-running::before { animation: penny-pulse 1.4s ease-in-out infinite; }

@keyframes penny-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.badge,
.count-pill,
.mode-pill,
.loc-badge,
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.count-pill { letter-spacing: 0.01em; }

.mode-pill {
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.loc-badge {
  background: var(--info-soft);
  border-color: transparent;
  color: var(--info);
}

.price-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* Penny yellow means "this rings up for a cent". A $1 deal or a markdown is a
   normal price and gets a neutral chip. */
.price-badge.is-neutral {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-markdown {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.type-deal {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

/* --------------------------------------------------------------------------
   11. Alerts
   -------------------------------------------------------------------------- */

.alert,
.banner {
  display: block;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.alert p:last-child,
.banner p:last-child { margin-bottom: 0; }

.alert-ok,
.banner-ok {
  background: var(--ok-soft);
  border-color: transparent;
  border-left-color: var(--ok);
}

.alert-warn,
.banner-warn {
  background: var(--warn-soft);
  border-color: transparent;
  border-left-color: var(--warn);
}

.alert-error,
.banner-err {
  background: var(--danger-soft);
  border-color: transparent;
  border-left-color: var(--danger);
}

.alert-info {
  background: var(--info-soft);
  border-color: transparent;
  border-left-color: var(--info);
}

/* --------------------------------------------------------------------------
   12. Stats
   -------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

/* Inside a card the card's own padding is the bottom margin. */
.card-body > .stat-grid:last-child { margin-bottom: 0; }

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.stat:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.stat-num {
  font-size: 1.375rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   13. Item cards
   -------------------------------------------------------------------------- */

.item-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.item-card,
.grid > .card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.item-card:hover,
.grid > .card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.item-img,
.card-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  padding: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.item-img img,
.card-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

html[data-theme="dark"] .item-img img,
html[data-theme="dark"] .card-media img { mix-blend-mode: normal; }

@media (prefers-color-scheme: dark) {
  .item-img img,
  .card-media img { mix-blend-mode: normal; }
}

html[data-theme="light"] .item-img img,
html[data-theme="light"] .card-media img { mix-blend-mode: multiply; }

/* Image element carrying .item-img directly (no media wrapper). */
img.item-img {
  display: block;
  width: 100%;
  height: 132px;
  padding: 12px;
  object-fit: contain;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.penny-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 800;
  font-size: 1rem;
}

/* The 1c coin is a claim about the price. Items that are not penny items get a
   neutral mark instead of one that contradicts their own badge. */
.penny-placeholder.is-neutral {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9375rem;
}

.card-media + .card-body,
.item-card .card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}

.item-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.008em;
  overflow-wrap: anywhere;
}

.item-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.meta-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.item-meta dt {
  min-width: 34px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.item-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.source-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   14. AI provider cards
   -------------------------------------------------------------------------- */

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin: 16px 0 20px;
}

.provider-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.provider-card:hover { border-color: var(--border-strong); }

/* A real border, not an inset shadow: the shadow painted underneath the
   opaque .provider-head, so the enabled rail started halfway down the card. */
.provider-card.is-on {
  border-color: var(--border-strong);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.provider-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.provider-card.is-on .provider-head { background: var(--accent-soft); }

/* On the tinted enabled header a soft-tinted pill loses its shape (--warn-soft
   on --accent-soft is 1.01:1); an outline in its own colour brings it back. */
.provider-card.is-on .provider-head .status { border: 1px solid currentColor; }

.provider-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--text);
}

/* A per-provider monogram: five identical shells differing only by a 15px
   title string are not scannable. */
.provider-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.provider-card.is-on .provider-mark {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-contrast);
}

.provider-body {
  display: block;
  padding: 16px;
}

/* Fieldset markup variant of a provider card. */
fieldset.ai-provider {
  margin: 16px 0;
  padding: 6px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

fieldset.ai-provider:hover { border-color: var(--border-strong); }

fieldset.ai-provider > legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  margin-left: -4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

fieldset.ai-provider:has(input[type="checkbox"]:checked) {
  border-color: var(--border-strong);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

fieldset.ai-provider:has(input[type="checkbox"]:checked) > legend {
  background: var(--accent-soft);
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   15. Public pages
   -------------------------------------------------------------------------- */

.hero { padding: 32px 0 4px; }

.hero h1 {
  margin: 0 0 6px;
  font-size: 2.125rem;
  letter-spacing: -0.025em;
}

.hero .sub {
  margin: 0 0 4px;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 1rem;
}

.list-group { margin: 4px 0 40px; }

.list-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.list-group-head h2 { margin: 0; }

/* Underlined at rest, not only on hover: hover never fires on touch. */
.minor-link {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: underline;
}

.minor-link:hover { color: var(--text); }

.more-link {
  margin: 8px 0 32px;
  font-size: 0.875rem;
  font-weight: 500;
}

.more-link a { color: var(--text-muted); text-decoration: underline; }

.more-link a:hover { color: var(--text); }

.date-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.date-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 120ms ease, background-color 120ms ease;
}

.date-list li:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.date-list a {
  font-weight: 600;
  text-decoration: none;
}

.date-list a:hover { text-decoration: underline; }

.pager,
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 40px;
}

.pager-status {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* A solid, filled panel: the dashed outline read as a drop zone or an unbuilt
   placeholder rather than a designed state. */
.empty-state,
.empty {
  margin: 20px 0 32px;
  padding: 40px 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
}

.empty-state p:last-child,
.empty p:last-child { margin-bottom: 0; }

/* The headline is the one thing here that should read at full strength; the
   container's muted colour is for the explanation under it. */
.empty-state .page-title,
.empty .page-title {
  margin: 0 0 8px;
  color: var(--text);
}

.prose {
  max-width: 72ch;
  line-height: 1.7;
}

article.prose h2 { margin: 32px 0 8px; }

article.prose p,
article.prose li { color: var(--text); }

article.prose ul {
  padding-left: 1.25rem;
  margin: 0 0 12px;
}

article.prose li { margin-bottom: 6px; }

article.prose .muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   16. Login
   -------------------------------------------------------------------------- */

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.login-card h1 {
  margin: 0 0 20px;
  font-size: 1.375rem;
}

.login-card label {
  text-align: left;
  margin-top: 16px;
}

.login-card input[type="password"] { margin-bottom: 20px; }

.login-card .btn-block { margin-top: 4px; }

.login-card .fineprint { margin: 16px 0 0; }

.login-card .fineprint a { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  flex: none;
  margin-top: 0;
  padding: 28px 0 32px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer p { margin: 0 0 6px; }

.site-footer .disclaimer {
  color: var(--text);
  font-weight: 600;
}

.site-footer .footer-links { margin-top: 10px; }

.site-footer .footer-links a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: underline;
}

.site-footer .footer-links a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  /* Not enough room for every column: restore the scrolling wrapper. */
  .container.wide { padding-inline: 16px; }
  .container.wide .table-wrap { overflow-x: auto; }
  .container.wide .table-wide { min-width: 1040px; }
  .container.wide .url-cell { max-width: 220px; }
}

@media (max-width: 860px) {
  .site-header > .container,
  .header-inner {
    justify-content: flex-start;
    row-gap: 4px;
  }

  .site-nav { margin-left: auto; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .two-col { grid-template-columns: minmax(0, 1fr); }

  .hero { padding-top: 24px; }

  .hero h1 { font-size: 1.75rem; }

  h1,
  .page-title { font-size: 1.5rem; }

  .item-grid,
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

  .item-img,
  .card-media { height: 108px; }

  .provider-grid { grid-template-columns: minmax(0, 1fr); }

  .form-card { padding: 18px 16px; }

  .site-header { position: static; }

  .site-nav { gap: 0; margin-left: 0; }

  .nav-link,
  .site-nav a,
  .site-nav .linklike { padding: 0 10px; font-size: 0.85rem; }

  .theme-toggle { padding: 0 10px; }

  .theme-toggle-text { display: none; }
}

@media (max-width: 420px) {
  .search-form .btn { flex: 1 1 auto; }
}

/* --------------------------------------------------------------------------
   19. Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .item-card:hover,
  .grid > .card:hover,
  .btn:active { transform: none; }
}

/* ------------------------------------------------------------------ */
/* Product detail dialog                                               */
/* ------------------------------------------------------------------ */

/* A card advertises itself as openable: pointer, lift on hover, and the same
   focus ring every other control uses (it is role="button", tabindex="0"). */
.item-card.is-clickable { cursor: pointer; }
.item-card.is-clickable:focus-visible {
  outline: var(--focus-ring-width, 3px) solid var(--focus-ring, var(--accent));
  outline-offset: 2px;
}

.item-dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.item-dialog::backdrop { background: rgb(0 0 0 / 0.55); backdrop-filter: blur(2px); }

.item-dialog-inner { position: relative; display: flex; flex-direction: column; max-height: inherit; }

.item-dialog-close {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; padding: 0;
  font-size: 1.5rem; line-height: 1;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer;
}
.item-dialog-close:hover { background: var(--surface-2); border-color: var(--border-strong); }

.item-dialog-media {
  display: grid; place-items: center;
  min-height: 220px; max-height: 46vh; padding: 1.25rem;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.item-dialog-media img { max-width: 100%; max-height: 42vh; object-fit: contain; }
/* No image (or a broken one): show the penny mark rather than an empty well. */
.item-dialog-media.is-empty::after {
  content: "1\00A2";
  font-size: 3rem; font-weight: 700; color: var(--text-faint);
}

.item-dialog-body { padding: 1.25rem; overflow-y: auto; }
.item-dialog-type { display: inline-block; margin-bottom: .5rem; }
.item-dialog-title { margin: 0 0 .5rem; font-size: 1.25rem; line-height: 1.3; }
.item-dialog-price {
  display: inline-block; margin-bottom: 1rem;
  padding: .3rem .7rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1.05rem;
  color: var(--accent-contrast); background: var(--accent);
}
.item-dialog-price.is-neutral { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }

.item-dialog-meta { display: grid; gap: .5rem; margin: 0; }
.item-dialog-meta .meta-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .5rem 0; border-top: 1px solid var(--border);
}
.item-dialog-meta dt { color: var(--text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.item-dialog-meta dd { margin: 0; text-align: right; word-break: break-word; }

@media (max-width: 480px) {
  .item-dialog { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .item-dialog-meta .meta-row { flex-direction: column; gap: .15rem; }
  .item-dialog-meta dd { text-align: left; }
}
