/*
 * Rezepte — one stylesheet, no build step.
 * Mobile first; the desktop layout (sidebar rail) starts at 960px.
 *
 *  1. Fonts & tokens       6. Recipe cards & posters   11. Editor (new/edit)
 *  2. Base                 7. Recipe page              12. Auth, profile, users
 *  3. Shell (rail/dock)    8. Ingredients & steps      13. Toasts, empty states, errors
 *  4. Type & page heads    9. Lightbox                 14. Motion
 *  5. Controls            10. Search
 */

/* 1. Fonts & tokens ------------------------------------------------------ */

@font-face {
    font-family: Archivo;
    src: url("/fonts/archivo/archivo-latin-wdth.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    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: Archivo;
    src: url("/fonts/archivo/archivo-latin-ext-wdth.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --font: Archivo, ui-sans-serif, system-ui, sans-serif;

    /* Fixed colours, the same in both schemes */
    --lime: #d4f53c;
    --lime-deep: #b9dc1c;
    --chili: #ff4b2b;
    --coal: #0e0e0c;
    --chalk: #f4f4ef;

    /* Light scheme */
    --bg: #ededE7;
    --surface: #f8f8f4;
    --surface-2: #e2e2db;
    --ink: #121210;
    --ink-2: #5d5d55;
    --ink-3: #8b8b82;
    --line: rgb(18 18 16 / .12);
    --line-strong: rgb(18 18 16 / .28);
    --danger: #d4321c;

    --rail-bg: var(--coal);
    --rail-ink: #a8a89f;

    /* Category tones (posters, chips) */
    --tone-1: #ff7a45; /* Hauptspeise: paprika */
    --tone-2: #8fd6b8; /* Vorspeise: minze */
    --tone-3: #f5a9c9; /* Nachspeise: himbeere */
    --tone-4: #9fd468; /* Salat: gurke */
    --tone-5: #f3c234; /* Sauce: senf */
    --tone-6: #9cc4ff; /* Frühstück: milch */
    --tone-7: #d9c4a3; /* Beilage: kartoffel */
    --tone-x: #cfcfc6;

    --r: 6px;
    --r-lg: 14px;
    --gutter: 16px;
    --dock-h: 64px;
    --ease: cubic-bezier(.2, .75, .2, 1);

    color-scheme: light;
}

/* Dark scheme: follows the system unless the profile page set data-theme on <html>.
   The two blocks are identical; keep them in sync. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f0f0d;
        --surface: #191917;
        --surface-2: #24241f;
        --ink: #efefe8;
        --ink-2: #a3a399;
        --ink-3: #74746c;
        --line: rgb(239 239 232 / .1);
        --line-strong: rgb(239 239 232 / .24);
        --danger: #ff6a4f;
        --rail-bg: #070706;
        --chip-n-active: #5f5f57;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0f0f0d;
    --surface: #191917;
    --surface-2: #24241f;
    --ink: #efefe8;
    --ink-2: #a3a399;
    --ink-3: #74746c;
    --line: rgb(239 239 232 / .1);
    --line-strong: rgb(239 239 232 / .24);
    --danger: #ff6a4f;
    --rail-bg: #070706;
    --chip-n-active: #5f5f57;
    color-scheme: dark;
}

@media (min-width: 640px) {
    :root { --gutter: 28px; }
}

@media (min-width: 1200px) {
    :root { --gutter: 48px; }
}

[data-cat="1"] { --tone: var(--tone-1); }
[data-cat="2"] { --tone: var(--tone-2); }
[data-cat="3"] { --tone: var(--tone-3); }
[data-cat="4"] { --tone: var(--tone-4); }
[data-cat="5"] { --tone: var(--tone-5); }
[data-cat="6"] { --tone: var(--tone-6); }
[data-cat="7"] { --tone: var(--tone-7); }

/* 2. Base ---------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font: 400 16px/1.5 var(--font);
    font-stretch: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

button { cursor: pointer; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

ul, ol { padding: 0; list-style: none; }

[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
    border-radius: 2px;
}

::selection { background: var(--lime); color: var(--coal); }

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

.skip {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--lime);
    color: var(--coal);
    font-weight: 700;
    border-radius: var(--r);
    transform: translateY(-200%);
}

.skip:focus { transform: none; }

.icon {
    width: 22px;
    height: 22px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm { width: 18px; height: 18px; }

/* Small condensed caps used for labels, meta lines and the ticket */
.label, .meta {
    font-size: 12px;
    font-weight: 600;
    font-stretch: 78%;
    letter-spacing: .07em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* 3. Shell --------------------------------------------------------------- */

.main {
    width: 100%;
    max-width: 1480px;
    margin-inline: auto;
    padding: 0 var(--gutter) calc(var(--dock-h) + 48px + env(safe-area-inset-bottom));
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-weight: 850;
    font-stretch: 125%;
    letter-spacing: -.02em;
    line-height: 1;
}

.brand__mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--lime);
    color: var(--coal);
    display: grid;
    place-items: center;
}

.brand__mark .icon { width: 17px; height: 17px; stroke-width: 2.2; }

/* Mobile top bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: env(safe-area-inset-top) var(--gutter) 0;
    max-width: 1480px;
    margin-inline: auto;
}

.topbar .brand { font-size: 19px; }

.topbar__end { display: flex; align-items: center; gap: 8px; }

.is-auth .topbar__end { display: none; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--bg);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-stretch: 125%;
    font-size: 15px;
    text-decoration: none;
    text-transform: uppercase;
}

/* Mobile dock */
.dock {
    position: fixed;
    z-index: 60;
    inset-inline: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: 480px;
    margin-inline: auto;
    height: var(--dock-h);
    padding: 0 6px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: center;
    background: var(--rail-bg);
    color: var(--rail-ink);
    border-radius: 22px;
    box-shadow: 0 18px 40px -18px rgb(0 0 0 / .55), inset 0 0 0 1px rgb(255 255 255 / .06);
    view-transition-name: dock;
}

.dock a {
    height: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 3px;
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: color .15s;
}

.dock a[aria-current="page"] { color: #fff; }

.dock a[aria-current="page"] .icon { color: var(--lime); }

.dock .dock__add { gap: 0; }

.dock__add span {
    width: 50px;
    height: 44px;
    border-radius: 14px;
    background: var(--lime);
    color: var(--coal);
    display: grid;
    place-items: center;
    transition: transform .2s var(--ease);
}

.dock__add:active span { transform: scale(.92); }

.dock__add .icon { stroke-width: 2.4; }

/* Desktop rail */
.rail { display: none; }

@media (min-width: 960px) {
    .shell {
        display: grid;
        grid-template-columns: 252px minmax(0, 1fr);
    }

    .topbar, .dock { display: none; }

    .main { padding-bottom: 80px; }

    .rail {
        position: sticky;
        top: 0;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        gap: 28px;
        padding: 28px 18px 20px;
        background: var(--rail-bg);
        color: var(--rail-ink);
        view-transition-name: rail;
    }

    .rail .brand {
        color: #fff;
        font-size: 24px;
        padding-inline: 8px;
    }

    .rail .brand__mark { width: 30px; height: 30px; border-radius: 8px; }

    .rail__nav { display: grid; gap: 2px; }

    .rail__nav a, .rail__logout {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 10px;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        transition: background .15s, color .15s;
    }

    .rail__nav a:hover { background: rgb(255 255 255 / .06); color: #fff; }

    .rail__nav a[aria-current="page"] { background: rgb(255 255 255 / .09); color: #fff; }

    .rail__nav a[aria-current="page"] .icon { color: var(--lime); }

    .rail__group {
        padding: 18px 12px 6px;
        color: #6f6f68;
    }

    .rail .btn--lime { width: 100%; }

    .rail__foot {
        margin-top: auto;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 8px 0;
        border-top: 1px solid rgb(255 255 255 / .08);
    }

    .rail__foot .avatar { background: #2a2a26; color: #fff; }

    .rail__user {
        min-width: 0;
        flex: 1;
        text-decoration: none;
        color: #fff;
        font-weight: 600;
        font-size: 14px;
        line-height: 1.25;
    }

    .rail__user small {
        display: block;
        color: var(--rail-ink);
        font-weight: 400;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rail__logout { padding: 8px; color: var(--rail-ink); background: none; border: 0; }

    .rail__logout:hover { color: #fff; background: rgb(255 255 255 / .06); }

    .rail__guest { display: grid; gap: 8px; margin-top: auto; }

    .rail__guest .btn--ghost { --btn-ink: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22); }

    .rail__guest .btn--ghost:hover { box-shadow: inset 0 0 0 1px #fff; }
}

/* 4. Type & page heads --------------------------------------------------- */

.ph {
    padding: 18px 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

@media (min-width: 960px) {
    .ph { padding: 52px 0 28px; }
}

.ph__eyebrow { color: var(--ink-2); margin-bottom: 10px; }

.display {
    font-size: clamp(46px, 13.5vw, 112px);
    font-weight: 850;
    font-stretch: 125%;
    line-height: .88;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.display--md { font-size: clamp(36px, 9vw, 72px); }

.count {
    display: inline-block;
    vertical-align: top;
    margin-left: .12em;
    padding: .38em .5em .3em;
    border-radius: 999px;
    background: var(--lime);
    color: var(--coal);
    font-size: max(12px, .16em);
    font-weight: 700;
    font-stretch: 100%;
    letter-spacing: 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transform: translateY(.25em);
}

.h2 {
    font-size: 22px;
    font-weight: 800;
    font-stretch: 112%;
    letter-spacing: -.02em;
    line-height: 1.1;
}

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

/* 5. Controls ------------------------------------------------------------ */

.btn {
    --btn-bg: var(--ink);
    --btn-ink: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-size: 15px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s var(--ease), background .15s, box-shadow .15s;
}

.btn:active { transform: scale(.97); }

.btn--lime { --btn-bg: var(--lime); --btn-ink: var(--coal); }

.btn--lime:hover { --btn-bg: var(--lime-deep); }

.btn--ghost {
    --btn-bg: transparent;
    --btn-ink: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.btn--danger { --btn-bg: transparent; --btn-ink: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }

.btn--danger:hover { --btn-bg: var(--danger); --btn-ink: #fff; }

.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

.btn--block { width: 100%; }

.linkbtn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-2);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.linkbtn:hover { color: var(--ink); }

/* Round icon button, used on images and in toolbars */
.ibtn {
    width: 42px;
    height: 42px;
    flex: none;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: inset 0 0 0 1px var(--line);
    transition: transform .15s var(--ease), background .15s;
}

.ibtn:active { transform: scale(.9); }

.ibtn--glass {
    background: rgb(248 248 244 / .86);
    color: var(--coal);
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Favourite heart */
.fav .icon { transition: transform .3s var(--ease), fill .15s, stroke .15s; }

.fav[aria-pressed="true"] .icon { fill: var(--chili); stroke: var(--chili); }

.fav.is-popping .icon { animation: pop .45s var(--ease); }

@keyframes pop {
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Text inputs */
.input, .select, .textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    font-size: 16px; /* no zoom on iOS */
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}

.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 70%, transparent);
}

.input[aria-invalid="true"] { border-color: var(--danger); }

.select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

.textarea { min-height: 220px; line-height: 1.6; resize: vertical; field-sizing: content; }

.field { display: grid; gap: 8px; }

.field > .label { color: var(--ink-2); }

.field__error { color: var(--danger); font-size: 14px; font-weight: 500; }

.field__hint { color: var(--ink-3); font-size: 13.5px; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    cursor: pointer;
}

.check input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--ink);
}

/* Chips: category filters and radio choices */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding: 2px var(--gutter);
    scroll-padding-inline: var(--gutter);
}

.chips::-webkit-scrollbar { display: none; }

.chips--wrap { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }

.chip {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--line-strong);
    color: var(--ink);
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.chip:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.chip__dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--tone, var(--tone-x));
}

.chip__n {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"], .chip:has(input:checked) {
    background: var(--ink);
    color: var(--bg);
    box-shadow: none;
}

.chip[aria-pressed="true"] .chip__n, .chip:has(input:checked) .chip__n { color: var(--chip-n-active, var(--lime)); } /* dark: see tokens */

.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Segmented control (public/private) */
.segmented {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-2);
}

.segmented label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 550;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label:has(input:checked) {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line);
}

.segmented label:has(input:focus-visible) { outline: 2px solid var(--ink); }

/* Stepper (portions) */
.stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stepper button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--ink);
    transition: background .15s;
}

.stepper button:hover { background: var(--line-strong); }

.stepper button:disabled { opacity: .35; cursor: default; }

.stepper .icon { width: 16px; height: 16px; stroke-width: 2.4; }

/* 6. Recipe cards & posters --------------------------------------------- */

.toolbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    gap: 12px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 10px var(--gutter) 12px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.toolbar.is-stuck { box-shadow: 0 1px 0 var(--line); }

/* Home has no page head, so the toolbar opens the page */
.toolbar--lead { margin-top: 8px; }

@media (min-width: 960px) {
    .toolbar--lead { margin-top: 40px; }
}

.searchbox {
    position: relative;
    display: flex;
    align-items: center;
}

.searchbox > .icon {
    position: absolute;
    left: 16px;
    color: var(--ink-3);
    pointer-events: none;
}

.searchbox .input {
    min-height: 52px;
    padding-left: 48px;
    padding-right: 48px;
    border-radius: 14px;
    font-size: 17px;
}

.searchbox .input::-webkit-search-cancel-button { display: none; }

.searchbox__clear {
    position: absolute;
    right: 8px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-2);
}

.listbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
}

.listbar__count { color: var(--ink-2); }

.listbar__end { display: flex; align-items: center; gap: 8px; }

.sort {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.sort select {
    height: 38px;
    padding: 0 34px 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
    font-size: 14px;
    font-weight: 550;
    appearance: none;
    cursor: pointer;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 12px;
    padding-top: 6px;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 36px 20px;
    }
}

@media (min-width: 1400px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

.card {
    position: relative;
    min-width: 0;
    animation: rise .5s var(--ease) both;
    animation-delay: calc(min(var(--i, 0), 12) * 35ms);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
}

.card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface-2);
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}

@media (hover: hover) {
    .card:hover .card__media img, .card:hover .poster__text { transform: scale(1.045); }
}

.card__time {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 5px 7px 4px;
    border-radius: 5px;
    background: var(--lime);
    color: var(--coal);
    font-size: 11.5px;
    font-weight: 700;
    font-stretch: 78%;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.card__lock {
    position: absolute;
    left: 8px;
    top: 8px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgb(14 14 12 / .72);
    color: #fff;
}

.card__lock .icon { width: 15px; height: 15px; }

.card .fav {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 38px;
    height: 38px;
}

.card .fav .icon { width: 19px; height: 19px; }

.card__title {
    margin-top: 11px;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.22;
    letter-spacing: -.01em;
    text-wrap: pretty;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.card__title a { text-decoration: none; }

/* The whole card is the link */
.card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--r);
}

.card__title a:focus-visible { outline: none; }

.card:has(.card__title a:focus-visible) .card__media { outline: 2px solid var(--ink); outline-offset: 3px; }

.card__meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    color: var(--ink-2);
}

.card__meta span { display: inline-flex; align-items: center; gap: 6px; }

.card__meta span + span { color: var(--ink-3); }

.card__meta .chip__dot { width: 7px; height: 7px; border-radius: 2px; }

/* Poster: typographic stand-in for recipes without a photo */
.poster {
    position: relative;
    width: 100%;
    height: 100%;
    container-type: inline-size;
    overflow: hidden;
    background-color: var(--tone, var(--tone-x));
    background-image: radial-gradient(rgb(14 14 12 / .13) 1px, transparent 1.3px);
    background-size: 7px 7px;
    color: var(--coal);
}

.poster {
    display: flex;
    align-items: flex-end;
}

.poster__text {
    display: block;
    width: 100%;
    padding: 0 7cqi 22cqi;
    font-size: 23cqi;
    font-weight: 900;
    font-stretch: 72%;
    line-height: .86;
    letter-spacing: -.01em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    hyphens: auto;
    transform-origin: 0 100%;
    transition: transform .6s var(--ease);
}

.poster--long .poster__text { font-size: 18cqi; }

.poster--xlong .poster__text { font-size: 14cqi; }

.poster__glyph {
    position: absolute;
    right: 6cqi;
    bottom: 5cqi;
    font-size: 9cqi;
    font-weight: 700;
    font-stretch: 100%;
    opacity: .7;
}

/* 7. Recipe page --------------------------------------------------------- */

.recipe { padding-bottom: 24px; }

.hero {
    position: relative;
    margin-inline: calc(var(--gutter) * -1);
    background: var(--surface-2);
}

.hero__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    aspect-ratio: 4 / 3.4;
}

.hero__track::-webkit-scrollbar { display: none; }

.hero__slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    display: block;
    cursor: zoom-in;
}

.hero__slide img { width: 100%; height: 100%; object-fit: cover; }

.hero .poster__text { font-size: 17cqi; padding: 0 6cqi 10cqi; }

.hero .poster--long .poster__text { font-size: 13cqi; }

.hero .poster--xlong .poster__text { font-size: 10cqi; }

/* Mobile: the photo runs to the top edge, the hero bar replaces the top bar */
@media (max-width: 959px) {
    .is-recipe .topbar { display: none; }
}

.hero__bar {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    inset-inline: 12px;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.hero__bar > * { pointer-events: auto; }

.hero__bar .spacer { flex: 1; pointer-events: none; }

.hero__dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    translate: -50% 0;
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgb(14 14 12 / .45);
    backdrop-filter: blur(8px);
}

.hero__dots i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgb(255 255 255 / .5);
    transition: width .25s var(--ease), background .25s;
}

.hero__dots i.is-active { width: 18px; background: #fff; }

.hero__thumbs { display: none; }

.recipe__head { padding-top: 22px; }

.recipe__kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    color: var(--ink-2);
}

.recipe__kicker a { text-decoration: none; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }

.recipe__kicker .icon { width: 14px; height: 14px; }

.recipe__title {
    margin-top: 14px;
    font-size: clamp(36px, 10.5vw, 76px);
    font-weight: 850;
    font-stretch: 118%;
    line-height: .92;
    letter-spacing: -.04em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.recipe__by {
    margin-top: 14px;
    color: var(--ink-2);
    font-size: 15px;
}

.recipe__by a { color: var(--ink); font-weight: 600; text-decoration: none; }

.recipe__by a:hover { text-decoration: underline; }

/* The ticket: time / portions / ingredient count */
.ticket {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr;
    border-block: 1px solid var(--ink);
}

.ticket > div {
    padding: 12px 0 14px;
    display: grid;
    gap: 6px;
    align-content: start;
}

.ticket > div + div { padding-left: 14px; border-left: 1px dashed var(--line-strong); }

.ticket dt { color: var(--ink-2); }

.ticket dd {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 28px;
    font-weight: 800;
    font-stretch: 112%;
    letter-spacing: -.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ticket dd small {
    font-size: 13px;
    font-weight: 600;
    font-stretch: 90%;
    letter-spacing: 0;
    color: var(--ink-2);
}

.ticket .stepper { gap: 8px; align-items: center; }

.ticket .stepper output { min-width: 1.2ch; text-align: center; }

.recipe__actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recipe__body {
    margin-top: 36px;
    display: grid;
    gap: 40px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ink);
}

.section-head .meta { color: var(--ink-2); }

.recipe__foot {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    color: var(--ink-3);
}

.recipe__foot a { color: var(--ink); }

.wake {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px 0 10px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
}

.wake .icon { width: 17px; height: 17px; }

.wake[aria-pressed="true"] { background: var(--lime); color: var(--coal); }

@media (min-width: 960px) {
    .recipe { padding-top: 40px; }

    .recipe__top {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 48px;
        align-items: end;
    }

    .hero { margin: 0; border-radius: var(--r-lg); overflow: hidden; }

    .hero__track { aspect-ratio: 5 / 4; }

    .hero__bar { top: 14px; inset-inline: 14px; }

    .hero__bar .back { visibility: hidden; }

    .hero__thumbs {
        display: flex;
        gap: 8px;
        margin-top: 10px;
    }

    .hero__thumbs button {
        width: 64px;
        height: 64px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        overflow: hidden;
        opacity: .5;
        transition: opacity .15s;
    }

    .hero__thumbs button[aria-current="true"], .hero__thumbs button:hover { opacity: 1; }

    .hero__thumbs img { width: 100%; height: 100%; object-fit: cover; }

    .recipe__head { padding-top: 0; padding-bottom: 6px; }

    .recipe__body {
        grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
        gap: 64px;
        margin-top: 64px;
        align-items: start;
    }

    .recipe__aside { position: sticky; top: 28px; }
}

@media (min-width: 1400px) {
    .recipe__body { grid-template-columns: 400px minmax(0, 820px); }
}

/* 8. Ingredients & steps ------------------------------------------------- */

.ing {
    margin-top: 4px;
    display: grid;
    grid-template-columns: 20px fit-content(42%) minmax(0, 1fr);
    column-gap: 14px;
}

.ing li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }

.ing li + li { border-top: 1px dashed var(--line-strong); }

.tick {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: baseline;
    padding: 13px 0;
    cursor: pointer;
    font-size: 16.5px;
    line-height: 1.35;
    user-select: none;
    -webkit-user-select: none;
}

.tick input { position: absolute; opacity: 0; pointer-events: none; }

.tick__box {
    width: 20px;
    height: 20px;
    align-self: center;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1.5px var(--line-strong);
    display: grid;
    place-items: center;
    transition: background .15s, box-shadow .15s;
}

.tick__box .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; color: var(--coal); }

.tick:has(input:checked) .tick__box { background: var(--lime); box-shadow: none; }

.tick:has(input:checked) .tick__box .icon { opacity: 1; }

.tick:has(input:focus-visible) .tick__box { outline: 2px solid var(--ink); outline-offset: 2px; }

.tick__qty {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.tick__qty b { font-weight: 800; }

.tick__qty b.is-changed { color: var(--ink); background: var(--lime); border-radius: 3px; padding: 0 3px; margin: 0 -3px; }

.tick__qty small { font-size: 1em; font-weight: 500; color: var(--ink-2); }

.tick__name { overflow-wrap: anywhere; hyphens: auto; }

.tick:has(input:checked) :is(.tick__qty, .tick__name) {
    color: var(--ink-3);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.supplies { margin-top: 32px; }

.supplies .chips { margin-top: 14px; }

/* Equipment names can be long ("Tortenbodenform mit herausnehmbarem Boden"): wrap inside the column */
.supplies .chip {
    cursor: default;
    max-width: 100%;
    height: auto;
    min-height: 38px;
    padding-block: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.supplies .chip:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }

.steps__list { counter-reset: step; }

.step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 18px 0;
    cursor: pointer;
}

.steps__list li + li .step { border-top: 1px dashed var(--line-strong); }

.step input { position: absolute; opacity: 0; pointer-events: none; }

.step__n {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1.5px var(--ink);
    font-size: 14px;
    font-weight: 800;
    font-stretch: 112%;
    font-variant-numeric: tabular-nums;
    transition: background .2s, box-shadow .2s;
}

.step__n .icon { display: none; width: 18px; height: 18px; stroke-width: 3; }

.step__text {
    padding-top: 5px;
    font-size: 17.5px;
    line-height: 1.6;
    text-wrap: pretty;
    overflow-wrap: anywhere;
    transition: color .2s;
}

.step:has(input:checked) .step__n { background: var(--lime); box-shadow: none; color: var(--coal); }

.step:has(input:checked) .step__n span { display: none; }

.step:has(input:checked) .step__n .icon { display: block; }

.step:has(input:checked) .step__text { color: var(--ink-3); }

.step:has(input:focus-visible) .step__n { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (min-width: 960px) {
    .step { grid-template-columns: 52px 1fr; gap: 18px; padding: 22px 0; }
    .step__n { width: 44px; height: 44px; font-size: 16px; }
    .step__text { font-size: 19px; padding-top: 8px; }
}

/* 9. Lightbox ------------------------------------------------------------ */

.lightbox {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(8 8 7 / .96);
    color: #fff;
}

.lightbox::backdrop { background: transparent; }

.lightbox[open] { animation: fade .2s ease both; }

@keyframes fade { from { opacity: 0; } }

.lightbox__track {
    height: 100%;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.lightbox__track::-webkit-scrollbar { display: none; }

.lightbox__track figure {
    flex: 0 0 100%;
    scroll-snap-align: center;
    display: grid;
    place-items: center;
    padding: 64px 12px;
}

.lightbox__track img { max-height: 100%; width: auto; object-fit: contain; border-radius: 4px; }

.lightbox__bar {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    inset-inline: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lightbox__count { color: #bbb; }

.lightbox__nav {
    position: fixed;
    top: 50%;
    translate: 0 -50%;
}

.lightbox__nav--prev { left: 16px; }

.lightbox__nav--next { right: 16px; }

@media (hover: none) {
    .lightbox__nav { display: none; }
}

/* 10. Search ------------------------------------------------------------- */

.search-form { display: grid; gap: 14px; }

.advanced {
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}

.advanced summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.advanced summary::-webkit-details-marker { display: none; }

.advanced summary .icon { transition: transform .2s var(--ease); }

.advanced[open] summary .icon { transform: rotate(180deg); }

.advanced__body {
    display: grid;
    gap: 14px;
    padding: 4px 16px 16px;
}

@media (min-width: 720px) {
    .advanced__body { grid-template-columns: repeat(2, 1fr); }
    .advanced__body .btn { justify-self: start; }
}

.results-head { margin: 26px 0 10px; color: var(--ink-2); }

.results-head strong { color: var(--ink); }

/* 11. Editor ------------------------------------------------------------- */

.editor {
    max-width: 980px;
    padding-bottom: 40px;
}

.editor__name {
    width: 100%;
    padding: 6px 0 10px;
    border: 0;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    background: transparent;
    font-size: clamp(30px, 8vw, 52px);
    font-weight: 850;
    font-stretch: 118%;
    letter-spacing: -.035em;
    line-height: 1.05;
    field-sizing: content;
    resize: none;
}

.editor__name::placeholder { color: var(--ink-3); opacity: .55; }

.editor__name:focus { outline: none; border-bottom-color: var(--lime-deep); }

.esec {
    display: grid;
    gap: 16px;
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
}

.esec__head .h2 { font-size: 19px; }

.esec__head p { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; max-width: 34ch; }

.esec__body { display: grid; gap: 18px; min-width: 0; }

@media (min-width: 840px) {
    .esec {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 40px;
        padding: 40px 0;
    }
}

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.affix { position: relative; }

.affix .input { padding-right: 56px; }

.affix__text {
    position: absolute;
    right: 14px;
    top: 50%;
    translate: 0 -50%;
    color: var(--ink-3);
    pointer-events: none;
}

/* Repeatable rows (ingredients, supplies) */
.rows { display: grid; gap: 8px; }

.row {
    display: grid;
    grid-template-columns: 64px 76px minmax(0, 1fr) 40px;
    gap: 6px;
    align-items: center;
}

.row--single { grid-template-columns: minmax(0, 1fr) 40px; }

.row .input { min-height: 46px; padding: 10px 11px; border-radius: 9px; }

.row__remove {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink-3);
}

.row__remove:hover { background: var(--surface-2); color: var(--danger); }

.rows__head {
    display: grid;
    grid-template-columns: 64px 76px 1fr 40px;
    gap: 6px;
    padding-inline: 2px;
    color: var(--ink-3);
}

.row.is-new { animation: rise .3s var(--ease) both; }

@media (min-width: 640px) {
    .row, .rows__head { grid-template-columns: 90px 110px minmax(0, 1fr) 40px; gap: 8px; }
}

.add-row {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px 0 10px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: none;
    font-size: 14px;
    font-weight: 600;
}

.add-row:hover { border-color: var(--ink); border-style: solid; }

/* Name and unit suggestions under a row field (app.js replaces the native datalist popup) */
[data-editor] { position: relative; }

.suggest {
    position: absolute;
    z-index: 50; /* above the save bar */
    max-height: 320px;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--ink);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 18px 40px -18px rgb(0 0 0 / .45);
    animation: suggest-in .15s var(--ease) both;
}

.suggest.is-up { animation-name: suggest-in-up; }

.suggest li {
    padding: 11px 12px;
    border-radius: 7px;
    font-size: 16px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.suggest li + li { border-top: 1px solid var(--line); }

.suggest li:hover { background: var(--surface-2); }

.suggest li[aria-selected="true"] { background: var(--lime); color: var(--coal); border-color: transparent; }

.suggest li[aria-selected="true"] + li { border-color: transparent; }

.suggest mark { background: none; color: inherit; font-weight: 750; }

@keyframes suggest-in { from { opacity: 0; transform: translateY(-4px); } }

@keyframes suggest-in-up { from { opacity: 0; transform: translateY(4px); } }

/* Photos */
.drop {
    position: relative;
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 140px;
    padding: 20px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--r-lg);
    text-align: center;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.drop:hover, .drop.is-over { border-color: var(--ink); background: var(--surface); }

.drop strong { color: var(--ink); display: block; }

.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.drop:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}

.thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-2);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s, filter .2s; }

.thumb__x {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgb(14 14 12 / .72);
    color: #fff;
    cursor: pointer;
}

.thumb__x .icon { width: 16px; height: 16px; }

.thumb__x input { position: absolute; opacity: 0; pointer-events: none; }

.thumb:has(input:checked) img { opacity: .35; filter: grayscale(1); }

.thumb:has(input:checked) .thumb__x { background: var(--danger); }

.thumb__flag {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 5px 6px;
    background: var(--danger);
    color: #fff;
    text-align: center;
    display: none;
}

.thumb:has(input:checked) .thumb__flag { display: block; }

.thumb__badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--lime);
    color: var(--coal);
}

/* Sticky save bar */
.savebar {
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
}

.savebar .btn--lime { flex: 1; max-width: 260px; }

/* On the editor the save bar takes the dock's place */
.is-editor .dock { display: none; }

.is-editor .main { padding-bottom: 0; }

.danger-zone {
    margin-top: 36px;
    padding: 20px;
    border-radius: var(--r-lg);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 40%, transparent);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    max-width: 980px;
    margin-bottom: 120px;
}

.danger-zone p { color: var(--ink-2); font-size: 14.5px; }

/* 12. Auth, profile, users ---------------------------------------------- */

.auth {
    display: grid;
    margin: 8px auto 0;
    max-width: 1100px;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}

.auth__art {
    position: relative;
    min-height: 150px;
    padding: 22px;
    display: flex;
    align-items: flex-end;
    background-color: var(--lime);
    background-image: radial-gradient(rgb(14 14 12 / .14) 1px, transparent 1.3px);
    background-size: 7px 7px;
    color: var(--coal);
    overflow: hidden;
}

.auth__art p {
    font-size: clamp(40px, 13vw, 92px);
    font-weight: 900;
    font-stretch: 72%;
    line-height: .84;
    text-transform: uppercase;
    letter-spacing: -.01em;
}

.auth__form {
    padding: 28px 20px 32px;
    display: grid;
    gap: 18px;
    align-content: start;
}

.auth__form .display { font-size: clamp(34px, 9vw, 52px); }

.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 14.5px; color: var(--ink-2); }

@media (min-width: 840px) {
    .auth { grid-template-columns: 1fr 1fr; min-height: min(640px, 80dvh); margin-top: 48px; }
    .auth__art { padding: 36px; }
    .auth__form { padding: 56px 52px; align-content: center; }
}

.panel {
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}

.narrow { max-width: 560px; }

.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-card .avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--lime);
    color: var(--coal);
    font-size: 28px;
}

.theme-pick { display: grid; gap: 12px; margin-top: 16px; }

.theme-pick .segmented { display: grid; }

.theme-pick .segmented label { padding-inline: 8px; }

.profile-card strong { display: block; font-size: 20px; font-weight: 750; line-height: 1.2; }

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.stat {
    padding: 16px;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    text-decoration: none;
    transition: box-shadow .15s;
}

.stat:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.stat b {
    display: block;
    margin-top: 10px;
    font-size: 40px;
    font-weight: 850;
    font-stretch: 118%;
    letter-spacing: -.04em;
    line-height: 1;
}

.stat .label { color: var(--ink-2); }

.menu {
    margin-top: 16px;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    overflow: hidden;
}

.menu > * + * { border-top: 1px solid var(--line); }

.menu a, .menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 0 16px;
    border: 0;
    background: none;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
}

.menu a:hover, .menu button:hover { background: var(--surface-2); }

.menu .chev { margin-left: auto; color: var(--ink-3); }

.menu .is-danger { color: var(--danger); }

.ulist { display: grid; gap: 8px; }

.urow {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 12px 12px 14px;
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}

.urow .avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 17px; }

.urow__main { min-width: 0; }

.urow__name { display: flex; align-items: center; gap: 8px; font-weight: 650; }

.urow__mail { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.urow__end { display: flex; align-items: center; gap: 6px; }

.tag {
    display: inline-block;
    padding: 4px 6px 3px;
    border-radius: 4px;
    background: var(--lime);
    color: var(--coal);
    font-size: 10.5px;
}

.urow__count { color: var(--ink-2); margin-right: 6px; white-space: nowrap; }

@media (max-width: 559px) {
    .urow__count { display: none; }
}

.form-stack { display: grid; gap: 18px; }

/* 13. Toasts, empty states, errors -------------------------------------- */

.toasts {
    position: fixed;
    z-index: 90;
    top: calc(12px + env(safe-area-inset-top));
    inset-inline: 12px;
    display: grid;
    justify-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--coal);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 16px 40px -16px rgb(0 0 0 / .6);
    pointer-events: auto;
    animation: toast-in .4s var(--ease) both, toast-out .4s ease 5s forwards;
}

.toast .icon { color: var(--lime); }

.toast--error .icon { color: var(--chili); }

@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

@keyframes toast-out { to { opacity: 0; transform: translateY(-14px); visibility: hidden; } }

.empty {
    margin-top: 12px;
    padding: 48px 20px;
    border-radius: var(--r-lg);
    border: 1.5px dashed var(--line-strong);
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 10px;
}

.empty__big {
    font-size: 64px;
    font-weight: 900;
    font-stretch: 72%;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -.01em;
}

.empty p { color: var(--ink-2); max-width: 36ch; }

.empty .btn { margin-top: 8px; }

.error-page {
    min-height: 60dvh;
    display: grid;
    align-content: center;
    gap: 18px;
    padding-block: 40px;
}

.error-page .display { font-size: clamp(96px, 34vw, 260px); line-height: .8; }

.error-page .display span { color: var(--lime-deep); }

/* 14. Motion ------------------------------------------------------------- */

@view-transition { navigation: auto; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

::view-transition-group(*) { animation-timing-function: var(--ease); animation-duration: .38s; }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }

    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
    }
}
