/* Hausfinder — eigenes kompaktes Stylesheet (kein Framework).
   Aufbau: Tokens, Basis, Bausteine, Kopf/Navigation, Seiten, Breakpoints.
   Breakpoints: Handy < 720px, Tablet 720–999px, Desktop >= 1000px. */

/* ---------- Tokens ---------- */
:root {
    --paper: #F2F4F1;
    --surface: #FFFFFF;
    --ink: #1C2824;
    --muted: #65716B;
    --line: #D8DED9;
    --line-strong: #C2CAC4;
    --hover: #F7F9F7;
    --field: #1F6B57;
    --field-dark: #185646;
    --field-tint: #E4F0EA;
    --no: #A8432F;
    --no-dark: #8E3726;
    --no-tint: #F7E8E4;

    --score-high: #2E7D4E;
    --score-mid: #A77C1C;
    --score-low: #A8432F;
    --score-none: #8A948F;
    /* Textfarben auf hellem Grund (AA-Kontrast) */
    --score-high-ink: #2A7348;
    --score-high-tint: #E3F1E8;
    --score-mid-ink: #8A6414;
    --score-mid-tint: #F7F0DF;
    --score-low-ink: #A8432F;
    --score-low-tint: #F7E8E4;

    --r-ctl: 6px;
    --r-panel: 10px;
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

    /* Typo-Skala 12 / 13.5 / 15 / 17 / 21 / 28 px bei 15px Basis */
    --fs-xs: .8rem;
    --fs-sm: .9rem;
    --fs-md: 1rem;
    --fs-lg: 1.1333rem;
    --fs-xl: 1.4rem;
    --fs-2xl: 1.8667rem;

    --header-h: 52px;
    --tabbar-h: 0px;
    --gutter: 24px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --bottom-ui: calc(var(--tabbar-h) + var(--safe-b));
    --maxw: 1280px;
    --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (max-width: 719.98px) {
    :root {
        --header-h: 48px;
        --tabbar-h: 56px;
        --gutter: 12px;
    }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
@media (max-width: 719.98px) { html { font-size: 16px; } }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.lightbox-open { overflow: hidden; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 650; line-height: 1.2; letter-spacing: -0.005em; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
code, kbd, pre { font-family: var(--font); }
code {
    font-weight: 600;
    background: var(--field-tint);
    color: var(--field-dark);
    padding: 0 4px;
    border-radius: 4px;
}
kbd {
    display: inline-block;
    min-width: 20px;
    padding: 0 5px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--surface);
    font-size: var(--fs-xs);
    line-height: 18px;
    text-align: center;
}

a { color: var(--field); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--field);
    outline-offset: 2px;
    border-radius: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 200;
    background: var(--surface);
    padding: 8px 12px;
    border-radius: var(--r-ctl);
}
.skip-link:focus { left: 8px; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num, .tnum {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.icon {
    flex: none;
    display: inline-block;
    vertical-align: -3px;
}

/* ---------- Bausteine: Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: .9667rem;
    font-weight: 560;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; border-color: #A9B3AD; background: var(--hover); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-primary { background: var(--field); border-color: var(--field); color: #fff; }
.btn-primary:hover { background: var(--field-dark); border-color: var(--field-dark); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: rgba(28, 40, 36, .06); border-color: transparent; color: var(--ink); }

.btn-yes:hover { color: var(--field); border-color: var(--field); background: var(--surface); }
.btn-no:hover { color: var(--no); border-color: var(--no); background: var(--surface); }
.btn-yes[aria-pressed="true"] { background: var(--field); border-color: var(--field); color: #fff; }
.btn-yes[aria-pressed="true"]:hover { background: var(--field-dark); border-color: var(--field-dark); color: #fff; }
.btn-no[aria-pressed="true"] { background: var(--no); border-color: var(--no); color: #fff; }
.btn-no[aria-pressed="true"]:hover { background: var(--no-dark); border-color: var(--no-dark); color: #fff; }
.btn-cmp[aria-pressed="true"] { background: var(--field-tint); border-color: var(--field); color: var(--field); }

/* Icon-Buttons in der Liste (32px) */
.ibtn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--muted);
    transition: background-color .12s, border-color .12s, color .12s;
}
.ibtn-yes:hover { color: var(--field); border-color: var(--field); }
.ibtn-no:hover { color: var(--no); border-color: var(--no); }
.ibtn-yes[aria-pressed="true"] { background: var(--field); border-color: var(--field); color: #fff; }
.ibtn-no[aria-pressed="true"] { background: var(--no); border-color: var(--no); color: #fff; }

.linkbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--field);
    font-size: var(--fs-sm);
    font-weight: 550;
}
.linkbtn:hover { text-decoration: underline; text-underline-offset: 2px; }
.linkbtn-danger { color: var(--no); }

.extlink { display: inline-flex; align-items: center; gap: 4px; }
.extlink .icon { vertical-align: 0; }

/* ---------- Bausteine: Badges, Tags, Score ---------- */
.badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: #E2E7E3;
    color: var(--ink);
    font-size: var(--fs-xs);
    font-weight: 650;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.badge-field { background: var(--field); color: #fff; }

.tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: #E6EAE7;
    color: #4E5954;
    font-size: var(--fs-xs);
    font-weight: 550;
    line-height: 1.4;
}

.score {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--r-ctl);
    font-size: var(--fs-sm);
    font-weight: 650;
    font-stretch: 87.5%;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.score-high { background: var(--score-high-tint); color: var(--score-high-ink); }
.score-mid { background: var(--score-mid-tint); color: var(--score-mid-ink); }
.score-low { background: var(--score-low-tint); color: var(--score-low-ink); }
.score-none { background: transparent; color: var(--muted); font-weight: 400; }

.drop {
    color: var(--field);
    font-size: var(--fs-xs);
    font-weight: 600;
    font-stretch: 87.5%;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    background: #E6EAE7;
    color: #4E5954;
    font-size: var(--fs-xs);
    font-weight: 600;
}
.pill-ok { background: var(--field-tint); color: var(--field-dark); }
.pill-err { background: var(--no-tint); color: var(--no-dark); }
.pill-warn { background: var(--score-mid-tint); color: var(--score-mid-ink); }

[aria-busy="true"]::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -1px;
    animation: hf-spin .8s linear infinite;
}
@keyframes hf-spin { to { transform: rotate(360deg); } }

/* Gekuerzter Text mit "Mehr anzeigen" */
.clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--lines, 4);
    line-clamp: var(--lines, 4);
    overflow: hidden;
}
.clamp-3 { --lines: 3; }
.clamp-4 { --lines: 4; }
.clamp-6 { --lines: 6; }
.clamp.is-open { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.clamp-toggle { margin-top: 4px; }

/* ---------- Bausteine: Formulare ---------- */
input[type="text"], input[type="number"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--fs-md);
    transition: border-color .12s, box-shadow .12s;
}
textarea {
    height: auto;
    min-height: 76px;
    padding: 8px 10px;
    line-height: 1.45;
    resize: vertical;
}
select {
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2365716B' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
input:hover, select:hover, textarea:hover { border-color: #A9B3AD; }
input:focus, select:focus, textarea:focus {
    border-color: var(--field);
    box-shadow: 0 0 0 3px rgba(31, 107, 87, .15);
    outline: none;
}
input::placeholder, textarea::placeholder { color: #8A948F; }

input[type="checkbox"] {
    appearance: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid #939E98;
    border-radius: 4px;
    background: var(--surface) center / 14px no-repeat;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
input[type="checkbox"]:hover { border-color: var(--field); }
input[type="checkbox"]:checked {
    border-color: var(--field);
    background-color: var(--field);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
input[type="checkbox"]:disabled { opacity: .4; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: var(--fs-sm); font-weight: 560; }
.field-help { display: block; color: var(--muted); font-size: var(--fs-xs); line-height: 1.4; }
.fields { display: grid; gap: 14px 16px; }
.fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: var(--fs-sm); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.checks-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 16px; }
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    font-size: .9667rem;
    cursor: pointer;
}

/* ---------- Kopf und Navigation ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    max-width: var(--maxw);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.brand {
    color: var(--ink);
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-profile { margin-left: 4px; color: var(--muted); font-weight: 450; font-size: var(--fs-sm); letter-spacing: 0; }

.mainnav { display: flex; align-items: center; gap: 2px; }
.mainnav a {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--r-ctl);
    color: #3F4B46;
    font-weight: 560;
    white-space: nowrap;
}
.mainnav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.mainnav a[aria-current="page"] { background: var(--field-tint); color: var(--field-dark); }
.mainnav a[aria-current="page"] .badge:not(.badge-field) { background: #CFE3D8; }

.subnav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.subnav a { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.subnav a:hover, .subnav a[aria-current="page"] { color: var(--ink); }
.subnav a[aria-current="page"] { font-weight: 600; }

/* Untere Tab-Leiste (nur Handy) */
.tabbar { display: none; }

/* "Mehr"-Menue in der Kopfzeile (nur Tablet) */
.topbar-more { display: none; }
.topbar-more > summary {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-ctl);
    color: var(--muted);
}
.topbar-more > summary:hover, .topbar-more[open] > summary { background: var(--hover); color: var(--ink); }

/* Dropdown-Menues (details[data-menu]) */
details[data-menu] { position: relative; }
details[data-menu] > summary { list-style: none; cursor: pointer; }
details[data-menu] > summary::-webkit-details-marker { display: none; }
.menu {
    position: absolute;
    z-index: 70;
    min-width: 200px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-panel);
}
.menu-right { right: 0; top: calc(100% + 6px); }
.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-ctl);
    color: var(--ink);
    font-size: .9667rem;
    white-space: nowrap;
}
.menu a:hover { background: var(--hover); text-decoration: none; }
.menu a[aria-current="page"] { color: var(--field-dark); font-weight: 600; }
.menu a .icon { color: var(--muted); }
.menu .badge { margin-left: auto; }
.menu-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Vergleichsleiste (schwebend) */
.tray {
    position: fixed;
    left: 50%;
    bottom: calc(16px + var(--bottom-ui));
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 16px;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    border-radius: var(--r-panel);
    box-shadow: 0 10px 30px rgba(28, 40, 36, .28);
    white-space: nowrap;
}
.tray-count { margin-right: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tray .btn-primary { background: #2B8A70; border-color: #2B8A70; }
.tray .btn-primary:hover { background: #247A63; border-color: #247A63; }
.tray .btn-quiet { color: #C9D2CD; }
.tray .btn-quiet:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.tray :focus-visible { outline-color: #9BD3C1; }

/* ---------- Seitenrahmen ---------- */
.page {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 16px var(--gutter) calc(48px + var(--bottom-ui));
}
body.has-tray .page { padding-bottom: calc(96px + var(--bottom-ui)); }

.pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 4px 0 16px;
}
.pagehead h1 { font-size: var(--fs-xl); }
.pagehead-meta { color: var(--muted); font-size: var(--fs-sm); }
.pagehead-actions { display: flex; gap: 8px; margin-left: auto; }

.notice {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: var(--r-ctl);
    font-size: .9667rem;
}
.notice-ok { background: var(--field-tint); border-color: #BCD8CA; color: var(--field-dark); }
.notice-warn { background: var(--score-mid-tint); border-color: #E3D0A2; color: #6B4F10; }
.notice-err { background: var(--no-tint); border-color: #E4C3BA; color: var(--no-dark); }

.empty {
    padding: 36px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-panel);
    background: var(--surface);
    color: var(--muted);
    text-align: center;
}
.empty > * + * { margin-top: 8px; }
.empty-title { color: var(--ink); font-size: var(--fs-lg); font-weight: 600; }
.empty .btn { margin: 4px 2px 0; }

.panel {
    margin-bottom: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.panel-head h2 { font-size: var(--fs-lg); }

.backlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 550;
}
.backlink:hover { color: var(--ink); text-decoration: none; }

/* Tabellen */
.tbl { width: 100%; font-size: var(--fs-sm); }
.tbl th {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl-small { font-size: var(--fs-xs); }
.tbl-scroll { position: relative; overflow-x: auto; }
.tbl .is-down { color: var(--field); font-weight: 600; }
.tbl .is-up { color: var(--no); font-weight: 600; }

pre.log {
    max-height: 360px;
    margin: 0;
    padding: 10px 12px;
    overflow: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    font-size: var(--fs-xs);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

/* ---------- Liste ---------- */
.listbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.tabs {
    position: relative;
    display: flex;
    gap: 22px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 10px 0 9px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--muted);
    font-weight: 560;
    white-space: nowrap;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--field); }
.tab-count { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; }
.tab[aria-current="page"] .tab-count { color: var(--field); font-weight: 600; }
.tab-archive { display: none; }

.listbar-end {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding-bottom: 6px;
}
.archive-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--r-ctl);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 560;
    white-space: nowrap;
}
.archive-toggle:hover, details[open] > .archive-toggle { background: rgba(28, 40, 36, .06); color: var(--ink); }
.archive-toggle.is-active { color: var(--ink); }
.sort-select { display: none; }

/* Zeilen: Grundlayout = kompakte Karte (Handy/Tablet); Desktop-Tabelle weiter unten */
.ltable { position: relative; }
.lhead { display: none; }
.lrows { margin: 0; }
.lrow {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
        "thumb title title"
        "thumb money money"
        "thumb facts facts"
        "thumb meta  actions"
        "pc    pc    pc";
    column-gap: 12px;
    row-gap: 2px;
    padding: 10px 12px;
    background: var(--surface);
    transition: background-color .12s;
}
.lrow:hover { background: var(--hover); }
.lrow.is-liked { box-shadow: inset 3px 0 0 var(--field); }
.lrow.is-disliked { box-shadow: inset 3px 0 0 #A2ACA6; }
.lrow.is-disliked .c-thumb img { opacity: .7; }
.lrow.is-removed .c-thumb, .lrow.is-removed .c-main, .lrow.is-removed .c-money, .lrow.is-removed .c-facts { opacity: .55; }
.lrow:has(.cmp-toggle:checked) { background: var(--field-tint); --muted: #56625C; }

.lrow .c-thumb {
    grid-area: thumb;
    align-self: start;
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: var(--r-ctl);
    background: #E3E8E4;
}
.lrow .c-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: grid; place-items: center; width: 100%; height: 100%; color: #9AA59F; }

.lrow .c-main { display: contents; }
.lrow-link {
    grid-area: title;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 620;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.lrow-link:hover { text-decoration: none; color: var(--field-dark); }
/* Ganze Zeile klickbar, Bedienelemente liegen darueber */
.lrow-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.lrow-link:focus-visible { outline: none; }
.lrow-link:focus-visible::after { outline: 2px solid var(--field); outline-offset: -2px; border-radius: 2px; }
.lrow-orig { display: none; }
/* Pro/Contra in einer Zeile, ohne Umbruch (voller Text im Tooltip) */
.lrow-pc {
    grid-area: pc;
    margin-top: 4px;
    display: flex;
    gap: 12px;
    min-width: 0;
    color: var(--ink);
    font-size: var(--fs-xs);
    line-height: 1.35;
}
/* Pro und Contra je eine Haelfte, getrennt gekuerzt: beide bleiben sichtbar */
.pc-part {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.pc-label { font-weight: 620; }
.pc-pro { color: var(--field); }
.pc-con { color: var(--no); }
.pc-sep { color: var(--muted); }
.lrow-meta {
    grid-area: meta;
    align-self: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    min-width: 0;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.35;
}
.lrow-meta > span { white-space: nowrap; }

.lrow .c-money {
    grid-area: money;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
}
.lrow .c-price {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: var(--fs-lg);
    font-weight: 650;
    font-stretch: 87.5%;
    white-space: nowrap;
}
.lrow .c-ppsqm { color: var(--muted); font-size: var(--fs-sm); font-stretch: 87.5%; font-weight: 500; white-space: nowrap; }

.lrow .c-facts {
    grid-area: facts;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2px 12px;
    font-size: var(--fs-sm);
}
.lrow .c-facts > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-stretch: 87.5%;
    font-weight: 560;
}
.lrow .c-facts .icon { width: 14px; height: 14px; color: var(--muted); }
.lrow .c-facts .is-empty, .lrow .c-ppsqm.is-empty { display: none; }
.no-km .c-km { display: none; }

.lrow .c-score {
    grid-area: thumb;
    align-self: start;
    justify-self: start;
    z-index: 1;
    margin: 4px;
    pointer-events: none;
}
.lrow .c-score .score { box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); }
.lrow .c-score .score-none { display: none; }

/* Vergleichs-Kaestchen: Handy/Tablet als Auswahl-Ecke auf dem Foto, Desktop als eigene Spalte */
.lrow .c-select {
    grid-area: thumb;
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    align-self: start;
    justify-self: end;
    width: 30px;
    height: 30px;
    margin: 62px 4px 0 0;
    border-radius: var(--r-ctl);
    background: rgba(255, 255, 255, .94);
    cursor: pointer;
}
.lrow .c-select::before { content: ""; position: absolute; inset: -8px; }
.lrow .c-select input { position: relative; }
.lrow .c-select:has(input:disabled) { opacity: .6; cursor: not-allowed; }

.lrow .c-actions {
    grid-area: actions;
    position: relative;
    z-index: 1;
    display: flex;
    gap: 6px;
    align-self: end;
}

.cur, .unit { font-weight: inherit; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}
.pager-info { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ---------- Listenfilter (partials/filters.html) ----------
   Grundform = Dialog (Tablet/Handy), ab 1200px Seitenleiste (siehe Breakpoints unten). */
.listpage { min-width: 0; }
.listmain { min-width: 0; }

.filter-open { position: relative; }
.filter-open.is-active { border-color: var(--field); color: var(--field-dark); }
.filter-open .filter-count { margin-left: 0; }

.filters {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    width: min(400px, 100%);
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -12px 0 32px rgba(28, 40, 36, .16);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
}
body.filters-open .filters, .filters:target {
    transform: none;
    visibility: visible;
    transition: transform .22s ease;
}
.filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(28, 40, 36, .38);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility 0s linear .22s;
}
body.filters-open .filters-backdrop { opacity: 1; visibility: visible; transition: opacity .22s ease; }
body.filters-open { overflow: hidden; }

.filters-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    padding: env(safe-area-inset-top, 0px) 8px 0 16px;
    border-bottom: 1px solid var(--line);
}
.filters-title { font-size: var(--fs-lg); }
.filters-close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-ctl);
    color: var(--muted);
}
.filters-close:hover { background: var(--hover); color: var(--ink); }
.filters-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 16px 8px;
}
.filters-foot {
    flex: none;
    display: flex;
    gap: 8px;
    padding: 10px 16px calc(10px + var(--safe-b));
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.filters-foot .btn-primary { flex: 1 1 auto; min-width: 0; }
.filters-noscript { margin-top: 12px; }

.fsearch { position: relative; }
.fsearch > .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.fsearch input[type="search"] {
    width: 100%;
    height: 38px;
    padding: 0 10px 0 32px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--fs-md);
    transition: border-color .12s, box-shadow .12s;
}
.fsearch-sm input[type="search"] { height: 32px; padding-left: 30px; font-size: var(--fs-sm); }
.fsearch-sm > .icon { left: 10px; }

.fgroup { border-top: 1px solid var(--line); }
.fsearch + .fgroup { margin-top: 12px; }
.fgroup > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 0;
    font-weight: 620;
    list-style: none;
    cursor: pointer;
}
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary:hover { color: var(--field-dark); }
.fgroup-chev { color: var(--muted); transition: transform .15s; }
.fgroup[open] > summary .fgroup-chev { transform: rotate(180deg); }
.fgroup-body { display: grid; gap: 16px; padding: 2px 0 16px; }

.ffield { display: grid; gap: 6px; min-width: 0; }
fieldset.ffield { display: block; }
.flabel { font-size: var(--fs-sm); font-weight: 560; color: var(--ink); }
legend.flabel { margin-bottom: 6px; }

.frange { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.frange-1 { grid-template-columns: minmax(0, 1fr); }
.finput { position: relative; display: block; min-width: 0; }
.finput input[type="number"] {
    height: 34px;
    padding: 0 44px 0 10px;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}
.finput input::-webkit-outer-spin-button, .finput input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.funit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: var(--fs-xs);
    pointer-events: none;
}
.fkm-custom { margin-top: 6px; max-width: 160px; }
.filters select { height: 34px; font-size: var(--fs-sm); }

.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.fchip {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--fs-sm);
    font-weight: 520;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}
.fchip:hover { border-color: #A9B3AD; background: var(--hover); }
.chip-input:checked + .fchip { border-color: var(--field); background: var(--field-tint); color: var(--field-dark); font-weight: 620; }
.chip-input:focus-visible + .fchip { outline: 2px solid var(--field); outline-offset: 2px; }

.fopts { display: grid; }
.fopt {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    font-size: var(--fs-sm);
    cursor: pointer;
}
.fopt-label { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fopt-count { flex: none; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.fopt.is-zero { color: #88928D; }
.fopt.is-zero .fopt-count { color: #A5AEA9; }
.fopts-none, .fopts-nomatch { color: var(--muted); font-size: var(--fs-xs); }
.fmore { justify-self: start; font-size: var(--fs-xs); }
.fexclude { margin-top: 4px; }
.check-sm { min-height: 26px; gap: 8px; color: var(--muted); font-size: var(--fs-xs); }
.check-sm input[type="checkbox"] { width: 16px; height: 16px; background-size: 12px; }
/* "Ohne Angabe einbeziehen" nur, wenn der zugehoerige Filter gesetzt ist */
.ffield-lot:has(#f-lot:placeholder-shown) .funknown,
.ffield-year:has(#f-year:placeholder-shown) .funknown,
.ffield-energy:has(#f-energy option[value=""]:checked) .funknown,
.ffield-cond:not(:has(#facet-cond input:checked)) .funknown { display: none; }

/* Trefferzahl und aktive Filter ueber der Liste */
.resultbar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin: 0 0 8px;
}
.result-count { color: var(--muted); font-size: var(--fs-sm); }
.result-count strong { color: var(--ink); font-size: var(--fs-md); font-weight: 650; font-variant-numeric: tabular-nums; }
.result-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-sm); }
.result-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 520; }
.result-links a:hover { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.chips > li { min-width: 0; max-width: 100%; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    height: 28px;
    padding: 0 6px 0 10px;
    border-radius: var(--r-ctl);
    background: var(--field-tint);
    color: var(--field-dark);
    font-size: var(--fs-sm);
    font-weight: 560;
}
.chip > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip .icon { color: var(--field); }
.chip:hover { background: #D3E7DC; text-decoration: none; }
.chips-reset { display: inline-block; padding: 0 4px; color: var(--muted); font-size: var(--fs-sm); }
.chips-reset:hover { color: var(--ink); }

/* Karte / Bewerten mit Listenfiltern */
.map-filtered { display: flex; flex-wrap: wrap; gap: 0 10px; }
.swipe-unfilter { margin-left: 10px; }

/* ---------- Vergleich ---------- */
.cmp-scroll {
    position: relative; /* Containing Block fuer .sr-only in den Zellen, sonst scrollt die Seite */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-left: var(--label-w, 140px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
}
.cmp {
    --label-w: 140px;
    table-layout: fixed;
    width: max(100%, calc(var(--label-w) + var(--cols) * 210px));
    border-collapse: separate;
    border-spacing: 0;
    font-size: .9667rem;
}
.cmp th, .cmp td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: baseline;
}
.cmp thead th { vertical-align: top; }
.cmp tbody tr:last-child > * { border-bottom: 0; }
.cmp-label {
    position: sticky;
    left: 0;
    z-index: 2;
    width: var(--label-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 560;
}
.cmp-col { scroll-snap-align: start; border-left: 1px solid var(--line); }
.cmp-label + .cmp-col { border-left: 0; }
.cmp td.num { font-weight: 600; font-stretch: 87.5%; font-size: var(--fs-md); }
.cmp td.is-best { background: var(--field-tint); color: var(--field-dark); font-weight: 680; }
.cmp .na { color: #9AA59F; font-weight: 400; }
.cmp td.is-best .score { background: var(--surface); box-shadow: inset 0 0 0 1px #BCD8CA; }
.cmp .drop { display: block; margin-top: 2px; }
.cmp-row-reason td { font-size: var(--fs-sm); line-height: 1.5; color: #34403B; }
.cmp-row-price td.num { font-size: var(--fs-lg); }

.cmp-head { position: relative; padding-top: 12px; font-weight: 400; }
.cmp-photo {
    display: block;
    aspect-ratio: 3 / 2;
    max-height: 170px;
    width: 100%;
    overflow: hidden;
    border-radius: var(--r-ctl);
    background: #E3E8E4;
}
.cmp-photo img { width: 100%; height: 100%; object-fit: cover; }
.cmp-photo .thumb-empty { height: 100%; }
.cmp-remove {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--ink);
    box-shadow: 0 0 0 1px rgba(28, 40, 36, .12);
}
.cmp-remove:hover { background: #fff; color: var(--no); text-decoration: none; }
.cmp-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 8px;
    color: var(--ink);
    font-weight: 620;
    line-height: 1.3;
}
.cmp-headprice {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-lg);
    font-weight: 650;
    font-stretch: 87.5%;
    font-variant-numeric: tabular-nums;
}
.cmp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-corner { vertical-align: bottom !important; }
.cmp-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.35;
}
.cmp-note .best-swatch { flex: none; margin-top: 1px; }
.best-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--field-tint);
    box-shadow: inset 0 0 0 1px #BCD8CA;
}

/* ---------- Detail ---------- */
.detail {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 32px;
    align-items: start;
}
.gallery-main {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--r-panel);
    background: #DDE3DE;
    cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--r-ctl);
    background: rgba(28, 40, 36, .72);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.gallery-count .icon { vertical-align: 0; }
.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    aspect-ratio: 3 / 2;
    border-radius: var(--r-panel);
    background: #E3E8E4;
    color: var(--muted);
}
.thumbs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.thumb {
    flex: none;
    width: 84px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--r-ctl);
    background: #E3E8E4;
    opacity: .72;
    transition: opacity .12s;
}
.thumb:hover { opacity: 1; }
.thumb.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--field); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.detail-title { font-size: var(--fs-2xl); line-height: 1.15; font-weight: 650; letter-spacing: -0.01em; }
.detail-orig {
    margin-top: 6px;
    overflow: hidden;
    color: var(--muted);
    font-size: var(--fs-sm);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.detail-place {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 10px;
    font-size: .9667rem;
}
.detail-place .icon { color: var(--muted); margin-right: -4px; }
.detail-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin-top: 12px;
}
.price-big {
    font-size: var(--fs-2xl);
    font-weight: 600;
    font-stretch: 87.5%;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.detail-price .drop { font-size: var(--fs-sm); }

.detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 8px;
}
.linkbtn-quiet {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-decoration: none;
}
.linkbtn-quiet:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.linkbtn-quiet[aria-pressed="true"] { color: var(--field); }
.linkbtn-quiet:disabled { opacity: .5; cursor: not-allowed; text-decoration: none; }

/* Entscheidungsblock: Notiz + zwei Buttons */
.decision { margin-top: 16px; position: relative; }
.decision-head {
    display: flex;
    align-items: center;
    gap: 4px 10px;
    min-height: 24px;
    margin-bottom: 6px;
}
.decision-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.decision-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    font-weight: 600;
}
.decision-status.is-liked { color: var(--field); }
.decision-status .muted { font-weight: 450; }
.decision-flash {
    font-size: var(--fs-xs);
    color: var(--muted);
    animation: decision-flash 2.6s ease forwards;
}
@keyframes decision-flash { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.decision-reset {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: 500;
}
.decision-reset:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.decision textarea {
    display: block;
    min-height: 0;
    max-height: 9.5em;
    resize: none;
    font-size: var(--fs-sm);
}
.decision-actions { display: flex; gap: 8px; margin-top: 8px; }
.decision-actions .btn:not(.decision-notebtn) { flex: 1 1 0; min-width: 0; }
.decision-notebtn { display: none; position: relative; width: 44px; padding: 0; flex: none; }

.detail-ai {
    margin-top: 18px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.detail-ai-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.detail-ai-label { font-weight: 600; }

.factlist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
    margin-top: 18px;
}
.factlist dt {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: var(--fs-xs);
}
.factlist dt .icon { color: var(--muted); }
.factlist dd {
    margin: 2px 0 0 22px;
    font-weight: 580;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
}

.detail-more {
    display: grid;
    gap: 28px;
    max-width: 860px;
    margin-top: 36px;
}
.detail-more > * { min-width: 0; }
.detail-section h2 { margin-bottom: 10px; font-size: var(--fs-lg); }
.prose { max-width: 70ch; line-height: 1.6; white-space: pre-line; overflow-wrap: break-word; }
/* KI-Beschreibung: Kurzfassung, gegliederte Stichpunkte, Originaltext aufklappbar */
.desc-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.desc-note { color: var(--muted); font-size: var(--fs-xs); font-weight: 450; }
.desc-summary { max-width: 70ch; font-size: var(--fs-lg); line-height: 1.5; }
.desc-blocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 32px;
    margin-top: 20px;
}
.desc-block h3 { margin-bottom: 6px; font-size: var(--fs-md); font-weight: 620; }
.desc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; line-height: 1.45; }
.desc-list li { position: relative; padding-left: 14px; }
.desc-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--field);
}
.desc-orig { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.desc-orig .prose { color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 719.98px) {
    .desc-blocks { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .desc-summary { font-size: var(--fs-md); }
}
.kv {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 20px;
    font-size: .9667rem;
}
.kv > div { display: contents; }
.kv dt { color: var(--muted); }
.note-form { display: grid; gap: 8px; max-width: 560px; }
.note-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-mapbox { margin-top: 20px; }
.detail-map {
    width: 100%;
    height: 240px;
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    overflow: hidden;
    isolation: isolate; /* Leaflet-z-index nicht ueber Tab- und Aktionsleiste */
    background: var(--surface);
}
.detail-map-note {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--muted);
}
.detail-map-note a { color: var(--field); }
.detail-delete { padding-top: 4px; }
.mobile-only { display: none; }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 20, 18, .94);
}
.lightbox-img {
    max-width: 94vw;
    max-height: 88vh;
    max-height: 88dvh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    cursor: pointer;
    user-select: none;
}
.lightbox-close, .lightbox-nav {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    transition: background-color .12s;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox-close { top: 14px; right: 14px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
    position: absolute;
    bottom: calc(14px + var(--safe-b));
    left: 50%;
    transform: translateX(-50%);
    color: #E5EAE7;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}
.lightbox :focus-visible { outline-color: #9BD3C1; }

/* ---------- Bewerten ---------- */
body.page-swipe .page {
    display: flex;
    flex-direction: column;
    max-width: 620px;
    height: calc(100vh - var(--header-h) - var(--bottom-ui));
    height: calc(100dvh - var(--header-h) - var(--bottom-ui));
    padding-top: 10px;
    padding-bottom: 12px;
}
.swipe-wrap, .swipe-stage {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.swipe-stage { gap: 8px; }
.swipe-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    flex: none;
}
.swipe-remaining { color: var(--muted); font-size: var(--fs-sm); }
.swipe-remaining strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.swipe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.swipe-photo {
    position: relative;
    flex: 1 1 0;
    min-height: 150px;
    background: #DDE3DE;
    cursor: zoom-in;
}
.swipe-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.swipe-photo-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
}
.swipe-photo-nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(28, 40, 36, .5);
    color: #fff;
    transform: translateY(-50%);
    opacity: .85;
}
.swipe-photo-nav:hover { opacity: 1; background: rgba(28, 40, 36, .7); }
.swipe-photo-prev { left: 8px; }
.swipe-photo-next { right: 8px; }
.swipe-photo-counter {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 7px;
    border-radius: var(--r-ctl);
    background: rgba(28, 40, 36, .7);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.swipe-score { position: absolute; left: 8px; top: 8px; }
.swipe-stamp {
    position: absolute;
    top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    border: 2px solid;
    border-radius: var(--r-ctl);
    background: rgba(255, 255, 255, .92);
    font-size: var(--fs-lg);
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
}
.swipe-stamp-yes { right: 14px; color: var(--field); }
.swipe-stamp-no { left: 14px; color: var(--no); }
.swipe-stamp .icon { vertical-align: 0; }

.swipe-body {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 58%;
    padding: 12px 14px;
    overflow-y: auto;
}
.swipe-body > * { flex-shrink: 0; }
.swipe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.swipe-title { font-size: var(--fs-lg); line-height: 1.25; }
.swipe-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.price-mid {
    font-size: var(--fs-lg);
    font-weight: 650;
    font-stretch: 87.5%;
    line-height: 1.25;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.swipe-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 12px;
    margin-top: -4px;
    font-size: var(--fs-sm);
}
.swipe-place { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.swipe-place .icon { color: var(--muted); }
.swipe-place .muted { margin-left: 6px; }
.swipe-orig {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--fs-xs);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.facts-chips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: var(--fs-sm);
}
.facts-chips .fact {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-weight: 560;
}
.facts-chips .fact > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.facts-chips .icon { color: var(--muted); }
.swipe-ai { color: #34403B; font-size: var(--fs-sm); line-height: 1.45; }
.swipe-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    font-size: var(--fs-sm);
}
.swipe-links .muted:nth-child(2) { margin-right: auto; }

.swipe-controls { flex: none; display: flex; flex-direction: column; gap: 6px; }
.swipe-reason > summary {
    display: inline-flex;
    padding: 2px 0;
    color: var(--muted);
    font-size: var(--fs-sm);
    cursor: pointer;
}
.swipe-reason > summary:hover { color: var(--ink); }
.swipe-reason[open] > summary { margin-bottom: 4px; }
.swipe-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
}
.swipe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid;
    border-radius: var(--r-panel);
    background: var(--surface);
    font-size: var(--fs-lg);
    font-weight: 650;
    transition: background-color .12s, color .12s;
}
.swipe-no { border-color: var(--no); color: var(--no); }
.swipe-no:hover { background: var(--no); color: #fff; }
.swipe-yes { border-color: var(--field); background: var(--field); color: #fff; }
.swipe-yes:hover { background: var(--field-dark); border-color: var(--field-dark); }
.swipe-skip { border-color: var(--line-strong); color: var(--muted); font-size: var(--fs-sm); font-weight: 560; }
.swipe-skip:hover { color: var(--ink); border-color: #A9B3AD; }
.swipe-hint {
    flex: none;
    margin-top: 8px;
    color: var(--muted);
    font-size: var(--fs-xs);
    text-align: center;
}
@media (hover: none), (pointer: coarse) { .swipe-hint { display: none; } }

.swipe-empty {
    margin: auto 0;
    padding: 36px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    text-align: center;
}
.swipe-empty h1 { font-size: var(--fs-xl); }
.swipe-empty p { margin-top: 10px; color: var(--muted); }
.swipe-empty-actions { display: flex; justify-content: center; gap: 8px; }

/* ---------- Karte ---------- */
body.page-map .page {
    max-width: none;
    height: calc(100vh - var(--header-h) - var(--bottom-ui));
    height: calc(100dvh - var(--header-h) - var(--bottom-ui));
    padding: 0;
}
.mapwrap { position: relative; height: 100%; }
.listing-map { position: absolute; inset: 0; background: #E5E9E5; }
.leaflet-container { font-family: var(--font); }

.seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}
.seg a {
    padding: 5px 11px;
    border-radius: var(--r-ctl);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 580;
    white-space: nowrap;
}
.seg a:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.seg a[aria-current="page"] { background: var(--field); color: #fff; }
.map-filter { position: absolute; top: 12px; left: 12px; z-index: 500; }

.map-legend {
    position: absolute;
    left: 12px;
    bottom: 22px;
    z-index: 500;
    padding: 8px 10px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-panel);
    font-size: var(--fs-xs);
}
.map-legend ul { display: grid; grid-template-columns: repeat(3, auto); gap: 3px 14px; }
.map-legend li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.map-legend p { margin-top: 5px; color: var(--muted); }
.dot { flex: none; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(28, 40, 36, .25); }
.dot-high { background: var(--score-high); }
.dot-mid { background: var(--score-mid); }
.dot-low { background: var(--score-low); }
.dot-none { background: var(--score-none); }
.dot-liked { background: var(--surface); border: 2.5px solid var(--ink); box-shadow: none; }
.dot-approx { background: #C8CFCA; border: 1.5px dashed var(--muted); box-shadow: none; }

.leaflet-marker-icon.map-cluster {
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 650;
    box-shadow: 0 0 0 1px rgba(28, 40, 36, .3);
}
.hf-popup .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: var(--r-panel); }
.hf-popup .leaflet-popup-content { width: 260px !important; margin: 0; font-size: var(--fs-sm); line-height: 1.4; }
/* Leaflet-Regeln (.leaflet-container a ...) sind spezifischer und werden nach style.css geladen */
.leaflet-container .hf-popup a.leaflet-popup-close-button {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font: 18px/24px var(--font);
    box-shadow: 0 0 0 1px rgba(28, 40, 36, .12);
}
.leaflet-container .hf-popup a.leaflet-popup-close-button:hover { color: var(--no); background: #fff; }
.map-popup .mp-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mp-body { display: grid; gap: 3px; padding: 10px 12px 12px; }
.leaflet-container .mp-title { color: var(--ink); font-weight: 650; font-size: var(--fs-md); }
.leaflet-container .mp-title:hover { color: var(--field-dark); }
.mp-orig { overflow: hidden; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
.mp-price { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.mp-price strong { font-size: var(--fs-lg); font-weight: 650; font-stretch: 87.5%; font-variant-numeric: tabular-nums; }
.mp-facts, .mp-meta { display: flex; flex-wrap: wrap; gap: 0 10px; }
.mp-facts { font-weight: 560; font-stretch: 87.5%; }
.mp-meta { color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Status ---------- */
.tiles {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
}
.tile-value { font-size: var(--fs-xl); font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: var(--fs-xs); }
.scrape-log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.scrape-state { font-weight: 600; }
.scrape-state.is-running { color: var(--field-dark); }
.run-error { max-width: 420px; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
.devlog-url { max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.panel-details > summary { cursor: pointer; font-weight: 600; }
.panel-details > summary .muted { margin-left: 6px; font-weight: 400; font-size: var(--fs-sm); }
.panel-details[open] > summary { margin-bottom: 10px; }

/* ---------- Einstellungen ---------- */
.settings { display: grid; gap: 12px; }
.setsec {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
}
.setsec-head h2 { font-size: var(--fs-lg); }
.setsec-head p { margin-top: 6px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.setsec-body { display: grid; gap: 18px; min-width: 0; }
.fieldsets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.disclosure > summary { color: var(--field); font-size: var(--fs-sm); font-weight: 560; cursor: pointer; }
.disclosure[open] > summary { margin-bottom: 8px; }
.savebar {
    position: sticky;
    bottom: var(--bottom-ui);
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 4px calc(-1 * var(--gutter)) 0;
    padding: 12px var(--gutter);
    background: rgba(242, 244, 241, .96);
    border-top: 1px solid var(--line);
}

/* ---------- Login ---------- */
.login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
}
.login-panel {
    width: min(360px, 100%);
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
}
.login-brand { margin-bottom: 16px; font-size: var(--fs-xl); }
.login-panel form { display: grid; gap: 14px; }

/* =========================================================
   Desktop >= 1000px: Liste als ausgerichtete Tabelle
   ========================================================= */
@media (min-width: 1000px) {
    .ltable {
        --cols: 22px 112px minmax(0, 1fr) 96px 60px 64px 64px 34px 48px 48px 48px 72px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r-panel);
    }
    .ltable.no-km { --cols: 22px 112px minmax(0, 1fr) 96px 60px 64px 64px 34px 48px 48px 72px; }

    .lhead, .lrow {
        display: grid;
        grid-template-columns: var(--cols);
        grid-template-rows: none;
        grid-template-areas: none;
        column-gap: 12px;
        align-items: center;
        padding: 0 14px 0 12px;
    }
    .lhead {
        position: sticky;
        top: var(--header-h);
        z-index: 5;
        height: 38px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        border-radius: var(--r-panel) var(--r-panel) 0 0;
        color: var(--muted);
        font-size: var(--fs-xs);
        font-weight: 600;
    }
    .lhead > * { white-space: nowrap; }
    .lhead .c-main { display: flex; align-items: center; gap: 12px; }
    .lhead .c-price, .lhead .c-ppsqm, .lhead .c-area, .lhead .c-lot, .lhead .c-rooms,
    .lhead .c-year, .lhead .c-km, .lhead .c-score { justify-self: end; text-align: right; }
    .lhead .c-score { justify-self: center; }
    .sort {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        color: var(--muted);
        border-radius: 4px;
    }
    .sort:hover { color: var(--ink); text-decoration: none; }
    .sort.is-active { color: var(--field-dark); }
    .sort-arrow { width: 12px; height: 12px; vertical-align: 0; }
    .sort-inline { font-weight: 500; }

    .lrow {
        min-height: 92px;
        padding-top: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--line);
        background: transparent;
    }
    .lrows > .lrow:last-child { border-bottom: 0; border-radius: 0 0 var(--r-panel) var(--r-panel); }
    .lrow:hover { background: var(--hover); }
    .lrow:has(.cmp-toggle:checked) { background: var(--field-tint); }

    .ltable .lrow > *, .ltable .lrow-link, .ltable .lrow-meta { grid-area: auto; }
    .lrow .c-thumb { width: 112px; height: 76px; }
    .lrow .c-main {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }
    .lrow-link { font-size: var(--fs-md); }
    .lrow-orig {
        display: block;
        overflow: hidden;
        color: var(--muted);
        font-size: var(--fs-sm);
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .lrow-meta { align-self: flex-start; margin-top: 1px; flex-wrap: nowrap; }
    .lrow.has-pc .lrow-orig { display: none; }
    /* Pro/Contra als zweite Zeile ueber die volle Breite unter Titel und Zahlen */
    .ltable .lrow.has-pc > .c-select, .ltable .lrow.has-pc > .c-thumb { grid-row: 1 / span 2; }
    .ltable .lrow-pc {
        margin-top: 0;
        grid-row: 2;
        grid-column: 3 / -1;
        align-self: start;
        padding-bottom: 8px;
        font-size: var(--fs-sm);
    }
    .ltable .lrow.has-pc > .c-main { align-self: end; }

    .lrow .c-money, .lrow .c-facts { display: contents; }
    .lrow .c-price {
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
        justify-self: end;
        font-size: var(--fs-md);
        font-weight: 620;
    }
    .lrow .c-ppsqm, .lrow .c-facts > span {
        justify-self: end;
        text-align: right;
        color: var(--ink);
        font-size: var(--fs-md);
        font-weight: 560;
        font-stretch: 87.5%;
    }
    .lrow .c-ppsqm { color: #3C4843; }
    .lrow .c-facts .icon, .lrow .cur, .lrow .unit { display: none; }
    .lrow .c-facts .is-empty, .lrow .c-ppsqm.is-empty { display: inline-flex; color: #A5AEA9; font-weight: 400; }
    .no-km .c-km { display: none !important; }

    .lrow .c-score { justify-self: center; align-self: center; margin: 0; }
    .lrow .c-score .score { box-shadow: none; }
    .lrow .c-score .score-none { display: inline-grid; }

    .lrow .c-select {
        justify-self: start;
        align-self: center;
        width: 22px;
        height: 22px;
        margin: 0;
        background: transparent;
    }
    .lrow .c-actions { align-self: center; justify-self: end; }
}

/* Unter 1000px gibt es keine Spaltenkoepfe: Sortierung als kompaktes Select */
@media (max-width: 999.98px) {
    .sort-select { display: flex; align-items: center; gap: 4px; }
    .sort-select .sort-dir { flex: none; }
    .sort-select select {
        width: auto;
        max-width: 132px;
        height: 32px;
        padding-left: 8px;
        padding-right: 26px;
        background-position: right 6px center;
        font-size: 16px;
    }
}

/* =========================================================
   Tablet 720–999px: Kartenzeilen zweispaltig
   ========================================================= */
@media (min-width: 720px) and (max-width: 999.98px) {
    .topbar-inner { gap: 16px; }
    .brand-profile { display: none; }
    .mainnav a { padding: 0 8px; }
    /* Status/Einstellungen/Abmelden passen neben vier Hauptlinks nicht mehr: Menue statt Textlinks */
    .subnav { display: none; }
    .topbar-more { display: block; margin-left: auto; }
    .lrows {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .lrow { border: 1px solid var(--line); border-radius: var(--r-panel); }
    .lrow.is-liked { box-shadow: inset 3px 0 0 var(--field); }
    .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
    .detail-title { font-size: var(--fs-xl); }
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .setsec { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
}

/* =========================================================
   Handy < 720px
   ========================================================= */
@media (max-width: 719.98px) {
    .mainnav, .subnav { display: none; }
    .topbar-inner { gap: 12px; }

    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        height: calc(var(--tabbar-h) + var(--safe-b));
        padding-bottom: var(--safe-b);
        background: var(--surface);
        border-top: 1px solid var(--line);
    }
    .tab-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        height: var(--tabbar-h);
        color: var(--muted);
        font-size: 11.5px;
        font-weight: 560;
        list-style: none;
        cursor: pointer;
    }
    .tab-item::-webkit-details-marker { display: none; }
    .tab-item:hover { text-decoration: none; color: var(--ink); }
    .tab-item[aria-current="page"] { color: var(--field); }
    .tab-item .icon { vertical-align: 0; }
    .tab-icon { position: relative; display: inline-flex; }
    .badge-dot {
        position: absolute;
        top: -5px;
        left: 14px;
        min-width: 17px;
        height: 17px;
        margin: 0;
        padding: 0 4px;
        border: 2px solid var(--surface);
        background: var(--field);
        color: #fff;
        font-size: 10.5px;
        box-sizing: content-box;
    }
    .tab-more { position: static; }
    .tab-more[open] > .tab-item { color: var(--ink); }
    .menu-up { right: 8px; bottom: calc(100% + 8px); min-width: 210px; }
    .menu-up a { padding: 11px 12px; font-size: var(--fs-md); }

    .tray {
        left: 8px;
        right: 8px;
        bottom: calc(8px + var(--bottom-ui));
        transform: none;
        padding-left: 14px;
    }
    .tray-count { margin-right: auto; }
    .tray-clear-label { display: none; }
    .tray [data-compare-clear] { width: 32px; padding: 0; color: #C9D2CD; }

    .page { padding-top: 0; }
    .pagehead { margin-top: 12px; }
    .pagehead h1 { font-size: var(--fs-lg); }

    /* Liste */
    .listbar {
        position: sticky;
        top: var(--header-h);
        z-index: 10;
        gap: 8px;
        margin: 0 calc(-1 * var(--gutter)) 0;
        padding: 0 var(--gutter);
        background: var(--paper);
    }
    .tabs {
        flex: 1 1 auto;
        gap: 18px;
        padding-right: 16px;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
    }
    .tab { padding: 11px 0 10px; }
    .tab-archive { display: inline-flex; }
    .archive { display: none; }
    .listbar-end { gap: 6px; padding-bottom: 5px; flex: none; }
    .listbar-end .btn span { display: none; }
    .listbar-end .btn { width: 32px; padding: 0; }
    .ltable { margin: 0 calc(-1 * var(--gutter)); }
    .lrow { border-bottom: 1px solid var(--line); }
    .lrow:hover { background: var(--surface); }
    .lrow:has(.cmp-toggle:checked) { background: var(--field-tint); }
    .empty { margin-top: 16px; }

    /* Vergleich */
    .cmp { --label-w: 92px; width: max(100%, calc(var(--label-w) + var(--cols) * 180px)); font-size: var(--fs-sm); }
    .cmp th, .cmp td { padding: 8px 10px; }
    .cmp-label { font-size: var(--fs-xs); }
    .cmp-remove { top: 16px; right: 16px; }
    .cmp-scroll { margin: 0 calc(-1 * var(--gutter)); border-radius: 0; border-left: 0; border-right: 0; }
    .page-compare .pagehead-actions .btn:not([data-compare-clear]) { display: none; }

    /* Detail */
    .page-detail .backlink { display: none; }
    .detail { display: block; }
    .detail-media { margin: 0 calc(-1 * var(--gutter)); }
    .gallery-main { border-radius: 0; }
    .thumbs { padding: 2px var(--gutter) 4px; }
    .thumb { width: 64px; height: 44px; }
    .detail-side { margin-top: 12px; }
    .detail-sticky { position: static; }
    .detail-title { font-size: 1.5rem; }
    .price-big { font-size: 1.6rem; }
    .mobile-only { display: inline-flex; }
    .decision {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--bottom-ui);
        z-index: 50;
        margin: 0;
        padding: 8px var(--gutter);
        background: var(--surface);
        border-top: 1px solid var(--line);
    }
    .decision textarea { font-size: 16px; min-height: 64px; }
    .decision-notebtn { display: inline-flex; }
    .decision-actions { margin-top: 0; gap: 6px; }
    .decision-actions .btn { height: 44px; padding: 0 8px; font-size: var(--fs-sm); }
    .decision-actions .decision-notebtn { width: 44px; padding: 0; }
    .decision.has-note .decision-notebtn::after {
        content: "";
        position: absolute;
        top: 7px;
        right: 7px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--field);
        border: 1.5px solid var(--surface);
    }
    .decision-notebtn[aria-expanded="true"] { background: var(--field-tint); border-color: var(--field); color: var(--field); }
    /* Zugeklappt: nur Leiste; Status/Notiz erst im aufgeklappten Zustand */
    .decision:not(.is-open) textarea,
    .decision:not(.is-open) .decision-status,
    .decision:not(.is-open) .decision-title,
    .decision:not(.is-open) .decision-reset { display: none; }
    .decision.is-open .decision-head { margin-bottom: 6px; }
    .decision.is-open textarea { margin-bottom: 8px; }
    /* Rueckmeldung als kleine Meldung ueber der Leiste */
    .decision:not(.is-open) .decision-head { position: absolute; left: var(--gutter); bottom: calc(100% + 8px); margin: 0; min-height: 0; }
    .decision:not(.is-open) .decision-flash {
        padding: 6px 12px;
        border-radius: 999px;
        background: var(--ink);
        color: #fff;
        font-size: var(--fs-sm);
    }
    .page-detail .page { padding-bottom: calc(96px + var(--bottom-ui)); }
    body.page-detail.has-tray .page { padding-bottom: calc(96px + var(--bottom-ui)); }
    .page-detail .tray { display: none; }
    .factlist { gap: 10px 14px; }
    .kv { grid-template-columns: minmax(0, 110px) minmax(0, 1fr); gap: 6px 12px; }
    .detail-more { margin-top: 28px; gap: 24px; }

    /* Bewerten */
    .page-swipe .page { padding-top: 6px; padding-bottom: 8px; }
    .swipe-body { padding: 10px 12px; gap: 6px; }
    .swipe-btn { height: 48px; }
    .swipe-skip span { display: none; }
    .swipe-skip { width: 52px; padding: 0; }

    /* Karte */
    .map-filter { top: 8px; left: 8px; right: 8px; }
    .seg a { padding: 5px 9px; }
    .map-legend { left: 8px; bottom: 18px; padding: 6px 8px; }
    .map-legend ul { grid-template-columns: repeat(2, auto); gap: 2px 12px; }
    .leaflet-top.leaflet-right { top: 48px; }

    /* Status */
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .panel { padding: 14px 12px; }
    .tbl .hide-m { display: none; }
    .tbl-compact th, .tbl-compact td { padding-left: 6px; padding-right: 6px; }

    /* Einstellungen */
    .setsec { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 14px; }
    .fields-3, .fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fieldsets { grid-template-columns: minmax(0, 1fr); }
    .checks-2 { grid-template-columns: minmax(0, 1fr); }
    .checks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .savebar { justify-content: stretch; }
    .savebar .btn { flex: 1 1 0; padding: 0 8px; font-size: var(--fs-sm); white-space: normal; line-height: 1.15; }
}

/* =========================================================
   Listenfilter: Seitenleiste ab 1200px, darunter Dialog
   ========================================================= */
/* 1000–1439px: schmalere Zahlenspalten, damit der Titel neben der Filterleiste Platz hat */
@media (min-width: 1000px) and (max-width: 1439.98px) {
    .ltable { --cols: 20px 88px minmax(0, 1fr) 84px 50px 52px 50px 26px 38px 34px 42px 68px; }
    .ltable.no-km { --cols: 20px 88px minmax(0, 1fr) 84px 50px 52px 50px 26px 38px 42px 68px; }
    .lhead, .lrow { column-gap: 8px; padding-left: 10px; padding-right: 10px; }
    .lrow { min-height: 76px; }
    .lrow .c-thumb { width: 88px; height: 60px; }
    .lrow .c-select { width: 20px; }
    .lrow .c-actions { gap: 4px; }
    .lhead .c-main { gap: 8px; }
}
@media (min-width: 1200px) {
    body.page-list { --maxw: 1560px; }
    .listpage {
        display: grid;
        grid-template-columns: 256px minmax(0, 1fr);
        gap: 20px;
        align-items: start;
    }
    .filters {
        position: sticky;
        top: calc(var(--header-h) + 16px);
        z-index: 1;
        width: auto;
        max-height: calc(100vh - var(--header-h) - 32px);
        max-height: calc(100dvh - var(--header-h) - 32px);
        border: 1px solid var(--line);
        border-radius: var(--r-panel);
        box-shadow: none;
        transform: none;
        visibility: visible;
        transition: none;
    }
    .filters-head { min-height: 0; padding: 12px 16px 0; border-bottom: 0; }
    .filters-title { font-size: var(--fs-md); }
    .filters-close, .filters-foot, .filters-backdrop, .filter-open { display: none; }
    .filters-body { padding: 8px 16px 4px; scrollbar-width: thin; }
    body.filters-open { overflow: auto; }
}
/* Schmales Tablet und Handy: Filter-Button nur mit Icon, Anzahl als Plakette an der Ecke */
@media (max-width: 899.98px) {
    .filter-open { width: 32px; padding: 0; }
    .filter-open > span:not(.filter-count) { display: none; }
    .listbar-end .btn span.filter-count {
        display: inline-grid;
        position: absolute;
        top: -9px;
        right: -9px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border: 2px solid var(--paper);
        font-size: 10.5px;
        box-sizing: content-box;
    }
}
@media (min-width: 1440px) {
    .listpage { grid-template-columns: 272px minmax(0, 1fr); gap: 24px; }
    .page-list .lhead, .page-list .lrow { column-gap: 10px; }
}
@media (max-width: 719.98px) {
    .filters { width: 100%; border-left: 0; box-shadow: none; transform: translateY(100%); }
    .filters input[type="number"], .filters input[type="search"], .filters select { font-size: 16px; }
    .fopt, .check { min-height: 36px; }
    .fchip { height: 34px; }
    .resultbar { margin-top: 10px; }
    .result-links { gap: 4px 14px; }
}

@media (max-width: 419.98px) {
    .fields-2 { grid-template-columns: minmax(0, 1fr); }
    .facts-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .decision-flash { animation: none !important; }
    *, *::before, *::after {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* KI-Begruendung: "Pro: …" und "Contra: …" je eine Zeile */
.ai-text {
    white-space: pre-line;
}

/* Zusammengefasste Inserate: Plattformen eines Hauses */
.srcs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.srcs .src + .src::before { content: ", "; }
.srcs .src-more { margin-left: 6px; color: var(--ink); }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.src-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.detail-links .linkbtn-quiet .muted { margin-left: 2px; }

/* Nicht ladbare Bilder: Platzhalter statt Browser-Symbol (app.js) */
img.img-broken { visibility: hidden; }
.has-broken-img { position: relative; background: #E6EBE7; }
.has-broken-img::after {
    content: "Bild nicht verfügbar";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 4px;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    pointer-events: none;
}
