/* ============================================
   Rezepte — Cookbook Design System
   Warm, cremefarbene Basis, Terrakotta-Akzent
   ============================================ */

:root {
    --bg: #f3ead8;
    --bg-2: #ede2cc;
    --surface: #fbf6ea;
    --surface-2: #f7efdc;
    --border: #e0d2b4;
    --border-strong: #c9b693;

    --ink: #2b2218;
    --ink-2: #4a3e30;
    --ink-3: #7a6a55;
    --ink-4: #a09076;

    --terra: #b44b27;
    --terra-deep: #8c3717;
    --terra-soft: #e9bba6;
    --terra-tint: #f4dccc;

    --olive: #6b6a2a;
    --olive-soft: #d9d5a8;

    --shadow-card: 0 1px 0 rgba(75, 50, 20, 0.04), 0 12px 32px -16px rgba(75, 50, 20, 0.18);
    --shadow-pop: 0 24px 48px -24px rgba(75, 50, 20, 0.35);

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 24px;

    --f-display: "DM Serif Display", "Cormorant Garamond", Georgia, serif;
    --f-body: "Crimson Pro", "Source Serif Pro", Georgia, serif;
    --f-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --f-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 18px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(ellipse at top left, rgba(180, 75, 39, 0.06), transparent 60%),
        radial-gradient(ellipse at bottom right, rgba(107, 106, 42, 0.05), transparent 60%);
}

main, .app-shell { position: relative; z-index: 1; }

a { color: var(--terra); text-decoration: none; }
a:hover { color: var(--terra-deep); }

.display {
    font-family: var(--f-display);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.05;
    color: var(--ink);
}
.eyebrow {
    font-family: var(--f-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--ink-3);
}
.meta {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.01em; color: var(--ink); }

.btn {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: -0.005em;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 160ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    background: var(--surface);
    color: var(--ink);
}
.btn-primary {
    background: var(--terra);
    color: #fff8ec;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 16px -10px rgba(140, 55, 23, 0.5);
}
.btn-primary:hover {
    background: var(--terra-deep);
    color: #fff8ec;
    transform: translateY(-1px);
}
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: var(--terra-deep); color: #fff8ec; }
.btn-danger:hover { background: #6e2812; color: #fff8ec; }
.btn-lg { font-size: 16px; padding: 14px 26px; }

input[type=text], input[type=number], input[type=url], input[type=email], input[type=search],
input[type=file], input[type=password], select, textarea, .input {
    font-family: var(--f-body);
    font-size: 17px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--ink);
    width: 100%;
    outline: none;
    transition: border-color 160ms, box-shadow 160ms;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--terra);
    box-shadow: 0 0 0 3px rgba(180, 75, 39, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
label {
    display: block;
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--ink-2);
    margin-bottom: 6px;
}
.help-block, small.form-text { font-family: var(--f-ui); font-size: 12px; color: var(--ink-3); margin-top: 6px; display: block; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-ui);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink-2);
    letter-spacing: 0.01em;
}
.chip-terra { background: var(--terra-tint); border-color: var(--terra-soft); color: var(--terra-deep); }
.chip-olive { background: var(--olive-soft); border-color: #c5c08a; color: #4a4912; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

.divider { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.divider-dotted { border: 0; border-top: 1px dashed var(--border-strong); margin: 18px 0; }
.ornament {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink-4);
    font-family: var(--f-display);
    font-size: 18px;
    margin: 80px auto 0;
    max-width: 360px;
}
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(243, 234, 216, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.app-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-text { font-family: var(--f-display); font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover .brand-text { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }

.app-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.app-nav a {
    font-family: var(--f-ui);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    color: var(--ink-3);
    text-decoration: none;
    position: relative;
    letter-spacing: -0.005em;
    border-radius: var(--r-sm);
}
.app-nav a:hover { color: var(--ink); }
.app-nav a.active { color: var(--ink); }
.app-nav a.active::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--terra);
}

.app-right { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.lang-group { display: flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; }
.lang-group a { color: var(--ink-4); padding: 4px 6px; text-decoration: none; }
.lang-group a.active { color: var(--ink); font-weight: 600; }
.user-block { display: flex; align-items: center; gap: 10px; padding-left: 20px; border-left: 1px solid var(--border); }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d9b48a, #b08560);
    color: #fbf6ea;
    font-family: var(--f-ui);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
}
.user-text { display: flex; flex-direction: column; line-height: 1.1; gap: 2px; }
.user-name { font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--ink); }
.user-signout {
    font-family: var(--f-ui);
    font-size: 11px;
    color: var(--ink-3);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}

.page { max-width: 1280px; margin: 0 auto; padding: 56px 32px 80px; position: relative; z-index: 1; }
.page-narrow { max-width: 720px; margin: 0 auto; padding: 56px 32px 80px; position: relative; z-index: 1; }

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}
.hero-left { display: flex; flex-direction: column; gap: 10px; }
.hero h1 { font-size: clamp(48px, 6vw, 80px); margin: 4px 0 0; }
.hero-sub { color: var(--ink-2); font-size: 18px; max-width: 480px; margin: 8px 0 0; font-style: italic; }
.hero-right { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; flex-wrap: wrap; }

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}
.recipe-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 220ms ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: 0 24px 48px -24px rgba(75, 50, 20, 0.32); }
.recipe-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin: 8px;
    border-radius: 12px;
    background: var(--bg-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-4);
    font-family: var(--f-mono);
    font-size: 12px;
}
.recipe-card-image img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card-body { padding: 10px 18px 22px; }
.recipe-card-tags { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.recipe-card-title { font-family: var(--f-display); font-size: 22px; line-height: 1.15; margin: 0 0 4px; color: var(--ink); letter-spacing: -0.01em; }
.recipe-card-sub { margin: 0; color: var(--ink-3); font-size: 15px; font-style: italic; }
.recipe-card-meta { display: flex; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }

.recipe-detail-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
    margin-bottom: 48px;
}
@media (max-width: 880px) { .recipe-detail-hero { grid-template-columns: 1fr; gap: 32px; } }
.recipe-detail-hero-text { display: flex; flex-direction: column; gap: 18px; }
.recipe-detail-title { font-size: clamp(40px, 5.5vw, 72px); margin: 4px 0 0; }
.recipe-detail-subtitle { font-style: italic; color: var(--ink-2); font-size: 20px; line-height: 1.4; margin: 0; max-width: 540px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    padding-top: 24px;
    padding-bottom: 8px;
    border-top: 1px dashed var(--border-strong);
    margin-top: 12px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-family: var(--f-display); font-size: 28px; color: var(--ink); letter-spacing: -0.01em; line-height: 1; }
.recipe-detail-image {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 16px;
    background: var(--bg-2);
    box-shadow: 0 30px 60px -30px rgba(75, 50, 20, 0.4), 0 8px 16px -8px rgba(75, 50, 20, 0.18);
}
.recipe-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.actions-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.recipe-description { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 720px; margin: 8px 0 0; font-style: italic; }

.recipe-body {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 64px;
    align-items: start;
}
@media (max-width: 880px) { .recipe-body { grid-template-columns: 1fr; gap: 40px; } }

.ingredients-card {
    position: sticky;
    top: 90px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
@media (max-width: 880px) { .ingredients-card { position: relative; top: 0; } }
.ingredients-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 36px; margin: 0; font-family: var(--f-display); }

.portion-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px 6px 12px;
    box-shadow: var(--shadow-card);
}
.portion-input {
    font-family: var(--f-display);
    font-size: 20px;
    color: var(--ink);
    background: transparent;
    border: 0;
    width: 44px;
    text-align: center;
    padding: 0;
    -moz-appearance: textfield;
}
.portion-input::-webkit-inner-spin-button,
.portion-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.portion-input:focus { box-shadow: none; outline: none; }
.portion-control .meta { font-size: 12px; color: var(--ink-3); }
.portion-step {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.portion-step:hover { background: var(--terra-tint); color: var(--terra-deep); border-color: var(--terra-soft); }
.portion-step:active { transform: scale(0.94); }

.ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
}
.ingredients-list li {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    gap: 6px 16px;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px dotted var(--border-strong);
}
.ing-amount {
    font-family: var(--f-display);
    font-size: 22px;
    color: var(--terra);
    letter-spacing: -0.01em;
}
.ing-unit { font-family: var(--f-ui); font-size: 13px; color: var(--ink-3); margin-left: 4px; font-weight: 500; }
.ing-name { color: var(--ink); font-size: 17px; }
.ing-note { grid-column: 2; font-size: 13px; color: var(--ink-3); font-style: italic; }

.step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 32px; }
.step-list > li { display: grid; grid-template-columns: auto 1fr; gap: 28px; }
.step-num {
    font-family: var(--f-display);
    font-size: 36px;
    color: var(--terra);
    line-height: 1;
    letter-spacing: 0.04em;
    padding-top: 6px;
    min-width: 56px;
}
.step-content { display: flex; flex-direction: column; gap: 8px; }
.step-text { font-size: 18px; line-height: 1.65; color: var(--ink-2); margin: 0; white-space: pre-wrap; }
.step-timer-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--terra-deep);
    background: var(--terra-tint);
    padding: 4px 10px;
    border-radius: 999px;
    margin-top: 6px;
    align-self: flex-start;
}

/* Login */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; position: relative; z-index: 1; }
.login-card { max-width: 440px; width: 100%; text-align: center; padding: 40px 32px; }
.login-card h1 { font-size: 44px; margin: 0 0 8px; }
.login-card .tagline { color: var(--ink-3); font-style: italic; margin: 0 0 32px; }
.login-card .btn { width: 100%; justify-content: center; }

/* Cook Mode */
.cook-shell { background: var(--bg); min-height: 100vh; position: relative; z-index: 1; }
.cook-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    gap: 24px;
}
.cook-top-name { font-family: var(--f-display); font-size: 22px; color: var(--ink); letter-spacing: -0.01em; }
.cook-progress { display: flex; gap: 6px; align-items: center; justify-content: center; }
.cook-progress-dot {
    height: 6px;
    width: 16px;
    border-radius: 999px;
    border: 0;
    background: var(--border-strong);
    cursor: pointer;
    transition: all 240ms ease;
    padding: 0;
}
.cook-progress-dot.active { width: 32px; background: var(--ink); }

.cook-grid { display: grid; grid-template-columns: 1.6fr 1fr; }
@media (max-width: 880px) { .cook-grid { grid-template-columns: 1fr; } }
.cook-main { padding: 40px 56px; display: flex; flex-direction: column; gap: 20px; }
.cook-marker { display: flex; align-items: baseline; gap: 6px; }
.cook-marker-num { font-family: var(--f-display); font-size: 88px; color: var(--terra); letter-spacing: -0.04em; line-height: 1; }
.cook-marker-of { font-family: var(--f-mono); font-size: 18px; color: var(--ink-3); }
.cook-step-text { font-size: 22px; line-height: 1.55; color: var(--ink); margin: 0; max-width: 580px; white-space: pre-wrap; }
.cook-sidebar { background: var(--surface-2); border-left: 1px solid var(--border); padding: 40px 32px; }
@media (max-width: 880px) { .cook-sidebar { border-left: 0; border-top: 1px solid var(--border); } }

.cook-timer {
    margin-top: 12px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 540px;
}
.cook-timer-display {
    font-family: var(--f-display);
    font-size: 56px;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
    font-feature-settings: "tnum";
}
.cook-timer-actions { display: flex; gap: 8px; }

.cook-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    bottom: 0;
    z-index: 30;
    box-shadow: 0 -8px 16px -8px rgba(75, 50, 20, 0.15);
}
.cook-nav .btn-next { justify-self: end; }
.cook-nav button[disabled] { opacity: 0.4; cursor: not-allowed; }

.cook-step-item { display: none; }
.cook-step-item.active { display: block; }
.cook-step-item.done .cook-step-text { opacity: 0.5; text-decoration: line-through; }

/* Invite code box */
.invite-code-box {
    display: block;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-2);
    word-break: break-all;
}

/* Group card */
.group-card { padding: 22px 26px; text-decoration: none; color: inherit; display: block; }
.group-card h3 { margin: 0 0 6px; font-size: 22px; font-family: var(--f-display); color: var(--ink); }

/* Forms */
.form-card { padding: 32px; display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding-top: 24px; border-top: 1px dashed var(--border-strong); }
form ul { color: var(--terra-deep); font-family: var(--f-ui); font-size: 13px; padding-left: 18px; margin: 6px 0 0; }
.form-card > div, .form-card > fieldset, .form-card > p { display: flex; flex-direction: column; }

/* Flash */
.flash { padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 16px; font-family: var(--f-ui); font-size: 14px; }
.flash-error { background: var(--terra-tint); border: 1px solid var(--terra-soft); color: var(--terra-deep); }

/* Empty */
.empty { text-align: center; padding: 64px 24px; color: var(--ink-3); }
.empty p { font-style: italic; font-size: 18px; margin: 0 0 24px; }

/* Page enter */
.page-enter { animation: pageIn 320ms ease-out; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* MCP setup section */
details.mcp-setup {
    margin-top: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 0;
    box-shadow: var(--shadow-card);
}
details.mcp-setup > summary {
    cursor: pointer;
    padding: 16px 22px;
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: 15px;
    color: var(--ink);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
details.mcp-setup > summary::before {
    content: "▸";
    color: var(--terra);
    font-size: 12px;
    transition: transform 160ms;
    display: inline-block;
}
details.mcp-setup[open] > summary::before { transform: rotate(90deg); }
details.mcp-setup > summary::-webkit-details-marker { display: none; }
.mcp-setup-body { padding: 8px 22px 22px; border-top: 1px solid var(--border); }
.mcp-setup-body h4 { font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); margin: 18px 0 6px; text-transform: uppercase; }
.mcp-setup-body p { margin: 0 0 10px; font-size: 15px; color: var(--ink-2); }
.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-2);
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
    margin: 0;
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    margin: 0 0 24px;
    box-shadow: var(--shadow-card);
}
.filter-bar:focus-within { border-color: var(--terra); box-shadow: 0 0 0 3px rgba(180, 75, 39, 0.15); }
.filter-bar input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 6px 0;
    font-family: var(--f-body);
    font-size: 16px;
}
.filter-bar input:focus { box-shadow: none; }
.filter-icon { color: var(--ink-3); flex-shrink: 0; }
.filter-clear {
    background: transparent;
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}
.filter-clear:hover { background: var(--bg-2); color: var(--ink); }

.filter-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    font-family: var(--f-ui);
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}
.filter-toggle:hover { background: var(--bg-2); color: var(--ink); }
.filter-toggle .filter-chevron { transition: transform 0.2s ease; }
.filter-toggle.is-open .filter-chevron { transform: rotate(180deg); }
.filter-toggle.is-open { background: var(--terra-tint); border-color: var(--terra-soft); color: var(--terra-deep); }

.filter-advanced {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin: -8px 0 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.filter-advanced[hidden] { display: none; }
.filter-group-label {
    font-family: var(--f-ui);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    margin-bottom: 8px;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip-filter {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--ink-2);
    cursor: pointer;
    font-family: var(--f-ui);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip-filter:hover { background: var(--bg); color: var(--ink); }
.chip-filter.is-active {
    background: var(--terra);
    border-color: var(--terra);
    color: var(--bg);
}
.filter-reset {
    align-self: flex-start;
    background: transparent;
    border: 0;
    padding: 4px 0;
    color: var(--ink-3);
    font-family: var(--f-ui);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}
.filter-reset:hover { color: var(--terra); }

/* Hamburger + Drawer */
.hamburger {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    margin-left: -4px;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--r-sm);
}
.hamburger:hover { background: var(--bg-2); }
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(43, 34, 24, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
}
.drawer-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-pop);
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-open .drawer-panel { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.drawer-close {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
    cursor: pointer;
}
.drawer-close:hover { background: var(--bg-2); color: var(--ink); }
.drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.drawer-user .user-name { font-family: var(--f-ui); font-size: 15px; font-weight: 500; }
.drawer-nav { display: flex; flex-direction: column; padding: 12px 8px; flex: 1; }
.drawer-nav a {
    font-family: var(--f-ui);
    font-size: 17px;
    color: var(--ink-2);
    padding: 14px 16px;
    border-radius: var(--r-md);
    text-decoration: none;
}
.drawer-nav a:hover { background: var(--bg-2); color: var(--ink); }
.drawer-nav a.active { background: var(--terra-tint); color: var(--terra-deep); font-weight: 500; }
.drawer-footer { padding: 18px 20px; border-top: 1px solid var(--border); }
.drawer-footer .lang-group a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; }
.drawer-footer .lang-group a.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ============ Mobile ============ */

@media (max-width: 880px) {
    .recipe-detail-hero { gap: 24px; }
    .recipe-detail-image { aspect-ratio: 16 / 10; }
    .recipe-detail-image:empty { display: none; }
    .recipe-body { gap: 32px; }
    .section-title { font-size: 28px; }
    .step-list > li { grid-template-columns: auto 1fr; gap: 16px; }
    .step-num { font-size: 28px; min-width: 36px; }
}

@media (max-width: 880px) {
    .hamburger { display: inline-flex; align-items: center; justify-content: center; }
    .app-header .app-nav { display: none; }
    .app-header .app-right { display: none; }
}

@media (max-width: 720px) {
    html, body { font-size: 16px; }
    .page, .page-narrow { padding: 24px 16px 48px; }

    /* Compact header */
    .app-header-inner { padding: 10px 12px; gap: 10px; }
    .brand-text { font-size: 18px; }

    /* Hero */
    .hero { gap: 16px; margin-bottom: 24px; }
    .hero h1 { font-size: clamp(32px, 9vw, 44px); }
    .hero-sub { font-size: 16px; }
    .hero-right { width: 100%; }
    .hero-right .btn-lg { flex: 1; justify-content: center; }

    /* Recipe detail */
    .recipe-detail-title { font-size: clamp(28px, 8vw, 40px); }
    .recipe-detail-subtitle { font-size: 17px; }
    .recipe-description { font-size: 17px; }
    .stat-row { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; padding-top: 16px; }
    .stat-value { font-size: 22px; }
    .actions-row { gap: 8px; }
    .actions-row .btn-lg { flex: 1; min-width: 0; justify-content: center; padding: 12px 14px; font-size: 14px; }

    /* Ingredients/Steps */
    .ingredients-card { padding: 18px; }
    .ingredients-header { margin-bottom: 12px; }
    .ing-amount { font-size: 18px; }
    .step-list > li { gap: 12px; }
    .step-num { font-size: 24px; min-width: 28px; padding-top: 4px; }
    .step-text { font-size: 16px; }

    /* Cook view */
    .cook-top { grid-template-columns: 1fr; padding: 12px 16px; gap: 8px; }
    .cook-top > a { justify-self: end !important; }
    .cook-top-name { font-size: 18px; }
    .cook-progress { justify-content: flex-start; flex-wrap: wrap; gap: 4px; }
    .cook-progress-dot { width: 12px; }
    .cook-progress-dot.active { width: 24px; }
    .cook-main { padding: 20px 16px; gap: 14px; }
    .cook-marker-num { font-size: 64px; }
    .cook-step-text { font-size: 18px; line-height: 1.5; }
    .cook-sidebar { padding: 20px 16px; }
    .cook-timer { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
    .cook-timer-display { font-size: 40px; }
    .cook-timer-actions { gap: 6px; }
    .cook-timer-actions .btn { padding: 6px 12px; font-size: 12px; }
    .cook-shell { padding-bottom: 88px; }
    .cook-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 12px;
        z-index: 50;
        box-shadow: 0 -8px 16px -8px rgba(75, 50, 20, 0.15);
        grid-template-columns: 1fr 1fr;
    }
    .cook-nav .meta { display: none; }
    .cook-nav .btn-lg { font-size: 14px; padding: 12px 14px; justify-content: center; }
    .cook-nav .btn-secondary.btn-lg { justify-self: start; }
    .cook-nav .btn-primary.btn-lg { justify-self: end; }

    /* Cards grid spacing */
    .recipe-grid { gap: 16px; grid-template-columns: 1fr; }
    .recipe-card-image { aspect-ratio: 16 / 10; margin: 6px; }

    /* Forms */
    .form-card { padding: 20px; gap: 12px; }
    .form-row { grid-template-columns: 1fr; gap: 12px; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn-lg { flex: 1; justify-content: center; }

    /* Login */
    .login-card { padding: 28px 20px; }
    .login-card h1 { font-size: 34px; }

    /* Misc */
    .invite-code-box { font-size: 12px; }
    .ornament { font-size: 15px; margin-top: 48px; }
}

@media (max-width: 420px) {
    .actions-row { flex-direction: column; }
    .actions-row .btn-lg { width: 100%; }
}

/* Group picker (pill-style multi-select) */
.group-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.group-picker-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.group-picker-pills {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    align-items: center;
}
.group-picker-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    background: var(--terra-tint);
    border: 1px solid var(--terra-soft);
    color: var(--terra-deep);
    border-radius: 999px;
    font-family: var(--f-ui);
    font-size: 13px;
    font-weight: 500;
}
.group-picker-pill-label { line-height: 1.2; }
.group-picker-pill-x {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.7;
    transition: background 0.15s, opacity 0.15s;
}
.group-picker-pill-x:hover {
    background: rgba(0, 0, 0, 0.08);
    opacity: 1;
}
.group-picker-empty {
    color: var(--ink-3);
    font-style: italic;
    font-size: 13px;
    font-family: var(--f-ui);
    padding: 4px 6px;
}
.group-picker-add {
    position: relative;
    display: inline-block;
}
.group-picker-add button {
    background: var(--surface);
    border: 1px dashed var(--border);
    color: var(--ink-2);
    padding: 7px 14px;
    border-radius: var(--r-md);
    font-family: var(--f-ui);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.group-picker-add button:hover:not(:disabled) {
    background: var(--terra-tint);
    border-color: var(--terra-soft);
    border-style: solid;
    color: var(--terra-deep);
}
.group-picker-add button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.group-picker-menu-item {
    padding: 8px 12px;
    border-radius: var(--r-sm, 6px);
    cursor: pointer;
    font-family: var(--f-ui);
    font-size: 14px;
    color: var(--ink-1);
}
.group-picker-menu-item:hover {
    background: var(--terra-tint);
    color: var(--terra-deep);
}

.group-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    z-index: 20;
    width: 280px;
    max-width: calc(100vw - 32px);
    max-height: 320px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
}
input.group-picker-search[type=text] {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 10px 14px;
    font-family: var(--f-ui);
    font-size: 14px;
    color: var(--ink);
    background: var(--surface);
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
    outline: none;
    transition: background 160ms;
}
input.group-picker-search[type=text]:focus {
    border-color: transparent;
    border-bottom-color: var(--terra-soft);
    background: var(--surface-2);
    box-shadow: none;
}
.group-picker-menu-list {
    list-style: none;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    flex: 1;
}
