:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --secondary: #475569;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #526071;
    --border: #dce2e8;
    --soft: #e0f2fe;
    --soft-alt: #eef2f6;
    --hero-start: #e8f4fb;
    --hero-end: #eef2f7;
    --placeholder-start: #e0f2fe;
    --placeholder-end: #e2e8f0;
    --primary-shadow: rgba(2, 132, 199, 0.25);
    --cook-accent: #7dd3fc;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --input-bg: #ffffff;
    --badge-glass: rgba(255, 255, 255, 0.94);
    --tip-bg: #fffbeb;
    --tip-border: #fde68a;
    --tip-text: #78350f;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.2rem; }
.section-space { padding: 2.2rem 1.2rem; }

/* Navbar */
.navbar { background: var(--nav-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.25rem; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { font-weight: 600; font-size: .95rem; }
.nav-links a.active { color: var(--primary); }
.nav-muted { color: var(--muted); font-size: .85rem !important; }
.user-pill { display: inline-flex; align-items: center; gap: .45rem; background: var(--soft-alt); padding: .3rem .75rem .3rem .35rem; border-radius: 99px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem 1.2rem; border-radius: 12px; font-weight: 700; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn-sm { padding: .45rem .9rem; font-size: .88rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.05rem; width: 100%; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost.is-active { background: var(--soft); border-color: var(--primary); color: var(--primary); }

/* Hero & Search */
.hero { background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%); border-bottom: 1px solid var(--border); padding: 3rem 0 2.2rem; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 0 0 .5rem; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 1.6rem; }
.search-bar { display: grid; grid-template-columns: 1fr auto auto auto; gap: .6rem; max-width: 860px; margin: 0 auto 1.2rem; background: var(--surface); padding: .55rem; border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.search-bar input, .search-bar select { border: none; padding: .65rem .8rem; font-size: .95rem; background: transparent; color: var(--text); outline: none; }
.filter-pills { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .7rem; }
.pill { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: .4rem .95rem; border-radius: 99px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill-outline.active { background: var(--secondary); border-color: var(--secondary); color: #fff; }

/* Grid & Cards */
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem; }
.fridge-banner-link { background: var(--soft); color: var(--primary-dark); padding: .5rem 1rem; border-radius: 12px; font-size: .92rem; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.recipe-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s; }
.recipe-card:hover { transform: translateY(-3px); }
.card-media { position: relative; height: 195px; display: block; background: var(--soft-alt); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; background: linear-gradient(135deg, var(--placeholder-start), var(--placeholder-end)); }
.badge-cat { position: absolute; top: 12px; left: 12px; background: var(--badge-glass); color: var(--text); padding: .25rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.badge-time { position: absolute; bottom: 12px; right: 12px; background: rgba(31,36,33,.82); color: #fff; padding: .25rem .65rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.badge-match { position: absolute; bottom: 12px; left: 12px; background: var(--secondary); color: #fff; padding: .25rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.card-body { padding: 1.2rem; display: flex; flex-direction: column; flex: 1; }
.card-meta-top { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: .4rem; }
.rating-chip { color: #d97706; font-weight: 700; }
.card-title { margin: 0 0 .5rem; font-size: 1.15rem; line-height: 1.3; }
.card-title a:hover { color: var(--primary); }
.card-summary { color: var(--muted); font-size: .9rem; margin: 0 0 .9rem; flex: 1; }
.card-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.mini-tag { background: var(--soft); color: var(--primary-dark); font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 6px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: .8rem; font-size: .85rem; }
.author-info { display: flex; align-items: center; gap: .45rem; }
.avatar-dot { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; }
.card-actions { display: flex; gap: .4rem; }
.icon-btn { background: var(--soft-alt); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; font-weight: 600; }
.icon-btn.is-active { background: var(--soft); border-color: var(--primary); color: var(--primary); }

/* Recipe Detail */
.recipe-header-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.8rem; box-shadow: var(--shadow); margin-bottom: 2rem; }
.recipe-badges { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-bottom: .6rem; }
.badge-cat-inline { background: var(--soft); color: var(--primary); font-weight: 700; padding: .2rem .7rem; border-radius: 99px; }
.recipe-header-info h1 { margin: 0 0 .7rem; font-size: 1.95rem; }
.recipe-lead { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.3rem; }
.time-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1.4rem; }
.time-box { background: var(--bg); padding: .7rem; border-radius: 12px; text-align: center; }
.time-box span { display: block; font-size: .78rem; color: var(--muted); }
.time-box strong { font-size: 1.05rem; }
.recipe-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; }
.recipe-header-media img, .detail-placeholder { width: 100%; height: 100%; min-height: 260px; object-fit: cover; border-radius: 16px; }
.detail-placeholder { background: linear-gradient(135deg, var(--placeholder-start), var(--placeholder-end)); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 4rem; }
.detail-placeholder small { font-size: .85rem; color: var(--muted); margin-top: .5rem; }

.recipe-columns { display: grid; grid-template-columns: 340px 1fr; gap: 2rem; align-items: start; }
.ingredients-panel, .steps-panel, .builder-card, .auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.panel-head h2 { margin: 0; font-size: 1.25rem; }
.servings-control { display: inline-flex; align-items: center; gap: .6rem; background: var(--bg); padding: .3rem .6rem; border-radius: 10px; border: 1px solid var(--border); }
.servings-control button { width: 28px; height: 28px; border: none; background: var(--surface); color: var(--text); border-radius: 8px; font-weight: 800; cursor: pointer; }
.hint-text { font-size: .85rem; color: var(--muted); margin-top: 0; }
.ingredient-list { list-style: none; padding: 0; margin: 1rem 0; }
.ingredient-item { padding: .55rem 0; border-bottom: 1px dashed var(--border); }
.ingredient-item label { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.ingredient-item input:checked ~ span { text-decoration: line-through; opacity: .5; }
.ing-qty { font-weight: 700; color: var(--primary); }

.step-card { padding: 1.1rem 1.2rem; border-left: 4px solid var(--primary); background: var(--bg); border-radius: 0 12px 12px 0; margin-bottom: 1rem; }
.step-number { font-weight: 800; color: var(--primary); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.step-text { margin: 0 0 .6rem; }
.timer-pill { background: var(--surface); border: 1px solid var(--primary); color: var(--primary); padding: .4rem .85rem; border-radius: 99px; font-weight: 700; font-size: .85rem; cursor: pointer; }

/* Comments */
.comments-section { margin-top: 2.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.8rem; }
.comment-form textarea, .builder-form input[type="text"], .builder-form input[type="number"], .builder-form textarea, .builder-form select, .auth-box input, input[type="email"], input[type="password"], input[type="file"] { width: 100%; padding: .65rem .85rem; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); border-radius: 10px; font-size: .95rem; margin-bottom: .8rem; font-family: inherit; }
.form-row-inline { display: grid; grid-template-columns: 220px 1fr; gap: .8rem; }
.comment-card { border-top: 1px solid var(--border); padding: 1rem 0; }
.comment-head { display: flex; justify-content: space-between; align-items: center; }
.stars { color: #f59e0b; }
.community-tip { background: var(--tip-bg); border: 1px solid var(--tip-border); color: var(--tip-text); padding: .5rem .8rem; border-radius: 8px; font-size: .9rem; margin: .5rem 0; }

/* Cook Mode Fullscreen */
.cook-modal { position: fixed; inset: 0; background: #181c1a; color: #fff; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.cook-modal[hidden] { display: none; }
.cook-modal-inner { max-width: 760px; width: 100%; display: flex; flex-direction: column; min-height: 70vh; justify-content: space-between; }
.cook-top, .cook-nav { display: flex; justify-content: space-between; align-items: center; }
.cook-body { text-align: center; padding: 2rem 0; }
.cook-body h2 { color: var(--cook-accent); font-size: 1.4rem; }
.cook-body p { font-size: clamp(1.3rem, 2.8vw, 1.9rem); line-height: 1.5; }

/* Timers Floating Bar */
.timers-bar { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: .5rem; z-index: 90; }
.active-timer-chip { background: #1f2421; color: #fff; padding: .65rem 1rem; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.25); display: flex; align-items: center; gap: .8rem; font-weight: 700; }

/* Fridge & Forms */
.fridge-form { max-width: 720px; margin: 0 auto; }
.fridge-input-row { display: flex; gap: .5rem; }
.fridge-input-row input { flex: 1; padding: .75rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font-size: 1rem; }
.selected-chips { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0; }
.chip-selected { background: var(--secondary); color: #fff; padding: .4rem .9rem; border-radius: 99px; font-weight: 700; cursor: pointer; }
.builder-card { margin-bottom: 1.4rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.ing-row { display: grid; grid-template-columns: 100px 130px 1fr 40px; gap: .5rem; align-items: start; }
.step-row { background: var(--bg); padding: .9rem; border-radius: 12px; margin-bottom: .8rem; }
.step-timer-input { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.step-timer-input input { width: 90px !important; margin-bottom: 0 !important; }
.btn-remove { background: var(--danger-bg); color: var(--danger-text); border: none; border-radius: 8px; height: 38px; width: 38px; cursor: pointer; font-weight: 700; }
.checkbox-group { display: flex; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1rem; }
.auth-box { max-width: 440px; margin: 2.5rem auto; }
.alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.profile-banner { display: flex; align-items: center; gap: 1.2rem; background: var(--surface); padding: 1.5rem; border-radius: 18px; border: 1px solid var(--border); margin-bottom: 1.5rem; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; }
.my-recipe-row { display: flex; justify-content: space-between; align-items: center; background: var(--surface); padding: 1rem 1.2rem; border-radius: 12px; border: 1px solid var(--border); margin-bottom: .6rem; }

/* Toast & Footer */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2421; color: #fff; padding: .7rem 1.3rem; border-radius: 99px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 120; }
.toast.show { opacity: 1; }
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.8rem 0; margin-top: 3rem; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-links { display: flex; gap: 1.2rem; }

@media (max-width: 820px) {
    .search-bar, .recipe-header-card, .recipe-columns, .grid-3, .form-row-inline, .ing-row { grid-template-columns: 1fr; }
}

/* Admin & Planner Extensions */
.badge-admin-nav { background: #1f2421; color: #fff !important; padding: .3rem .7rem; border-radius: 8px; font-size: .85rem !important; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); padding: .85rem 1rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 600; }
.admin-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem; box-shadow: var(--shadow); }
.kpi-card span { display: block; font-size: .85rem; color: var(--muted); }
.kpi-card strong { font-size: 1.8rem; color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: .82rem; text-transform: uppercase; }
.btn-danger-xs { background: var(--danger-bg); color: var(--danger-text); border: none; padding: .35rem .65rem; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: .8rem; }
.badge-role { background: var(--soft-alt); color: var(--text); padding: .2rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.badge-role.is-admin { background: var(--soft); color: var(--primary); }

/* Planner */
.planner-layout { display: grid; grid-template-columns: 1fr 330px; gap: 1.8rem; align-items: start; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.day-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.day-card-head { background: var(--primary); color: #fff; font-weight: 800; padding: .65rem 1rem; font-size: 1rem; }
.meal-slot-box { padding: .85rem 1rem; border-bottom: 1px dashed var(--border); }
.meal-slot-box:last-child { border-bottom: none; }
.slot-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: .4rem; }
.planned-title { font-weight: 700; color: var(--text); display: block; margin-bottom: .35rem; font-size: .95rem; }
.planned-title:hover { color: var(--primary); }
.planned-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.quick-assign-form select, .quick-assign-form input { width: 100%; padding: .45rem .6rem; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); border-radius: 8px; font-size: .85rem; margin-bottom: .4rem; }
.quick-assign-bottom { display: flex; gap: .4rem; }
.quick-assign-bottom input { width: 70px; margin-bottom: 0; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem; max-width: 420px; width: 100%; box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.modal-card select, .modal-card input { width: 100%; padding: .6rem .8rem; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); border-radius: 10px; margin-bottom: .8rem; }

@media (max-width: 900px) {
    .admin-kpi-grid, .planner-layout, .grid-2 { grid-template-columns: 1fr; }
}

/* Vector SVG Icons System */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.brand-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px var(--primary-shadow); }
.nav-item { display: inline-flex; align-items: center; gap: .38rem; }
.title-with-icon { display: inline-flex; align-items: center; gap: .5rem; }
.hero-title-icon { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; }
.brand-footer { display: inline-flex; align-items: center; gap: .45rem; }
.kpi-label { display: inline-flex !important; align-items: center; gap: .4rem; }
.placeholder-svg { color: var(--primary); opacity: .75; }
.empty-icon-circle { width: 68px; height: 68px; border-radius: 50%; background: var(--soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .8rem; }
.icon-fill { fill: currentColor; }
.is-active .icon-heart, .is-active .icon-bm { fill: currentColor; }
.badge-cat, .badge-time, .badge-match, .rating-chip, .mini-tag, .fridge-banner-link, .timer-pill, .community-tip, .slot-label, .alert-success { display: inline-flex; align-items: center; gap: .35rem; }
.badge-admin-nav { display: inline-flex; align-items: center; gap: .35rem; }

/* v1.3.0 Features: Author follow strip, Bookmark folders, Unit switcher, Private notes, Print styles */
.author-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .7rem .95rem;
    margin: .9rem 0 1.1rem;
}
.bookmark-folder-bar {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    margin-top: .75rem;
    background: var(--soft);
    border: 1px solid var(--border);
    padding: .45rem .75rem;
    border-radius: 10px;
}
.bookmark-folder-bar select {
    padding: .35rem .6rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: .85rem;
}
.unit-switch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .65rem;
    padding: .45rem .6rem;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
}
.unit-switch-btns { display: inline-flex; gap: .3rem; }
.unit-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    padding: .28rem .55rem;
    border-radius: 7px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}
.unit-btn.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.private-note-box {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}
.private-note-box textarea {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .88rem;
    margin-bottom: .5rem;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}
.folder-move-form { margin-top: .75rem; }
.folder-move-form select {
    width: 100%;
    padding: .42rem .6rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: .84rem;
}

@media print {
    .no-print, .navbar, .footer, #toast, .cook-modal, .timers-bar, .modal-overlay { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .recipe-header-card, .ingredients-panel, .steps-panel { box-shadow: none !important; border: 1px solid #d1d5db !important; }
    .recipe-columns { grid-template-columns: 1fr 1.6fr !important; }
}


/* Dark Mode (v1.4.0) */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--soft-alt);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.theme-toggle-btn .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle-btn .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle-btn .theme-icon-sun { display: inline-flex; color: #fbbf24; }

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --soft: rgba(56, 189, 248, 0.14);
    --soft-alt: #263347;
    --hero-start: #132238;
    --hero-end: #172033;
    --placeholder-start: #1e293b;
    --placeholder-end: #0f172a;
    --nav-bg: rgba(15, 23, 42, 0.88);
    --input-bg: #0f172a;
    --badge-glass: rgba(15, 23, 42, 0.88);
    --tip-bg: rgba(245, 158, 11, 0.14);
    --tip-border: rgba(245, 158, 11, 0.35);
    --tip-text: #fde68a;
    --danger-bg: rgba(239, 68, 68, 0.18);
    --danger-text: #fca5a5;
    --success-bg: rgba(16, 185, 129, 0.16);
    --success-border: rgba(16, 185, 129, 0.38);
    --success-text: #6ee7b7;
    --shadow: 0 10px 28px rgba(2, 6, 23, 0.45);
}

html[data-theme="dark"] .badge-admin-nav {
    background: var(--primary);
    color: #fff !important;
}
html[data-theme="dark"] .alert {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.38);
    color: #fca5a5;
}
html[data-theme="dark"] code {
    background: rgba(15, 23, 42, 0.7);
    padding: .1rem .35rem;
    border-radius: 5px;
    color: #93c5fd;
}


/* Liste de courses avancée (Semainier : rayons, articles libres, cases cochées) */
.shopping-panel-enhanced { width: 100%; }
.shopping-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.custom-shopping-form { display: grid; grid-template-columns: 1fr 122px auto; gap: .4rem; margin-bottom: .9rem; }
.custom-shopping-form input, .custom-shopping-form select { padding: .48rem .6rem; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); border-radius: 9px; font-size: .84rem; min-width: 0; }
.shopping-groups-wrap { display: flex; flex-direction: column; gap: .95rem; margin-bottom: .5rem; }
.shopping-aisle-group { background: var(--soft-alt); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .75rem; }
.shopping-aisle-title { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--primary-dark); margin-bottom: .45rem; padding-bottom: .35rem; border-bottom: 1px dashed var(--border); }
[data-theme="dark"] .shopping-aisle-title { color: var(--primary); }
.aisle-count { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: .05rem .45rem; font-size: .72rem; }
.shopping-aisle-list { margin: 0; }
.shopping-item { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .35rem 0; border-bottom: 1px solid rgba(148, 163, 184, .18); }
.shopping-item:last-child { border-bottom: none; padding-bottom: 0; }
.shopping-item label { flex: 1; margin: 0; cursor: pointer; }
.shopping-item.is-checked .ing-qty,
.shopping-item.is-checked .ing-unit,
.shopping-item.is-checked .ing-name { text-decoration: line-through; opacity: .55; }
.custom-item-tag { display: inline-block; margin-left: .4rem; font-size: .68rem; font-weight: 700; padding: .08rem .42rem; border-radius: 99px; background: var(--soft); color: var(--primary-dark); vertical-align: middle; }
[data-theme="dark"] .custom-item-tag { color: var(--primary); }

/* Mode liste simple (aplatissement visuel des groupes de rayons) */
.shopping-groups-wrap.is-flat-view { gap: 0; background: var(--soft-alt); border: 1px solid var(--border); border-radius: 12px; padding: .55rem .75rem; }
.shopping-groups-wrap.is-flat-view .shopping-aisle-group { background: transparent; border: none; border-radius: 0; padding: 0; }
.shopping-groups-wrap.is-flat-view .shopping-aisle-title { display: none; }
.shopping-groups-wrap.is-flat-view .shopping-item { border-bottom: 1px solid rgba(148, 163, 184, .18); padding: .38rem 0; }
.shopping-groups-wrap.is-flat-view .shopping-aisle-group:last-child .shopping-item:last-child { border-bottom: none; }

@media (min-width: 901px) {
    .planner-layout { grid-template-columns: 1fr 370px; }
}

.remix-origin-badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); background: var(--soft-alt); padding: .35rem .75rem; border-radius: 10px; margin: .25rem 0 .75rem; }
.remix-origin-badge a { color: var(--primary); text-decoration: underline; }
.chef-public-banner { justify-content: space-between; flex-wrap: wrap; }
.chef-stats-strip { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }

/* Menu déroulant utilisateur dans la barre de navigation */
.user-menu { position: relative; display: inline-flex; align-items: center; }
.user-menu-trigger { border: 1px solid var(--border); font-family: inherit; font-size: .9rem; font-weight: 700; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.user-menu-trigger:hover, .user-menu.is-open .user-menu-trigger { border-color: var(--primary); background: var(--soft); }
.user-menu-chevron { transition: transform .18s ease; opacity: .75; }
.user-menu.is-open .user-menu-chevron { transform: rotate(180deg); color: var(--primary); opacity: 1; }
.user-menu-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 228px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16); padding: .4rem; z-index: 999; flex-direction: column; gap: .15rem; text-align: left; }
.user-menu.is-open .user-menu-dropdown, .user-menu-dropdown:not([hidden]) { display: flex; }
.user-menu-dropdown[hidden] { display: none; }
html[data-theme="dark"] .user-menu-dropdown { box-shadow: 0 16px 36px rgba(2, 6, 23, 0.65); }
.user-menu-header { padding: .45rem .65rem .55rem; border-bottom: 1px solid var(--border); margin-bottom: .2rem; }
.user-menu-header strong { display: block; font-size: .92rem; color: var(--text); line-height: 1.25; }
.user-menu-header small { display: block; font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.user-menu-item { display: flex; align-items: center; gap: .55rem; padding: .52rem .65rem; border-radius: 9px; font-size: .88rem; font-weight: 600 !important; color: var(--text); transition: background .12s, color .12s; }
.user-menu-item:hover { background: var(--soft-alt); color: var(--primary); }
.user-menu-item.is-danger { color: var(--danger-text); }
.user-menu-item.is-danger:hover { background: var(--danger-bg); color: var(--danger-text); }
.user-menu-divider { height: 1px; background: var(--border); margin: .25rem .35rem; }


/* Progression des étapes & bouton « Faite » */
.steps-progress-pill {
    display: inline-flex;
    align-items: center;
    padding: .28rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    background: var(--soft);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}
html[data-theme="dark"] .steps-progress-pill {
    color: #7dd3fc;
}
.steps-progress-pill.is-complete {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}
.steps-progress-track {
    width: 100%;
    height: 7px;
    background: var(--soft-alt);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.15rem;
    border: 1px solid var(--border);
}
.steps-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width .25s ease;
}
.step-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin-bottom: .45rem;
}
.step-top-row .step-number {
    margin-bottom: 0;
}
.step-done-btn {
    display: inline-flex;
    align-items: center;
    gap: .36rem;
    padding: .32rem .72rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: all .15s ease;
}
.step-done-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--soft);
}
.step-done-btn.is-done {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}
.step-card.is-done {
    border-left-color: #10b981;
    opacity: .84;
}
.step-card.is-done .step-text {
    text-decoration: line-through;
    color: var(--muted);
}
