:root {
    --bg: #0c1114;
    --bg-soft: #12191d;
    --panel: #172126;
    --panel-2: #1d2a30;
    --line: #2c3c43;
    --text: #f5f7f7;
    --muted: #9dafb7;
    --primary: #87e65d;
    --primary-dark: #173711;
    --danger: #ff7c7c;
    --warning: #ffd27a;
    --radius: 22px;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(99, 214, 83, 0.08), transparent 34rem),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
.button {
    touch-action: manipulation;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    padding:
        max(14px, env(safe-area-inset-top))
        max(24px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(12, 17, 20, 0.88);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: var(--primary);
    color: #102009;
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 8px 28px rgba(135, 230, 93, 0.22);
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.desktop-nav {
    display: flex;
    gap: 8px;
}

.desktop-nav a {
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--muted);
}

.desktop-nav a:hover {
    background: var(--panel);
    color: var(--text);
}

.page-shell {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: 38px 0 110px;
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin: 8px 0 30px;
    padding: 38px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(125deg, rgba(135, 230, 93, 0.14), transparent 55%),
        var(--panel);
    box-shadow: var(--shadow);
}

.hero.small {
    padding: 28px 32px;
}

.hero h1,
.form-header h1,
.recipe-header h1 {
    margin: 6px 0 10px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.hero.small h1,
.form-header h1 {
    font-size: clamp(34px, 4vw, 50px);
}

.hero p,
.form-header p,
.recipe-header p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.searchbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 28px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    background: #0f161a;
    color: var(--text);
}

input,
select {
    min-height: 48px;
    padding: 0 14px;
}

textarea {
    padding: 14px;
    line-height: 1.55;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(135, 230, 93, 0.12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition:
        transform 0.16s ease,
        filter 0.16s ease,
        background 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.button-primary {
    background: var(--primary);
    color: var(--primary-dark);
}

.button-secondary {
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
}

.button-danger {
    border: 1px solid rgba(255, 124, 124, 0.3);
    background: rgba(255, 124, 124, 0.08);
    color: var(--danger);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin: 30px 0 18px;
}

.section-heading.compact {
    align-items: center;
    margin: 0 0 18px;
}

.section-heading h2,
.panel h2 {
    margin: 5px 0 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.recipe-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.recipe-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 190px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.1), transparent 22%),
        linear-gradient(145deg, #26383d, #172125);
}

.recipe-visual > span {
    font-size: 82px;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28));
}

.select-recipe {
    position: absolute;
    top: 14px;
    right: 14px;
    cursor: pointer;
}

.select-recipe input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.select-recipe span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    background: rgba(12, 17, 20, 0.66);
    color: transparent;
    font-size: 22px;
    font-weight: 900;
    backdrop-filter: blur(8px);
}

.select-recipe input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-dark);
}

.recipe-card-body {
    padding: 20px;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.recipe-meta span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
}

.recipe-card h3 {
    margin: 14px 0 8px;
    font-size: 23px;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.recipe-card p {
    min-height: 70px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.portion-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.portion-control label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stepper {
    display: grid;
    grid-template-columns: 38px 52px 38px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.stepper.large {
    grid-template-columns: 46px 70px 46px;
}

.stepper button,
.stepper input {
    min-height: 38px;
    border: 0;
    border-radius: 0;
    background: #10171a;
    color: var(--text);
    text-align: center;
}

.stepper input {
    padding: 0;
    appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
    appearance: none;
}

.stepper button {
    cursor: pointer;
    color: var(--primary);
    font-size: 18px;
    font-weight: 900;
}

.card-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary);
    font-weight: 800;
}

.shopping-action {
    position: sticky;
    bottom: 18px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 720px;
    margin: 30px auto 0;
    padding: 14px 14px 14px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(23, 33, 38, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    opacity: 0.55;
}

.shopping-action.active {
    opacity: 1;
}

.shopping-action strong,
.shopping-action small {
    display: block;
}

.shopping-action small {
    margin-top: 3px;
    color: var(--muted);
}

.panel {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.back-link {
    display: inline-flex;
    margin-bottom: 22px;
    color: var(--muted);
    font-weight: 750;
}

.back-link:hover {
    color: var(--text);
}

.recipe-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 34px;
    align-items: center;
    margin-bottom: 24px;
}

.detail-visual {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 34px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.1), transparent 25%),
        linear-gradient(145deg, #293d42, #172125);
    font-size: 120px;
    box-shadow: var(--shadow);
}

.header-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ingredient-list {
    display: grid;
    gap: 8px;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #11191d;
}

.ingredient-row > span:last-child {
    color: var(--muted);
    text-align: right;
}

.ingredient-check {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(135, 230, 93, 0.12);
    color: var(--primary);
    font-weight: 900;
}

.instructions {
    counter-reset: instruction;
}

.instructions p {
    position: relative;
    margin: 0;
    padding: 14px 0 14px 44px;
    border-bottom: 1px solid var(--line);
    color: #d7e0e4;
    line-height: 1.55;
}

.instructions p:last-child {
    border-bottom: 0;
}

.instructions p::before {
    counter-increment: instruction;
    content: counter(instruction);
    position: absolute;
    left: 0;
    top: 11px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
}

.bring-panel {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 0.8fr);
    gap: 34px;
    margin-top: 20px;
}

.bring-panel p,
.muted {
    color: var(--muted);
}

.bring-form,
.plan-options {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #dbe4e7;
    font-size: 13px;
    font-weight: 760;
}

.checkbox-box {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
    cursor: pointer;
}

.checkbox-box input {
    width: 20px;
    min-height: 20px;
    margin: 2px 0 0;
    accent-color: var(--primary);
}

.checkbox-box span {
    display: grid;
    gap: 3px;
}

.checkbox-box small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.4;
}

.form-header {
    margin-bottom: 24px;
}

.recipe-form {
    display: grid;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.ingredient-editor,
.instruction-editor,
.plan-editor {
    min-height: 280px;
    margin-top: 14px;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.instruction-editor {
    min-height: 230px;
    font-family: inherit;
}

.plan-editor {
    min-height: 370px;
}

.format-help {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
}

code {
    overflow-wrap: anywhere;
    color: #b8f59d;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.selected-recipes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.selected-chip {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 9px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.selected-chip > span {
    grid-row: span 2;
    font-size: 26px;
}

.selected-chip small {
    color: var(--muted);
}

.notice,
.flash {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel);
}

.notice a {
    color: var(--primary);
    font-weight: 800;
}

.notice-warning {
    border-color: rgba(255, 210, 122, 0.32);
    color: var(--warning);
}

.notice-error,
.flash-error {
    border-color: rgba(255, 124, 124, 0.32);
    background: rgba(255, 124, 124, 0.08);
    color: #ffc1c1;
}

.flash-success {
    border-color: rgba(135, 230, 93, 0.32);
    background: rgba(135, 230, 93, 0.08);
    color: #c9ffb2;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px;
}

.status-card strong,
.status-card small {
    display: block;
}

.status-card small {
    margin-top: 3px;
    color: var(--muted);
}

.status-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.04);
}

.status-dot.ok {
    background: var(--primary);
}

.status-dot.bad {
    background: var(--danger);
}

.path-list,
.simple-list {
    display: grid;
    gap: 10px;
}

.path-list > div,
.simple-list > div {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.empty-state {
    padding: 60px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    text-align: center;
}

.empty-state > span {
    font-size: 64px;
}

.empty-state h2 {
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--muted);
}

.mobile-nav {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

@media (max-width: 960px) {
    .recipe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recipe-header {
        grid-template-columns: 220px 1fr;
    }

    .detail-layout,
    .bring-panel {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .topbar {
        min-height: 68px;
        padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    }

    .brand small,
    .desktop-nav {
        display: none;
    }

    .page-shell {
        width: min(100% - 22px, 1180px);
        padding-top: 20px;
        padding-bottom: 120px;
    }

    .hero,
    .hero.small {
        display: grid;
        padding: 24px 20px;
        border-radius: 22px;
    }

    .hero h1,
    .form-header h1,
    .recipe-header h1 {
        font-size: 38px;
    }

    .searchbar {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: center;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-visual {
        min-height: 160px;
    }

    .recipe-card p {
        min-height: auto;
    }

    .shopping-action {
        bottom: 82px;
        margin-top: 18px;
        padding: 11px 11px 11px 14px;
        border-radius: 17px;
    }

    .shopping-action small {
        display: none;
    }

    .recipe-header {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .detail-visual {
        aspect-ratio: 16 / 9;
        font-size: 88px;
    }

    .detail-layout {
        gap: 14px;
    }

    .panel {
        padding: 19px;
        border-radius: 19px;
    }

    .section-heading.compact {
        align-items: flex-start;
    }

    .ingredient-row {
        grid-template-columns: 30px 1fr auto;
        padding: 8px;
    }

    .bring-panel {
        gap: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .desktop-only {
        display: none;
    }

    .mobile-nav {
        position: fixed;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        left: 10px;
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 20px;
        background: rgba(23, 33, 38, 0.94);
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
    }

    .mobile-nav a {
        display: grid;
        justify-items: center;
        gap: 3px;
        padding: 6px 2px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 750;
    }

    .mobile-nav span {
        color: var(--text);
        font-size: 20px;
    }

    .plan-editor {
        min-height: 420px;
        font-size: 14px;
    }
}


.import-editor {
    min-height: 520px;
    margin-top: 14px;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    tab-size: 2;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.radio-box {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #10171a;
    cursor: pointer;
}

.radio-box input {
    width: 20px;
    min-height: 20px;
    margin: 2px 0 0;
    accent-color: var(--primary);
}

.radio-box span {
    display: grid;
    gap: 4px;
}

.radio-box small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.4;
}

@media (max-width: 760px) {
    .radio-grid {
        grid-template-columns: 1fr;
    }

    .import-editor {
        min-height: 460px;
        font-size: 13px;
    }
}


.random-picker-panel {
    display: grid;
    grid-template-columns: 1fr minmax(330px, 0.7fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(120deg, rgba(135, 230, 93, 0.08), transparent 60%),
        var(--panel);
    box-shadow: var(--shadow);
}

.random-picker-panel h2 {
    margin: 5px 0 8px;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.random-picker-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.random-picker-form {
    display: grid;
    gap: 9px;
}

.random-picker-controls {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
}

.random-day-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.random-day-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.random-day-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 170px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.11), transparent 24%),
        linear-gradient(145deg, #293d42, #172125);
}

.random-day-emoji {
    font-size: 78px;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.26));
}

.day-label {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(12, 17, 20, 0.72);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.random-day-body {
    padding: 19px;
}

.random-day-body h2 {
    margin: 13px 0 8px;
    font-size: 23px;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.random-day-body > p {
    min-height: 70px;
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.random-day-actions {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 9px;
    margin-top: 15px;
}

.random-day-actions .button {
    padding: 0 10px;
}

.random-plan-actions {
    position: sticky;
    bottom: 18px;
    z-index: 40;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 28px auto 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: rgba(23, 33, 38, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

@media (max-width: 960px) {
    .random-picker-panel {
        grid-template-columns: 1fr;
    }

    .random-day-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .random-picker-panel {
        gap: 18px;
        padding: 20px;
        border-radius: 19px;
    }

    .random-picker-controls {
        grid-template-columns: 1fr;
    }

    .random-picker-controls .stepper {
        width: 100%;
        grid-template-columns: 1fr 1.3fr 1fr;
    }

    .random-day-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .random-day-visual {
        min-height: 145px;
    }

    .random-day-body > p {
        min-height: auto;
    }

    .random-plan-actions {
        bottom: 82px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 10px;
    }

    .random-plan-actions .button:last-child {
        grid-column: span 2;
    }

    .mobile-nav {
        grid-template-columns: repeat(5, 1fr);
    }

    .mobile-nav a {
        font-size: 10px;
    }
}


.category-menu {
    position: relative;
}

.category-menu > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.category-menu > summary::-webkit-details-marker {
    display: none;
}

.category-menu > summary:hover,
.category-menu[open] > summary {
    background: var(--panel);
    color: var(--text);
}

.category-caret {
    font-size: 12px;
    transition: transform 0.16s ease;
}

.category-menu[open] .category-caret {
    transform: rotate(180deg);
}

.category-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 100;
    width: min(390px, calc(100vw - 28px));
    max-height: min(70vh, 620px);
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: rgba(23, 33, 38, 0.98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.category-popover-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 4px 5px 12px;
    border-bottom: 1px solid var(--line);
}

.category-popover-heading strong,
.category-popover-heading small {
    display: block;
}

.category-popover-heading small {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 500;
}

.category-popover-heading > a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 850;
}

.category-tree {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-tree .category-tree {
    margin: 4px 0 2px 14px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
}

.category-tree a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 7px 9px;
    border-radius: 10px;
    color: #dce5e8;
    font-size: 14px;
    font-weight: 720;
}

.category-tree a:hover,
.category-tree a.active {
    background: rgba(135, 230, 93, 0.1);
    color: var(--primary);
}

.category-tree small {
    display: grid;
    place-items: center;
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 11px;
}

.category-empty {
    margin: 8px;
    color: var(--muted);
}

.mobile-category-menu {
    display: none;
}

.mobile-category-menu > summary {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    color: var(--text);
    font-size: 22px;
}

.category-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: -8px 0 24px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--panel);
}

.category-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    color: var(--muted);
}

.category-breadcrumbs a:hover,
.category-breadcrumbs a.current {
    color: var(--primary);
}

.recipe-category-link {
    color: inherit;
}

.recipe-category-link:hover {
    color: var(--primary);
}

.field-help {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.45;
}

@media (max-width: 680px) {
    .mobile-category-menu {
        display: block;
    }

    .mobile-category-menu .category-popover {
        position: fixed;
        top: 75px;
        right: 11px;
        left: 11px;
        width: auto;
        max-height: calc(100vh - 170px);
    }

    .category-filter-bar {
        align-items: flex-start;
        margin-top: -5px;
        padding: 14px;
    }

    .category-filter-bar .button {
        min-height: 42px;
        padding: 0 12px;
        white-space: nowrap;
    }
}

/* ==========================================================
   Vollausbau: Filter, Kalender, Vorrat, Standardartikel, PWA
   ========================================================== */

.desktop-nav {
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-panel {
    display: grid;
    gap: 18px;
    margin-bottom: 26px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.filter-head h2 {
    margin: 5px 0 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.filter-groups,
.filter-group {
    display: grid;
    gap: 11px;
}

.filter-group > strong {
    color: #dce5e8;
    font-size: 13px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    display: inline-flex;
    cursor: pointer;
}

.filter-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.filter-chip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.filter-chip input:checked + span {
    border-color: rgba(135, 230, 93, 0.55);
    background: rgba(135, 230, 93, 0.13);
    color: var(--primary);
}

.filter-chip small {
    color: inherit;
    opacity: 0.72;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.filter-toggle {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
    cursor: pointer;
}

.filter-toggle input {
    width: 19px;
    min-height: 19px;
    accent-color: var(--primary);
}

.card-title-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 9px;
    align-items: start;
}

.favorite-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #10171a;
    color: var(--muted);
    cursor: pointer;
    font-size: 21px;
}

.favorite-button.active,
.favorite-button:hover {
    border-color: rgba(255, 124, 124, 0.45);
    color: #ff8e9c;
}

.rating-display,
.detail-rating {
    display: flex;
    gap: 2px;
    margin: 2px 0 11px;
}

.rating-display span {
    color: #3d4a4f;
}

.rating-display .filled,
.star-button.active {
    color: #ffd56a;
}

.star-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #3d4a4f;
    cursor: pointer;
    font-size: 25px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}

.tag-row a {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(135, 230, 93, 0.08);
    color: #b8f59d;
    font-size: 12px;
    font-weight: 750;
}

.selection-buttons {
    display: flex;
    gap: 9px;
}

.two-column-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1.35fr);
    gap: 20px;
    align-items: start;
}

.sticky-panel {
    position: sticky;
    top: 100px;
}

.stack-form,
.stack-actions {
    display: grid;
    gap: 13px;
}

.compact-grid {
    gap: 10px;
}

.editable-list {
    display: grid;
    gap: 10px;
}

.editable-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #10171a;
}

.editable-item.inactive {
    opacity: 0.55;
}

.editable-item-main strong,
.editable-item-main small {
    display: block;
}

.editable-item-main small {
    margin-top: 4px;
    color: var(--muted);
}

.select-box {
    position: relative;
    cursor: pointer;
}

.select-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.select-box span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: transparent;
}

.select-box input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-dark);
    font-weight: 900;
}

.inline-editor {
    position: relative;
}

.inline-editor > summary {
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
}

.inline-editor > summary::-webkit-details-marker {
    display: none;
}

.inline-editor[open] {
    grid-column: 1 / -1;
    width: 100%;
}

.inline-editor[open] > summary {
    margin-bottom: 10px;
    background: var(--panel-2);
}

.mini-form {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.compact-checkbox {
    align-self: end;
    min-height: 48px;
}

.status-pill {
    min-width: 76px;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(255, 124, 124, 0.1);
    color: #ffb5b5;
    font-size: 11px;
    font-weight: 850;
    text-align: center;
}

.status-pill.active {
    background: rgba(135, 230, 93, 0.11);
    color: var(--primary);
}

.send-dock {
    position: sticky;
    bottom: 18px;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    margin-top: 18px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(23, 33, 38, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.shopping-check-list {
    display: grid;
    gap: 8px;
}

.shopping-check-row {
    display: grid;
    grid-template-columns: 125px minmax(160px, 1.2fr) minmax(110px, 0.75fr) minmax(100px, 0.7fr);
    gap: 9px;
    align-items: center;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.shopping-check-row > small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.have-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.have-check input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--primary);
}

.standard-select-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.detail-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-action-grid form {
    display: grid;
    gap: 11px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #10171a;
}

.detail-actions-panel {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.planner-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.planner-header h1 {
    margin: 5px 0 0;
    font-size: clamp(38px, 5vw, 60px);
    letter-spacing: -0.045em;
}

.view-switch,
.planner-actions {
    display: flex;
    gap: 9px;
}

.calendar-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.calendar-nav a:last-child {
    text-align: right;
}

.calendar-nav a {
    color: var(--primary);
    font-weight: 780;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.day-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 390px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.day-card.today {
    border-color: rgba(135, 230, 93, 0.65);
    box-shadow: 0 0 0 2px rgba(135, 230, 93, 0.08), var(--shadow);
}

.day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.day-head span {
    color: var(--primary);
    font-weight: 850;
}

.planned-recipe {
    display: grid;
    gap: 5px;
    margin: 12px 0;
    padding: 11px;
    border-radius: 14px;
    background: rgba(135, 230, 93, 0.07);
}

.planned-recipe > span {
    font-size: 28px;
}

.planned-recipe h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
}

.planned-recipe small {
    color: var(--muted);
}

.day-card form {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.day-card label {
    font-size: 11px;
}

.day-card select,
.day-card input {
    min-height: 42px;
    padding: 0 9px;
    font-size: 12px;
}

.text-danger {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
}

.planner-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.month-calendar {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.month-weekdays,
.month-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.month-weekdays span {
    padding: 12px 8px;
    border-right: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.month-day {
    min-height: 128px;
    padding: 10px;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    transition: background 0.15s ease;
}

.month-day:hover {
    background: rgba(135, 230, 93, 0.07);
}

.month-day.outside {
    opacity: 0.32;
}

.month-day.today strong {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--primary-dark);
}

.month-day span {
    display: block;
    margin-top: 10px;
    color: #dce5e8;
    font-size: 12px;
    line-height: 1.3;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 20px;
    text-align: center;
}

.metric-card strong {
    color: var(--primary);
    font-size: 35px;
}

.metric-card span {
    color: var(--muted);
}

.settings-layout {
    margin-bottom: 20px;
}

.install-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: var(--primary-dark);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 850;
}

.offline-state {
    max-width: 620px;
    margin: 80px auto;
}

@media (max-width: 1120px) {
    .desktop-nav {
        gap: 2px;
    }

    .desktop-nav a,
    .desktop-nav summary {
        padding: 8px 9px;
        font-size: 13px;
    }

    .week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .day-card {
        min-height: 330px;
    }
}

@media (max-width: 780px) {
    .filter-row,
    .detail-action-grid,
    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .sticky-panel {
        position: static;
    }

    .standard-select-grid,
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shopping-check-row {
        grid-template-columns: 115px 1fr;
    }

    .shopping-check-row > small {
        grid-column: 2;
    }
}

@media (max-width: 680px) {
    .filter-panel {
        padding: 17px;
        border-radius: 19px;
    }

    .filter-head {
        align-items: flex-start;
    }

    .filter-head .button {
        min-height: 42px;
        padding: 0 11px;
    }

    .selection-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .shopping-action {
        display: grid;
    }

    .send-dock {
        bottom: 82px;
        grid-template-columns: 1fr;
    }

    .editable-item {
        grid-template-columns: auto 1fr;
    }

    .inline-editor {
        grid-column: 1 / -1;
    }

    .week-grid {
        grid-template-columns: 1fr;
    }

    .day-card {
        min-height: auto;
    }

    .calendar-nav {
        grid-template-columns: 1fr auto 1fr;
        padding: 11px;
        font-size: 12px;
    }

    .month-calendar {
        overflow-x: auto;
    }

    .month-weekdays,
    .month-week {
        min-width: 720px;
    }

    .month-day {
        min-height: 105px;
    }

    .planner-header {
        display: grid;
    }

    .view-switch .button {
        flex: 1;
    }

    .planner-actions {
        position: sticky;
        bottom: 82px;
        z-index: 30;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 17px;
        background: rgba(23, 33, 38, 0.95);
        box-shadow: var(--shadow);
    }

    .dashboard-grid,
    .standard-select-grid {
        grid-template-columns: 1fr;
    }

    .settings-layout {
        gap: 14px;
    }

    .shopping-check-row {
        grid-template-columns: 1fr;
    }

    .shopping-check-row > small {
        grid-column: auto;
    }

    .have-check {
        padding: 7px 0;
    }

    .install-button {
        right: 12px;
        bottom: 90px;
    }
}


/* ==========================================================
   Wochenplan: komplette KW gemeinsam bearbeiten und speichern
   ========================================================== */

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

.week-toolbar,
.week-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--panel);
}

.week-toolbar strong,
.week-toolbar small,
.week-save-bar strong,
.week-save-bar small {
    display: block;
}

.week-toolbar small,
.week-save-bar small {
    margin-top: 3px;
    color: var(--muted);
}

.week-toolbar .is-dirty,
.week-save-bar .is-dirty {
    color: var(--warning);
}

.week-toolbar .is-saving,
.week-save-bar .is-saving {
    color: var(--primary);
}

.planner-empty-day {
    display: grid;
    place-items: center;
    gap: 5px;
    min-height: 94px;
    margin: 12px 0;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.planner-empty-day > span {
    color: var(--primary);
    font-size: 24px;
    font-weight: 900;
}

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

.day-editor-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.day-editor-actions .button {
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
}

.week-save-bar {
    position: sticky;
    bottom: 18px;
    z-index: 35;
    margin-top: 6px;
    background: rgba(23, 33, 38, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.week-planner-form.is-dirty .week-save-bar {
    border-color: rgba(255, 210, 122, 0.45);
}

.week-planner-form.is-loading {
    pointer-events: none;
    opacity: 0.78;
}

.week-planner-form.is-loading [data-roll-week],
.week-planner-form.is-loading [data-roll-day] {
    cursor: wait;
}

@media (max-width: 680px) {
    .week-toolbar,
    .week-save-bar {
        display: grid;
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .week-toolbar .button,
    .week-save-bar .button {
        width: 100%;
    }

    .week-save-bar {
        bottom: 82px;
    }

    .day-editor-actions {
        grid-template-columns: 1fr auto;
    }

    .planner-actions {
        position: static;
        margin-top: 12px;
    }
}


/* DAILY_COMPANION_FEATURES */

/* Dashboard */
.dashboard-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        linear-gradient(125deg, rgba(135, 230, 93, 0.16), transparent 58%),
        var(--panel);
    box-shadow: var(--shadow);
}

.dashboard-hero h1 {
    margin: 6px 0 10px;
    font-size: clamp(36px, 5vw, 62px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
}

.dashboard-hero-actions,
.dashboard-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-metrics .metric-card {
    transition:
        transform 0.16s ease,
        border-color 0.16s ease;
}

.dashboard-metrics .metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(135, 230, 93, 0.38);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 20px;
}

.dashboard-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin: 18px 0;
}

.dashboard-day {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
    text-align: center;
}

.dashboard-day.today {
    border-color: var(--primary);
    background: rgba(135, 230, 93, 0.08);
}

.dashboard-day > span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.dashboard-day small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-list,
.dashboard-favorites {
    display: grid;
    gap: 8px;
}

.dashboard-list > div,
.dashboard-list > a,
.dashboard-favorites > a {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #10171a;
}

.dashboard-list small,
.dashboard-favorites small {
    color: var(--muted);
}

.dashboard-favorites > a {
    grid-template-columns: 40px 1fr;
}

.dashboard-favorites > a > span {
    grid-row: span 2;
    font-size: 28px;
}

.dashboard-empty {
    display: grid;
    justify-items: center;
    padding: 30px 10px;
    color: var(--muted);
    text-align: center;
}

.dashboard-empty > span {
    font-size: 36px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
}

.status-pill.confirmed {
    background: rgba(135, 230, 93, 0.13);
    color: var(--primary);
}

.status-pill.draft {
    background: rgba(255, 210, 122, 0.12);
    color: var(--warning);
}

/* Planner: special days, confirmation and ingredient reuse */
.week-state-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--panel);
}

.week-state-panel > div {
    display: grid;
    gap: 6px;
}

.week-state-panel small {
    color: var(--muted);
}

.week-toolbar {
    grid-template-columns: 1fr minmax(240px, 0.65fr) auto;
}

.compact-field {
    min-width: 0;
}

.compact-field select {
    min-height: 42px;
}

.reuse-result {
    padding: 12px 15px;
    border: 1px solid rgba(135, 230, 93, 0.28);
    border-radius: 14px;
    background: rgba(135, 230, 93, 0.08);
    color: #d6ffc4;
}

.day-editor [hidden] {
    display: none !important;
}

/* Cook mode */
.cook-mode {
    min-height: calc(100vh - 130px);
}

.cook-mode:fullscreen {
    overflow: auto;
    padding: 18px;
    background: var(--bg);
}

.cook-header {
    position: sticky;
    top: 78px;
    z-index: 35;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: rgba(23, 33, 38, 0.96);
    backdrop-filter: blur(18px);
}

.cook-header > div:nth-child(2) {
    display: grid;
    gap: 3px;
    text-align: center;
}

.cook-header small {
    color: var(--muted);
}

.cook-header-actions {
    display: flex;
    gap: 8px;
}

.cook-header-actions .button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
}

.cook-progress {
    height: 5px;
    overflow: hidden;
    background: var(--panel-2);
}

.cook-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--primary);
    transition: width 0.25s ease;
}

.cook-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.cook-ingredients,
.cook-step-stage {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.cook-ingredients {
    align-self: start;
    padding: 20px;
}

.cook-section-title h2 {
    margin: 5px 0 15px;
}

.cook-ingredient-list {
    display: grid;
    gap: 8px;
}

.cook-ingredient-list label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #10171a;
    cursor: pointer;
}

.cook-ingredient-list input,
.cook-step-done input {
    width: 22px;
    min-height: 22px;
    margin: 1px 0 0;
    accent-color: var(--primary);
}

.cook-ingredient-list span {
    display: grid;
    gap: 3px;
}

.cook-ingredient-list small {
    color: var(--muted);
}

.cook-ingredient-list input:checked + span {
    opacity: 0.5;
    text-decoration: line-through;
}

.cook-step-stage {
    display: grid;
    align-content: start;
    min-height: 560px;
    padding: 30px;
}

.cook-step {
    display: grid;
    align-content: center;
    min-height: 240px;
}

.cook-step-number {
    color: var(--primary);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cook-step p {
    margin: 18px 0 28px;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.24;
    letter-spacing: -0.025em;
}

.cook-step-done {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.cook-timer {
    display: grid;
    grid-template-columns: 1fr 150px auto;
    align-items: end;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #10171a;
}

.cook-timer > div:first-child {
    display: grid;
    gap: 4px;
}

.cook-timer [data-timer-display] {
    font-size: 42px;
    font-variant-numeric: tabular-nums;
}

.cook-timer-actions {
    display: flex;
    gap: 8px;
}

.cook-navigation {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.cook-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
}

.cook-dots button {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--line);
}

.cook-dots button.active {
    background: var(--primary);
    transform: scale(1.25);
}

.cook-finish {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.cook-finish form {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
}

.cook-finish label {
    max-width: 180px;
}

/* Cooking history and import preview */
.cooked-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.cooked-summary > div {
    min-width: 130px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #10171a;
}

.cooked-summary strong,
.cooked-summary small {
    display: block;
}

.cooked-summary small {
    margin-top: 3px;
    color: var(--muted);
}

.import-preview-card {
    display: grid;
    gap: 16px;
}

.import-warning-list {
    display: grid;
    gap: 7px;
}

.import-warning-list > div {
    padding: 10px 12px;
    border: 1px solid rgba(255, 210, 122, 0.28);
    border-radius: 12px;
    background: rgba(255, 210, 122, 0.07);
    color: #ffe0a1;
}

.import-clean {
    border-color: rgba(135, 230, 93, 0.28);
    color: #c9ffb2;
}

.preview-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.import-commit-bar {
    position: sticky;
    bottom: 18px;
    z-index: 35;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(23, 33, 38, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

/* Standard item recurrence */
.recurrence-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.recurrence-meta span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 11px;
}

.recurrence-meta .due-now {
    background: rgba(255, 210, 122, 0.12);
    color: var(--warning);
}

@media (max-width: 960px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-week {
        grid-template-columns: repeat(4, 1fr);
    }

    .cook-layout {
        grid-template-columns: 1fr;
    }

    .cook-ingredients {
        position: static;
    }

    .week-toolbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .dashboard-hero {
        display: grid;
        padding: 23px 20px;
        border-radius: 22px;
    }

    .dashboard-hero-actions {
        display: grid;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-week {
        grid-template-columns: repeat(2, 1fr);
    }

    .week-state-panel {
        display: grid;
    }

    .cook-header {
        top: 68px;
        grid-template-columns: 1fr auto;
    }

    .cook-header > a {
        grid-column: span 2;
        font-size: 13px;
    }

    .cook-header > div:nth-child(2) {
        text-align: left;
    }

    .cook-header-actions {
        justify-content: flex-end;
    }

    .cook-header-actions .button {
        max-width: 135px;
        min-height: 38px;
        padding: 0 9px;
        font-size: 11px;
    }

    .cook-step-stage {
        min-height: auto;
        padding: 20px;
    }

    .cook-step {
        min-height: 250px;
    }

    .cook-step p {
        font-size: 30px;
    }

    .cook-timer {
        grid-template-columns: 1fr 110px;
    }

    .cook-timer-actions {
        grid-column: span 2;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .cook-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .cook-dots {
        grid-column: span 2;
        grid-row: 1;
        flex-wrap: wrap;
    }

    .cook-finish form {
        display: grid;
    }

    .cook-finish label {
        max-width: none;
    }

    .preview-editor-grid {
        grid-template-columns: 1fr;
    }

    .import-commit-bar {
        bottom: 82px;
    }
}

/* ==========================================================
   Paarmodus / Essenstinder
   ========================================================== */

.pair-nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
}

.pair-nav-link small {
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(255, 92, 138, 0.13);
    color: #ff8faf;
    font-size: 10px;
}

.pair-setup-shell,
.pair-login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
    align-items: center;
    gap: 28px;
    min-height: calc(100vh - 170px);
}

.pair-intro-card,
.pair-login-heading {
    padding: 30px;
}

.pair-intro-card h1,
.pair-login-heading h1,
.pair-hero h1,
.pair-results-hero h1,
.pair-swipe-header h1 {
    margin: 7px 0 13px;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.pair-intro-card > p,
.pair-login-heading > p,
.pair-hero p,
.pair-results-hero p,
.pair-swipe-header p {
    max-width: 720px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}

.pair-feature-list {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.pair-feature-list > div {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 3px 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel);
}

.pair-feature-list > div > span {
    grid-row: span 2;
    font-size: 28px;
}

.pair-feature-list small {
    color: var(--muted);
}

.pair-setup-form,
.pair-login-form,
.pair-join-form {
    display: grid;
    gap: 16px;
}

.pair-profile-setup-card {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 92, 138, 0.25);
    border-radius: 14px;
    background: rgba(255, 92, 138, 0.06);
}

.pair-profile-setup-card.secondary {
    border-color: var(--line);
    background: #10171a;
}

.pair-profile-setup-card > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ff5c8a;
    color: white;
    font-weight: 900;
}

.pair-profile-setup-card strong,
.pair-profile-setup-card small {
    display: block;
}

.pair-profile-setup-card small {
    margin-top: 3px;
    color: var(--muted);
}

.pair-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pair-profile-choice {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 20px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #10171a;
    text-align: center;
    cursor: pointer;
}

.pair-profile-choice input {
    position: absolute;
    opacity: 0;
}

.pair-profile-choice:has(input:checked) {
    border-color: #ff5c8a;
    box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.12);
}

.pair-profile-choice small {
    color: var(--muted);
}

.pair-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5c8a, #ff9bb8);
    color: white;
    font-size: 20px;
    font-weight: 900;
}

.pair-join-form {
    max-width: 620px;
}

.pair-hero,
.pair-results-hero,
.pair-swipe-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        linear-gradient(120deg, rgba(255, 92, 138, 0.15), transparent 55%),
        var(--panel);
    box-shadow: var(--shadow);
}

.pair-hero-actions,
.pair-results-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.pair-household-bar {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
}

.pair-household-bar > div:first-child {
    display: grid;
    gap: 2px;
}

.pair-household-bar > div:first-child strong {
    font-size: 22px;
    letter-spacing: 0.12em;
}

.pair-member-row {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.pair-member-chip {
    display: grid;
    grid-template-columns: 30px auto;
    align-items: center;
    gap: 2px 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #10171a;
}

.pair-member-chip.active {
    border-color: rgba(255, 92, 138, 0.4);
}

.pair-member-chip > span {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 92, 138, 0.16);
    color: #ff8faf;
    font-weight: 900;
}

.pair-member-chip small {
    color: var(--muted);
    font-size: 10px;
}

.pair-layout {
    display: grid;
    grid-template-columns: minmax(330px, 0.75fr) minmax(0, 1.25fr);
    gap: 20px;
}

.pair-create-panel {
    align-self: start;
    position: sticky;
    top: 92px;
}

.pair-filter-details {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.pair-filter-details > summary {
    padding: 13px 14px;
    cursor: pointer;
    font-weight: 800;
}

.pair-filter-section {
    display: grid;
    gap: 10px;
    padding: 0 14px 14px;
}

.pair-round-options {
    display: grid;
    gap: 10px;
}

.pair-session-list {
    display: grid;
    gap: 12px;
}

.pair-session-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #10171a;
}

.pair-session-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.pair-session-head h3 {
    margin: 8px 0 4px;
}

.pair-session-head small {
    color: var(--muted);
}

.pair-progress-list {
    display: grid;
    gap: 7px;
    margin: 14px 0;
}

.pair-progress-list > div {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.pair-progress-list > div > div,
.mini-progress {
    overflow: hidden;
    height: 7px;
    border-radius: 999px;
    background: var(--panel-2);
}

.pair-progress-list i,
.mini-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5c8a, #ffb0c7);
}

.pair-session-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pair-swipe-counter {
    display: grid;
    justify-items: end;
}

.pair-swipe-counter strong {
    font-size: 32px;
}

.pair-swipe-counter small {
    color: var(--muted);
}

.pair-swipe-progress {
    height: 6px;
    overflow: hidden;
    margin-bottom: 18px;
    border-radius: 999px;
    background: var(--panel-2);
}

.pair-swipe-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #ff5c8a, #ffb0c7);
}

.pair-swipe-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 620px);
    justify-content: center;
    align-items: start;
    gap: 22px;
}

.pair-partner-progress {
    display: grid;
    gap: 13px;
}

.pair-progress-person {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.pair-progress-person.active {
    border-color: rgba(255, 92, 138, 0.36);
}

.pair-progress-person .pair-avatar {
    width: 42px;
    height: 42px;
    font-size: 17px;
}

.pair-progress-person small {
    color: var(--muted);
    font-size: 11px;
}

.pair-secret-note {
    margin: 2px 0 0;
    font-size: 12px;
}

.pair-card-stage {
    display: grid;
    justify-items: center;
    touch-action: pan-y;
}

.pair-swipe-card {
    position: relative;
    overflow: hidden;
    width: min(100%, 560px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    transform-origin: 50% 100%;
    transition: transform 0.18s ease, opacity 0.18s ease;
    user-select: none;
}

.pair-swipe-card.dragging {
    transition: none;
}

.pair-card-visual {
    display: grid;
    place-items: center;
    min-height: 220px;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 92, 138, 0.22), transparent 54%),
        #10171a;
    font-size: 112px;
}

.pair-card-content {
    padding: 23px;
}

.pair-card-content h2 {
    margin: 10px 0 8px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.pair-card-content > p {
    margin: 0 0 13px;
    color: var(--muted);
    line-height: 1.5;
}

.pair-card-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.pair-card-details > div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #10171a;
}

.pair-card-details strong,
.pair-card-details small {
    display: block;
}

.pair-card-details small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.pair-card-ingredients {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.pair-card-ingredients summary {
    cursor: pointer;
    font-weight: 800;
}

.pair-card-ingredients > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.pair-card-ingredients span {
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 11px;
}

.pair-swipe-stamp {
    position: absolute;
    top: 28px;
    z-index: 5;
    display: none;
    padding: 7px 12px;
    border: 4px solid currentColor;
    border-radius: 10px;
    font-size: 25px;
    font-weight: 1000;
    letter-spacing: 0.08em;
    transform: rotate(-12deg);
}

.pair-swipe-stamp.no {
    left: 24px;
    color: #ff6b7a;
}

.pair-swipe-stamp.yes {
    right: 24px;
    color: #79e75d;
    transform: rotate(12deg);
}

.pair-swipe-stamp.maybe {
    left: 50%;
    color: #ffd27a;
    transform: translateX(-50%) rotate(-3deg);
}

.pair-vote-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
}

.pair-vote-button {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.pair-vote-button span {
    font-size: 28px;
    font-weight: 900;
}

.pair-vote-button small {
    font-weight: 800;
}

.pair-vote-button.no {
    color: #ff6b7a;
}

.pair-vote-button.maybe {
    color: #ffd27a;
}

.pair-vote-button.yes {
    color: #79e75d;
}

.pair-swipe-help {
    display: grid;
    justify-items: center;
    gap: 3px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.pair-results-progress {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.pair-results-progress > div {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--panel);
}

.pair-results-progress small {
    color: var(--muted);
}

.pair-matches-section {
    margin-bottom: 22px;
}

.pair-match-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.pair-match-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    cursor: grab;
}

.pair-match-card.selected {
    border-color: #ff5c8a;
    box-shadow: 0 0 0 3px rgba(255, 92, 138, 0.12);
}

.pair-match-card:active {
    cursor: grabbing;
}

.pair-match-score {
    padding: 8px 12px;
    background: rgba(255, 210, 122, 0.1);
    color: #ffd27a;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.pair-match-score.score-100 {
    background: rgba(121, 231, 93, 0.12);
    color: #8df371;
}

.pair-match-score.score-80 {
    background: rgba(255, 92, 138, 0.11);
    color: #ff9fba;
}

.pair-match-visual {
    display: grid;
    place-items: center;
    min-height: 115px;
    background: #10171a;
    font-size: 58px;
}

.pair-match-content {
    padding: 14px;
}

.pair-match-content h3 {
    margin: 0 0 9px;
    font-size: 20px;
}

.pair-vote-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.pair-vote-summary span {
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 10px;
}

.pair-vote-summary .decision-yes {
    color: #8df371;
}

.pair-vote-summary .decision-maybe {
    color: #ffd27a;
}

.pair-match-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.pair-match-actions a,
.pair-match-actions button {
    border: 0;
    background: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.pair-week-board-section {
    margin-bottom: 22px;
}

.pair-week-date-field {
    max-width: 240px;
    margin-bottom: 14px;
}

.pair-week-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.pair-week-slot {
    min-height: 150px;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #10171a;
    cursor: pointer;
}

.pair-week-slot.drag-over,
.pair-week-slot.has-recipe {
    border-style: solid;
    border-color: #ff5c8a;
    background: rgba(255, 92, 138, 0.07);
}

.pair-week-slot > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
}

.pair-week-drop-content {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    min-height: 94px;
    color: var(--muted);
    text-align: center;
}

.pair-week-drop-content > span {
    font-size: 25px;
}

.pair-week-slot.has-recipe .pair-week-drop-content > span {
    font-size: 31px;
}

.pair-week-slot [data-clear-match-day] {
    width: 100%;
    padding: 5px;
    border: 0;
    background: none;
    color: #ff7a86;
    cursor: pointer;
    font-size: 10px;
}

.pair-week-mobile-help {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.pair-secondary-results {
    margin-top: 12px;
}

.pair-secondary-results > summary {
    cursor: pointer;
    font-weight: 850;
}

@media (max-width: 1050px) {
    .pair-setup-shell,
    .pair-login-shell,
    .pair-layout,
    .pair-swipe-layout {
        grid-template-columns: 1fr;
    }

    .pair-create-panel {
        position: static;
    }

    .pair-swipe-layout {
        max-width: 620px;
        margin: 0 auto;
    }

    .pair-partner-progress {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pair-partner-progress > .eyebrow,
    .pair-partner-progress > h2,
    .pair-secret-note {
        grid-column: 1 / -1;
    }

    .pair-match-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pair-week-board {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .mobile-nav {
        grid-template-columns: repeat(6, 1fr);
        gap: 1px;
    }

    .mobile-nav a {
        font-size: 9px;
    }

    .mobile-nav span {
        font-size: 17px;
    }

    .pair-setup-shell,
    .pair-login-shell {
        min-height: auto;
    }

    .pair-intro-card,
    .pair-login-heading {
        padding: 8px 4px 16px;
    }

    .pair-profile-grid,
    .pair-results-progress,
    .pair-match-grid {
        grid-template-columns: 1fr;
    }

    .pair-hero,
    .pair-results-hero,
    .pair-swipe-header {
        display: grid;
        padding: 21px;
        border-radius: 21px;
    }

    .pair-hero-actions,
    .pair-results-actions {
        display: grid;
        justify-content: stretch;
    }

    .pair-household-bar {
        grid-template-columns: 1fr auto;
    }

    .pair-member-row {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .pair-partner-progress {
        grid-template-columns: 1fr;
    }

    .pair-card-visual {
        min-height: 160px;
        font-size: 84px;
    }

    .pair-card-content {
        padding: 18px;
    }

    .pair-card-content h2 {
        font-size: 29px;
    }

    .pair-vote-button {
        width: 68px;
        height: 68px;
    }

    .pair-week-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* UX_COMPACT_REWORK */
.compact-main-nav {
    gap: 6px;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown > summary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 11px;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    font-weight: 750;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown[open] > summary,
.nav-dropdown > summary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 90;
    display: grid;
    width: min(330px, 86vw);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(23, 33, 38, 0.98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.nav-dropdown-menu a {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border-radius: 12px;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-dropdown-menu a > span {
    font-size: 22px;
    text-align: center;
}

.nav-dropdown-menu strong,
.nav-dropdown-menu small {
    display: block;
}

.nav-dropdown-menu small {
    margin-top: 2px;
    color: var(--muted);
}

.more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.more-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 15px;
    min-height: 130px;
}

.more-card > span {
    font-size: 38px;
    text-align: center;
}

.more-card h2,
.more-card p {
    margin: 0;
}

.more-card p {
    margin-top: 5px;
    color: var(--muted);
}

.compact-recipe-hero .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.compact-filter-panel {
    position: relative;
}

.filter-collapsible {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.filter-collapsible > summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 800;
}

.filter-collapsible > summary small {
    color: var(--muted);
    font-weight: 650;
}

.filter-collapsible .chip-list {
    padding: 0 12px 12px;
}

.filter-loading {
    position: absolute;
    right: 16px;
    bottom: 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.filter-panel.is-loading,
[data-recipe-results][aria-busy="true"] {
    opacity: 0.65;
}

.recipe-results-heading .button {
    flex-shrink: 0;
}

.mobile-recipe-fab {
    display: none;
}

.day-head {
    align-items: start;
}

.day-head > div {
    display: grid;
    gap: 2px;
}

.day-lock-button {
    display: grid;
    justify-items: center;
    min-width: 50px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
}

.day-lock-button small {
    font-size: 10px;
    font-weight: 800;
}

.day-card.is-locked {
    border-color: rgba(255, 210, 122, 0.45);
    background: linear-gradient(180deg, rgba(255, 210, 122, 0.06), var(--panel));
}

.day-card.is-locked .day-editor {
    pointer-events: none;
    opacity: 0.48;
}

.day-card.is-locked .day-lock-button {
    border-color: rgba(255, 210, 122, 0.45);
    background: rgba(255, 210, 122, 0.12);
    color: var(--warning);
}

.pair-undo-form {
    display: flex;
    justify-content: center;
    margin: 0 0 12px;
}

.pair-results-actions form {
    margin: 0;
}

@media (max-width: 760px) {
    .more-grid {
        grid-template-columns: 1fr;
    }

    .compact-mobile-nav {
        grid-template-columns: repeat(5, 1fr);
    }

    .recipe-results-heading .button,
    .compact-recipe-hero .button-primary {
        display: inline-flex;
    }

    .mobile-recipe-fab {
        position: fixed;
        right: 18px;
        bottom: 88px;
        z-index: 80;
        display: grid;
        place-items: center;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--primary);
        color: #071006;
        box-shadow: var(--shadow);
        font-size: 31px;
        font-weight: 900;
    }

    .compact-recipe-hero .hero-actions {
        display: grid;
        width: 100%;
    }

    .recipe-results-heading {
        align-items: stretch;
    }

    .recipe-results-heading .button {
        width: 100%;
    }
}


/* ==========================================================
   Wochenplan Drag & Drop und externe Rezeptlinks
   ========================================================== */

.planner-drag-hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.day-head-actions {
    display: flex;
    align-items: start;
    gap: 6px;
}

.day-drag-handle {
    display: grid;
    justify-items: center;
    min-width: 54px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.day-drag-handle:active {
    cursor: grabbing;
}

.day-drag-handle > span {
    color: var(--primary);
    font-size: 18px;
    line-height: 1;
    letter-spacing: -4px;
}

.day-drag-handle small {
    font-size: 9px;
    font-weight: 800;
}

.day-card.is-locked .day-drag-handle {
    opacity: 0.38;
    cursor: not-allowed;
}

.day-card.is-dragging {
    opacity: 0.42;
    border-style: dashed;
}

.day-card.drag-over {
    border-color: var(--primary);
    background:
        linear-gradient(
            180deg,
            rgba(135, 230, 93, 0.15),
            var(--panel)
        );
    box-shadow:
        0 0 0 3px rgba(135, 230, 93, 0.12),
        var(--shadow);
    transform: translateY(-3px);
}

.day-card.keyboard-move-source {
    border-color: var(--primary);
    outline: 3px dashed rgba(135, 230, 93, 0.35);
    outline-offset: 3px;
}

.day-drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: grid;
    gap: 4px;
    width: min(230px, calc(100vw - 32px));
    padding: 13px 15px;
    border: 1px solid rgba(135, 230, 93, 0.6);
    border-radius: 14px;
    background: rgba(23, 33, 38, 0.97);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
    color: var(--text);
    pointer-events: none;
}

.day-drag-ghost strong {
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
}

.day-drag-ghost span {
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.planner-drag-active {
    cursor: grabbing;
    user-select: none;
}

.recipe-card-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
}

.card-link.external,
.source-link-button {
    color: var(--primary);
}

@media (max-width: 760px) {
    .day-head-actions {
        gap: 5px;
    }

    .day-drag-handle,
    .day-lock-button {
        min-width: 48px;
        padding-inline: 6px;
    }

    .planner-drag-hint {
        font-size: 11px;
    }
}


/* ==========================================================
   Planner-Korrekturen und Drag & Drop in der Monatsansicht
   ========================================================== */

.planner-empty-day[hidden],
.month-lock-badge[hidden] {
    display: none !important;
}

.week-grid {
    grid-template-columns: repeat(7, minmax(165px, 1fr));
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.day-head {
    align-items: flex-start;
}

.day-head > div:first-child {
    min-width: 0;
}

.day-head > div:first-child span {
    display: block;
    overflow-wrap: anywhere;
    line-height: 1.1;
}

.day-head-actions {
    flex: 0 0 auto;
}

.day-drag-handle,
.day-lock-button {
    position: relative;
    min-width: 38px;
    width: 38px;
    min-height: 38px;
    padding: 5px;
}

.day-action-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.planned-recipe h3 {
    overflow-wrap: anywhere;
    hyphens: auto;
}

.day-card select,
.day-card input {
    max-width: 100%;
    min-width: 0;
}

.month-drag-info {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(135, 230, 93, 0.055);
    color: var(--muted);
}

.month-drag-info > span {
    color: var(--primary);
    font-size: 24px;
    letter-spacing: -5px;
}

.month-drag-info p {
    margin: 0;
    line-height: 1.4;
}

.month-day {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    outline: none;
}

.month-day:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(135, 230, 93, 0.35);
}

.month-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.month-day-number {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-weight: 850;
}

.month-day-number:hover {
    background: rgba(135, 230, 93, 0.1);
    color: var(--primary);
}

.month-day.today .month-day-number {
    background: var(--primary);
    color: var(--primary-dark);
}

.month-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 27px;
    height: 27px;
    border: 1px solid rgba(255, 210, 122, 0.25);
    border-radius: 9px;
    background: rgba(255, 210, 122, 0.08);
    font-size: 13px;
}

.month-plan-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 7px;
    width: 100%;
    margin-top: 8px;
    padding: 9px;
    border: 1px solid rgba(135, 230, 93, 0.18);
    border-radius: 12px;
    background: rgba(135, 230, 93, 0.07);
    color: var(--text);
    cursor: grab;
    text-align: left;
    touch-action: none;
    user-select: none;
}

.month-plan-chip:active {
    cursor: grabbing;
}

.month-plan-chip > span {
    grid-row: span 2;
    margin: 0;
    font-size: 20px;
}

.month-plan-chip strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-plan-chip small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-empty-slot {
    display: grid;
    flex: 1;
    place-items: center;
    min-height: 48px;
    margin-top: 8px;
    border: 1px dashed rgba(157, 175, 183, 0.16);
    border-radius: 11px;
    color: rgba(157, 175, 183, 0.45);
    font-size: 11px;
}

.month-day.is-locked .month-plan-chip {
    opacity: 0.48;
    cursor: not-allowed;
}

.month-day.is-dragging {
    opacity: 0.42;
}

.month-day.month-drag-over {
    opacity: 1;
    background: rgba(135, 230, 93, 0.14);
    box-shadow: inset 0 0 0 3px rgba(135, 230, 93, 0.42);
}

.month-day.keyboard-move-source {
    opacity: 1;
    box-shadow: inset 0 0 0 3px rgba(135, 230, 93, 0.45);
}

.month-calendar.is-saving {
    opacity: 0.58;
    pointer-events: none;
}

.month-drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: min(230px, calc(100vw - 30px));
    overflow: hidden;
    padding: 12px 14px;
    border: 1px solid rgba(135, 230, 93, 0.55);
    border-radius: 13px;
    background: rgba(23, 33, 38, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    color: var(--text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.month-undo-toast {
    position: sticky;
    top: 88px;
    z-index: 38;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(135, 230, 93, 0.32);
    border-radius: 15px;
    background: rgba(23, 33, 38, 0.98);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.month-undo-toast > span {
    flex: 1;
    line-height: 1.4;
}

.month-undo-toast form {
    margin: 0;
}

.month-undo-toast form button {
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: var(--primary);
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 850;
}

.month-undo-toast > button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
}

@media (max-width: 1120px) {
    .week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow-x: visible;
    }
}

@media (max-width: 680px) {
    .week-grid {
        grid-template-columns: 1fr;
    }

    .month-drag-info {
        align-items: flex-start;
        font-size: 12px;
    }

    .month-undo-toast {
        top: 72px;
        flex-wrap: wrap;
    }

    .month-undo-toast > span {
        flex-basis: calc(100% - 46px);
    }
}


/* ==========================================================
   Foto-/JSON-Import für den Vorrat
   ========================================================== */

.pantry-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pantry-import-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.pantry-import-step {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.pantry-import-step > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(135, 230, 93, 0.12);
    color: var(--primary);
    font-size: 20px;
    font-weight: 900;
}

.pantry-import-step > div {
    display: grid;
    gap: 4px;
}

.pantry-import-step small {
    color: var(--muted);
    line-height: 1.4;
}

.prompt-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.prompt-preview > strong {
    flex-basis: 100%;
}

.prompt-preview > span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
    color: var(--muted);
    font-size: 12px;
}

.pantry-import-editor {
    min-height: 360px;
}

.pantry-import-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.radio-box.danger-choice {
    border-color: rgba(255, 108, 108, 0.28);
    background: rgba(255, 108, 108, 0.045);
}

.pantry-preview-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pantry-preview-summary > div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.pantry-preview-summary strong {
    color: var(--primary);
    font-size: 28px;
}

.pantry-preview-summary span {
    color: var(--muted);
    font-size: 12px;
}

.pantry-preview-card {
    display: grid;
    gap: 16px;
}

.pantry-preview-card.has-warnings {
    border-color: rgba(255, 210, 122, 0.28);
}

.pantry-preview-card.has-errors {
    border-color: rgba(255, 108, 108, 0.36);
}

.import-error-list {
    display: grid;
    gap: 7px;
}

.import-error-list > div {
    padding: 10px 12px;
    border: 1px solid rgba(255, 108, 108, 0.34);
    border-radius: 12px;
    background: rgba(255, 108, 108, 0.07);
    color: #ffb3b3;
}

.confidence-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.confidence-row strong {
    padding: 5px 8px;
    border-radius: 999px;
}

.confidence-high {
    background: rgba(135, 230, 93, 0.12);
    color: var(--primary);
}

.confidence-medium {
    background: rgba(255, 210, 122, 0.12);
    color: var(--warning);
}

.confidence-low {
    background: rgba(255, 108, 108, 0.12);
    color: #ff9e9e;
}

@media (max-width: 860px) {
    .pantry-import-guide,
    .pantry-import-modes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .pantry-hero {
        display: grid;
    }

    .hero-actions {
        display: grid;
    }

    .pantry-preview-summary {
        grid-template-columns: 1fr;
    }

    .pantry-import-editor {
        min-height: 300px;
    }
}


/* ==========================================================
   Zutatenbibliothek und Wochenplan-Autopilot
   ========================================================== */

.button-accent {
    border-color: rgba(174, 119, 255, 0.45);
    background:
        linear-gradient(
            135deg,
            rgba(174, 119, 255, 0.2),
            rgba(135, 230, 93, 0.12)
        );
    color: #e9d9ff;
}

.button-accent:hover {
    border-color: rgba(174, 119, 255, 0.75);
    transform: translateY(-1px);
}

.planner-header-actions {
    flex-wrap: wrap;
}

.library-header,
.autopilot-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.library-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.library-stat {
    display: grid;
    gap: 5px;
    padding: 18px;
}

.library-stat strong {
    color: var(--primary);
    font-size: 30px;
}

.library-stat span {
    color: var(--muted);
    font-size: 12px;
}

.library-stat.warning strong {
    color: var(--warning);
}

.library-explainer {
    margin-bottom: 28px;
}

.library-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.library-flow > div {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
}

.library-flow strong {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: rgba(135, 230, 93, 0.11);
    color: var(--primary);
}

.library-flow span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.library-section {
    margin-top: 34px;
    scroll-margin-top: 100px;
}

.library-section > .section-heading p {
    max-width: 760px;
    margin: 6px 0 0;
    color: var(--muted);
}

.library-inbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.library-inbox-card {
    display: grid;
    align-content: start;
    gap: 15px;
}

.library-inbox-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.library-inbox-head h3 {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}

.library-source-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.library-source-row span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
    color: var(--muted);
    font-size: 11px;
}

.library-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.library-suggestions > strong {
    flex-basis: 100%;
    font-size: 12px;
}

.library-suggestions > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid rgba(135, 230, 93, 0.2);
    border-radius: 999px;
    background: rgba(135, 230, 93, 0.07);
    color: var(--text);
    font-size: 12px;
}

.library-suggestions small {
    color: var(--primary);
}

.library-resolve-form {
    display: grid;
    gap: 13px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.library-choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.library-create-box {
    margin-bottom: 15px;
}

.library-create-box summary {
    cursor: pointer;
    font-weight: 850;
}

.library-create-box[open] summary {
    margin-bottom: 16px;
}

.library-catalog-list {
    display: grid;
    gap: 12px;
}

.library-catalog-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.library-catalog-card > summary::-webkit-details-marker {
    display: none;
}

.library-catalog-card > summary > div {
    display: grid;
    gap: 4px;
}

.library-catalog-card > summary small {
    color: var(--muted);
}

.library-catalog-card > summary > span {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--primary);
    font-size: 11px;
}

.library-catalog-card[open] > summary {
    margin-bottom: 17px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.library-catalog-form {
    align-items: end;
}

.library-alias-list {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.library-alias-list > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.library-alias-list form,
.tag-library-list form {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
}

.library-alias-list button,
.tag-library-list button {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 108, 108, 0.08);
    color: #ff9e9e;
    cursor: pointer;
}

.library-merge-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid rgba(255, 108, 108, 0.2);
}

.tag-library-panel {
    display: grid;
    gap: 16px;
}

.tag-library-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.import-new-tag-confirm {
    border-color: rgba(255, 210, 122, 0.28);
    background: rgba(255, 210, 122, 0.05);
}

.pantry-catalog-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(174, 119, 255, 0.22);
    border-radius: 14px;
    background: rgba(174, 119, 255, 0.045);
}

.catalog-suggestion-note {
    max-width: 260px;
    padding: 9px 11px;
    border-radius: 11px;
    background: #10171a;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.catalog-suggestion-note strong {
    color: #e9d9ff;
}

.autopilot-safety {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid rgba(135, 230, 93, 0.25);
    border-radius: 999px;
    background: rgba(135, 230, 93, 0.08);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.autopilot-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.autopilot-preset {
    cursor: pointer;
}

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

.autopilot-preset > span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 11px;
    height: 100%;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
    transition:
        border-color 0.16s ease,
        transform 0.16s ease,
        background 0.16s ease;
}

.autopilot-preset b {
    grid-row: span 2;
    font-size: 24px;
}

.autopilot-preset strong {
    align-self: end;
}

.autopilot-preset small {
    color: var(--muted);
    line-height: 1.35;
}

.autopilot-preset input:checked + span {
    border-color: rgba(174, 119, 255, 0.62);
    background:
        linear-gradient(
            135deg,
            rgba(174, 119, 255, 0.13),
            rgba(135, 230, 93, 0.06)
        );
    box-shadow: 0 0 0 3px rgba(174, 119, 255, 0.09);
    transform: translateY(-2px);
}

.autopilot-day-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 11px;
    overflow-x: auto;
    padding-bottom: 7px;
}

.autopilot-day-card {
    display: grid;
    align-content: start;
    gap: 11px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #10171a;
}

.autopilot-day-card.is-fixed {
    opacity: 0.72;
    border-color: rgba(135, 230, 93, 0.22);
}

.autopilot-day-card.is-locked {
    border-color: rgba(255, 210, 122, 0.28);
}

.autopilot-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.autopilot-day-head > div {
    display: grid;
    gap: 2px;
}

.autopilot-day-head span {
    color: var(--muted);
    font-size: 11px;
}

.autopilot-lock-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(255, 210, 122, 0.08);
}

.autopilot-lock-indicator[hidden] {
    display: none !important;
}

.autopilot-current-plan {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 9px;
    border: 1px solid rgba(135, 230, 93, 0.14);
    border-radius: 12px;
    background: rgba(135, 230, 93, 0.05);
}

.autopilot-current-plan.empty {
    border-style: dashed;
    border-color: var(--line);
    background: transparent;
}

.autopilot-current-plan > span {
    font-size: 22px;
}

.autopilot-current-plan > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.autopilot-current-plan strong,
.autopilot-current-plan small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autopilot-current-plan small {
    color: var(--muted);
    font-size: 10px;
}

.autopilot-considers > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.autopilot-considers > div span,
.autopilot-preview-meta span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
    color: var(--muted);
    font-size: 11px;
}

.autopilot-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.autopilot-preview-grid {
    display: grid;
    gap: 15px;
}

.autopilot-preview-day {
    display: grid;
    gap: 14px;
}

.autopilot-preview-day.is-fixed {
    opacity: 0.74;
}

.autopilot-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.autopilot-preview-head h2 {
    margin: 3px 0 0;
}

.autopilot-day-condition {
    padding: 8px 10px;
    border: 1px solid rgba(174, 119, 255, 0.2);
    border-radius: 11px;
    background: rgba(174, 119, 255, 0.045);
    color: #d6bdff;
    font-size: 12px;
}

.autopilot-options {
    display: grid;
    gap: 9px;
}

.autopilot-option {
    cursor: pointer;
}

.autopilot-option > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.autopilot-option-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        transform 0.16s ease;
}

.autopilot-option > input:checked + .autopilot-option-content {
    border-color: rgba(135, 230, 93, 0.5);
    background: rgba(135, 230, 93, 0.07);
    box-shadow: 0 0 0 3px rgba(135, 230, 93, 0.08);
    transform: translateY(-1px);
}

.autopilot-option.primary .autopilot-option-content {
    border-color: rgba(174, 119, 255, 0.3);
}

.autopilot-option-emoji {
    font-size: 28px;
}

.autopilot-option-main {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.autopilot-option-main strong {
    overflow-wrap: anywhere;
}

.autopilot-option-main > small {
    color: var(--muted);
}

.autopilot-option-content > b {
    align-self: start;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(174, 119, 255, 0.1);
    color: #d6bdff;
    font-size: 10px;
}

.autopilot-reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.autopilot-reason-chips em {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
}

.autopilot-special-plan,
.autopilot-fixed-plan {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.autopilot-special-plan > span,
.autopilot-fixed-plan > span {
    font-size: 30px;
}

.autopilot-special-plan > div,
.autopilot-fixed-plan > div {
    display: grid;
    gap: 4px;
}

.autopilot-special-plan small,
.autopilot-fixed-plan small {
    color: var(--muted);
}

.autopilot-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.autopilot-reasons li {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
}

.autopilot-final-check {
    position: sticky;
    bottom: 78px;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    background: rgba(23, 33, 38, 0.97);
    backdrop-filter: blur(16px);
}

.autopilot-final-check h2 {
    margin: 3px 0 5px;
}

.autopilot-final-check p {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .library-summary,
    .library-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .autopilot-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .autopilot-day-grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
        overflow-x: visible;
    }
}

@media (max-width: 820px) {
    .library-inbox-grid {
        grid-template-columns: 1fr;
    }

    .library-choice-row,
    .pantry-catalog-choice {
        grid-template-columns: 1fr;
    }

    .catalog-suggestion-note {
        max-width: none;
    }

    .library-merge-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .library-header,
    .autopilot-header {
        display: grid;
        align-items: start;
    }

    .library-summary,
    .library-flow,
    .autopilot-preset-grid,
    .autopilot-day-grid {
        grid-template-columns: 1fr;
    }

    .library-choice-row {
        grid-template-columns: 1fr;
    }

    .autopilot-preview-head {
        display: grid;
    }

    .autopilot-option-content {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .autopilot-option-content > b {
        grid-column: 2;
        justify-self: start;
    }

    .autopilot-final-check {
        display: grid;
        bottom: 72px;
    }

    .autopilot-final-check .button {
        width: 100%;
    }
}


.library-unit-issue-list {
    display: grid;
    gap: 12px;
}

.library-unit-issue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.library-unit-issue h3 {
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.library-unit-issue small {
    color: var(--muted);
}

.library-unit-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.library-unit-actions form {
    margin: 0;
}

.ingredient-import-mapping {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    padding: 11px;
    border: 1px solid rgba(174, 119, 255, 0.2);
    border-radius: 13px;
    background: rgba(174, 119, 255, 0.04);
}

.ingredient-import-mapping > strong {
    color: #e9d9ff;
    font-size: 12px;
}

.ingredient-import-map-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr);
    align-items: center;
    gap: 10px;
}

.ingredient-import-map-row > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.ingredient-import-map-row span,
.ingredient-import-map-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ingredient-import-map-row small {
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 680px) {
    .library-unit-issue {
        display: grid;
    }

    .library-unit-actions {
        justify-content: stretch;
    }

    .library-unit-actions form,
    .library-unit-actions .button {
        width: 100%;
    }

    .ingredient-import-map-row {
        grid-template-columns: 1fr;
    }
}


.known-tag-picker {
    display: grid;
    gap: 7px;
}

.known-tag-picker > small {
    color: var(--muted);
}

.known-tag-picker > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.known-tag-picker button {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
}

.known-tag-picker button:hover {
    border-color: rgba(135, 230, 93, 0.35);
    color: var(--primary);
}


/* ==========================================================
   Gemeinsamer Trefferkorb
   ========================================================== */

.pair-basket-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    margin: 16px 0 22px;
    padding: 16px 18px;
    border-color: rgba(135, 230, 93, 0.25);
    background:
        linear-gradient(
            135deg,
            rgba(135, 230, 93, 0.1),
            rgba(174, 119, 255, 0.06)
        );
}

.pair-basket-banner:hover {
    border-color: rgba(135, 230, 93, 0.48);
    transform: translateY(-2px);
}

.pair-basket-banner-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: rgba(135, 230, 93, 0.12);
    font-size: 25px;
}

.pair-basket-banner-main {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.pair-basket-banner-main small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pair-basket-banner-count {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-dark);
    font-weight: 900;
}

.pair-basket-banner-arrow {
    color: var(--primary);
    font-size: 22px;
}

.pair-basket-flow {
    display: grid;
    gap: 14px;
    margin: 18px 0 26px;
}

.pair-basket-flow > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pair-basket-flow article {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.pair-basket-flow article > strong {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(135, 230, 93, 0.11);
    color: var(--primary);
}

.pair-basket-flow article > span {
    display: grid;
    gap: 3px;
}

.pair-basket-flow small {
    color: var(--muted);
    line-height: 1.35;
}

.pair-auto-basket-note,
.basket-added-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid rgba(135, 230, 93, 0.22);
    border-radius: 999px;
    background: rgba(135, 230, 93, 0.07);
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.pair-basket-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 26px;
    margin-bottom: 18px;
}

.pair-basket-hero h1 {
    margin: 4px 0 8px;
}

.pair-basket-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.pair-basket-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(86px, 1fr));
    gap: 9px;
    min-width: min(360px, 100%);
}

.pair-basket-summary > div {
    display: grid;
    gap: 3px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.pair-basket-summary strong {
    color: var(--primary);
    font-size: 24px;
}

.pair-basket-summary span {
    color: var(--muted);
    font-size: 10px;
}

.pair-basket-week-nav {
    margin-bottom: 16px;
}

.pair-basket-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(620px, 1.5fr);
    align-items: start;
    gap: 16px;
}

.pair-basket-list-column {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.pair-basket-open-panel,
.pair-basket-planned-panel,
.pair-basket-week-panel {
    min-width: 0;
}

.pair-basket-mobile-help {
    margin: 0 0 12px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #10171a;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.pair-basket-mobile-help.active {
    border-color: rgba(135, 230, 93, 0.32);
    background: rgba(135, 230, 93, 0.07);
    color: var(--primary);
}

.pair-basket-card-list {
    display: grid;
    gap: 9px;
}

.pair-basket-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
    transition:
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.pair-basket-card.selected {
    border-color: rgba(135, 230, 93, 0.62);
    box-shadow: 0 0 0 3px rgba(135, 230, 93, 0.09);
    transform: translateY(-2px);
}

.pair-basket-card.is-planned {
    border-color: rgba(174, 119, 255, 0.22);
}

.pair-basket-select-area {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: grab;
    text-align: left;
    touch-action: manipulation;
}

.pair-basket-select-area:active {
    cursor: grabbing;
}

.pair-basket-card-emoji {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(135, 230, 93, 0.08);
    font-size: 24px;
}

.pair-basket-card-main {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.pair-basket-card-main > strong,
.pair-basket-card-main > small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pair-basket-card-main > small {
    color: var(--muted);
    font-size: 10px;
}

.pair-basket-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pair-basket-card-meta em {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 9px;
    font-style: normal;
}

.pair-basket-card-meta em.score-100 {
    background: rgba(135, 230, 93, 0.1);
    color: var(--primary);
}

.pair-basket-card-meta em.score-80 {
    background: rgba(255, 210, 122, 0.1);
    color: var(--warning);
}

.pair-basket-select-label {
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.pair-basket-card.selected .pair-basket-select-label {
    border-color: rgba(135, 230, 93, 0.3);
    color: var(--primary);
}

.pair-basket-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
}

.pair-basket-card-actions a,
.pair-basket-card-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
}

.pair-basket-card-actions a:hover {
    color: var(--primary);
}

.pair-basket-card-actions button:hover {
    color: #ff9e9e;
}

.pair-basket-planned-panel > summary {
    cursor: pointer;
    font-weight: 850;
}

.pair-basket-planned-panel[open] > summary {
    margin-bottom: 10px;
}

.pair-basket-planned-panel .muted {
    margin: 0 0 12px;
}

.pair-basket-week-panel {
    position: sticky;
    top: 92px;
}

.pair-basket-save-hint {
    padding: 6px 9px;
    border: 1px solid rgba(255, 210, 122, 0.22);
    border-radius: 999px;
    background: rgba(255, 210, 122, 0.06);
    color: var(--warning);
    font-size: 10px;
    font-weight: 800;
}

.pair-basket-week-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(112px, 1fr));
    gap: 9px;
    overflow-x: auto;
    padding: 4px 0 10px;
}

.pair-basket-day {
    display: grid;
    align-content: start;
    min-width: 112px;
    min-height: 190px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.pair-basket-day.has-basket-item {
    border-color: rgba(135, 230, 93, 0.26);
    background: rgba(135, 230, 93, 0.045);
}

.pair-basket-day.has-existing-plan:not(.has-basket-item) {
    border-color: rgba(174, 119, 255, 0.2);
}

.pair-basket-day.drag-over {
    border-color: var(--primary);
    background: rgba(135, 230, 93, 0.13);
    transform: translateY(-3px);
}

.pair-basket-day.is-locked {
    opacity: 0.48;
}

.pair-basket-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 7px;
    margin-bottom: 9px;
}

.pair-basket-day-head > div {
    display: grid;
    gap: 2px;
}

.pair-basket-day-head span {
    color: var(--muted);
    font-size: 10px;
}

.pair-basket-day-lock {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: rgba(255, 210, 122, 0.08);
    font-size: 12px;
}

.pair-basket-day-lock[hidden] {
    display: none !important;
}

.pair-basket-day-content {
    display: grid;
    justify-items: start;
    align-content: center;
    gap: 6px;
    width: 100%;
    min-height: 105px;
    padding: 9px;
    border: 1px dashed rgba(157, 175, 183, 0.18);
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.pair-basket-day.has-basket-item .pair-basket-day-content {
    border-style: solid;
    border-color: rgba(135, 230, 93, 0.18);
    background: rgba(135, 230, 93, 0.055);
}

.pair-basket-day.has-existing-plan:not(.has-basket-item)
    .pair-basket-day-content {
    border-style: solid;
    border-color: rgba(174, 119, 255, 0.15);
    background: rgba(174, 119, 255, 0.04);
}

.pair-basket-day-content > span {
    font-size: 24px;
}

.pair-basket-day-content > strong {
    width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.25;
}

.pair-basket-day-content > small {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.3;
}

.pair-basket-day-clear {
    margin-top: 7px;
    padding: 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 9px;
}

.pair-basket-day-clear:hover {
    color: #ff9e9e;
}

.pair-basket-day-clear[hidden] {
    display: none !important;
}

.pair-basket-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.pair-basket-empty {
    margin-top: 28px;
}

.compact-empty {
    padding: 18px;
}

@media (max-width: 1180px) {
    .pair-basket-workspace {
        grid-template-columns: 1fr;
    }

    .pair-basket-week-panel {
        position: static;
    }

    .pair-basket-week-board {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
        overflow-x: visible;
    }
}

@media (max-width: 780px) {
    .pair-basket-flow > div {
        grid-template-columns: 1fr;
    }

    .pair-basket-hero {
        display: grid;
        align-items: start;
    }

    .pair-basket-summary {
        min-width: 0;
        width: 100%;
    }

    .pair-basket-week-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pair-basket-card-actions {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .pair-basket-banner {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .pair-basket-banner-count {
        display: none;
    }

    .pair-basket-banner-arrow {
        grid-column: 3;
        grid-row: 1;
    }

    .pair-basket-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pair-basket-summary > div {
        padding: 10px;
    }

    .pair-basket-week-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .pair-basket-week-nav strong {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .pair-basket-week-board {
        grid-template-columns: 1fr;
    }

    .pair-basket-day {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        min-height: 0;
        gap: 8px;
    }

    .pair-basket-day-head {
        display: grid;
        align-content: start;
        min-width: 58px;
        margin: 0;
    }

    .pair-basket-day-content {
        min-height: 82px;
    }

    .pair-basket-day-clear {
        grid-column: 2;
        margin: 0;
        text-align: left;
    }

    .pair-basket-select-area {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pair-basket-select-label {
        grid-column: 2;
        justify-self: start;
    }

    .pair-basket-form-actions {
        display: grid;
    }

    .pair-basket-form-actions .button {
        width: 100%;
    }
}

/* ==========================================================
   Serverfähige Benutzerverwaltung und Sicherheitsbereiche
   ========================================================== */

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(135, 230, 93, 0.08), transparent 34%),
        radial-gradient(circle at bottom right, rgba(174, 119, 255, 0.08), transparent 32%),
        var(--bg);
}

.auth-shell {
    width: min(520px, calc(100% - 28px));
    margin: 0 auto;
    padding: 42px 0 72px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 24px;
}

.auth-brand > span:last-child {
    display: grid;
    gap: 2px;
}

.auth-brand small {
    color: var(--muted);
}

.auth-card {
    padding: clamp(20px, 4vw, 32px);
}

.auth-card-heading {
    margin-bottom: 20px;
}

.auth-card-heading h1 {
    margin: 4px 0 8px;
}

.auth-card-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-form {
    gap: 15px;
}

.auth-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.auth-card-footer a {
    color: var(--primary);
}

.account-dropdown > summary {
    gap: 8px;
}

.account-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(135, 230, 93, 0.12);
    color: var(--primary);
    font-weight: 900;
}

.account-summary-text {
    display: grid;
    max-width: 130px;
    text-align: left;
}

.account-summary-text strong,
.account-summary-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-summary-text small {
    color: var(--muted);
    font-size: 9px;
}

.account-logout-form,
.account-logout-form button {
    width: 100%;
}

.account-logout-form button {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.account-logout-form button > div {
    display: grid;
    gap: 2px;
}

.account-logout-form small {
    color: var(--muted);
}

.read-only-banner {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 210, 122, 0.22);
    background: rgba(255, 210, 122, 0.07);
    color: var(--warning);
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.account-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.account-session-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.account-session-row > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.account-session-row small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-privacy {
    margin-top: 18px;
}

.danger-zone {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 108, 108, 0.2);
}

.danger-zone summary {
    color: #ff9e9e;
    cursor: pointer;
    font-weight: 850;
}

.danger-zone[open] summary {
    margin-bottom: 12px;
}

.admin-user-list {
    display: grid;
    gap: 14px;
}

.admin-user-card {
    display: grid;
    gap: 15px;
}

.admin-user-card.is-inactive {
    opacity: 0.68;
}

.admin-user-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.admin-user-heading h2 {
    margin: 3px 0;
}

.admin-user-heading p {
    margin: 0;
    color: var(--muted);
}

.account-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.account-facts span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #10171a;
    color: var(--muted);
    font-size: 10px;
}

.admin-user-actions {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.secret-link-box {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    border-color: rgba(135, 230, 93, 0.32);
}

.secret-link-box h2,
.secret-link-box p {
    margin: 0;
}

.secret-link-box p {
    color: var(--muted);
}

.copy-secret-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    margin-top: 8px;
}

.copy-secret-row input {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
}

.invitation-form {
    align-items: end;
}

.invitation-list > div {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
}

.invitation-list > div > div {
    display: grid;
    gap: 3px;
}

.invitation-list small {
    color: var(--muted);
}

.audit-table-wrap {
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.audit-table th,
.audit-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.audit-table th {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.audit-table code {
    color: var(--primary);
}

.backup-strategy-card {
    margin: 18px 0;
}

.backup-layer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    margin: 14px 0;
}

.backup-layer-grid article {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #10171a;
}

.backup-layer-grid article > strong {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(135, 230, 93, 0.1);
    color: var(--primary);
}

.backup-layer-grid article > span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.backup-layer-grid small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.architecture-facts code {
    overflow-wrap: anywhere;
}

.error-page > span {
    color: var(--primary);
    font-size: 42px;
    font-weight: 950;
}

@media (max-width: 960px) {
    .account-summary-text {
        display: none;
    }

    .admin-user-actions,
    .backup-layer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .auth-shell {
        padding-top: 24px;
    }

    .auth-card-footer,
    .account-header,
    .account-session-row,
    .admin-user-heading {
        display: grid !important;
    }

    .copy-secret-row,
    .invitation-list > div {
        grid-template-columns: 1fr;
    }

    .copy-secret-row .button,
    .account-session-row .button {
        width: 100%;
    }
}
