:root {
    color-scheme: dark;
    --bg: #16110f;
    --panel: #231b17;
    --line: #3d302a;
    --text: #f6ede4;
    --muted: #bcaa9c;
    --accent: #f0a53a;
}
* { box-sizing: border-box; }
body {
    margin: 0 auto;
    max-width: 46rem;
    padding: 0 1rem calc(6rem + env(safe-area-inset-bottom));
    background: var(--bg);
    color: var(--text);
    font: 1rem/1.5 system-ui, sans-serif;
}
header { display: flex; justify-content: space-between; align-items: center; }
h1 { font: italic 700 1.6rem/1.2 Georgia, serif; color: var(--accent); }
h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; }
section:not(.gate) > h2 { text-transform: capitalize; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
    min-height: 2.75rem;
    padding: .4rem .9rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: .6rem;
    cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
label.button { position: relative; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
label.button:focus-within { outline: 3px solid var(--accent); }
.visually-hidden { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; opacity: 0; }
a.button, label.button { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem .9rem; border-radius: .6rem; text-decoration: none; }
.share { margin: .5rem 0 1rem; }
button.primary, a.button.primary { border: 1px solid; background: var(--accent); border-color: var(--accent); color: #1d1206; font-weight: 600; }
button.danger { color: #ff9d8f; }
button.link { background: none; border: 0; padding: .4rem 0; text-decoration: underline; text-align: left; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input:not([type=checkbox]), select, textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: .4rem .6rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: .6rem;
}
input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.themes { display: flex; gap: .5rem; overflow-x: auto; padding: .25rem .1rem .75rem; scrollbar-width: none; }
.themes.wrap { flex-wrap: wrap; }
/* A mouse cannot swipe, so show every chip. */
@media (min-width: 40rem), (hover: hover) and (pointer: fine) { .themes { flex-wrap: wrap; } }
.chip { white-space: nowrap; border-radius: 2rem; }
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #1d1206; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; margin: .5rem 0; }
.pick span, .field span { display: block; font-size: .85rem; color: var(--muted); }
.field { display: block; margin: .6rem 0; }
.check { display: flex; gap: .5rem; align-items: center; min-height: 2.5rem; }
.cards, .list, .recipe { list-style: none; padding: 0; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem; }
.card { display: grid; grid-template-columns: 4.5rem 1fr; gap: .2rem .8rem; width: 100%; height: 100%; text-align: left; align-content: center; align-items: center; padding: .8rem; }
.card > :not(.art) { grid-column: 2; }
.card > .art { grid-row: 1 / span 3; width: 4.5rem; height: 4.5rem; }
.art { display: block; }
img.art { object-fit: cover; border-radius: .6rem; }
.hero { display: flex; justify-content: center; clear: both; }
.hero .art { width: min(100%, 11rem); aspect-ratio: 1; }
.hero img.art { width: 100%; aspect-ratio: 4 / 3; }
.preview { width: 6rem; border-radius: .6rem; }
input[type=color] { padding: .2rem !important; }
.list li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.recipe li { padding: .2rem 0; }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.badge { font-size: .75rem; padding: .05rem .5rem; border: 1px solid var(--line); border-radius: 1rem; color: var(--muted); }
.badge.sf { margin-left: .4rem; color: #9ee6a8; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .8rem; padding: 0 1rem .5rem; margin: 1rem 0; }
nav {
    position: fixed;
    inset: auto 0 0 0;
    display: flex;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .5rem calc(.5rem + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
}
nav[hidden] { display: none; }
nav button { flex: 1; max-width: 11rem; padding: .3rem; }
nav button[aria-current=page] { border-color: var(--accent); color: var(--accent); }
dialog {
    width: min(32rem, calc(100vw - 1.5rem));
    max-height: 90dvh;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1rem;
}
dialog::backdrop { background: #000a; }
dialog .close { float: right; }
fieldset { border: 1px solid var(--line); border-radius: .6rem; margin: .6rem 0; }
.item { flex-wrap: nowrap; margin-bottom: .4rem; }
.item select { flex: 1; width: auto !important; min-width: 0; }
.item input { width: 4.5rem !important; }
form.row input { flex: 1; width: auto !important; min-width: 8rem; }
.gate { text-align: center; padding-top: 3rem; }
.big { font-size: 4rem; margin: 0; }
.qr { display: block; width: min(100%, 22rem); margin: 1rem auto; background: #fff; fill: #000; border-radius: .5rem; }
#toast {
    position: fixed;
    left: 50%;
    bottom: 5.5rem;
    translate: -50% 0;
    width: max-content;
    max-width: 90vw;
    padding: .6rem 1rem;
    background: var(--text);
    color: var(--bg);
    border-radius: .6rem;
    opacity: 0;
    pointer-events: none;
}
#toast.show { opacity: 1; }
@media print {
    body { background: #fff; color: #000; }
    header, nav, .themes, .no-print, #toast { display: none !important; }
}
