/* Preiswächter · design system taken over from Tuck (tuck-web DESIGN.md, frontend/src/style.css,
   static/tuck/account.css): same tokens, fonts, weights, breakpoints (24/40/64 rem) and focus rule. */
@font-face {
  font-family: "Figtree Variable";
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Gabarito Variable";
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/gabarito-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Figtree Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 100.7%;
  ascent-override: 94.4%;
  descent-override: 24.8%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Gabarito Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold");
  size-adjust: 93.4%;
  ascent-override: 100.6%;
  descent-override: 27.8%;
  line-gap-override: 0%;
}
:root {
  --display: "Gabarito Variable", Gabarito, "Gabarito Fallback", system-ui, sans-serif;
  --sans: "Figtree Variable", Figtree, "Figtree Fallback", system-ui, sans-serif;
  --paper: #fff7ee;
  --surface: #ffffff;
  --raised: #fffcf8;
  --ink: #1c1a33;
  --muted: #5e5a78;
  --line: #f0e4d6;
  --edge: #7d7996;
  --soft: #f7ecdf;
  --brand: #ff6a2b;
  --money: #0a7a4d;
  --notice: #c22f1f;
  --go: #0f7a55;
  --ongo: #ffffff;
  --bar: #1c1a33;
  --onbar: #fff7ee;
  --h0: #e0561a;
  --t0: #ffe3d2;
  --h1: #2f6fe0;
  --t1: #dcecff;
  --h2: #0f8f57;
  --t2: #d5f4e3;
  --h3: #6a4ee0;
  --t3: #e9e0ff;
  --h4: #0e7c86;
  --t4: #d3f2f2;
  --h5: #d63367;
  --t5: #ffdde7;
  /* Chart series, validated for colour-vision deficiency against --surface (dataviz validator). */
  --series-a: #2f6fe0;
  --series-b: #e0561a;
  --grid: #f0e4d6;
  --shadow: 0 18px 40px -18px rgb(28 26 51 / 0.35);
  --shadow-sm: 0 6px 18px -10px rgb(28 26 51 / 0.3);
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --r-xs: 4px;
  --pill: 999px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;
  --gap-label: var(--space-2);
  --gap-field: var(--space-4);
  --gap-card: var(--space-4);
  --pad-card: var(--space-5);
  --gap-section: var(--space-7);
  --gutter: clamp(var(--space-4), 4vw, var(--space-7));
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(2.25rem, 7vw, 3rem);
  --focus-width: 3px;
  --focus-color: var(--brand);
  --focus-offset: 3px;
  --control: 3rem;
  --chip: 2.25rem;
  --icon-btn: 2.75rem;
  color-scheme: light;
}
@media (min-width: 40rem) {
  :root {
    --pad-card: var(--space-6);
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12111f;
    --surface: #1d1b30;
    --raised: #232039;
    --ink: #f5f3ff;
    --muted: #aba7c7;
    --line: #2c2a45;
    --edge: #6f6b8f;
    --soft: #25223b;
    --brand: #ff8a55;
    --money: #3ddc97;
    --notice: #ff8f80;
    --go: #3ddc97;
    --ongo: #0b2117;
    --bar: #0c0b16;
    --onbar: #f5f3ff;
    --h0: #ff8a55;
    --t0: #3a2418;
    --h1: #6aa6ff;
    --t1: #172a47;
    --h2: #3ddc97;
    --t2: #143427;
    --h3: #a28cff;
    --t3: #28204a;
    --h4: #4dd4dc;
    --t4: #12333a;
    --h5: #ff73a2;
    --t5: #3e1b2a;
    --series-a: #4f8ff0;
    --series-b: #ef7034;
    --grid: #2c2a45;
    --shadow: 0 18px 40px -18px rgb(0 0 0 / 0.7);
    --shadow-sm: 0 6px 18px -10px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(60rem 30rem at 110% -10%, var(--t0), transparent 60%),
    radial-gradient(50rem 30rem at -20% 110%, var(--t3), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font: 450 var(--text-md)/1.5 var(--sans);
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
button,
.btn {
  hyphenate-limit-chars: 10 4 4;
  text-wrap: balance;
}
h1 {
  font: 700 var(--text-2xl) / 1.05 var(--display);
  letter-spacing: -0.03em;
  margin: 0;
}
@media (min-width: 40rem) {
  h1 {
    font-size: var(--text-3xl);
  }
}
h2 {
  font: 650 var(--text-xl)/1.2 var(--display);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
}
h3 {
  font: 650 var(--text-lg)/1.25 var(--display);
  margin: 0;
}
p {
  margin: 0 0 var(--space-4);
}
a {
  color: inherit;
  font-weight: 600;
  text-underline-offset: 0.2em;
}
code,
.wrap-any {
  overflow-wrap: anywhere;
  hyphens: manual;
}
:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
  font-size: var(--text-sm);
}
.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Frame ---------- */
.top,
main {
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.top {
  min-height: 4.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  padding-block: var(--space-3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--icon-btn);
  text-decoration: none;
  font: 700 var(--text-xl)/1 var(--display);
  letter-spacing: -0.03em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-sm);
  background: var(--bar);
  color: var(--onbar);
}
.brand-mark circle {
  fill: var(--brand);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-box: fill-box;
}
.brand:hover .brand-mark circle {
  transform: translateY(25%);
}
main {
  padding-bottom: var(--space-8);
  display: grid;
  gap: var(--gap-section);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--pad-card);
  box-shadow: var(--shadow-sm);
}
.card > :last-child {
  margin-bottom: 0;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}
.section-head h2 {
  margin: 0;
}

/* Status: the indigo card from Tuck's balance view, with warm light spots. */
.status {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: var(--pad-card);
  background:
    radial-gradient(22rem 12rem at 100% 0%, rgb(255 106 43 / 0.35), transparent 70%),
    radial-gradient(18rem 10rem at 0% 120%, rgb(162 140 255 / 0.3), transparent 70%),
    var(--bar);
  color: var(--onbar);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 64rem) {
  .status {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}
.overline {
  margin: 0 0 var(--space-2);
  font: 700 var(--text-xs)/1.2 var(--sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}
.status h1 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.dot {
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--edge);
  box-shadow: 0 0 0 4px rgb(255 255 255 / 0.12);
}
.s-ok .dot {
  background: #3ddc97;
}
.s-warn .dot {
  background: #ffb020;
}
.s-fail .dot {
  background: #ff8f80;
}
.status-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
}
.status-facts div {
  display: grid;
}
.status-facts dt {
  opacity: 0.75;
}
.status-facts dd {
  margin: 0;
  font-weight: 600;
}
.status-msg {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / 0.1);
  max-width: 48rem;
}
.busy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.busy::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* ---------- Buttons and actions ---------- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control);
  padding: var(--space-2) var(--space-6);
  border: 2px solid var(--go);
  border-radius: var(--pill);
  background: var(--go);
  color: var(--ongo);
  font: 600 var(--text-md)/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
button.secondary,
.btn.secondary {
  border-color: var(--edge);
  background: transparent;
  color: var(--ink);
}
button.secondary:hover,
.btn.secondary:hover {
  background: var(--soft);
}
button.danger {
  border-color: var(--notice);
  background: transparent;
  color: var(--notice);
}
button.brand-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #1c1a33;
}
.status button.secondary {
  border-color: rgb(255 255 255 / 0.5);
  color: var(--onbar);
}
.status button.secondary:hover {
  background: rgb(255 255 255 / 0.1);
}
form {
  margin: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.actions > form {
  display: contents;
}
/* Tuck's rule: in narrow boxes every action takes the full width, the main one first. */
@media (max-width: 40rem) {
  .actions > *,
  .actions > form > button {
    flex: 1 1 100%;
  }
}

/* ---------- Fields ---------- */
.fields {
  display: grid;
  gap: var(--gap-field);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
.field {
  display: grid;
  gap: var(--gap-label);
  align-content: start;
}
.field.wide {
  grid-column: 1 / -1;
}
label {
  font-weight: 600;
  font-size: var(--text-sm);
}
input:not([type="checkbox"], [type="radio"], [type="hidden"]),
select {
  width: 100%;
  min-height: var(--control);
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--edge);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  font: 450 var(--text-md)/1.3 var(--sans);
}
input[type="checkbox"] {
  width: 1.3rem;
  height: 1.3rem;
  accent-color: var(--brand);
}
.check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--icon-btn);
}
.help {
  color: var(--muted);
  font-size: var(--text-sm);
}
.form-error {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--notice) 14%, var(--surface));
  color: var(--ink);
  font-weight: 600;
}
.add-form .actions {
  margin-top: var(--space-5);
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  gap: var(--gap-card);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}
.product {
  --h: var(--h1);
  --t: var(--t1);
  position: relative;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.product:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.hue-0 {
  --h: var(--h0);
  --t: var(--t0);
}
.hue-1 {
  --h: var(--h1);
  --t: var(--t1);
}
.hue-2 {
  --h: var(--h2);
  --t: var(--t2);
}
.hue-3 {
  --h: var(--h3);
  --t: var(--t3);
}
.hue-4 {
  --h: var(--h4);
  --t: var(--t4);
}
.hue-5 {
  --h: var(--h5);
  --t: var(--t5);
}
.product-head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.badge-letter {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--icon-btn);
  height: var(--icon-btn);
  border-radius: var(--r-sm);
  background: var(--t);
  color: var(--ink);
  font: 700 var(--text-lg)/1 var(--display);
  box-shadow: inset 0 0 0 2px var(--h);
}
.product-head h3 a {
  text-decoration: none;
}
.product-head h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}
.price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}
.price strong {
  font: 700 var(--text-2xl)/1 var(--display);
  letter-spacing: -0.02em;
}
.delta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}
.delta.down {
  color: var(--money);
}
.delta.up {
  color: var(--notice);
}
.tiles {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr));
  margin: 0;
}
.tile {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-md);
  background: var(--soft);
}
.tile dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}
.tile dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 1.75rem;
  padding: 0 var(--space-3);
  border-radius: var(--pill);
  background: var(--soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}
.chip.hit {
  background: color-mix(in srgb, var(--money) 18%, var(--surface));
  color: var(--ink);
}
.chip.warn {
  background: color-mix(in srgb, var(--notice) 16%, var(--surface));
  color: var(--ink);
}
.chip svg {
  width: 0.9rem;
  height: 0.9rem;
}
.spark {
  display: block;
  width: 100%;
  height: 3.5rem;
}
.spark path {
  fill: none;
  stroke: var(--series-a);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.spark circle {
  fill: var(--series-a);
  stroke: var(--surface);
  stroke-width: 2;
}
.empty {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  padding: var(--space-7) var(--pad-card);
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
}

/* ---------- Charts ---------- */
.chart-wrap {
  position: relative;
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid-line {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart .axis-text {
  fill: var(--muted);
  font: 450 var(--text-xs) var(--sans);
  font-variant-numeric: tabular-nums;
}
.chart .end-text {
  fill: var(--ink);
  font: 600 var(--text-xs) var(--sans);
  font-variant-numeric: tabular-nums;
}
.chart .series {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.series-a {
  stroke: var(--series-a);
  fill: var(--series-a);
}
.series-b {
  stroke: var(--series-b);
  fill: var(--series-b);
}
.chart .series.series-a,
.chart .series.series-b {
  fill: none;
}
.chart .end-dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.chart .crosshair {
  stroke: var(--edge);
  stroke-width: 1;
}
.chart .hover-dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.key {
  width: 1rem;
  height: 0.2rem;
  border-radius: var(--pill);
}
.key.a {
  background: var(--series-a);
}
.key.b {
  background: var(--series-b);
}
.tooltip {
  position: absolute;
  top: 0;
  pointer-events: none;
  min-width: 11rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.tooltip[hidden] {
  display: none;
}
.tooltip b {
  display: block;
  margin-bottom: var(--space-1);
}
.tooltip div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.tooltip div span:last-child {
  margin-left: auto;
  font-weight: 600;
}

/* ---------- Tables (Tuck Betrieb) ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
thead th {
  background: var(--soft);
  color: var(--muted);
  font: 700 var(--text-xs)/1.2 var(--sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-wrap: balance;
  hyphens: manual;
}
td.r,
th.r {
  text-align: right;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--raised);
}
@media (max-width: 40rem) {
  .table-wrap {
    border: 0;
    background: none;
    overflow: visible;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
  }
  thead {
    display: none;
  }
  tr {
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
  }
  td,
  td.r {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-2) 0;
    text-align: right;
  }
  td:last-child {
    border-bottom: 0;
  }
  td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    text-align: left;
  }
}

/* ---------- Alerts ---------- */
.feed {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.feed li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-1) var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: var(--soft);
}
.feed .icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--t2);
  color: var(--h2);
}
.feed .icon.session {
  background: var(--t0);
  color: var(--h0);
}
.feed .icon svg {
  width: 1rem;
  height: 1rem;
}
.feed time {
  grid-column: 2;
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ---------- Detail page ---------- */
.crumbs {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
}
.detail-head {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 64rem) {
  .two {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--gap-card);
    align-items: start;
  }
}
.two > * + * {
  margin-top: var(--gap-card);
}
@media (min-width: 64rem) {
  .two > * + * {
    margin-top: 0;
  }
}
details summary {
  cursor: pointer;
  font-weight: 600;
  min-height: var(--icon-btn);
  display: flex;
  align-items: center;
}
.history-log {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  opacity: 0.85;
}
footer.foot {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-7);
  color: var(--muted);
  font-size: var(--text-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
ul.grid {
  margin: 0;
  padding: 0;
  list-style: none;
}
.empty p {
  margin: 0;
}
[data-gap] {
  margin-top: var(--gap-card);
}
.actions.spaced {
  margin-top: var(--space-5);
}
[data-hover][hidden] {
  display: none;
}
td.r {
  white-space: nowrap;
}

/* ---------- App shell (server version) ---------- */
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--pill);
  background: var(--surface);
}
.top {
  padding-top: max(var(--space-3), env(safe-area-inset-top));
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--icon-btn);
  padding: 0 var(--space-4);
  border-radius: var(--pill);
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.nav a:hover {
  color: var(--ink);
  background: var(--soft);
}
.nav a[aria-current="page"] {
  background: var(--bar);
  color: var(--onbar);
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 var(--space-1);
  border-radius: var(--pill);
  background: var(--brand);
  color: #1c1a33;
  font-size: var(--text-xs);
  font-weight: 700;
}
/* On phones the navigation becomes Tuck's floating bar at the bottom. */
@media (max-width: 40rem) {
  .nav {
    position: fixed;
    z-index: 5;
    left: var(--space-3);
    right: var(--space-3);
    bottom: max(var(--space-3), env(safe-area-inset-bottom));
    justify-content: space-between;
    background: var(--bar);
    box-shadow: var(--shadow);
  }
  .nav a {
    flex: 1;
    justify-content: center;
    padding: 0 var(--space-2);
    color: var(--onbar);
    font-size: var(--text-xs);
  }
  .nav a:hover {
    background: transparent;
    color: var(--onbar);
  }
  .nav a[aria-current="page"] {
    background: var(--brand);
    color: #1c1a33;
  }
  main {
    padding-bottom: calc(var(--space-8) * 2);
  }
  .foot {
    padding-bottom: calc(var(--space-8) * 2);
  }
}
.flash {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.flash li {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--money) 16%, var(--surface));
  font-weight: 600;
}
.flash li.error {
  background: color-mix(in srgb, var(--notice) 16%, var(--surface));
}
.field.invalid input {
  border-color: var(--notice);
}
.field-error {
  color: var(--notice);
  font-size: var(--text-sm);
  font-weight: 600;
}
.lead {
  color: var(--muted);
  max-width: 48rem;
}
.stack {
  display: grid;
  gap: var(--gap-card);
  align-content: start;
}
.two > .stack + .stack {
  margin-top: var(--gap-card);
}
@media (min-width: 64rem) {
  .two > .stack + .stack {
    margin-top: 0;
  }
}
.tile-delta {
  color: var(--muted);
  font-size: var(--text-xs);
}
.help-box {
  margin: var(--space-4) 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-md);
  background: var(--t0);
}
.help-box h4 {
  margin: 0 0 var(--space-2);
  font: 650 var(--text-md)/1.3 var(--display);
}
.help-box ul,
.help-box ol {
  margin: 0;
  padding-left: var(--space-5);
  display: grid;
  gap: var(--space-2);
}
.help-box p {
  margin: var(--space-2) 0 0;
}
pre.code {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  border-radius: var(--r-sm);
  background: var(--bar);
  color: var(--onbar);
  font-size: var(--text-sm);
  white-space: pre-wrap;
}
code {
  font-size: 0.92em;
}
.steps-list {
  display: grid;
  gap: var(--space-2);
  padding-left: var(--space-5);
}
.collector h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.collector .tiles {
  margin-bottom: var(--space-4);
}
.collector + .collector,
.empty + .card {
  margin-top: var(--gap-card);
}
.s-ok.collector .dot {
  background: var(--money);
}
.s-warn.collector .dot {
  background: #d99a00;
}
.s-fail.collector .dot {
  background: var(--notice);
}
.collector .dot {
  box-shadow: none;
}
.status.s-fail .dot {
  background: #ff8f80;
}
.status.s-warn .dot {
  background: #ffb020;
}
.status.s-ok .dot {
  background: #3ddc97;
}
.link-list {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}
.link-list a {
  display: flex;
  align-items: center;
  min-height: var(--icon-btn);
}
table.channels td.c,
table.channels th.c {
  text-align: center;
  width: 6rem;
}
.feed li.new {
  box-shadow: inset 4px 0 0 var(--brand);
}
.feed .icon.k-cm_login,
.feed .icon.k-cm_blocked,
.feed .icon.k-collector_offline,
.feed .icon.k-offers {
  background: var(--t0);
  color: var(--h0);
}
.feed .icon.k-collector_back {
  background: var(--t1);
  color: var(--h1);
}
.feed b {
  font-weight: 600;
}
.fields.spaced {
  margin-top: var(--space-5);
}
/* Sign-in pages: one centred card, the allauth forms inside use the same fields and buttons. */
.auth main {
  max-width: 30rem;
}
.auth-card h1 {
  margin-bottom: var(--space-4);
}
.auth-card form {
  display: grid;
  gap: var(--gap-field);
  margin: var(--space-5) 0;
}
.auth-card form p {
  display: grid;
  gap: var(--gap-label);
  margin: 0;
}
.auth-card form p:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.auth-card button,
.auth-card [type="submit"] {
  width: 100%;
}
.auth-card .helptext,
.auth-card .errorlist {
  color: var(--muted);
  font-size: var(--text-sm);
}
.auth-card .errorlist {
  margin: 0;
  padding-left: var(--space-4);
  color: var(--notice);
  font-weight: 600;
}
.auth-card hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-5) 0;
}
.auth .nav {
  display: none;
}
/* Alternatives below the main sign-in (passkey, code) look secondary, like in tuck-web. */
.auth-card hr ~ * button,
.auth-card hr ~ button {
  border-color: var(--edge);
  background: transparent;
  color: var(--ink);
}
.auth-card hr ~ a,
.auth-card hr ~ * a {
  display: inline-flex;
  align-items: center;
  min-height: var(--icon-btn);
  margin-top: var(--space-2);
}
[hidden] {
  display: none !important;
}
.nav svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav .short {
  display: none;
}
@media (max-width: 40rem) {
  .nav a {
    position: relative;
    flex-direction: column;
    gap: 0;
    min-height: 3.25rem;
    line-height: 1.1;
  }
  .nav svg {
    width: 1.3rem;
    height: 1.3rem;
  }
  .nav .long {
    display: none;
  }
  .nav .short {
    display: inline;
  }
  .nav .count {
    position: absolute;
    top: var(--space-1);
    right: 22%;
    min-width: 1.1rem;
    height: 1.1rem;
  }
  /* The channel matrix stays a small table on phones; it has only three short columns. */
  table.channels {
    display: table;
  }
  table.channels thead {
    display: table-header-group;
  }
  table.channels tbody {
    display: table-row-group;
  }
  table.channels tr {
    display: table-row;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
  }
  table.channels td,
  table.channels td.c {
    display: table-cell;
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--line);
  }
  table.channels td.c {
    text-align: center;
  }
  table.channels td[data-label]::before {
    content: none;
  }
  .channels-wrap.table-wrap {
    border: 1px solid var(--line);
    background: var(--surface);
  }
}

/* Sign in to Cardmarket from the app: the collector's browser as a picture to tap on. */
.small {
  font-size: 0.875rem;
}
.remote-state {
  font-weight: 600;
}
.remote-screen {
  position: relative;
  max-width: 30rem;
  margin: var(--space-3) auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--surface);
  min-height: 12rem;
}
.remote-screen img {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.remote-screen .tap {
  position: absolute;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.875rem 0 0 -0.875rem;
  border: 2px solid var(--brand);
  border-radius: 50%;
  pointer-events: none;
  animation: tap 600ms ease-out forwards;
}
@keyframes tap {
  to {
    transform: scale(1.8);
    opacity: 0;
  }
}
.remote-wait {
  padding: var(--space-4);
  text-align: center;
}
.remote-type {
  display: flex;
  gap: var(--space-2);
  max-width: 30rem;
  margin: 0 auto;
}
.remote-type input {
  flex: 1;
  min-width: 0;
  /* 16px keeps iOS from zooming into the field */
  font-size: 1rem;
}
.remote-hide,
.remote-keys {
  max-width: 30rem;
  margin-inline: auto;
}
.remote-keys {
  margin-top: var(--space-2);
}
@media (prefers-reduced-motion: reduce) {
  .remote-screen .tap {
    animation: none;
    opacity: 0.6;
  }
}
/* The keys are tools, not choices: a compact 3x2 grid, also on phones. */
.actions.remote-keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}
.actions.remote-keys > button {
  width: auto;
  min-height: 2.75rem;
  padding-inline: var(--space-2);
}
