/* 2nd Wave Auslagen: design base. Same tokens, font and background as the Hub and the Streamlit app. */

@font-face { font-family: "K2D"; src: url("/static/fonts/K2D-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "K2D"; src: url("/static/fonts/K2D-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "K2D"; src: url("/static/fonts/K2D-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Sacramento"; src: url("/static/fonts/Sacramento-Regular.ttf") format("truetype"); font-display: swap; }

:root {
    --brand-primary: #e00000;
    --brand-primary-hover: #c40000;
    --bg: #2d2d2d;
    --fg: #f5f5f5;
    --muted: #afafaf;
    --subtle: #8a8a90;
    --surface: rgba(0, 0, 0, 0.5);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.65);
    --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.07) 0%, transparent 55%), rgba(0, 0, 0, 0.35);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --warn: #f2c94c;
    --ok: #6fcf97;

    --radius: 1rem;
    --radius-s: 0.6rem;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --sidebar-w: 300px;
    --content-w: 960px;

    /* Calm, short transitions; switched off for people who reduce motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur: 170ms;

    color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
    :root { --dur: 0ms; }
    *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--bg);
    color: var(--fg);
    font-family: "K2D", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
/* Hub background: dimmed photo over the viewport, landscape silhouette fading in at the bottom */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: 0; }
body::after {
    inset: 0;
    background: url("/static/img/hub-background.jpg") top center / cover no-repeat;
    opacity: 0.45;
}
body::before {
    inset: auto 0 0 0;
    height: 50vh;
    background: url("/static/img/hub-landscape.svg") top center / cover no-repeat;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
    z-index: 1;
}

a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---------- Layout: sidebar + main, one column on narrow screens ---------- */
.shell { position: relative; z-index: 2; display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(28px) saturate(175%);
    -webkit-backdrop-filter: blur(28px) saturate(175%);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
/* Logo lockup like the Hub's header: 100x50 artwork, "Auslagen" where the Hub shows "HUB" */
.brand { position: relative; display: inline-block; }
.brand::after {
    content: "Auslagen";
    position: absolute; left: 0; right: 27px; top: 38px; text-align: right;
    color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.logo { display: block; width: 100px; height: 50px; }
.main { flex: 1 1 auto; min-width: 0; padding: var(--space-6) var(--space-6) 4rem; }
.main-inner { max-width: var(--content-w); margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-5); }
.topbar { display: none; align-items: center; justify-content: space-between; gap: var(--space-3); }

.icon-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius-s);
    background: transparent; color: var(--fg); border: 1px solid var(--border); cursor: pointer;
    transition: background var(--dur) var(--ease);
}
.icon-button:hover { background: rgba(255, 255, 255, 0.06); }
.icon-button svg { width: 1.1rem; height: 1.1rem; }

.backdrop { display: none; }

@media (max-width: 860px) {
    .topbar { display: flex; }
    .main { padding: var(--space-4) var(--space-4) 3rem; }
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 20;
        width: min(320px, 88vw);
        transform: translateX(-102%);
        transition: transform var(--dur) var(--ease);
        overflow-y: auto;
    }
    .sidebar.is-open { transform: none; box-shadow: var(--shadow); }
    .backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.55); }
}
@media (min-width: 861px) {
    .sidebar-close { display: none; }
    /* Stays in place while the receipts scroll, like the Streamlit sidebar */
    .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}

/* ---------- Typography ---------- */
.page-title {
    font-size: clamp(1.375rem, 1.1rem + 0.65vw, 1.75rem);
    font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; margin: 0;
}
.page-subtitle { font-size: clamp(0.8125rem, 0.78rem + 0.12vw, 0.9375rem); color: var(--muted); margin: var(--space-1) 0 0; }
.section-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
.sidebar-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }

/* ---------- Surfaces ---------- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-edge);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px) saturate(175%);
    -webkit-backdrop-filter: blur(28px) saturate(175%);
}
.hint-rule {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: var(--space-3) var(--space-4); font-size: 0.875rem; color: var(--muted);
}
.hint-rule strong { color: var(--fg); }
.placeholder { color: var(--subtle); font-size: 0.875rem; margin: 0; }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field label { font-size: 0.875rem; }
.input {
    width: 100%; font: inherit; color: var(--fg);
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: var(--radius-s);
    padding: 0.55rem 0.75rem;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input:focus { outline: none; border-color: var(--brand-primary); background: rgba(255, 255, 255, 0.08); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    font: inherit; font-weight: 500; cursor: pointer;
    padding: 0.55rem 1rem; border-radius: var(--radius-s);
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.06); color: var(--fg);
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-hover); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-2); }
.user-line { font-size: 0.8125rem; color: var(--muted); }
.version { font-size: 0.75rem; color: var(--subtle); }

/* ---------- HTMX: instant feedback while a request runs ---------- */
.htmx-indicator { opacity: 0; transition: opacity var(--dur) var(--ease); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------- Belege: upload box ---------- */
.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.dropzone {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
    border: 1.5px dashed rgba(255, 255, 255, 0.22); border-radius: var(--radius);
    background: var(--glass-bg); box-shadow: var(--shadow);
    padding: 0.9rem 1.1rem;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dropzone.is-over { border-color: var(--brand-primary); background: rgba(224, 0, 0, 0.08); }
.dropzone:focus-within { border-color: rgba(255, 255, 255, 0.45); }
.dropzone-text { flex: 1 1 12rem; color: var(--muted); font-size: 0.875rem; line-height: 1.35; }
.dropzone-busy { color: var(--fg); font-size: 0.8125rem; }
.dropzone .btn { cursor: pointer; }
.htmx-request.dropzone { border-color: rgba(255, 255, 255, 0.45); }

/* ---------- Übersicht ---------- */
.receipts-block { display: flex; flex-direction: column; gap: var(--space-5); }
.receipts-block:empty { display: none; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.kpi-card {
    background: var(--glass-bg); border: 1px solid var(--glass-edge); border-radius: 0.85rem;
    padding: var(--space-4) 1.25rem; box-shadow: var(--shadow); text-align: center;
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.kpi-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.kpi-value { font-size: 1.5rem; font-weight: 700; margin-top: var(--space-1); }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ---------- Receipt list ---------- */
.receipt-list {
    list-style: none; margin: 0; padding: 0.15rem 1.1rem;
    background: var(--glass-bg); border: 1px solid var(--glass-edge); border-radius: var(--radius);
    box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.receipt { padding: 0.75rem 0 0.9rem; border-bottom: 1px solid var(--border); }
.receipt:last-child { border-bottom: none; }
.receipt-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: start; }
.receipt-nr {
    width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.08);
    font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.receipt-title { overflow-wrap: anywhere; }
.receipt-title em { color: var(--muted); font-style: normal; }
.receipt-meta { color: var(--muted); font-size: 0.8125rem; margin-top: 0.1rem; }
.receipt-note { font-size: 0.78rem; line-height: 1.4; margin-top: 0.3rem; color: var(--muted); }
.receipt-note-error { color: #fde68a; }
.receipt-note-warning { color: #e9d9b0; }
.receipt-actions { display: flex; align-items: center; gap: var(--space-3); }
.receipt-remove {
    display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border-radius: 0.5rem;
    border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.receipt-remove:hover, .receipt-remove:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); }
.receipt-remove svg { width: 1.05rem; height: 1.05rem; }
.receipt-amount { font-weight: 600; font-size: 0.9375rem; text-align: right; white-space: nowrap; padding-top: 0.15rem; }
.receipt.is-off .receipt-main, .receipt.is-off .receipt-amount { opacity: 0.6; }
@media (max-width: 560px) {
    .receipt-row { grid-template-columns: 26px minmax(0, 1fr) auto; }
    .receipt-actions { grid-column: 2 / -1; }
}

/* Switch "Ein / Aus": a real checkbox, styled */
.switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; user-select: none; padding-top: 0.1rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
    position: relative; width: 2.1rem; height: 1.2rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.18); transition: background var(--dur) var(--ease);
}
.switch-track::after {
    content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 0.9rem; height: 0.9rem;
    border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch-track { background: var(--brand-primary); }
.switch input:checked + .switch-track::after { transform: translateX(0.9rem); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--fg); outline-offset: 2px; }
.switch-label { font-size: 0.875rem; min-width: 1.8rem; }
.htmx-request .switch { opacity: 0.7; }

/* ---------- Messages ---------- */
.toasts {
    position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 30;
    display: flex; flex-direction: column; gap: var(--space-2); max-width: min(420px, calc(100vw - 2rem));
}
.toast {
    background: rgba(20, 20, 20, 0.92); border: 1px solid var(--border); border-left: 3px solid var(--ok);
    border-radius: var(--radius-s); padding: 0.65rem 0.9rem; font-size: 0.875rem; box-shadow: var(--shadow);
    animation: toast-in var(--dur) var(--ease) both;
    transition: opacity 250ms var(--ease), transform 250ms var(--ease);
}
.toast-info { border-left-color: var(--muted); }
.toast-warning { border-left-color: var(--warn); }
.toast.is-leaving { opacity: 0; transform: translateY(4px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- M3: entry form next to the original ---------- */
.entry { margin: var(--space-2) 0 0 calc(26px + var(--space-3)); }
.entry-summary {
    display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; list-style: none;
    font-size: 0.875rem; color: var(--fg); padding: 0.35rem 0.75rem; border-radius: var(--radius-s);
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
    transition: background var(--dur) var(--ease);
}
.entry-summary::-webkit-details-marker { display: none; }
.entry-summary::before { content: "›"; display: inline-block; transition: transform var(--dur) var(--ease); }
details[open] > .entry-summary::before { transform: rotate(90deg); }
.entry-summary:hover { background: rgba(255, 255, 255, 0.08); }
.entry-body {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-5);
    margin: var(--space-3) 0 var(--space-4); animation: entry-in var(--dur) var(--ease) both;
}
@keyframes entry-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
    .entry { margin-left: 0; }
    .entry-body { grid-template-columns: 1fr; }
}
.entry-preview { min-width: 0; }
.preview-button {
    position: relative; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; max-width: 100%;
}
.preview-image { display: block; max-height: 260px; max-width: 100%; width: auto; object-fit: contain; border-radius: 0.5rem; background: #fff; }
.preview-zoom {
    position: absolute; top: 8px; right: 8px; display: flex; padding: 0.3rem; border-radius: 0.5rem;
    background: rgba(20, 20, 20, 0.78); color: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.preview-zoom svg { width: 1rem; height: 1rem; }
.preview-dialog {
    border: 0; padding: var(--space-3); background: rgba(15, 15, 15, 0.96); color: var(--fg);
    max-width: 96vw; max-height: 96vh; border-radius: var(--radius);
}
.preview-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.preview-dialog-bar { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.preview-pager { display: flex; align-items: center; gap: var(--space-2); margin-right: auto; }
.preview-pager[hidden] { display: none; }
.preview-full { display: block; max-width: calc(96vw - 2rem); max-height: calc(96vh - 5rem); object-fit: contain; background: #fff; }

.entry-form { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.choice { border: 0; margin: 0; padding: 0; }
.choice legend { font-size: 0.875rem; padding: 0; margin-bottom: var(--space-1); }
.choice-row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.choice-option, .check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.875rem; cursor: pointer; }
.choice-option input, .check input { accent-color: var(--brand-primary); width: 1rem; height: 1rem; }
.field-help { margin: var(--space-1) 0 0; font-size: 0.75rem; color: var(--subtle); line-height: 1.4; }
.field-error {
    margin: 0; border-radius: var(--radius-s); border: 1px solid rgba(217, 119, 6, 0.5); background: rgba(217, 119, 6, 0.18);
    padding: 0.6rem 0.85rem; font-size: 0.8125rem; color: #fde68a;
}
input[type="date"].input { color-scheme: dark; }

/* ---------- M4: sidebar form, signature, export ---------- */
[x-cloak] { display: none !important; }
.sidebar-form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-3); }
.sidebar-subtitle { font-size: 0.875rem; font-weight: 700; margin: var(--space-2) 0 0; }
.bank { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.reset { margin-top: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.help {
    display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; margin-left: 0.2rem;
    border-radius: 50%; border: 1px solid var(--subtle); color: var(--subtle); font-size: 0.65rem; cursor: help; vertical-align: 1px;
}
.hint-warn, .hint-ok, .hint-error {
    border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.8125rem; line-height: 1.45;
}
.hint-warn, .hint-error { border: 1px solid rgba(217, 119, 6, 0.5); background: rgba(217, 119, 6, 0.18); color: #fde68a; }
.hint-ok { border: 1px solid rgba(111, 207, 151, 0.45); background: rgba(111, 207, 151, 0.14); color: #c9f2da; }
.signature-preview {
    font-family: "Sacramento", cursive; font-size: 2.1rem; padding: 0.4rem 0.9rem 0.15rem;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.35); display: inline-block; min-width: 14rem;
}
.signature-caption { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.input[disabled] { opacity: 0.55; cursor: not-allowed; }
.download-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
a.btn { text-decoration: none; }
.package-preview { margin-top: var(--space-3); }
.package-preview .preview-pager { margin-bottom: var(--space-3); }
.package-page { display: block; width: 100%; height: auto; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 12px; background: #fff; }
@media (max-width: 560px) { .download-row { grid-template-columns: 1fr; } }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 0.875rem; }

/* ---------- M5: draft menu, mileage, supplementary documents ---------- */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.title-row .section-title { margin: 0; }
.menu { position: relative; }
.menu-button { list-style: none; min-width: 9rem; }
.menu-button::-webkit-details-marker { display: none; }
.menu-panel {
    position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 15; width: min(420px, 92vw);
    background: rgba(24, 24, 24, 0.97); border: 1px solid var(--glass-edge); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: var(--space-4); transform-origin: top right;
    animation: menu-in var(--dur) var(--ease) 40ms both;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
.dropzone-small { padding: 0.6rem 0.8rem; box-shadow: none; flex-wrap: nowrap; }
.entry-flat { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3) var(--space-4); }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.mileage-form { margin-top: var(--space-3); }
textarea.input { resize: vertical; min-height: 4.5rem; }
.supp-summary { cursor: pointer; list-style: none; margin: 0; }
.supp-summary::-webkit-details-marker { display: none; }
.supp-summary::before { content: "›"; display: inline-block; margin-right: var(--space-2); transition: transform var(--dur) var(--ease); }
.supp[open] > .supp-summary::before { transform: rotate(90deg); }
.supp-body { margin-top: var(--space-3); }
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); }
.tab {
    font: inherit; font-size: 0.875rem; color: var(--muted); background: none; border: 0; cursor: pointer;
    padding: 0.5rem 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab.is-active { color: var(--fg); border-bottom-color: var(--brand-primary); }

/* ---------- M7: further details in the entry form ---------- */
.fx { padding: var(--space-3); border-radius: var(--radius-s); border: 1px solid rgba(242, 201, 76, 0.35); background: rgba(242, 201, 76, 0.07); }
.fx .field-help { margin: 0 0 var(--space-2); color: var(--fg); }
.more { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.more-summary { cursor: pointer; font-size: 0.875rem; color: var(--muted); list-style: none; }
.more-summary::-webkit-details-marker { display: none; }
.more-summary::before { content: "›"; display: inline-block; margin-right: var(--space-2); transition: transform var(--dur) var(--ease); }
.more[open] > .more-summary::before { transform: rotate(90deg); }
.more-body { margin-top: var(--space-3); }
select.input { appearance: auto; }

/* Help "?": also readable on touch screens and by keyboard. Tap or focus shows the text as a small bubble. */
.help { position: relative; }
.help:focus { outline: none; border-color: var(--fg); color: var(--fg); }
.help:focus::after {
    content: attr(aria-label);
    position: absolute; z-index: 25; top: calc(100% + 0.4rem); right: -0.4rem;
    width: max-content; max-width: min(260px, 70vw);
    padding: 0.5rem 0.65rem; border-radius: var(--radius-s);
    background: rgba(20, 20, 20, 0.97); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
    color: var(--fg); font-size: 0.75rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal;
    animation: toast-in var(--dur) var(--ease) both;
}

/* Every choice reacts as a whole, also on the circle or box itself */
input[type="radio"], input[type="checkbox"], select, label.choice-option, label.check, .mode-option { cursor: pointer; }

/* "Abrechnung für": two cards, the line under each says what the choice means */
.mode { border: 0; margin: 0; padding: 0; }
.mode legend { font-size: 0.875rem; padding: 0; margin-bottom: var(--space-2); }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.mode-option {
    position: relative; display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.6rem 0.7rem; border-radius: var(--radius-s);
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.mode-option:hover { background: rgba(255, 255, 255, 0.07); }
.mode-option:active { transform: scale(0.98); }
.mode-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-option:has(input:checked) { border-color: var(--brand-primary); background: rgba(224, 0, 0, 0.12); }
.mode-option:has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: 2px; }
.mode-title { font-size: 0.875rem; font-weight: 500; }
.mode-sub { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
