/*
    Built on the HoyaSticks design system (design-system/tokens.css, linked before this file).
    Colours, spacing, radii and type come from its variables only.
*/
:root {
    /* The design system has no status colours yet. An error follows the accent; a warning is the one local value. */
    --danger: var(--accent);
    --warning: #8a5a00;
    --header-height: 72px;
    --page-gutter: var(--space-6);
    /* Native controls (select lists, scrollbars, the colour picker) follow the theme too. */
    color-scheme: light;
}

[data-theme=dark] {
    --warning: #e6c16a;
    color-scheme: dark;
}

@media (max-width: 40rem) {
    :root {
        --page-gutter: var(--space-4);
    }
}

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

/* A column as tall as the window, so the footer stays at the bottom of short pages. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 24px;
}

body > main {
    flex: 1 0 auto;
}

/* Text styles of the design system, applied to the elements that carry them. */
h1 {
    margin: 0 0 var(--space-6);
    font-size: 40px;
    line-height: 44px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h2 {
    margin: var(--space-8) 0 var(--space-4);
    font-size: 28px;
    line-height: 34px;
    font-weight: 600;
}

h3 {
    margin: var(--space-6) 0 var(--space-2);
    font-size: 20px;
    line-height: 26px;
    font-weight: 600;
}

@media (max-width: 40rem) {
    h1 {
        font-size: 28px;
        line-height: 34px;
    }

    h2 {
        font-size: 20px;
        line-height: 26px;
    }
}

a {
    color: var(--accent);
}

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

h1:focus {
    outline: none;
}

/* With media-guard.js: no "Save image" sheet on a long press on the iPhone, and no selection that drags a photo out.
   Not in the admin panel, which needs its own files. */
body:not(:has(.admin-bar)) :is(img, video) {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Form controls */
:where(input:not([type=checkbox], [type=radio], [type=color], [type=file], [type=hidden]), select, textarea) {
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--ink);
    font: inherit;
}

:where(input, select, textarea):disabled {
    background: var(--surface);
    color: var(--ink-muted);
}

:where(input[type=checkbox], input[type=radio]) {
    accent-color: var(--accent);
}

::placeholder {
    color: var(--ink-muted);
    opacity: 0.7;
}

/* Dropdown.razor: the site's own list, used instead of every select. */
.dropdown {
    position: relative;
    min-width: 0;
}

    .dropdown-button {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        width: 100%;
        min-width: 0;
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-sm);
        background: var(--surface-raised);
        color: var(--ink);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }

        .dropdown-button:hover:not(:disabled) {
            border-color: var(--ink-muted);
        }

        .dropdown-button:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 1px;
        }

        .dropdown-button:disabled {
            background: var(--surface);
            color: var(--ink-muted);
            cursor: default;
        }

    .dropdown-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

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

    .dropdown-arrow {
        flex: none;
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform 0.15s;
    }

    .dropdown.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .dropdown-list {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        z-index: 20;
        min-width: 100%;
        /* Never wider than the screen, nor taller than a good part of it. */
        max-width: min(28rem, calc(100vw - 2 * var(--page-gutter)));
        max-height: min(18rem, 50vh);
        margin: 0;
        padding: var(--space-1);
        overflow-y: auto;
        list-style: none;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-sm);
        background: var(--surface-raised);
        box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
        color: var(--ink);
        font-size: 15px;
        line-height: 20px;
        font-weight: 400;
    }

        .dropdown-list[data-up] {
            top: auto;
            bottom: calc(100% + 4px);
        }

    .dropdown-option {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-sm);
        cursor: pointer;
    }

        .dropdown-option:hover, .dropdown-option.active {
            background: var(--surface);
        }

        .dropdown-option.active {
            box-shadow: inset 2px 0 0 var(--accent);
        }

        .dropdown-option.selected {
            color: var(--accent);
            font-weight: 600;
        }

        .dropdown-option.disabled {
            color: var(--ink-muted);
            cursor: default;
            opacity: 0.6;
        }

    .dropdown-check {
        flex: none;
        width: 16px;
        height: 16px;
        border: 1px solid var(--line-strong);
        border-radius: 3px;
    }

    .dropdown-option.selected .dropdown-check {
        border-color: var(--accent);
        background: var(--accent);
        box-shadow: inset 0 0 0 3px var(--surface-raised);
    }

    /* The colour of an option, before its name. */
    .dropdown-dot {
        flex: none;
        width: 14px;
        height: 14px;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-pill);
    }

    /* Tight spots of the panel: a filter, a cell, the colour of a photo. */
    .dropdown.compact .dropdown-button {
        padding: var(--space-1) var(--space-2);
        font-size: 14px;
        line-height: 20px;
    }

.valid.modified:not([type=checkbox]) {
    border-color: var(--brand-moss);
}

.invalid, input[aria-invalid=true] {
    border-color: var(--danger);
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat var(--space-4)/1.8rem, var(--brand-crimson);
    padding: var(--space-4) var(--space-4) var(--space-4) 3.7rem;
    border-radius: var(--radius-md);
    color: var(--brand-mist);
}

    .blazor-error-boundary::after {
        content: "Wystąpił błąd."
    }

/* 3D views (SceneView, KitSceneView) */
.scene-view {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 20rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    overflow: hidden;
}

    .scene-view canvas {
        display: block;
        width: 100%;
        height: 100%;
        outline: none;
        touch-action: none;
    }

.scene-message {
    position: absolute;
    inset: auto 0 var(--space-4) 0;
    margin: 0;
    text-align: center;
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 20px;
    pointer-events: none;
}

.button {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    cursor: pointer;
}

    .button:hover:not(:disabled) {
        border-color: var(--ink);
    }

    .button:disabled {
        opacity: 0.5;
        cursor: default;
    }

    .button.danger {
        color: var(--danger);
    }

        .button.danger:hover:not(:disabled) {
            border-color: var(--danger);
        }

    .button.primary {
        border-color: var(--accent);
        background: var(--accent);
        color: var(--on-accent);
    }

        .button.primary:hover:not(:disabled) {
            border-color: var(--ink);
            background: color-mix(in srgb, var(--accent) 85%, var(--ink));
        }

a.button {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

/* Administration panel */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

    .admin-heading h1 {
        margin: 0;
    }

.admin-back {
    display: inline-block;
    margin-bottom: var(--space-4);
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    text-decoration: none;
}

    .admin-back:hover {
        color: var(--accent);
    }

.admin-error {
    color: var(--danger);
}

.admin-success {
    color: var(--ink-muted);
    font-weight: 500;
}

/* What refused an action, under the refusal; a long list scrolls instead of pushing the page down. */
.admin-held-by {
    max-height: 12rem;
    overflow-y: auto;
    margin: 0 0 var(--space-4);
    padding-left: var(--space-6);
    font-size: 14px;
    line-height: 20px;
}

.admin-table-scroll {
    overflow-x: auto;
}

/* Separate borders, so that the rounded corners hold. */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
}

    .admin-table.narrow {
        max-width: 48rem;
    }

    .admin-table th, .admin-table td {
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--line);
        text-align: left;
    }

    .admin-table tbody tr:last-child > * {
        border-bottom: none;
    }

    .admin-table thead th {
        color: var(--ink-muted);
        font-size: 14px;
        line-height: 20px;
        font-weight: 500;
    }

    .admin-table .number {
        text-align: right;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .admin-table .nowrap {
        white-space: nowrap;
    }

    .admin-table caption {
        margin-bottom: var(--space-2);
        color: var(--ink-muted);
        font-size: 14px;
        line-height: 20px;
        text-align: left;
    }

    /* A row that waits for someone stands out; a finished one steps back. */
    .admin-table tr.highlight > td:first-child {
        box-shadow: inset 3px 0 0 var(--accent);
        font-weight: 600;
    }

    .admin-table tr.faded {
        color: var(--ink-muted);
    }

    /* Stays a table cell: as a flex box it would not stretch to the row, and its border would sit higher. */
    .admin-table td.actions {
        text-align: right;
        white-space: nowrap;
    }

        .admin-table td.actions > * + * {
            margin-left: var(--space-2);
        }

    /* A row's detail, opened by the button in its first cell. */
    .admin-table .detail-toggle {
        width: 1%;
        padding-right: 0;
    }

    .admin-table .toggle {
        display: inline-grid;
        place-items: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: none;
        color: var(--ink);
        font: inherit;
        cursor: pointer;
    }

        .admin-table .toggle:hover {
            border-color: var(--line-strong);
        }

    .admin-table tr:has(+ tr.row-detail:not([hidden])) > * {
        border-bottom-color: transparent;
    }

    .admin-table tr.row-detail > td {
        padding-top: 0;
        padding-left: calc(var(--space-4) + 28px + var(--space-4));
    }

    @media (max-width: 40rem) {
        .admin-table tr.row-detail > td {
            padding-left: var(--space-2);
            padding-right: var(--space-2);
        }
    }

    /* The last row keeps no line under it, even with its closed detail after it. */
    .admin-table tbody tr:nth-last-child(2):has(+ tr.row-detail[hidden]) > * {
        border-bottom: none;
    }

    .admin-table .button {
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-sm);
    }

    .admin-table input {
        width: 100%;
    }

.admin-split {
    display: grid;
    /* min(): on a phone one column as wide as the screen, not 30rem that runs off it. */
    grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 1fr));
    gap: var(--space-6);
    align-items: start;
}

.admin-card {
    padding: var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    margin-top: var(--space-2);
}

    .admin-card h2 {
        margin: 0 0 var(--space-3);
        font-size: 20px;
        line-height: 26px;
    }

    .admin-card h3 {
        margin: var(--space-6) 0 var(--space-1);
        font-size: 16px;
        line-height: 24px;
    }

@media (max-width: 40rem) {
    .admin-card {
        padding: var(--space-4);
    }
}

.hint {
    margin: 0 0 var(--space-2);
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 20px;
}

.admin-form {
    display: grid;
    gap: var(--space-6);
}

    .admin-form .fields {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
        gap: var(--space-4);
    }

    .admin-form label {
        display: grid;
        gap: var(--space-1);
        color: var(--ink-muted);
        font-size: 14px;
        line-height: 20px;
        font-weight: 500;
    }

    .admin-form input:not([type=checkbox]), .admin-form .dropdown-button {
        width: 100%;
        font-size: 16px;
        line-height: 24px;
    }

    .admin-form fieldset {
        display: grid;
        gap: var(--space-3);
        margin: 0;
        padding: var(--space-4);
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
    }

    .admin-form legend {
        padding: 0 var(--space-2);
        font-size: 14px;
        line-height: 20px;
        font-weight: 600;
    }

    .admin-form .option-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: var(--space-2);
    }

    .admin-form .checks {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2) var(--space-6);
    }

    .admin-form label.check {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        color: inherit;
    }

    .admin-form fieldset > .button, .admin-form > .button {
        justify-self: start;
    }

    .admin-form .validation-message {
        font-size: 14px;
        line-height: 20px;
    }

    .admin-form .variant {
        display: grid;
        /* minmax(0, ...) lets the number inputs shrink instead of pushing the row out of its card. */
        grid-template-columns: minmax(4.5rem, 1fr) repeat(3, minmax(0, 1fr));
        gap: var(--space-3);
        align-items: end;
        padding: var(--space-2) 0;
        border-top: 1px solid var(--line);
    }

        .admin-form .variant:first-child {
            border-top: none;
        }

        .admin-form .variant .check {
            align-self: center;
            font-weight: 600;
        }

    /* A correction's lower price, by percent or by amount, side by side in one cell. */
    .admin-form .lower-by {
        display: flex;
        gap: var(--space-2);
    }

        .admin-form .lower-by input[type=number] {
            width: 5.5rem;
        }

.colour-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    gap: var(--space-2);
    align-items: center;
}

    .colour-row input[type=color] {
        width: 3rem;
        height: 2.6rem;
        padding: var(--space-1);
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-sm);
        background: var(--surface-raised);
    }

.admin-card.narrow {
    max-width: 36rem;
}

        .admin-form .variant .pricing {
            grid-column: 1 / -1;
        }

            .admin-form .variant .pricing summary {
                color: var(--accent);
                font-size: 14px;
                line-height: 20px;
                font-weight: 500;
                cursor: pointer;
            }

            .admin-form .variant .pricing[open] summary {
                margin-bottom: var(--space-2);
            }

.admin-table .missing {
    color: var(--warning);
}

.admin-table .higher {
    color: var(--danger);
}

.admin-table .lower {
    color: var(--ink-muted);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
    color: var(--ink-muted);
    font-size: 14px;
    line-height: 20px;
}

/* Whether customers can see a part. */
.admin-status {
    display: inline-block;
    padding: 2px var(--space-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    white-space: nowrap;
}

    .admin-status.draft {
        border-style: dashed;
        color: var(--ink-muted);
    }

    .admin-status.published {
        border-color: var(--ink);
    }

    /* Orders: paid ones wait for the shop, one that needs attention needs it first; ended ones step back. */
    .admin-status.order-paid, .admin-status.order-inprogress {
        border-color: var(--accent);
        color: var(--ink);
    }

    .admin-status.order-needsattention {
        border-color: var(--danger);
        color: var(--danger);
        font-weight: 600;
    }

    .admin-status.order-expired, .admin-status.order-cancelled, .admin-status.order-returned {
        border-style: dashed;
        color: var(--ink-muted);
    }

    /* Withdrawals: a company's waiting for the shop stands out; one settled, taken back or refused steps back. */
    .admin-status.withdrawal-submitted, .admin-status.withdrawal-ontheway, .admin-status.withdrawal-received {
        border-color: var(--accent);
        color: var(--ink);
    }

    .admin-status.withdrawal-decide {
        border-color: var(--danger);
        color: var(--danger);
        font-weight: 600;
    }

    .admin-status.withdrawal-settled, .admin-status.withdrawal-revoked, .admin-status.withdrawal-refused {
        border-style: dashed;
        color: var(--ink-muted);
    }

    /* Complaints: one waiting for an answer stands out, the last three days and an overdue one most; an answered one steps back. */
    .admin-status.complaint-submitted, .admin-status.complaint-waiting {
        border-color: var(--accent);
        color: var(--ink);
    }

    .admin-status.complaint-urgent {
        border-color: var(--danger);
        color: var(--danger);
        font-weight: 600;
    }

    .admin-status.complaint-accepted, .admin-status.complaint-rejected {
        border-style: dashed;
        color: var(--ink-muted);
    }

    .admin-status.complaint-settled {
        border-style: dashed;
        color: var(--ink-muted);
    }

    /* Documents: a refusal and a correction to approve ask for the shop; one on its way waits quietly. */
    .admin-status.invoice-failed {
        border-color: var(--danger);
        color: var(--danger);
        font-weight: 600;
    }

    .admin-status.invoice-draft {
        border-color: var(--accent);
    }

    .admin-status.invoice-queued, .admin-status.invoice-creating, .admin-status.invoice-sendingtoksef {
        border-style: dashed;
        color: var(--ink-muted);
    }

    /* Shipments: a refusal asks for the shop; one being made waits quietly; one called off steps back. */
    .admin-status.shipment-rejected {
        border-color: var(--danger);
        color: var(--danger);
        font-weight: 600;
    }

    .admin-status.shipment-confirmed {
        border-color: var(--accent);
    }

    .admin-status.shipment-queued, .admin-status.shipment-creating, .admin-status.shipment-cancelled {
        border-style: dashed;
        color: var(--ink-muted);
    }

.admin-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: var(--space-3);
    margin: 0 0 var(--space-4);
    padding: 0;
    list-style: none;
}

    .admin-photos li {
        display: grid;
        gap: var(--space-2);
        align-content: start;
    }

    .admin-photos img {
        display: block;
        width: 100%;
        aspect-ratio: 3 / 4;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        object-fit: cover;
    }

    .admin-photos .button {
        padding: var(--space-1) var(--space-2);
        font-size: 13px;
        line-height: 18px;
    }

    .admin-photos .photo-colour {
        display: grid;
        gap: var(--space-1);
        color: var(--ink-muted);
        font-size: 13px;
        line-height: 18px;
    }

        .admin-photos .photo-colour .dropdown {
            min-width: 0;
            font-size: 13px;
        }


/*
    Collection looks (CollectionLookFrame, CollectionLook in the domain). Typefaces of the pairs a collection can choose:
    variable files in wwwroot/fonts, licence next to each (*-OFL.txt). A browser downloads a face only when a page
    sets text in it, so these cost nothing on pages that do not.
*/
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/fraunces-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

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

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

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

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

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/space-grotesk-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

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

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

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

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

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

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

/*
    The page of a collection, edge to edge between the header and the footer: the frame takes the main column's
    padding in, so what hangs in the margins is placed as on any page, and its background reaches the window's edges.
*/
.collection-look {
    --font-heading: var(--font-sans);
    position: relative;
    /* Its own stacking context: the background below, the hoyas above it, the content on top. */
    isolation: isolate;
    margin: calc(-1 * var(--space-8)) calc(-1 * var(--page-gutter));
    padding: var(--space-8) var(--page-gutter);
    font-family: var(--font-sans);
}

    .collection-look::before {
        content: "";
        position: absolute;
        z-index: -2;
        /* From one edge of the page to the other (the frame is the main column, centred), never wider: see below. */
        inset: 0 calc(50% - 50cqw);
        background-color: var(--surface);
    }

    .collection-look :is(h1, h2, h3) {
        font-family: var(--font-heading);
    }

/* The page's width without a scroll bar that takes room (100vw would count it and let the page scroll sideways). */
html:has(.collection-look) {
    container-type: inline-size;
}

/*
    The collection's colours, in the light theme only: a visitor who chose the dark one keeps the shop's dark palette.
    The domain checked text and accent against the background; muted text stays as dark as text for that reason.
    The panel's preview (data-palette-always) shows them in either theme. The header and the footer of a page with
    a palette (and the announcement over the header) take its colours, but neither its typefaces nor its pattern (the
    frame sets the variables on the root).
*/
:root:not([data-theme=dark]) .collection-look[data-palette],
.collection-look[data-palette][data-palette-always],
:root:not([data-theme=dark]):has(.collection-look[data-palette]) :is(.site-header, .site-footer) {
    --surface: var(--look-surface);
    --surface-raised: color-mix(in srgb, var(--look-surface) 82%, #ffffff);
    --ink: var(--look-ink);
    --ink-muted: var(--look-ink);
    --line: color-mix(in srgb, var(--look-ink) 18%, var(--look-surface));
    --line-strong: color-mix(in srgb, var(--look-ink) 50%, var(--look-surface));
    --accent: var(--look-accent);
    --on-accent: var(--look-on-accent);
    --focus: var(--look-accent);
    --danger: var(--look-accent);
    --brand-pink: color-mix(in srgb, var(--look-accent) 55%, var(--look-surface));
    --brand-crimson: var(--look-accent);
    color: var(--ink);
}

    :root:not([data-theme=dark]) .collection-look[data-palette].palette-dark,
    .collection-look[data-palette][data-palette-always].palette-dark,
    :root:not([data-theme=dark]):has(.collection-look[data-palette].palette-dark) :is(.site-header, .site-footer) {
        --surface-raised: color-mix(in srgb, var(--look-surface) 88%, #ffffff);
        --warning: #e6c16a;
        color-scheme: dark;
    }

/* The footer has no ground of its own; under a palette it takes the palette's, edge to edge like the frame's. */
:root:not([data-theme=dark]):has(.collection-look[data-palette]) .site-footer {
    background: var(--surface);
}

/* The announcement over the header is set in the accent; the palette's own takes the shop's place. */
:root:not([data-theme=dark]):has(.collection-look[data-palette]) .announcement-bar {
    --accent: var(--look-accent);
    --on-accent: var(--look-on-accent);
}

.collection-look.fonts-garden {
    --font-heading: Fraunces, ui-serif, Georgia, serif;
}

.collection-look.fonts-elegant {
    --font-sans: 'Source Sans 3', ui-sans-serif, system-ui, sans-serif;
    --font-heading: 'Playfair Display', ui-serif, Georgia, serif;
}

.collection-look.fonts-technical {
    --font-sans: Inter, ui-sans-serif, system-ui, sans-serif;
    --font-heading: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
}

.collection-look.fonts-handmade {
    --font-sans: Nunito, ui-sans-serif, system-ui, sans-serif;
    --font-heading: Caveat, ui-rounded, cursive;
}

    /* A handwriting runs small for its size. */
    .collection-look.fonts-handmade :is(h1, h2) {
        font-size: 1.3em;
        line-height: 1.1;
    }

/* Patterns over the background, faint, in the colour of text. */
.collection-look.pattern-dots::before {
    background-image: radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1.5px, transparent 2px);
    background-size: 22px 22px;
}

.collection-look.pattern-grid::before {
    background-image:
        linear-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px);
    background-size: 32px 32px;
}

.collection-look.pattern-stripes::before {
    background-image: repeating-linear-gradient(
        -45deg, color-mix(in srgb, var(--ink) 6%, transparent) 0 10px, transparent 10px 28px);
}

/* Outlet: the panel's list shows each item by its main photo. */
.outlet-thumb {
    display: block;
    width: 3rem;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* A printed page (an assembly instruction for the parcel, a document to keep) is the text alone, in the light theme. */
@media print {
    :root,
    [data-theme=dark] {
        --surface: #ffffff;
        --surface-raised: #ffffff;
        --ink: var(--brand-forest);
        --ink-muted: var(--brand-moss);
        --line: #d5ded6;
        --line-strong: #5f7f6f;
        --accent: var(--brand-crimson);
        color-scheme: light;
    }

    .customer-view-bar,
    .site-header,
    .site-footer,
    .margin-plant,
    #blazor-error-ui {
        display: none !important;
    }
}
