/* Judas Feast. Ported from assets/index.html (tokens, chrome, dock, start menu, drawer, portal,
   feed, detail). Only the pages that exist are styled; add the rest as they are built. */

:root {
    color-scheme: dark;
    --bg: #080607;
    --deep: #0c0809;
    --panel: #100b0c;
    --panel2: #170e11;
    --line: #392126;
    --linehi: #754147;
    --red: #df4343;
    --redlit: #ff625d;
    --cream: #f3e5df;
    --text: #e5d0c5;
    --muted: #a68e90;
    --soft: #765e5d;
    --font: Consolas, 'Lucida Console', 'Courier New', monospace;
    --narrow: 'Arial Narrow', 'Liberation Sans Narrow', 'Roboto Condensed', Impact, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
#app:focus, h1:focus { outline: none; }

body {
    margin: 0;
    padding-bottom: 62px;
    background: radial-gradient(ellipse 95% 260px at 50% 130px, #1d080c52, transparent 75%), #080607;
    color: var(--text);
    font: 16px/1.6 var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app { flex: 1; }

body::before {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, #ffffff03 4px);
    opacity: .35;
}

body.no-scan::before { display: none; }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; color: inherit; transition: color .15s, border-color .15s, background .15s; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--red); color: #fff; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
    outline: 2px solid var(--redlit);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.wrap { width: min(calc(100% - 64px), 1480px); margin: 0 auto; }
.page { padding: 30px 0 58px; }

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--linehi);
    background: transparent;
    color: var(--cream);
    min-height: 38px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .075em;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn:hover { border-color: var(--redlit); background: #32191c; }
.btn.primary { border-color: var(--red); background: var(--red); color: #190707; }
.btn.primary:hover { background: var(--redlit); border-color: var(--redlit); }
.btn.subtle { border-color: var(--line); color: var(--muted); }

/* Status bar across the top */
.site-chrome {
    position: sticky;
    top: 0;
    z-index: 70;
    height: 88px;
    background: #090607ef;
    border-bottom: 1px solid #342023;
    backdrop-filter: blur(15px);
}

.chrome-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    height: 54px;
    padding: 0 12px;
}

.chrome-ticker {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-top: 1px solid #261619;
    color: #ac9493;
    font-size: 14px;
    letter-spacing: .07em;
    white-space: nowrap;
}

.chrome-inner > * { min-width: 0; color: #ac9493; font-size: 14px; letter-spacing: .07em; white-space: nowrap; }
.chrome-inner button, .chrome-inner a { padding: 4px 0; border: 0; background: none; text-align: left; }
.chrome-left { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.chrome-home { color: #e2b6b5; font-size: 14px; line-height: 1; }
.chrome-home:hover { color: var(--redlit); }
.presence-status { display: flex; align-items: center; gap: 7px; color: #e8c4c1; }
.presence-status:hover, .presence-status.open { color: var(--redlit); }
.presence-status.live .presence-dot { animation: pulse 1.6s ease-in-out infinite; }
.chrome-fade { color: #806465; overflow: hidden; text-overflow: ellipsis; }

.presence-dot, .dock-live {
    display: inline-block;
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: 50%;
    background: #e14444;
    box-shadow: 0 0 9px #e14444b0;
}

@keyframes pulse { 50% { opacity: .35; } }

body.no-glow .presence-dot, body.no-glow .dock-live, body.no-glow .start-orb { box-shadow: none; }

.now-ticker { overflow: hidden; text-overflow: ellipsis; }
.now-ticker span { color: #e24a46; }
.now-ticker a { padding: 0; }
.now-ticker a:hover { color: var(--cream); }
.chrome-inner .chrome-gear { text-align: right; color: #e2b6b5; font-size: 18px; line-height: 1; }
.chrome-gear:hover, .chrome-gear.open { color: var(--redlit); }

/* Library toolbar and recipe feed */
.library-section { padding: 0 0 56px; }

.library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    margin: 0 0 23px;
    padding: 8px 0;
    border-top: 1px solid #43262b;
    border-bottom: 1px solid #43262b;
}

.filters { display: flex; flex-wrap: wrap; flex: 1; gap: 3px; min-width: 0; margin: 0; }

.chip {
    padding: 8px 7px;
    border: 1px solid transparent;
    background: transparent;
    color: #af9998;
    font-size: 14px;
    white-space: nowrap;
}

.chip:hover { color: var(--cream); }
.chip.active { background: #321419; color: #ff7770; border-color: #613035; }

.search {
    display: flex;
    align-items: center;
    flex: none;
    gap: 10px;
    width: 310px;
    max-width: 100%;
    height: 35px;
    padding: 0 9px;
    background: #120c0e;
    border: 1px solid var(--line);
    color: var(--red);
}

.search input { width: 100%; border: 0; outline: 0; background: none; color: var(--cream); font-size: 14px; }
.search input::placeholder { color: var(--soft); }
.shortcut { font-size: 14px; color: #6b4c52; white-space: nowrap; }


.feed-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin: 0 0 13px; }
.feed-head h1, .feed-head h2 { margin: 6px 0 0; color: #edddd8; font-size: 21px; letter-spacing: -.02em; }
.feed-slash { color: #e14b48; }
.feed-sort { display: flex; align-items: center; gap: 13px; }
.counter { color: var(--muted); font-size: 14px; white-space: nowrap; }

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.recipe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 203px;
    background: linear-gradient(150deg, #120c0e, #0c090a);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background .2s;
}

.recipe-card:hover { background: #1c1013; }
.card-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0b080a; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 20px 14px; }

.recipe-card .num {
    position: absolute;
    right: 20px;
    top: 14px;
    z-index: 1;
    padding: 0 6px;
    background: #080607b0;
    color: #c9a3a1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.card-top { display: flex; align-items: center; gap: 9px; min-height: 24px; }
.tag { color: var(--redlit); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.tag.muted { color: var(--muted); }

.card-title {
    margin: 13px 0 7px;
    color: var(--cream);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 900;
}

.recipe-card:hover .card-title { color: var(--redlit); }
.card-desc { margin: 0 0 7px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.card-spacer { flex: 1; }

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #382124;
    color: var(--muted);
    font-size: 14px;
}

.empty { grid-column: 1 / -1; padding: 40px; border: 1px dashed var(--linehi); text-align: center; color: var(--muted); }
.load-more { margin: 24px 0 0; text-align: center; }
.section-link { color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.section-link:hover { color: var(--redlit); }

/* Recipe page */
.back { display: inline-block; padding: 0 0 22px; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--redlit); }

.detail-heading h1 {
    margin: 7px 0 11px;
    color: var(--cream);
    font-size: clamp(28px, 4vw, 45px);
    line-height: 1.06;
    letter-spacing: -.06em;
}

.summary { max-width: 730px; margin: 0 0 22px; color: var(--muted); font-size: 16px; line-height: 1.7; }

.recipe-hero {
    display: block;
    width: 100%;
    max-height: 520px;
    margin: 0 0 20px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
    color: var(--muted);
    font-size: 14px;
}

.unit-toggle { display: inline-flex; margin-left: auto; }

.unit-toggle button {
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.unit-toggle button + button { border-left: 0; }
.unit-toggle button[aria-pressed="true"] { background: #321517; border-color: var(--red); color: var(--cream); }

.recipe-columns {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(0, 1.35fr);
    gap: 27px;
    padding: 27px 23px 30px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.subhead { margin: 0 0 16px; color: var(--redlit); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.ingredients, .steps { margin: 0; padding: 0; list-style: none; }
.ingredients li { margin: 0 0 11px; color: var(--text); font-size: 16px; line-height: 1.5; }
.ingredient-group { margin: 18px 0 10px; color: var(--muted); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.ingredient-group:first-of-type { margin-top: 0; }
.ingredients small { color: var(--muted); }
.steps { counter-reset: step; }

.steps li {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    line-height: 1.7;
}

.steps li:last-child { margin: 0; padding: 0; border: 0; }

.steps li::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    flex: none;
    min-width: 20px;
    color: var(--redlit);
}

.step-meta { color: var(--muted); }
.recipe-notes { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.coming { padding: 60px 0; }
.coming h1 { margin: 8px 0; color: var(--cream); }

.bullet { margin: 0 8px; color: #b64240; }

/* Bottom dock and start menu */
.bottom-dock {
    position: sticky;
    bottom: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: 1fr 90px 1fr;
    align-items: center;
    height: 62px;
    padding: 0 12px;
    background: #0d0809ef;
    border-top: 1px solid #6b3135;
    backdrop-filter: blur(18px);
    box-shadow: 0 -10px 25px #0005;
}

.dock-left, .dock-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: #ac9290;
    font-size: 14px;
    white-space: nowrap;
}

.dock-center { position: relative; align-self: center; justify-self: center; }

.start-orb {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid #a5383a;
    background: radial-gradient(circle at 50% 25%, #58171e, #230c0f 70%);
    color: #f5a29a;
    font-size: 26px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 0 0 4px #0d0809, 0 0 19px #92242e70;
    transform: translateY(-9px);
}

.start-orb:hover, .start-orb.is-open {
    border-color: #ff6f67;
    color: #fff;
    box-shadow: 0 0 0 4px #0d0809, 0 0 24px #de363b83;
}

body.no-glow .start-orb:hover, body.no-glow .start-orb.is-open { box-shadow: 0 0 0 4px #0d0809; }

.dock-right { justify-content: flex-end; gap: 13px; }
.dock-right a { padding: 5px 0; color: #a68c8b; }
.dock-right a:hover { color: #fa7771; }
.dock-time { padding-left: 12px; border-left: 1px solid #4a292d; color: #bda4a0; }

.start-menu {
    position: absolute;
    left: 50%;
    bottom: 61px;
    width: 340px;
    max-height: calc(100vh - 90px);
    padding: 8px;
    overflow: auto;
    transform: translateX(-50%);
    background: #160d10;
    border: 1px solid #8c3e41;
    box-shadow: 0 18px 45px #000d;
}

.menu-head { display: flex; justify-content: space-between; padding: 10px 11px 13px; color: #f4d2d0; font-size: 14px; }
.menu-head span { color: #7c5256; font-size: 14px; }
.menu-label { padding: 8px 11px 4px; color: #7c5256; font-size: 14px; letter-spacing: .1em; }

.start-menu a:not(.btn) {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 11px;
    border-top: 1px solid #382124;
    color: #d0b8b2;
    font-size: 14px;
}

.start-menu a:not(.btn):hover { background: #32171c; color: #fff; }
.start-menu a:not(.btn) span { width: 14px; color: #b14848; text-align: center; }
.start-menu a:not(.btn) b { margin-left: auto; color: #d35852; font-size: 14px; font-weight: 400; }

.menu-status { margin-top: 8px; padding: 10px 11px; background: #211214; border: 1px solid #4e292e; font-size: 14px; }
.menu-status strong { display: block; color: #f1a3a0; font-size: 14px; letter-spacing: .08em; }
.menu-status small { display: block; margin: 4px 0 0; color: #ab9090; font-size: 14px; line-height: 1.6; }
.menu-status .btn { margin-top: 8px; }
.menu-mobile { display: none; }
.menu-hint { padding: 12px 11px 4px; color: #7f5c5d; font-size: 14px; }
.menu-copy { margin: 0; padding: 0 11px 8px; color: #604f51; font-size: 14px; }

/* Settings drawer */
.site-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 99;
    width: 390px;
    max-width: 100vw;
    padding: 20px 23px;
    overflow: auto;
    background: #140b0d;
    border-left: 1px solid #662d36;
    box-shadow: -14px 0 44px #000a;
    transform: translateX(102%);
    transition: transform .2s;
}

.site-drawer.open { transform: translateX(0); }
.site-drawer.left {
    right: auto;
    left: 0;
    display: flex;
    flex-direction: column;
    border-left: 0;
    border-right: 1px solid #662d36;
    box-shadow: 14px 0 44px #000a;
    transform: translateX(-102%);
}

.site-drawer.left.open { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 18px;
    border-bottom: 1px solid #583035;
    color: #f1a3a0;
    font-size: 14px;
    letter-spacing: .08em;
}

.drawer-close { border: 0; background: transparent; color: #be9998; font-size: 23px; }
.site-drawer h2 { margin: 28px 0 12px; color: #cb7571; font-size: 14px; letter-spacing: .08em; }

.guest-panel {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    background: #211214;
    border: 1px solid #4e292e;
    color: #dcc2b9;
    font-size: 14px;
}

.guest-panel strong {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 1px solid #945254;
    color: #e1706e;
    font-size: 24px;
}

.guest-panel small { display: block; margin-top: 4px; color: #ab9090; font-size: 14px; }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid #3c2427;
    color: #c5a8a4;
    font-size: 14px;
}

.setting-row input { accent-color: #df4444; }
.drawer-note { color: #ad9391; font-size: 14px; line-height: 1.8; }
.drawer-scrim { position: fixed; inset: 0; z-index: 90; background: #0008; }

.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.drawer-actions form { margin: 0; }
.btn.tiny { padding: 8px 11px; font-size: 14px; }

.select {
    min-width: 135px;
    height: 33px;
    padding: 0 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.select.wide { width: 100%; height: 38px; color: var(--cream); font-size: 14px; }

.field-input {
    width: 100%;
    min-width: 0;
    padding: 11px;
    background: #090607;
    border: 1px solid var(--linehi);
    color: var(--cream);
    font-size: 14px;
}

.field-input::placeholder { color: var(--soft); }

/* Page channel */
.chatlog { display: flex; flex-direction: column; flex: 1; gap: 8px; min-height: 120px; padding: 14px 0; overflow: auto; }
.chatline { color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.chatline.system { color: var(--muted); font-size: 14px; }
.chatline .uname { color: var(--redlit); }
.chatline.admin .uname { color: #f1a3a0; text-shadow: 0 0 8px #df434380; }

.chat-del, .chat-mute {
    margin-left: 6px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.chat-del:hover, .chat-mute:hover { border-color: var(--red); color: var(--redlit); }
.chatinput { padding-top: 12px; border-top: 1px solid #583035; }
.chat-compose { display: flex; gap: 8px; }
.chat-compose .field-input { flex: 1; }
.locked { margin-bottom: 10px; color: var(--muted); font-size: 14px; letter-spacing: .08em; }

/* Search overlay */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 12vh 14px 0;
    background: #000b;
    backdrop-filter: blur(4px);
}

.command { width: min(620px, 100%); padding: 18px 20px; background: #120a0c; border: 1px solid var(--linehi); box-shadow: 0 25px 100px #000a; }
.command .field-input { margin-top: 14px; }
.command-results { max-height: 46vh; margin-top: 10px; overflow: auto; }

.cmdrow {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-top: 1px solid #382124;
    font-size: 14px;
}

.cmdrow:hover, .cmdrow.active { background: #32171c; }
.cmdrow b { overflow: hidden; color: var(--cream); text-overflow: ellipsis; white-space: nowrap; }
.cmdrow small, .cmdtype { color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.cmdtype { color: var(--redlit); }
.command-help { margin-top: 10px; color: #7f5c5d; font-size: 14px; }
.command-results .empty { padding: 22px; border: 0; }

/* Notifications */
.toast-host { position: fixed; right: 20px; top: 52px; z-index: 120; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: #2a1013; border: 1px solid var(--red); color: var(--cream); font-size: 14px; box-shadow: 0 12px 30px #000a; animation: toast-in .2s ease-out; }
.toast.leaving { opacity: 0; transition: opacity .25s; }
.toast-success { border-color: #4f9d62; }
.toast-warning { border-color: #c9a13a; }
.toast-dismiss { display: block; width: 100%; padding: 13px 18px; border: 0; background: transparent; color: inherit; text-align: left; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* Sign-in and registration */
.auth-card { max-width: 460px; margin: 20px auto; padding: 26px; background: var(--panel); border: 1px solid var(--line); }
.auth-card h1 { margin: 6px 0 10px; color: var(--cream); font-size: 26px; letter-spacing: -.04em; }
.auth-card form { display: grid; gap: 6px; margin-top: 18px; }
.auth-card .btn { margin-top: 12px; }
.auth-field { margin-top: 8px; color: var(--muted); font-size: 14px; letter-spacing: .06em; }
.auth-consent { display: flex; align-items: start; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.auth-consent input { margin-top: 3px; accent-color: var(--red); }
.hint { color: var(--muted); font-size: 14px; }
.hint a { color: var(--redlit); }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; padding: 8px 12px; background: var(--red); color: #190707; }
.skip-link:focus { top: 8px; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    padding: 10px 16px;
    background: #2a1013;
    border-top: 1px solid var(--red);
    color: var(--cream);
}

#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* Display preferences */
body.noise::after {
    content: "";
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    opacity: .06;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

html.large-text body { font-size: 16px; }
html.large-text .card-desc, html.large-text .ingredients li, html.large-text .steps li { font-size: 14px; }
html[data-density="compact"] .card-body { padding: 11px 16px; }
html[data-density="compact"] .card-title { margin-top: 8px; }
html[data-density="comfortable"] .card-body { padding: 22px 26px 18px; }
html[data-density="comfortable"] body { line-height: 1.8; }
body.reduced-motion *, body.reduced-motion *::before { animation: none !important; transition: none !important; }

@media (min-width: 1450px) {
}

@media (max-width: 1080px) {
}

@media (max-width: 960px) {
    .chrome-fade { display: none; }
    .library-toolbar { flex-wrap: wrap; }
    .search { width: 245px; }
}

@media (max-width: 780px) {
    .feature-recipe { grid-template-columns: 1.4fr 1fr; height: auto; }
    .recipe-columns { grid-template-columns: 1fr 1.25fr; }
    .library-toolbar { height: auto; }
    .search { width: 100%; }
}

@media (max-width: 700px) {
    .site-chrome { height: 80px; }
    .chrome-inner { grid-template-columns: 1fr auto; height: 46px; padding: 0 14px; }
    .chrome-ticker { padding: 0 14px; }
    .wrap { width: calc(100% - 20px); }
    body { padding-bottom: 60px; }
    .bottom-dock { height: 60px; }
    .chrome-fade { display: none; }
    .library-toolbar { align-items: stretch; gap: 7px; }
    .filters { flex-wrap: nowrap; overflow-x: auto; }
    .recipe-grid { grid-template-columns: 1fr; }
    .menu-mobile { display: block; }
    .bottom-dock { grid-template-columns: 1fr 65px 1fr; padding: 0 14px; }
    .dock-time { padding-left: 0; border: 0; }
}

@media (max-width: 570px) {
    .feature-recipe { grid-template-columns: 1fr; }
    .recipe-columns { grid-template-columns: 1fr; padding: 20px 17px; }
    .feed-head { align-items: start; }
    .unit-toggle { margin-left: 0; }
}

@media (max-width: 480px) {
    .dock-time { display: none; }
}

@media (max-width: 410px) {
    .feed-sort .counter { display: none; }
    .start-menu { width: min(290px, calc(100vw - 28px)); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* Comfortable touch areas: an invisible 40 px hit zone, the look does not change. */
.chrome-inner a, .chrome-inner button, .drawer-close, .dock-left a, .dock-right a, .back,
.section-link, .site-drawer a:not(.btn), .unit-toggle button { position: relative; }
.chrome-inner a::after, .chrome-inner button::after, .drawer-close::after, .dock-left a::after,
.dock-right a::after, .back::after, .section-link::after,
.site-drawer a:not(.btn)::after, .unit-toggle button::after {
    content: "";
    position: absolute;
    inset: -12px -14px;
}

.hero-intro { max-width: 720px; margin: 8px 0 26px; color: var(--text); font-size: 16px; line-height: 1.6; }

.servings { display: inline-flex; align-items: center; gap: 8px; }
.servings b { min-width: 1.5em; color: var(--cream); font-size: 16px; text-align: center; }

.step-btn {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--cream);
    font-size: 16px;
    line-height: 1;
}

.step-btn:hover:not(:disabled) { border-color: var(--red); }
.step-btn:disabled { opacity: .4; }

.recipe-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.recipe-tools [aria-pressed="true"] { background: #321517; border-color: var(--red); color: var(--cream); }

.step-text { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.step-tick { flex: none; width: 22px; height: 22px; margin-top: 4px; accent-color: var(--red); }
.step-tick:checked + span { color: var(--muted); text-decoration: line-through; }

.cook-mode .ingredients li, .cook-mode .steps li { font-size: 20px; line-height: 1.6; }
.cook-mode .recipe-columns { grid-template-columns: 1fr; }

@media print {
    .site-chrome, .bottom-dock, .site-drawer, .drawer-scrim, .overlay, .skip-link, .back, .recipe-tools,
    .unit-toggle, .step-btn,
    .recipe-hero, .library-section, .community-section, .toast-host {
        display: none !important;
    }

    body, .recipe-columns { background: #fff !important; color: #000 !important; }
    body::before, body::after { display: none !important; }
    .wrap, .page { max-width: none; padding: 0; }
    h1, h2, .subhead, .ingredients li, .steps li, .recipe-meta, .summary, .recipe-notes {
        color: #000 !important;
        text-shadow: none !important;
    }

    .recipe-columns { border: 0; padding: 0; grid-template-columns: 1fr; }
    .steps li { border-color: #999; break-inside: avoid; }
    .step-tick { display: none !important; }
    .step-text { display: block !important; }
    .step-tick:checked + span, .servings b, .step-meta { color: #000 !important; text-decoration: none !important; }
}

.rating-stars { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.rating-stars .step-btn { width: 40px; height: 40px; }
.rating-stars a { display: inline-flex; align-items: center; min-height: 40px; }
.made-it-photo { max-width: 100%; width: 360px; height: auto; }
.made-it-thumb { width: 100px; height: 100px; object-fit: cover; }
.community-section textarea { display: block; width: 100%; min-height: 80px; }
.community-section input[type=file] { display: block; min-height: 40px; max-width: 100%; }

@media (min-width: 1200px) {
    .recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

small, .step-meta { font-size: 14px; }
.chrome-inner .chrome-gear::after { inset: -12px -10px; }
.chrome-inner .chrome-home::after { inset: -12px -10px; }

/* Public layout follows NULL's portal and content/sidebar structure in Judas tokens. */
.site-chrome { background: var(--deep); border-color: var(--line); }
.chrome-inner { grid-template-columns: minmax(0, 1fr) auto; }
.chrome-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.session-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.chrome-inner .iconbtn, .chrome-inner .chrome-gear, .dock-left .iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: none; padding: 8px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted);
}
.chrome-inner .iconbtn:hover, .chrome-inner .chrome-gear:hover, .dock-left .iconbtn:hover {
    border-color: var(--redlit); color: var(--redlit);
}
.presence-status { min-width: 0; }
.presence-status span { overflow: hidden; text-overflow: ellipsis; }
.chrome-ticker { gap: 16px; justify-content: space-between; border-color: var(--line); color: var(--muted); }
.now-ticker { flex: 1 1 0; min-width: 0; }
.now-ticker span { color: var(--redlit); }
.path-label { flex: 0 1 45%; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.bottom-dock { position: fixed; left: 0; right: 0; background: var(--deep); border-color: var(--line); }
.start-orb { width: 56px; height: 56px; padding: 3px; border: 2px solid var(--red); background: var(--deep); }
.start-orb img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.home-page { padding-top: 30px; }
.hero-intro { margin: 20px 0; }
.registration-banner, .panel, .lead, .recipe-card {
    border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.registration-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; margin-bottom: 28px; }
.registration-banner .actions { display: flex; align-items: center; gap: 10px; flex: none; }
.banner-close { border: 0; background: transparent; color: var(--muted); width: 40px; height: 40px; font-size: 24px; }
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0 20px; }
.filter-scroll { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.filter-scroll .chip { display: inline-flex; align-items: center; min-height: 38px; border-radius: 8px; padding: 8px 14px; }
.inline-search { display: flex; gap: 8px; min-width: 0; }
.filterbar > .inline-search { flex: 0 1 340px; }
.inline-search input {
    min-width: 0; width: 100%; flex: 1; border: 1px solid var(--line); border-radius: 8px;
    color: var(--cream); background: var(--deep); font-size: 14px; padding: 10px 12px;
}
.portal { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.portal .feature-recipe { display: block; height: auto; min-width: 0; overflow: hidden; }
.home-logo { margin: 0; line-height: 0; min-width: 0; align-self: center; }
.home-logo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.featured-slot { position: relative; min-width: 0; align-self: center; }
.featured-label { position: absolute; top: 16px; left: 16px; z-index: 2; letter-spacing: 0.08em; pointer-events: none; }
.featured-slot .recipe-card { display: block; }
.featured-slot .card-title { font-size: 28px; }
.featured-slot .card-desc { font-size: 18px; -webkit-line-clamp: 3; }
.lead-media { display: block; position: relative; aspect-ratio: 16 / 8.5; }
.lead-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-overlay { position: absolute; bottom: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; }
.badge { border: 1px solid var(--linehi); border-radius: 8px; background: var(--deep); padding: 4px 8px; color: var(--redlit); font-size: 14px; }
.lead-copy { padding: 24px 28px 28px; }
.lead h1 { font-size: clamp(28px, 3.2vw, 46px); line-height: 1.15; margin: 8px 0 14px; color: var(--cream); }
.lead .summary { font-size: 18px; line-height: 1.65; }
.meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 14px; margin-top: 12px; }
.sidegrid { display: grid; gap: 20px; min-width: 0; }
.recipe-grid { border: 0; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recipe-card { overflow: hidden; min-width: 0; }
.recipe-card:hover, .lead:hover { border-color: var(--redlit); background: var(--panel2); }
.card-body { min-width: 0; padding: 16px 18px 18px; }
.card-title { overflow-wrap: anywhere; margin: 6px 0 10px; }
.card-desc { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.portal .story { display: grid; grid-template-columns: 130px minmax(0, 1fr); padding: 16px; gap: 16px; min-height: 0; }
.story .card-photo { border-radius: 6px; aspect-ratio: 16 / 10; }
.story .card-body { padding: 0; }
.story .card-desc { -webkit-line-clamp: 3; }
.story .card-top { flex-wrap: wrap; }
.story .card-title { font-size: 20px; }
.library-section { left: auto; margin-top: 26px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; max-width: 1320px; }
.recipe-content { min-width: 0; }
.recipe-content .recipe-columns { grid-template-columns: 1fr; }
.sidebar-col { display: grid; align-content: start; gap: 22px; min-width: 0; }
.panel { overflow: hidden; }
.panel-head { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--redlit); letter-spacing: .1em; }
.panel-body { padding: 16px; }
.widget-list { list-style: none; padding: 4px 0; margin: 0; }
.widget-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; }
.widget-list span { color: var(--muted); font-size: 14px; }
.widget-list .active, .widget-list a:hover { color: var(--redlit); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.feed-links { display: grid; gap: 12px; font-size: 14px; }
.sidebar-col .newsletter-signup { border: 0; margin: 0; padding: 0; }
.sidebar-col .newsletter-signup h2 { margin-top: 0; font-size: 20px; }
.sidebar-col .share-row { display: flex; flex-direction: column; align-items: stretch; }
.sidebar-col input { min-width: 0; width: 100%; }
.cook-mode + .sidebar-col { display: none; }
.content-layout:has(.cook-mode) { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) {
    .recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1099px) {
    .content-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .portal { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
    .portal .story { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
    .registration-banner { flex-wrap: wrap; }
    .filterbar { flex-wrap: wrap; }
}
@media (max-width: 699px) {
    .portal, .recipe-grid { grid-template-columns: minmax(0, 1fr); }
    .chrome-actions { gap: 8px; }
    .chrome-actions .session-label { display: none; }
    .presence-dot { display: none; }
    .chrome-ticker { gap: 8px; letter-spacing: 0; }
    .path-label { flex-basis: 38%; }
    .registration-banner { gap: 12px; }
    .registration-banner .actions { flex-wrap: wrap; }
    .filterbar > .inline-search { flex: 1 1 100%; }
    .filter-scroll { width: 100%; }
    .lead-copy { padding: 18px; }
    .bottom-dock { grid-template-columns: minmax(0, 1fr) 65px minmax(0, 1fr); }
    .dock-left { gap: 6px; }
    .dock-right { gap: 6px; }
    .dock-right a { display: none; }
    .dock-time { display: inline; white-space: normal; font-size: 14px; text-align: right; }
}
@media print {
    .sidebar-col { display: none !important; }
    .content-layout { display: block; }
}
.lead h1, .lead .summary { font-family: var(--narrow); }
.page .inline-search input { margin: 0; }
.sidebar-col .newsletter-signup form { padding: 0; border: 0; }
.section-link::after { inset: -12px 0; }

/* Loading state, so a page never says "not found" or "empty" while its data is still on the way. */
.page-loading {
    display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 220px;
    color: var(--muted); letter-spacing: .12em; font-size: 14px; grid-column: 1 / -1;
}
.spinner {
    width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--redlit);
    border-radius: 50%; animation: jf-spin .8s linear infinite;
}
@keyframes jf-spin { to { transform: rotate(360deg); } }

/* Search boxes drop their matches down as you type. */
.live-search { position: relative; }
.live-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin-top: 6px;
    max-height: 360px; overflow: auto; border: 1px solid var(--linehi); border-radius: 8px;
    background: var(--panel); box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.live-results .cmdrow { grid-template-columns: 76px minmax(0, 1fr); }
.live-results .cmdrow small { display: none; }
.live-results .empty { padding: 16px; }
@media (min-width: 700px) {
    .live-results { min-width: 360px; left: auto; }
}
