/*
  Components: badges, cards, product tiles, notices, accordions, lists, menus, dialogs, toasts and tables.
*/

/* ---------------------------------------------------------------- icons */
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------------------------------------------------------------- badge */
.badge {
  --badge-bg: color-mix(in oklab, var(--ink) 8%, transparent);
  --badge-ink: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); background: var(--badge-bg); color: var(--badge-ink);
  font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
}
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--accent { --badge-bg: var(--accent); --badge-ink: var(--accent-ink); }
.badge--strong { --badge-bg: var(--ink); --badge-ink: var(--bg); }
.badge--success { --badge-bg: var(--success-soft); --badge-ink: var(--success); }
.badge--warn { --badge-bg: var(--warn-soft); --badge-ink: var(--warn); }
.badge--info { --badge-bg: var(--info-soft); --badge-ink: var(--info); }
.badge--danger { --badge-bg: var(--danger-soft); --badge-ink: var(--danger); }
.badge--muted { --badge-ink: var(--muted); }

/* ---------------------------------------------------------------- card */
.card {
  display: grid; gap: var(--s-4); align-content: start; padding: var(--s-5);
  border-radius: var(--r-lg); background: var(--raised); box-shadow: var(--shadow-sm);
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.card__title { font-size: var(--t-card); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.card__title--lg { font-size: var(--t-h3); font-weight: 400; letter-spacing: var(--tracking-display); }
.card--accent { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.card--accent .eyebrow { color: var(--accent-ink); }
.card--danger { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--danger) 35%, transparent); }
@media (max-width: 639px) { .card { padding: var(--s-4); border-radius: var(--r-md); } }

/* ---------------------------------------------------------------- product tile */
.tile { position: relative; display: grid; gap: var(--s-3); align-content: start; }
.tile__link { display: grid; gap: var(--s-3); color: inherit; border-radius: var(--r-lg); }
.tile__link:focus-visible { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--action), 0 0 0 7px var(--action-edge); }
.tile__media { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: var(--r-lg); background: var(--surface); }
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease), filter var(--dur-slow) var(--ease); }
.tile__badge { position: absolute; left: var(--s-3); top: var(--s-3); }
.tile__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.tile__name { font-size: var(--t-card); font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.tile__price { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile__facts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: calc(-1 * var(--s-2)); font-size: var(--t-small); color: var(--muted); }
.tile__add { position: absolute; right: var(--s-3); top: calc(var(--s-3)); width: 44px; height: 44px; }
/* "available soon": a product that has its price but still waits for its test print (TESTDRUCK in tool/js/preise.js) */
.tile__state {
  position: absolute; left: var(--s-3); top: var(--s-3); z-index: 1; pointer-events: none;
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--raised); color: var(--ink); box-shadow: var(--shadow-sm);
  font-size: var(--t-label); font-weight: 600; line-height: 1; white-space: nowrap;
}
/* "3D": opens the configurator's 3D view of the piece (it turns, shows its back and, for a pot, its bottom) */
.view3d {
  position: absolute; right: var(--s-3); top: var(--s-3); z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: var(--r-pill);
  background: var(--raised); color: var(--ink); box-shadow: var(--shadow-sm);
  font-size: var(--t-label); font-weight: 600; line-height: 1; text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.view3d .icon { width: 16px; height: 16px; }
.view3d:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .view3d:hover { background: var(--action); color: var(--action-ink); } }
/* a rendering of the configurator (transparent background): shown whole on the surface, never cropped */
.tile--render .tile__media img, .pic.pic--render img { position: relative; object-fit: contain; padding: 7%; filter: drop-shadow(0 4px 7px rgb(22 22 26 / .18)); }
/* layer lines: fine rings behind the piece, like the layers of a print – the motif shared with the configurator's stage */
.tile--render .tile__media::before, .tile__media--gift::before, .tile__media--icon::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 19px, color-mix(in oklab, var(--ink) 6%, transparent) 19px 20px);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 72%); mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 72%);
  transition: scale var(--dur-slow) var(--ease);
}
.tile__media--gift .gift-card, .tile__media--icon .icon { position: relative; }
@media (hover: hover) and (pointer: fine) { .tile:hover .tile__media::before { scale: 1.12; } }
/* many renderings are black: on the dark theme their ground is lifted, so the piece stays readable */
[data-theme="dark"] :is(.tile--render .tile__media, .pic--render) { background: color-mix(in oklab, var(--ink) 32%, var(--surface)); }
.configure-note { margin-top: var(--s-6); max-width: 72ch; font-size: var(--t-small); }
/* the gallery of every template: two rows of filter chips, then a dense grid of small tiles */
/* Phone cases, announced (configure page): one quiet panel per brand, the model names as a list */
.phones { margin-top: var(--s-9, 96px); padding-top: var(--s-7); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.stickers { margin-top: var(--s-9, 96px); padding-top: var(--s-7); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.stickers .section-head { margin-bottom: var(--s-5); }
.stickers__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s-3); margin: 0 0 var(--s-5); padding: 0; list-style: none; }
.stickers__item { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-2); border-radius: var(--r-lg, 20px); background: var(--surface); font-size: var(--t-small); text-align: center; }
.sticker-picture { width: 104px; height: 110px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .18)); }
.phones .section-head { margin-bottom: var(--s-5); }
.phones h2 .badge { vertical-align: middle; margin-left: var(--s-2); }
.phones__brands { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); }
.phones__brand { padding: var(--s-5); border-radius: var(--r-lg, 20px); background: var(--surface); }
.phones__name { margin: 0 0 var(--s-3); font-size: var(--t-body, 1rem); font-weight: 600; }
.phones__list { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--t-small); }
.phones__note { margin-top: var(--s-4); font-size: var(--t-small); }
/* the start page's one line about them, under the configure button */
.phones-hint { margin-top: var(--s-4); font-size: var(--t-small); }
.phones-hint .badge { margin-right: var(--s-2); }
.gallery { margin-top: var(--s-9, 96px); padding-top: var(--s-7); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.gallery .section-head { margin-bottom: var(--s-5); }
.gallery, .gallery [data-gallery] { min-width: 0; }
.gallery__grid { list-style: none; margin: 0; padding: 0; }
.gallery__grid > li { position: relative; min-width: 0; }
.gallery__grid .view3d { right: var(--s-2); top: var(--s-2); height: 32px; padding: 0 10px 0 8px; }
.gallery__filter { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.chip--chosen, .chip--chosen:hover { background: var(--ink); color: var(--bg); }
.gallery__count { margin: var(--s-4) 0 var(--s-5); font-size: var(--t-small); }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-6) var(--gap); }
.gallery__item { display: grid; gap: 2px; color: inherit; text-decoration: none; border-radius: var(--r-lg); }
.gallery__media { position: relative; overflow: hidden; display: block; aspect-ratio: 1; margin-bottom: var(--s-2); border-radius: var(--r-lg); background: var(--surface); }
.gallery__media::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 50%, transparent 0 15px, color-mix(in oklab, var(--ink) 6%, transparent) 15px 16px); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 72%); mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 72%); }
/* a soft shadow lifts white pieces off the light ground (the renderings carry only a faint one) */
.gallery__media img { position: relative; width: 100%; height: 100%; object-fit: contain; padding: 9%; filter: drop-shadow(0 3px 5px rgb(22 22 26 / .22)); transition: transform var(--dur-slow) var(--ease); }
[data-theme="dark"] .gallery__media { background: color-mix(in oklab, var(--ink) 32%, var(--surface)); }
.gallery__name { font-weight: 500; line-height: 1.3; }
.gallery__product { font-size: var(--t-small); color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .gallery__item:hover img { transform: scale(1.06) rotate(-2deg); } }
@media (max-width: 479px) { .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-5); } }
.tile.is-paused .tile__media img { filter: grayscale(.85); opacity: .75; }
/* an idea the configurator does not make yet: its icon, thin and quiet, where the picture will be */
.tile__media--icon { display: grid; place-items: center; color: var(--muted); }
.tile__media--icon .icon { width: 26%; height: auto; stroke-width: 1; }
[data-theme="dark"] .tile--idea .tile__media { background: color-mix(in oklab, var(--ink) 32%, var(--surface)); }
/* the gift card: the dark card of the configurator's dialog, slightly turned, where a picture would be.
   Sizes follow the tile (cqw), so the card reads the same in every grid. */
.tile__media--gift { display: grid; place-items: center; container-type: inline-size; }
.gift-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 70cqw; aspect-ratio: 1.58; padding: 6cqw 6.5cqw; border-radius: 4.5cqw; background: var(--inverse); color: var(--inverse-ink); box-shadow: var(--shadow-lg); rotate: -5deg; transition: rotate var(--dur-slow) var(--ease), translate var(--dur-slow) var(--ease); }
.gift-card__kicker { font-size: 3.1cqw; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.gift-card__amount { font-size: 13cqw; line-height: 1; letter-spacing: -0.035em; color: var(--accent); font-variant-numeric: tabular-nums; }
.gift-card .logo-mark { position: absolute; right: 6.5cqw; top: 5.5cqw; width: 7cqw; height: auto; }
.gift-card .logo-mark__path { stroke: var(--inverse-ink); }
[data-theme="dark"] .gift-card { box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); }
[data-theme="dark"] .tile__media--gift { background: color-mix(in oklab, var(--ink) 32%, var(--surface)); }
@media (hover: hover) and (pointer: fine) { .tile--gift:hover .gift-card { rotate: -2deg; translate: 0 -1.5cqw; } }
@media (hover: hover) and (pointer: fine) {
  .tile__link:hover .tile__media img { transform: scale(1.04); }
  /* the quick-add button fades in where it stays (no slide); under the pointer it turns yellow */
  .tile__add { opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-enter), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
  .tile:hover .tile__add, .tile__add:focus-visible { opacity: 1; }
}
@media (max-width: 639px) {
  .tile__head { flex-direction: column; gap: 2px; }
  .tile__name { font-size: 16px; }
  .tile__add { width: 38px; height: 38px; right: var(--s-2); top: var(--s-2); }
  .tile__media { border-radius: var(--r-md); }
}
.tile--skeleton { pointer-events: none; }

.dots { display: inline-flex; align-items: center; gap: 3px; }
.dots__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14); }
.dots__more { font-size: 12px; margin-left: 2px; }

.thumb { display: block; width: var(--thumb); height: var(--thumb); flex: none; overflow: hidden; border-radius: var(--r-sm); background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- notice, empty, success, status */
.notice { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: var(--r-md); background: var(--info-soft); color: var(--ink); margin-bottom: var(--s-5); }
.notice > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--info); }
.notice__title { font-weight: 600; }
.notice__text { font-size: var(--t-small); }
.notice--success { background: var(--success-soft); } .notice--success > .icon { color: var(--success); }
.notice--warn { background: var(--warn-soft); } .notice--warn > .icon { color: var(--warn); }
.notice--danger { background: var(--danger-soft); } .notice--danger > .icon { color: var(--danger); }
.form-stack > [data-form-error] > .notice { margin-bottom: 0; }

.empty { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-8) var(--s-5); text-align: center; border-radius: var(--r-lg); background: color-mix(in oklab, var(--ink) 3%, transparent); }
.empty__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--raised); box-shadow: var(--shadow-sm); }
.empty__icon .icon { width: 24px; height: 24px; color: var(--muted); }
.empty__title { font-size: var(--t-h3); }
.empty__text { color: var(--muted); max-width: 46ch; }
.empty .btn { margin-top: var(--s-2); }

.success-state { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-5) 0; text-align: center; }
.success-state--left { justify-items: start; text-align: left; }
.success-state__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); animation: pop-in calc(520ms * var(--motion-scale)) var(--ease-enter) both; }
.success-state__icon .icon { width: 26px; height: 26px; stroke-width: 2.6; }
.success-state h2, .success-state h3 { font-size: var(--t-h3); }
.success-state p { color: var(--muted); max-width: 48ch; }

.status-page { display: grid; justify-items: center; gap: var(--s-4); text-align: center; padding-block: var(--s-8); }
.status-page__icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.status-page__icon .icon { width: 30px; height: 30px; }
.status-page .lead { color: var(--muted); max-width: 52ch; }

.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: spin 700ms linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, color-mix(in oklab, var(--surface) 55%, var(--raised)) 50%, var(--surface) 100%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-sm); }
.skeleton--line { height: 14px; }
.skeleton--short { width: 50%; }

/* ---------------------------------------------------------------- accordion (FAQ, product details) */
.accordion { display: grid; }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-5) 0; font-size: var(--t-lead); font-weight: 500; line-height: 1.35;
  border-radius: var(--r-xs); transition: color var(--dur) var(--ease);
}
.accordion__summary:hover { color: color-mix(in oklab, var(--ink) 75%, var(--muted)); }
.accordion__icon { width: 20px; height: 20px; flex: none; color: var(--muted); transition: transform var(--dur-panel) var(--ease); }
.accordion__item[open] > .accordion__summary .accordion__icon { transform: rotate(45deg); color: var(--ink); }
.accordion__content { padding: 0 var(--s-7) var(--s-5) 0; color: var(--ink); }
.accordion__content p { max-width: 64ch; }
/* Smooth height where the browser can animate <details> (interpolate-size, ::details-content). */
.accordion__item::details-content { block-size: 0; overflow: clip; transition: block-size var(--dur-panel) var(--ease), content-visibility var(--dur-panel) allow-discrete; }
.accordion__item[open]::details-content { block-size: auto; }
.accordion--compact .accordion__summary { padding: var(--s-4) 0; font-size: var(--t-body); }
.accordion--compact .accordion__content { padding-bottom: var(--s-4); }
@media (max-width: 639px) { .accordion__summary { font-size: 17px; padding: var(--s-4) 0; } .accordion__content { padding-right: 0; } }

.disclosure { font-size: var(--t-small); }
.disclosure > summary { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; border-radius: var(--r-xs); }
.disclosure > summary:hover { color: var(--ink); }
.disclosure > summary .icon { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.disclosure[open] > summary .icon { transform: rotate(180deg); }
.disclosure > :not(summary) { margin-top: var(--s-3); }

/* ---------------------------------------------------------------- key / value lists */
.kv { display: grid; gap: 0; font-size: var(--t-small); }
.kv > div { display: grid; grid-template-columns: minmax(110px, 35%) 1fr; gap: var(--s-3); padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
.kv--inline > div { grid-template-columns: minmax(96px, auto) 1fr; }
.kv--debug { font-family: var(--font-mono); font-size: 12.5px; }

.spec { display: grid; }
.spec > div { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.spec > div:last-child { border-bottom: 0; }
.spec dt { color: var(--muted); }
.spec dd { text-align: right; font-variant-numeric: tabular-nums; }
.spec--wide > div { padding: var(--s-4) 0; }
/* a value that is a whole sentence or two (help: returns) reads as a paragraph, not as a figure */
.spec dd.spec__text { max-width: 60ch; text-align: left; }

/* ---------------------------------------------------------------- rows (steps with a value) */
.rows > li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: var(--s-4); row-gap: 2px; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.rows > li:first-child { padding-top: 0; }
.rows__index { grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in oklab, var(--ink) 7%, transparent); font-size: var(--t-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.rows__name { font-weight: 600; align-self: center; }
.rows__text { grid-column: 2; color: var(--ink); font-size: var(--t-small); max-width: 52ch; }
.rows__value { grid-column: 3; grid-row: 1; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); font-size: var(--t-small); align-self: center; }

.steps { display: grid; gap: var(--s-4); margin-block: var(--s-6); }
.step { display: flex; gap: var(--s-4); align-items: flex-start; }
.step__num { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.step > span:last-child { display: grid; gap: 2px; }
.step__text { color: var(--muted); font-size: var(--t-small); }

/* ---------------------------------------------------------------- order timeline */
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; }
.timeline__step { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: var(--t-small); }
.timeline__step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0; }
.timeline__step:first-child::before { display: none; }
.timeline__step.is-done::before { background: var(--action); }
.timeline__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--raised); box-shadow: inset 0 0 0 2px var(--line-strong); }
.timeline__step.is-done .timeline__dot { background: var(--action); color: var(--action-ink); box-shadow: none; }
.timeline__step.is-current .timeline__dot { box-shadow: 0 0 0 5px color-mix(in oklab, var(--action) 18%, transparent); }
.timeline__dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.timeline__label { font-weight: 600; }
.timeline__date { color: var(--muted); font-size: var(--t-label); min-height: 1.2em; }

/* ---------------------------------------------------------------- cart lines and summary */
.cart-lines { display: grid; }
/* picture | name, material, colour | prices – and under name and prices one row: stepper left, bin right */
.cart-line {
  /* the picture's column is as high as name, colour line and stepper row together (components/cart.js THUMB) */
  display: grid; grid-template-columns: 90px minmax(0, 1fr) auto;
  grid-template-areas: "media body prices" "media controls controls";
  column-gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
  animation: line-in calc(320ms * var(--motion-scale)) var(--ease-enter);
}
.cart-line__media { grid-area: media; align-self: start; }
.cart-line:first-child { padding-top: 0; }
.cart-line__body { grid-area: body; display: grid; gap: 4px; align-content: start; min-width: 0; }
.cart-line__name { font-weight: 600; }
.cart-line__name:hover { text-decoration: underline; text-underline-offset: 3px; }
/* material · ● colour: the colour's own swatch, ringed so black and white read on both grounds */
.cart-line__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--t-small); color: var(--muted); }
.cart-line__swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cart-line__warn { display: flex; align-items: center; gap: 6px; font-size: var(--t-small); color: var(--warn); }
.cart-line__warn .icon { width: 16px; height: 16px; }
/* the bare stepper (controls.css .stepper--sm) starts on the text's edge, the bin's lines end on the
   price's edge; the bin stays quiet until pointed at, then only its lines turn red – no disc behind it */
.cart-line__controls { grid-area: controls; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-2); margin-left: -6px; }
.cart-line__remove { margin-right: -7px; color: var(--muted); transition: color var(--dur) var(--ease); }
.cart-line__remove:is(:hover, :focus-visible) { color: var(--danger); background: none; }
.cart-line__prices { grid-area: prices; display: grid; justify-items: end; align-content: start; gap: 2px; }
.cart-line__price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-line__each { font-size: var(--t-label); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* compact: the same line in the checkout's narrow summary – smaller picture, tighter rows, smaller type */
.cart-lines--compact .cart-line { grid-template-columns: 80px minmax(0, 1fr) auto; column-gap: var(--s-3); padding: var(--s-3) 0; }
.cart-lines--compact .cart-line:last-child { border-bottom: 0; padding-bottom: 0; }
.cart-lines--compact .cart-line__body { gap: 2px; }
.cart-lines--compact .cart-line__name { font-size: var(--t-small); }
.cart-lines--compact .cart-line__meta { font-size: 13px; }
.cart-lines--compact .cart-line__controls { gap: var(--s-2); margin-top: var(--s-1); }
.cart-lines--compact .cart-line__price { font-size: var(--t-small); }

.summary { display: grid; gap: var(--s-4); }
.summary__rows { display: grid; gap: var(--s-2); }
.summary__rows > div { display: flex; justify-content: space-between; gap: var(--s-4); font-variant-numeric: tabular-nums; }
.summary__rows dt { color: var(--muted); }
.summary__total { padding-top: var(--s-3); margin-top: var(--s-1); border-top: 1px solid var(--line); font-size: var(--t-lead); font-weight: 600; }
.summary__total dt { color: var(--ink) !important; }
.summary__note { font-size: var(--t-label); color: var(--muted); }

.free-ship { display: grid; gap: var(--s-2); }
.free-ship__text { display: flex; align-items: center; gap: 6px; font-size: var(--t-small); }
.free-ship__text .icon { width: 16px; height: 16px; flex: none; } /* an accent icon (chrome.css) */
.free-ship__bar { height: 6px; border-radius: 3px; background: color-mix(in oklab, var(--ink) 9%, transparent); overflow: hidden; }
/* the filled part has its real width (not a stretched bar, so its round ends stay round) and changes
   at once with the quantity – no animation */
.free-ship__bar > span { display: block; height: 100%; width: calc(var(--progress) * 100%); border-radius: inherit; background: var(--action); }

.mini-lines { display: grid; gap: var(--s-3); }
.mini-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; }
.mini-line__thumb { position: relative; }
.mini-line__qty { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 700; }
.mini-line__text { display: grid; font-size: var(--t-small); }
.mini-line__text span { color: var(--muted); }
.mini-line__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mini-line__price { font-size: var(--t-small); font-weight: 500; font-variant-numeric: tabular-nums; }

.pay-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: var(--t-label); color: var(--muted); }
/* payment marks (ui/components/payment.js): small white cards with each brand's own colours – the way
   payment marks appear on every shop, so they read the same on the light and the dark ground */
.pay-marks { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pay-mark {
  display: inline-grid; place-items: center; height: 24px; min-width: 38px; padding: 0 7px;
  border-radius: 4px; background: #ffffff; box-shadow: inset 0 0 0 1px rgb(22 22 26 / .14);
  color: #16161a; font: 800 10px/1 var(--font); letter-spacing: .02em; white-space: nowrap;
}
.pay-mark svg { width: 24px; height: 15px; }
.pay-mark--visa svg { width: 28px; height: 9px; }
.pay-mark--amex { background: #016fd0; color: #ffffff; box-shadow: none; }
/* TWINT: its black card, edged in the same black – no grey ring */
.pay-mark--twint { background: #000000; box-shadow: none; }
.pay-mark--twint svg { width: 43px; height: 14px; }
/* Apple Pay and Google Pay: the same white card, its lettering at the same height */
.pay-mark--apple-pay { color: #000000; }
.pay-mark--apple-pay svg { width: 28px; height: 12px; }
.pay-mark--google-pay svg { width: 28px; height: 11px; }
/* on the dark ground a white card needs no edge: it stays plain white to its border (the grey hairline
   is only for the pale ground, where white on off-white would vanish) */
:root[data-theme="dark"] .pay-mark { box-shadow: none; }
/* the payment provider: Stripe's wordmark in white on Stripe purple, a hairline before it (after TWINT) */
.pay-marks__sep { align-self: stretch; width: 1px; margin: 3px 3px; background: var(--line-strong); }
/* after the provider, a middle dot leads to the methods it takes */
.pay-marks__dot { flex: none; width: 4px; height: 4px; margin: 0 3px; border-radius: 50%; background: var(--muted); }
.pay-mark--stripe { background: #635bff; color: #ffffff; box-shadow: none; }
.pay-mark--stripe svg { width: 31px; height: 13px; }

/* ---------------------------------------------------------------- menus */
.menu { position: relative; }
.menu > [data-menu-trigger] { position: relative; }
.menu > [data-menu-trigger]::before {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur-panel) var(--ease);
  pointer-events: none;
}
.menu > [data-menu-trigger]:is(:focus-visible, [aria-expanded="true"])::before { transform: scaleX(1); }
.menu__panel {
  position: absolute; top: calc(100% + 2px); left: 0; z-index: 60; min-width: 240px; padding: 4px 0;
  background: var(--raised); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  transform-origin: top left; animation: menu-in calc(180ms * var(--motion-scale)) var(--ease-enter);
}
.menu__panel--end { left: auto; right: 0; transform-origin: top right; }
/* every menu outside the header (row menus): fixed to the window, placed – and flipped up – by ui/components/menu.js */
.menu__panel.is-floating { position: fixed; right: auto; z-index: calc(var(--z-header) + 5); }
/* In the header a menu opens just below the header's lower edge, centred under its icon (moved in
   only as far as needed to stay inside the window: --menu-shift, ui/components/menu.js). Its icon shows
   no line when open – like the other header icons, the open menu is the sign. */
.header__tools .menu__panel {
  top: calc(100% + (var(--header-h) - 40px) / 2 + 6px); left: 50%; right: auto;
  translate: calc(-50% + var(--menu-shift, 0px)) 0; transform-origin: top center;
}
.header__tools .menu > [data-menu-trigger]::before { content: none; }
.menu__panel.is-closing { animation: menu-out calc(120ms * var(--motion-scale)) var(--ease) forwards; }
.menu__heading { padding: 8px 16px 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 14px 0 16px;
  border: 0; border-radius: 0; background: none; color: var(--ink); font: 500 var(--t-small)/1.3 var(--font); text-align: left;
  transition: background-color var(--dur-fast) var(--ease);
}
.menu__item .icon { width: 18px; height: 18px; color: var(--muted); }
.menu__item:is(:hover, :focus-visible, [aria-checked="true"]) { background: var(--highlight); box-shadow: none; }
.menu__item[aria-checked="true"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.menu__item--quiet { color: var(--muted); }
.menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
.menu__sep { margin: 6px 16px; }
/* groups that fold open inside a menu (language, display): the row names the group and shows the
   current choice, its chevron turns; the options unfold under it, slightly indented */
.menu__group-toggle { font-weight: 600; }
.menu__group-toggle + .menu__group + .menu__group-toggle { box-shadow: inset 0 1px 0 var(--line); }
.menu__group-toggle + .menu__group + .menu__group-toggle:is(:hover, :focus-visible) { box-shadow: inset 0 1px 0 var(--line); }
/* (a small gap before the choice, so "Darstellung · Wie Gerät" fits the menus' common 240px – as wide as the account menu) */
.menu__group-value { margin-left: auto; padding-left: var(--s-2); font-weight: 400; color: var(--muted); white-space: nowrap; }
.menu__item .menu__group-chevron { width: 16px; height: 16px; flex: none; transition: transform var(--dur-panel) var(--ease), color var(--dur) var(--ease); }
.menu__group-toggle[aria-expanded="true"] .menu__group-chevron { color: var(--ink); transform: rotate(180deg); }
.menu__group { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-panel) var(--ease); }
.menu__group.is-open { grid-template-rows: 1fr; }
.menu__group-inner { min-height: 0; overflow: hidden; }
.menu__group .menu__item { padding-left: 28px; }
.menu__identity { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 10px; padding: 8px 16px; font-size: var(--t-small); }
.menu__identity .badge { grid-column: 2; justify-self: start; margin-top: 4px; }
.menu__email { display: block; color: var(--muted); font-size: var(--t-label); }

.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; grid-row: span 2; }
.person { display: inline-flex; align-items: center; gap: var(--s-3); }
.person > span:last-child { display: grid; }

/* ---------------------------------------------------------------- dialogs and sheets (native <dialog>) */
.dialog {
  padding: 0; border: 0; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
  background: transparent; color: var(--ink); overflow: visible;
}
.dialog::backdrop { background: rgb(10 10 12 / .48); backdrop-filter: blur(2px); }
.dialog[open] { animation: dialog-in var(--dur-panel) var(--ease-enter); }
.dialog[open]::backdrop { animation: fade-in var(--dur-panel) var(--ease); }
.dialog.is-closing { animation: dialog-out var(--dur) var(--ease) forwards; }
.dialog.is-closing::backdrop { animation: fade-out var(--dur) var(--ease) forwards; }
.dialog__panel {
  display: flex; flex-direction: column; max-height: inherit; overflow: hidden;
  border-radius: var(--r-xl); background: var(--raised); box-shadow: var(--shadow-lg);
}
.dialog--sm { width: 440px; }
.dialog--md { width: 560px; }
.dialog--lg { width: 760px; }
.dialog__header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-5) var(--s-3) var(--s-6); }
/* the ✕ of a dialog or sheet (the cart) is a bare cross: no disc under the pointer */
.dialog__header .icon-btn[data-close-dialog]:hover { background: none; }
.dialog__title { font-size: var(--t-h3); font-weight: 400; }
/* a count beside a dialog's title (the cart drawer): the same yellow number as on the header's cart icon */
.dialog__count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px;
  border-radius: 10px; background: var(--accent); color: var(--accent-ink); vertical-align: 3px;
  font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.dialog__count[hidden] { display: none; }
/* a long body scrolls inside (wheel, touch, keys) without a visible scrollbar, like the side navigation */
.dialog__body { padding: var(--s-3) var(--s-6) var(--s-6); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.dialog__body::-webkit-scrollbar { display: none; }
.dialog__text { color: var(--muted); }
/* the way back (Cancel) stands on the left, the action on the right */
.dialog__footer > .btn--secondary[data-close-dialog]:first-child:not(:last-child) { margin-right: auto; }
.dialog__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-3); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line); background: color-mix(in oklab, var(--ink) 2%, var(--raised)); }
.dialog__spacer { flex: 1; }
.dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); width: 100%; }
@media (max-width: 639px) {
  .dialog--center { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92dvh; }
  .dialog--center .dialog__panel { border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialog--center[open] { animation: sheet-up var(--dur-panel) var(--ease-enter); }
  .dialog--center.is-closing { animation: sheet-down var(--dur) var(--ease) forwards; }
  .dialog__header { padding: var(--s-4) var(--s-4) var(--s-2) var(--s-5); }
  .dialog__body { padding: var(--s-2) var(--s-5) var(--s-5); }
  .dialog__footer { padding: var(--s-4) var(--s-5); flex-direction: column-reverse; align-items: stretch; }
  .dialog__footer > .btn { width: 100%; }
  .dialog__spacer { display: none; }
}

/* side sheet: the cart (right) and the phone menu (left) */
.dialog--sheet { margin: 0 0 0 auto; width: min(440px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; }
.dialog--sheet .dialog__panel { height: 100%; border-radius: var(--r-xl) 0 0 var(--r-xl); }
.dialog--sheet[open] { animation: slide-from-right var(--dur-panel) var(--ease-enter); }
.dialog--sheet.is-closing { animation: slide-to-right var(--dur) var(--ease) forwards; }
.dialog--sheet .dialog__body { flex: 1; }
.dialog--sheet .dialog__footer { flex-direction: column; align-items: stretch; gap: var(--s-4); }
.dialog--start { margin: 0 auto 0 0; }
.dialog--start .dialog__panel { border-radius: 0 var(--r-xl) var(--r-xl) 0; }
.dialog--start[open] { animation: slide-from-left var(--dur-panel) var(--ease-enter); }
.dialog--start.is-closing { animation: slide-to-left var(--dur) var(--ease) forwards; }
@media (max-width: 479px) { .dialog--sheet .dialog__panel { border-radius: 0; } }

/* under the cart drawer's checkout button: the cart page as a quiet link, centred */
.drawer-foot { display: flex; justify-content: center; margin-top: calc(-1 * var(--s-2)); }
.drawer-empty { display: grid; justify-items: center; gap: var(--s-4); padding: var(--s-8) 0; text-align: center; color: var(--muted); }
.drawer-empty > .icon { width: 40px; height: 40px; }

/* ---------------------------------------------------------------- toasts */
.toasts {
  position: fixed; inset: auto auto var(--s-5) 50%; transform: translateX(-50%); z-index: 300;
  display: grid; gap: var(--s-2); width: min(440px, calc(100vw - 32px));
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--s-3); padding: 12px 12px 12px 16px; pointer-events: auto;
  border-radius: var(--r-md); background: var(--inverse); color: var(--inverse-ink); box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-panel) var(--ease-enter);
}
.toast.is-leaving { animation: toast-out var(--dur) var(--ease) forwards; }
.toast__icon { width: 20px; height: 20px; color: var(--accent); }
.toast--danger .toast__icon { color: #ff8a7a; }
.toast--info .toast__icon { color: var(--inverse-muted); }
.toast__text { flex: 1; font-size: var(--t-small); font-weight: 500; }
.toast__action { height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-size: var(--t-small); font-weight: 600; }
.toast__close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--r-xs); background: none; color: var(--inverse-muted); }
.toast__close:hover { color: var(--inverse-ink); }
.toast__close .icon { width: 16px; height: 16px; }
body.has-sticky-bar .toasts { bottom: calc(var(--s-5) + 72px); }

/* ---------------------------------------------------------------- tables (team area) */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); background: var(--raised); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.table { font-size: var(--t-small); }
.table th { padding: 12px var(--s-4); text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
/* sortable column titles (ui/components/sortable.js): the arrows sit right of the title; the sorted column is ink */
.th-sort {
  display: inline-flex; align-items: center; gap: 6px; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: var(--r-sm);
  background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.th-sort:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 5%, transparent); }
.th-sort__icon { display: inline-grid; }
.th-sort__icon .icon { width: 13px; height: 13px; opacity: .45; transition: opacity var(--dur-fast) var(--ease); }
.th-sort:hover .th-sort__icon .icon { opacity: .8; }
.table th:is([aria-sort="ascending"], [aria-sort="descending"]) { color: var(--ink); }
.table th:is([aria-sort="ascending"], [aria-sort="descending"]) .th-sort__icon .icon { opacity: 1; }
.table th.num .th-sort { flex-direction: row; }
.table td { padding: 12px var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: color-mix(in oklab, var(--ink) 3%, transparent); }
.table tr.is-muted td { color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table__sub { display: block; font-size: var(--t-label); color: var(--muted); }
.table__actions { width: 1%; white-space: nowrap; text-align: right; }
.table--compact td, .table--compact th { padding: 10px var(--s-3); }
.card > .table { margin: 0 calc(-1 * var(--s-3)); width: calc(100% + 2 * var(--s-3)); }
.row-actions { display: inline-flex; gap: var(--s-2); }
/* Phones and upright tablets: every row becomes a card with label / value lines. */
@media (max-width: 899px) {
  .table-wrap { background: none; box-shadow: none; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { margin-bottom: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--raised); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
  .table td { display: flex; justify-content: space-between; gap: var(--s-4); padding: 6px 0; border: 0; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--t-label); text-align: left; flex: none; }
  .table td > :first-child { margin-left: auto; }
  .table .table__actions { width: 100%; justify-content: flex-end; padding-top: var(--s-2); }
  .card > .table { margin: 0; width: 100%; }
  .card > .table tr { box-shadow: none; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
}

/* ---------------------------------------------------------------- tabs (link tabs) */
.tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-5); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs__tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 var(--s-4); color: var(--muted); font-weight: 500; white-space: nowrap; transition: color var(--dur) var(--ease); }
.tabs__tab .icon { width: 18px; height: 18px; }
.tabs__tab:hover { color: var(--ink); }
.tabs__tab::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); transform: scaleX(0); transition: transform var(--dur-panel) var(--ease); }
.tabs__tab[aria-selected="true"] { color: var(--ink); }
.tabs__tab[aria-selected="true"]::after { transform: scaleX(1); }

/* ---------------------------------------------------------------- misc */
.address { line-height: 1.6; }
.secret { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--highlight); }
.secret code { flex: 1; font-size: 18px; font-weight: 600; letter-spacing: .02em; }
