/*
 * Three themes (plans/schaft.md, ontwerpen in https://claude.ai/artifact/92PcqzuyzpK7CsziXsv4aE). Every screen uses
 * only these variables and the shared classes below; what really looks different per theme is under its own
 * [data-theme] block at the end. Text pairs are checked for 4.5:1 in ThemeContrastTests.
 */
:root, [data-theme="markt"] {
    --bg: #F6F9F3;
    --surface: #FFFFFF;
    --text: #1F2A1F;
    --muted: #4F604F;
    --line: #E1E8DC;
    --accent: #2F6B3A;        /* headings, active tab, selection */
    --accent-text: #FFFFFF;
    --cta: #C73A1E;           /* the one button that counts */
    --cta-text: #FFFFFF;
    --chip: #E3EEDD;
    --chip-text: #2F6B3A;
    --bar: #2F6B3A;
    --hero-bg: #FFFFFF;       /* the first suggestion tonight */
    --hero-text: #1F2A1F;
    --hero-muted: #4F604F;
    --font-body: "Nunito", system-ui, sans-serif;
    --font-head: "Nunito", system-ui, sans-serif;
    --head-weight: 900;
    --head-size: 30px;
    --radius: 22px;
    --radius-button: 14px;
}

[data-theme="bistro"] {
    --bg: #1C1A17;
    --surface: #24211D;
    --text: #F3EDE1;
    --muted: #C9C0B0;
    --line: #3A3631;
    --accent: #E8B931;
    --accent-text: #1C1A17;
    --cta: #E8B931;
    --cta-text: #1C1A17;
    --chip: #3A3631;
    --chip-text: #F3EDE1;
    --bar: #1C1A17;
    --hero-bg: #E8B931;
    --hero-text: #1C1A17;
    --hero-muted: #3A3328;
    --font-body: "Archivo", system-ui, sans-serif;
    --font-head: "Archivo Black", "Archivo", system-ui, sans-serif;
    --head-weight: 400;
    --head-size: 28px;
    --radius: 24px;
    --radius-button: 14px;
    color-scheme: dark;
}

[data-theme="schrift"] {
    --bg: #FFFFFF;
    --surface: #FFF6C9;
    --text: #22252B;
    --muted: #4A4F5C;
    --line: #DCE3F2;
    --accent: #2B4C9B;
    --accent-text: #FFFFFF;
    --cta: #2B4C9B;
    --cta-text: #FFFFFF;
    --chip: #FFF6C9;
    --chip-text: #22252B;
    --marker: #E2711D;
    --bar: #2B4C9B;
    --hero-bg: #FFF6C9;
    --hero-text: #22252B;
    --hero-muted: #4A4F5C;
    --font-body: "Inter", system-ui, sans-serif;
    --font-head: "Caveat", cursive;
    --head-weight: 700;
    --head-size: 44px;
    --radius: 6px;
    --radius-button: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); margin: 0; line-height: 1.1; }
h1 { font-size: var(--head-size); }
h2 { font-size: calc(var(--head-size) * 0.66); }

.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; font: 900 40px "Nunito", system-ui, sans-serif; color: #2F6B3A; }
.welcome { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 16px; text-align: center; }

/* Shell: header with logo, the page, a bottom bar with three tabs */
.shell { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: max(16px, env(safe-area-inset-top)) 20px 8px; }
.top .me { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--chip); color: var(--chip-text); font-weight: 700; text-decoration: none; }
.page { flex: 1; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.tabs { position: sticky; bottom: 0; display: flex; justify-content: space-around; padding: 8px 8px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); background: var(--bg); }
.tabs a { min-width: 72px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.tabs a.active { color: var(--accent); }
.tabs svg { width: 24px; height: 24px; }

.eyebrow { font-size: 14px; font-weight: 700; color: var(--muted); }
.muted { color: var(--muted); }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
/* The first suggestion: everything in it (title, links, quiet buttons) in the hero's own colors */
.card.hero { background: var(--hero-bg); color: var(--hero-text); }
.card.hero .muted { color: var(--hero-muted); }
.card.hero .dish, .card.hero a, .card.hero .link-button { color: var(--hero-text); }
.card.hero .button:not(.cta) { color: var(--hero-text); border-color: var(--hero-text); }

.button { min-height: 48px; padding: 0 18px; border-radius: var(--radius-button); border: 2px solid var(--line); background: transparent;
    color: var(--text); font: 700 16px var(--font-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.button.cta { background: var(--cta); border-color: var(--cta); color: var(--cta-text); }
.button:focus-visible, .tabs a:focus-visible, .theme-choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Theme picker: each choice previews itself in its own colors, whatever the current theme */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-choice { border: 3px solid transparent; border-radius: 18px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; font: 700 15px var(--font-body); }
.theme-choice[aria-pressed="true"] { border-color: var(--accent); }
.theme-choice.markt { background: #EEF3EA; color: #1F2A1F; }
.theme-choice.bistro { background: #2A2723; color: #F3EDE1; }
.theme-choice.schrift { background: #FFFFFF; color: #22252B; box-shadow: inset 0 0 0 1px #DCE3F2; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); }

/* Forms, chips and the dish screens (brok 1) */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--muted); }
.input { min-height: 48px; width: 100%; padding: 10px 14px; border-radius: var(--radius-button); border: 2px solid var(--line);
    background: var(--surface); color: var(--text); font: 16px var(--font-body); }
textarea.input { min-height: 120px; resize: vertical; }
.input:focus-visible, .chip:focus-visible, .link-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: none; background: var(--chip); color: var(--chip-text);
    font: 700 14px var(--font-body); display: inline-flex; align-items: center; cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.link-button { background: none; border: none; padding: 0; min-height: 44px; color: var(--accent); font: 700 15px var(--font-body); cursor: pointer; text-decoration: underline; }
.notice { padding: 12px 14px; border-radius: var(--radius-button); background: var(--chip); color: var(--chip-text); font-weight: 600; }
.dish { display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none; }
.dish .thumb, .thumb { width: 64px; height: 64px; border-radius: calc(var(--radius) / 2); object-fit: cover; background: var(--chip); flex: none; }
.photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); }
.ingredients, .steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.ingredient-row { display: grid; grid-template-columns: 72px 72px 1fr 44px; gap: 6px; align-items: center; }
.ingredient-row .input { padding: 8px 10px; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: transparent; color: var(--text);
    font: 700 20px var(--font-body); cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- What looks really different per theme ---- */

/* Bistro: uppercase small labels and tabs, the first suggestion as a big yellow block */
[data-theme="bistro"] .eyebrow, [data-theme="bistro"] .tabs a { text-transform: uppercase; letter-spacing: 0.1em; }
[data-theme="bistro"] .card.hero .button.cta { background: #1C1A17; border-color: #1C1A17; color: #F3EDE1; }

/* Schrift: tilted notes, a dashed tab bar, a ruled list */
[data-theme="schrift"] .card { box-shadow: 0 6px 14px rgba(34, 37, 43, 0.12); transform: rotate(-1deg); }
[data-theme="schrift"] .card:nth-of-type(2n) { transform: rotate(0.8deg); background: #E4F0FF; }
[data-theme="schrift"] .card:nth-of-type(3n) { transform: rotate(-0.5deg); background: #E5F4E6; }
[data-theme="schrift"] .tabs { border-top-style: dashed; }
[data-theme="schrift"] .tabs a { font: 600 22px "Caveat", cursive; }
[data-theme="schrift"] .tabs a.active { font-weight: 700; }
[data-theme="schrift"] .tabs svg { display: none; }
[data-theme="schrift"] h2 { font-size: 30px; color: var(--accent); }
[data-theme="schrift"] .list-row { border-bottom-color: #C9D5EE; }
[data-theme="schrift"] .ingredients li::marker { color: var(--marker); }

@media (prefers-reduced-motion: reduce) {
    [data-theme="schrift"] .card, [data-theme="schrift"] .card:nth-of-type(n) { transform: none; }
}

/* At the top: never over the tabs, so the list stays reachable whatever went wrong */
#blazor-error-ui { display: none; position: fixed; top: 0; left: 0; right: 0; padding: 12px 20px; background: #FFF6C9; color: #22252B; z-index: 1000; }
#blazor-error-ui .dismiss { position: absolute; right: 12px; top: 6px; border: none; background: none; font-size: 22px; cursor: pointer; }
/* A file picker that looks like a button: the input stays focusable (Tab, then Enter/Space) */
.file-button { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.file-button:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* The shopping list: a big round tick to check off with a thumb, the amount to tap and change */
.add-line { display: flex; gap: 10px; }
.shopping { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.shopping li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 12px; background: var(--surface); border-radius: var(--radius-button); }
.shopping .what { flex: 1; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.shopping .quantity { min-height: 44px; text-decoration: none; }
.shopping .input.amount { width: 96px; min-height: 40px; }
.shopping .check { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); background: transparent; color: var(--accent-text);
    font-weight: 900; cursor: pointer; }
.shopping .check.done { background: var(--accent); border-color: var(--accent); }
.shopping .remove { flex: none; width: 44px; height: 44px; border: none; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.shopping .check:focus-visible, .shopping .remove:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.shopping.bought .what { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.eyebrow.section { margin-top: 6px; }
.shopping .input.place { flex-basis: 100%; min-height: 40px; }
.shopping li:has(.place) { flex-wrap: wrap; }
.route { margin: 0; padding-left: 26px; columns: 2; column-gap: 24px; }
.route li { padding: 2px 0; break-inside: avoid; }
.places { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.places li { display: grid; grid-template-columns: 1fr minmax(140px, 1fr); gap: 4px 10px; align-items: center; }
.places li .muted { grid-column: 2; font-size: 13px; }
.places .what { font-weight: 600; overflow-wrap: anywhere; }
.shop-choice { display: flex; align-items: center; gap: 10px; }
.shop-choice > span { font-weight: 700; color: var(--muted); }
.shop-choice .input { flex: 1; font-weight: 600; }

/* The floor plan (brok 4b, Components/ShopMapView.razor): the theme's own colours, so it fits Markt, Bistro and Schrift.
   Its page gets the width of the screen: drawing is done on a computer, and the phone column would leave a strip. */
.shell:has(.map-page) { max-width: 1400px; }
.map-layout { display: grid; gap: 12px; }
@media (min-width: 900px) { .map-layout.editing { grid-template-columns: minmax(0, 1fr) 300px; } }
.map-plane { position: relative; overflow: hidden; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); min-height: 280px; }
.map-svg { display: block; touch-action: none; user-select: none; }
.map-svg text { font-family: var(--font-body); font-weight: 800; pointer-events: none; }
.map-gridline { stroke: var(--line); }
.map-floor { fill: var(--bg); }
.map-wall { fill: none; stroke: var(--muted); stroke-width: 0.12; opacity: .6; }
.map-block { cursor: pointer; }
.map-layout.editing .map-block { cursor: move; }
.map-shelf .map-box { fill: var(--chip); }
.map-shelf .map-label { fill: var(--chip-text); }
.map-empty .map-box { fill: var(--line); }
.map-want .map-box { fill: var(--accent); }
.map-want .map-label { fill: var(--accent-text); }
.map-checkout .map-box { fill: var(--muted); opacity: .45; }
.map-checkout .map-label { fill: var(--text); }
.map-entrance .map-box { fill: transparent; stroke: var(--accent); stroke-width: .1; stroke-dasharray: .25 .18; }
.map-entrance .map-label { fill: var(--accent); }
.map-selected .map-box { stroke: var(--cta); stroke-width: .14; }
.map-bad .map-box, .map-draft.map-bad { stroke: var(--cta); stroke-width: .16; fill: var(--cta); fill-opacity: .25; }
.map-draft { fill: var(--accent); fill-opacity: .3; stroke: var(--accent); stroke-width: .1; }
.map-path { fill: none; stroke: var(--cta); stroke-width: .16; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: .4 .2;
    animation: map-march 1.2s linear infinite; }
@keyframes map-march { to { stroke-dashoffset: -1.2; } }
@media (prefers-reduced-motion: reduce) { .map-path { animation: none; } }
.map-stop { fill: var(--surface); stroke: var(--cta); stroke-width: .08; }
.map-stop-text { fill: var(--text); font-weight: 900; }
.map-zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-handle { fill: var(--surface); stroke: var(--cta); stroke-width: .08; cursor: ew-resize; }
.map-handle.ns { cursor: ns-resize; }
.map-plane:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.map-zoom button { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--text);
    font: 800 18px var(--font-body); cursor: pointer; }
.map-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.map-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.map-size { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.map-sections { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.map-section { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.small { font-size: 13px; }
