/* Nutrition -- self-served CSS, no external resources, no web fonts
   (PROJEKT.md 4, 10.2). Mobile first.
   Structure: 1 tokens, 2 base, 3 layout (header, tab bar, footer),
   4 components (buttons, cards, forms, lists, badges, segmented control),
   then page-specific blocks. */

/* ---------- 1. Tokens ---------- */
:root {
    --bg: #f4f6f4;
    --surface: #ffffff;
    --surface-2: #f8faf8;
    --ink: #1c2421;
    --ink-soft: #5c6863;
    --ink-faint: #8b9590;
    --line: #e2e7e4;
    --line-strong: #cdd5d1;
    --accent: #2f6f4f;
    --accent-strong: #245a40;
    --accent-soft: #e7f1eb;
    --used-tint: #eef5fc;     /* Suchtreffer: verwendet oder eigen */
    --ki-tint: #dcebfa;       /* Marke „KI“ */
    --ki-ink: #1f5a8f;
    --coach: #ffe14d;         /* Hinweise für Besucher ohne Konto */
    --coach-ink: #000;
    --used-tint-hover: #e1edf9;
    --danger: #b3261e;
    --danger-soft: #fbeceb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 20, 0.05), 0 2px 8px rgba(16, 24, 20, 0.04);
    --header-h: 56px;
    --tabbar-h: 52px;
    --content-w: 46rem;
    /* Auswertung: Verhältnis zur Referenz (keine diagnostische Wertung). */
    --bar-rail: #e9ece9;      /* Schiene (Hintergrund des Balkens) */
    --bar-reached: #2f6f4f;   /* grün: Referenzwert erreicht */
    --bar-below: #c8862a;     /* bernstein: unter dem Referenzwert */
    --bar-ul: #c0392b;        /* rot: über der tolerierbaren Höchstmenge */
    --bar-ul-tint: rgba(192, 57, 43, 0.07);
    --bar-share: #5b7a99;     /* neutral: Anteil eines Lebensmittels, Richtwert */
    --bar-over-max: #d9701f;  /* orange: über einem Orientierungswert (höchstens) */
}

/* ---------- 2. Base ---------- */
/* The hidden attribute always wins over display rules (e.g. .btn's inline-flex). */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; margin-top: 1.25rem; }
h3 { font-size: 0.95rem; font-weight: 650; margin-top: 1rem; }
p { margin: 0.5rem 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
.icon { flex: none; display: block; }
.muted { color: var(--ink-soft); font-size: 0.875rem; }
.hint { color: var(--ink-soft); font-size: 0.875rem; margin: 0.75rem 0; }
.ack { color: var(--accent); font-size: 0.875rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 3. Layout ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.site-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 750;
    font-size: 1.05rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.site-logo {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 70% 30%, #8fd1a8 0 22%, transparent 23%),
        linear-gradient(135deg, var(--accent) 0%, #3f8f67 100%);
}
.site-nav { display: none; }
.site-nav a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }
.site-nav-guest { display: flex; margin-left: auto; align-items: center; gap: 0.5rem; }
/* Narrow phones: name, "Anmelden" and "Registrieren" just fit; the search is on the start page. */
@media (max-width: 459px) { .site-nav-guest .guest-search { display: none; } }
@media (max-width: 389px) {
    .site-header-inner:has(.site-nav-guest) .site-title { font-size: 0.85rem; gap: 0.3rem; }
    .site-nav-guest { gap: 0.1rem; }
    .site-nav-guest a { padding-inline: 0.4rem; font-size: 0.85rem; }
}
@media (max-width: 339px) { .site-header-inner:has(.site-nav-guest) .site-title { font-size: 0; } }
.site-nav a.btn-primary, .site-nav a.btn-primary:hover { color: #fff; background: var(--accent); }
.site-nav a.btn-primary:hover { background: var(--accent-strong); }
.site-user { display: none; margin-left: auto; align-items: center; gap: 0.25rem; }
.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 0;
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
}
.icon-link:hover, .icon-link.active { color: var(--accent); background: var(--accent-soft); }
.logout-form { display: inline; margin: 0; }
/* The "⋮" user menu (templates/_user_menu.html): a <details> in the header
   (icon button) and as the last tab on phones; the pop-up drops down below. */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.site-user .user-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
}
.site-user .user-menu-button:hover, .site-user .user-menu[open] > .user-menu-button, .site-user .user-menu.is-active > .user-menu-button { color: var(--accent); background: var(--accent-soft); }
.user-menu-pop { right: 0; top: calc(100% + 0.3rem); width: min(17rem, calc(100vw - 1.5rem)); }
.user-menu-mail { margin: 0.3rem 0.9rem 0.45rem; font-size: 0.8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.user-menu-pop .list-row { color: var(--ink); }
.user-menu-pop .list-row .icon { color: var(--ink-soft); }
/* The round account badge and its menu (templates/_account_menu.html, 7.11.2026):
   at the right end of the title row, on phones too. Colours fixed per account
   (accounts.avatar), white capitals on all of them. */
.site-account { margin-left: auto; display: flex; align-items: center; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-button { display: inline-flex; padding: 3px; }
.account-button:hover .avatar, .account-menu[open] > .account-button .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.account-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.8rem; }
.avatar-0 { background: #1a73e8; }
.avatar-1 { background: #c2185b; }
.avatar-2 { background: #2e7d32; }
.avatar-3 { background: #7b1fa2; }
.avatar-4 { background: #d84315; }
.avatar-5 { background: #00796b; }
.avatar-6 { background: #3949ab; }
.avatar-7 { background: #6d4c41; }
.account-pop { right: 0; top: calc(100% + 0.3rem); width: min(19rem, calc(100vw - 1.5rem)); padding: 0 0 0.35rem; }
.account-current { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 1.1rem 1rem 0.9rem; border-bottom: 1px solid var(--line); text-align: center; }
.account-current form { width: 100%; margin: 0.6rem 0 0; }
.account-name { margin: 0.35rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.account-mail { margin: 0; color: var(--ink-soft); font-size: 0.88rem; overflow-wrap: anywhere; }
.account-current .avatar-lg + .account-mail { margin-top: 0.35rem; }
.account-head { margin: 0.7rem 1rem 0.3rem; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.account-pop form { margin: 0; }
.account-row, .account-pop .list-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.account-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 1rem; }
.account-row:hover, .account-pop .list-row:hover { background: var(--surface-2); }
.account-row-text { display: flex; flex-direction: column; min-width: 0; }
.account-row-name { font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }
.account-row-mail { font-size: 0.82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.account-row-note { font-size: 0.78rem; color: var(--ink-faint); font-style: italic; }
.account-pop .account-add { border-top: 1px solid var(--line); margin-top: 0.35rem; padding-top: 0.25rem; }
.account-pop .list-row .icon { color: var(--ink-soft); }
.account-note { margin: 0.45rem 1rem 0.4rem; font-size: 0.75rem; color: var(--ink-faint); line-height: 1.35; }
/* an account of the iPhone app without an e-mail address (accounts.app_accounts):
   a person in place of the letter, an orange dot while no address secures it */
.avatar { position: relative; }
.avatar .icon { width: 62%; height: 62%; }
.avatar-dot { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 2px var(--surface, #fff); }
.account-unsaved { margin-top: 0.35rem; }
.account-current a.btn { width: 100%; margin-top: 0.6rem; }
.account-other-login { margin-top: 0.55rem; font-size: 0.88rem; }
.user-menu-legal { margin: 0.35rem 0.75rem 0.25rem; font-size: 0.8rem; color: var(--ink-faint); }
.user-menu-legal a { color: var(--ink-soft); }

main {
    flex: 1;
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 1rem 1rem 1.5rem;
}
main.wide { max-width: 72rem; }
main.wide.wide-table { max-width: 82rem; }  /* Konten: the whole table at once (2.12.2026) */

/* Phones: tab bar right below the title row (part of the sticky header);
   desktop: navigation inside the title row. Pages with the "compact-head" body
   class (search, adding an entry) hide the title row on phones. */
.tabbar {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr; /* 5 tabs, 6 for admins */
    height: var(--tabbar-h);
    border-top: 1px solid var(--line);
    position: relative; /* the user menu's pop-up drops below the bar */
}
.tabbar > a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ink-faint);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
}
.tabbar > a .icon { width: 21px; height: 21px; }
.tabbar > a.active { color: var(--accent); }
.tabbar .user-menu { position: static; }
.tabbar .user-menu-button {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--ink-faint);
    font-size: 0.68rem;
    font-weight: 500;
}
.tabbar .user-menu-button .icon { width: 21px; height: 21px; }
.tabbar .user-menu.is-active > .user-menu-button, .tabbar .user-menu[open] > .user-menu-button { color: var(--accent); }
.tabbar .user-menu-pop { position: absolute; right: 0.5rem; top: calc(100% + 0.25rem); }
.tabbar > a.active::after {
    content: "";
    position: absolute;
    left: 22%;
    right: 22%;
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--accent);
}
/* A meal of the diary day as a jump target (#mahlzeit-<pk> after adding to
   it): its header lands just below the sticky header (title row, on phones
   plus the tab bar). */
.meal { scroll-margin-top: calc(var(--header-h) + 0.75rem); }
@media (max-width: 759px) { .meal { scroll-margin-top: calc(var(--header-h) + var(--tabbar-h) + 0.75rem); } }
@media (max-width: 759px) {
    /* Phones: a flatter title row, the tab bar below carries the navigation. */
    :root { --header-h: 38px; }
    .site-title { font-size: 0.95rem; }
    .site-logo { width: 22px; height: 22px; border-radius: 7px; }
    body.compact-head .site-header-inner { display: none; }
    body.compact-head .tabbar { border-top: 0; }
}

.site-footer {
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.78rem;
}
.site-footer a { color: var(--ink-faint); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer-data { color: var(--ink-soft); }
.site-footer-data a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 2px; }

@media (min-width: 760px) {
    .site-nav { display: flex; gap: 0.15rem; }
    .site-user { display: flex; }
    .site-account { display: none; }
    /* Logged in: three columns, the middle one exactly as wide as the page
       content (--content-w less main's padding), so "Tagebuch" starts flush
       with what is below it; narrower windows push it right of the logo. */
    .site-header-inner:has(.site-user) {
        display: grid;
        grid-template-columns: minmax(max-content, 1fr) minmax(min-content, calc(var(--content-w) - 2.5rem)) minmax(max-content, 1fr);
        column-gap: 0;
    }
    .site-header-inner:has(.site-user) > .site-title { justify-self: start; padding-right: 1.25rem; }
    .site-header-inner:has(.site-user) > .site-nav { grid-column: 2; }
    .site-header-inner:has(.site-user) > .site-user { grid-column: 3; justify-self: end; margin-left: 0; padding-left: 0.5rem; }
    .tabbar { display: none; }
    main { padding: 1.5rem 1.25rem 2rem; }
}

/* ---------- 4. Components ---------- */
.messages { margin: 0 0 0.75rem; }
.message {
    margin: 0 0 0.4rem;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.875rem;
}
.message-error, .message-warning { background: var(--danger-soft); color: var(--danger); }
/* An information about the AI (incomplete label: the AI fills it), decision of 9.11.2026. */
.message-ki { background: var(--ki-tint); color: var(--ki-ink); }
.message-ki a { color: inherit; }
.product-warning .found-hit { margin: 0 0 0.6rem; }
.origin-ai_pending .origin-tag { color: var(--ki-ink); }

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
}
.page-head h1 { margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.85rem 1rem;
    margin: 0 0 0.75rem;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card > h2 { font-size: 0.95rem; margin: 0 0 0.4rem; }
.card-list { padding: 0.25rem 0; }

/* Buttons */
button, .btn {
    font: inherit;
}
.btn,
.stacked-form button[type=submit],
.period-form button[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover, .stacked-form button[type=submit]:hover, .period-form button[type=submit]:hover {
    background: var(--accent-strong);
    color: #fff;
}
.btn-secondary, .secondary-button {
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--line-strong);
}
.btn-secondary:hover, .secondary-button:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: var(--accent);
}
.btn-ghost { background: none; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn-sm { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-faint);
    cursor: pointer;
}
.btn-icon:hover { color: var(--danger); background: var(--danger-soft); }
.btn-icon.add:hover { color: var(--accent); background: var(--accent-soft); }
/* Former text-link buttons: quiet, but clearly a button. */
.link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    text-decoration: none;
}
.link-button:hover { color: var(--accent); background: var(--accent-soft); }

/* Form controls */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], select, textarea {
    font: inherit;
    font-size: 1rem; /* >= 16px: no zoom on iOS */
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.65rem;
    min-height: 40px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.stacked-form p { margin: 0 0 0.85rem; }
.stacked-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.25rem;
}
.stacked-form input:not([type=checkbox]):not([type=radio]),
.stacked-form select,
.stacked-form textarea { width: 100%; max-width: 26rem; }
.stacked-form .helptext, .stacked-form small { display: block; color: var(--ink-soft); font-size: 0.8rem; margin-top: 0.2rem; }
.stacked-form button[type=submit] { margin-top: 0.25rem; }
.stacked-form .errorlist, .form-errors {
    color: var(--danger);
    font-size: 0.85rem;
    list-style: none;
    padding: 0;
    margin: 0.25rem 0;
}

/* Lists */
.list-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: 0;
    background: none;
    color: var(--ink);
    text-decoration: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.list-row > span { flex: 1; }
.list-row .icon { color: var(--ink-faint); }
.list-row:hover { background: var(--surface-2); color: var(--accent); }
.card-list > * + *, .card-list > form + form, .card-list > a + form { border-top: 1px solid var(--line); }
.account-links { margin-top: 1.5rem; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }

/* Segmented control (e.g. period: Heute / 7 / 14 / 30 Tage) */
.seg {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: 10px;
    background: #e8ece9;
}
.seg a, .seg button {
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    border: 0;
    background: none;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.seg a.current, .seg a[aria-current], .seg button[aria-pressed=true] {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(16, 24, 20, 0.12);
}

/* Search field */
input.search-input {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem 0.85rem 0.6rem 2.4rem;
    min-height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9590' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E") no-repeat 0.85rem center / 18px;
}
.htmx-indicator {
    opacity: 0;
    margin-left: 0.5rem;
    color: var(--ink-soft);
    font-size: 0.8rem;
    transition: opacity 0.2s;
}
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Back link, item header, amount entry */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin: 0 0 0.5rem -0.35rem;
    padding: 0.2rem 0.4rem 0.2rem 0.15rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-decoration: none;
}
.back-link .icon { width: 18px; height: 18px; }
.back-link:hover { color: var(--accent); background: var(--accent-soft); }
.back a { color: var(--ink-soft); font-size: 0.85rem; text-decoration: none; }
.item-head { margin: 0 0 0.75rem; }
.item-head h1 { margin: 0 0 0.35rem; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.field-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); margin: 0.25rem 0 0.3rem; }
.amount-card select { width: 100%; margin-bottom: 0.9rem; }
.amount-input { position: relative; display: flex; align-items: center; }
.amount-input input {
    width: 100%;
    font-size: 1.6rem;
    font-weight: 700;
    min-height: 56px;
    padding-right: 3rem;
    font-variant-numeric: tabular-nums;
}
.amount-input .unit { position: absolute; right: 0.9rem; color: var(--ink-soft); font-weight: 600; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0.9rem; }
.chip {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.82rem;
    cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.seg-scroll { display: flex; max-width: 100%; overflow-x: auto; margin: 0 0 0.75rem; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll a { flex: 1; text-align: center; }

/* Detail pages */
.btn-block-mobile { margin: 0 0 0.85rem; }
@media (max-width: 759px) { .btn-block-mobile { display: flex; width: 100%; } }
.nutrient-card h2 { font-size: 0.9rem; margin: 0.1rem 0 0.35rem; color: var(--ink-soft); }
.nutrient-card .nutrients tr:last-child th, .nutrient-card .nutrients tr:last-child td { border-bottom: 0; }
/* Origin of every value (foods.display): a tag, its detail only on wide screens. */
.origin-tag { display: inline-block; font-size: 0.68rem; font-weight: 600; line-height: 1.5; padding: 0 0.35rem; border-radius: 4px; background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; vertical-align: baseline; }
.origin-detail { display: block; font-size: 0.72rem; line-height: 1.3; color: var(--ink-faint); }
.nutrients tr.origin-user .origin-tag { background: var(--accent-soft); color: var(--accent-strong); }
.nutrients tr.origin-corrected .origin-tag { background: var(--accent-soft); color: var(--accent-strong); }
.nutrients tr.origin-category .origin-tag,
.nutrients tr.origin-recipe .origin-tag,
.nutrients tr.origin-ai .origin-tag,
.nutrients tr.origin-missing .origin-tag,
.nutrients tr.origin-label_zero .origin-tag,
.nutrients tr.origin-fortified .origin-tag { font-weight: 400; font-style: italic; }
.nutrients .origin-detail a { color: inherit; }
@media (max-width: 600px) {
    .nutrients .origin { padding-left: 0.25rem; padding-right: 0; text-align: right; }
    .nutrients .origin-detail { display: none; }
}
.estimate-status h2 { font-size: 0.9rem; margin: 0.1rem 0 0.35rem; color: var(--ink-soft); }
.estimate-runs { margin: 0.3rem 0 0.6rem; padding-left: 1.1rem; font-size: 0.85rem; color: var(--ink-soft); }
.hits li { position: relative; }
.hit-admin { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); margin: 0; }
.hit-admin .btn-icon { font-size: 1rem; line-height: 1; min-height: 28px; min-width: 28px; }
.legend-card h2 { font-size: 0.9rem; margin: 0.1rem 0 0.5rem; color: var(--ink-soft); }
.origin-legend { margin: 0; font-size: 0.85rem; }
.origin-legend div { display: grid; grid-template-columns: 7rem 1fr; gap: 0.25rem 0.6rem; align-items: baseline; margin: 0 0 0.4rem; }
.origin-legend dt, .origin-legend dd { margin: 0; }
.origin-legend dd { color: var(--ink-soft); }
@media (max-width: 600px) { .origin-legend div { grid-template-columns: 6.5rem 1fr; } }
.badge .icon { width: 13px; height: 13px; }

/* Start page for visitors without an account */
.home-hero { margin: 1rem 0 1.5rem; }
.home-hero h1 { font-size: 1.7rem; margin: 0 0 0.5rem; }
.home-hero p { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 1rem; }
.home-search { margin: 0 0 0.75rem; }
.home-features { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin: 0 0 1rem; }
.home-features h2 { font-size: 1rem; margin: 0 0 0.3rem; }
.home-features p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
@media (min-width: 600px) { .home-features { grid-template-columns: 1fr 1fr; } }

/* Result lists (search, diary add) */
.hits {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.hits li + li { border-top: 1px solid var(--line); }
.hits a {
    display: block;
    padding: 0.32rem 0.85rem;
    line-height: 1.35;
    color: var(--ink);
    text-decoration: none;
}
.hits a:hover { background: var(--surface-2); color: var(--accent); }
/* A row the user has used or created: tinted edge to edge, the text stays in line. */
.hit-used { background: var(--used-tint); }
.hits .hit-used a:hover { background: var(--used-tint-hover); }
.ingredient-results .hit-used { box-shadow: -0.5rem 0 0 var(--used-tint), 0.5rem 0 0 var(--used-tint); }
.hit-used .own-mark { background: #dfe5f3; }
.result-group {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    margin: 0.85rem 0 0.3rem;
}

/* --- Detailseite --- */
.back a,
.basis {
    font-size: 0.9rem;
    color: var(--ink-soft);
    text-decoration: none;
}
.nutrient-tier {
    margin: 1.5rem 0;
}
.nutrients {
    width: 100%;
    border-collapse: collapse;
}
.nutrients th,
.nutrients td {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--line);
    vertical-align: baseline;
}
.nutrients th {
    font-weight: 400;
}
.nutrients .amount {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.nutrients .origin {
    color: var(--ink-soft);
    font-size: 0.8rem;
}
.nutrients .missing {
    color: var(--ink-soft);
}
.nutrients tr.state-missing th {
    color: var(--ink-soft);
}
.source {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.form-errors {
    color: #a33;
    padding-left: 1rem;
}
.placeholder-note {
    color: #a33;
    font-size: 0.85rem;
}

/* --- Tagebuch --- */
.date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}
.date-bar .btn-icon.nav { color: var(--ink-soft); width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); }
.date-bar .btn-icon.nav:hover { color: var(--accent); background: var(--accent-soft); }
.date-pick { flex: 1; text-align: center; margin: 0; }
.date-pick label { position: relative; display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; padding: 0.15rem 0.75rem; border-radius: var(--radius-sm); }
.date-pick label:hover { background: var(--surface); }
.date-title { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.date-sub { font-size: 0.8rem; color: var(--ink-soft); }
/* The native date input covers the label invisibly: tapping the date opens the
   calendar on phones and desktops alike. */
.date-pick input[type=date] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    min-height: 0;
    padding: 0;
    border: 0;
}
.date-pick input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.back-today { text-align: center; margin: -0.5rem 0 0.5rem; }

.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}
.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.55rem 0.2rem;
    text-align: center;
    min-width: 0;
}
.tile-value { display: block; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-value small { font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
.tile-label { display: block; font-size: 0.7rem; letter-spacing: -0.01em; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-main { background: var(--accent); border-color: var(--accent); }
.tile-main .tile-value, .tile-main .tile-value small, .tile-main .tile-label { color: #fff; }
.tile-flag { color: inherit; opacity: 0.75; font-size: 0.7rem; margin-left: 1px; }
.tile-value .tile-goal { font-size: 0.68rem; font-weight: 500; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.tile-name-short { display: none; }
.tile-main .tile-value .tile-goal { color: rgba(255, 255, 255, 0.8); }
.tile-bar { --tile-bar: var(--bar-share); display: block; height: 6px; margin: 0.35rem 0.4rem 0; border-radius: 3px; background: var(--bar-rail); position: relative; }
.tile-bar.status-reached, .tile-bar.status-within { --tile-bar: var(--bar-reached); }
.tile-bar.status-below { --tile-bar: var(--bar-below); }
.tile-bar.status-over-max { --tile-bar: var(--bar-over-max); }
/* Protein, fat, carbohydrates: up to 100 % always green (decision of 31.10.2026). */
.tile:not(.tile-main) .tile-bar { --tile-bar: var(--bar-reached); }
.tile-fill { display: block; height: 100%; border-radius: 3px; background: var(--tile-bar); }
.tile-bar.over .tile-fill { border-radius: 3px 0 0 3px; }
/* Over 100 %: the part beyond the target solid orange, as "über dem
   Orientierungs- bzw. Richtwert" below (decision of 31.10.2026), a mark at 100 %. */
.tile-excess {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 0 3px 3px 0;
    background: var(--bar-over-max);
}
.tile-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
/* The percentage as large as the value (decision of 31.10.2026). */
.tile-over { font-size: 1.15rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Over 100 %: a light end cap shows the bar goes beyond the target. */
.tile-main .tile-bar { background: rgba(255, 255, 255, 0.3); }
.tile-main .tile-bar { --tile-bar: #fff; }
.tile-main .tile-mark { background: var(--ink); box-shadow: 0 0 0 1px #fff; }
.tile-main .tile-over { color: #fff; }
.goal-of { color: var(--ink-faint); font-size: 0.8rem; }
.day-details .bar-cell { width: 34%; padding-left: 0.5rem; padding-right: 0.5rem; vertical-align: middle; }
.day-details .bar-cell .nb-track { display: block; height: 0.6rem; }
.day-details .pct { width: 1%; white-space: nowrap; text-align: right; font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
    .day-details .bar-cell { width: 26%; padding-left: 0.25rem; padding-right: 0.25rem; }
    .day-details .goal-of { display: block; }
}

.day-details { padding: 0; }
.day-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-soft);
}
.day-details > summary::-webkit-details-marker { display: none; }
.day-details[open] > summary .icon { transform: rotate(180deg); }
.day-details > table, .day-details > .hint { margin: 0 1rem 0.75rem; width: calc(100% - 2rem); }
.day-details .group-row th {
    padding: 0.9rem 0.25rem 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line-strong);
}
.day-details tbody:first-child .group-row th { padding-top: 0.2rem; }

/* All day values at the bottom of the diary (report rows for one day). */
.day-values { margin-top: 1.75rem; }
.day-values-title { font-size: 1.05rem; margin: 0 0 0.5rem; }
.day-values { scroll-margin-top: calc(var(--header-h) + 0.75rem); }
@media (max-width: 759px) { .day-values { scroll-margin-top: calc(var(--header-h) + var(--tabbar-h) + 0.75rem); } }
.day-values-meals { margin: 0 0 0.5rem; }
.day-values-meals + .hint { margin-top: 0; }
.nb-coverage { margin-left: 0.35rem; }
.meal { position: relative; padding: 0.35rem 0.25rem 0.35rem 1rem; }
/* Phone: title with add/edit, energy sum on the right, macro sums below;
   per entry only the energy. PC (min-width 760px, below): four columns. */
.meal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.5rem;
    min-height: 38px;
}
.meal-title { display: flex; align-items: center; gap: 0.1rem; min-width: 0; }
.meal-title h2 { margin: 0 0.4rem 0 0; font-size: 0.95rem; }
.meal-sums { display: contents; }
.meal-sums .val-enercc {
    grid-column: 2;
    grid-row: 1;
    padding-right: 0.5rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.meal-sums .val-enercc .val-label { display: none; }
.meal-macros {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 0.3rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}
.meal-macros .val + .val::before { content: " · "; }
.meal-title .meal-menu { position: static; }
.meal-title .menu-pop { left: 0.5rem; right: auto; top: 2.6rem; width: min(22rem, calc(100% - 1rem)); }
.meal-empty { display: block; padding: 0.1rem 0 0.5rem; font-size: 0.85rem; color: var(--ink-faint); text-decoration: none; }
.meal-empty:hover { color: var(--accent); }

.entries { list-style: none; padding: 0; margin: 0; }
.entries li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.1rem 0;
    border-top: 1px solid var(--line);
}
.entries .btn-icon { width: 30px; height: 28px; }
.entries .inline-form { display: flex; }  /* no line box around the bin (adds height) */
/* On a PC the rows are as low as the text allows: a smaller hit area for the
   bin is fine with a mouse (phones keep 28px for the finger). */
@media (min-width: 760px) {
    .entries li { padding: 0.08rem 0; }
    .entries .btn-icon { width: 28px; height: 24px; }
}
.entry-name { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.entry-amount { color: var(--ink-soft); font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-vals .val { display: none; font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-vals .val-enercc { display: inline-block; min-width: 4.2rem; text-align: right; }
@media (min-width: 760px) {
    .meal-head { display: flex; gap: 0.6rem; }
    .meal-title { flex: 1; }
    .meal-sums { display: flex; align-items: flex-end; gap: 0.6rem; }
    .meal-macros { display: contents; }
    .meal-sums .val {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-end;
        width: 4.75rem;
        padding: 0;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--ink);
    }
    .meal-sums .val-label,
    .meal-sums .val-enercc .val-label { display: block; font-size: 0.68rem; font-weight: 400; color: var(--ink-faint); }
    .meal-macros .val + .val::before { content: none; }
    .entry-vals { display: flex; gap: 0.6rem; }
    .entry-vals .val { display: block; width: 4.75rem; text-align: right; color: var(--ink-soft); }
    .entry-vals .val-enercc { min-width: 0; color: var(--ink); }
}
.inline-form { display: inline; margin: 0; }
.card .entries li:first-child, .card > .entries:first-child li:first-child { border-top: 0; }
.add-link { color: var(--accent); text-decoration: none; font-size: 0.875rem; }
.complete-form { margin: 1rem 0 0; text-align: center; }
.complete-form .is-complete { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.complete-form .muted { font-size: 0.78rem; margin-top: 0.4rem; }

.nutrients.compact th, .nutrients.compact td { padding: 0.3rem 0.25rem; font-size: 0.875rem; }
.nutrients .coverage { width: 1%; white-space: nowrap; }

/* Narrow phones: energy as a wide tile, the three macros below it. */
@media (max-width: 520px) {
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tile-main { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 0.5rem; padding: 0.5rem; }
    .tile-main .tile-bar { flex-basis: 100%; margin: 0.35rem 0.5rem 0; }
    .tile-main .tile-value, .tile-main .tile-over { font-size: 1.25rem; }
    .tile-main .tile-label { font-size: 0.8rem; }
    .tile-name-long { display: none; }
    .tile-name-short { display: inline; }
}
@media (max-width: 420px) {
    .tile-value, .tile-over { font-size: 1rem; }
    .entry-amount { font-size: 0.8rem; }
    .entry-vals .val-enercc { min-width: 3.6rem; font-size: 0.8rem; }
}

/* --- Mahlzeiten: Menü, Kopieren, Vorlagen, Schnellauswahl --- */
.meal-menu { position: relative; }
.meal-menu > summary { list-style: none; }
.meal-menu > summary::-webkit-details-marker { display: none; }
.meal-menu[open] > summary { color: var(--accent); background: var(--accent-soft); }
.menu-pop {
    position: absolute;
    right: 0;
    top: 2.4rem;
    z-index: 10;
    width: min(20rem, calc(100vw - 2rem));
    padding: 0.35rem 0;
    box-shadow: 0 6px 24px rgba(16, 24, 20, 0.16);
}
.menu-pop .list-row { padding: 0.55rem 0.9rem; font-size: 0.9rem; }
.menu-pop .list-row.danger { color: var(--danger); }
.menu-pop .list-row.danger .icon { color: var(--danger); }
.menu-form { padding: 0.5rem 0.9rem 0.6rem; border-top: 1px solid var(--line); margin: 0; }
.menu-form .field-label { display: flex; align-items: center; gap: 0.35rem; }
.menu-form .field-label .icon { width: 16px; height: 16px; }
.menu-inline { display: flex; gap: 0.4rem; }
.menu-inline input { flex: 1; min-width: 0; min-height: 34px; padding: 0.3rem 0.5rem; font-size: 0.95rem; }
.quick-list { padding: 0; }
.quick-row, .template-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.85rem; margin: 0; }
.quick-list > .quick-row + .quick-row, .card-list > .template-row + .template-row { border-top: 1px solid var(--line); }
.quick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
/* One line under the name, cut with "…" (decision of 31.10.2026). */
.quick-text small { color: var(--ink-soft); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Meal templates on the add page: compact rows, the button for more below. */
.compact-quick .quick-row { padding: 0.12rem 0.75rem; gap: 0.6rem; }
.compact-quick .quick-text { line-height: 1.12; }
.compact-quick .quick-row .btn-sm { min-height: 26px; padding: 0.1rem 0.55rem; }
.compact-quick .more-row { text-align: center; padding: 0.1rem 0; border-top: 1px solid var(--line); }
.add-for { font-size: 0.9rem; white-space: nowrap; }
.quick-row .btn .icon { width: 16px; height: 16px; }
.result-group .icon { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 0.15rem; }
.templates-section { margin-top: 1.75rem; }
.template-sums { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0.85rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.template-sums dt { color: var(--ink-soft); font-size: 0.75rem; }
.template-sums dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Meal template pages: compact (detail, edit, adding) */
.template-page .page-head { align-items: center; margin-bottom: 0.5rem; }
.template-page .page-head .action-row { margin: 0; }
.template-page .card { padding: 0.55rem 0.8rem; margin-bottom: 0.5rem; }
.template-page .card h2 { margin: 0 0 0.3rem; font-size: 1rem; }
.template-page .back-link { margin-bottom: 0.25rem; }
.template-name-form .field-label { margin-top: 0; }
.template-name-form .menu-inline input { max-width: 26rem; }
.template-name-form input[name=name] { width: 100%; max-width: 26rem; min-height: 34px; padding: 0.3rem 0.5rem; font-size: 0.95rem; }
.template-page .entries li { gap: 0.4rem; }
.template-page .entry-link { color: inherit; text-decoration: none; cursor: pointer; }
.template-page .entry-link:hover { color: var(--accent); }
.template-page #template-results { margin-top: 0.3rem; }
.template-page .ingredient-results { margin: 0.2rem 0 0; }
.template-page .ingredient-add-row { align-items: center; gap: 0.35rem; padding: 0.15rem 0; }
.template-page .ingredient-add-row input[name=amount] { width: 3.6rem; min-height: 32px; padding: 0.2rem 0.35rem; }
.template-page .ingredient-add-row .btn-icon, .template-page .ingredient-amount-form .btn-icon { width: 32px; height: 32px; }
.template-page .result-group { margin: 0.4rem 0 0.1rem; font-size: 0.85rem; }
/* Recipes page (30.10.2026): search on top, compact one-line rows. */
.recipe-list-search { margin: 0 0 0.6rem; }
.list-section { margin: 0 0 0.9rem; }
.list-head { margin: 0 0 0.35rem; }
.list-head h2, h2.list-head { margin: 0; font-size: 1.05rem; }
.compact-list { padding: 0; }
.compact-list .list-row { padding: 0.42rem 0.85rem; gap: 0.6rem; }
.compact-list .list-row .icon { width: 18px; height: 18px; }
.row-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.5rem; }
.row-name { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-list .row-text small { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 0.78rem; }
/* Meals: name and items as one text of at most two lines, then "…". */
.compact-list .row-text.row-wrap { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.35; }
.compact-list .row-wrap .row-name, .compact-list .row-wrap small { display: inline; white-space: normal; max-width: none; }
.compact-list .row-wrap .row-name { margin-right: 0.3rem; }
.compact-list .more-row { text-align: center; padding: 0.1rem 0; }
.templates-section h2 { margin: 0; }
.recipes-heading { margin: 1.25rem 0 0.5rem; }
.recipes-heading h2 { margin: 0; }

/* --- Rezepte --- */
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.85rem; }
.empty-state { text-align: center; padding: 1.5rem 1rem; }
.list-row small { flex: none; }
.ingredient-amount-form { display: flex; align-items: center; gap: 0.25rem; margin: 0; }
.ingredient-amount-form input[name=amount_g], .ingredient-amount-form input[name=amount], .ingredient-amount-form input[name^="amount-"], .ingredient-amount-form input[name$="-amount"] { width: 4.8rem; min-height: 34px; padding: 0.25rem 0.4rem; text-align: right; font-size: 0.95rem; }
.ingredient-amount-form .unit { color: var(--ink-soft); font-size: 0.85rem; }
select.unit-select { width: auto; min-height: 34px; padding: 0.2rem 0.3rem; font-size: 0.95rem; }
.amount-with-unit { gap: 0.5rem; }
.amount-with-unit input { flex: 1; min-width: 0; padding-right: 0.65rem; }
.amount-input.amount-with-unit select.unit-select { width: auto; margin-bottom: 0; align-self: stretch; min-height: 0; font-size: 1rem; }
.coverage-inline { display: block; font-weight: 400; color: var(--ink-faint); font-size: 0.72rem; }
.stacked-form button.btn-block { width: 100%; }
#ingredient-results, #template-results { margin-top: 0.5rem; }

/* --- Rezepte (ab Schritt 6b) --- */
.recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: baseline;
    margin: 1rem 0;
}
.recipe-actions a {
    color: var(--accent);
    text-decoration: none;
}
.ingredient-results {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}
.ingredient-add-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--line);
}
.ingredient-add-row .entry-name {
    flex: 1;
}
.ingredient-add-row input[name=amount_g], .ingredient-add-row input[name=amount] {
    width: 4.5rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: 4px;
}

/* --- Auswertung (ab Schritt 7b) --- neutral, keine Warnfarben (PROJEKT.md 8.6) */
.report-period {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: baseline;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}
.report-period a {
    color: var(--ink-soft);
    text-decoration: none;
}
.report-period a.current {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}
.day-nav {
    justify-content: space-between;
    max-width: 32rem;
}
.day-nav strong { color: var(--ink); }
.report-table th[scope=row] {
    font-weight: 400;
}
.nutrient-note {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 0.15rem;
}
.comparison {
    font-size: 0.85rem;
}
.percent {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.ref-source,
.soft-note,
.ul-note {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 0.15rem;
}
.reference-explainer {
    border-left: 3px solid var(--line);
    padding: 0.25rem 0 0.25rem 1rem;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* --- Auswertung: Kopf --- */
.report-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.75rem; }
.period-custom { position: relative; }
.period-custom > summary { list-style: none; }
.period-custom > summary::-webkit-details-marker { display: none; }
.period-custom .icon { width: 18px; height: 18px; }
.period-custom[open] .period-form { position: absolute; right: 0; top: 2.4rem; z-index: 5; width: max-content; max-width: calc(100vw - 2rem); }
.period-form { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: end; font-size: 0.85rem; }
.period-form label { display: flex; flex-direction: column; gap: 0.2rem; font-weight: 600; color: var(--ink-soft); }
.report-note { font-size: 0.8rem; color: var(--ink-soft); margin: -0.25rem 0 0.75rem; text-align: center; }
.period-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--ink-soft); }
.seg-sm a { padding: 0.25rem 0.6rem; font-size: 0.78rem; }
.btn-icon.is-disabled { opacity: 0.35; cursor: default; }
.report-group { padding: 0.5rem 0.75rem 0.25rem; }
.values-head { margin: 1.5rem 0 0.25rem; font-size: 1.1rem; }
.values-head + .hint, .values-basis + .hint { margin-top: 0; }
.values-basis { margin: 0.35rem 0 0.5rem; }
.report-group .report-group-title { margin: 0.2rem 0.25rem 0.35rem; border: 0; padding: 0; font-size: 0.9rem; }
.report-group .nb:last-child { border-bottom: 0; }
.nb.no-cmp > summary { grid-template-columns: 1fr auto; }
.nb.no-data .nb-name,
.nb.no-data .nb-amount { color: var(--ink-faint); }
.nb.no-data .nb-amount small { font-size: 0.8em; }
.nutrients tr.no-data th,
.nutrients tr.no-data td { color: var(--ink-faint); }
.nutrients tr.no-data small { font-size: 0.8em; }
div.date-pick { display: flex; flex-direction: column; align-items: center; }

/* --- Auswertung: kompakte Balkenansicht --- */
.report-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    list-style: none;
    margin: 0 0 0.6rem;
    padding: 0;
    font-size: 0.8rem;
    color: var(--ink-soft);
}
.report-legend .swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 2px;
    margin-right: 0.3rem;
    vertical-align: -1px;
}
.report-legend .status-reached { background: var(--bar-reached); }
.report-legend .status-below { background: var(--bar-below); }
.report-legend .status-ul { background: var(--bar-ul); }
.report-legend .status-over-max { background: var(--bar-over-max); }
.report-legend .swatch-ref {
    display: inline-block;
    width: 2px;
    height: 0.95rem;
    background: #4a4a4a;
    margin: 0 0.45rem 0 0.4rem;
    vertical-align: -2px;
}

.report-group-title {
    font-size: 0.95rem;
    color: var(--ink-soft);
    margin: 1.25rem 0 0.25rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.2rem;
}
.nutrient-bars { margin: 0 0 0.5rem; }

.nb { border-bottom: 1px solid var(--line); }
.nb.over-ul { background: var(--bar-ul-tint); }
.nb > summary {
    display: grid;
    /* Feste Spalten, damit die Balken (und die 100%-Marke) zeilenuebergreifend
       exakt fluchten. */
    grid-template-columns: 9.5rem 1fr 11rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.4rem;
    cursor: pointer;
    list-style: none;
}
.nb > summary::-webkit-details-marker { display: none; }
.nb > summary::marker { content: ""; }
.nb-name { font-size: 0.9rem; line-height: 1.15; display: flex; align-items: center; gap: 0.3rem; }  /* tight when a long name wraps */
/* Chevron: shows that the row can be expanded; turns up when open. */
.nb-chev { flex: none; display: inline-flex; color: var(--ink-soft); transition: transform 0.15s ease; }
.nb-chev .icon { width: 16px; height: 16px; }
.nb[open] .nb-chev { transform: rotate(180deg); color: var(--accent); }
.nb > summary:hover .nb-chev { color: var(--accent); }

/* Balken: Achse 0–150 %, 100 %-Marke bei 2/3 (= 66.666 %). Werte ueber 100 %
   ragen sichtbar ueber die Marke hinaus (gedeckelt bei 150 %). */
.nb-track {
    position: relative;
    height: 0.8rem;
    border-radius: 5px;
    background: var(--bar-rail);
}
.nb-track.status-none { background: transparent; }
.nb-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    min-width: 3px;
    border-radius: 5px;
}
.status-below .nb-fill { background: var(--bar-below); }
.status-reached .nb-fill, .status-within .nb-fill { background: var(--bar-reached); }
.status-over-max .nb-fill { background: var(--bar-over-max); }
.nb.over-ul .nb-fill { background: var(--bar-ul); }
.nb-ref {
    position: absolute;
    left: 50%;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: #3a3a3a;
    border-radius: 1px;
}
/* ueber 200 %: Balken ist gedeckelt; gerade (abgeschnittene) Kante + »-Hinweis,
   dass die Zufuhr noch darueber hinausgeht. */
.nb-track.over-axis .nb-fill {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.nb-more {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1;
    pointer-events: none;
}

.nb-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.nb-value-main { display: flex; align-items: baseline; gap: 0.5rem; }
.nb-pct { font-weight: 600; min-width: 3.4rem; text-align: right; }
.nb-amount { color: var(--ink-soft); min-width: 4.6rem; text-align: right; }
.nb-goal { color: var(--ink-faint); }
.nb-detail .ref-source { overflow-wrap: anywhere; }
.nb-ul-badge {
    color: var(--bar-ul);
    font-weight: 700;
    font-size: 0.72rem;
}
.nb-detail {
    font-size: 0.82rem;
    color: var(--ink-soft);
    padding: 0 0.4rem 0.6rem;
}
.nb-detail p { margin: 0.25rem 0; }
/* "Woher kommt es?" -- Anteile der Lebensmittel an einem Naehrstoff. Neutrale
   Farbe: ein Anteil ist weder gut noch schlecht. */
/* Recipe and meal pages: nutrient rows that open "Woher kommt es?" (the
   ingredients' shares, same bars as the diary), one value column per basis. */
.rn-list { --rn-cols: 1; }
.rn-list.rn-cols-2 { --rn-cols: 2; }
.rn-head, .rn > summary, .rn-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(var(--rn-cols), 6.5rem);
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.4rem;
}
.rn { border-bottom: 1px solid var(--line); }
.rn:last-child { border-bottom: 0; }
.rn-head { padding-top: 0; padding-bottom: 0.2rem; border-bottom: 1px solid var(--line); font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.rn-head span, .rn-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rn-val { font-size: 0.9rem; }
.rn > summary { cursor: pointer; list-style: none; }
.rn > summary::-webkit-details-marker { display: none; }
.rn > summary::marker { content: ""; }
.rn[open] .nb-chev { transform: rotate(180deg); color: var(--accent); }
.rn > summary:hover .nb-chev { color: var(--accent); }
.rn-row .nb-name { padding-left: calc(16px + 0.3rem); } /* aligned with the chevron rows */
@media (max-width: 600px) {
    .rn-head, .rn > summary, .rn-row { grid-template-columns: minmax(0, 1fr) repeat(var(--rn-cols), 5.6rem); gap: 0.4rem; }
}
.nb-contrib { margin: 0.2rem 0 0.6rem; }
.nb-contrib-title { font-weight: 600; color: var(--ink); margin: 0.25rem 0 0.3rem; }
.nb-contrib ul { list-style: none; margin: 0; padding: 0; }
.nb-contrib li {
    display: grid;
    grid-template-columns: minmax(0, 11rem) 1fr 8.5rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.15rem 0;
}
.nb-contrib li.is-rest .c-name { font-style: italic; }
.c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.c-track {
    position: relative;
    height: 0.55rem;
    border-radius: 4px;
    background: var(--bar-rail);
}
.c-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 4px;
    background: var(--bar-share);
}
.c-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.estimate-mark-inline { font-style: italic; color: var(--ink-soft); font-size: 0.75rem; }
.nb-info {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.2rem 0.75rem;
    margin: 0.45rem 0;
}
.nb-info dt { font-weight: 600; color: var(--ink); }
.nb-info dd { margin: 0; }
.report-tip {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin: 0 0 0.5rem;
}

@media (max-width: 30rem) {
    .nb > summary {
        /* phone: name and values in one line, the bar full width below */
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "name value" "track track";
        gap: 0.3rem 0.5rem;
    }
    .nb > summary .nb-name { grid-area: name; }
    .nb > summary .nb-value { grid-area: value; }
    .nb > summary .nb-track { grid-area: track; margin-left: 1.3rem; }
    .nb-value { font-size: 0.8rem; }
    .nb-value-main { gap: 0.3rem; }
    .nb-pct { min-width: 2.3rem; }
    .nb-amount { min-width: 0; }
    .nb-ul-badge { font-size: 0.68rem; }
    .nb-info { grid-template-columns: 1fr; }
    .nb-info dd { margin-bottom: 0.3rem; }
    .nb-contrib li { grid-template-columns: minmax(0, 7rem) 1fr 6.5rem; gap: 0.4rem; }
}

/* --- Markenprodukte (ab Schritt 8b) --- */
.hits .brand,
.ingredient-results .brand,
.entries .brand {
    color: var(--ink-soft);
    font-size: 0.85rem;
}
.ingredient-add-row.is-unavailable { color: var(--ink-soft); }
.ingredient-add-row .hint-inline {
    font-size: 0.8rem;
    font-style: italic;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .ingredient-add-row.is-unavailable { flex-wrap: wrap; }
    .ingredient-add-row .hint-inline { white-space: normal; }
}
.hits .variant-count {
    color: var(--ink-soft);
    font-size: 0.8rem;
    white-space: nowrap;
}
.variants { margin-top: 1.25rem; }
.variants h2 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.hits .hit-values {
    display: block;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}
.secondary-button.htmx-request { opacity: 0.5; }

/* --- Schaetzungen (ab Schritt 8c) --- neutral gekennzeichnet */
.supplement-mark { display: block; font-size: 0.78rem; color: var(--ink-soft); margin: 0.25rem 0; }
.estimate-mark {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    font-style: italic;
}

.legal-text h2 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
}
.legal-text {
    font-size: 0.95rem;
}

/* --- Rezepte: Mengen ändern, Portionen --- */
.amount-unit { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.stacked-form .amount-unit input { min-width: 0; width: 6rem; }
.stacked-form .amount-unit select { min-width: 0; }
.stacked-form textarea {
    width: 100%;
    max-width: 32rem;
    padding: 0.5rem;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 6px;
}

/* --- Suche: weitere Treffer nachladen --- */
.hits li.more-row { border-bottom: none; text-align: center; }
.more-button {
    background: none;
    border: none;
    color: var(--ink-soft);
    padding: 0.25rem 1.5rem;
    cursor: pointer;
    border-radius: 6px;
    line-height: 0;
}
.more-button:hover,
.more-button:focus-visible { color: var(--accent); background: var(--bar-rail, rgba(0, 0, 0, 0.05)); }
.more-button.htmx-request { opacity: 0.4; }
.ingredient-results li.more-row { text-align: center; }

/* --- Suche: eine gemeinsame Trefferliste (Grundlebensmittel fett, kcal rechts) --- */
.hit { display: flex; align-items: baseline; gap: 0.75rem; }
.hits a.hit { display: flex; }
.hit-main { flex: 1; min-width: 0; }
.label-note { color: var(--ink-faint); font-size: 0.8em; font-style: italic; white-space: nowrap; }
.hit-food .hit-name { font-weight: 600; }
/* Ingredient rows share the line with amount and button: energy below the name. */
.ingredient-add-row .hit { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.hit-kcal {
    flex: none;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Betreiber-Übersicht (dashboard); main.wide is defined above (72rem) --- */
.dash-section { margin: 1.5rem 0 2rem; }
.dash-section h2 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.dash-section h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.dash-nav { margin-bottom: 1rem; }
.dash-areas { margin-bottom: 0; }
.dash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0.4rem 0 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}
.dash-tabs a { color: var(--ink-soft); text-decoration: none; padding-bottom: 0.15rem; border-bottom: 2px solid transparent; }
.dash-tabs a:hover { color: var(--ink); }
.dash-tabs a.current { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.dash-tabs .dash-tab-external { margin-left: auto; }
/* tasks of the start page: a list with count, link and detail */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.task-list .count { min-width: 3rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.task-list .detail { color: var(--ink-soft); font-size: 0.85rem; flex-basis: 100%; padding-left: 3.6rem; }
/* process strip (Import → Wartefrist → Versionsprüfung) */
.flow { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0.5rem 0 1rem; align-items: stretch; }
.flow li { border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.65rem; flex: 1 1 12rem; position: relative; }
.flow li + li::before { content: "→"; position: absolute; left: -0.75rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); background: var(--bg, #fff); }
.flow .flow-title { font-size: 0.78rem; color: var(--ink-soft); display: block; }
.flow .flow-value { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
/* long explanations folded away */
.explain { margin: 0.5rem 0 0.75rem; font-size: 0.875rem; }
.explain > summary { cursor: pointer; color: var(--accent); }
.explain p { margin: 0.4rem 0 0; }
.day-bars.cost .day-bar-fill { background: var(--bar-share); }
.state-grid .warn { font-weight: 600; }
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.5rem;
    margin: 0;
}
.kpis > div {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
}
.kpis dt { font-size: 0.78rem; color: var(--ink-soft); }
.kpis dd { margin: 0.15rem 0 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.dash-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.dash-table th, .dash-table td {
    text-align: left;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--line);
    vertical-align: baseline;
}
.dash-table th { font-weight: 600; color: var(--ink-soft); font-size: 0.8rem; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-table th a.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.dash-table th a.sort-link:hover { color: var(--accent); text-decoration: underline; }
/* Konten (2.12.2026): narrow two-line count headers, addresses never break inside a line */
.dash-table th.count { width: 1%; }
.dash-table .email-line { white-space: nowrap; }
/* Registration funnel (Werbung → Kampagnen, 10.11.2026): one series, one colour, thin
   bars with rounded ends on a rail; the numbers stay in the table. */
.funnel-table td:first-child { white-space: nowrap; }
.funnel-bar-cell { width: 45%; min-width: 8rem; }
.funnel-track { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--bar-rail); }
.funnel-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.funnel-done td { font-weight: 600; }
/* Visitors without an account (Nutzung → Besucher, 11.11.2026) */
.visitor-table .funnel-bar-cell { width: 35%; min-width: 6rem; }
.visitor-table td:first-child { white-space: normal; }
.visitor-page { text-decoration: none; }
.visitor-page:hover { text-decoration: underline; }
.visitor-path { font-size: 0.75rem; word-break: break-all; }
.visitor-more { margin-top: 0.5rem; }
.visitor-more summary { cursor: pointer; color: var(--ink-soft); font-size: 0.85rem; }
.dash-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .dash-columns { grid-template-columns: 1fr; } }
.warn { color: #a33; }
.inline-check { display: inline-flex; gap: 0.3rem; align-items: center; }
.day-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 6rem;
    border-bottom: 1px solid var(--line);
}
.day-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.day-bar-fill { display: block; width: 100%; background: var(--bar-reached); border-radius: 2px 2px 0 0; min-height: 0; }
.day-bars-axis { display: flex; justify-content: space-between; font-size: 0.75rem; margin-top: 0.2rem; }
.todo-list { padding-left: 1.2rem; margin: 0 0 1rem; }
.todo-list li { margin: 0.25rem 0; }
.cov-cell { width: 35%; }
.cov-bar { display: block; height: 0.5rem; background: var(--bar-rail); border-radius: 3px; overflow: hidden; }
.cov-bar > span { display: block; height: 100%; background: var(--bar-reached); }

/* --- Tagesziele --- */
.target-rows { display: flex; flex-direction: column; }
.target-row { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; align-items: center; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.target-row:first-child { border-top: 0; }
.target-name { font-size: 0.9rem; font-weight: 600; }
.target-name small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--ink-soft); }
.target-input { display: flex; align-items: center; gap: 0.3rem; }
.target-input input { width: 6.5rem; text-align: right; min-height: 36px; padding: 0.3rem 0.5rem; }
.target-input .unit { width: 2.2rem; color: var(--ink-soft); font-size: 0.85rem; }
.target-row.is-manual input { border-color: var(--accent); background: var(--accent-soft); }
.target-row .form-errors { grid-column: 1 / -1; margin: 0; }
.reset-spacer { display: inline-block; width: 34px; }
.own-value { color: var(--accent-strong); font-weight: 600; }
.used-mark { display: inline-block; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.68rem; font-weight: 600; vertical-align: 1px; }
.own-value .estimate-mark-inline { color: var(--accent); }
.sticky-actions { position: sticky; bottom: env(safe-area-inset-bottom); display: flex; align-items: center; gap: 0.75rem; margin: 0 -1rem; padding: 0.6rem 1rem; z-index: 5; background: rgba(244, 246, 244, 0.95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.sticky-actions { flex-wrap: wrap; }
@media (max-width: 759px) {
    /* Recipe and meal edit pages while typing a search (edit_rows.js): the
       field sits below the header, the keyboard below the hits. */
    body.search-focused .sticky-actions { display: none; }
    body.search-focused #ingredient-results, body.search-focused #template-results { min-height: 75vh; }
}
.sticky-actions .ai-submit { order: -1; }
.leave-dialog h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.leave-dialog p { margin: 0 0 1rem; }
.leave-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.new-mark { background: var(--accent-soft); color: var(--accent-strong); }
.sticky-actions .btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.own-tier { margin: 0.9rem 0 0.3rem; font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.own-ai-hint { margin-top: 0.5rem; }
.target-input input::placeholder { color: var(--ink-faint); font-style: italic; }
@media (min-width: 760px) { .sticky-actions { bottom: 0; margin: 0; border-radius: var(--radius) var(--radius) 0 0; } }
.message-warning a { color: inherit; }

/* --- Anmelden, Registrieren, Einwilligung --- */
main.auth { max-width: 30rem; padding-top: 2rem; }
.auth-card { padding: 1.5rem 1.25rem; }
.auth-card h1 { text-align: center; margin-bottom: 0.25rem; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 0.75rem; }
.auth-brand .site-logo { width: 44px; height: 44px; border-radius: 12px; }
.auth-brand-named { align-items: center; gap: 0.6rem; }
.auth-brand-name { font-size: 1.5rem; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.auth-sub { text-align: center; margin: 0 0 1.25rem; }
.auth-card .stacked-form input:not([type=checkbox]), .auth-card .pw-wrap { width: 100%; max-width: none; }
.auth-switch { text-align: center; margin: 1rem 0 0; font-size: 0.875rem; color: var(--ink-soft); }
.consent-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; margin: 0.75rem 0; font-size: 0.85rem; max-height: 16rem; overflow-y: auto; }
.consent-check, .stacked-form label.consent-check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.75rem 0; font-size: 0.9rem; font-weight: 400; }
.consent-check input { margin-top: 0.2rem; flex: none; }
/* "Mit Google anmelden" (accounts.google, 10.11.2026): Google's light button
   (white, grey outline, dark text, the four-colour G), no Google script. */
a.google-btn, button.google-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%;
    min-height: 2.75rem; padding: 0.6rem 1rem; border: 1px solid #747775; border-radius: var(--radius-sm);
    background: #fff; color: #1f1f1f; font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer;
}
a.google-btn:hover, button.google-btn:hover { background: #f6f8f7; color: #1f1f1f; }
.google-btn .google-g, .login-methods .google-g { flex: none; vertical-align: -3px; }
.auth-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0 0.4rem; font-size: 0.8rem; color: var(--ink-soft); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-methods { margin-top: 1.5rem; }
.login-methods button.google-btn { width: auto; }

/* --- Willkommen: Profil einrichten (30.10.2026, accounts/onboarding.html) ---
   One question per step (onboarding.js), large option cards, a quiet page
   without the main navigation. */
body.onboarding-page .site-nav, body.onboarding-page .tabbar { display: none; }
.onboarding-card h1 { font-size: 1.35rem; }
.onboarding-card .auth-sub { margin-bottom: 1.1rem; }
.ob-progress { margin: 0 0 1.1rem; }
.ob-progress-track { height: 6px; border-radius: 999px; background: var(--bar-rail); overflow: hidden; }
.ob-progress-bar { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.3s ease; }
.ob-count { margin: 0.45rem 0 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-faint); }
.ob-step { border: 0; padding: 0; margin: 0 0 1.4rem; min-width: 0; }
.onboarding.is-wizard .ob-step { margin-bottom: 1.1rem; }
.ob-question { display: block; padding: 0; margin: 0 0 0.3rem; font-size: 1.12rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.ob-question:focus { outline: none; }
.ob-question label { font: inherit; color: inherit; margin: 0; }
.ob-hint { margin: 0 0 0.9rem; font-size: 0.875rem; color: var(--ink-soft); }
.ob-options { display: grid; gap: 0.5rem; }
.ob-options-2 { grid-template-columns: 1fr 1fr; }
.ob-option { display: block; position: relative; margin: 0; cursor: pointer; }
.ob-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ob-option-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 2.6rem 0.75rem 0.95rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
/* The choice mark on the right: an empty ring, a filled check when chosen. */
.ob-option-body::after {
    content: "";
    position: absolute;
    right: 0.85rem;
    top: 50%;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: -0.575rem;
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface) no-repeat center / 0.7rem;
    box-sizing: border-box;
}
.ob-option:hover .ob-option-body { border-color: var(--accent); }
.ob-option input:checked + .ob-option-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ob-option input:checked + .ob-option-body::after {
    border-color: var(--accent);
    background-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5.2 4.5 8 10.5 1.8'/%3E%3C/svg%3E");
}
.ob-option input:focus-visible + .ob-option-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.ob-option-title { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.ob-option-text { font-size: 0.8rem; color: var(--ink-soft); }
.ob-input input {
    width: 100%;
    min-height: 52px;
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ob-input input::placeholder { font-size: 1.05rem; font-weight: 400; color: var(--ink-faint); }
.ob-error { margin: 0.55rem 0 0; font-size: 0.85rem; color: var(--danger); }
.ob-nav { display: flex; gap: 0.5rem; margin-top: 0.4rem; }
.ob-nav .btn { flex: 1; justify-content: center; min-height: 46px; font-size: 1rem; }
.ob-nav [data-ob-back] { flex: 0 0 auto; padding: 0 1.1rem; }
.ob-later { margin-top: 0.6rem; text-align: center; }
.provisional-note a { font-weight: 600; }
.ob-privacy { display: flex; align-items: flex-start; gap: 0.5rem; margin: 1.2rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }
.ob-privacy .icon { flex: none; width: 16px; height: 16px; margin-top: 0.1rem; color: var(--ink-faint); }
.is-wizard .ob-nojs-note { display: none; }
.onboarding-card.ob-later .auth-brand, .onboarding-card.ob-later .auth-sub { display: none; }
.onboarding-card.ob-later h1 { margin-bottom: 1rem; }
.ob-enter { animation: ob-in 0.22s ease-out; }
@keyframes ob-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .ob-enter { animation: none; }
    .ob-progress-bar { transition: none; }
}

/* --- Registrierung --- */
.hp-field, .default-submit { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup-form small { display: block; margin-top: 0.2rem; }
/* The last step of the registration (10.11.2026): checkboxes, Google, e-mail. */
.ob-account { position: relative; }
/* The registration page (16.11.2026): the benefit above the heading, the legal sentence below the buttons */
.signup-benefit { display: flex; width: fit-content; align-items: center; gap: 0.5rem; margin: 0 auto 0.8rem; padding: 0.35rem 0.85rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.85rem; font-weight: 600; line-height: 1.3; }
.signup-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 4px rgba(47, 191, 113, 0.18); }
.signup-card h1 { text-align: center; }
.ob-account .stacked-form small.password-hint { color: var(--accent-strong); font-weight: 600; }
.ob-account .stacked-form small.password-hint[hidden] { display: none; }
.signup-legal { margin: 0.9rem 0 0; font-size: 0.8rem; color: var(--ink-soft); text-align: center; }
.ob-account .consent-check { margin: 0.6rem 0; }
.ob-account .google-btn { margin-top: 1rem; }
.ob-account .stacked-form { margin-top: 0.4rem; }
.ob-account .stacked-form small { display: block; margin-top: 0.2rem; }
.ob-account .stacked-form input:not([type=checkbox]), .ob-account .pw-wrap { width: 100%; max-width: none; }
.ob-account-submit { min-height: 46px; }
.ob-account .btn-block { margin-top: 0.4rem; }

/* --- Passwortfelder: anzeigen/verbergen, Übereinstimmung --- */
.pw-wrap { position: relative; display: inline-block; width: 100%; max-width: 26rem; }
.pw-wrap input { padding-right: 2.6rem; }
.pw-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    color: var(--ink-soft);
    cursor: pointer;
    line-height: 0;
    border-radius: 4px;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--accent); }
.pw-toggle[aria-pressed="true"] { color: var(--accent); }
.pw-match { display: block; font-size: 0.85rem; margin-top: 0.25rem; min-height: 1.1em; }
.pw-match.ok { color: var(--accent); }
.pw-match.bad { color: #a33; }

/* ---------- Own foods (foods.own_foods) ---------- */
.own-mark { background: #eef0f8; color: #3d4f7c; }
.ki-mark, .used-mark.ki-mark, .badge.ki-mark, .hit-used .ki-mark { background: var(--ki-tint); border-color: transparent; color: var(--ki-ink); font-weight: 600; }

/* "+KI" in a meal's head: a small "KI" in the plus's lower right quarter, without touching it and sticking out a little. */
.btn-icon.ai-add { position: relative; overflow: visible; }
.ai-add-tag { position: absolute; right: 5px; bottom: 5px; color: var(--ki-ink); font-size: 0.56rem; font-weight: 700; line-height: 1.05; letter-spacing: 0.01em; }
#day-content { display: contents; }
/* While an estimate runs: a bar running to and fro where the values will stand
   (diary rows, value cells, the line above a page's values; foods.waiting). */
.ai-wait { display: inline-block; height: 6px; border-radius: 999px; background: var(--ki-tint); overflow: hidden; vertical-align: middle; }
.entry-vals.ai-wait { display: block; flex: none; width: 4.2rem; }
.ai-wait-cell { width: 3.2rem; }
/* beside "KI denkt …" in a diary line: visible also when the line's own values are all there (7.11.2026) */
.ai-wait-note { width: 2.6rem; }
.estimate-wait { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.9rem; color: var(--ink-soft); font-size: 0.9rem; }
.estimate-wait .ai-wait { flex: none; width: 4.5rem; }
.ai-wait-bar { display: block; width: 40%; height: 100%; border-radius: 999px; background: var(--ki-ink); opacity: 0.75; animation: ai-wait 1.3s ease-in-out infinite alternate; }
@keyframes ai-wait { from { transform: translateX(-20%); } to { transform: translateX(170%); } }
@media (min-width: 760px) { .entry-vals.ai-wait { width: 20.8rem; } }
@media (prefers-reduced-motion: reduce) { .ai-wait-bar { width: 100%; animation: none; opacity: 0.35; } }
.estimating-late { margin: 0 0 0.75rem; }
.ai-note { color: var(--ink-faint); font-size: 0.78rem; font-style: italic; white-space: nowrap; }
.ai-description { margin: 0 0 0.75rem; font-size: 0.9rem; overflow-wrap: anywhere; }
.ai-description-card p { margin: 0; overflow-wrap: anywhere; }
.ai-meal-form textarea, .ai-meal-form input[type=text] { width: 100%; }
.ai-meal-form textarea { min-height: 7rem; }
.ai-meal-hint { display: block; margin: 0 0 0.6rem; color: var(--ink-soft); font-size: 0.85rem; font-weight: 400; }
.ai-meal-keep { margin: 0.75rem 0; }
/* "Pro 100 g berechnen" (10.11.2026): the grams eaten, only with that choice */
.ai-meal-per { margin: 0.75rem 0 0; }
.ai-meal-per .choice { display: flex; align-items: flex-start; gap: 0.45rem; padding: 0.25rem 0; }
.ai-meal-grams { display: none; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0 1.6rem; }
.ai-meal-per:has(input[value="100g"]:checked) .ai-meal-grams { display: flex; }
.ai-meal-form .ai-meal-grams input { width: 6rem; flex: 0 0 6rem; }
.ai-meal-keep .choice { display: flex; align-items: flex-start; gap: 0.45rem; padding: 0.25rem 0; }
.ai-meal-form .btn-block { margin-top: 0.85rem; }
.ai-meal-form .hint { margin: 0.6rem 0 0; }
.ai-meal-table .ai-meal-words { min-width: 16rem; max-width: 34rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.create-own { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.5rem 0 0.75rem; }
.search-extras { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; margin: 0; }
.search-extras .text-link { text-decoration: underline; text-underline-offset: 3px; }
.search-row:has(.search-input:not(:placeholder-shown)) ~ .search-extras { display: none; }
.create-own .link-button .icon { width: 14px; height: 14px; vertical-align: -2px; }
.own-form .card { margin-bottom: 0.6rem; padding: 0.7rem 1rem; }
/* Own food or dietary supplement (form field "art"): parts shown for one kind only. */
.own-form:has(input[name=art][value=nem]:checked) .food-only { display: none; }
.own-form:not(:has(input[name=art][value=nem]:checked)) .supplement-only { display: none; }
.own-form .stacked-form { padding-bottom: 0.2rem; }
/* Compact own-food form: tight fields, radio choices side by side. */
.own-form .stacked-form p { margin-bottom: 0.5rem; }
.own-form .choice-group { margin-bottom: 0.5rem; }
.own-form .choice-group label.choice { display: inline-flex; margin-right: 1rem; padding: 0.1rem 0; }
.own-form .card > p:has(textarea) { margin: 0; }
.own-form .hint { margin: 0.25rem 0 0.4rem; font-size: 0.8rem; }
.own-form .own-tier { margin: 0.6rem 0 0.15rem; }
.own-form .target-row { padding: 0.15rem 0; }
.own-form .target-input input { min-height: 30px; padding: 0.15rem 0.45rem; }
.own-form .target-row.is-estimated input { font-style: italic; color: var(--ink-soft); }
.estimated-sample { font-style: italic; }
.own-correct-more summary { font-size: 0.8rem; padding: 0; }
.own-correct-more .hint { margin-top: 0.3rem; }
.choice-group { border: 0; padding: 0; margin: 0 0 0.85rem; min-width: 0; }
.choice-group .field-label { padding: 0; }
.choice, .stacked-form label.choice { display: flex; align-items: center; gap: 0.45rem; padding: 0.25rem 0; font-size: 0.92rem; font-weight: 400; color: var(--ink); cursor: pointer; }
.choice input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); flex: none; }
.own-extra > .target-rows { padding: 0 1rem 0.5rem; }
.similar-card .hits { margin: 0; }
.own-warning p { margin: 0 0 0.5rem; }
.own-warning .btn { margin-top: 0.15rem; }
.danger-zone { margin: 1rem 0 2rem; }
.danger-zone form { margin-top: 0.5rem; }

/* ---------- Meal plan (diary.meal_plan) ---------- */
.meal-plan-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: -0.25rem 0 1rem; }
.meal-plan-links .link-button .icon { width: 14px; height: 14px; vertical-align: -2px; }
.meal-empty-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.meal-title .badge { font-size: 0.7rem; }
.meal-plan-row .btn-icon[disabled] { opacity: 0.3; cursor: default; }

/* ---------- Edit an entry: dialog (diary.js), bottom sheet on phones ---------- */
.entry-link { color: inherit; text-decoration: none; }
/* Hover (devices with a mouse): the whole entry row opens the edit dialog
   (diary.js), so the whole row is highlighted -- dark green text on light green.
   The box-shadow widens the background beyond the text without moving it. */
@media (hover: hover) {
    .entries li:has(.entry-link) { cursor: pointer; border-radius: 6px; }
    .entries li:has(.entry-link):hover { background: var(--accent-soft); box-shadow: -0.5rem 0 0 var(--accent-soft), 0.5rem 0 0 var(--accent-soft); }
    .entries li:has(.entry-link):hover .entry-link,
    .entries li:has(.entry-link):hover .entry-vals .val { color: var(--accent-strong); }
    .entries li:has(.entry-link):hover .brand,
    .entries li:has(.entry-link):hover .entry-amount { color: var(--accent); }
    /* Expandable value rows (day values, report, recipe and meal pages): light
       background on hover. */
    .nb > summary, .rn > summary { border-radius: 6px; }
    .nb > summary:hover, .rn > summary:hover { background: var(--accent-soft); }
}
dialog.sheet { width: min(28rem, calc(100vw - 2rem)); max-height: 85vh; padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(16, 24, 20, 0.25); overflow: auto; }
dialog.sheet::backdrop { background: rgba(16, 24, 20, 0.45); }
.sheet-body, .sheet-page { padding: 1rem 1.1rem 1.25rem; }
.sheet-head { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.4rem; }
.sheet-head h2 { flex: 1; margin: 0.15rem 0 0; font-size: 1.15rem; line-height: 1.3; }
.sheet-close { font-size: 1.5rem; line-height: 1; }
/* "Zum Lebensmittel" beside the name in an entry's dialog (9.11.2026) */
.sheet-open { display: inline-flex; align-items: center; justify-content: center; gap: 0.1rem; height: 1.6rem; margin-left: 0.25rem; padding: 0 0.3rem 0 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--accent); font-size: 0.8rem; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; vertical-align: 0.1em; }
.sheet-open:hover { background: var(--accent-soft); border-color: var(--accent); }
.sheet-open .icon { width: 1rem; height: 1rem; }
.entry-edit-form { margin-top: 0.75rem; }
.entry-edit-form select { width: 100%; margin-bottom: 0.9rem; }
.entry-edit-form .amount-input { margin-bottom: 0.9rem; }
.entry-values { margin: 1rem 0 0; border-top: 1px solid var(--line); }
.entry-values > summary { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0; font-weight: 600; cursor: pointer; list-style: none; }
.entry-values > summary::-webkit-details-marker { display: none; }
.entry-values[open] > summary .icon { transform: rotate(180deg); }
.entry-values h3 { margin: 0.6rem 0 0.2rem; font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.entry-values .nutrients .origin-detail { display: none; }
@media (min-width: 600px) {
    /* Smaller type in the dialog on a PC. */
    dialog.sheet { font-size: 0.875rem; }
    dialog.sheet .sheet-head h2 { font-size: 1rem; }
    dialog.sheet .field-label { font-size: 0.75rem; }
    dialog.sheet .amount-input input { font-size: 1.15rem; min-height: 42px; }
    dialog.sheet .amount-input .unit { font-size: 0.85rem; }
    dialog.sheet select { font-size: 0.875rem; min-height: 36px; padding-top: 0.3rem; padding-bottom: 0.3rem; }
    dialog.sheet .btn { font-size: 0.875rem; min-height: 38px; }
    dialog.sheet .badge { font-size: 0.7rem; }
    dialog.sheet .entry-values > summary { font-size: 0.875rem; padding: 0.55rem 0; }
    dialog.sheet .entry-values h3 { font-size: 0.68rem; }
    dialog.sheet .nutrients th, dialog.sheet .nutrients td { font-size: 0.8rem; padding: 0.25rem 0.4rem; }
    dialog.sheet .hint { font-size: 0.78rem; }
}
@media (max-width: 599px) {
    dialog.sheet { width: 100%; max-width: 100%; max-height: 90vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
    .sheet-body { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
}

/* ---------- Adding to the diary: compact amount page with nutrients ---------- */
.add-entry .item-head { margin-bottom: 0.5rem; }
.add-entry .item-head h1 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.add-entry .amount-card { padding: 0.65rem 0.85rem 0.8rem; font-size: 0.9rem; }
.add-entry .field-label { font-size: 0.75rem; margin: 0.1rem 0 0.2rem; }
.add-entry .amount-input input { font-size: 1.2rem; min-height: 42px; }
.add-entry .amount-input .unit { font-size: 0.85rem; }
.add-entry .quick-amounts { margin: 0.35rem 0 0.55rem; gap: 0.3rem; }
.add-entry .chip { padding: 0.15rem 0.6rem; font-size: 0.8rem; }
.add-entry .amount-card select { min-height: 36px; font-size: 0.875rem; padding-top: 0.3rem; padding-bottom: 0.3rem; margin-bottom: 0.6rem; }
.add-entry .amount-card .btn { min-height: 38px; font-size: 0.875rem; }
.add-entry .variants { margin-top: 0.9rem; }
.add-entry .variants h2 { font-size: 0.875rem; margin: 0 0 0.1rem; }
.add-entry .variants .muted { font-size: 0.78rem; margin: 0 0 0.3rem; }
.add-entry .hits a { padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.add-entry .hits .hit-values { font-size: 0.75rem; }
.add-values-title { font-size: 0.95rem; margin: 1.1rem 0 0.4rem; }
.add-entry .nutrient-card { padding-top: 0.5rem; padding-bottom: 0.4rem; margin-bottom: 0.6rem; }
.add-entry .nutrient-card h2 { font-size: 0.8rem; margin: 0 0 0.2rem; }
.add-entry .nutrients th, .add-entry .nutrients td { font-size: 0.8rem; padding: 0.22rem 0.4rem; }
.add-entry .source, .add-entry .hint { font-size: 0.75rem; }
/* More variants behind a small "v" below the first four. */
.more-variants > summary { display: flex; justify-content: center; align-items: center; gap: 0.25rem; padding: 0.2rem; color: var(--ink-soft); font-size: 0.78rem; cursor: pointer; list-style: none; }
.more-variants > summary::-webkit-details-marker { display: none; }
.more-variants > summary:hover { color: var(--accent); }
.more-variants > summary .icon { width: 18px; height: 18px; }
.more-variants[open] > summary .icon { transform: rotate(180deg); }

/* ---------- Barcode scan with the camera (scanner.js) ---------- */
.search-row { display: flex; align-items: center; gap: 0.5rem; }
.search-row .search-input { flex: 1; min-width: 0; }
.scan-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
}
.scan-button:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
/* Food search and diary add page (4.11.2026): "Scannen" beside the icon; on phones, while the
   field has text, the plain round button again for more room to type. Below
   the row the "sucht …" indicator on the left, the create link on the right. */
.scan-button.scan-named { width: auto; gap: 0.45rem; padding: 0 0.8rem 0 1rem; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--accent); }
@media (max-width: 759px) {
    .search-row:has(.search-input:not(:placeholder-shown)) .scan-button.scan-named { width: 44px; padding: 0; color: var(--ink-soft); }
    .search-row:has(.search-input:not(:placeholder-shown)) .scan-label { display: none; }
}
.search-under { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.4rem 0 0.5rem; }
.new-food-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.new-food-link .icon { width: 14px; height: 14px; }
.barcode-row { display: flex; max-width: 26rem; }
.barcode-row input { flex: 1; min-width: 0; }
.barcode-row .scan-button { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.scan-view { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: #111; aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 30%;
    bottom: 30%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}
.scan-status { min-height: 1.4em; margin: 0.6rem 0 0.4rem; font-size: 0.9rem; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.scan-photo { position: relative; overflow: hidden; }
.scan-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scan-photo .icon { width: 16px; height: 16px; }
.scan-torch[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.scan-note { font-size: 0.75rem; margin-bottom: 0; }
/* "Woher kommt es?": entries without a bar (0, or without a value). */
.nb-contrib-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--ink-soft); }
/* Contradictory/incomplete product data (foods/_product_warning.html). */
.product-warning p { margin: 0 0 0.4rem; }
.product-warning .hits { margin: 0.3rem 0 0; }
.product-warning .hits a { color: var(--ink); }
/* Search hits: popular products, and the DACH score for admins. */
.popular-mark { background: #fbf1df; color: #8a5a10; }
.admin-score { margin-left: 0.3rem; color: var(--ink-faint); font-size: 0.7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Open Food Facts dietary supplements: shown to admins only, marked loudly (31.10.2026) */
.nem-mark {
    display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle;
}
.nem-note {
    margin: 0.5rem 0 0; padding: 0.55rem 0.75rem; border-radius: 8px;
    background: var(--danger-soft); color: var(--danger); font-size: 0.88rem;
}
.supplement-mark-inline { background: var(--accent-soft); color: var(--accent-strong); }

/* Admin pages of the estimation cascade (dashboard/estimates, ingredients, flags) */
.batch-form, .filter-form { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0.5rem 0 0.75rem; }
.batch-form input[type="number"] { width: 7rem; }
.coverage-table .bar-cell { width: 40%; }
.share-bar { display: block; height: 0.6rem; border-radius: 3px; background: var(--bar-share); }
.row-actions { white-space: nowrap; }
.row-actions .link-button { margin-right: 0.5rem; }
.dash-table tr.status-rejected td { color: var(--ink-faint); }
/* Produktversionen (2.11.2026) */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.bulk-bar label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; }
.versions-table td { vertical-align: top; }
.badge-warn { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.version-detail { margin-top: 0.3rem; font-size: 0.82rem; }
.version-detail > summary { cursor: pointer; color: var(--accent); }
.mini-table { border-collapse: collapse; margin: 0.4rem 0; }
.mini-table th, .mini-table td { padding: 0.15rem 0.6rem 0.15rem 0; text-align: left; font-size: 0.8rem; }
.mini-table th { color: var(--ink-soft); font-weight: 600; }
.ingredient-diff { display: grid; gap: 0.6rem; grid-template-columns: 1fr 1fr; margin-top: 0.4rem; }
.ingredient-diff p { margin: 0.15rem 0 0; font-size: 0.78rem; }
.decide-form { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.note-input { width: 9rem; font-size: 0.8rem; padding: 0.15rem 0.3rem; min-height: 0; }
.ingredients-card h2 { font-size: 0.9rem; margin: 0.1rem 0 0.35rem; color: var(--ink-soft); }
.ingredients-card p { margin: 0 0 0.3rem; font-size: 0.9rem; }
#own-ingredients { width: 100%; }

/* --- Tagebuch: Bearbeiten-Modus je Mahlzeit (31.10.2026) ---
   The pencil shows a box in front of every entry and a bar with "Alle" and the
   actions; on phones the bar wraps and every row is a tap target. */
.meal-edit[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.select-bar { display: none; }
.meal.is-selecting .select-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin: 0.15rem 0.75rem 0.4rem -0.5rem;
    padding: 0.45rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
}
.select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.select-all input, .entry-check { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; }
.select-count { margin-right: auto; font-size: 0.8rem; color: var(--ink-soft); }
.select-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; flex-basis: 100%; }
.select-actions .btn { flex: 1 1 auto; min-height: 40px; padding: 0.3rem 0.7rem; }
.select-actions .btn .icon { width: 17px; height: 17px; }
/* Narrow phones: the four buttons still fit on two rows. */
@media (max-width: 374px) {
    .select-actions .btn { padding: 0.3rem 0.4rem; gap: 0.25rem; font-size: 0.85rem; }
}
.select-actions .btn.is-open { color: var(--accent-strong); background: var(--surface); border-color: var(--accent); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid var(--line-strong); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.select-actions .btn:disabled,
.select-actions .btn:disabled:hover,
.share-options .btn:disabled,
.share-options .btn:disabled:hover {
    opacity: 0.45;
    cursor: default;
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--line-strong);
}
.select-save { flex-basis: 100%; min-width: 0; }  /* the input's own width must not widen the bar */
.select-save .field-label { font-size: 0.8rem; margin-bottom: 0.25rem; }
.select-save .menu-inline input { min-height: 40px; font-size: 1rem; }  /* >= 16px: no zoom on iOS */
.select-save .menu-inline .btn { flex: none; min-height: 40px; }
.select-share { flex-basis: 100%; min-width: 0; }
.select-share .field-label { font-size: 0.8rem; margin-bottom: 0.25rem; }
.select-share .share-name { width: 100%; min-height: 40px; font-size: 1rem; margin-bottom: 0.5rem; }
.share-recipe-amounts { display: grid; gap: 0.5rem; margin: 0 0 0.6rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); background: var(--surface); }
.share-recipe-amount { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; font-size: 0.9rem; }
.share-recipe-title { font-weight: 600; flex-basis: 100%; }
.share-recipe-amount label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 32px; cursor: pointer; }
.share-recipe-amount input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }
.share-options { display: grid; gap: 0.4rem; }
.share-options .btn { flex: none; justify-content: flex-start; text-align: left; min-height: 40px; }
.select-share .hint { margin: 0.5rem 0 0; }
.share-cancel { margin-top: 0.35rem; }
.share-link { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.75rem 0; }
.share-link input { flex: 1 1 12rem; min-width: 0; min-height: 40px; padding: 0.3rem 0.5rem; font-size: 0.85rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.share-link .btn, .share-link .inline-form { flex: none; }
.share-actions { margin: 0 0 0.75rem; }
.share-rows .share-row { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.share-rows .share-note { font-size: 0.78rem; }
.share-rows .is-skipped > .entry-name, .share-sub .is-skipped { text-decoration: line-through; color: var(--ink-faint); }
.share-sub { margin: 0.2rem 0 0.2rem 0.9rem; padding: 0; list-style: disc; font-size: 0.85rem; color: var(--ink-soft); }
.share-sub li { padding: 0.1rem 0; }
.share-values { margin-top: 0.75rem; }
.share-kinds { border: 0; padding: 0; margin: 0 0 0.75rem; }
.share-kind { display: flex; align-items: center; gap: 0.5rem; min-height: 36px; cursor: pointer; }
.share-kind input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); }
.share-list .share-item { padding: 0.75rem 0.9rem; }
.share-list .share-item + .share-item { border-top: 1px solid var(--line); }
.share-list .share-item.is-new { background: var(--accent-soft); }
.share-list .share-item.is-revoked { color: var(--ink-soft); }
.share-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.share-head .muted { font-size: 0.8rem; }
.entry-check { display: none; accent-color: var(--accent); cursor: pointer; }
.meal.is-selecting .entry-check { display: block; }
.meal.is-selecting .entries li { min-height: 42px; cursor: pointer; }
.meal.is-selecting .entries li.is-ticked {
    background: var(--accent-soft);
    box-shadow: -0.5rem 0 0 var(--accent-soft), 0.25rem 0 0 var(--accent-soft);  /* card padding */
}
@media (min-width: 760px) {
    .select-actions { flex-basis: auto; }
    .select-actions .btn { flex: none; min-height: 34px; }
    .meal.is-selecting .entries li { min-height: 32px; }
}

/* --- An admin uses another account (accounts.impersonation) --- */
.impersonation-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem 0.8rem; margin: 0; padding: 0.45rem 16px; background: var(--danger-soft); color: var(--danger); font-size: 0.875rem; text-align: center; }
.impersonation-bar strong { word-break: break-all; }

/* --- Recipe and meal edit pages: saved at once (decision of 8.11.2026, edit_rows.js) --- */
.save-bar { justify-content: space-between; }
.save-status { flex: 1 1 12rem; font-size: 0.875rem; color: var(--ink-soft); }
.save-status.is-busy { color: var(--ink-faint); }
.save-status.is-ok::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.save-status.is-error { color: var(--danger); }
.ingredient-amount-form input::placeholder { color: var(--ink); opacity: 0.55; }
input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.undo-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 4.5rem); z-index: 30; transform: translateX(-50%); display: flex; align-items: center; gap: 0.6rem; max-width: calc(100% - 32px); padding: 0.6rem 1rem; border-radius: 999px; background: #1c2421; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-size: 0.9rem; }
.undo-toast .link-button { color: #9fe0bb; font-weight: 700; }
/* The AI's assumption after a simple estimate (static/js/ai_assessment.js). */
.ai-assessment-dialog h2 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.ai-assessment-item + .ai-assessment-item { border-top: 1px solid var(--line); padding-top: 0.6rem; }
.ai-assessment-name { font-weight: 600; margin-bottom: 0.3rem; }
.ai-assessment-dialog .action-row { justify-content: flex-end; margin-top: 0.8rem; }
/* "Support/Kontakt" (9.11.2026) */
.contact-form textarea, .contact-form input[type=email] { width: 100%; max-width: 36rem; }
.contact-form .btn { margin-top: 0.5rem; }

/* --- Lebensmittel- und Produktseiten für Gäste (11.11.2026): was die Website kann,
   ein Knopf; im Stil des Facebook-Titelbilds (mint/blau, Glas-Chips, Handy). --- */
.guest-promo {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: center;
    margin: 0 0 1.5rem; padding: 1.25rem 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius);
    background:
        radial-gradient(ellipse 60% 80% at 0% 0%, rgba(127, 214, 164, 0.45), transparent 70%),
        radial-gradient(ellipse 55% 70% at 100% 20%, rgba(191, 224, 255, 0.6), transparent 70%),
        radial-gradient(ellipse 50% 60% at 60% 100%, rgba(255, 217, 179, 0.45), transparent 70%),
        var(--surface);
}
.guest-promo-brand { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-weight: 700; color: var(--accent); }
.guest-promo-brand .site-logo { width: 26px; height: 26px; }
.guest-promo-title { margin: 0; font-size: clamp(1.4rem, 4.5vw, 2rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.guest-promo-word { display: inline-block; background: linear-gradient(100deg, #2f6f4f 0%, #1f8f7a 45%, #3fb87e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease; }
.guest-promo-word.is-out { opacity: 0; transform: translateY(0.35em); filter: blur(6px); }
.guest-promo-lead { margin: 0.7rem 0 0; max-width: 40rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }
.guest-promo-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0 1.1rem; padding: 0; list-style: none; }
.guest-promo-chips li {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 6px 16px rgba(5, 15, 10, 0.08); font-size: 0.82rem; font-weight: 600; color: var(--ink);
}
.guest-promo-chips .icon { width: 16px; height: 16px; color: var(--accent); }
.guest-promo-chips b { padding: 0.05rem 0.4rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); }
.guest-promo-button { min-height: 46px; padding-inline: 1.4rem; font-size: 1rem; }
.guest-promo-phone { display: none; }
@media (min-width: 760px) {
    .guest-promo { grid-template-columns: minmax(0, 1fr) 170px; padding: 1.6rem 1.75rem; margin-top: 0.75rem; }
    .guest-promo-phone {
        position: relative; display: block; align-self: start; width: 170px; height: 300px; overflow: hidden; padding: 6px;
        border-radius: 26px; background: #0d1512; transform: rotate(4deg); margin-top: 0.4rem;
        box-shadow: 0 0 0 1.5px #2a3732, 0 24px 40px -16px rgba(5, 15, 10, 0.45);
    }
    .guest-promo-phone { border-radius: 26px; }
    /* the diary from dinner (y 1420 of 780 px width) down to the nutrient bars */
    .guest-promo-phone img { display: block; width: 100%; height: auto; margin-top: -182%; background: #fff; }
    .guest-promo-phone::after { content: ""; position: absolute; inset: 6px; border-radius: 20px; box-shadow: 0 0 0 6px #0d1512; pointer-events: none; }
}

/* Comparison, related foods and topic pages (foods.topics, 11.11.2026) */
.food-compare { margin: 0.4rem 0 1rem; max-width: 46rem; color: var(--ink-soft); line-height: 1.6; }
.food-compare a { font-weight: 600; }
.related-foods { margin-top: 1rem; }
.related-foods h2 { font-size: 1rem; margin: 0.2rem 0 0.5rem; }
.related-foods h2 + .related-list { margin-bottom: 1rem; }
.related-list { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; margin: 0; padding: 0; list-style: none; }
.related-list a { display: inline-block; padding: 0.3rem 0.65rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.88rem; text-decoration: none; background: var(--surface); }
.related-list a:hover { border-color: var(--accent); }
.related-list a.related-all { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.related-list a.related-all:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
/* "pflanzlich" / "vegan laut Etikett" (foods.plant, 12.11.2026) */
.plant-mark, .badge.plant-badge { background: #e3f3e6; border-color: transparent; color: #1f6b3a; }
.plant-note { margin: 0.4rem 0 0; color: var(--ink-soft); font-size: 0.875rem; }
.topic-variant { margin: 0 0 0.75rem; font-size: 0.92rem; }
.topic-list { margin: 0; padding-left: 1.6rem; }
.topic-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.topic-list li:last-child { border-bottom: 0; }
/* name left, amount in its own column at the top right, also when the name wraps */
.topic-row { display: flex; align-items: baseline; gap: 0.75rem; }
.topic-row a { flex: 1; min-width: 0; }
.topic-amount { flex: none; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* "Werbung → Beiträge" (apps.outreach, 12.11.2026): leads with their draft, channels */
.outreach-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.outreach-tabs a {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.9rem;
}
.outreach-tabs a.current { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); font-weight: 600; }
/* five small figures: three in a row on a phone, the cards below are what counts */
.outreach-kpis { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.lead-list { list-style: none; margin: 1rem 0; padding: 0; }
.lead-card h3 { margin: 0.35rem 0; font-size: 1.02rem; }
.badge-plain { border-style: dashed; }
.admin-message { margin: 0.5rem 0; }
.admin-message summary { cursor: pointer; color: var(--accent-strong); font-size: 0.92rem; }
.admin-message textarea { display: block; width: 100%; max-width: 40rem; font: inherit; line-height: 1.45; }
.outreach-terms textarea { display: block; width: 100%; max-width: 24rem; margin-bottom: 0.6rem; }
.outreach-guide summary { cursor: pointer; font-weight: 600; }
.outreach-guide h3 { font-size: 0.95rem; margin: 0.9rem 0 0.3rem; }
.outreach-guide ol, .outreach-guide ul { margin: 0.2rem 0 0.4rem; padding-left: 1.3rem; }
.outreach-guide li { margin: 0.2rem 0; }
.outreach-guide code { background: var(--accent-soft); padding: 0.05rem 0.3rem; border-radius: 4px; white-space: nowrap; }
.lead-card.is-copied { border-color: var(--accent); }
.lead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.lead-summary { margin: 0.25rem 0 0.5rem; }
.lead-warning { margin: 0.35rem 0; padding: 0.35rem 0.6rem; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 0.875rem; }
.lead-note { display: flex; gap: 0.35rem; align-items: flex-start; margin: 0.3rem 0; color: var(--ink-soft); font-size: 0.875rem; }
.lead-note .icon { flex: none; width: 15px; height: 15px; margin-top: 0.15rem; }
.lead-card textarea { width: 100%; margin: 0.4rem 0 0.2rem; font: inherit; line-height: 1.45; }
/* Werbung → Links (2.12.2026) */
.backlink-sender { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin: 0.75rem 0; }
.backlink-sender input[type="text"] { width: 14rem; max-width: 100%; }
.backlink-contact { margin: 0.4rem 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.lead-card .backlink-subject { width: 100%; margin: 0.2rem 0 0.4rem; font: inherit; }
.backlink-footer { margin: 0 0 0.4rem; padding: 0.4rem 0.6rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); font: inherit; font-size: 0.85rem; white-space: pre-wrap; }
.backlink-link { min-width: 16rem; flex: 1 1 16rem; }
.backlink-notes { margin-top: 0.5rem; font-size: 0.875rem; }
.backlink-notes textarea { width: 100%; font: inherit; }
.lead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-top: 0.5rem; }


/* ---------- Besucher ohne Konto (accounts.guests, 22.11.2026) ---------- */
/* "Anmelden" and "Registrieren" in the header, on phones too (the tab bar holds the navigation) */
.site-visitor { display: flex; margin-left: auto; align-items: center; gap: 0.5rem; }
.site-visitor a:not(.btn) { padding: 0.4rem 0.5rem; color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.site-visitor a:not(.btn):hover, .site-visitor a.active { color: var(--accent); }
@media (max-width: 399px) {
    .site-header-inner:has(.site-visitor) .site-title { font-size: 0.85rem; gap: 0.3rem; }
    .site-visitor { gap: 0.15rem; }
    .site-visitor a:not(.btn) { padding-inline: 0.35rem; font-size: 0.85rem; }
}
@media (max-width: 339px) { .site-header-inner:has(.site-visitor) .site-title { font-size: 0; } }
@media (min-width: 760px) {
    .site-header-inner:has(.site-visitor) { display: grid; grid-template-columns: 1fr auto 1fr; }
    .site-header-inner:has(.site-visitor) > .site-title { justify-self: start; padding-right: 1.25rem; }
    .site-header-inner:has(.site-visitor) > .site-nav { grid-column: 2; }
    .site-header-inner:has(.site-visitor) > .site-visitor { grid-column: 3; justify-self: end; margin-left: 0; }
}
/* the first tap is a form (diary.views.start); its button looks like the link it replaces */
.start-form { display: inline-flex; margin: 0; }
.meal-empty-row .start-form { display: block; }
button.meal-empty { border: 0; background: none; font: inherit; font-size: 0.85rem; cursor: pointer; text-align: left; }
/* the yellow pointers: at the "+" of breakfast, then down to the day's values */
.coach {
    display: inline-block;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--coach);
    color: var(--coach-ink);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(16, 24, 20, 0.18);
}
.coach::before { content: ""; position: absolute; border: 8px solid transparent; }
.coach-anchor { position: relative; display: inline-flex; }
.coach-anchor .btn-icon.add { color: var(--coach-ink); background: var(--coach); }
.coach-up { position: absolute; z-index: 2; top: calc(100% + 10px); left: -0.6rem; width: max-content; max-width: min(22rem, 62vw); }
.coach-up::before { bottom: 100%; left: calc(0.6rem + 9px); border-bottom-color: var(--coach); }
.meal.has-coach .meal-empty-row { padding-top: 3.1rem; }
@media (max-width: 520px) { .meal.has-coach .meal-empty-row { padding-top: 4.5rem; } }
.coach-row { margin: 0.5rem 0 0.9rem; }
.coach-down { position: relative; }
.coach-down:hover { color: var(--coach-ink); }
.coach-down::before { top: 100%; left: 1.2rem; border-top-color: var(--coach); }
/* the question to register, and the line that stays after "Später" */
.guest-prompt .sheet-body { text-align: center; }
.guest-prompt h2 { margin: 0.4rem 0 1rem; font-size: 1.1rem; line-height: 1.35; }
.guest-prompt-later { margin: 0.6rem 0 0; }
.guest-bar { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--coach); color: var(--coach-ink); font-size: 0.9rem; font-weight: 500; }
.guest-bar a { color: var(--coach-ink); font-weight: 700; }
/* an account of the iPhone app without an e-mail address (accounts.app_accounts) */
.email-hint { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: baseline; justify-content: space-between; }
.email-hint-actions { display: inline-flex; gap: 1rem; align-items: baseline; }
.email-hint-actions form { margin: 0; }
.email-hint .link-button { color: var(--coach-ink); font-weight: 500; }
.app-start-points { margin: 0.75rem 0 1rem; padding-left: 1.2rem; }
.app-start-points li { margin-bottom: 0.5rem; }
.app-start-consent { margin: 0 0 0.75rem; font-weight: 600; }


/* ---------- In der iPhone-App (core.app_client, 22.11.2026) ---------- */
/* The native shell shows title, tabs and the links of the footer; the Open Food Facts notice stays. */
/* in the app help and legal pages are in the "⋮" menu of the top bar (22.11.2026) */
body.in-app .site-footer > a { display: none; }
body.in-app .site-footer { padding-top: 0.5rem; }

/* "Konto löschen" (accounts.views.delete_account, 22.11.2026) */
.stacked-form button.btn-danger[type=submit] { background: var(--danger); border-color: var(--danger); color: #fff; }
.stacked-form button.btn-danger[type=submit]:hover { background: #8f1e18; border-color: #8f1e18; }
.delete-account ul { margin: 0.25rem 0 0.75rem; padding-left: 1.2rem; }
.delete-link { margin: 1.5rem 0 4.5rem; text-align: center; }
.delete-link .link-button, .delete-link .link-button:hover { color: var(--danger); }

/* logging the iPhone app in to an existing account (accounts.app_login) */
.app-login { margin-bottom: 0.5rem; }
.app-login .hint { margin: 0.35rem 0 0.9rem; text-align: center; }
.app-qr ol { margin: 0 0 1rem; padding-left: 1.2rem; }
.app-qr-code { display: flex; justify-content: center; margin: 0.5rem 0 1rem; }
.app-qr-code svg { width: min(18rem, 100%); height: auto; background: #fff; border-radius: var(--radius-sm); }

/* What the app can do, under the empty day of a visitor (diary/_visitor_intro.html, 29.11.2026) */
.visitor-intro { display: grid; gap: 1.25rem; margin: 1.5rem 0 0.5rem; padding: 1.1rem 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 640px) { .visitor-intro { grid-template-columns: 1fr 13rem; align-items: start; } }
.visitor-intro h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.visitor-intro-lead { margin: 0 0 0.85rem; font-size: 0.93rem; line-height: 1.5; color: var(--ink); }
.visitor-intro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.visitor-intro-list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.45; color: var(--ink-soft); }
.visitor-intro-list strong { color: var(--ink); font-weight: 600; }
.visitor-intro-list .icon { flex: none; width: 18px; height: 18px; margin-top: 0.1rem; color: var(--accent); }
.visitor-intro-ki { flex: none; width: 18px; margin-top: 0.15rem; font-size: 0.62rem; font-weight: 700; line-height: 18px; text-align: center; border-radius: 4px; background: var(--ki-tint); color: var(--ki-ink); }
.visitor-intro-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.3rem; margin: 0.9rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-soft); }
.visitor-intro-foot .icon { flex: none; width: 14px; height: 14px; color: var(--accent); }
.visitor-intro-phone { margin: 0 auto; width: 100%; max-width: 13rem; padding: 0.45rem; background: #1c2421; border-radius: 1.6rem; box-shadow: 0 10px 30px rgba(16, 24, 20, 0.18); }
.visitor-intro-phone img { display: block; width: 100%; height: auto; border-radius: 1.2rem; }

/* The amount the shown nutrient values are for, while it is not the basis (30.11.2026) */
.values-for { padding: 0.05rem 0.35rem; border-radius: 4px; background: var(--coach); color: var(--coach-ink); font-weight: inherit; }
