/* FashionFinder.ch – one plain stylesheet, no framework. */

/* Colours: black, white and neutral greys, with red and green only where they mean something. Light is the rule; the dark ones follow below under the same names, so a rule never asks which of
   the two is on. Which one: what the device says, unless the settings page chose one for this browser. That choice
   stands as data-theme on <html> (App.razor from the cookie, theme.js at once when it changes). */
:root {
    color-scheme: light dark; /* the browser's own parts follow: form fields, scroll bars, the page before it has loaded */
    /* The page, what lies on it (cards, the header), and what opens over both (menus, suggestions). The page is
       plain white, like what lies on it: lines set things apart, not shades. --soft is the faint fill of something
       on it that is chosen or under the pointer, and of a field that is set into a surface. */
    --bg: #ffffff;
    --soft: #f5f5f5;
    --surface: #ffffff;
    /* The track that options of which one is chosen lie on (a switch), and an option on it under the pointer. */
    --track: #f2f2f2;
    --track-hover: #ffffff;
    --raised: #ffffff;
    --text: #111111;
    --muted: #666666;
    /* Lines from soft to strong: between parts of one thing and around cards (--line), around what can be pressed
       (--line-strong: chips, outlined buttons), around what can be typed into (--field-line, 3:1 against the
       field, so it is found without its label), and the same under the pointer (--line-hover). */
    --line: #e6e6e6;
    --line-strong: #c9c9c9;
    --field-line: #8f8f8f;
    --line-hover: #6b6b6b;
    /* Red and green as writing and outline, soft as a tint behind them, and as a fill that carries white writing. */
    --accent: #b3261e;
    --accent-soft: #fbe9e7;
    --accent-fill: #b3261e;
    --on-accent: #fff;
    --good: #166534;
    --good-soft: #e8f5ec;
    --good-fill: #166534;
    --on-good: #fff;
    --radius: 6px; /* every corner: pictures, cards, buttons, fields, chips */
    --radius-round: 999px; /* the search fields, the one round shape */
    --inverse: #fff; /* writing on something filled with --text */
    --text-strong: #000;
    --text-soft: #3d3d3d; /* a filled button under the pointer */
    --warn: #92400e;
    --ring: rgb(17 17 17 / .1);
    --glass: rgb(255 255 255 / .92); /* buttons and notes that lie on a picture or on the feed */
    --veil: rgb(255 255 255 / .86); /* the page behind the photo that is being searched */
    /* Shadows of what opens over the page: rgb(var(--shadow) / calc(strength * var(--shadow-k))). On a dark page
       a shadow has to be black and several times as strong to be seen at all. */
    --shadow: 17 17 17;
    --shadow-k: 1;
    --dark-from: #3a3a3a; /* the dark half of the login, which is dark in both looks */
    --dark-to: #111111;
    --skeleton: #ececec;
    --skeleton-shine: rgb(255 255 255 / .9);
    /* The shops photograph for a white page, some with nothing at all behind the article: a picture keeps its
       light ground in the dark too, and so does what is drawn right onto it (the dots). In the dark it is only
       turned down a little (--picture-filter), so a list of white tiles does not glare; --picture-behind is the
       same ground where it is not part of the picture itself and so not turned down with it. A picture that is
       missing is not one. */
    --picture: #f4f4f4;
    --picture-behind: #f0f0f0;
    --picture-filter: none;
    --picture-blend: multiply; /* a picture taken on white takes the colour of its tile; not in the dark, where the tile stays light */
    /* What a picture that is shown whole (the feed) has beside it, as its own background: nothing in the light,
       where it is blended onto the tile; in the dark the white of a shop's photo, turned down together with the
       picture, so the bands beside a photo are the colour of the photo's ground and not a second grey. */
    --picture-fit: transparent;
    --picture-hover: brightness(.96); /* the picture of a card under the pointer: a shade darker than --picture-filter */
    --placeholder: #f4f4f4;
    --shop-ring: transparent; /* around the colours of the shops, some of which are nearly black */
    --shop-keep: 100%; /* how much of a shop's colour a line drawn in it keeps (price chart): the rest is white, in the dark */
    --logo-light: block;
    --logo-dark: none;
    /* Motion, the same in both looks. Three lengths: --dur-1 for what answers the pointer or a press (colour, fill,
       a line, a tooltip), --dur-2 for what opens, arrives or turns (menus, panels, notes, underlines, arrows),
       --dur-3 for a list or a page part that comes in. Nothing that explains a change runs longer than --dur-3;
       only what shows that something is still going on does (spinners, the line at the top, skeletons), and notes
       that stay to be read. Two curves: --ease-out for what arrives or follows (fast at first, then settling),
       --ease-in-out for what goes to and fro. Only opacity and transform move. Every rule that moves something
       has its "prefers-reduced-motion" rule beside it. */
    --dur-1: 120ms;
    --dur-2: 200ms;
    --dur-3: 280ms;
    --ease-out: cubic-bezier(.2, 0, 0, 1);
    --ease-in-out: cubic-bezier(.45, 0, .55, 1);
}
:root[data-theme="light"] { color-scheme: light; }
/* The dark colours stand twice: once for a device that asks for them, once for the choice on the settings page.
   A stylesheet without a build step cannot share them: change both lists together.
   Neutral greys like the black of the logo. Three steps of depth that can be told apart (page, card, menu), lines
   that show on all three, writing at 7:1 and more on each of them, and red and green lighter as writing (at
   least 5:1) but deep as a fill, so the white writing on a badge keeps 4.5:1. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0e0e10; --soft: #0e0e10; --surface: #19191c; --raised: #222226; --text: #f4f4f5; --muted: #a8a8b3;
        --track: #222226; --track-hover: #34343b;
        --line: #3a3a42; --line-strong: #5c5c67; --field-line: #777783; --line-hover: #a0a0ac;
        --swatch-edge: #777783; /* a black dot on the dark page */
        --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f4f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        --accent: #ff6b5c; --accent-soft: #3a1512; --accent-fill: #d92d20; --good: #4ade80; --good-soft: #0f2a1a; --good-fill: #15803d;
        --inverse: #0e0e10; --text-strong: #fff; --text-soft: #d4d4d8; --warn: #f5b34d;
        --ring: rgb(244 244 245 / .18); --glass: rgb(20 20 23 / .92); --veil: rgb(14 14 16 / .86);
        --shadow: 0 0 0; --shadow-k: 3; --dark-from: #2b2b31; --dark-to: #141417;
        --skeleton: #232327; --skeleton-shine: rgb(255 255 255 / .06); --placeholder: #232327;
        --picture-behind: #d8d8d8; --picture-filter: brightness(.9); --picture-blend: normal; --picture-fit: #fff; --picture-hover: brightness(.86);
        --shop-ring: rgb(255 255 255 / .3); --shop-keep: 55%; --logo-light: none; --logo-dark: block;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e0e10; --soft: #0e0e10; --surface: #19191c; --raised: #222226; --text: #f4f4f5; --muted: #a8a8b3;
    --track: #222226; --track-hover: #34343b;
    --line: #3a3a42; --line-strong: #5c5c67; --field-line: #777783; --line-hover: #a0a0ac;
    --swatch-edge: #777783; /* a black dot on the dark page */
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f4f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --accent: #ff6b5c; --accent-soft: #3a1512; --accent-fill: #d92d20; --good: #4ade80; --good-soft: #0f2a1a; --good-fill: #15803d;
    --inverse: #0e0e10; --text-strong: #fff; --text-soft: #d4d4d8; --warn: #f5b34d;
    --ring: rgb(244 244 245 / .18); --glass: rgb(20 20 23 / .92); --veil: rgb(14 14 16 / .86);
    --shadow: 0 0 0; --shadow-k: 3; --dark-from: #2b2b31; --dark-to: #141417;
    --skeleton: #232327; --skeleton-shine: rgb(255 255 255 / .06); --placeholder: #232327;
    --picture-behind: #d8d8d8; --picture-filter: brightness(.9); --picture-blend: normal; --picture-fit: #fff; --picture-hover: brightness(.86);
    --shop-ring: rgb(255 255 255 / .3); --shop-keep: 55%; --logo-light: none; --logo-dark: block;
}
/* "More contrast" asked for in the system (prefers-contrast: more), in either look: the grey writing moves a step
   towards the writing (9:1 and more), the soft lines become lines that are seen (3:1), and the lines around what
   can be pressed or typed into take the colour of the writing. Three lists for the same reason as above. */
@media (prefers-contrast: more) {
    :root { --muted: #4a4a4a; --line: #8f8f8f; --line-strong: #111111; --field-line: #111111; --line-hover: #111111; --swatch-edge: #111111; }
    :root[data-theme="dark"] { --muted: #d4d4d8; --line: #777783; --line-strong: #f4f4f5; --field-line: #f4f4f5; --line-hover: #f4f4f5; --swatch-edge: #f4f4f5; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --muted: #d4d4d8; --line: #777783; --line-strong: #f4f4f5; --field-line: #f4f4f5; --line-hover: #f4f4f5; --swatch-edge: #f4f4f5; }
}
/* The moment the look changes (theme.js marks it for two frames): everything has its new colours at once. Without
   this the page cut to dark while buttons, links and the chosen option faded after it, each at its own pace. */
html[data-theme-switching] *, html[data-theme-switching] *::before, html[data-theme-switching] *::after { transition: none !important; }

* { box-sizing: border-box; }

/* One typeface for everything, served from here (wwwroot/fonts, SIL Open Font License): Hanken Grotesk. Headlines
   are the same face, bold, at sizes that do not shout: the site is a frame for articles of every kind and
   price, and sets no mood of its own. The logo is drawn in the same face. Its @font-face is in Components/App.razor,
   where the file gets its address with the fingerprint (kept by the browser for good). */
:root {
    --font-text: "Hanken Grotesk", "Hanken Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Until the file has arrived on a first visit (and if it never does), the text stands in a face of the device. The
   system's own one runs 6 to 7% wider, so headings and names broke differently and jumped when Hanken Grotesk came.
   Arial is as wide as Hanken Grotesk in its regular weights and 5% wider in bold (measured; Liberation Sans and
   Arimo are drawn to Arial's widths, Roboto is within 1% in regular): taken with the heights of Hanken Grotesk
   (ascent 100%, descent 30% of the size; with size-adjust they are divided by it), a line is as long and as high
   before as after. Only for the Latin letters, so an arrow or a sign Hanken Grotesk does not have still comes from
   the system's face, as before. */
@font-face {
    font-family: "Hanken Fallback"; font-weight: 100 549;
    src: local("Arial"), local("Liberation Sans"), local("Arimo"), local("Roboto");
    ascent-override: 100%; descent-override: 30%; line-gap-override: 0%;
    unicode-range: U+0020-007E, U+00A0-00FF;
}
@font-face {
    font-family: "Hanken Fallback"; font-weight: 550 900;
    src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold");
    size-adjust: 95%; ascent-override: 105.3%; descent-override: 31.6%; line-gap-override: 0%;
    unicode-range: U+0020-007E, U+00A0-00FF;
}
/* The small letters of Hanken Grotesk are low for its size: one step up, the text reads as large as is usual at
   16px, and is as wide. Everything given in rem follows. */
html { font-size: 106.25%; }

/* ---------- Icons (Components/Shared/Icon.razor) ---------- */

/* As large as the text around it and in its colour. */
/* The stroke is 1.75 of the 24 units an icon is drawn on, which is right from about 19px up. Smaller, it would thin
   out with the icon (1.05px at 14.4px) while the letters beside it keep their weight: so it never gets thinner
   than 1.35px on the screen, whatever the size. tan(atan2(1em, 1px)) is the font size as a plain number; a browser
   that cannot work that out keeps the 1.75 written on the drawing itself. The rule follows the font size: an icon
   that needs a size of its own gets it as font-size, not as width and height. */
.icon {
    display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -0.14em; overflow: visible;
    stroke-width: max(1.75, 32.4 / tan(atan2(1em, 1px)));
}
.icon.is-filled { fill: currentColor; }
/* An icon before its words (icon-lead) or after them (icon-trail) keeps this distance and is written right next to
   them, without a space: a space would be narrower, and underlined in a link. A row that sets a gap of its own
   (flex) needs neither. */
.icon-lead { margin-right: 0.4em; }
.icon-trail { margin-left: 0.4em; }
.icon-accent { color: var(--accent); }
.icon.is-spin { animation: icon-spin .9s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon.is-spin { animation-duration: 3s; } }
/* The same drawings for what the stylesheet adds by itself. */
:root {
    --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --icon-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E");
    --icon-ring-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.5 2.5 2.5 5-5.5'/%3E%3C/svg%3E");
    /* "chevron-down" and "x" of Icon.razor, as masks: the arrow of a box that opens (.multi-select) and the button
       that empties a search field. Drawn at 16px, so a little bolder than at the size of the icons. */
    --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
    /* The same arrow for a <select>, which can carry a picture but no mask: drawn in --text, so it stands once
       more in each of the two dark lists at the top. */
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%; /* no enlarged text in landscape on phones */
    overflow-wrap: break-word;
}

a { color: inherit; }
h1 { font-size: 1.9rem; font-weight: 650; line-height: 1.15; letter-spacing: -0.01em; margin: 0.2rem 0 1.1rem; text-wrap: balance; }
h1:focus { outline: none; }
h2 { font-size: 1rem; margin: 0 0 0.6rem; letter-spacing: -0.005em; }
/* A heading below the first has the weight of the first (the browser's own bold, 700, made a section heavier than
   its page) and breaks into lines of even length like it. Running text does not leave a last word alone on a
   line where the browser can help it. */
h2, h3, h4 { font-weight: 650; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
/* Small words in capitals (the brand of an article, the title over a group of filters or a column) are spaced
   out by one measure wherever they stand. */
:root { --caps-track: 0.08em; }

/* The page: how wide its content gets (--page), and the room it keeps from the edge of the screen (--gutter), which
   is never less than what a notch or a rounded corner takes (the safe area, see the viewport in App.razor).
   --header-h is the height of the header, which stays at the top of the window on every screen (nav.js measures
   it), --sticky-top is where something that stays in view under it has to stop. The sizes change
   with the screen: see "Screen sizes and kinds of devices" at the end. */
:root {
    --page: 1160px;
    --gutter: 20px;
    --header-h: 116px;
    --sticky-top: calc(var(--header-h) + 14px);
}
/* What the browser brings into view (the control the Tab key lands on, a heading a link jumps to) stops under the
   header and not behind it: the top of the window that is taken, plus a little air. Tabbing backwards put every
   fourth control under the header, where its focus ring was not seen at all. A page with a second bar that stays
   under the header says so here, once for everything on it; the bar at the bottom edge (the search field of the
   phone, "Speichern" of the settings) is kept clear the same way. A rule that names a place of its own
   (scroll-margin-top) only gives what it needs beyond this. */
html { scroll-padding-top: calc(var(--header-h) + 12px); }
html:has(.home-section > .piece-head) { scroll-padding-top: calc(var(--header-h) + 58px); }
html:has(.favorites-jump) { scroll-padding-top: calc(var(--header-h) + 62px); }
html:has(.settings-tabs) { scroll-padding-top: calc(var(--header-h) + 64px); }
html:has(.settings-save), html:has(.welcome-actions) { scroll-padding-bottom: 88px; }
.container {
    max-width: var(--page); margin: 0 auto;
    padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
main.container { padding-top: 40px; padding-bottom: 88px; min-height: 70vh; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header / footer ---------- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { display: block; height: 28px; width: auto; }
.logo .logo-light { display: var(--logo-light); }
.logo .logo-dark { display: var(--logo-dark); }

/* The search in the header is one rounded field: the text, the photo upload and the round button to send it off
   all stand inside it. The field carries the suggestions, so they are as wide as the whole of it. */
.header-search {
    position: relative; display: flex; align-items: center; flex: 1; gap: 2px; min-width: 220px; max-width: 640px; min-height: 48px; margin: 0 auto;
    padding: 4px; background: var(--soft); border: 1px solid var(--field-line); border-radius: var(--radius-round);
    transition: border-color var(--dur-1), background-color var(--dur-1), box-shadow var(--dur-1);
}
.header-search:hover { border-color: var(--line-hover); }
.header-search:focus-within { background: var(--surface); border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.header-search .search-field { position: static; }
.header-search input[type="search"] {
    flex: 1; padding: 6px 6px 6px 14px; border: 0; border-radius: var(--radius-round); background: transparent; text-overflow: ellipsis;
}
.header-search input[type="search"]:focus { outline: none; } /* the field around it shows the focus */
.header-search .suggestions { top: calc(100% + 6px); }
.header-search .search-submit, .header-search .image-upload-compact label {
    display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 0;
    border-radius: 50%; transition: background-color var(--dur-1), color var(--dur-1);
}
.header-search .search-submit:hover { background: var(--text-soft); border-color: var(--text-soft); }
.header-search .image-upload-compact label { background: transparent; border: 0; color: var(--muted); }
.header-search .image-upload-compact label:hover, .header-search .image-upload-compact label:focus-within { background: var(--line); color: var(--text); }
.header-search .image-upload-compact label:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.header-search .search-submit .icon, .header-search .image-upload-compact .icon { display: block; font-size: 18px; }
.header-search .search-submit-label { display: none; }
/* The magnifier is for the round button only: where the button says "Suchen", it stays away. */
.search-box:not(.header-search) .search-submit-icon { display: none; }
@media (prefers-reduced-motion: reduce) {
    .header-search, .header-search .search-submit, .header-search .image-upload-compact label { transition: none; }
}
/* ---------- Signs of life (busy.js) ---------- */

/* A search that was sent off: a turning ring takes the place of the magnifier, or of the word, until the result
   (or its own wait) is on the page. The button keeps its size. */
.search-box.is-busy .search-submit { position: relative; color: transparent; pointer-events: none; }
.search-box.is-busy .search-submit::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; box-sizing: border-box;
    border: 2px solid var(--inverse); border-right-color: transparent; border-radius: 50%;
    animation: wait-spin .7s linear infinite;
}
/* A page or a list that takes longer than a moment: a line along the top of the window, quick at first and ever
   slower, so it never arrives before the page does; then it runs to the end and fades. The list that is about to
   be replaced steps back meanwhile. */
html[data-loading]::before, html:has(.search-layout.is-busy)::before {
    content: ""; position: fixed; z-index: 1000; top: 0; left: 0; right: 0; height: 2px; background: var(--text);
    transform-origin: left center; pointer-events: none;
    animation: page-line 12s cubic-bezier(.1, .6, .2, 1) both;
}
/* A filter changed while the text of the search is still being interpreted (Search.razor, is-busy): the same, after
   the moment in which most lists are there. Every other filter tap starts the line from the tap (busy.js). */
html:has(.search-layout.is-busy)::before { animation-delay: .15s; }
.search-layout.is-busy .results { animation: list-wait var(--dur-2) .15s both; }
@keyframes list-wait { to { opacity: .5; } }
/* A filter that was tapped, until the server's answer (with the new list) replaces it (busy.js, data-pending): the
   chip looks chosen or not chosen at once, the pill is struck out. At once means without the transition of the
   buttons, also when it goes: the answer then shows the same, and nothing fades twice. */
.chip[data-pending] { transition: none; }
.chip[data-pending="on"] { border-color: var(--text); background: var(--soft); box-shadow: inset 0 0 0 1px var(--text); }
.chip.is-active[data-pending="off"] { border-color: var(--line-strong); background: var(--surface); box-shadow: none; }
.chip.is-removable[data-pending] { color: var(--muted); text-decoration: line-through; }
/* The line the new list of a filter starts at when busy.js brings it into view: where the sidebar stops under the
   header, so the sidebar and the chip that was just tapped stay where they are. */
.search-layout > .results { scroll-margin-top: 2px; } /* with the scroll-padding of the page: --sticky-top */
/* The list can take the focus only while busy.js has put it there (the pill that had it is gone): a ring for the keyboard alone. */
.search-layout > .results:focus:not(:focus-visible) { outline: none; }
html[data-loading="done"]::before { animation: page-line-done .3s ease-out both; }
@keyframes page-line {
    from { transform: scaleX(0); }
    8% { transform: scaleX(.45); }
    25% { transform: scaleX(.7); }
    to { transform: scaleX(.94); }
}
@keyframes page-line-done { from { transform: scaleX(1); } to { transform: scaleX(1); opacity: 0; } }
html[data-loading="on"] .results { opacity: .5; transition: opacity var(--dur-2); }
@media (prefers-reduced-motion: reduce) {
    html[data-loading]::before, html:has(.search-layout.is-busy)::before { animation: none; opacity: .6; }
    html[data-loading="done"]::before { opacity: 0; }
    html[data-loading="on"] .results { transition: none; }
}

/* Stands in for the search on the start page, so the links stay on the right. As tall as the search field, so the
   header is as tall on the start page as on every other page and the logo stays where it is from page to page. */
.header-spacer { flex: 1; min-height: 48px; }

/* The links of the header (favourites, wardrobe, account or sign-in, settings) are four of a kind: one size of
   symbol (--header-icon), one colour, and the same faint fill under the pointer. The fill needs room around the
   writing; the negative margin takes that room back, so the row is laid out as if the links had no padding. */
.site-header { --header-icon: 22px; }
.header-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; margin: -6px;
    border-radius: var(--radius); text-decoration: none; font-weight: 600; white-space: nowrap; transition: background-color var(--dur-1);
}
.header-link .icon { font-size: var(--header-icon); }
.header-account { display: flex; align-items: center; gap: 14px; }
/* Only where a pointer really hovers: on touch screens a tap would leave the fill behind. */
@media (hover: hover) { .header-link:hover { background: var(--soft); } }
@media (prefers-reduced-motion: reduce) { .header-link { transition: none; } }
/* The page the visitor is on (favourites, wardrobe, account or sign-in, settings): its icon is drawn bold. */
.header-link[aria-current] .icon { stroke-width: 2.5; }
.badge {
    display: inline-block; min-width: 1.4em; padding: 0 6px; margin-left: 4px;
    border-radius: var(--radius); background: var(--accent-fill); color: var(--on-accent); font-size: 0.8rem; text-align: center;
}
/* The number of favourites in the header has just changed (favorites.js, data-tick): one short beat, so the heart
   that was pressed further down is seen to arrive up here. "scale" and not "transform": on small screens the
   number is put in its place with a transform of its own. */
.header-favorites .badge[data-tick] { animation: badge-tick var(--dur-2) ease-out; }
@keyframes badge-tick { 0% { scale: .6; } 60% { scale: 1.15; } }
@media (prefers-reduced-motion: reduce) { .header-favorites .badge[data-tick] { animation: none; } }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 18px 0; }

/* ---------- Form elements ---------- */

/* One height for everything that is typed into or opened in a row or a column of fields (the filters of the
   search, the row above its list): fields, the box that opens (.multi-select) and the track of the views
   (.view-track) are all --field-h tall, with writing of one size. */
:root { --field-h: 44px; }
input[type="search"], input[type="number"], select {
    font: inherit; padding: 8px 12px; border: 1px solid var(--field-line);
    border-radius: var(--radius); background: var(--surface); color: var(--text); min-height: var(--field-h);
}
/* Not the field of the search itself: it stands inside a rounded field that gives the height (.header-search, .hero-search). */
.search-box input[type="search"] { min-height: 0; }
/* The arrow of a <select> is the one of the boxes that open (.multi-select), not each browser's own. */
select {
    -webkit-appearance: none; appearance: none; padding-right: 36px; text-overflow: ellipsis;
    background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
/* The cross that empties a search field (Chromium and Safari draw one, in their own blue): the "x" of the icons
   in the grey of the page, darker under the pointer. The room around it is given back, so the field keeps its height. */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none; appearance: none; flex: none; width: 28px; height: 28px; margin: -2px -6px -2px 4px; cursor: pointer;
    background: var(--muted); -webkit-mask: var(--icon-x) center / 16px no-repeat; mask: var(--icon-x) center / 16px no-repeat;
}
input[type="search"]::-webkit-search-cancel-button:hover { background: var(--text); }
input:hover, select:hover, textarea:hover { border-color: var(--line-hover); }
/* The example in an empty field: the browser's own grey is too faint on a dark field. */
::placeholder { color: var(--muted); opacity: 1; }
/* What the browser draws itself and fills with a colour of its own (a blue): in the colour of the text, wherever
   it stands, also in a form that has no class for it. */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--text); }

button, .button {
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
    padding: 9px 18px; border-radius: var(--radius); border: 1px solid var(--text);
    background: var(--text); color: var(--inverse);
    transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
@media (prefers-reduced-motion: reduce) { button, .button { transition: none; } }
.button-small { padding: 4px 10px; font-size: 0.85rem; background: transparent; color: var(--text); border-color: var(--line-strong); }
button:disabled { opacity: 0.5; cursor: default; }
.button-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); width: 100%; }
/* Under the pointer every button answers, as chips, links and the fields do: a filled one a shade softer
   (--text-soft, with --inverse on it 10:1 and more in both looks), one with a grey line gets the line of the writing,
   one with that line already gets a faint fill. Written with :where, so a button that has an answer of its own
   keeps it. Not on touch screens, where "under the pointer" stays on after a tap. */
@media (hover: hover) and (pointer: fine) {
    button:where(:not([class])):where(:enabled):hover,
    .button:where(:not(.button-outline, .button-small, .button-secondary, .button-danger)):hover { background: var(--text-soft); border-color: var(--text-soft); }
    .button-small:where(:not(:disabled)):hover, .button-secondary:where(:not(:disabled)):hover { border-color: var(--text); }
    .button-outline:where(:not(:disabled)):hover { background: var(--track); }
}

/* The focus of the keyboard: one ring for everything, two pixels in the colour of the writing, two pixels away, so
   it stands on the page and not on the thing. A link, a summary or a tick box has no corners of its own: its ring
   gets soft ones, like the ring of a button or a field (:where, so a corner that is set anywhere wins). */
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
:where(a, summary, label, input[type="checkbox"], input[type="radio"], [tabindex]):focus-visible { border-radius: 4px; }

/* ---------- Pressed ---------- */

/* Whatever can be pressed answers at once, before the server does: it steps back for as long as the finger or the
   mouse button is down. Nothing moves and nothing changes its size, the page stays still; only the opacity
   changes, which the browser does without laying anything out again. Phones no longer flash their own grey over
   what is tapped (this says the same, in the colours of the page), and a tap is not held back to see whether a
   second one follows (the feed and the cards that are swiped set their own touch-action further down). */
:is(a, button, summary, label, select, input, textarea) { touch-action: manipulation; }
:is(a, button, summary, .check, .image-upload label, .image-upload-compact label) { -webkit-tap-highlight-color: transparent; }
:is(button:not(:disabled), .button, a.chip, summary, .check, .header-link, .logo, .site-nav a, .site-footer a,
    .product-card-link, .feed-text, .suggestion, .category-index a, .letters a, .breadcrumb a, .color-variants a, .colour-swatch, .colour-pick,
    .piece-head a, a.brand, .image-upload label, .image-upload-compact label):active { opacity: .62; }

/* ---------- Search suggestions (SearchBox) ---------- */

/* The field carries the list, so the list is exactly as wide as the field. */
.search-field { position: relative; display: flex; flex: 1; min-width: 0; }
.search-field input { flex: 1; width: 100%; min-width: 0; }
/* Shown while the focus is in the form; the hover keeps it there for a click in browsers that do not focus links. */
.suggestions {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
    min-width: min(400px, 100vw - 40px); /* the field in the header is narrow: room for the article names */
    max-height: min(70vh, 460px); overflow-y: auto; padding: 6px; text-align: left;
    background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 28px rgb(var(--shadow) / calc(.14 * var(--shadow-k)));
}
.search-box:focus-within .suggestions, .suggestions:hover { display: block; }
/* The list arrives with a short fade from the field it belongs to (menu-in, like the boxes of the filters), once
   when it opens; what is typed after that changes its rows without it. */
.suggestions { animation: menu-in var(--dur-1) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .suggestions { animation: none; } }
.suggestions-title { padding: 8px 8px 2px; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--caps-track); }
.suggestion { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius); text-decoration: none; }
.suggestion:hover, .suggestion.is-active { background: var(--soft); }
.suggestion.is-active { outline: 2px solid var(--text); outline-offset: -2px; }
.suggestion-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.suggestion-icon { flex: none; width: 1.4em; text-align: center; font-size: 1rem; line-height: 1; color: var(--muted); }
.suggestion .price s { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; text-align: right; }
.suggestion .count, .suggestion .price { flex: none; white-space: nowrap; }
.suggestion .price { font-weight: 600; font-size: 0.9rem; }
.suggestion.is-product img, .suggestion.is-product .image-placeholder {
    flex: none; width: 40px; height: 50px; object-fit: cover; border-radius: var(--radius); background-color: var(--picture);
}
.suggestion.is-product .suggestion-text { display: flex; flex-direction: column; line-height: 1.3; }
.suggestion .brand { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--caps-track); color: var(--muted); } /* as ".brand" on a card */
.suggestion .name { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Start page ---------- */

.hero { padding: 36px 0 20px; }
.hero h1 { font-size: 2rem; }
.hero p { color: var(--muted); max-width: 560px; margin: 0; }
.hero .hero-actions { max-width: none; margin-top: 24px; }
/* The start page, from the left edge: the question, what the site does, and under them the field with the photo
   search beside it. */
.hero.is-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); column-gap: 12px; padding: 56px 0 8px; }
.hero.is-home h1 { grid-column: 1 / -1; font-size: 2.7rem; letter-spacing: -0.025em; margin: 0 0 8px; }
.hero .hero-lead { grid-column: 1 / -1; max-width: none; margin: 0; font-size: 1rem; line-height: 1.5; }
/* One round field like the one in the header, only larger: the text and the button stand inside it, and it
   carries the suggestions, so they are as wide as the whole of it. */
.hero-search {
    position: relative; display: flex; align-items: center; gap: 6px; margin: 24px 0 0; padding: 6px;
    background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--radius-round);
    transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.hero-search:hover { border-color: var(--line-hover); }
.hero-search:focus-within { border-color: var(--text); box-shadow: 0 0 0 3px var(--ring); }
.hero-search .search-field { position: static; }
.hero-search input[type="search"] { flex: 1; padding: 12px 8px 12px 20px; font-size: 1.05rem; border: 0; border-radius: var(--radius-round); background: transparent; text-overflow: ellipsis; }
.hero-search input[type="search"]:focus { outline: none; } /* the field around it shows the focus */
.hero-search button { flex: none; padding: 12px 26px; border-radius: var(--radius-round); }
.hero-search .suggestions { top: calc(100% + 8px); }
/* The arrow that opens the field to two lines: small and quiet beside the button, round like it. */
.hero-search .search-expand {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; margin-right: 2px;
    color: var(--muted); background: transparent; border: 0; border-radius: 50%; transition: background-color var(--dur-1), color var(--dur-1);
}
.hero-search .search-expand:hover { color: var(--text); background: var(--line); }
.hero-search .search-expand .icon { display: block; font-size: 18px; transition: transform var(--dur-1); }
.hero-search .search-expand[aria-expanded="true"] .icon { transform: rotate(180deg); }
/* The text area that takes the place of the input once the field is used (suggest.js): one line high like it, and
   as high as its text from there on, without a scrollbar. Opened with the arrow it has two lines at least. The
   arrow and the button stay in the middle of the height, and a field of several lines has corners that suit it. */
.hero-search [hidden] { display: none; }
.hero-search textarea {
    flex: 1; min-width: 0; box-sizing: border-box; padding: 10px 8px 10px 20px; font: inherit; font-size: 1.05rem; line-height: 1.45; color: inherit;
    border: 0; background: transparent; resize: none; overflow: hidden;
}
.hero-search textarea:focus { outline: none; }
.hero-search.is-expanded textarea { min-height: calc(2.9em + 20px); }
.hero-search.is-tall { border-radius: 26px; }
.hero:has(.hero-search.is-tall) .image-upload label { border-radius: 26px; }
@media (prefers-reduced-motion: reduce) { .hero-search .search-expand, .hero-search .search-expand .icon { transition: none; } }
/* The photo search is the button beside the field, as high as the field. */
.hero .image-upload { align-self: stretch; max-width: none; margin: 24px 0 0; }
.hero .image-upload label { height: 100%; justify-content: center; gap: 10px; padding: 0 22px; background: none; border-style: solid; border-color: var(--field-line); border-radius: var(--radius-round); }
.hero .image-upload label:hover, .hero .image-upload label:focus-within { border-color: var(--line-hover); }
.hero .image-upload-icon { font-size: 1.3rem; color: inherit; }
.hero .image-upload .hint { display: none; }
/* Without the photo search (it is switched off, ImageUpload draws nothing) the field stands alone: as wide as it is
   beside the button on an ordinary monitor, on every monitor, instead of leaving the button's column empty and
   growing to 1250px on a large one, where "Suchen" stood far from the text. */
.hero.is-home > .hero-search:last-child { grid-column: 1 / -1; max-width: 808px; }
@media (max-width: 900px) {
    .hero.is-home { display: block; }
    .hero-search { margin-top: 22px; }
    .hero .image-upload { margin-top: 10px; }
    .hero .image-upload label { height: auto; padding: 12px 18px; }
}

/* The categories as an index: the names in columns, each with how much there is. */
.category-index { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 40px; }
.category-index li { border-bottom: 1px solid var(--line); }
.category-index a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; text-decoration: none; font-weight: 500; }
/* A name too long for its column breaks at a syllable ("Sportbeklei-dung" on a small phone) instead of running out of it. */
.category-index .name { display: flex; align-items: center; gap: 10px; min-width: 0; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
.category-index .name .icon { font-size: 1.2em; }
.category-index a:hover .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.category-index .count { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
/* Three columns where four are too narrow for a name on one line with its number (tablets, an opened folding phone).
   After the rule above: before it, it never applied. */
@media (max-width: 1000px) { .category-index { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; } }

.shop-strip ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); }
.shop-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; box-shadow: 0 0 0 1px var(--shop-ring); }

/* ---------- Search page ---------- */

/* The path is a row with one gap between all of its parts: the spaces of the markup stood before an arrow and not
   after it, so the arrows leaned on the link that follows. A long path goes on in a second line. */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--muted); font-size: 0.85rem; }
.breadcrumb > * { min-width: 0; }
.breadcrumb .icon { font-size: 0.9em; opacity: .7; }

.search-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .search-layout { grid-template-columns: 1fr; } }

.filters { padding: 0 12px 0 0; } /* the room on the right is for its own scroll bar */
/* One block per filter with a line in between; the first one follows the head (or the top of the box). */
.filter-group { padding: 14px 0; border-top: 1px solid var(--line); }
.filter-group:first-child { border-top: none; }
.filter-group h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--caps-track); color: var(--muted); margin-bottom: 0.55rem; }
.filters-actions { display: none; }
/* A button that reads as a link: for the small "undo" actions next to something bigger. */
.text-button {
    padding: 2px 0; border: none; background: none; color: var(--muted); font-weight: 500; font-size: 0.85rem;
    text-decoration: underline; text-underline-offset: 3px;
}
.text-button:hover { color: var(--text); }
/* Wide screens: the filters stay next to the list while it scrolls, and scroll by themselves when they are taller. */
@media (min-width: 761px) {
    .filters:not(.skeleton-filters) {
        position: sticky; top: var(--sticky-top); max-height: calc(100vh - var(--sticky-top) - 16px); overflow-y: auto;
        /* On a tablet the browser's bars come and go: the column ends above them (dvh), not behind them. */
        max-height: calc(100dvh - var(--sticky-top) - 16px);
        overscroll-behavior: contain; scrollbar-width: thin;
    }
    /* A box that scrolls cuts off what reaches over its edge, and the ring of the keyboard focus does (2px, 2px
       away from the chip or the field): the box is 4px larger on the three sides without room, and has that much
       room inside, so everything stands where it stood and the ring is whole. Not over the feed, where the
       panel has its own room. */
    .filters:not(.skeleton-filters):not(.is-over-feed.is-open) { top: calc(var(--sticky-top) - 4px); margin: -4px 0 -4px -4px; padding: 4px 12px 4px 4px; }
}
.check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.check:hover { color: var(--text-strong); }
/* Every box to tick is in the colour of the text, in the filters as on the settings page: the browser's own blue
   would be the only blue of the site. (A light tick colour makes the browser draw a dark tick, so the dark look works.) */
.check input { accent-color: var(--text); }
.filters .check input { flex: none; margin: 0; }
.price-range span { color: var(--muted); }
.price-range { display: flex; align-items: center; gap: 6px; }
.price-range input { width: 100%; min-width: 0; }
/* No arrows to step the price up and down: in a field this narrow they take the room of the number. */
.price-range input { -moz-appearance: textfield; appearance: textfield; }
.price-range input::-webkit-outer-spin-button, .price-range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-weight: 500; font-size: 0.9rem;
    background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.chip.is-small { padding: 2px 8px; font-size: 0.8rem; }
.chip.is-active { border-color: var(--text); background: var(--soft); box-shadow: inset 0 0 0 1px var(--text); }
.chip.is-static { cursor: default; }
.chip.is-soft { border-style: dashed; color: var(--muted); }
.facet-search { width: 100%; margin-bottom: 6px; }
/* 4px of room on every side (taken back by the margin, and kept when the list scrolls to the box that has the
   focus): a list that scrolls cuts off the focus ring of a tick box at its edge. */
.scroll-list { max-height: 260px; overflow-y: auto; padding: 4px; margin: -4px 0 -4px -4px; scroll-padding: 4px; }
.check .count { margin-left: auto; }

/* A closed box that opens into a checkbox list (sizes): shows the choice instead of every option */
.multi-select { border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); }
.multi-select summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px 7px 12px;
    min-height: calc(var(--field-h) - 2px); /* with the line around the box: as tall as a field */
    cursor: pointer; list-style: none; user-select: none; color: var(--muted);
}
.multi-select summary::-webkit-details-marker { display: none; }
.multi-select summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-select summary.has-value { color: var(--text); font-weight: 600; }
/* The arrow (--icon-chevron, the one a <select> shows too) turns over when the box opens, and nothing else of it moves. */
.multi-select summary::after {
    content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
    -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat;
    transition: transform var(--dur-2) var(--ease-out);
}
.multi-select[open] summary::after { transform: rotate(180deg); }
/* The list of an opened box comes in with a short fade from above, each time it opens. */
.multi-select[open] > .scroll-list { animation: menu-in var(--dur-1) var(--ease-out); }
/* --menu-from: from where; a list that opens upwards (the suggestions over the field at the bottom of a phone) comes from below. */
@keyframes menu-in { from { opacity: 0; transform: translateY(var(--menu-from, -4px)); } }
@media (prefers-reduced-motion: reduce) {
    .multi-select summary::after { transition: none; }
    .multi-select[open] > .scroll-list { animation: none; }
}
.multi-select summary:hover, .multi-select[open] summary { color: var(--text); }
.multi-select[open] { border-color: var(--line-hover); }
.multi-select .scroll-list { border-top: 1px solid var(--line); margin: 0; padding: 4px 10px 6px; max-height: 240px; }
.multi-select .check .swatch { margin-right: 0; }
.check.is-below-select { margin-top: 6px; }
.count { color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.hint { color: var(--muted); font-size: 0.85rem; }
/* A paragraph of it right on a page (what "Für dich" shows and why, what a list of the account holds) is no wider
   than can be read in one go: on a large monitor a line was 200 letters long. */
main > p.hint { max-width: 75ch; }
/* A note in a box. Red is for what went wrong or needs doing (a link that is no longer valid, a closed
   registration); is-info is for what is merely said (how a page fills, what is not there yet): the faint fill of
   the page with a line around it, which shows in the dark as well, where that fill is the page's own colour. */
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; }
.notice.is-info { background: var(--soft); border: 1px solid var(--line); }
.more { text-align: center; margin-top: 24px; }
/* Where a list that was loaded batch by batch ends: said in a quiet line, so the footer does not just turn up. */
.list-end { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: 0.9rem; }
/* The heading of a search repeats what was typed. On a phone a long description would take three lines and more
   of the screen that the field at the bottom already shows it on: two lines of it, then it is cut. */
@media (max-width: 760px) {
    .search-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
}

.interpretation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.interpretation-head { margin: 0; }
.interpretation > .hint { flex-basis: 100%; }
.interpretation-head strong { margin-right: 4px; }
.interpretation .hint { margin: 8px 0 0; }
.swatch {
    display: inline-block; width: 14px; height: 14px; border-radius: 50%;
    /* The edge like the one of the dots on a card (.colour-swatch): 3:1 around white on the white page, and the
       light --swatch-edge around black on the dark one. */
    border: 1px solid var(--swatch-edge, rgb(0 0 0 / .44)); vertical-align: -2px; margin-right: 4px;
}
.chip .swatch { margin-right: 0; }

.results-bar { display: flex; align-items: center; margin-bottom: 14px; color: var(--muted); gap: 8px 16px; flex-wrap: wrap; min-height: var(--field-h); }
.results-count strong { color: var(--text); font-size: 1.05rem; }
/* How many colours the cards stand for: said where there is room for it. */
@media (max-width: 560px) { .results-colours { display: none; } }
.results-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 0.9rem; }
.results-sort select { font-size: 1rem; color: var(--text); } /* the word before it is small, the field reads like every field */
.results-bar > .skeleton:last-child { margin-left: auto; }
/* The filters that are switched on, above the list: a click takes one away. */
.active-filters { align-items: center; margin: -2px 0 16px; }
.chip.is-removable { cursor: pointer; padding-right: 8px; background: var(--soft); border-color: var(--line-strong); }
.chip.is-removable:hover { border-color: var(--text); }
/* The pill of a filter that was just switched on (busy.js, data-added) fades in, so it is seen which one is new. */
.chip.is-removable[data-added] { animation: wait-fade var(--dur-2) both; }
@media (prefers-reduced-motion: reduce) { .chip.is-removable[data-added] { animation: none; } }
.chip-x { display: flex; color: var(--muted); font-size: 0.85rem; line-height: 1; }
.chip.is-removable:hover .chip-x { color: var(--accent); }
.active-filters .text-button { margin-left: 4px; }
button.chip:not(.is-static):hover { border-color: var(--text); }
.empty { color: var(--muted); padding: 30px 0; }
/* A list of the visitor with nothing in it yet (EmptyState.razor): a drawing of what belongs here, one sentence, the
   next step. The sentence is no wider than a line reads well. */
.empty > .icon { display: block; margin: 0 0 10px; font-size: 2rem; stroke-width: 1.5; }
.empty > .icon + p { max-width: 60ch; margin: 0; }
/* The search list with nothing in it: a box in the place of the articles. */
.results .empty {
    padding: 44px 20px; text-align: center;
    background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}
.results .empty p { margin: 0 0 8px; }
.empty-title { color: var(--text); font-weight: 700; font-size: 1.15rem; }

/* Search as a feed: one article fills the screen, the next one follows by scrolling. Its pictures stand side by
   side and are swiped through; both snap into place by themselves. feed.js adds the double tap (favourite), the
   dots and the arrows, and moves both with the finger on touch screens.
   The feed has two sizes (the buttons of FeedControls.razor; feed.js marks the page with data-feed-full):
   - inside the page (the rule): the header stays, the feed takes the room of the window under it. For that the
     page is as tall as the window while the feed is open, the content is the box the feed fills, and the footer
     is left out;
   - over the whole screen, header included.
   container-type: an article is as wide as a picture that fills the height of the feed, whichever size it has. */
html:has(.feed:not(.is-closing)) { overflow: hidden; }
.feed {
    position: fixed; inset: 0; z-index: 50; background: var(--bg); touch-action: manipulation; animation: wait-fade var(--dur-2) both;
    -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; container-type: size;
}
html:not([data-feed-full]):has(.feed:not(.is-closing)) body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
html:not([data-feed-full]):has(.feed:not(.is-closing)) .site-header { flex: none; }
html:not([data-feed-full]):has(.feed:not(.is-closing)) main.container {
    position: relative; flex: 1; width: 100%; min-height: 0; box-sizing: border-box; overflow: hidden;
}
html:not([data-feed-full]):has(.feed:not(.is-closing)) .site-footer { display: none; }
/* Over everything of the page it lies on (the cards that follow it too), and under the header and what that
   opens over the page (suggestions, the menu of the categories: 10 and more). */
html:not([data-feed-full]) .feed:not(.is-closing) { position: absolute; z-index: 9; }
/* What the feed covers is out of reach while it is open, for the keyboard and for a screen reader too: the Tab key
   walked on through the filters, the sorting and the page's links behind the feed, with the focus nowhere to be
   seen. The content is hidden as a whole and the feed (and the filters it opens over itself) is shown again inside
   it; over the whole screen the header and the footer lie behind the feed as well. Once the feed has faded in, so
   the page is still behind it while it does. */
html:has(.feed:not(.is-closing)) main.container { visibility: hidden; transition: visibility 0s var(--dur-2); }
html:has(.feed:not(.is-closing)) :is(.feed, .filters.is-over-feed.is-open) { visibility: visible; }
html[data-feed-full]:has(.feed:not(.is-closing)) :is(.site-header, .site-footer) { visibility: hidden; transition: visibility 0s var(--dur-2); }
/* position: feed.js measures where an article (a picture) starts from its box.
   Whole pixels: under a header that is 100.08px tall the articles would be 711.92px each, and with such a height the
   browser snaps back by one article when the one on the screen is taken out ("nicht mein Stil"). */
.feed-scroll {
    position: relative; height: 100%; height: round(down, 100%, 1px); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none;
}
/* Once feed.js follows the finger (data-paged), the browser leaves swipes alone and only keeps the zoom with two
   fingers: its own fling runs past articles. Also on everything inside: the pictures scroll on their own, so what
   the feed says about touches does not reach them. */
.feed-scroll[data-paged], .feed-scroll[data-paged] * { touch-action: pinch-zoom; }
/* The feed of the search (data-feed-free) scrolls like any page: nothing snaps, and up and down is the browser's
   own scrolling, fling included. Sideways (the pictures) stays with feed.js. */
.feed-scroll[data-feed-free] { scroll-snap-type: none; }
.feed-scroll[data-feed-free] > * { scroll-snap-align: none; }
.feed-scroll[data-paged][data-feed-free], .feed-scroll[data-paged][data-feed-free] * { touch-action: pan-y pinch-zoom; }
/* The filters of the search while its feed is open (Search.razor: the feed's filter button opens them): the same
   panel as beside the grid, as a column over the left edge of the feed, the whole width on a phone. Its head
   (the button "Filter") and the button at its end close it again. Over the feed (9, or 50 on the whole screen),
   and inside the page still under what the header opens: the content is a layer of its own for that. */
html:not([data-feed-full]):has(.feed:not(.is-closing)) main.container { isolation: isolate; }
/* The button "Filter" stays at the top and the actions at the bottom; only the options between them scroll, with
   their scroll bar at the panel's right edge. */
.filters.is-over-feed.is-open {
    position: absolute; inset: 0 auto 0 0; z-index: 10; box-sizing: border-box; width: min(100%, 320px); max-height: none; padding: 12px 16px;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--bg); border: none; border-right: 1px solid var(--line); border-radius: 0;
}
html[data-feed-full] .filters.is-over-feed.is-open { position: fixed; z-index: 51; padding-top: max(12px, env(safe-area-inset-top)); }
.filters.is-over-feed.is-open .filters-toggle { display: flex; flex: none; width: 100%; padding: 10px 14px; }
.filters.is-over-feed.is-open .filters-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-top: 4px; }
.filters.is-over-feed.is-open .filters-options {
    flex: 1 1 auto; min-height: 0; margin-right: -16px; padding-right: 16px;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.filters.is-over-feed.is-open .filters-actions { display: grid; flex: none; gap: 8px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.feed-control.is-filter { position: relative; }
.feed-control.is-filter .badge { position: absolute; top: -7px; right: -7px; margin: 0; font-size: 0.7rem; line-height: 1.5; }
/* Beside the panel, not under it: on a screen with room for both, the feed starts where the open panel ends, so
   the article and its name and price stay in view while they are filtered (the feed lays its article out for
   the width it is given). */
@media (min-width: 761px) {
    .filters.is-over-feed.is-open ~ .results .feed { left: min(100%, 320px); }
}
@media (max-width: 760px) {
    .filters.is-over-feed.is-open { width: 100%; border-right: none; }
    html:not([data-feed-full]) body:has(.site-header:not(.no-phone-search) .header-search) .filters.is-over-feed.is-open {
        bottom: calc(72px + env(safe-area-inset-bottom));
    }
}
.feed-scroll::-webkit-scrollbar, .feed-track::-webkit-scrollbar { display: none; }
/* What stands in the corner: the filters of the search, and the track of the views (see "View track"). */
.feed-controls { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; }
.feed-control {
    display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
    border-radius: var(--radius); border-color: var(--line); background: var(--glass); color: var(--text); font-size: 1.25rem; line-height: 1;
    box-shadow: 0 2px 10px rgb(var(--shadow) / calc(.12 * var(--shadow-k)));
}
.feed-control:hover { border-color: var(--text); }
/* The track of the views in the corner of the feed: on glass, like the buttons, over the pictures. */
.feed-controls .view-track { padding: 3px; background: var(--glass); border-color: var(--line); box-shadow: 0 2px 10px rgb(var(--shadow) / calc(.12 * var(--shadow-k))); }
.feed-controls .view-track-item { width: 40px; height: 34px; }
/* As wide as a picture of the usual shape that fills the height: big on a monitor, the whole screen on a phone. */
.feed-item {
    display: flex; flex-direction: column; width: min(100%, 78vh); width: min(100%, 78cqh); height: 100%; margin: 0 auto;
    background: var(--surface); scroll-snap-align: start; scroll-snap-stop: always; user-select: none; -webkit-user-select: none;
}
.feed-media { position: relative; flex: 1; min-height: 0; background: var(--picture-behind); }
.feed-track {
    position: relative; display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain; scrollbar-width: none;
}
.feed-picture { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; background: var(--picture-behind); isolation: isolate; }
.feed-picture img, .feed-picture .image-placeholder {
    display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; -webkit-user-drag: none;
}
/* The picture is shown whole, so there are bands beside or above it: they and the ground of the photo are one
   colour, like the tile of a card (--picture-fit, --picture-blend). */
.feed-picture img:not(.image-placeholder) { background-color: var(--picture-fit); mix-blend-mode: var(--picture-blend); }
.feed-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.feed-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(17 17 17 / .22); transition: background-color var(--dur-1), transform var(--dur-1); }
.feed-dots i.is-active { background: #111111; transform: scale(1.25); }
/* Arrows are for the mouse; a finger swipes. */
.feed-arrow {
    position: absolute; top: 50%; display: none; place-items: center; width: 40px; height: 40px; margin-top: -20px; padding: 0;
    border-radius: var(--radius); border-color: var(--line); background: var(--glass); color: var(--text); font-size: 1.35rem; line-height: 1;
}
.feed-arrow.is-previous { left: 12px; }
.feed-arrow.is-next { right: 12px; }
@media (hover: hover) and (pointer: fine) { .feed-arrow:not([hidden]) { display: grid; } }
.feed-heart {
    position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; display: grid; place-items: center;
    font-size: 104px; line-height: 1; color: var(--accent-fill); filter: drop-shadow(0 2px 14px rgb(255 255 255 / .95)); opacity: 0; pointer-events: none;
}
.feed-heart.is-bursting { animation: feed-heart .9s ease-out both; }
@keyframes feed-heart {
    0% { opacity: 0; transform: scale(.2) rotate(-14deg); }
    22% { opacity: 1; transform: scale(1.15) rotate(0); }
    36% { transform: scale(.94); }
    50%, 72% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: translateY(-36px) scale(1.2); }
}
/* How the feed is used: said once on the article it opens with, then it goes away by itself. Once it has been
   shown, or the visitor has used the feed (feed.js marks the page with data-feed-hinted, and keeps for this
   browser that the feed was used), it does not come again: not on the article that follows one that was taken
   out, and not in the next feed. */
.feed-hint {
    position: absolute; left: 12px; right: 12px; bottom: 30px; width: fit-content; margin: 0 auto; padding: 8px 16px; border-radius: var(--radius);
    display: grid; justify-items: center; gap: 2px; text-wrap: balance;
    background: rgb(17 17 17 / .72); color: #fff; font-size: 0.85rem; text-align: center; pointer-events: none;
    animation: feed-hint 5s ease-in-out both;
}
@keyframes feed-hint { 0%, 100% { opacity: 0; } 8%, 85% { opacity: 1; } }
html[data-feed-hinted] .feed-hint { display: none; }
/* Above the button "nicht mein Stil" in the corner, not on it. */
.feed-media:has(.feed-hide) .feed-hint { bottom: 64px; }
/* The way to the next article comes first, with an arrow that moves the way the finger does. */
.feed-hint-next { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.feed-hint-next .icon { font-size: 1.3em; animation: feed-hint-next 1.2s ease-in-out infinite; }
@keyframes feed-hint-next { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-4px); } }
.feed-hint .for-mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
    .feed-hint .for-touch { display: none; }
    .feed-hint .for-mouse { display: inline; }
    .feed-hint-next .icon { display: none; }
}
/* The close button answers at once (feed.js), the page below follows when the server has answered. */
.feed.is-closing { opacity: 0; pointer-events: none; animation: none; transition: opacity var(--dur-1); }
.feed-info {
    flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
}
.feed-text { flex: 1; min-width: 0; text-decoration: none; }
/* The name on two lines at most, like on a card: its last word is the colour, which tells two articles apart. */
.feed-text .name { font-weight: 600; font-size: 1.05rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* The price stays in one piece where it has the room; where it has not, it breaks instead of running under the buttons. */
.feed-text .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.feed-text .price s, .feed-text .shops { color: var(--muted); font-weight: 400; font-size: 0.85rem; white-space: nowrap; }
.feed-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.feed-actions .favorite-button { min-height: 44px; padding: 9px 12px; font-size: 1.35rem; }
.feed-more { display: grid; place-items: center; height: 40%; scroll-snap-align: end; }
/* After the last article: said in so many words, so nobody swipes against a wall. */
.feed-end {
    display: grid; align-content: center; justify-items: center; gap: 14px; height: 45%; padding: 0 24px;
    color: var(--muted); text-align: center; text-wrap: balance; scroll-snap-align: end;
}
.feed-end p { margin: 0; }
/* "Nicht mein Stil" ("Für dich"): on the picture, out of the way of the dots and of the line that says why. */
.feed-hide {
    position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border-radius: var(--radius); border-color: var(--line); background: var(--glass); color: var(--muted); font-size: 1.15rem; line-height: 1;
}
.feed-hide:hover { color: var(--text); border-color: var(--text); }
/* What "nicht mein Stil" did, with the way back: over the feed for a few seconds, then gone (and out of the way of taps).
   At the left edge of the article, which stands in the middle of a wide screen (see .feed-item). */
.feed-toast {
    position: absolute; top: 12px; left: calc(max(0px, (100% - 78vh) / 2) + 12px); z-index: 2; display: flex; align-items: center; gap: 10px;
    max-width: min(calc(100% - 128px), calc(78vh - 24px)); padding: 8px 8px 8px 14px; border-radius: var(--radius);
    background: rgb(17 17 17 / .88); color: #fff; font-size: 0.85rem; line-height: 1.3;
    box-shadow: 0 2px 10px rgb(var(--shadow) / calc(.12 * var(--shadow-k))); animation: feed-toast 7s both;
}
@supports (width: 1cqh) {
    .feed-toast { left: calc(max(0px, (100% - 78cqh) / 2) + 12px); max-width: min(calc(100% - 128px), calc(78cqh - 24px)); }
}
/* Where the feed is narrow (a phone), the buttons in its corner reach into the place of the note: it stands under
   their row, as wide as it needs to be, so the way back to the grid stays free. */
@container (max-width: 700px) {
    .feed-toast { top: 66px; left: 12px; max-width: calc(100% - 24px); }
    html[data-feed-full] .feed-toast { top: calc(max(12px, env(safe-area-inset-top)) + 54px); }
}
/* Back in the list: the article the feed showed last is on the screen (feed.js) and stands out for a moment, by a
   line around its picture in the colour of the writing (red is for prices and errors). */
.product-card.is-returned .product-card-link::before { animation: feed-returned 1.4s ease-out both; }
@keyframes feed-returned {
    0%, 55% { outline: 2px solid var(--text); outline-offset: 2px; }
    100% { outline: 2px solid transparent; outline-offset: 2px; }
}
.feed-toast .button-small { flex: none; display: inline-flex; align-items: center; background: #fff; color: #111111; border-color: #fff; white-space: nowrap; }
/* It arrives from above, by a few pixels: something was put there, it did not just appear. */
@keyframes feed-toast {
    0% { opacity: 0; transform: translateY(-6px); }
    4%, 90% { opacity: 1; visibility: visible; transform: none; }
    100% { opacity: 0; visibility: hidden; transform: none; }
}
@media (max-width: 760px) {
    /* The search field at the bottom edge of the search page stays in reach: inside the page the articles end above
       it (the feed itself goes on behind it, so nothing of the page shows through there). */
    html:not([data-feed-full]) body:has(.site-header:not(.no-phone-search) .header-search) .feed:not(.is-closing) {
        box-sizing: border-box; padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }
}
@media (prefers-reduced-motion: reduce) {
    .feed { animation: none; }
    .feed.is-closing, .feed-dots i { transition: none; }
    .feed-heart.is-bursting { animation-name: feed-hint; }
    .feed-hint-next .icon { animation: none; }
    .feed-hint ~ .feed-why { animation-duration: .01s; }
    /* The note comes and goes without moving; the line around the article that was shown last is there and then gone. */
    @keyframes feed-toast { 0% { opacity: 0; } 4%, 90% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
    .product-card.is-returned .product-card-link::before { animation-timing-function: step-end; }
}

/* ---------- Product card ---------- */

/* Three articles in a row on tablets and opened folding phones; two on phones, four and five on wider screens,
   fewer beside a column (see "How many articles in a row" at the end of the sheet). */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }

/* An article in a list: the picture is the tile, what it is and what it costs stands freely under it. */
.product-card { position: relative; min-width: 0; }
/* The tile lies behind the picture (--picture-behind) and the picture is blended onto it: the white ground of a
   shop's photo becomes the tile, so every article stands on the same ground whatever the shop photographed it on. */
.product-card-link { position: relative; display: block; text-decoration: none; isolation: isolate; }
.product-card-link::before { content: ""; position: absolute; z-index: -1; top: 0; left: 0; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--picture-behind); }
.product-card img, .product-card .image-placeholder {
    display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius);
}
.product-card img { background-color: transparent; mix-blend-mode: var(--picture-blend); }
/* Under the pointer the card answers quietly: the name is underlined and the picture steps back a shade. Nothing
   moves and nothing grows; a list of pictures that jump at the mouse is restless. */
@media (hover: hover) and (pointer: fine) {
    .product-card-link:hover .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
    .product-card-link .shop-picture { transition: filter var(--dur-1) var(--ease-out); }
    .product-card-link:hover .shop-picture:not(.image-placeholder) { filter: var(--picture-hover); }
}
@media (prefers-reduced-motion: reduce) { .product-card-link .shop-picture { transition: none; } }
.product-card-body { padding: 12px 2px 4px; }
.brand { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--caps-track); color: var(--muted); }
.product-card .name { margin-top: 2px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Price and old price each stay in one piece; the old price moves to the next line when it has no room. On a
   narrow card (two in a row on a phone) it has room more often: its "CHF" is left out there, the price before it
   has said it (.price-unit, ProductCard.razor; still read out). */
.product-card .price { margin-top: 6px; font-weight: 600; font-size: 1rem; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; white-space: nowrap; }
.product-card .shops { font-size: 0.8rem; color: var(--muted); }
.product-card .price s { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.product-card-favorite { position: absolute; top: 2px; right: 2px; }
/* On the picture the heart stands by itself. The tile under it is light in both looks, so the heart is dark in
   both; a light edge keeps it visible on a photo that is dark in that corner (a crisp line right at the heart and
   a soft one around it: one faint glow was lost on a black jacket). */
.product-card-favorite .favorite-button, .product-card-favorite .favorite-button.is-active {
    padding: 10px; border: 0; background: none; color: #111111; font-size: 1.3rem;
    filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 2.5px rgb(255 255 255 / .85));
}
.product-card-favorite .favorite-button.is-active { color: var(--accent-fill); }
/* What lies on a picture and is reached by keyboard: the ring is dark with a light line inside it, in both looks.
   A picture is light or dark whatever the look of the page, and the ring of the page (--text) is lost on half of them. */
.product-card-favorite .favorite-button:focus-visible, .feed-arrow:focus-visible, .feed-hide:focus-visible,
.feed-control:focus-visible, .foryou-hide:focus-visible {
    outline: 2px solid #111111; outline-offset: 2px; box-shadow: 0 0 0 2px #fff;
}
/* Two that fill the box that cuts them off. The row of pictures of an article, which the keyboard scrolls: the
   frame around it carries the ring (drawn inside, it lay under the pictures in the dark look). The name and price
   at the bottom edge of the feed: the ring is drawn inside, where it is whole. */
.detail-track:focus-visible { outline: none; }
.detail-image:has(.detail-track:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.feed-text { padding: 0 6px; margin: 0 -6px; } /* the room the ring keeps from the words; nothing moves */
.feed-text:focus-visible { outline-offset: -2px; }
.product-card-actions { padding: 6px 2px 0; }
.product-card-actions > * { margin-bottom: 12px; }
.bought-button { width: 100%; padding: 5px 10px; font-size: 0.85rem; background: transparent; color: var(--muted); border-color: var(--line); }
.bought-button:hover { color: var(--text); border-color: var(--text); }
/* Marked as bought just now: what the button became, with the way back beside it. */
.bought-done { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 5px 10px; font-size: 0.85rem; font-weight: 600; color: var(--good); background: var(--good-soft); border: 1px solid var(--good); border-radius: var(--radius); }
.bought-done .text-button { font-size: inherit; font-weight: 400; }
/* On a narrow card the two do not fit side by side: each stays whole (its sign beside its word) and the way back
   goes under "Gekauft", instead of both breaking after their sign. */
.bought-done { flex-wrap: wrap; row-gap: 0; }
.bought-done > span, .bought-done .text-button { display: inline-flex; align-items: center; white-space: nowrap; }
.product-card-actions .button-small { width: 100%; }
.look-table td { vertical-align: top; }
.look-article { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; min-width: 200px; }
.look-article img, .look-article .image-placeholder { width: 56px; flex: none; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--picture); }
.look-article .offer-title { display: block; }
.look-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.look-line .offer-title { margin-right: 4px; }
/* The colours of a model (ColourSwatches): a dot per colour, a link to that colour. The dot is small, what can be
   tapped around it is not (24 px). The colour that is shown has a ring; under the pointer a dot shows its colour
   in the card (colours.js) and gets the ring while it does. */
.product-card-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 0 0 4px; }
.colour-swatches { display: flex; flex-wrap: wrap; align-items: center; margin-left: -5px; }
.colour-swatch { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; text-decoration: none; }
/* The edge is what shows a white dot on the white page: dark enough for that (3:1), and a shade of the colour on every other dot. */
.colour-swatch::before {
    content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--swatch, #d4d4d8);
    box-shadow: inset 0 0 0 1px var(--swatch-edge, rgb(0 0 0 / .44));
}
.colour-swatch.is-shown::before, .colour-swatch.is-previewed::before { outline: 1.5px solid var(--text); outline-offset: 2px; }
.colour-swatches.is-previewing .colour-swatch.is-shown:not(.is-previewed)::before { outline-color: transparent; }
@media (hover: hover) and (pointer: fine) {
    .colour-swatch:hover::before { outline: 1.5px solid var(--text); outline-offset: 2px; }
}
.colour-more { padding: 0 4px; font-size: 0.8rem; color: var(--muted); text-decoration: none; line-height: 24px; }
.colour-more:hover { color: var(--text); text-decoration: underline; }
/* Another colour of the model costs clearly less: said under the dots, a link to it. */
.colour-deal { display: inline-flex; gap: .3em; min-width: 0; max-width: 100%; font-size: 0.8rem; color: var(--good); text-decoration: none; }
.colour-deal-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* the words give way ... */
.colour-deal-price { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }     /* ... the price stays whole */
.colour-deal:hover { text-decoration: underline; }
.feed-colours { flex-basis: 100%; display: flex; align-items: center; gap: 8px; margin-top: -4px; }
.feed-colours .hint { margin: 0; font-size: 0.8rem; }

.product-card-badges { position: absolute; top: 10px; left: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sale-badge, .multi-badge { padding: 2px 8px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 700; }
.sale-badge { background: var(--accent-fill); color: var(--on-accent); }
.multi-badge { background: var(--good-fill); color: var(--on-good); }

.favorite-button {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 1.1rem; line-height: 1;
    background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.favorite-button .icon + span { font-size: 0.9rem; }
.favorite-button.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* The heart is filled at once and in its colour at once: faded like other buttons, a heart that was just set was
   filled black for a moment before it turned red. Only its ground and edge fade. */
.favorite-button { transition: background-color var(--dur-1), border-color var(--dur-1); }
/* Set by the visitor just now (favorites.js marks the button that was pressed with data-pressed): the heart answers
   with one short beat, the same on a card, in the feed and on the article page. Not the hearts that are set when a
   page opens, and nothing when it is taken away. Under the pointer it comes a little closer, pressed it gives way. */
.favorite-button .icon { transition: transform var(--dur-1) var(--ease-out); }
.favorite-button:not(:disabled):active .icon { transform: scale(.88); }
.favorite-button[data-pressed].is-active .icon { animation: heart-set var(--dur-2) ease-out; }
@keyframes heart-set { 0% { transform: scale(.78); } 55% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (hover: hover) and (pointer: fine) {
    .favorite-button:not(.is-active):hover { border-color: var(--line-hover); }
    .product-card-favorite .favorite-button:hover .icon { transform: scale(1.12); }
    .product-card-favorite .favorite-button:active .icon { transform: scale(.88); }
}
@media (prefers-reduced-motion: reduce) {
    .favorite-button, .favorite-button .icon { transition: none; }
    .favorite-button[data-pressed].is-active .icon { animation: none; }
}

/* Favourites: switch between one list and one block per category */
.favorites-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 16px; }
.favorites-bar > .button-small, .favorites-group > .button-small { display: inline-flex; align-items: center; flex: none; }
.favorites-bar > .button-small .icon, .favorites-group > .button-small .icon { font-size: 1.2em; }
.favorites-group { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 28px 0 12px; }
.favorites-group h2 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 1.2rem; }
.favorites-group h2 > .icon, .favorites-group h2 > .shop-icon { flex: none; align-self: center; }
.favorites-group h2 > .icon { font-size: 1.25em; stroke-width: 1.5; }
/* Favicons are drawn for a light browser tab: a white tile keeps a black one visible in dark mode. */
.shop-icon { width: 20px; height: 20px; padding: 2px; border-radius: var(--radius); background: #fff; object-fit: contain; box-shadow: 0 0 0 1px var(--shop-ring); }
.favorites-bar + .favorites-group { margin-top: 8px; }
/* The groups of a grouped list (categories or shops) in one row: it stays under the header while the list scrolls
   (at the top of the screen where the header scrolls away), and each entry jumps to its block. One line, pushed
   sideways when the groups do not fit. */
.favorites-jump {
    position: sticky; top: var(--header-h); z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)) 4px; padding: 8px var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line);
}
.favorites-jump::-webkit-scrollbar { display: none; }
.favorites-jump .chip { flex: none; text-decoration: none; white-space: nowrap; }
.favorites-jump .chip:hover { border-color: var(--text); }
.favorites-jump .chip > .icon { font-size: 1.15em; }
.favorites-jump .shop-icon { width: 16px; height: 16px; padding: 1px; }
.favorites-jump + .favorites-group { margin-top: 16px; }
/* A group the row jumps to stops under the row: the scroll-padding of the page (html:has(.favorites-jump)) keeps that room. */
.favorites-group-count { color: var(--muted); font-size: 0.9rem; font-weight: 400; }

/* Favourites, sorting out: one article fills the screen (above the header). The card follows the finger sideways
   (sortout.js sets --drag from -1 = sort out to 1 = keep), its pictures are scrolled through up and down. */
html:has(.sortout) { overflow: hidden; }
.sortout {
    position: fixed; inset: 0; z-index: 50; height: 100vh; height: 100dvh; background: var(--bg);
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; overscroll-behavior: contain;
}
.sortout [hidden] { display: none; }
.sortout-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.sortout-bar button:disabled { opacity: 0.4; cursor: default; }
/* Each of the two buttons stays one line; the count between them gives way and ends with "…" where a group's name
   stands before it on a narrow phone. */
.sortout-bar .button-small, .sortout-action { white-space: nowrap; }
.sortout-count { flex: 0 1 auto; min-width: 0; display: flex; overflow: hidden; white-space: pre; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.sortout-count > span { flex: none; }
.sortout-count > .sortout-count-group { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Below an ordinary phone (320px, a folded one) the words of the two buttons stand alone, and everything a little
   closer: so the count is there in full and "Aussortieren" fits beside its sign. */
@media (max-width: 359px) {
    .sortout-bar { gap: 8px; padding-left: 8px; padding-right: 8px; }
    .sortout-bar .button-small { flex: none; padding-left: 10px; padding-right: 10px; }
    .sortout-bar .button-small .icon { display: none; }
    .sortout-actions { gap: 8px; padding-left: 8px; padding-right: 8px; }
    .sortout-action { padding-left: 6px; padding-right: 6px; }
}
/* A folded phone (280px): the two decisions are their words in their colours, or the row would be wider than the screen. */
@media (max-width: 299px) {
    .sortout-action .icon { display: none; }
    /* The name of the group has no room there: the count stands alone. */
    .sortout-count-group, .sortout-count-group + span { display: none; }
}
.sortout-stage { display: flex; justify-content: center; min-height: 0; padding: 0 12px; }
.sortout-card {
    --drag: 0;
    display: flex; flex-direction: column; width: min(100%, 560px); height: 100%; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgb(var(--shadow) / calc(.08 * var(--shadow-k)));
    touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
    transition: transform var(--dur-2) ease-out; animation: sortout-in var(--dur-2) var(--ease-out); /* not kept after its end: it would hold the card in place against the drag */
}
/* Also on everything inside: the pictures scroll on their own, so what the card says about touches does not reach
   them, and the browser would take a sideways swipe on a picture for itself. */
.sortout-card * { touch-action: pan-y; }
.sortout-card.is-dragging { transition: none; cursor: grabbing; }
.sortout-card.is-leaving { transition: transform var(--dur-2) ease-in; } /* as long as sortout.js waits (FlyTime) */
@keyframes sortout-in { from { opacity: 0; transform: scale(.96); } }
.sortout-gallery { position: relative; flex: 1; min-height: 0; background: var(--picture-behind); }
.sortout-images {
    position: absolute; inset: 0; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain;
    scrollbar-width: none; outline-offset: -3px;
}
.sortout-images::-webkit-scrollbar { display: none; }
.sortout-images img, .sortout-images .image-placeholder {
    display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; scroll-snap-align: start;
    -webkit-user-drag: none; pointer-events: none;
}
.sortout-dots { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.sortout-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(17 17 17 / .22); transition: background-color var(--dur-1), transform var(--dur-1); }
.sortout-dots i.is-active { background: #111111; transform: scale(1.25); }
.sortout-more {
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 12px; border-radius: var(--radius);
    background: rgb(17 17 17 / .72); color: #fff; font-size: 0.8rem; white-space: nowrap; pointer-events: none; transition: opacity var(--dur-2);
}
.sortout-gallery.is-scrolled .sortout-more { opacity: 0; }
.sortout-stamp {
    position: absolute; top: 22px; padding: 4px 12px; border: 3px solid; border-radius: var(--radius); background: var(--surface);
    font-weight: 800; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; pointer-events: none;
}
.sortout-stamp.is-keep { left: 18px; color: var(--good); transform: rotate(-10deg); opacity: max(0, var(--drag)); }
.sortout-stamp.is-drop { right: 18px; color: var(--accent); transform: rotate(10deg); opacity: max(0, calc(-1 * var(--drag))); }
.sortout-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sortout-text { min-width: 0; }
.sortout-info .name { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sortout-side { flex: none; text-align: right; font-size: 0.9rem; }
.sortout-side .price { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.sortout-side .price s { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.sortout-actions { display: flex; justify-content: center; gap: 12px; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
.sortout-action { flex: 1 1 0; max-width: 274px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); font-size: 1rem; }
.sortout-action.is-drop { color: var(--accent); border-color: var(--accent); }
.sortout-action.is-keep { color: var(--good); border-color: var(--good); }
.sortout-action.is-drop:hover { background: var(--accent-soft); }
.sortout-action.is-keep:hover { background: var(--good-soft); }
.sortout-done { grid-row: 2; align-self: center; padding: 0 20px; text-align: center; }
/* It is a dialog that takes the keyboard's focus when it opens (sortout.js): the whole screen needs no ring. */
.sortout:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
    .sortout-card, .sortout-card.is-leaving { transition: none; animation: none; }
    .sortout-dots i { transition: none; }
}
/* A low, wide window (a phone on its side): stacked, the picture would be left with less than half of the height.
   So the text stands beside the picture and the two decisions in a column beside the card. Swiping is the same
   (its distance follows the card's width, sortout.js). */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 560px) {
    .sortout { grid-template-columns: minmax(0, 1fr) minmax(170px, 26%); grid-template-rows: auto minmax(0, 1fr); }
    .sortout-bar { grid-column: 1 / -1; padding-top: 6px; padding-bottom: 6px; }
    .sortout-stage { padding: 0 0 max(10px, env(safe-area-inset-bottom)) 12px; }
    .sortout-card { flex-direction: row; width: 100%; }
    .sortout-info { flex: 0 0 38%; flex-direction: column; border-top: 0; border-left: 1px solid var(--line); }
    .sortout-side { text-align: left; }
    .sortout-actions { flex-direction: column; justify-content: center; padding: 0 12px max(10px, env(safe-area-inset-bottom)); }
    .sortout-action { flex: none; max-width: none; }
    .sortout-done { grid-column: 1 / -1; }
}

/* ---------- Product detail ---------- */

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head h1 { margin-bottom: 4px; }
.detail-meta { color: var(--muted); }
.detail-meta strong { color: var(--text); }


.offer-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.offer-table th, .offer-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.offer-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--caps-track); color: var(--muted); }
.offer-table tr:last-child td { border-bottom: none; }
.offer-table .num { text-align: right; white-space: nowrap; }
.offer-table s { color: var(--muted); margin-right: 8px; }
.offer-table tr.is-best { background: var(--good-soft); }
.best-badge {
    margin-left: 10px; padding: 2px 8px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 700;
    background: var(--good-fill); color: var(--on-good); white-space: nowrap;
}

.official-badge {
    margin-left: 10px; padding: 1px 8px; border-radius: var(--radius); font-size: 0.75rem; font-weight: 700;
    border: 1px solid var(--text); color: var(--text); white-space: nowrap;
}
.button-outline { background: transparent; color: var(--text); border-color: var(--text); }
.detail-official { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* The shops of an article: not wider than a row can be read across. On a large monitor the shop stood at the left
   edge and its price and button a hand's width away at the right. */
.offer-table.is-stacked, .offer-table.is-stacked + .hint { max-width: 920px; }
.offer-title { color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.offer-table .sizes { color: var(--muted); font-size: 0.85rem; }
.offer-table { margin-bottom: 8px; }
.detail-info, .history { margin-top: 24px; }
.detail-info p { max-width: 720px; }
section > h2 { margin-top: 28px; font-size: 1.15rem; }
.filters h2, .shop-strip h2 { margin-top: 0; }

/* ---------- Data page ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stats strong { display: block; font-size: 1.6rem; letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: 0.85rem; }
.state { font-weight: 600; color: var(--muted); }
.state-succeeded { color: var(--good); }
.state-failed { color: var(--accent); }
.state-warning { color: var(--warn); }
@media (max-width: 760px) { .offer-table { display: block; overflow-x: auto; } }
.index-state { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.index-state { margin: 0 0 8px; }
.index-state + .stats { margin-top: 16px; }
.share-bar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.share-bar > span { flex: none; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }
.bar { flex: 1; height: 8px; border-radius: var(--radius); background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: var(--radius); background: var(--good-fill); }
.stats strong.state-failed { color: var(--accent); }

/* The sections of the data page: a row of links to them, what needs attention, and lists with bars. */
.data-nav { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.data-nav::-webkit-scrollbar { display: none; }
.data-nav a {
    flex: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    color: var(--text); text-decoration: none; font-size: 0.9rem; white-space: nowrap;
}
.data-nav a:hover { border-color: var(--text); }
.data-nav ~ h2, .data-nav ~ * h2, .data-nav ~ * > h2 { scroll-margin-top: 12px; } /* beyond the scroll-padding of the page */
.data-nav ~ h2 { font-size: 1.3rem; margin: 40px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.health { list-style: none; padding: 0; margin: -12px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.health li { display: flex; gap: 6px 12px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.health li:last-child { border-bottom: none; }
.health li > span { flex: 1; }
.health li > a { flex: none; font-size: 0.85rem; }
.health li > .icon { flex: none; align-self: center; font-size: 1.15rem; color: var(--muted); }
.health li.is-bad > .icon { color: var(--accent); }
.health li.is-warn > .icon { color: var(--warn); }
.health li.is-ok > .icon { color: var(--good); }
.health li.is-bad > span { font-weight: 600; }
.data-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; align-items: start; margin-bottom: 20px; }
.data-columns.is-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.data-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.data-card h3, .data-subhead { font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--caps-track); color: var(--muted); margin: 0 0 12px; }
.data-card .bar-list + h3 { margin-top: 22px; }
.data-card .hint { margin: 10px 0 0; }
.data-card .offer-table { border: none; border-radius: 0; margin: 0 -16px; width: calc(100% + 32px); }
.data-card .offer-table th:first-child, .data-card .offer-table td:first-child { padding-left: 16px; }
.data-card .offer-table th:last-child, .data-card .offer-table td:last-child { padding-right: 16px; }
.data-card .offer-table th { padding-top: 0; }
.data-card code, .data-intro code { font-size: 0.85em; overflow-wrap: anywhere; }
.data-card td code { white-space: nowrap; }
.data-intro { max-width: 46rem; margin: -4px 0 14px; }
.data-subhead { margin: 4px 0 10px; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(40px, 1fr) auto; gap: 10px; align-items: center; }
.data-columns.is-wide .bar-list li { grid-template-columns: minmax(0, 17rem) minmax(40px, 1fr) auto; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { min-width: 5.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.bar-value strong { color: var(--text); margin-right: 6px; }
.bar.is-low > span { background: var(--warn); }
.quality-table td.is-low { color: var(--warn); font-weight: 600; }
.quality-table th, .quality-table td { padding-left: 8px; padding-right: 8px; }
.quality-table th { letter-spacing: 0.02em; }
.quality-table th:first-child, .quality-table td:first-child { padding-left: 14px; }
/* Phones and upright tablets: one block per shop instead of a table that is wider than the page; the small values
   carry their column's name. Up to 900px: the widest of these tables need that much for their columns. */
@media (max-width: 900px) {
    .offer-table.is-cards { display: block; overflow: hidden; }
    .offer-table.is-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .offer-table.is-cards tbody { display: block; }
    .offer-table.is-cards tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
    .offer-table.is-cards tr:last-child { border-bottom: none; }
    .offer-table.is-cards td { display: block; padding: 0; border: none; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .offer-table.is-cards td:first-child, .offer-table.is-cards td.wide { flex: 1 1 100%; }
    .offer-table.is-cards td:first-child { font-weight: 600; }
    .offer-table.is-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8rem; }
    .offer-table.is-cards td.wide:not(:has(*)):not([data-label]) { display: none; }
    .offer-table.is-cards .button-small { display: flex; width: 100%; justify-content: center; align-items: center; margin-top: 4px; padding: 9px 12px; }
    .data-card .offer-table.is-cards td:first-child, .data-card .offer-table.is-cards td:last-child { padding-left: 0; padding-right: 0; }
    .data-card .offer-table.is-cards tr { padding: 12px 16px; }
}
/* Such a table whose rows end in one button (the search history, the availability alarms): where the block is
   wide enough (a small tablet, an unfolded phone) the button stands at the end of the line of values instead of
   as a bar across the whole block. */
@media (min-width: 561px) and (max-width: 900px) {
    .offer-table.is-cards.has-action td.wide { flex: 0 0 auto; margin-left: auto; }
    .offer-table.is-cards.has-action .button-small { width: auto; margin-top: 0; }
}
@media (max-width: 760px) {
    .admin-unlock input:not([type="number"]) { flex: 1 1 12rem; min-width: 0; }
    .data-nav { margin: 0 calc(-1 * var(--gutter)) 14px; padding: 0 var(--gutter); }
    .data-nav a { padding: 7px 13px; }
    .data-nav ~ h2 { margin-top: 30px; padding-top: 18px; }
    .health li { flex-wrap: wrap; padding-right: 12px; }
    .bar-list li, .data-columns.is-wide .bar-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
    .bar-list .bar-name { white-space: normal; }
    .bar-list .bar { grid-column: 1 / -1; grid-row: 2; }
    .bar-list li { padding-bottom: 2px; }
    .data-card { padding: 14px; }
    .data-card td code { white-space: normal; }
    .data-card .offer-table { margin: 0 -14px; width: calc(100% + 28px); }
    .data-card .offer-table.is-cards tr { padding: 12px 14px; }
}

/* Shops and catalogue, live (ImportOverview): a symbol per state, and per running import its steps with a bar each.
   The colours say what they say elsewhere: green done, red failed, amber old, the text colour for what runs now. */
.kind-ok { --kind: var(--good); }
.kind-failed { --kind: var(--accent); }
.kind-stale { --kind: var(--warn); }
.kind-running { --kind: var(--text); }
.kind-waiting, .kind-never, .kind-off { --kind: var(--muted); }
.import-toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.import-summary { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.import-summary li {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.85rem; color: var(--muted);
}
.import-summary li > .icon { font-size: 1.2rem; color: var(--kind); }
.import-summary strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.import-line { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 0 0 14px; font-size: 0.85rem; color: var(--muted); }
.import-line > span { display: inline-flex; align-items: center; }
.import-line.is-muted { margin-top: 4px; }
.import-grid { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.import-card {
    min-width: 0; display: grid; gap: 10px; align-content: start; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.import-card.kind-running { border-color: var(--line-hover); }
.import-card.kind-failed { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.import-card.kind-off { opacity: .65; }
.import-catalogue { margin-bottom: 14px; }
.import-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.import-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-title img { flex: none; width: 18px; height: 18px; border-radius: 4px; object-fit: contain; }
.import-title .shop-dot { margin-right: 0; flex: none; }
.import-title > .icon { flex: none; font-size: 1.15rem; color: var(--muted); }
.import-state { flex: none; display: inline-flex; font-size: 1.4rem; color: var(--kind); }
.icon-button { flex: none; display: inline-flex; padding: 6px; font-size: 1rem; line-height: 1; background: transparent; color: var(--text); border-color: var(--line-strong); }
.icon-button:hover:not(:disabled) { border-color: var(--text); }
.import-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.import-facts > li { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.import-facts strong { color: var(--text); }
.import-facts .is-bad { color: var(--accent); font-weight: 600; }
.import-facts .is-warn { color: var(--warn); font-weight: 600; }
/* What a fact or the symbol of a state means in full, under the pointer, after a tap or with the focus of the keyboard:
   a panel under the row it is in, as wide as the card, so it never runs off the screen. The card under the pointer
   lies above its neighbours while it shows. */
.import-card { position: relative; }
.import-card:hover, .import-card:focus-within { z-index: 3; }
.import-card.kind-off:hover, .import-card.kind-off:focus-within { opacity: 1; }
.import-facts, .import-head { position: relative; }
.has-tip { cursor: help; border-radius: 3px; }
.has-tip:focus { outline: none; }
.has-tip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.import-facts .has-tip:hover, .import-facts .has-tip:focus { color: var(--text); }
.import-facts .has-tip.is-bad:hover, .import-facts .has-tip.is-bad:focus { color: var(--accent); }
.import-facts .has-tip.is-warn:hover, .import-facts .has-tip.is-warn:focus { color: var(--warn); }
.tip {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
    display: grid; gap: 2px; padding: 9px 11px;
    background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 28px rgb(var(--shadow) / calc(.14 * var(--shadow-k)));
    font-size: 0.8rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; overflow-wrap: anywhere;
    visibility: hidden; opacity: 0; pointer-events: none; transition: opacity var(--dur-1), visibility 0s var(--dur-1);
}
.has-tip:hover > .tip, .has-tip:focus > .tip { visibility: visible; opacity: 1; transition: opacity var(--dur-1) .15s, visibility 0s .15s; }
.tip > * { min-width: 0; }
.tip-title { font-weight: 600; }
.tip-line { color: var(--muted); }
.tip-failures { list-style: none; margin: 4px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.tip-failures li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.tip-failures strong { color: var(--text); }
.tip-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.tip-recovered { color: var(--good); }
.tip-url, .tip-detail { flex-basis: 100%; }
.tip-detail { color: var(--muted); }
.import-error, .import-note { margin: 0; display: flex; gap: 6px; align-items: baseline; font-size: 0.8rem; overflow-wrap: anywhere; }
.import-error { color: var(--accent); }
.import-note { color: var(--muted); }
.import-error .icon, .import-note .icon { flex: none; align-self: center; }
.import-advice summary { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.import-advice.is-bad summary { color: var(--accent); }
.import-advice.is-warn summary { color: var(--warn); }
.import-advice p { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.import-reasons { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.import-reasons > span:first-child { display: inline-flex; color: var(--text); font-size: 1rem; }
.import-reasons.is-muted > span:first-child { color: var(--muted); }
.import-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.import-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-round); background: var(--soft); white-space: nowrap; }
.import-chip img { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; }

/* The steps: a symbol, a bar, a number under it. Done steps carry a green tick, the running one is in the text
   colour; a bar that cannot be measured runs as a stripe from left to right. */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.track-step { min-width: 0; display: grid; justify-items: center; gap: 6px; color: var(--muted); }
.track-icon { position: relative; display: inline-flex; font-size: 1.25rem; }
.track-badge {
    position: absolute; right: -7px; bottom: -5px; display: inline-flex; padding: 2px; font-size: 0.55rem;
    border-radius: 50%; background: var(--good-fill); color: var(--on-good); box-shadow: 0 0 0 2px var(--surface);
}
.track-badge .icon { stroke-width: 4; }
.track-bar { position: relative; width: 100%; height: 6px; border-radius: var(--radius-round); background: var(--line); overflow: hidden; }
.track-bar > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--text); transition: width .9s ease-out; }
.track-bar.is-running > span { width: 40%; animation: track-run 1.4s ease-in-out infinite; }
@keyframes track-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.track-caption { max-width: 100%; min-height: 1.2em; font-size: 0.75rem; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-step.is-active { color: var(--text); }
.track-step.is-active .track-icon { animation: track-pulse 1.6s ease-in-out infinite; }
@keyframes track-pulse { 50% { opacity: .45; } }
.track-step.is-done { color: var(--good); }
.track-step.is-done .track-bar > span { background: var(--good-fill); }
.track-step.is-done .track-caption { color: var(--muted); }
.track-step.is-failed { color: var(--accent); }
.track-step.is-failed .track-bar > span { background: var(--accent-fill); }
.track-step.is-failed .track-badge { background: var(--accent-fill); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) {
    .track-bar > span { transition: none; }
    .track-bar.is-running > span { width: 100%; animation: none; opacity: .4; }
    .track-step.is-active .track-icon { animation: none; }
}
@media (max-width: 760px) {
    .import-toolbar > button { flex: 1 1 100%; display: flex; justify-content: center; align-items: center; }
    .import-line { gap: 6px 14px; }
}

/* ---------- Image search ---------- */

.image-upload { max-width: 680px; margin: 4px auto 14px; }
.image-upload label {
    display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
    padding: 12px 16px; background: var(--surface); border: 1px dashed var(--line-hover); border-radius: var(--radius);
    transition: border-color var(--dur-1);
}
.image-upload label:hover, .image-upload label:focus-within { border-color: var(--text); }
.image-upload.is-busy label { cursor: progress; opacity: 0.7; }
.image-upload-icon { display: flex; font-size: 1.7rem; color: var(--muted); }
.image-upload strong { display: block; }

/* The camera button next to the search field in the header */
.image-upload-compact { position: relative; display: flex; }
.image-upload-compact label {
    display: flex; align-items: center; padding: 0 10px; cursor: pointer; font-size: 1.25rem; color: var(--muted);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color var(--dur-1);
}
.image-upload-compact label:hover, .image-upload-compact label:focus-within { border-color: var(--text); color: var(--text); }
.image-upload-compact.is-busy label { cursor: progress; opacity: 0.7; }
.image-upload-compact .notice {
    position: absolute; top: 100%; right: 0; z-index: 20; margin: 6px 0 0; width: min(300px, 80vw);
    border: 1px solid var(--line); font-size: 0.9rem; box-shadow: 0 4px 14px rgb(0 0 0 / calc(.12 * var(--shadow-k)));
}

.image-search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .image-search-layout { grid-template-columns: 1fr; } }
.image-search-layout > * { min-width: 0; } /* lets the result column shrink instead of overflowing */
.image-search-photo img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.image-search-photo .image-upload label { padding: 10px 12px; }
.piece { margin-bottom: 36px; }
.piece-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
/* The title of a page and, a step smaller, the titles of its parts. */
.piece-head h1 { font-size: 1.5rem; margin: 0 0 16px; }
.piece-head h2, .shop-strip h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 16px; }
/* The link to all of them, with its arrow: a row of two, so the line under the words ends with the words and does
   not run on under the gap before the arrow. */
.piece-head > a { display: inline-flex; align-items: center; gap: 4px; font-size: 0.9rem; color: var(--muted); text-underline-offset: 4px; }
.piece-head > a:hover { color: var(--text); }
.piece .chips { margin-bottom: 14px; }
.piece-others { font-size: 1.05rem; margin: 26px 0 12px; }

/* The result of a photo: the photo with its pieces stays in view on the left, the matches of the chosen piece
   scroll on the right. */
.image-search-layout { grid-template-columns: minmax(240px, 320px) 1fr; }
@media (min-width: 761px) { .image-search-photo { position: sticky; top: var(--sticky-top); } }
/* On a phone the photo is small and in the middle, the matches follow right below its pieces, and what explains
   and what uploads another photo comes after them: the parts of the photo column become rows of the page. */
@media (max-width: 760px) {
    .image-search-layout { grid-template-columns: 1fr; gap: 12px; }
    .image-search-photo { display: contents; }
    .image-search-photo .photo-stage { width: min(100%, 230px); justify-self: center; }
    .image-search-photo .photo-parts { justify-content: center; margin: 0; }
    .image-search-photo .photo-mark-toggle { justify-self: center; margin: 0; }
    .piece-results { order: 4; margin-top: 8px; }
    .image-search-photo > .hint { order: 5; margin: 18px 0 0; }
    .image-search-photo > .image-upload { order: 6; width: 100%; }
    .piece-head h1 { font-size: 1.3rem; }
}
/* The matches of another piece or another filter are on their way (the image model compares the pictures): the
   list steps back, and once that takes longer than a moment a line runs along its top, as over a page that loads. */
.piece-results { position: relative; transition: opacity var(--dur-1); }
.piece-results.is-busy { opacity: .55; }
.piece-results.is-busy::before {
    content: ""; position: absolute; top: -6px; left: 0; right: 0; height: 2px; background: var(--text);
    transform-origin: left center; pointer-events: none; animation: page-line 8s .15s cubic-bezier(.1, .6, .2, 1) both;
}
.piece-words { margin-bottom: 14px; }
.piece-group { font-size: 1.1rem; margin: 28px 0 12px; }
.piece-similar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.piece-filter { margin: 0 0 16px; }
.piece-filter .chip { cursor: pointer; }
.photo-words { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.photo-words label { font-weight: 600; }
.photo-words input { flex: 1 1 260px; min-width: 0; }
.photo-words-read { margin: 0 0 14px; }
.more { text-align: center; margin: 22px 0 0; }

/* The photo, the dots on its pieces and the frame around the one that is shown. What lies on the photo keeps its
   own light and dark, whatever the page has: it is seen against the photo, not against the page. */
.photo-stage {
    position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--picture-behind); user-select: none; -webkit-user-select: none;
}
.photo-stage img { display: block; width: 100%; border: 0; border-radius: 0; }
.photo-stage.is-markable { cursor: crosshair; }
.photo-stage.is-marking { touch-action: none; outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-box, .photo-draw {
    position: absolute; pointer-events: none; border: 2px solid #fff; border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 0 0 100vmax rgb(0 0 0 / .32);
}
.photo-box { transition: left .25s, top .25s, width .25s, height .25s; }
@media (prefers-reduced-motion: reduce) { .photo-box, .photo-dot { transition: none; } }
.photo-draw { display: none; border-style: dashed; box-shadow: 0 0 0 1px rgb(0 0 0 / .45); }
.photo-stage.is-drawing .photo-draw { display: block; }
.photo-stage.is-drawing .photo-box, .photo-stage.is-drawing .photo-dot { opacity: 0; }
.photo-dot {
    position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0; border-radius: 50%; cursor: pointer;
    background: rgb(255 255 255 / .92); border: 2px solid #fff; box-shadow: 0 1px 6px rgb(0 0 0 / .5), inset 0 0 0 6px #fff, inset 0 0 0 13px #111111;
    transition: transform var(--dur-1);
}
.photo-dot:hover, .photo-dot:focus-visible { transform: scale(1.2); }
.photo-dot::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; } /* a finger needs more than 26 px */
.photo-parts { margin: 12px 0 0; }
.photo-parts .chip { cursor: pointer; }
.photo-mark-toggle { display: none; align-items: center; gap: 8px; margin: 12px 0 0; }
.photo-mark-toggle .icon { font-size: 16px; }
.photo-mark-on, .photo-mark-toggle.is-on .photo-mark-off { display: none; }
.photo-mark-toggle.is-on .photo-mark-on { display: inline; }
.photo-mark-toggle.is-on { border-color: var(--accent); color: var(--accent); }
@media (pointer: coarse) { .photo-mark-toggle { display: inline-flex; } }
.photo-hint { margin: 10px 0 14px; }

/* The article on the photo itself: bigger than a card, with what it costs at which shop. */
.exact-match {
    display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 20px; align-items: center; margin: 0 0 14px;
    padding: 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.exact-picture { display: block; border-radius: var(--radius); overflow: hidden; }
.exact-picture img, .exact-picture .image-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background-color: var(--picture); }
.exact-body { min-width: 0; }
.exact-badge {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 3px 10px 3px 8px; border-radius: var(--radius);
    font-size: 0.85rem; font-weight: 600; background: var(--soft); border: 1px solid var(--line-strong); color: var(--text);
}
.exact-badge.is-certain { background: var(--good-soft); border-color: transparent; color: var(--good); }
.exact-badge .icon { font-size: 15px; }
.exact-body .brand { color: var(--muted); font-size: 0.9rem; }
.exact-body h2 { font-size: 1.2rem; margin: 2px 0 12px; }
.exact-body h2 a { color: inherit; text-decoration: none; }
.exact-body h2 a:hover { text-decoration: underline; }
.exact-offers { list-style: none; margin: 0 0 14px; padding: 0; max-width: 340px; }
.exact-offers li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.exact-offers li:first-child strong { color: var(--good); }
.exact-actions { display: flex; align-items: center; gap: 12px; }
@media (max-width: 520px) { .exact-match { grid-template-columns: 110px 1fr; gap: 14px; padding: 12px; } .exact-body h2 { font-size: 1.05rem; } }

/* A row of cards that is swiped sideways: the other colours, the cheaper look-alikes. */
.product-row {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 180px); gap: 14px; overflow-x: auto;
    padding: 2px 2px 12px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.product-row > * { scroll-snap-align: start; }

/* A picture dragged onto the page is searched (upload.js). */
.drop-veil {
    position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; pointer-events: none;
    background: var(--veil); color: var(--text); font-size: 1.3rem; font-weight: 700;
}
.drop-veil span { padding: 26px 40px; border: 2px dashed var(--text); border-radius: var(--radius); background: var(--surface); }
.is-dropping .drop-veil { display: flex; }

/* ---------- additions ---------- */

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--text); color: var(--inverse); padding: 8px 14px; z-index: 20; }
.skip-link:focus { left: 8px; top: 8px; }

/* Header: second row with the main navigation */
.site-nav { border-top: 1px solid var(--line); }
.site-nav { --nav-pad: 11px; --nav-gap: 20px; }
.site-nav-row { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
/* Who it is for, what it is, and the two shortcuts on the right: three groups with a line in between. */
.site-nav-group { display: flex; flex: none; align-items: center; gap: var(--nav-gap); }
/* Room that the categories cannot use is shared between both sides: they stand centred between the lines,
   together with the "more" button. */
.site-nav-cats, .site-nav-cats[hidden] + .site-nav-more { margin-left: auto; }
.site-nav-more, .site-nav-cats:has(+ .site-nav-more[hidden]) { margin-right: auto; }
.site-nav-divider { flex: none; width: 1px; height: 18px; background: var(--line); }
/* The categories take the room that is left. Those that do not fit wrap onto a second line that is cut off:
   they are found in the menu behind the button instead (see nav.js). Cut off by a clip-path that leaves a few pixels
   around the row, not by overflow: hidden, which also cut the frame the keyboard draws around an entry (the second
   line starts further down than the clip-path reaches). */
.site-nav-cats {
    display: flex; flex: 1 1 0; flex-wrap: wrap; gap: 10px var(--nav-gap); min-width: 0; clip-path: inset(-5px);
    height: calc(0.9rem * 1.5 + 2 * var(--nav-pad));
}
.site-nav-cats[hidden] { display: none; }
.site-nav-cats a.is-cut { visibility: hidden; }
.site-nav a {
    position: relative; padding: var(--nav-pad) 0; text-decoration: none; font-size: 0.9rem; line-height: 1.5; color: var(--muted);
    transition: color var(--dur-1);
}
/* A bar under the entry of the page the visitor is on. Hover only darkens the writing, without a bar. */
.site-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
    background: var(--text); transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out);
}
.site-nav a[aria-current] { color: var(--text); }
/* Only where a pointer really hovers: on touch screens a tap leaves :hover behind, which made a second entry look chosen. */
@media (hover: hover) { .site-nav a:hover { color: var(--text); } }
.site-nav a[aria-current]::after { transform: scaleX(1); }
/* Who it is for is a switch: the chosen gender is filled and stays while the visitor picks a category. */
.site-nav-group.is-gender { gap: 2px; padding: 3px; background: var(--track); border: 1px solid var(--line); border-radius: var(--radius); }
.site-nav-group.is-gender a {
    padding: 2px 12px; border-radius: var(--radius); color: var(--text); font-weight: 600; letter-spacing: 0.01em;
    transition: background-color var(--dur-1), color var(--dur-1);
}
.site-nav-group.is-gender a::after { content: none; }
.site-nav-group.is-gender a:hover { background: var(--track-hover); }
.site-nav-group.is-gender a[aria-current] { background: var(--text); color: var(--inverse); }
.site-nav a.is-sale, .site-nav a.is-sale:hover, .site-nav a.is-sale[aria-current] { color: var(--accent); font-weight: 600; }
.site-nav a.is-sale::after { background: var(--accent); }

/* The "more" entry and its menu with the categories that had no room in the row. It is one more entry of the row,
   written like the others (no box around it), with a small arrow; on phones too, where it names the open category. */
.site-nav-more { position: relative; flex: none; }
.site-nav-more[hidden] { display: none; }
.site-nav-more summary {
    position: relative; display: flex; align-items: center; gap: 6px; padding: var(--nav-pad) 0;
    cursor: pointer; list-style: none; font-size: 0.9rem; line-height: 1.5; color: var(--muted); user-select: none;
    transition: color var(--dur-1);
}
.site-nav-more summary::-webkit-details-marker { display: none; }
/* A small arrow that turns over while the menu is open */
.site-nav-more summary::after {
    content: ""; flex: none; width: 5px; height: 5px; margin: 0 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: translateY(-1.5px) rotate(45deg); transition: transform var(--dur-2) var(--ease-out);
}
/* It keeps its middle while it turns: moved within the same transform (a margin that changed made it jump first). */
.site-nav-more[open] summary::after { transform: translateY(1.5px) rotate(225deg); }
/* The bar under it, as under the other entries: only while the open category is in its menu, not on hover. */
.site-nav-more summary::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
    background: var(--text); transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out);
}
.site-nav-more[open] summary, .site-nav-more.is-current summary { color: var(--text); }
@media (hover: hover) { .site-nav-more summary:hover { color: var(--text); } }
.site-nav-more.is-current summary::before { transform: scaleX(1); }
.site-nav-more summary:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 2px; }
/* What the button says: see nav.js */
.site-nav-more .more-full, .site-nav-more .more-dots { display: none; }
.site-nav-more[data-label="full"] .more-full { display: inline; }
.site-nav-more[data-label="full"] .more-short, .site-nav-more[data-label="none"] .more-short { display: none; }
.site-nav-more[data-label="none"] .more-dots { display: flex; font-size: 1.25rem; }
.site-nav-more[data-label="none"] summary::after { content: none; }
.site-nav-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; display: flex; flex-direction: column;
    min-width: 210px; max-width: calc(100vw - 24px); max-height: min(75vh, 560px); overflow-y: auto; padding: 6px;
    background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / calc(.12 * var(--shadow-k)));
    /* Never past the lower edge of the window: the header stays at the top, so the page cannot be scrolled to bring
       the last entries up (--header-h, see nav.js; 0 where the header scrolls away with the page, and there the
       page scrolls). The menu scrolls in itself, without taking the page along at its end. */
    max-height: min(75vh, 560px, 100vh - var(--header-h) - 20px);
    max-height: min(75dvh, 560px, 100dvh - var(--header-h) - 20px - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}
/* It opens with a short move down from the button, every time: the animation belongs to the open state (on the
   menu itself it ran once, unseen, when the page loaded). */
.site-nav-more[open] > .site-nav-menu { animation: menu-in var(--dur-1) var(--ease-out); } /* the one of the filters' boxes and the suggestions */
.site-nav-menu a { padding: 9px 12px; border-radius: var(--radius); color: var(--text); }
.site-nav-menu a[hidden] { display: none; }
.site-nav-menu a::after { content: none; }
.site-nav-menu a:hover { background: var(--soft); }
.site-nav-menu a[aria-current] { background: var(--soft); font-weight: 600; }
/* Every category with its picture, as on the start page; the open one is ticked. */
.site-nav-menu a { display: flex; align-items: center; gap: 10px; }
.site-nav-menu .menu-icon { display: flex; justify-content: center; flex: none; width: 1.4em; font-size: 1.15rem; line-height: 1; color: var(--muted); }
.site-nav-menu a:hover .menu-icon, .site-nav-menu a[aria-current] .menu-icon { color: inherit; }
.site-nav-menu a[data-cat][aria-current]::after {
    content: ""; position: static; flex: none; width: 15px; height: 15px; margin-left: auto; border-radius: 0; background: currentColor; transform: none;
    -webkit-mask: var(--icon-check) center / contain no-repeat; mask: var(--icon-check) center / contain no-repeat;
}
.site-nav-more .more-icon { display: none; }
.site-nav-menu a.is-menu-sale { display: none; color: var(--accent); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .site-nav a, .site-nav a::after, .site-nav-more summary, .site-nav-more summary::after, .site-nav-more summary::before { transition: none; }
    .site-nav-more[open] > .site-nav-menu { animation: none; }
}

/* Narrow screens: the sale moves from the row into the menu and the genders go, so categories and brands have room.
   The menu becomes a panel over the whole width, with the categories in two columns. */
@media (max-width: 560px) {
    .site-nav { position: relative; }
    .site-nav-more { position: static; }
    .site-nav a.is-sale { display: none; }
    /* No gender switch on phones, nor the line after it: the gender is chosen in the filters of the search. */
    .site-nav-group.is-gender, .site-nav-group.is-gender + .site-nav-divider { display: none; }
    /* No categories in the row either: one or two of them next to a "more" button look lost. The button is the
       category selector instead: it names the open category and lists all of them. Like the categories on wide
       screens it stands centred in the room before the line that sets off the shortcuts. */
    .site-nav-cats { display: none; }
    .site-nav-row > .site-nav-cats + .site-nav-more { margin-left: auto; margin-right: auto; }
    .site-nav-more[data-label="short"] .more-full { display: inline; }
    .site-nav-more[data-label="short"] .more-short { display: none; }
    .site-nav-more .more-full { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; } /* room for the g of "Kategorien" */
    /* Where the row is short of room, the button gives way first by cutting its name short ("Hoodies & P…"), with the
       picture of the category still in front of it, before nav.js takes the picture away and then the name. Not to
       fewer than a few letters: those say nothing, and the dots say "more" as well. */
    .site-nav-more { flex: 0 1 auto; min-width: 0; }
    .site-nav-more summary { min-width: 0; }
    /* Where the visitor has set a larger writing (text only, up to twice the size), the row grows with it only as
       far as the screen has room for its four entries: beyond that the button was written over "Für dich". At
       the usual size this is 0.9rem as everywhere (15.3px is that size, 4.75vw is it on a phone of 320px). */
    .site-nav-row > .site-nav-group a, .site-nav-more summary { font-size: min(0.9rem, max(15.3px, 4.75vw)); }
    .site-nav-more .more-full { min-width: 3.5em; }
    /* Written like the entries beside it, as on large screens: the name of the open category in the colour of the
       text and with the bar under it, with the picture of the category in front. */
    .site-nav-more summary { gap: 7px; }
    .site-nav-more[data-label="full"] .more-icon { display: flex; font-size: 1.1rem; line-height: 1; }
    /* The categories as tiles, picture above the name, like on the start page: three in a row. */
    .site-nav-more .site-nav-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; align-items: stretch; border-radius: var(--radius); }
    .site-nav-menu a[data-cat] {
        flex-direction: column; justify-content: flex-start; gap: 6px; padding: 12px 4px 10px; border-radius: var(--radius);
        text-align: center; font-size: 0.8rem;
        /* A name that is wider than its tile breaks where the word does, with a hyphen ("Sportbeklei-dung"). */
        -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word;
    }
    .site-nav-menu .menu-icon { width: auto; font-size: 1.6rem; color: inherit; }
    .site-nav-menu .menu-icon .icon { stroke-width: 1.5; }
    .site-nav-menu a[data-cat][aria-current] { box-shadow: inset 0 0 0 1.5px var(--text); }
    .site-nav-menu a[data-cat][aria-current]::after { content: none; }
    .site-nav-menu {
        top: calc(100% + 6px); left: 12px; right: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px;
        min-width: 0; max-width: none; padding: 8px; box-shadow: 0 12px 32px rgb(0 0 0 / calc(.16 * var(--shadow-k)));
    }
    .site-nav-menu { align-items: center; }
    .site-nav-menu a { white-space: normal; line-height: 1.25; }
    .site-nav-menu a.is-menu-sale {
        display: block; grid-column: 1 / -1; margin-top: 6px; text-align: center; background: var(--accent-soft); border-radius: var(--radius);
    }
    .site-nav-menu a.is-menu-sale:hover, .site-nav-menu a.is-menu-sale[aria-current] { background: var(--accent-fill); color: var(--on-accent); }
}

@media (max-width: 760px) {
    .header-search { order: 3; flex-basis: 100%; }
    h1 { font-size: 1.45rem; }


}

/* Footer */
.site-footer { padding: 28px 0 22px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; margin-bottom: 18px; }
/* The titles of the columns are headings (a screen reader finds the footer's parts by them), written as before. */
.footer-grid strong, .footer-title { display: block; color: var(--text); margin: 0 0 6px; font-size: inherit; font-weight: 700; letter-spacing: 0; }
.footer-grid p { margin: 0; max-width: 320px; }
.footer-grid nav a { display: block; text-decoration: none; padding: 4px 0; }
.footer-grid nav a:hover { text-decoration: underline; }
.footer-note { border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div { grid-column: 1 / -1; } }

/* Buttons */
.button-outline { background: transparent; color: var(--text); }
.button-large { padding: 12px 22px; font-size: 1.05rem; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; }

/* A picture of a shop (ProductImage.razor), and one that is missing or cannot be loaded */
.shop-picture { filter: var(--picture-filter); }
/* A picture that arrived after the page was there (ProductImage marks it when it has loaded) fades in on its tile
   instead of jumping onto it. */
.shop-picture[data-arrived] { animation: picture-arrived var(--dur-2) var(--ease-out); }
@keyframes picture-arrived { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .shop-picture[data-arrived] { animation: none; } }
.image-placeholder {
    filter: none;
    --picture: var(--placeholder); /* wherever it stands in for a picture, it has its own colour */
    display: block; width: 100%; aspect-ratio: 4 / 5;
    background: var(--picture) url("favicon.svg") center / 36px no-repeat; opacity: 0.6;
}
/* A picture that could not be loaded is the same placeholder: nothing of the picture element shows through it,
   not the alt text either (it is still read out), and it is not blended onto the tile behind it. */
img.image-placeholder { color: transparent; font-size: 0; mix-blend-mode: normal; }

/* Search: kinds of articles of the category, above the list */
.subcategories { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; }
.subcategories .chip { cursor: pointer; }
.subcategories .chip .count { margin-left: 2px; }
@media (max-width: 760px) {
    .subcategories { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 14px; padding: 0 var(--gutter) 4px; scrollbar-width: none; }
    .subcategories::-webkit-scrollbar { display: none; }
    .subcategories .chip { flex: none; }
}

/* Search: on small screens the filters fold away behind a button */
.filters-toggle { display: none; align-items: center; justify-content: center; gap: 8px; }
.empty button { margin-top: 4px; }
@media (max-width: 760px) {
    .filters { padding: 10px; }
    .filters.is-open { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
    /* Folded away, the filters are the button alone: no box around a box. */
    .filters:not(.is-open) { padding: 0; }
    .filters-toggle { display: flex; padding: 10px 14px; background: var(--surface); }
    .filters-body { display: none; margin-top: 4px; }
    .filters.is-open .filters-body { display: block; }
    .filters-actions { display: grid; gap: 8px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
    /* Count and sorting share one row; the note about the personal order gets its own below. */
    .results-bar .personal-note { order: 3; flex-basis: 100%; margin-left: 0; }
    /* The word "Sortieren" is not shown but still read out: it is the name of the field. */
    .results-sort span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    /* The sorting takes the room that count and view switch leave, so the three stay on one row. */
    .results-sort { flex: 1 1 120px; min-width: 0; }
    /* Less room around the words and a size smaller (16px, the least a phone does not zoom into), so "Beste Treffer"
       still fits beside the count and the views on a narrow phone. */
    .results-sort select { width: 100%; min-width: 0; padding-left: 10px; padding-right: 28px; background-position: right 7px center; font-size: max(16px, 0.94rem); }
    /* More room between the rows than between the two cards of a row: the price of a card belongs to the picture
       above it, not to the one below. */
    .product-grid { gap: 20px 10px; }
    .product-card-body { padding: 10px 2px 4px; }
}
/* Opened on a phone, the filters are a panel over the list, from under the header down to the search field at
   the bottom edge, like the one over the feed (.filters.is-over-feed): the button "Filter" stays at its top and
   closes it, "n Artikel anzeigen" stays at its bottom, and only the options between them scroll. Folded into the
   page they were 1100px of options that pushed the list off the screen, with the button that shows the list at
   their far end, and closing them left the visitor wherever the page had been scrolled to. Now the page behind
   does not move at all: it is where it was when the panel closes. The panel fades in with a short rise, so it is
   seen to arrive; it closes at once.
   Not in a window too low for a panel (a phone on its side, up to 520px: the header does not stay at the top
   there either): there the filters fold into the page as before. */
@media (max-width: 760px) and (min-height: 521px) {
    html:has(.filters.is-open:not(.is-over-feed)) { overflow: hidden; }
    .filters.is-open:not(.is-over-feed) {
        position: fixed; inset: var(--header-h) 0 0 0; z-index: 9; /* under the header and what it opens */
        display: flex; flex-direction: column; overflow: hidden;
        padding: 12px max(var(--gutter), env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
        background: var(--bg); border: none; border-radius: 0;
        animation: filters-in var(--dur-2) var(--ease-out);
    }
    body:has(.site-header:not(.no-phone-search) .header-search) .filters.is-open:not(.is-over-feed) {
        bottom: calc(72px + env(safe-area-inset-bottom)); padding-bottom: 6px;
    }
    .filters.is-open:not(.is-over-feed) .filters-toggle { flex: none; }
    .filters.is-open:not(.is-over-feed) .filters-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
    /* The scroll bar of the options at the edge of the screen, and room for the ring of the keyboard focus on both sides. */
    .filters.is-open:not(.is-over-feed) .filters-options {
        flex: 1 1 auto; min-height: 0; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
        overflow-y: auto; overscroll-behavior: contain;
    }
    .filters.is-open:not(.is-over-feed) .filters-actions { flex: none; }
    /* What the panel covers is out of reach while it is open, for the keyboard and for a screen reader too (they
       would walk through a list nobody sees): once the panel has faded in, so the page is still behind it while it does. */
    html:has(.filters.is-open:not(.is-over-feed)) :is(.search-title, .interpretation, .subcategories, .search-layout > .results, .site-footer) {
        visibility: hidden; transition: visibility 0s var(--dur-2);
    }
}
@keyframes filters-in { from { opacity: 0; transform: translateY(8px); } }
/* The panel over the feed fades in as well; it comes from the side there, so it does not rise. */
.filters.is-over-feed.is-open { animation: wait-fade var(--dur-2) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .filters.is-open:not(.is-over-feed), .filters.is-over-feed.is-open { animation: none; } }

/* Start page sections */
.home-section { margin-top: 76px; }
/* The heading of a section stays under the header while its articles scroll past, and goes with the end of the
   section, where the next one takes its place. Over the gutter as well, so nothing shows beside it. The line under
   it only while it stands over articles (where the browser can tell, scroll-state; elsewhere there is none). */
.home-section > .piece-head {
    position: sticky; top: var(--header-h); z-index: 5; container-type: scroll-state;
    margin: -10px calc(-1 * var(--gutter)) 6px; padding: 10px var(--gutter); background: var(--bg);
}
.home-section > .piece-head h2 { margin: 0; }
.home-section > .piece-head h2::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 1px solid var(--line); opacity: 0;
}
@container scroll-state(stuck: top) { .home-section > .piece-head h2::after { opacity: 1; } }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 1.3rem; margin: 0; }
/* The shops begin under their heading, at the left edge like everything else on the page: centred, each of their
   rows began somewhere else, under a heading that stands left. */
.shop-strip ul { justify-content: flex-start; }
.shop-strip a { text-decoration: none; }
.shop-strip .shop-icon { width: 16px; height: 16px; padding: 1px; margin-right: 8px; vertical-align: -3px; }
.shop-strip a:hover { text-decoration: underline; color: var(--text); }

/* Favourites */
.notice.is-good { background: var(--good-soft); color: var(--good); font-weight: 600; }
.price-change { margin-top: 6px; font-size: 0.8rem; font-weight: 600; }
.price-change.is-down { color: var(--good); }
.price-change.is-up { color: var(--muted); }

/* Product detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; margin: 14px 0 8px; }
/* minmax(0, …): a long row of thumbnails or a wide picture must not stretch the page */
@media (max-width: 760px) { .detail { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
/* The picture: a frame in the shape of the shops' photos (4:5), so a photo fills it and nothing is left beside it.
   Where the frame has another shape (a phone, where it must leave room for the price) the picture is shown whole
   and blended onto the frame like a card's onto its tile (--picture-fit, --picture-blend): what is beside it is
   the colour of the photo's own ground, not a second grey. */
.detail-image {
    position: relative; aspect-ratio: 4 / 5; background: var(--picture); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; isolation: isolate;
}
/* All pictures of the article side by side, one in view: swiped from one to the next like the pictures in the
   feed, or moved by a thumbnail (gallery.js). The bar of the row is not shown; the thumbnails say where it is. */
.detail-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.detail-track::-webkit-scrollbar { display: none; }
.detail-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.detail-image img, .detail-image .image-placeholder { display: block; width: 100%; height: 100%; object-fit: contain; }
.detail-image img:not(.image-placeholder) { background-color: var(--picture-fit); mix-blend-mode: var(--picture-blend); }
/* Which picture of how many, on the picture: only where the thumbnails are left out (a phone, see there). */
.detail-count {
    display: none; position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: var(--radius);
    background: var(--glass); color: var(--text); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3;
}
/* The row scrolls sideways, and what scrolls cuts off what reaches over its edge: 4px of room on every side (taken
   back by the margin) keep the focus ring of a small picture whole. */
.detail-thumbs { display: flex; gap: 8px; margin: 6px -4px 0; overflow-x: auto; padding: 4px; }
.detail-thumb { flex: 0 0 64px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.detail-thumb.is-active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.detail-thumb img, .detail-thumb .image-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.detail-summary h1 { margin: 2px 0 8px; font-size: 1.6rem; }
a.brand { text-decoration: none; }
a.brand:hover { text-decoration: underline; }
.detail-price { margin: 18px 0 14px; }
.detail-price strong { font-size: 1.9rem; letter-spacing: -0.02em; }
.detail-price s { color: var(--muted); margin: 0 8px; }
.detail-price .hint, .detail-price .saving { display: block; }
.saving { color: var(--good); font-weight: 600; font-size: 0.9rem; }
.detail-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
/* The heart among the buttons of the article is one of them: as tall as the outlined buttons beside it and drawn
   like them (it was a small grey pill beside a large button), red once it is set. Its two labels differ in length:
   it is as wide as the longer one from the start, so setting it does not push the buttons beside it along. */
.detail-actions .favorite-button { justify-content: center; gap: 0.4em; min-width: 14.6rem; min-height: 46px; padding: 9px 18px; font-size: 1.05rem; font-weight: 600; }
.detail-actions .favorite-button:not(.is-active) { background: transparent; border-color: var(--text); }
.detail-actions .favorite-button .icon + span { font-size: 1rem; }
/* Beside a narrow picture or under it (up to a small laptop) the buttons are a column of one width, with the
   words in the middle: side by side they had four widths and ragged ends. */
@media (max-width: 1023px) {
    .detail-actions .button, .detail-official .button, .detail-actions .favorite-button { flex: 1 1 100%; text-align: center; justify-content: center; }
}
.detail-block { margin-top: 20px; }
.detail-block h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: var(--caps-track); color: var(--muted); margin: 0 0 8px; }
.detail-block p { margin: 0; }
.detail-block .size-missing { margin-top: 8px; }
/* Another size for the alert: the field and its button on one row, the same height, on a phone too. */
.size-alert-form { flex-wrap: nowrap; gap: 8px; margin-top: 8px; max-width: 420px; }
.size-alert-form .brand-filter { flex: 1 1 0; min-width: 0; max-width: none; margin: 0; }
.size-alert-form button { flex: none; min-height: var(--field-h); padding: 4px 12px; white-space: nowrap; }
.color-variants { display: flex; flex-wrap: wrap; gap: 8px; }
.color-variants a { width: 60px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.color-variants a:hover { border-color: var(--text); }
.color-variants img, .color-variants .image-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
/* The colours of the model on its page (ProductDetail): a picture per colour with its lowest price under it. The one
   of the page is ringed; a reduced price is in the colour of a reduction. Wraps onto a second row, never scrolls
   sideways: every colour is in sight with its price. */
.detail-colours { margin-top: 14px; }
.detail-colours-head { margin: 0 0 8px; font-size: 0.9rem; }
.detail-colours-head .hint { margin: 0; }
.colour-picks { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.colour-pick { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 60px; text-decoration: none; color: var(--text); }
.colour-pick img, .colour-pick .image-placeholder {
    display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius);
    border: 1px solid var(--line); background-color: var(--picture);
}
.colour-pick:hover img { border-color: var(--line-hover); }
.colour-pick.is-current img, .colour-pick.is-current .image-placeholder { outline: 2px solid var(--text); outline-offset: 1px; border-color: transparent; }
.colour-pick-price { font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.colour-pick.is-current .colour-pick-price { color: var(--text); font-weight: 600; }
.colour-pick-price.is-reduced { color: var(--accent); }
.detail-colours-deal { margin: 8px 0 0; }

.price-chart { margin: 0 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; max-width: 720px; }
/* The lines are a drawing stretched to the box (PriceChart.razor), their strokes keep their thickness; the prices
   stand in a column at its left on the height of their line, the dates in a row under it, the dot at the end of a
   line is a box on the drawing: all of them the page's own text and sizes, on a phone as on a monitor (inside the
   drawing an 11px label shrank to 6px on a phone). */
.price-chart-plot { position: relative; height: 150px; padding-left: 4.9rem; }
.price-chart-lines { position: relative; height: 100%; margin-right: 5px; }
.price-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.price-chart .axis { stroke: var(--line); stroke-width: 1; }
.price-chart-y { position: absolute; left: 0; transform: translateY(-50%); color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-chart-x { display: flex; justify-content: space-between; gap: 12px; margin: 2px 5px 0 4.9rem; color: var(--muted); font-size: 0.75rem; }
/* A shop's own colour (--shop) as far as the page allows it: as it is on the light page, mixed with white on the
   dark one (--shop-keep), where the dark blues and greys of some shops could not be told from the ground. */
.price-chart polyline { stroke: var(--shop); stroke-width: 2.5; }
.price-chart-end, .price-chart .shop-dot { background: var(--shop); }
/* The mix only where the browser knows it: a declaration with var() is not dropped when color-mix() is unknown, it
   becomes no colour at all, and the lines and dots would be gone (Safari before 16.2, Firefox before 113). */
@supports (color: color-mix(in oklab, red, blue)) {
    .price-chart polyline { stroke: color-mix(in oklab, var(--shop) var(--shop-keep), #fff); }
    .price-chart-end, .price-chart .shop-dot { background: color-mix(in oklab, var(--shop) var(--shop-keep), #fff); }
}
.price-chart-end { position: absolute; left: 100%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); }
.price-chart figcaption { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.85rem; margin-top: 6px; }
.history { padding-left: 18px; color: var(--muted); font-size: 0.85rem; }

/* Brands */
.brand-filter { width: 100%; max-width: 360px; margin-bottom: 14px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.letters a { min-width: 2em; padding: 4px 8px; text-align: center; text-decoration: none; font-weight: 600; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.letters a:hover { border-color: var(--text); }
.brand-group { scroll-margin-top: 2px; } /* beyond the scroll-padding of the page */
.brand-group ul { list-style: none; padding: 0; margin: 0 0 8px; columns: 4 200px; column-gap: 24px; }
.brand-group li { padding: 3px 0; break-inside: avoid; }
.brand-group a { text-decoration: none; }
.brand-group a:hover { text-decoration: underline; }

/* Text pages */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose li { margin-bottom: 8px; }

/* Data page */
.admin-unlock { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.personal-note { color: var(--accent); white-space: nowrap; margin-left: 8px; cursor: pointer; }
.personal-note input { margin: 0 4px 0 0; vertical-align: -1px; accent-color: var(--accent); }
.account-section { margin: 28px 0; }
.account-section h2 { font-size: 1.15rem; margin-bottom: 4px; }
.account-section .chips { margin: 8px 0 14px; }
/* The brands "Neu von deinen Marken" is for (NewFromBrandsPage.razor), above its articles. */
.chips.new-brands { margin-bottom: 18px; }
.account-section h3 { font-size: 0.85rem; color: var(--muted); font-weight: 600; margin: 12px 0 0; }
.login-form { display: grid; gap: 6px; max-width: 360px; margin: 16px 0; }
.login-form label { font-weight: 600; margin-top: 8px; }
.login-form input { font: inherit; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.login-form button { margin-top: 14px; }
.admin-unlock input { font: inherit; padding: 6px 10px; border: 1px solid var(--field-line); border-radius: var(--radius); }

/* Account forms (login, registration, settings) */
.login-form input:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.login-form label .hint { font-weight: 400; }
.login-form .check { font-weight: 400; margin-top: 12px; align-items: flex-start; }
.login-form .check input { width: auto; margin-top: 4px; padding: 0; }
.login-form p.hint { margin: 0; }
.login-form .choice { border: 0; padding: 0; margin: 8px 0 0; min-width: 0; }
.login-form .choice legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
/* Radio buttons that look like one switch: the options lie on one track, the chosen one is filled (as the gender
   switch of the header). */
.segmented {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px;
    background: var(--track); border: 1px solid var(--line); border-radius: var(--radius);
}
.segmented.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented.is-three span { padding-left: 6px; padding-right: 6px; }
/* On phones three share the width: their writing a little smaller, so that «Automatisch» is not broken in two. */
@media (max-width: 420px) { .segmented.is-three span { padding-left: 4px; padding-right: 4px; font-size: 0.94rem; } }
/* The narrowest phones (320px and a folded one): smaller again and never broken, the word needs 80px there. */
@media (max-width: 340px) { .segmented.is-three span { padding-left: 2px; padding-right: 2px; font-size: 0.82rem; white-space: nowrap; } }
.login-form .segmented label { position: relative; margin: 0; font-weight: 600; cursor: pointer; }
.login-form .segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
    display: block; height: 100%; padding: 8px 12px; text-align: center; border-radius: calc(var(--radius) - 2px);
    transition: background-color var(--dur-1), color var(--dur-1);
}
.segmented label:hover span { background: var(--track-hover); }
.segmented input:checked + span { background: var(--text); color: var(--inverse); }
.segmented input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
/* View track (ViewTrack.razor): grid, feed, feed over the whole screen, as pictures in the track of the choice of the
   look above. Over the grid the grid is chosen (is-on); in the feed the size it has (data-feed-full, feed.js). */
.view-track {
    display: inline-flex; flex: none; gap: 2px; margin: 0; padding: 2px;
    background: var(--track); border: 1px solid var(--line); border-radius: var(--radius);
}
.view-track-item {
    /* The track is as tall as the fields it stands in a row with (--field-h): 6px are its own padding and line. */
    display: grid; place-items: center; width: 40px; height: calc(var(--field-h) - 6px); padding: 0; border: 0; border-radius: calc(var(--radius) - 2px);
    background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; text-decoration: none; cursor: pointer;
    transition: background-color var(--dur-1), color var(--dur-1);
}
.view-track-item.is-on { cursor: default; }
@media (hover: hover) { .view-track-item:not(.is-on):hover { background: var(--track-hover); color: var(--text); } }
.view-track-item.is-on, html:not([data-feed-full]) .view-track-item.is-page, html[data-feed-full] .view-track-item.is-full,
.view-track-item.is-on:hover, html:not([data-feed-full]) .view-track-item.is-page:hover, html[data-feed-full] .view-track-item.is-full:hover {
    background: var(--text); color: var(--inverse);
}
.view-track-item:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* The way back to the grid is where the keyboard starts when a feed opens: without a ring for who did not come by
   keyboard (feed.js, data-quiet), or two of the views would look chosen. */
.view-track-item[data-quiet]:focus-visible { outline: none; }
/* The signs of the views grow with a larger writing as far as their box has room (it is 40px wide). */
.view-track-item .icon { font-size: min(1em, 24px); }
@media (prefers-reduced-motion: reduce) { .segmented span, .view-track-item { transition: none; } }
/* A heading with the view of its list at the other end ("Für dich"). */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0.2rem 0 1.1rem; }
.page-head h1 { margin: 0; }

/* Login and registration: one card in the middle of the page. */
.auth { max-width: 440px; margin: 24px auto 0; }
.auth-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px;
}
.auth-card h1 { font-size: 1.6rem; margin: 0 0 6px; }
.auth-lead { color: var(--muted); margin: 0 0 20px; }
.auth-card .notice { margin: 0 0 16px; font-size: 0.95rem; }
.auth-card .login-form { max-width: none; margin: 0; }
.auth-card .login-form label, .auth-card .label-row { margin-top: 12px; }
.auth-card .label-row label, .auth-card .segmented label { margin-top: 0; }
.auth-card .login-form > input { padding: 11px 12px; border-radius: var(--radius); background: var(--soft); }
.auth-card .login-form > input:hover { border-color: var(--line-hover); }
.auth-card .login-form > input:focus-visible { background: var(--surface); }
.auth-card .login-form input::placeholder { color: var(--muted); }
.auth-card .login-form button, .auth-button { width: 100%; margin-top: 22px; padding: 12px 14px; font-size: 1rem; text-align: center; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row a { font-size: 0.85rem; color: var(--muted); }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.code-input::placeholder { letter-spacing: 0.08em; }
.auth-legal { color: var(--muted); font-size: 0.8rem; margin: 18px 0 0; }
.auth-switch { text-align: center; color: var(--muted); margin: 18px 0 0; }
.auth-switch a { color: var(--text); font-weight: 600; }
.auth-side { display: none; }
/* Desktop: the form and a dark half with what an account is for, side by side in one panel. */
@media (min-width: 900px) {
    .auth { max-width: 940px; margin-top: 48px; }
    .auth-panel {
        display: grid; grid-template-columns: 5fr 6fr; overflow: hidden;
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    }
    .auth-card {
        border: 0; border-radius: 0; box-shadow: none; padding: 48px 56px; min-height: 520px;
        display: flex; flex-direction: column; justify-content: center;
    }
    .auth-card h1 { font-size: 1.75rem; margin-bottom: 6px; }
    .auth-lead { margin-bottom: 24px; }
    .auth-side {
        display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 48px 44px;
        color: #fff; background: radial-gradient(120% 90% at 0% 0%, var(--dark-from) 0%, var(--dark-to) 60%);
    }
    .auth-side img { height: 28px; width: auto; align-self: flex-start; }
    .auth-side-title { font-size: 1.6rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 20px; }
    .auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #e6e6e6; }
    .auth-side li { position: relative; padding-left: 28px; }
    .auth-side li::before {
        content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
        background: rgba(255, 255, 255, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
    }
    .auth-side-foot { margin: 0; font-size: 0.85rem; color: #a3a3a3; }
}
@media (max-width: 480px) {
    .auth { margin-top: 8px; }
    .auth-card { padding: 22px 18px; border-radius: var(--radius); }
}
.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: 0.04em; user-select: all; }
.admin-unlock input[type="number"] { width: 5em; }
.admin-heading { font-size: 1.3rem; margin: 36px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); }
h1 + .admin-heading { border-top: 0; padding-top: 0; margin-top: 8px; }
.account-section .login-form { margin-top: 4px; }
/* Account: settings, admin and signing out in one row. */
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.account-actions .button-secondary { width: auto; }
/* Settings page: one form over several groups (Allgemein, Marken, Shops, Darstellung), each with its sections; the
   shops in as many columns as fit. */
.settings-form { max-width: 720px; margin-top: 0; }
/* Margins do not collapse inside a grid: the section's own margin is the whole distance, the heading adds none. */
.settings-form .account-section { display: grid; gap: 6px; margin: 22px 0 0; }
.settings-form .account-section h2 { margin-top: 0; }
.settings-form .account-section h2 + .check, .settings-form .account-section h2 + .choice { margin-top: 4px; }
.settings-form .hint { margin: 0; }
.settings-form > button { justify-self: start; }
.settings-shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 16px; }
.settings-shops .check { margin-top: 6px; align-items: center; }
.settings-shops .check input { margin-top: 0; flex: none; }
.settings-shops .check .shop-icon { flex: none; }
/* The groups as tabs in a row that stays under the header (tabs.js marks the one on the screen). Larger than the
   chips of the favourites: they are the sections of the whole page, not a filter of a list. */
.settings-tabs {
    position: sticky; top: var(--header-h); z-index: 6; display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)) 8px; padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line);
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs a {
    position: relative; flex: none; padding: 14px 0 13px; font-size: 1.05rem; font-weight: 600; line-height: 1.3;
    color: var(--muted); text-decoration: none; white-space: nowrap; transition: color var(--dur-1);
}
.settings-tabs a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0;
    background: var(--text); transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out);
}
.settings-tabs a:hover, .settings-tabs a[aria-current] { color: var(--text); }
.settings-tabs a[aria-current]::after { transform: scaleX(1); }
.settings-tabs a:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; border-radius: 2px; }
.settings-tabs[data-settling] a, .settings-tabs[data-settling] a::after { transition: none; } /* the mark a page opens with does not glide in (tabs.js) */
@media (prefers-reduced-motion: reduce) { .settings-tabs a, .settings-tabs a::after { transition: none; } }
.settings-intro { max-width: 720px; margin: 16px 0 0; }
/* A group starts below the row of tabs when it is jumped to; the last one is tall enough that it, too, can come to
   the top. Its rows stay at the top of that height (a grid stretches them over it by default, which pulled the
   heading, the sections and their buttons and hints apart): the free room is left below them. The page already
   scrolls on by what follows the group, the Speichern bar and the footer (about 490px on wide screens, more on
   phones), so only the rest of the window (less the 64px of the tabs, see scroll-padding-top) is made up. */
.settings-group { display: grid; align-content: start; gap: 6px; padding: 28px 0 8px; }
.settings-group + .settings-group { border-top: 1px solid var(--line); margin-top: 28px; }
.settings-group:last-of-type { min-height: calc(100vh - var(--header-h) - 64px - 490px); }
.settings-group > h2 { font-size: 1.35rem; margin: 0 0 2px; }
.settings-form .settings-group > .account-section:first-of-type { margin-top: 6px; }
.settings-form .account-section h3 { font-size: 1rem; color: var(--text); margin: 0; }
.settings-form .account-section h3 + .check, .settings-form .account-section h3 + .choice { margin-top: 4px; }
/* Speichern stays at the bottom edge of the window while the groups scroll by. */
.settings-save {
    position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
    margin: 24px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line);
}
.settings-form .settings-save button { margin-top: 0; }
/* Beside phones the form is a column narrower than the window: the bar and its line are as wide as that column
   (reaching out by the gutter, the line met the left edge of a tablet's window and stopped short of the right). */
@media (min-width: 761px) { .settings-save { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; } }
/* Beside it, while something was changed and not saved yet (account.js writes the words): light or dark applies at
   once, everything else only with the button, and nothing else on the page would tell the two apart. */
.settings-unsaved { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; animation: wait-fade var(--dur-2) both; }
.settings-unsaved:empty { display: none; }
.settings-unsaved::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-fill); }
@media (prefers-reduced-motion: reduce) { .settings-unsaved { animation: none; } }

/* Brands the user likes and does not want (BrandPicker): what is chosen as chips, a field to look for a brand, and a
   list where each brand has a heart and a "no". */
.brand-picker { display: grid; gap: 10px; margin-top: 6px; }
.brand-chosen { display: grid; gap: 8px; }
.brand-chosen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.brand-chosen-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.brand-chosen-label .icon { font-size: 1.05rem; }
.brand-chosen .chip { cursor: pointer; font-weight: 600; animation: wait-fade var(--dur-2) var(--ease-out) both; } /* a brand that was just chosen is seen to arrive up here */
@media (prefers-reduced-motion: reduce) { .brand-chosen .chip { animation: none; } }
.brand-chosen .chip .icon { font-size: 0.95em; margin-right: -2px; color: var(--muted); }
.brand-chosen .chip.is-liked { border-color: var(--text); }
.brand-chosen .chip.is-disliked { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.brand-picker-search { position: relative; max-width: 360px; margin-top: 4px; }
.brand-picker-search > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.05rem; pointer-events: none; }
.brand-picker .brand-picker-search input[type="search"] { width: 100%; font: inherit; padding: 9px 10px 9px 36px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.brand-picker .brand-picker-search input[type="search"]:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.brand-picker-caption { margin: 4px 0 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.brand-pick-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 20px; }
.brand-pick { display: flex; align-items: center; gap: 2px; min-width: 0; padding: 2px 0; border-bottom: 1px solid var(--line); }
.brand-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pick.is-liked .brand-pick-name { font-weight: 600; }
.brand-pick.is-disliked .brand-pick-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.brand-picker .brand-pick button {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0;
    border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 1.1rem;
}
.brand-picker .brand-pick button:hover { background: var(--soft); color: var(--text); }
.brand-picker .brand-pick .brand-pick-like[aria-pressed="true"] { color: var(--accent); }
.brand-picker .brand-pick .brand-pick-no[aria-pressed="true"] { color: var(--text); background: var(--soft); }
.brand-pick button:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

/* Right after registering: the brands, on a page of its own (WelcomePage). */
.welcome { max-width: 720px; margin: 8px auto 0; }
.welcome h1 { margin-bottom: 8px; }
.welcome-lead { color: var(--muted); margin: 0 0 20px; max-width: 600px; }
.welcome-form { max-width: none; margin: 0; }
.welcome-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 20px;
    margin: 20px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line);
}
.welcome-form .welcome-actions button { margin-top: 0; display: inline-flex; align-items: center; }
.welcome-skip { color: var(--muted); font-weight: 600; }
/* Account: the pages with what is stored, as a list of links; and the way back on those pages. */
.account-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.account-links a {
    display: grid; gap: 2px; padding: 12px 14px; text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.account-links a:hover { border-color: var(--text); }
.account-links span { color: var(--muted); font-size: 0.85rem; }
.back-link { margin: 0 0 4px; font-size: 0.9rem; }
/* Arrow and word in a row with a gap, so the line under the link starts under the word and not under the space
   before it; tall enough for a finger without moving the heading below. */
.back-link a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; margin: -8px 0; text-underline-offset: 3px; }
/* Deleting for good in two steps, in place (ConfirmButton.razor): the question, "Abbrechen" where the button was
   pressed, and the button that does it. */
.confirm-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.confirm-inline > span { flex: 1 1 100%; font-weight: 600; }
.confirm-inline > button { display: inline-flex; align-items: center; }
.confirm-inline > .button-danger { animation: wait-fade var(--dur-2) both; }
@media (prefers-reduced-motion: reduce) { .confirm-inline > .button-danger { animation: none; } }
.form-intro { max-width: 560px; }
.form-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.notice-action .button-small { background: var(--surface); }
.button-danger { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.hero-actions { flex-wrap: wrap; }
.empty .hero-actions { justify-content: flex-start; }
.affiliate-note { color: var(--muted); font-size: 0.85rem; }

/* Data page: what is set up for going public (admins only) */
.checklist { list-style: none; padding: 0; margin: 0; max-width: 720px; }
.checklist li { padding: 6px 0 6px 26px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li::before {
    content: ""; position: absolute; left: 2px; top: 10px; width: 16px; height: 16px; background: var(--accent);
    -webkit-mask: var(--icon-ring) center / contain no-repeat; mask: var(--icon-ring) center / contain no-repeat;
}
.checklist li.is-done::before { background: var(--good); -webkit-mask-image: var(--icon-ring-check); mask-image: var(--icon-ring-check); }

/* Shown by Blazor when the connection to the server breaks with an error */
/* It looks and stands like the note of a broken connection below (.reconnect): both say that the page has stopped
   answering and offer the one thing to do about it. Blazor shows it by setting display: block on it. */
#blazor-error-ui {
    display: none; position: fixed; z-index: 100; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    box-sizing: border-box; width: max-content; max-width: min(520px, 100vw - 32px); padding: 6px 6px 6px 14px;
    border-radius: var(--radius); background: var(--text); color: var(--inverse); font-size: 0.9rem; line-height: 1.35; text-align: center;
    box-shadow: 0 2px 10px rgb(var(--shadow) / calc(.12 * var(--shadow-k)));
}
#blazor-error-ui .reload {
    display: inline-block; margin: 2px 0 2px 8px; padding: 4px 10px; border-radius: var(--radius);
    background: var(--inverse); color: var(--text); font-size: 0.85rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
#blazor-error-ui .reload:hover { background: var(--soft); }
@media (pointer: coarse), (max-width: 760px) { #blazor-error-ui .reload { padding: 7px 12px; } }

/* ---------- The connection to the server (ReconnectNotice, reconnect.js) ---------- */

/* A note at the bottom while the live connection of an interactive page is broken for longer than a moment: in the
   colour of the text, so that it stands out in both looks. The box itself is always there (it is the live region
   for screen readers) and has no size; the script sets data-state, and only the note of that state shows. */
.reconnect {
    position: fixed; z-index: 1001; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
    display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.reconnect-note {
    display: none; align-items: center; gap: 10px; max-width: 520px; margin: 0; padding: 10px 14px;
    border-radius: var(--radius); background: var(--text); color: var(--inverse); font-size: 0.9rem; line-height: 1.35;
    box-shadow: 0 2px 10px rgb(var(--shadow) / calc(.12 * var(--shadow-k))); pointer-events: auto;
    animation: wait-fade var(--dur-2) var(--ease-out) both;
}
.reconnect[data-state="waiting"] .reconnect-waiting,
.reconnect[data-state="offline"] .reconnect-offline,
.reconnect[data-state="failed"] .reconnect-failed { display: flex; }
.reconnect-ring {
    flex: none; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: wait-spin .8s linear infinite;
}
.reconnect-failed { padding: 6px 6px 6px 14px; }
.reconnect .reconnect-retry { flex: none; margin-left: 4px; background: var(--inverse); color: var(--text); border-color: var(--inverse); white-space: nowrap; }
.reconnect .reconnect-retry:hover { background: var(--soft); border-color: var(--soft); }
/* The narrowest phones: the note with the button is as wide as the screen allows, so its words stay on one or two
   lines beside the button instead of three. */
@media (max-width: 360px) {
    .reconnect { padding: 0 10px; }
    .reconnect-failed { flex: 1; justify-content: space-between; text-wrap: balance; }
}
@media (prefers-reduced-motion: reduce) {
    .reconnect-ring { animation-duration: 3s; }
    .reconnect-note { animation: none; }
}

/* ---------- Phones and touch screens ---------- */

/* Fingers need more room than a mouse pointer. */
@media (pointer: coarse), (max-width: 760px) {
    .chip { padding: 7px 12px; }
    .chip.is-small { padding: 6px 10px; font-size: 0.85rem; }
    .chips { gap: 8px; }
    .check { padding: 7px 0; }
    .filters .check input { width: 18px; height: 18px; flex: none; margin: 0; }
    .settings-form .check input { width: 18px; height: 18px; flex: none; margin-top: 3px; } /* the boxes of the settings as large as the filters' */
    .settings-form .settings-shops .check input { margin-top: 0; }
    .button-small { padding: 7px 12px; }
    .site-nav { --nav-pad: 13px; }
    .site-nav-group.is-gender a { padding-top: 5px; padding-bottom: 5px; }
    .site-nav-menu a { padding: 11px 12px; }
    .footer-grid nav a { padding: 11px 0; } /* rows of 44px */
    .letters { gap: 6px; }
    .letters a { min-width: 2.6em; padding: 8px 10px; }
    .brand-group li { padding: 6px 0; }
    .breadcrumb a { display: inline-block; padding: 4px 0; }
    .favorite-button { padding: 9px 11px; }
}

@media (max-width: 760px) {
    :root { --gutter: 16px; --header-h: 104px; } /* until nav.js has measured it */
    /* Safety net: content that is too wide is cut off instead of making the whole page wider than the screen. */
    main.container { padding-top: 16px; padding-bottom: 40px; overflow-x: clip; }

    /* Header: the logo and the four links are always one row, whoever is signed in and however many favourites
       there are (the search is not in the row here, see below; the number of favourites sits on the heart, see
       "up to 960px" at the end). The logo has a set height per width of screen, so it is the same on every page:
       24px, 20px up to 480px, 17px up to 339px, 14px below 320px. The links are boxes the size of a fingertip that
       stand side by side; each height is the largest that fits beside them on the narrowest screen of its step
       (320px: 12 + 135 + 9 + 4 x 40 - 8 + 12). Should it not fit after all (a very large type size), the logo
       gives way and is drawn smaller: nothing wraps onto a second row. */
    .header-row { flex-wrap: nowrap; gap: 0; padding-top: 10px; padding-bottom: 10px; }
    .logo { flex: 0 1 auto; min-width: 0; margin-right: auto; padding-right: 4px; }
    .logo img { min-width: 0; max-width: 100%; height: 24px; object-fit: contain; object-position: left center; }
    .header-spacer { display: none; }
    .header-link { padding: 0; margin: -6px 0; min-width: 44px; min-height: 44px; }
    /* The last symbol ends at the edge of the page's content, not the box around it (44px with a symbol of 24px). */
    .header-account { gap: 0; margin-right: -10px; }
    @media (max-width: 480px) { .logo img { height: 20px; } }
    @media (max-width: 359px) {
        .header-row .header-link { min-width: 40px; } /* .header-row: over the size for touch screens at the end */
        .header-account { margin-right: -8px; }
    }
    @media (max-width: 339px) { .logo img { height: 17px; } }
    /* The outer screen of the first folding phones (280px) */
    @media (max-width: 319px) {
        .logo img { height: 14px; }
        .header-row .header-link { min-width: 36px; }
        .header-account { margin-right: -6px; }
    }
    /* On the search page the search (field, photo upload, button) sits at the bottom edge, where the thumb reaches it.
       Under the full-screen views (z-index 50). */
    .header-search {
        position: fixed; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30;
        min-width: 0; max-width: none; margin: 0; padding: 5px;
        background: var(--raised); border-color: var(--field-line); box-shadow: 0 6px 24px rgb(var(--shadow) / calc(.18 * var(--shadow-k)));
    }
    .header-search:focus-within { box-shadow: 0 6px 24px rgb(var(--shadow) / calc(.18 * var(--shadow-k))), 0 0 0 3px var(--ring); }
    .header-search input[type="search"] { min-width: 0; padding-left: 16px; }
    .header-search .search-submit, .header-search .image-upload-compact label { width: 44px; height: 44px; }
    .header-search .search-submit .icon, .header-search .image-upload-compact .icon { font-size: 20px; }
    /* What opened under the field opens over it now. */
    .header-search .suggestions { top: auto; bottom: calc(100% + 8px); max-height: min(60vh, 460px); box-shadow: 0 -10px 28px rgb(var(--shadow) / calc(.14 * var(--shadow-k))); --menu-from: 4px; }
    .header-search .image-upload-compact .notice { top: auto; bottom: 100%; margin: 0 0 10px; }
    /* Room for the field, so the end of the page is not hidden behind it. */
    body:has(.site-header:not(.no-phone-search) .header-search) .site-footer { padding-bottom: calc(18px + 72px + env(safe-area-inset-bottom)); }
    /* And for what the keyboard brings into view: it stops above the field, not behind it. */
    html:has(.site-header:not(.no-phone-search) .header-search) { scroll-padding-bottom: calc(72px + 12px + env(safe-area-inset-bottom)); }
    body:has(.site-header:not(.no-phone-search) .header-search) #blazor-error-ui { bottom: calc(72px + 8px + env(safe-area-inset-bottom)); }
    body:has(.site-header:not(.no-phone-search) .header-search) .reconnect { bottom: calc(72px + 8px + env(safe-area-inset-bottom)); }
    /* A strip of the page's colour behind the field, edge to edge: the cards of the grid end at it instead of
       showing through beside and under the field (the feed does the same with its own background). */
    .site-header:not(.no-phone-search):has(.header-search)::after {
        content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 29;
        height: calc(72px + env(safe-area-inset-bottom)); background: var(--bg);
    }
    /* Only the search page has the field on phones: the other pages are for browsing and reading. */
    .no-phone-search .header-search { display: none; }

    /* Navigation: tighter, so that the categories, the "more" button and brands fit side by side on the smallest phones. */
    .site-nav { --nav-gap: 16px; }
    .site-nav-row { gap: 12px; }
    @media (max-width: 360px) {
        .site-nav { --nav-gap: 12px; }
        .site-nav-row { gap: 8px; }
    }

    /* Start page */
    .hero { padding: 16px 0 8px; }
    .hero.is-home { padding: 28px 0 4px; }
    .hero.is-home h1 { font-size: 2rem; }
    .hero .hero-lead { font-size: 1rem; }
    .hero-search { margin-top: 22px; padding: 5px; }
    .hero-search input[type="search"] { min-width: 0; padding: 10px 6px 10px 16px; font-size: 1rem; }
    /* The button is the round one with the magnifier, as in the field at the bottom of the search page. */
    .search-box.hero-search .search-submit { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
    .search-box.hero-search .search-submit .search-submit-icon { display: block; font-size: 20px; }
    .search-box.hero-search .search-submit-label { display: none; }
    .category-index { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; margin-bottom: 28px; }
    .category-index .count { display: none; }
    .category-index .name { gap: 6px; } /* with the narrower gutter: "Hoodies & Pullover" on one line on an ordinary phone (390px) */
    .home-section { margin-top: 30px; }
    .section-head h2 { font-size: 1.15rem; }
    .shop-strip ul { gap: 8px 18px; }

    /* Search */
    .search-layout, .image-search-layout { gap: 16px; }
    .search-layout > * { min-width: 0; }
    .interpretation { padding: 0 0 12px; margin-bottom: 14px; }
    .results-bar { gap: 8px 12px; }
    .results-bar label { display: flex; align-items: center; gap: 8px; }
    .scroll-list { max-height: 300px; }
    .product-card .name { font-size: 0.95rem; line-height: 1.35; }
    .product-card .price { font-size: 1rem; }
    .product-card-body { overflow-wrap: anywhere; }
    .product-card-favorite { top: 0; right: 0; }
    .product-card-badges { top: 8px; left: 6px; }

    /* Product detail */
    /* The picture takes less than half of the screen's height, so that under it the name, the price and the button
       to the shop are on the first screen too (it used to fill the screen and push them a screen down). */
    .detail-image { aspect-ratio: auto; height: max(220px, min(110vw, 46vh, 100vh - 390px)); }
    /* Measured by the screen with the browser's bars showing (svh), which is how the page opens on a phone: "vh"
       is the screen without them there, and the button to the shop stood behind the lower bar. */
    @supports (height: 1svh) { .detail-image { height: max(220px, min(110vw, 46svh, 100svh - 390px)); } }
    .detail-thumbs { scrollbar-width: none; }
    .detail-thumbs::-webkit-scrollbar { display: none; }
    .detail-price { margin: 14px 0 12px; }
    .price-chart { padding: 10px; }
    .price-chart-plot { height: 130px; }

    /* The path to the page on one line: the page's own name is left out (the heading under it says it), and the
       last link is cut short with "…" where the row is too long. As tall as a finger needs. */
    .breadcrumb { flex-wrap: nowrap; gap: 6px; min-height: 44px; margin-top: -8px; white-space: nowrap; }
    .breadcrumb > [aria-current], .breadcrumb > .icon:has(+ [aria-current]) { display: none; }
    .breadcrumb > a { flex: none; padding: 10px 0; }
    .breadcrumb > a:last-of-type { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

    /* Offers of a product: one block per shop instead of a table that scrolls sideways. */
    .offer-table.is-stacked { display: block; overflow: hidden; }
    .offer-table.is-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .offer-table.is-stacked tbody { display: block; }
    .offer-table.is-stacked tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
    .offer-table.is-stacked tr:last-child { border-bottom: none; }
    .offer-table.is-stacked td { display: block; padding: 0; border: none; }
    .offer-table.is-stacked td:first-child { grid-area: 1 / 1; }
    .offer-table.is-stacked .offer-price { grid-area: 1 / 2; }
    .offer-table.is-stacked .sizes { grid-area: 2 / 1 / auto / -1; }
    .offer-table.is-stacked .offer-go { grid-area: 3 / 1 / auto / -1; }
    .offer-table.is-stacked .offer-go .button { display: block; text-align: center; margin-top: 4px; }
    .offer-table.is-stacked .offer-price s { display: block; margin: 0; font-size: 0.85rem; }
    .offer-table.is-stacked .best-badge, .offer-table.is-stacked .official-badge { display: inline-block; margin: 2px 0 2px 6px; }
    /* Other tables keep their columns and scroll inside their own box. */
    .offer-table th, .offer-table td { padding: 10px 12px; }
    .offer-table { -webkit-overflow-scrolling: touch; }

    /* Brands, forms, footer */
    .brand-filter, .login-form { max-width: none; }
    .brand-group ul { columns: 2 130px; column-gap: 16px; }
    .login-form input:not([type="checkbox"]) { padding: 10px 12px; }
    .login-form button { padding: 12px 14px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats strong { font-size: 1.35rem; }
    .site-footer { padding-top: 22px; }
    .footer-grid { gap: 18px 24px; }
}

/* Very narrow phones */
@media (max-width: 350px) {
    :root { --gutter: 12px; }
    .product-grid { gap: 18px 8px; }
    .product-card-body { padding: 8px 1px 4px; }
}

/* ---------- Waiting for the AI ---------- */

/* The text search and the photo search both ask the AI, which takes seconds. The wait shows what is being
   worked on, ticks off steps and already has the shape of the result, so it feels shorter than it is.
   Time alone moves everything here: no script, and nothing is sent back and forth while the AI works. */

@keyframes wait-fade { from { opacity: 0; } }
@keyframes wait-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes wait-spin { to { transform: rotate(360deg); } }

/* The place in the row (--n), for what comes in one after another. */
.chips > :nth-child(2), .product-grid > :nth-child(2), .piece:nth-child(2) { --n: 1; }
.chips > :nth-child(3), .product-grid > :nth-child(3), .piece:nth-child(3) { --n: 2; }
.chips > :nth-child(4), .product-grid > :nth-child(4), .piece:nth-child(4) { --n: 3; }
.chips > :nth-child(5), .product-grid > :nth-child(5), .piece:nth-child(5) { --n: 4; }
.chips > :nth-child(6), .product-grid > :nth-child(6), .piece:nth-child(6) { --n: 5; }
.chips > :nth-child(7), .product-grid > :nth-child(7), .piece:nth-child(7) { --n: 6; }
.chips > :nth-child(8), .product-grid > :nth-child(8), .piece:nth-child(8) { --n: 7; }
.chips > :nth-child(9), .product-grid > :nth-child(9) { --n: 8; }
.chips > :nth-child(10), .product-grid > :nth-child(10) { --n: 9; }
.chips > :nth-child(11), .product-grid > :nth-child(11) { --n: 10; }
.chips > :nth-child(n+12), .product-grid > :nth-child(n+12) { --n: 11; }

/* Steps (WaitSteps.razor): grey while they wait, a turning ring while they are worked on (from --at),
   a green tick once they are done (from --until). */
.wait-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9rem; }
.wait-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); animation: wait-step-on .3s var(--at) forwards; }
.wait-mark { position: relative; flex: none; width: 16px; height: 16px; }
.wait-mark i {
    position: absolute; inset: 0; border: 2px solid var(--line); border-radius: 50%;
    animation: wait-spin .8s linear infinite, wait-mark-on .2s var(--at) forwards, wait-mark-done .2s var(--until) forwards;
}
.wait-mark::after {
    content: ""; position: absolute; left: 5.5px; top: 2.5px; width: 5px; height: 9px; box-sizing: border-box;
    border: solid var(--on-good); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
    animation: wait-check .4s var(--until) cubic-bezier(.3, 1.7, .5, 1) forwards;
}
@keyframes wait-step-on { to { color: var(--text); } }
@keyframes wait-mark-on { to { border-top-color: var(--text); } }
@keyframes wait-mark-done { to { border-color: var(--good-fill); background-color: var(--good-fill); } }
@keyframes wait-check { to { transform: rotate(45deg) scale(1); } }

/* A line along the lower edge of the box: quick at first, then ever slower, so it never arrives before the result. */
.wait-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); overflow: hidden; }
.wait-bar::after {
    content: ""; position: absolute; inset: 0; background: var(--text); transform-origin: left center;
    animation: wait-bar 30s ease-out both;
}
@keyframes wait-bar {
    from { transform: scaleX(0); }
    7% { transform: scaleX(.42); }
    17% { transform: scaleX(.66); }
    35% { transform: scaleX(.82); }
    to { transform: scaleX(.96); }
}

/* Text search: the box where the interpretation will stand. The words of the query light up one after another. */
.ai-wait { position: relative; overflow: hidden; padding-bottom: 16px; animation: wait-fade var(--dur-2) both; }
.ai-wait .interpretation-head { display: flex; align-items: center; gap: 8px; }
.ai-wait-words { margin-bottom: 12px; }
.ai-wait-words .chip {
    animation: wait-fade var(--dur-2) calc(var(--i) * 40ms) both, ai-word 2.6s calc(var(--i) * 130ms + .4s) ease-in-out infinite;
}
@keyframes ai-word {
    0%, 24%, 100% { border-color: var(--line); background-color: var(--surface); }
    10% { border-color: var(--text); background-color: var(--soft); }
}

/* The AI is at work on something the page already shows (AiWait.razor: the similar articles are being checked,
   the picture of an article is looked at for its outfit): a small box with what it is doing, its steps and the
   growing line, in the place where its answer will stand. */
.ai-note {
    position: relative; overflow: hidden; display: grid; gap: 10px; padding: 12px 16px 17px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 0.95rem;
    animation: wait-fade var(--dur-2) both;
}
.ai-note-head { display: flex; align-items: center; gap: 8px; }
.ai-note .wait-steps { font-size: 0.85rem; }
.similar-wait { margin: 0 0 10px; }
.outfit-wait { margin: 0 0 22px; }
/* Beside the list the box is narrow: one step per line. Above the list (phones) they stand side by side. */
@media (min-width: 761px) { .similar-wait .wait-steps { flex-direction: column; gap: 6px; } }

/* Grey shapes where filters and articles will stand. A band of light runs over each of them, a little later
   from article to article, so it looks like one wave across the page. */
.skeleton {
    display: block; height: 0.8rem; border-radius: var(--radius);
    position: relative; overflow: hidden; background: var(--skeleton);
}
/* The band is a layer of its own that is only pushed along (transform), so nothing is painted anew while it runs.
   It is twice as wide as the shape: from all the way out on the left to all the way out on the right. */
.skeleton::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 200%;
    background: linear-gradient(100deg, transparent 30%, var(--skeleton-shine) 50%, transparent 70%);
    transform: translateX(-100%); animation: skeleton-sweep 1.5s calc(var(--i, 0) * 90ms) linear infinite backwards;
}
@keyframes skeleton-sweep { from { transform: translateX(-100%); } to { transform: translateX(50%); } }
.skeleton.is-title { width: 45%; height: 0.7rem; margin-bottom: 12px; }
.skeleton.is-pill { height: 28px; border-radius: var(--radius); }
.skeleton.is-image { height: auto; aspect-ratio: 4 / 5; border-radius: 0; }
.skeleton-filters { animation: wait-fade var(--dur-3) both; }
.skeleton-card { animation: wait-rise var(--dur-3) calc(var(--i) * 60ms) both; }
.skeleton-card:hover { border-color: var(--line); }
.skeleton-card .product-card-body { display: grid; gap: 11px; padding-bottom: 18px; }
@media (max-width: 760px) {
    /* The filters are folded away behind a button here. */
    .skeleton-filters .filter-group:not(:first-child), .skeleton-filters .chips { display: none; }
    .skeleton-filters .filter-group { margin: 0; padding: 0; }
    .skeleton-filters .skeleton.is-title { width: 30%; height: 1rem; margin: 11px auto; }
}

/* The result after the wait comes in piece by piece instead of jumping onto the screen. Only the first
   articles: the ones loaded while scrolling are simply there. */
.interpretation.is-fresh { animation: wait-rise var(--dur-3) both; }
.interpretation.is-fresh .chip { animation: wait-fade var(--dur-2) calc(var(--n, 0) * 40ms + .1s) ease-out both; }
.search-layout.is-fresh .filters, .search-layout.is-fresh .results-bar { animation: wait-fade var(--dur-3) both; }
.search-layout.is-fresh .product-card:nth-child(-n+12) { animation: wait-rise var(--dur-3) calc(var(--n, 0) * 45ms) both; }
/* The next batch of a list ("Mehr anzeigen", or loaded while scrolling; autoload.js marks its cards): all of them
   fade in together, without moving, so nothing shifts under the scrolling. */
.product-card[data-appended] { animation: wait-fade var(--dur-2) both; }
@media (prefers-reduced-motion: reduce) { .product-card[data-appended] { animation: none; } }
.image-search-photo { animation: wait-fade var(--dur-3) both; }
.image-search-layout .piece { animation: wait-rise var(--dur-3) calc(var(--n, 0) * 110ms) both; }

/* Photo search: the photo itself, over the whole page, with a beam of light running up and down on it.
   upload.js sets --upload-preview and --upload-ratio the moment a photo is chosen. */
.scan-overlay {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; cursor: progress;
    background: var(--veil); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: wait-fade var(--dur-2) both;
}
.scan-card {
    position: relative; overflow: hidden; display: grid; justify-items: center; gap: 14px; width: min(340px, 100%);
    padding: 20px 20px 26px; text-align: left; font-size: 1rem; font-weight: 400; color: var(--text);
    background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgb(0 0 0 / calc(.16 * var(--shadow-k)));
    animation: scan-card-in var(--dur-3) cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes scan-card-in { from { opacity: 0; transform: translateY(14px) scale(.95); } }
.scan-card strong { font-size: 1.05rem; }
.scan-card .wait-steps { flex-direction: column; gap: 8px; justify-self: stretch; padding: 0 6px; }
.scan-photo {
    position: relative; overflow: hidden; height: min(40vh, 300px); max-width: 100%; aspect-ratio: var(--upload-ratio, 4 / 5);
    border-radius: var(--radius); background: var(--upload-preview, url("favicon.svg") center / 40px no-repeat) var(--picture);
}
/* Slightly darkened, so the beam shows on a white product picture too. */
.scan-photo::before { content: ""; position: absolute; inset: 0; background: rgba(17, 17, 17, .3); }
.scan-beam {
    position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: #fff;
    box-shadow: 0 0 6px 1px #fff, 0 0 26px 10px rgba(255, 255, 255, .55);
    animation: scan-beam 2.2s var(--ease-in-out) infinite alternate;
}
@keyframes scan-beam { to { top: 100%; } }
/* Four corners, like the frame of a viewfinder */
.scan-frame {
    --corner: linear-gradient(#fff 0 0);
    position: absolute; inset: 10px; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .45));
    background:
        var(--corner) top left / 18px 2px, var(--corner) top left / 2px 18px,
        var(--corner) top right / 18px 2px, var(--corner) top right / 2px 18px,
        var(--corner) bottom left / 18px 2px, var(--corner) bottom left / 2px 18px,
        var(--corner) bottom right / 18px 2px, var(--corner) bottom right / 2px 18px;
    background-repeat: no-repeat; animation: scan-frame 1.6s ease-in-out infinite;
}
@keyframes scan-frame { 50% { transform: scale(.955); opacity: .65; } }

/* Without movement the steps still tick off and the line still grows: they say how far the search is. */
@media (prefers-reduced-motion: reduce) {
    .wait-mark i { animation: wait-mark-on .2s var(--at) forwards, wait-mark-done .2s var(--until) forwards; }
    .wait-mark::after { animation-timing-function: linear; }
    .ai-note, .piece-results.is-busy::before,
    .ai-wait-words .chip, .skeleton::after, .skeleton-card, .scan-card, .scan-frame,
    .interpretation.is-fresh, .interpretation.is-fresh .chip, .search-layout.is-fresh .product-card:nth-child(-n+12),
    .image-search-layout .piece { animation: none; }
    .scan-beam { display: none; }
}

/* ---- "Ähnliche Artikel" of an article (Pages/SimilarPage) ---- */
/* The article stays in view next to the list, so every candidate can be compared with it. */
@media (min-width: 761px) { .similar-source { position: sticky; top: var(--sticky-top); max-height: calc(100vh - var(--sticky-top) - 16px); max-height: calc(100dvh - var(--sticky-top) - 16px); overflow-y: auto; scrollbar-width: thin; } }
.similar-source-text { margin: 10px 0 8px; display: grid; gap: 2px; }
.similar-source-text .brand { font-size: 0.85rem; } /* larger than on a card, beside a larger name */
.similar-source-price { font-weight: 700; }
.similar-source .chips { margin: 8px 0 12px; }
.similar-ai { margin: 0 0 8px; color: var(--text); }
.similar-controls { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px; }
.similar-controls .chip { font: inherit; font-size: 0.9rem; cursor: pointer; }
.similar-same { margin-bottom: 18px; }
.similar-same h2 { font-size: 1rem; margin: 0 0 8px; }
.similar-card { position: relative; display: grid; }
.similar-card .product-card { height: 100%; }
/* How alike, on the picture: top left, beside the favourite button in the other corner. On the narrowest cards
   (a folded phone, 280px) the words end with "…" before that button instead of running under it. */
.similar-score {
    position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: var(--radius); pointer-events: none;
    box-sizing: border-box; max-width: calc(100% - 44px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.75rem; font-weight: 700; color: var(--text); background: var(--glass); border: 1px solid var(--line);
}
@media (max-width: 310px) { .similar-score { max-width: calc(100% - 56px); } }
.similar-score.is-high { color: var(--inverse); background: var(--text); border-color: var(--text); }
.similar-why { margin-top: 6px; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.similar-more { margin: 24px 0 0; text-align: center; }
/* Opening the page plays once, in the order of what happens: a beam of light runs down the picture of the article,
   what was read off it pops in below, and the articles found rise in as one wave, each with its likeness last. */
.similar-source > a:first-child { position: relative; display: block; overflow: hidden; border-radius: var(--radius); }
.similar-beam {
    position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none;
    /* A light trail with a dark edge in front: it shows on a white product picture and on a dark one. */
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .6));
    border-bottom: 2px solid rgba(17, 17, 17, .7); box-shadow: 0 2px 10px 1px rgba(255, 255, 255, .9);
    transform: translateY(-105%); animation: similar-beam .95s .15s var(--ease-in-out) both;
}
@keyframes similar-beam {
    80% { opacity: 1; }
    to { transform: translateY(255%); opacity: 0; }
}
.similar-source .chip { animation: wait-fade var(--dur-2) calc(var(--n, 0) * 40ms + .3s) ease-out both; }
.similar-source .chip.is-soft { animation: wait-fade var(--dur-2) ease-out both; }
.similar-controls, .similar-layout .results-bar { animation: wait-fade var(--dur-3) both; }
.similar-grid .similar-card { animation: wait-rise var(--dur-3) calc(min(var(--n, 0), 11) * 45ms + .1s) var(--ease-out) both; }
.similar-grid .similar-score { animation: wait-fade var(--dur-2) calc(min(var(--n, 0), 11) * 40ms + .3s) ease-out both; }

/* The button that leads here (article page): the sparkles twinkle under the pointer, and it gives way when pressed. */
.similar-search { transition: transform var(--dur-1) ease, background-color var(--dur-2) ease, color var(--dur-2) ease; }
.similar-search:hover { background: var(--text); color: var(--inverse); }
.similar-search:active { transform: scale(.96); }

@media (prefers-reduced-motion: reduce) {
    .similar-beam { display: none; }
    .similar-source .chip, .similar-source .chip.is-soft, .similar-controls, .similar-layout .results-bar, .similar-grid .similar-card, .similar-grid .similar-score,
    .similar-search:hover .icon { animation: none; }
    .similar-search { transition: none; }
}
@media (max-width: 760px) {
    /* The article itself as a narrow strip above the list, not a full-width picture. */
    .similar-source { display: grid; grid-template-columns: 64px 1fr; gap: 0 12px; align-items: start; }
    /* What it is compared by, and what "similar" should mean: one row each that is pushed sideways, instead of three
       and four rows of chips that kept the first article off the first screen. The chip cut off at the edge says
       there is more. 3px of room around the rows, so the outline of a chip with the focus is not cut. */
    .similar-source .chips, .similar-controls {
        flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
        margin-inline: -3px; padding: 3px 32px 3px 3px;
        /* The row fades out at its right end, also where a chip happens to end right at the edge. */
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    }
    .similar-source .chips::-webkit-scrollbar, .similar-controls::-webkit-scrollbar { display: none; }
    .similar-source .chips > *, .similar-controls .chip { flex: none; white-space: nowrap; }
    .similar-controls .chips { flex-wrap: nowrap; flex: none; }
    .similar-layout .results-bar { margin-top: 0; }
    .similar-source > a:first-child { grid-row: span 2; }
    .similar-source > p, .similar-source > .chips { grid-column: 1 / -1; }
    .similar-source-text { margin-top: 0; }
    .similar-controls { gap: 8px; }
    /* On a phone the list should start on the first screen: no explanation, and the breadcrumb leads back. */
    .similar-source > p:not(.similar-ai) { display: none; }
    .similar-ai { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .similar-source .chips { margin-bottom: 8px; }
}

/* ---------- "Für dich" (ForYouPage.razor) ---------- */

.foryou-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
/* A card with the button that takes it off the list ("nicht mein Stil") on its picture. */
.foryou-card { position: relative; display: flex; min-width: 0; }
.foryou-card > .product-card { flex: 1; min-width: 0; }
/* Why the article is suggested; something new to discover stands out. */
.why { margin-top: 6px; font-size: 0.8rem; line-height: 1.3; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.why.is-new { color: var(--accent); font-weight: 600; }
.foryou-hide {
    position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border-radius: var(--radius); border-color: var(--line); background: var(--glass); color: var(--muted); opacity: 0; transition: opacity var(--dur-1);
}
.foryou-card:hover .foryou-hide, .foryou-hide:focus-visible { opacity: 1; }
.foryou-hide:hover { color: var(--text); border-color: var(--text); }
/* No mouse, no hover: the button is always there. */
@media (hover: none) { .foryou-hide { opacity: 1; } }
/* "Nicht mein Stil" was pressed: the card fades and shrinks a little before it is taken out and the others move up
   (ForYouPage waits as long, LeaveMilliseconds), so it is seen to leave. Nothing on it can be pressed meanwhile. */
.foryou-card.is-leaving { opacity: 0; transform: scale(.96); transition: opacity .16s ease-in, transform .16s ease-in; pointer-events: none; }
/* What that did, with the way back, in the list: the note of the feed (.feed-toast), at the bottom edge of the
   window, in the middle, where the visitor is in the list and where the notes of the connection stand too. In the
   colours of those notes, which read on the page in both looks (the feed's own lies on a picture). It arrives from
   below, and stays while the pointer or the keyboard is on it. */
.feed-toast.is-page {
    position: fixed; top: auto; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; translate: -50% 0;
    box-sizing: border-box; width: max-content; max-width: min(520px, 100vw - 24px);
    background: var(--text); color: var(--inverse); animation-name: page-toast;
}
.feed-toast.is-page .button-small { background: var(--inverse); color: var(--text); border-color: var(--inverse); }
/* Held, it is always the note in full: it appears under a pointer that rests there, and would be stopped at its
   first, invisible moment. (Once gone it is hidden, cannot be pointed at any more and so does not come back.) */
.feed-toast.is-page:hover, .feed-toast.is-page:focus-within {
    animation-play-state: paused; opacity: 1 !important; visibility: visible !important; transform: none !important;
}
@keyframes page-toast {
    0% { opacity: 0; transform: translateY(6px); }
    4%, 90% { opacity: 1; visibility: visible; transform: none; }
    100% { opacity: 0; visibility: hidden; transform: none; }
}
/* The list "Neue Vorschläge" brought comes in as one wave, like a new list of the search: the press did something. */
.product-grid.is-fresh > .foryou-card:nth-child(-n+12) { animation: wait-rise var(--dur-3) calc(var(--n, 0) * 35ms) both; }
@media (prefers-reduced-motion: reduce) {
    .foryou-card.is-leaving { transform: none; transition: opacity .16s; }
    .product-grid.is-fresh > .foryou-card:nth-child(-n+12) { animation: wait-fade var(--dur-2) both; }
    @keyframes page-toast { 0% { opacity: 0; } 4%, 90% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
}
/* The same line on an article of the feed, on its picture. */
.feed-why {
    position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 76px); padding: 4px 10px; border-radius: var(--radius);
    background: var(--glass); color: var(--muted); font-size: 0.8rem; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-why.is-new { color: var(--accent); font-weight: 600; }
/* Above the dots of the pictures, where an article has several. */
.feed-media:has(.feed-dots) .feed-why { bottom: 26px; }
/* On the article the feed opens with, the note on how it is used comes first; the line follows when that is gone
   (at once where the note is not shown again, see .feed-hint). */
.feed-hint ~ .feed-why { animation: wait-fade var(--dur-3) 4.7s both; }
html[data-feed-hinted] .feed-hint ~ .feed-why { animation: none; }

/* ---------- "Outfit vervollständigen" (OutfitPage.razor) ---------- */

/* The button under a bought article that leads here: the first of the two, so it is the filled one. */
.outfit-link { display: block; width: 100%; padding: 6px 10px; font-size: 0.85rem; text-align: center; }

.outfit-intro { max-width: 46rem; margin: -6px 0 18px; }
.outfit-for { margin: 0 0 18px; }
/* The outfit on the left, the rows of what goes with it on the right. */
.outfit-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 28px 36px; align-items: start; }
.outfit-layout > * { min-width: 0; } /* lets the rows shrink and scroll instead of widening the page */

/* "Dein Outfit": the pieces from head to toe. It stays in view while the rows are scrolled through. */
.outfit-look { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.outfit-look h2 { font-size: 1.05rem; margin: 0 0 12px; }
/* The list scrolls where its pieces do not fit (down beside the rows, sideways on a phone). It keeps room around
   them for what is drawn around a picture, which a scrolling list would cut off otherwise: the ring of the one that
   has the keyboard and, on a phone, the frame of the own article. */
.outfit-parts { list-style: none; margin: -4px; padding: 4px; display: grid; gap: 10px; }
.outfit-part { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: center; animation: wait-rise var(--dur-3) var(--ease-out) both; }
/* Beside the rows it is never taller than the window. Of an outfit with more pieces than fit, only the pieces scroll:
   the sum and the button under them stay in view. The pieces fade in without rising there: one that rises reaches
   past the end of the list, which would show a scrollbar for that moment. These rules stand after those they change. */
@media (min-width: 761px) {
    .outfit-look { position: sticky; top: var(--sticky-top); max-height: calc(100vh - var(--sticky-top) - 16px); max-height: calc(100dvh - var(--sticky-top) - 16px); display: flex; flex-direction: column; overflow: hidden; }
    .outfit-parts { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .outfit-part { animation-name: wait-fade; }
}
/* Beside the rows on a tablet or an unfolded phone the outfit is a narrow column, so three pieces of a row are in
   sight, not two and a bit. */
@media (min-width: 761px) and (max-width: 1023px) {
    .outfit-layout { grid-template-columns: 240px 1fr; gap: 28px 20px; }
}
/* In a low window (a phone on its side) an outfit that stays in view had room for less than one piece between
   its heading and its button: there it is as long as its pieces and moves with the page. */
@media (min-width: 761px) and (max-height: 520px) {
    .outfit-look { position: static; max-height: none; overflow: visible; }
    .outfit-parts { overflow-y: visible; }
}
/* The picture of a piece on the light ground every product picture has, in both looks. */
.outfit-part-picture { display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--picture-behind); overflow: hidden; }
.outfit-part-picture img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: var(--picture-blend); filter: var(--picture-filter); }
.outfit-part-text { display: grid; gap: 1px; min-width: 0; font-size: 0.9rem; line-height: 1.3; }
.outfit-part-text strong { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.outfit-part-kind { color: var(--muted); font-size: 0.8rem; }
.outfit-part-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.outfit-part-text .text-button { justify-self: start; padding: 4px 0; font-size: 0.8rem; }
/* The article everything is built around. */
.outfit-badge { justify-self: start; margin-bottom: 3px; padding: 1px 8px; border-radius: var(--radius); background: var(--text); color: var(--inverse); font-size: 0.72rem; font-weight: 600; }
/* A row nothing is picked from yet: the place of its piece, as a way to the row. */
.outfit-gap { display: grid; place-items: center; background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); text-decoration: none; font-size: 1.1rem; }
.outfit-gap:hover { border-color: var(--text); color: var(--text); }
.outfit-part.is-empty .outfit-part-kind { font-size: 0.9rem; }

.outfit-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.outfit-total strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.outfit-total-note { margin: 2px 0 0; font-size: 0.8rem; }
.outfit-keep { width: 100%; margin-top: 12px; }
.outfit-keep:disabled { opacity: .45; cursor: default; }
.outfit-kept { margin: 10px 0 0; padding: 8px 12px; font-size: 0.85rem; }

/* What the AI says about wearing the article, and the note that it has something new. */
.outfit-tip { margin: 0 0 22px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.95rem; }
.outfit-arrived { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 22px; background: var(--soft); border: 1px solid var(--line); }

.outfit-row { margin-bottom: 30px; scroll-margin-top: 10px; } /* beyond the scroll-padding of the page */
.outfit-row .piece-head h2 { margin-bottom: 10px; }
.outfit-row .piece-head .text-button { font-size: 0.85rem; }
.outfit-row .empty { padding: 6px 0 0; }
/* Room around the cards for the frame of the picked one, which the scrolling row would cut off otherwise. */
.outfit-cards { grid-auto-columns: minmax(150px, 176px); padding: 6px 6px 12px; margin: 0 -6px; }
.outfit-card { position: relative; display: grid; min-width: 0; animation: wait-rise var(--dur-3) calc(min(var(--n, 0), 11) * 35ms) var(--ease-out) both; }
.outfit-card .product-card { height: 100%; display: flex; flex-direction: column; }
.outfit-card .product-card-link { flex: 1; }
.outfit-card .product-card-actions > * { margin-bottom: 0; }
/* The reason may name the colours and the piece it also goes with: three lines instead of the two of other lists. */
.outfit-card .why { -webkit-line-clamp: 3; line-clamp: 3; }
/* The piece of a row that is in the outfit: a frame around its picture and a word on it. */
.outfit-card.is-picked .product-card-link::before { outline: 2px solid var(--text); outline-offset: 2px; }
.outfit-in { position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: var(--radius); background: #111111; color: #fff; font-size: 0.72rem; font-weight: 600; pointer-events: none; }
.outfit-pick { width: 100%; }
/* The button of the picked piece is filled. Its size stays that of the others (.button-small, larger for fingers). */
.outfit-pick.is-active { background: var(--text); color: var(--inverse); border-color: var(--text); }

.outfit-more { margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--line); }
.outfit-more h2 { font-size: 1.05rem; margin: 0 0 10px; }
.outfit-more .chip { cursor: pointer; }

/* On a phone the outfit lies over the rows as a strip of small pictures, so it is seen growing while a row is
   swiped through: pictures only, the sum, the button that keeps the pieces and its answer. */
@media (max-width: 760px) {
    .outfit-layout { grid-template-columns: 1fr; gap: 18px; }
    .outfit-look {
        position: sticky; top: var(--header-h); z-index: 5; margin: 0 calc(-1 * var(--gutter, 16px)); padding: 8px var(--gutter, 16px);
        border-width: 0 0 1px; border-radius: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px;
    }
    .outfit-look h2, .outfit-part-text, .outfit-total-note { display: none; }
    /* The answer to "Gewählte Teile merken" under the button, with the way to the favourites; gone with the next pick. */
    .outfit-kept { grid-column: 1 / -1; margin: 0; padding: 4px 10px; font-size: 0.8rem; }
    .outfit-parts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
    .outfit-part { display: block; flex: none; width: 40px; }
    /* Around the picture, not inside it: in the dark look the picture (its own layer, --picture-filter) is painted over a frame inside it. */
    .outfit-part.is-anchor .outfit-part-picture { outline: 2px solid var(--text); outline-offset: 2px; }
    .outfit-total { margin: 0; padding: 0; border: 0; display: grid; justify-items: end; gap: 0; font-size: 0.8rem; white-space: nowrap; }
    .outfit-total strong { font-size: 0.9rem; }
    .outfit-keep { grid-column: 1 / -1; margin: 0; padding: 6px 10px; font-size: 0.85rem; }
    .outfit-cards { grid-auto-columns: minmax(138px, 44vw); }
    /* A row the "+" of the strip leads to stops under the strip, not behind it. The strip is about 109px tall, and
       up to 164px while the answer to "Gewählte Teile merken" (one line or two) stands under the button. */
    html:has(.outfit-look) { scroll-padding-top: calc(var(--header-h) + 124px); }
    html:has(.outfit-kept) { scroll-padding-top: calc(var(--header-h) + 180px); }
    .outfit-row { scroll-margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .outfit-part, .outfit-card { animation: none; }
}

/* ---------- Screen sizes and kinds of devices ---------- */

/* What the rules above leave open between the smallest phone and the largest monitor, from narrow to wide, then
   what depends on the kind of device instead of its width (touch, a low window, the browser). The phone layout
   itself (up to 760px: the search field at the bottom edge, what is left out there) stands above and stays. */

/* --- Every screen: the parts of it that the device covers --- */

/* The page reaches under a notch, round corners and the home bar (viewport-fit=cover): what sits at an edge keeps
   out of them. All of these are 0 on a screen without such parts. */
.site-header { padding-top: env(safe-area-inset-top); }
.site-footer { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.feed-controls { right: max(12px, env(safe-area-inset-right)); }
html[data-feed-full] .feed-controls { top: max(12px, env(safe-area-inset-top)); }
.sortout { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }

/* The list under a search field never reaches past what is left of the screen: search.js keeps --visible-height at
   the height that an on-screen keyboard leaves free. */
.suggestions { max-height: min(70vh, 460px, var(--visible-height, 100vh) - 84px); }

/* --- The smallest phones and the outer screen of a folding phone (up to 350px) --- */

@media (max-width: 350px) {
    .site-nav-row { gap: 6px; }
    .results-bar { gap: 8px; }
}
/* Narrow phones (up to 379px): less room between the count, the views and the sorting, and the two views 40px wide
   instead of 44, so "Beste Treffer" is not cut beside a count of three digits. */
@media (max-width: 379px) {
    .results-bar { gap: 8px; }
    .results-bar .view-track-item { width: 40px; }
}

/* --- Phones (up to 760px) --- */

@media (max-width: 760px) {
    /* The search field at the bottom edge: clear of round corners, and on a wide screen no wider than a field
       needs to be, in the middle. */
    .header-search {
        left: max(12px, env(safe-area-inset-left), 50% - 290px); right: max(12px, env(safe-area-inset-right), 50% - 290px);
    }
    /* Its suggestions open upwards: with the keyboard out, only as far as the screen goes. */
    .header-search .suggestions { max-height: min(60vh, 460px, var(--visible-height, 100vh) - 84px); }
}

/* --- Large phones, unfolded folding phones, small tablets (520 to 760px) ---
   The phone layout with more room: three articles in a row instead of two that fill the screen. */
@media (min-width: 520px) and (max-width: 760px) {
    .product-grid { gap: 22px 12px; }


}
/* From 600px the article page has room for the picture and what it costs side by side: the price is on the
   first screen instead of under a picture that fills it. */
@media (min-width: 600px) and (max-width: 760px) {
    .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
    .detail-image { aspect-ratio: 4 / 5; height: auto; }
    .detail-summary h1 { font-size: 1.4rem; }
}

/* --- Tablets and small windows (761 to 1023px) --- */

/* Everything of the header on one row: the links as symbols and a slightly smaller logo leave the room to the search. */
@media (min-width: 761px) and (max-width: 960px) {
    .header-row { gap: 14px; }
    .logo img { height: 24px; }
}

/* --- Up to 960px: the links of the header are symbols without their words --- */

@media (max-width: 960px) {
    .site-header { --header-icon: 24px; }
    .header-label, .header-login-label { display: none; } /* each link says what it is in its aria-label */
    /* The number of favourites sits on the corner of the heart instead of beside it, so the row is as wide with
       99 favourites as with none (beside it, the first favourite pushed the links onto a second row on phones).
       Its middle is at the corner: a longer number grows to both sides and stays clear of the next symbol. */
    .header-favorites { position: relative; }
    .header-favorites .badge {
        position: absolute; left: calc(50% + 10px); top: calc(50% - 18px); transform: translateX(-50%);
        min-width: 16px; height: 16px; margin: 0; padding: 0 4px; font-size: 11px; font-weight: 700; line-height: 16px;
        box-shadow: 0 0 0 2px var(--surface); pointer-events: none;
    }
}
/* The pages with a column beside the list (the filters of the search, the article of "Ähnliche Artikel", the photo
   that was searched): a narrower column and smaller cards give three or four articles in a row instead of one or two. */
@media (min-width: 761px) and (max-width: 1023px) {
    .search-layout { grid-template-columns: 212px 1fr; gap: 20px; }
    .image-search-layout { grid-template-columns: 220px 1fr; gap: 20px; }
    .search-layout .product-grid, .image-search-layout .product-grid { gap: 24px 12px; }
    .search-layout .product-card-body, .image-search-layout .product-card-body { padding: 10px 2px 4px; }
    /* Beside the filters the row above the list is short: without the word "Sortieren" (still read out, as on a
       phone) the count, the views and the sorting stay on one row. */
    .search-layout .results-sort span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* --- From tablets up: the picture of an article fits the window --- */

/* On a low screen (a laptop) a picture as wide as its column would be taller than the window: it stops where the
   window does, so the picture, its thumbnails and the price are seen together. */
/* The column of the picture is made as narrow as that height asks for (a 4:5 frame: width = height x 0.8), not the
   picture cut or shown small in a frame that stays wide: the frame keeps the shape of the photo, the thumbnails
   stand under its edge, and the text beside it gets the room. On a tall screen the column is as wide as before
   (1.1 parts of 2.1). */
@media (min-width: 761px) {
    .detail {
        --hero-h: max(420px, calc(100vh - var(--sticky-top) - 120px));
        grid-template-columns: minmax(0, min(calc((100% - 32px) * .524), calc(var(--hero-h) * .8))) minmax(0, 1fr);
    }
}
/* A low window (a phone on its side): the header does not stay in view there, so the picture may take nearly the
   whole height, and never more. Also where the two columns start (600px). */
@media (min-width: 600px) and (max-height: 520px) {
    .detail {
        --hero-h: max(220px, calc(100vh - 110px));
        grid-template-columns: minmax(0, min(50%, calc(var(--hero-h) * .8))) minmax(0, 1fr);
    }
}

/* --- Large monitors: the page uses more of the screen, the lists get more columns --- */

@media (min-width: 1500px) {
    :root { --page: 1400px; }
    /* The picture of an article is as tall as the window allows; a column wider than that would stand half empty.
       0.9 parts of 1.9 at most, and never taller than the window (--hero-h, as from tablets up: this rule stands
       after that one and has to carry the limit itself). */
    .detail { grid-template-columns: minmax(0, min(calc((100% - 48px) * .474), calc(var(--hero-h) * .8))) minmax(0, 1fr); gap: 48px; }
}
@media (min-width: 1800px) { :root { --page: 1600px; } }

/* --- A low window: a phone turned sideways --- */

@media (max-height: 520px) {
    /* The header goes away with the page instead of staying at the top: its two rows took a third of such a
       window. nav.js then gives --header-h as 0, so what stays in view under the header (the filters, the tabs of
       the settings, the headings of the start page) stops at the top edge. */
    .site-header { position: relative; } /* not static: it stays the layer its menu and the suggestions open in */
    /* The menu of the categories is as long as its entries and the page scrolls to its end, now that it can. */
    .site-nav-menu { max-height: none; overflow-y: visible; }
    /* The feed inside the page gets the room of the navigation row; the header's first row stays above it. */
    html:not([data-feed-full]):has(.feed:not(.is-closing)) .site-nav { display: none; }
    .scan-photo { height: min(34vh, 300px); }
    /* The start page: the question as large as on a phone held upright and with less room above it and above the
       first section, so the field is whole on the first screen and the articles begin right under it. */
    .hero.is-home { padding-top: 20px; }
    .hero.is-home h1 { font-size: 2rem; }
    .home-section { margin-top: 36px; }
    /* The settings: the bar with "Speichern" stays (it also says what is not saved yet), with less room around it. */
    .settings-save { margin-top: 12px; padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
}
/* A window a little taller than that (a small laptop, a small phone held upright: 521 to 640px): the header stays,
   so a second bar under it and a third at the bottom edge left too little of the page (40% and more of a 600px
   window were bars). In the settings the row of sections goes with the page there; "Speichern" stays in view. On
   a small phone the strip of the chosen parts of an outfit goes with the page as well: a row of articles is taller
   than what the header and the strip left of the screen. */
@media (min-height: 521px) and (max-height: 640px) {
    .settings-tabs { position: static; }
}
@media (max-width: 760px) and (min-height: 521px) and (max-height: 600px) {
    .outfit-look { position: static; }
}
/* The feed when it is low itself: a picture that fills its height is narrow, so the text stands beside the picture
   instead of under it (it was squeezed into a column of single letters there). Only where the feed is wide enough
   for the two side by side, a phone on its side: a small phone held upright is low as well (320x568 leaves the feed
   390px), and there the text beside the picture ran out of the screen. It keeps the picture above the text. */
@container (max-height: 460px) and (min-width: 560px) {
    .feed-item { flex-direction: row; width: min(100%, 80cqh + 340px); }
    .feed-media { flex: 0 0 auto; width: min(80cqh, 58%); }
    .feed-info {
        flex: 1 1 0; min-width: 0; flex-direction: column; align-items: stretch; justify-content: center; gap: 14px;
        padding: 16px 16px max(16px, env(safe-area-inset-bottom)); border-top: 0; border-left: 1px solid var(--line);
    }
    .feed-text { flex: none; }
    .feed-colours { flex-basis: auto; } /* in the column, 100 % would be of its height */
    .feed-text .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }
    .feed-toast { left: 12px; }
    .feed-hint { bottom: 22px; }
}
/* A low feed has no room for the whole note on its picture: the way to the next article is said, the rest is left out. */
@container (max-height: 460px) {
    .feed-hint > :not(.feed-hint-next) { display: none; }
}
/* A narrow feed (a small phone, the outer screen of a folding phone): the article is as wide as the screen whatever
   its height, and name and price have a row of their own above the buttons. Beside them the price ran under the heart. */
@container (max-width: 559px) {
    .feed-item { width: 100%; }
}
/* Measured in the size of the writing (22em are 374px at the usual size): with a larger writing the text needs
   the row to itself on a wider phone as well, where it stood in a column of single letters beside the buttons. */
@container (max-width: 22em) {
    .feed-info { gap: 8px 12px; padding-top: 10px; }
    .feed-text { flex: 1 1 100%; }
    .feed-actions { flex: 1 1 auto; }
    .feed-actions .button { flex: 1 1 auto; text-align: center; }
}
/* Only with a much larger writing (14em are 238px at the usual size): the note on the picture says its first line
   alone, as in a low feed; all of it lay over the buttons above it. */
@container (max-width: 14em) {
    .feed-hint > :not(.feed-hint-next) { display: none; }
}

/* --- Touch screens --- */

@media (pointer: coarse) {
    /* iOS zooms into a field whose writing is smaller than 16px when it is tapped, and stays zoomed in. */
    select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { font-size: max(1em, 16px); }
    /* What is pressed with a finger on a picture or right under it is as large as a fingertip (44px), without
       looking any larger: the heart of a card, the buttons of the feed and of the note over it, and "nicht mein
       Stil" on a card. The dots of the colours stay small; what can be tapped around them reaches into the room
       above and below, and a little further sideways where the screen has the room. */
    .product-card-favorite .favorite-button { padding: 11px; }
    .feed-control { width: 46px; height: 46px; }
    .feed-controls .view-track-item { width: 44px; height: 38px; }
    .feed-hide { width: 44px; height: 44px; }
    .feed-toast .button-small { min-height: 44px; }
    .foryou-hide::after { content: ""; position: absolute; inset: -6px; }
    .colour-swatch { height: 36px; margin: -6px 0; }
    .colour-more { line-height: 36px; margin: -6px 0; }
    /* Links and buttons that are a line of text or a small sign take a tap around them as well, as far as the room
       between them and their neighbours goes: the link beside a heading ("Alle Neuheiten"), the arrow in the
       search field of the start page, a brand in the list from A to Z (a row of it is 38px), a shop on the start
       page (whose rows stand further apart for it). */
    .piece-head > a, .hero-search .search-expand, .brand-group a, .shop-strip a { position: relative; }
    .piece-head > a::after, .hero-search .search-expand::after, .brand-group a::after, .shop-strip a::after { content: ""; position: absolute; }
    .piece-head > a::after { inset: -11px -6px; }
    .hero-search .search-expand::after { inset: -4px; }
    .brand-group a::after { inset: -8px -4px; }
    .shop-strip ul { row-gap: 0; }
    .shop-strip li { padding: 10px 0; }
    .shop-strip a::after { inset: -11px -6px; }
    /* The visitor's own lists: the buttons above a list and under a card ("Aussortieren", "Gekauft?", "Wieder
       merken"), the two at the top of sorting out and its link to the article are as tall as a fingertip. In the
       list of brands "mag ich" and "nicht für mich" mean opposite things side by side: each is 44px, with a gap. */
    .favorites-bar > .button-small, .favorites-group > .button-small, .sortout-bar .button-small,
    .product-card-actions .button-small, .bought-button, .bought-done, .confirm-inline > button { min-height: 44px; }
    .sortout-side a { position: relative; }
    .sortout-side a::after { content: ""; position: absolute; inset: -12px -10px; }
    .brand-picker .brand-pick button { width: 44px; height: 44px; }
    .brand-pick { gap: 4px; }
    /* What was still smaller than a fingertip after all of the above, found by measuring every page on a touch
       screen. Lines of text and small signs take the tap in the room around them and look as before: the logo,
       the links of the path above an article and "Zurück" above a list, the brand over the name of an article,
       "Passwort vergessen?", the offer in another colour under a card, the brands of "Neu von deinen Marken", the
       text buttons beside a heading and in a line, the two views in their track, "nur für mich" above a list. */
    .logo, .breadcrumb a, .back-link a, .detail-summary > a.brand, .label-row > a, .colour-deal, .new-brands .chip,
    .piece-head > .text-button, .foryou-bar > .text-button, .size-missing .text-button, .view-track-item, .personal-note { position: relative; }
    .logo::after, .breadcrumb a::after, .back-link a::after, .detail-summary > a.brand::after, .label-row > a::after,
    .colour-deal::after, .new-brands .chip::after, .piece-head > .text-button::after, .foryou-bar > .text-button::after,
    .size-missing .text-button::after, .view-track-item::after, .personal-note::after { content: ""; position: absolute; }
    .logo::after { inset: -10px 0; }
    .breadcrumb a::after { inset: -7px; }
    .back-link a::after { inset: -5px 0; }
    .detail-summary > a.brand::after { inset: -14px 0; }
    .label-row > a::after { inset: -11px 0; }
    .colour-deal::after { inset: -6px 0 -16px; }
    .new-brands .chip::after { inset: -5px 0; }
    .piece-head > .text-button::after, .foryou-bar > .text-button::after, .size-missing .text-button::after, .view-track-item::after { inset: -3px 0; }
    .personal-note::after { inset: -9px 0; }
    /* A search in the list of searches, where a row of the table is a card. */
    .offer-table.is-cards td > a:not([class]) { position: relative; }
    .offer-table.is-cards td > a:not([class])::after { content: ""; position: absolute; inset: -11px 0; }
    /* Buttons and rows that show their own box are that tall themselves: "Neue Vorschläge", "Gewählte Teile merken"
       on a phone, "Löschen" in the list of searches, a row with a box to tick, the field of the search. */
    .foryou-bar > .button-small, .outfit-keep, .offer-table.is-cards .button-small { min-height: 44px; }
    .check { min-height: 44px; }
    .header-search input[type="search"] { min-height: 44px; }
}
@media (pointer: coarse) and (min-width: 360px) {
    .colour-swatch { width: 28px; }
    .colour-swatches { margin-left: -7px; }
}
/* The two round buttons in the search field of the header are as large as a fingertip, like the ones of the field
   at the bottom edge of a phone; the field gives them the room from its padding (and the stand-in on the start page
   follows, see .header-spacer). */
@media (pointer: coarse) and (min-width: 761px) {
    .header-search { padding: 2px; }
    .header-search .search-submit, .header-search .image-upload-compact label { width: 44px; height: 44px; }
    .header-spacer { min-height: 50px; }
}
@media (pointer: coarse), (max-width: 760px) {
    /* The links of the header are as large as a fingertip, without making the row taller. */
    .header-link { min-width: 44px; min-height: 44px; }
    .text-button { padding-top: 8px; padding-bottom: 8px; }
    /* What is tapped in and above the list of the search is as tall as a fingertip (44px): the chips that choose
       or remove something (not the ones that only say something), "Alle entfernen" beside them, and the two
       views in their track. */
    button.chip, a.chip { min-height: 44px; }
    .chip.is-small { min-height: 0; }
    .active-filters .text-button { min-height: 44px; }
    .view-track-item { width: 44px; }
    /* The cross that empties a search field: 40px to hit, the drawing as small as before. */
    input[type="search"]::-webkit-search-cancel-button { width: 40px; height: 40px; margin: -8px -8px -8px 0; }
    .detail-thumb { flex-basis: 68px; }
}
/* On a phone the pictures of an article are swiped; the row of thumbnails under them would take the place of the
   price on the first screen. A counter on the picture says which of how many is shown. With a mouse (a narrow
   window on a desktop) the thumbnails stay: they are the way to the other pictures there. */
@media (max-width: 599px) and (pointer: coarse) {
    .detail-thumbs { display: none; }
    .detail-count { display: block; }
}

/* --- Browsers --- */

/* Safari draws a search field its own way (rounded, with a magnifier and room before the text) and ignores part of
   what this stylesheet says about it, unless that look is switched off. */
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

/* ---------- How many articles in a row, in every list ----------
   The wider the list, the more articles in a row, so that a card is never smaller than on a phone (about 175px)
   and a picture never so large that a screen shows a single row (cards of 230 to 300px on a monitor).
   A list that fills the page: two below 600px (phones upright, folding phones closed, one screen of a dual-screen
   phone), three from 600px (.product-grid above: opened folding phones, phones on their side, tablets), four from
   1100px, five from 1500px, where the page gets wider as well (--page).
   A list beside a column (the filters of the search, the photo that was searched, the article of "Ähnliche
   Artikel") has less room: there the steps come later. At the end of the sheet, so it wins over the rules for
   each screen size. */
@media (max-width: 599px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* The price before a reduction without its "CHF" (see .product-card .price): hidden like .visually-hidden. */
    .product-card .price-unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 1100px) {
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1500px) {
    .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 839px) {
    .search-layout .product-grid, .image-search-layout .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 840px) and (max-width: 1499px) {
    .search-layout .product-grid, .image-search-layout .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1500px) and (max-width: 1799px) {
    .search-layout .product-grid, .image-search-layout .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Where a card is narrower than about 200px, a name takes two lines more often than not: every card keeps the room
   for two there, so the prices of a row stand on one line instead of at two heights. (Wider cards do not: nearly
   every name has one line there, and the room would stand empty.) */
@media (max-width: 479px), (min-width: 600px) and (max-width: 679px) {
    .product-card .name { min-height: 2.7em; }
}
@media (min-width: 840px) and (max-width: 959px) {
    .search-layout .product-card .name, .image-search-layout .product-card .name { min-height: 2.7em; }
}
/* A few articles under a heading that leads to all of them (the start page, "Ähnliche Artikel" on an article): whole
   rows only. However many there are and however many fit in a row, a last row that is not full is left out (the
   first article of such a row and what follows it), unless it is the only row. */
@media (max-width: 599px) {
    .piece-head + .product-grid > :nth-child(2n+1):last-child:not(:first-child) { display: none; }
    /* Four rows at most on a phone: the page under them (the categories, the offers of the article) stays in reach. */
    .piece-head + .product-grid > :nth-child(n+9) { display: none; }
}
@media (min-width: 600px) and (max-width: 1099px) {
    .piece-head + .product-grid > :nth-child(3n+1):nth-last-child(-n+2):not(:first-child),
    .piece-head + .product-grid > :nth-child(3n+1):nth-last-child(-n+2):not(:first-child) ~ * { display: none; }
}
@media (min-width: 1100px) and (max-width: 1499px) {
    .piece-head + .product-grid > :nth-child(4n+1):nth-last-child(-n+3):not(:first-child),
    .piece-head + .product-grid > :nth-child(4n+1):nth-last-child(-n+3):not(:first-child) ~ * { display: none; }
}
@media (min-width: 1500px) {
    .piece-head + .product-grid > :nth-child(5n+1):nth-last-child(-n+4):not(:first-child),
    .piece-head + .product-grid > :nth-child(5n+1):nth-last-child(-n+4):not(:first-child) ~ * { display: none; }
}

/* ---------- Colours chosen by the visitor's system ---------- */

/* Forced colours (Windows "Kontrastdesigns"): the system replaces every colour of the page with its own few and
   drops fills and shadows, which is what most "chosen" states here are made of. They get the system's own pair for
   something chosen, which is kept as it is written. What is drawn with a mask or as a plain fill (arrows, ticks,
   dots, the lines under the page one is on) is told its colour too, and a colour dot keeps the colour it is there
   to show. */
@media (forced-colors: active) {
    .chip.is-active, .chip[data-pending="on"], .segmented input:checked + span, .outfit-pick.is-active,
    .view-track-item.is-on, html:not([data-feed-full]) .view-track-item.is-page, html[data-feed-full] .view-track-item.is-full,
    .site-nav-group.is-gender a[aria-current], .site-nav-menu a[aria-current], .letters a[aria-current], .badge {
        /* Not adjusted by the system, or it would lay a patch of the page's colour behind the words. */
        forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; box-shadow: none;
    }
    .chip.is-active *, .chip[data-pending="on"] *, .site-nav-menu a[aria-current] * { color: HighlightText; }
    .chip.is-active[data-pending="off"] { background: Canvas; color: CanvasText; border-color: CanvasText; }
    .chip.is-active[data-pending="off"] * { color: CanvasText; }
    .site-nav a::after, .site-nav-more summary::before, .settings-tabs a::after { background: Highlight; }
    .detail-thumb.is-active, .favorite-button.is-active { border-color: Highlight; }
    .favorite-button.is-active, .product-card-favorite .favorite-button.is-active { color: Highlight; }
    /* On a photo the heart is in the colour of the system's writing, which may be white: it gets the ground that goes with it. */
    .product-card-favorite .favorite-button { background: Canvas; filter: none; }
    .multi-select summary::after, .site-nav-menu a[data-cat][aria-current]::after { background: CanvasText; }
    .site-nav-menu a[data-cat][aria-current]::after { background: HighlightText; }
    input[type="search"]::-webkit-search-cancel-button, .checklist li::before { background: CanvasText; }
    .feed-dots i, .sortout-dots i { background: Canvas; border: 1px solid CanvasText; }
    .feed-dots i.is-active, .sortout-dots i.is-active { background: CanvasText; }
    .swatch, .colour-swatch::before, .shop-dot { forced-color-adjust: none; }
}
