:root {
    --bg: #ffffff;
    --panel: #fafaf8;
    --line: #e4e4e0;
    --line-soft: #eeeeea;
    --line-strong: #d6d6d1;
    --ink: #1a1a1a;
    --ink-2: #3a3a37;
    --muted: #5f5f5a;
    --accent: #2f6b3a;
    --accent-dark: #1f4a27;
    --accent-soft: #e3ede4;
    --warn-bg: #fff6e5;
    --warn-line: #9a5b00;
    --warn-ink: #7a4700;
    --danger: #a12a1e;
    --display: "Space Grotesk", system-ui, sans-serif;
    --topbar-h: 57px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
a { color: var(--accent-dark); }
img { display: block; max-width: 100%; }
code { font-size: 0.92em; background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.spacer { flex: 1 1 auto; }
.icon { flex: 0 0 auto; }
.mobile-only { display: none !important; }

/* ---------- Buttons and fields ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 16px;
    border: 1px solid var(--line-strong); border-radius: 6px;
    background: var(--bg); color: var(--ink);
    font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--panel); }
.btn:disabled, .btn.is-busy { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-dashed { border-style: dashed; border-color: #b9b9b3; background: transparent; color: var(--accent-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #7f2017; }
.btn-danger-text { color: var(--danger); }
.btn-wide { min-width: 200px; min-height: 48px; }
.btn:focus-visible, .btn:focus-within, .icon-btn:focus-visible, .row:focus-visible, .recipe-row:focus-visible,
.thumb-btn:focus-visible, .link-btn:focus-visible, .wordmark:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 44px; width: 44px; height: 44px;
    border: 0; border-radius: 6px; background: transparent; color: var(--muted);
    cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

.link-btn {
    min-height: 44px; padding: 0; border: 0; background: transparent;
    color: var(--accent-dark); text-decoration: underline; cursor: pointer; font-size: 14px;
}

.field {
    width: 100%; min-width: 0; height: 44px; padding: 0 12px;
    border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg);
}
textarea.field { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field.chk { border: 2px solid var(--warn-line); background: var(--warn-bg); }
.field-title { height: 52px; font-size: 20px; font-weight: 600; }
.field-below { margin-top: 8px; }
.lbl { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 14px; color: var(--muted); }
.flag { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--warn-ink); }
.empty { padding: 16px 12px; font-size: 14px; color: var(--muted); }

.notice { padding: 10px 14px; border-radius: 8px; background: var(--line-soft); font-size: 15px; }
.notice-error { background: #fbeceb; color: #7f2017; }
.notice-check { background: var(--warn-bg); color: #5c3600; }

/* ---------- Shell ---------- */

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 20px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.logo-mark { flex: 0 0 auto; color: var(--accent); }
.wordmark-logo { display: block; width: auto; flex: 0 0 auto; }
.account { position: relative; min-width: 0; margin-left: auto; }
.account-btn { gap: 6px; max-width: 100%; padding: 0 10px; color: var(--ink-2); }
.account-btn .icon { flex: 0 0 auto; color: var(--muted); }
.account-name { font-size: 14px; max-width: min(40vw, 260px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-backdrop { position: fixed; inset: 0; z-index: 29; }
.account-menu {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
    min-width: 200px; margin: 0; padding: 6px; display: flex; flex-direction: column;
    background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.menu-item {
    display: flex; align-items: center; min-height: 44px; width: 100%; padding: 0 12px;
    border: 0; border-radius: 6px; background: transparent; color: var(--ink);
    font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--line-soft); }
.menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings { max-width: 640px; }
.settings-block { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.settings-block .lbl { margin-bottom: 0; }
.settings-block .field { max-width: 320px; }

/* ---------- Three columns + detail ---------- */

.browser {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 200px 200px 280px minmax(0, 1fr);
    align-items: stretch;
}

.col { min-width: 0; padding: 8px; border-right: 1px solid var(--line); background: var(--panel); }
.col-recipes { background: var(--bg); }
.col-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-left: 12px; }
.col-head h2 { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.col-actions { display: flex; }
.col-add { display: flex; gap: 6px; margin: 0 4px 8px; }
.col-add .btn { padding: 0 12px; }
.col-edit { flex-wrap: wrap; }
.col-edit .field { flex: 1 1 100%; }
.col-edit .btn { flex: 1 1 auto; }
.col-notice { margin: 0 4px 8px; font-size: 14px; }
.col-hint { padding: 8px 12px; }

.row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 44px; padding: 0 12px; border-radius: 6px;
    color: var(--ink); text-decoration: none;
}
.row:hover { background: var(--line-soft); }
.row.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.count { font-size: 13px; font-weight: 400; color: var(--muted); }

.search { position: relative; margin: 0 4px 8px; }
.search .icon { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.search .field { padding-left: 36px; }

.recipe-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none;
}
.recipe-row:hover { background: var(--line-soft); }
.recipe-row.on { background: var(--accent-soft); color: var(--accent-dark); }
.recipe-row-text { display: flex; flex-direction: column; min-width: 0; }
.recipe-row-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-row.on .recipe-row-name { font-weight: 600; }
.recipe-row-meta { font-size: 13px; color: var(--muted); min-height: 19px; }
.thumb { flex: 0 0 52px; width: 52px; height: 44px; border-radius: 4px; object-fit: cover; }
.thumb-empty { background: repeating-linear-gradient(135deg, #ececE8 0 8px, var(--line) 8px 16px); }

.detail { min-width: 0; padding: 24px 40px 64px; }
.detail-empty { max-width: 420px; margin: 12vh auto 0; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 20px; }
.detail-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.message-page { max-width: 420px; margin: 12vh auto 0; padding: 0 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.message-page h1 { font-family: var(--display); font-size: 28px; }

.mobile-bar { display: none; }

/* ---------- Recipe view ---------- */

.recipe { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.recipe-bar { display: flex; align-items: center; gap: 8px; }
.recipe-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--line-soft); }
.thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.thumb-btn { position: relative; width: 88px; height: 60px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--line-soft); cursor: pointer; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb-tag { position: absolute; left: 4px; bottom: 4px; padding: 0 5px; border-radius: 3px; background: rgba(26, 26, 26, 0.8); color: #fff; font-size: 11px; font-weight: 600; }
.thumbs .btn-dashed { min-height: 60px; }

.recipe-head { display: flex; flex-direction: column; gap: 6px; }
.recipe-kicker { font-size: 14px; color: var(--muted); }
.recipe-head h1 { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 4px; font-size: 15px; color: var(--ink-2); }
.recipe-meta strong { font-weight: 600; }

.recipe-body { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.recipe-body h2, .editor h2 { margin-bottom: 12px; font-family: var(--display); font-weight: 600; font-size: 20px; }
.recipe-ingredients { flex: 1 1 220px; min-width: 0; }
.recipe-method { flex: 2 1 340px; min-width: 0; }
.recipe-ingredients ul, .recipe-method ol { list-style: none; margin: 0; padding: 0; }
.recipe-ingredients li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.recipe-ingredients li:last-child { border-bottom: 0; }
.amount { flex: 0 0 72px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recipe-method ol { display: flex; flex-direction: column; gap: 18px; font-size: 17px; line-height: 1.6; }
.recipe-method li { display: flex; gap: 16px; }
.step-no { flex: 0 0 26px; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--accent); }

/* Cook mode: only the recipe, larger, for a tablet on the worktop. */
.app:has(.browser.cooking) > .topbar { display: none; }
.browser.cooking { display: block; padding-bottom: 0; }
.browser.cooking > .col, .browser.cooking > .mobile-bar { display: none; }
.browser.cooking > .detail { display: block; padding: 16px 32px 64px; }
.recipe-cook { max-width: 1180px; gap: 16px; }
.recipe-cook .recipe-head h1 { font-size: clamp(32px, 4.5vw, 52px); }
.recipe-cook .recipe-meta { font-size: 18px; }
.recipe-cook .recipe-body { gap: 48px; }
.recipe-cook .recipe-body h2 { font-size: 24px; }
.recipe-cook .recipe-ingredients { flex: 1 1 300px; font-size: 20px; }
.recipe-cook .recipe-ingredients li { padding: 12px 0; }
.recipe-cook .amount { flex-basis: 96px; }
.recipe-cook .recipe-method { flex: 2 1 460px; }
.recipe-cook .recipe-method ol { gap: 28px; font-size: 22px; line-height: 1.55; }
.recipe-cook .step-no { flex-basis: 34px; font-size: 26px; }
@media (min-width: 900px) {
    /* The ingredients stay in view while the steps scroll. */
    .recipe-cook .recipe-ingredients { position: sticky; top: 16px; align-self: flex-start; max-height: calc(100dvh - 32px); overflow-y: auto; }
}
@media (max-width: 899px) {
    .browser.cooking > .detail { padding: 12px 16px 48px; }
    .recipe-cook .recipe-ingredients { font-size: 18px; }
    .recipe-cook .recipe-method ol { font-size: 19px; }
}
.step-text { white-space: pre-line; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Editor ---------- */

.editor { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.editor-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.editor-head h1 { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.01em; }
.editor-actions { display: flex; gap: 8px; }
.editor-section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.editor-section h2 { margin-bottom: 0; }
.editor-section h3 { font-size: 15px; font-weight: 600; margin-top: 8px; }
.editor-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.grow2 { flex: 2 1 180px; min-width: 0; }
.grow1 { flex: 1 1 100px; min-width: 0; }
.editor-columns { display: flex; flex-wrap: wrap; gap: 40px; }
.editor-columns > .editor-section { flex: 1 1 300px; }

.photo-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-tile { width: 168px; }
.photo-tile img { width: 168px; height: 112px; object-fit: cover; border-radius: 6px; background: var(--line-soft); }
.photo-tile img.is-cover { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-tile-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.cover-label { font-size: 14px; font-weight: 600; color: var(--accent-dark); }
.photo-add { display: flex; flex-direction: column; gap: 8px; justify-content: center; min-height: 112px; }

.line-head { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: -8px; }
.amount-col { flex: 0 0 88px; }
.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: flex; gap: 8px; align-items: flex-start; }
.line .step-no { padding-top: 8px; flex-basis: 20px; font-size: 18px; }
.flag-step, .step-add { margin-left: 28px; }

.editor-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.delete-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- Scan ---------- */

.scan { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 64px; display: flex; flex-direction: column; gap: 16px; }
.scan h1 { font-family: var(--display); font-weight: 700; font-size: 24px; }
.scan-intro { color: var(--ink-2); }
.scan-pages { display: flex; flex-wrap: wrap; gap: 12px; }
.scan-page { position: relative; width: 132px; }
.scan-page img { width: 132px; height: 176px; object-fit: cover; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--line-soft); }
.scan-page-remove { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, 0.92); color: var(--ink); }
.scan-page-no { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.scan-add { display: flex; flex-direction: column; gap: 8px; justify-content: center; min-height: 176px; }
.scan-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }

/* ---------- Admin ---------- */

.admin { width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.admin > * { min-width: 0; max-width: 100%; }
.admin h1 { font-family: var(--display); font-weight: 700; font-size: 24px; }
.admin-totals { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-totals > div { flex: 1 1 160px; display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; }
.admin-figure { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; white-space: nowrap; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); font-weight: 400; vertical-align: top; }
.admin-table thead th { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
.admin-table tbody tr:last-child th, .admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-name { display: block; font-weight: 600; }

/* ---------- Sign in ---------- */

.signin { min-height: 100vh; min-height: 100dvh; padding: 48px 16px; display: flex; align-items: center; justify-content: center; background: var(--panel); }
.signin-card { width: 100%; max-width: 400px; padding: 40px 32px; display: flex; flex-direction: column; gap: 28px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.signin-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.signin-head h1 { display: flex; color: var(--ink); }
.signin-head h1 { font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -0.02em; }
.signin-head p { color: var(--ink-2); }
.signin-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-sso { min-height: 48px; }
.signin-foot { text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Landing page (public, at "/") ---------- */

.lp { --lp-pad: clamp(16px, 5vw, 80px); background: var(--bg); }
.lp-topbar { position: static; padding-left: var(--lp-pad); padding-right: var(--lp-pad); }
.lp-section { padding: clamp(48px, 6vw, 80px) var(--lp-pad); }
.lp-band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lp-hero { padding-top: clamp(40px, 6vw, 80px); border-top: 0; }
.lp-wrap { max-width: 1120px; margin: 0 auto; }
.lp-stack { display: flex; flex-direction: column; gap: clamp(24px, 3vw, 40px); }
.lp h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5.2vw, 60px); line-height: 1.08; letter-spacing: -0.02em; }
.lp h2 { max-width: 640px; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -0.02em; }
.lp h3 { font-size: 18px; font-weight: 600; }
.lp-section p { color: var(--ink-2); }
.lp-section p.hint { color: var(--muted); }

.lp-hero .lp-wrap { display: flex; flex-direction: column; gap: clamp(32px, 5vw, 56px); }
.lp-hero-text { max-width: 720px; display: flex; flex-direction: column; gap: 20px; }
.lp-hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px 32px; }
.lp-hero-top .lp-hero-text { flex: 1 1 480px; min-width: 0; }
.lp-video-open { flex: 0 0 auto; min-height: 48px; }
.lp-video-open .icon { color: var(--accent); }

/* The video dialog: a 16:9 player that fits the window, with the close button above it. */
.lp-video { width: min(960px, calc(100vw - 32px), calc((100dvh - 128px) * 16 / 9)); padding: 0; border: 0; border-radius: 10px; background: #000; overflow: visible; }
.lp-video::backdrop { background: rgba(0, 0, 0, 0.75); }
.lp-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
.lp-video-close { position: absolute; top: -52px; right: 0; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; }
.lp-video-close:hover { background: rgba(255, 255, 255, 0.15); }
.lp-video-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lp-lead { font-size: clamp(17px, 1.6vw, 20px); }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }

.lp-shot {
    display: grid; grid-template-columns: 180px 180px 240px minmax(0, 1fr);
    height: 420px; overflow: hidden;
    border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg);
}
.lp-shot-col { padding: 8px; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.lp-shot-recipes { background: var(--bg); }
.lp-shot-head { min-height: 44px; padding-left: 12px; display: flex; align-items: center; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lp-shot-row { min-height: 44px; padding: 0 12px; border-radius: 6px; display: flex; align-items: center; }
.lp-shot-row.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.lp-shot-detail { min-width: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.lp-shot-photo { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; background: var(--accent-soft); }
.lp-shot-title { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.lp-shot-list { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--ink-2); }
.lp-shot-list .lp-shot-head { min-height: 0; padding-left: 0; }

.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.lp-card { padding: 24px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; }
.lp-card .icon { color: var(--accent); }

.lp-scan { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(32px, 5vw, 72px); }
.lp-scan-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.lp-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; }
.lp-steps li { display: flex; gap: 16px; }
.lp-step-no { flex: 0 0 32px; height: 32px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.lp-form { flex: 1 1 320px; min-width: 0; max-width: 460px; padding: 20px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 14px; }
.lp-form-group { display: flex; flex-direction: column; gap: 8px; }
.lp-form-group .lbl { margin-bottom: 0; }
.lp-field { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; display: flex; align-items: center; }
.lp-field.chk { border: 2px solid var(--warn-line); background: var(--warn-bg); }
.lp-field-title { min-height: 52px; font-size: 20px; font-weight: 600; }
.lp-form-save { min-height: 44px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }

.lp-close { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 56px; }
.lp-close-text { flex: 1 1 320px; min-width: 0; max-width: 640px; display: flex; flex-direction: column; gap: 12px; }

.lp-foot { padding: 20px var(--lp-pad); border-top: 1px solid var(--line); background: var(--panel); }
.lp-foot .lp-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; }
.lp-foot-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; }
.lp-foot .link-btn { display: inline-flex; align-items: center; }

/* On a phone the picture of the app shows the recipe only, as the app itself does. */
@media (max-width: 899px) {
    .lp-shot { grid-template-columns: minmax(0, 1fr); height: auto; }
    .lp-shot-col { display: none; }
    .lp-shot-photo { height: 220px; }
}

/* ---------- Blazor error bar ---------- */

#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 12px 20px; background: #7f2017; color: #fff;
}
#blazor-error-ui a { color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
.blazor-error-boundary { padding: 16px; background: #7f2017; color: #fff; }
.blazor-error-boundary::after { content: "Something went wrong."; }

/* ---------- Mobile first: one column, chips for course and cuisine ---------- */

@media (max-width: 899px) {
    .mobile-only { display: inline-flex !important; }

    .browser { display: flex; flex-direction: column; padding-bottom: 84px; }
    .browser.has-detail { padding-bottom: 0; }
    .browser.has-detail > .col, .browser.has-detail > .mobile-bar { display: none; }
    .browser:not(.has-detail) > .detail { display: none; }

    .col { padding: 4px 0 0; border-right: 0; background: var(--bg); }
    .col-head { padding: 0 4px 0 16px; }
    .col-add { margin: 0 16px 8px; }
    .col-recipes .col-actions { display: none; }
    .col-notice { margin: 0 16px 8px; }
    .recipe-bar { flex-wrap: wrap; }

    .col-list { display: flex; gap: 8px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none; }
    .col-list::-webkit-scrollbar { display: none; }
    .row { flex: 0 0 auto; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 22px; white-space: nowrap; }
    .row.on { background: var(--accent); border-color: var(--accent); color: #fff; }
    .row.on .count { color: #fff; }

    .search { margin: 0 16px 8px; }
    .recipe-list { border-top: 1px solid var(--line-soft); }
    .recipe-row { padding: 10px 16px; border-radius: 0; border-bottom: 1px solid var(--line-soft); }
    .recipe-row-name { font-weight: 600; }
    .thumb { flex-basis: 72px; width: 72px; height: 56px; border-radius: 6px; }
    .empty { padding: 20px 16px; }

    .mobile-bar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
        display: flex; gap: 8px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--bg); border-top: 1px solid var(--line);
    }
    .mobile-bar .btn { flex: 1 1 0; min-height: 52px; border-radius: 8px; }

    .topbar { padding: 6px 8px 6px 16px; }
    .detail { padding: 8px 16px 48px; }
    .recipe { gap: 16px; }
    .recipe-cover { width: calc(100% + 32px); max-width: none; margin: 0 -16px; border-radius: 0; aspect-ratio: 3 / 2; }
    .thumbs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; }
    .thumb-btn { flex: 0 0 76px; width: 76px; height: 56px; }
    .thumbs .btn-dashed { flex: 0 0 auto; min-height: 56px; }
    .recipe-head h1 { font-size: 34px; }
    .recipe-body { gap: 24px; padding-top: 20px; }
    .recipe-ingredients, .recipe-method { flex-basis: 100%; }
    .recipe-ingredients li { padding: 10px 0; }

    .editor { gap: 24px; }
    .editor-head h1 { font-size: 24px; }
    .editor-actions .btn-primary { display: none; }
    .field { height: 48px; }
    .editor-columns { gap: 24px; }
    .editor-foot { flex-direction: column-reverse; align-items: stretch; }
    .photo-tile, .photo-tile img { width: calc(50vw - 22px); }
    .photo-add { flex: 1 1 100%; min-height: 0; flex-direction: row; }
    .photo-add .btn { flex: 1 1 0; min-height: 56px; }
    .scan-add { flex: 1 1 100%; min-height: 0; flex-direction: row; }
    .scan-add .btn { flex: 1 1 0; min-height: 56px; }
    .scan-foot { align-items: stretch; }
}

/* Longer words in other languages: let the top bar and the bottom bar make room on phones. */
@media (max-width: 899px) {
    .mobile-bar .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; padding: 6px 10px; }
    .editor-actions, .recipe-bar .delete-confirm { flex-wrap: wrap; }
    .photo-add .btn, .scan-add .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; padding: 6px 10px; }
}
.admin-table .field-plan { width: auto; min-width: 96px; padding: 4px 8px; font-size: 14px; }
.lp-foot-version { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.app-version { font-size: 12px; font-variant-numeric: tabular-nums; }
