/* ============================================================
   NETTOZEIT — "Sandglass (Cool)" Design System
   Warm-editorial identity on a cool, low-glare neutral base.
   Semantics:  terracotta = Kosten / Aktion   ·   petrol-green = Sparen / Belohnung
   ============================================================ */

:root {
    /* Accent — muted terracotta (Kosten / Aktion) */
    --primary:       #b5623f;
    --primary-dark:  #9a5134;
    --primary-light: #e4d5cb;
    --secondary:     #a55840;

    /* Cool neutral base — dimmed, no pure white */
    --bg-gradient: linear-gradient(180deg, #d8dde4 0%, #ccd3db 100%);
    --card-bg:     #e9ecf0;
    --surface-2:   #dde2e8;
    --text-main:   #1f2733;
    --text-light:  #5d6875;
    --line-color:  #c3cbd4;
    --sidebar-bg:  #dde2e8;

    /* Semantic */
    --success:       #2f6f5e;   /* Sparen / Belohnung */
    --success-light: #d3e2da;
    --danger:        #c04f46;
    --danger-light:  #ead4d1;

    /* Deep display card (Stundenlohn) — cool & calm, not bright */
    --display-card: linear-gradient(135deg, #2c3644 0%, #1f2733 100%);
    --display-hi:   #ec9871;    /* warm highlight on the dark card */

    /* Footer */
    --footer-bg:   #1f2733;
    --footer-text: #c3ccd6;

    /* Elevation — soft, cool-tinted */
    --shadow-sm: 0 1px 2px rgba(31,39,51,0.05);
    --shadow-md: 0 12px 30px -18px rgba(31,39,51,0.28);
    --shadow-lg: 0 22px 48px -22px rgba(31,39,51,0.34);

    /* Type */
    --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --radius: 18px;
}

/* Dark theme — warm charcoal, same accents */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary:       #d47e5d;
        --primary-dark:  #bd6a48;
        --primary-light: #3a2a22;
        --secondary:     #c47053;
        --bg-gradient:   linear-gradient(180deg, #181d23 0%, #121519 100%);
        --card-bg:       #1e242b;
        --surface-2:     #242b33;
        --text-main:     #e8edf2;
        --text-light:    #98a3b0;
        --line-color:    #303a45;
        --sidebar-bg:    #191e24;
        --success:       #57b89c;
        --success-light: #1e2d29;
        --danger:        #e07a71;
        --danger-light:  #37231f;
        --display-card:  linear-gradient(135deg, #242d38 0%, #1a2029 100%);
        --footer-bg:     #12161b;
        --footer-text:   #aab4bf;
        --shadow-md:     0 14px 34px -20px rgba(0,0,0,0.6);
        --shadow-lg:     0 24px 50px -22px rgba(0,0,0,0.7);
    }
}
/* Explicit manual overrides win in both directions */
:root[data-theme="light"] {
    --primary:#b5623f; --primary-dark:#9a5134; --primary-light:#e4d5cb; --secondary:#a55840;
    --bg-gradient:linear-gradient(180deg,#d8dde4 0%,#ccd3db 100%);
    --card-bg:#e9ecf0; --surface-2:#dde2e8; --text-main:#1f2733; --text-light:#5d6875;
    --line-color:#c3cbd4; --sidebar-bg:#dde2e8;
    --success:#2f6f5e; --success-light:#d3e2da; --danger:#c04f46; --danger-light:#ead4d1;
    --display-card:linear-gradient(135deg,#2c3644 0%,#1f2733 100%);
    --footer-bg:#1f2733; --footer-text:#c3ccd6;
    --shadow-md:0 12px 30px -18px rgba(31,39,51,0.28);
}
:root[data-theme="dark"] {
    --primary:#d47e5d; --primary-dark:#bd6a48; --primary-light:#3a2a22; --secondary:#c47053;
    --bg-gradient:linear-gradient(180deg,#181d23 0%,#121519 100%);
    --card-bg:#1e242b; --surface-2:#242b33; --text-main:#e8edf2; --text-light:#98a3b0;
    --line-color:#303a45; --sidebar-bg:#191e24;
    --success:#57b89c; --success-light:#1e2d29; --danger:#e07a71; --danger-light:#37231f;
    --display-card:linear-gradient(135deg,#242d38 0%,#1a2029 100%);
    --footer-bg:#12161b; --footer-text:#aab4bf;
    --shadow-md:0 14px 34px -20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
body {
    font-family: var(--sans);
    margin: 0; min-height: 100vh;
    display: flex; flex-direction: column;
    background: var(--bg-gradient);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}
.num, input, .wage-val, .hero-val, .summary-val { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* HEADER */
header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--card-bg) 82%, transparent);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    padding: 0.85rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--line-color);
}
.logo { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 11px; cursor: pointer; color: var(--text-main); }
.logo-img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
/* Marken-Badge: Gradient ist Markenkonstante (Logo-Spec), kein Theme-Token */
.logo-badge { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #c9622b, #e0894f); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 14px -6px rgba(201,98,43,0.55); }
.logo-text { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; letter-spacing: -0.01em; }
.logo-text .accent { color: var(--primary); }
.logo-icon { background: var(--primary); color: #fff; padding: 6px; border-radius: 9px; font-size: 1.2rem; }

.header-actions { display: flex; align-items: center; gap: 10px; }
nav { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line-color); padding: 4px; border-radius: 100px; }
.nav-btn {
    background: transparent; border: 1px solid transparent; color: var(--text-light);
    padding: 8px 17px; border-radius: 100px; cursor: pointer; font-weight: 600; font-size: 0.9rem;
    font-family: var(--sans); transition: color .2s, background .2s;
}
.nav-btn:hover { color: var(--text-main); }
.nav-btn.active { background: var(--card-bg); color: var(--primary); font-weight: 700; box-shadow: var(--shadow-sm); }

.theme-toggle {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid var(--line-color); background: var(--card-bg); color: var(--text-main);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color .2s, transform .1s;
}
.theme-toggle:hover { border-color: var(--primary); }
.theme-toggle:active { transform: scale(0.93); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* Mobile Menu Button */
.mobile-menu-btn { display: none; background: transparent; border: none; color: var(--text-main); font-size: 1.7rem; cursor: pointer; }

/* LAYOUT */
.main-container { flex: 1; padding: 0 20px 40px 20px; width: 100%; max-width: 1300px; margin: 0 auto; overflow: hidden; }
.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active-view { display: block; }
.page-grid { display: grid; grid-template-columns: 1fr; gap: 25px; width: 100%; padding-top: 25px; align-items: start; }
@media (min-width: 1000px) { .page-grid { grid-template-columns: 1fr 1.1fr; } }
.salary-container { max-width: 900px; margin: 25px auto 0; background: var(--card-bg); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-color); padding: 40px; }

/* CONTAINERS */
.home-card { background: var(--card-bg); border-radius: 22px; border: 1px solid var(--line-color); padding: 28px; box-shadow: var(--shadow-md); animation: fadeIn 0.4s ease; }
h2 { margin-top: 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 600; color: var(--text-main); display: flex; align-items: center; letter-spacing: -0.01em; text-wrap: balance; }
p.desc { color: var(--text-light); font-size: 0.95rem; margin-bottom: 25px; line-height: 1.5; }
.input-group { margin-bottom: 18px; position: relative; }
label { display: flex; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
input, select {
    width: 100%; padding: 13px 14px; border: 1.5px solid var(--line-color); border-radius: 12px;
    font-size: 1rem; font-family: inherit; background: var(--surface-2); color: var(--text-main); transition: 0.2s;
}
input::placeholder { color: var(--text-light); opacity: 0.75; }
input:focus, select:focus { outline: none; border-color: var(--primary); background: var(--card-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input-row { display: flex; gap: 15px; } .input-row > div { flex: 1; }
.input-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.btn-calc {
    width: 100%; padding: 16px; background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none; border-radius: 14px; font-size: 1.05rem; font-weight: 700; font-family: var(--sans);
    cursor: pointer; margin-top: 20px; transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 75%, transparent);
}
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn-calc:active { transform: scale(0.98); }

/* TOOLTIPS */
.info-wrapper { display: inline-block; position: relative; margin-left: 8px; }
.info-icon { display: flex; justify-content: center; align-items: center; width: 20px; height: 20px; background: var(--surface-2); color: var(--text-light); border: 1px solid var(--line-color); border-radius: 50%; font-size: 0.75rem; font-weight: 700; cursor: help; }
.info-icon:hover { background: var(--primary); color: white; border-color: var(--primary); }
.tooltip-box { visibility: hidden; width: 250px; background-color: #101720; color: #fff; text-align: center; border-radius: 10px; padding: 12px; position: absolute; z-index: 100; top: 135%; left: 50%; margin-left: -125px; opacity: 0; transition: 0.3s; font-size: 0.8rem; pointer-events: none; box-shadow: var(--shadow-lg); }
.tooltip-box::after { content: ""; position: absolute; bottom: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: transparent transparent #101720 transparent; }
.info-wrapper:hover .tooltip-box { visibility: visible; opacity: 1; }
.tooltip-wide { width: 300px; margin-left: -150px; text-align: left; }
.tooltip-list { margin: 0; padding-left: 15px; margin-top: 5px; } .tooltip-list li { margin-bottom: 4px; }

/* CART & SEARCH */
.search-container { position: relative; margin-bottom: 15px; display: flex; gap: 10px; }
.search-input-wrapper { position: relative; flex: 1; }
.search-input { width: 100%; padding-left: 40px !important; border-color: color-mix(in srgb, var(--primary) 40%, var(--line-color)) !important; cursor: pointer; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-light); pointer-events: none; display: flex; align-items: center; }
.btn-add-manual { background: var(--surface-2); color: var(--text-main); border: 1px solid var(--line-color); border-radius: 12px; padding: 0 15px; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: 0.9rem; }
.btn-add-manual:hover { border-color: var(--primary); color: var(--primary); }
.cart-container { background: var(--surface-2); border: 1px dashed var(--line-color); border-radius: 14px; padding: 15px; margin-bottom: 20px; }
.cart-header { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; margin-bottom: 10px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-light); padding: 0 5px; }
.cart-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; margin-bottom: 10px; align-items: center; background: var(--card-bg); padding: 10px; border-radius: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--line-color); animation: slideIn 0.3s ease; }
.cart-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.btn-shop { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 0.85rem; font-weight: 700; text-decoration: none; line-height: 1; white-space: nowrap; box-shadow: var(--shadow-sm); transition: filter .15s, transform .1s, box-shadow .15s; }
.btn-shop svg { width: 14px; height: 14px; }
.btn-shop:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }
.btn-shop:active { transform: translateY(0); filter: brightness(0.96); }
.cart-input { width: 100%; padding: 8px; font-size: 0.9rem; border: 1px solid var(--line-color); border-radius: 8px; background: var(--surface-2); color: var(--text-main); }
.input-with-label { position: relative; }
.input-label-tiny { position: absolute; top: -6px; left: 6px; z-index: 3; background: var(--card-bg); padding: 0 4px; font-size: 0.65rem; color: var(--text-light); font-weight: 600; border-radius: 3px; pointer-events: none; }
.btn-remove { background: var(--danger-light); color: var(--danger); border: none; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1.1rem; line-height: 0; }
.cart-summary { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: var(--card-bg); border-radius: 12px; border: 1px solid var(--line-color); margin-top: 15px; }
.summary-label { font-size: 0.78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.summary-val { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--text-main); }
.empty-state { text-align: center; padding: 20px; color: var(--text-light); }

/* Worker Layout */
.worker-layout { margin-top: 20px; }

/* RESULTS */
#fixcost-feedback { margin-top: 8px; font-size: 0.78rem; padding: 8px 12px; width: 100%; display: none; border-radius: 10px; }
.feedback-good { background: var(--success-light); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); display: block !important; }
.feedback-bad { background: var(--danger-light); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); display: block !important; }
.result-container { display: none; margin-top: 30px; border-top: 2px dashed var(--line-color); padding-top: 20px; }

/* Stundenlohn — deep cool display card */
#wage-display-area { background: var(--display-card); border-radius: 20px; padding: 20px 26px; box-shadow: var(--shadow-md); }
.wage-table { width: 100%; margin-bottom: 0; border-collapse: collapse; }
.wage-table td { padding: 13px 0; font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.13); }
.wage-table tr:last-child td { border-bottom: none; }
.wage-label { color: rgba(255,255,255,0.72); font-weight: 500; }
.wage-val { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; color: #fff; text-align: right; }
.signal-red { font-family: var(--serif); color: var(--display-hi) !important; font-weight: 600; font-size: 1.9rem; text-align: right; }

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.hero-box { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 16px; padding: 22px 10px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.hero-grid .hero-box:first-child { background: var(--primary-light); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.hero-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); font-weight: 700; margin-bottom: 6px; }
.hero-grid .hero-box:first-child .hero-label { color: var(--primary-dark); }
.hero-val { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; color: var(--primary); line-height: 1.1; }
.hero-grid .hero-box:not(:first-child) .hero-val { color: var(--text-main); }
.detail-footer { background: var(--surface-2); border-radius: 14px; border: 1px solid var(--line-color); overflow: hidden; }
.detail-item { padding: 12px 15px; border-bottom: 1px solid var(--line-color); display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--text-light); }
.detail-item:last-child { border-bottom: none; }
.detail-item.is-effective { background: var(--success-light); }
.val-highlight { font-weight: 700; color: var(--text-main); }

/* DECISION AREA */
.decision-area { margin-top: 25px; padding-top: 20px; border-top: 2px dashed var(--line-color); }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.btn-decision { padding: 15px; border: 1px solid transparent; border-radius: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.2s; text-align: left; font-family: var(--sans); }
.btn-decision span { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.btn-decision small { font-weight: 400; font-size: 0.8rem; opacity: 0.85; }
.d-icon { font-size: 1.5rem; }
.btn-save { background: var(--success); color: #fff; border-color: var(--success); }
.btn-save:hover { background: color-mix(in srgb, var(--success) 88%, #000); transform: translateY(-2px); box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--success) 60%, transparent); }
.btn-buy { background: var(--surface-2); color: var(--text-main); border-color: var(--line-color); }
.btn-buy:hover { border-color: var(--primary); transform: translateY(-2px); }

/* SHOP MODAL ROW */
.shop-link-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--line-color); border-radius: 10px; background: var(--card-bg); }
.shop-btn-external { background: var(--primary); color: white; text-decoration: none; padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; }
.shop-btn-external:hover { background: var(--primary-dark); }

/* AD SLOT — native placement */
.ad-slot { flex-shrink: 0; padding: 14px; background: var(--sidebar-bg); border-top: 1px solid var(--line-color); display: flex; flex-direction: column; gap: 6px; }
.ad-banner { margin-top: 25px; border: 1px solid var(--line-color); border-radius: 18px; background: var(--card-bg); }
.ad-label { font-size: 0.62rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-light); font-weight: 600; }
.ad-body { width: 100%; min-height: 96px; border: 1px dashed var(--line-color); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 0.85rem; background: var(--card-bg); }

/* SALARY STYLES */
.salary-result-wrapper { margin-top: 30px; border-top: 2px dashed var(--line-color); padding-top: 30px; }
.toggle-container { display: flex; justify-content: center; margin-bottom: 25px; }
.toggle-btn { padding: 10px 30px; border: 1px solid var(--line-color); background: var(--card-bg); cursor: pointer; font-weight: 600; color: var(--text-light); transition: 0.2s; }
.toggle-btn:first-child { border-radius: 10px 0 0 10px; border-right: none; }
.toggle-btn:last-child { border-radius: 0 10px 10px 0; border-left: none; }
.toggle-btn.active-mode { background: var(--primary); color: white; border-color: var(--primary); }
.salary-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.salary-table { width: 100%; border-collapse: collapse; }
.salary-table th { text-align: left; color: var(--text-light); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; padding-bottom: 10px; border-bottom: 2px solid var(--line-color); }
.salary-table td { padding: 12px 0; border-bottom: 1px solid var(--line-color); font-size: 0.95rem; color: var(--text-main); }
.salary-table .total-row td { font-family: var(--serif); font-weight: 600; color: var(--primary); font-size: 1.3rem; border-top: 2px solid var(--line-color); padding-top: 15px; }
.salary-table .real-netto-row td { background: var(--success-light); color: var(--success); font-weight: 700; }
.deduction-val { color: var(--danger); }
.salary-chart-wrap { position: relative; height: 300px; display: flex; justify-content: center; align-items: center; }

/* TRANSFER BUTTON */
.salary-transfer-box { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line-color); }
.btn-transfer { background: var(--success); color: white; border: none; padding: 15px 30px; border-radius: 12px; font-weight: 600; cursor: pointer; font-size: 1rem; font-family: var(--sans); transition: transform 0.2s, box-shadow .2s; box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--success) 60%, transparent); }
.btn-transfer:hover { transform: translateY(-2px); box-shadow: 0 14px 24px -10px color-mix(in srgb, var(--success) 65%, transparent); }

/* LISTS VIEW */
.lists-container { display: grid; grid-template-columns: 250px 1fr; gap: 0; background: var(--card-bg); border-radius: 22px; border: 1px solid var(--line-color); box-shadow: var(--shadow-md); overflow: hidden; min-height: 600px; margin-top: 25px; }
.lists-sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--line-color); padding: 20px; display: flex; flex-direction: column; }
.lists-content { padding: 30px; background: var(--card-bg); }
.btn-new-list { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; margin-bottom: 20px; transition: background .2s; }
.btn-new-list:hover { background: var(--primary-dark); }
.lists-nav { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.list-nav-item { padding: 12px; border-radius: 10px; cursor: pointer; font-size: 0.95rem; color: var(--text-main); transition: 0.2s; border: 1px solid transparent; }
.list-nav-item:hover { background: var(--surface-2); }
.list-nav-item.active { background: var(--card-bg); border-color: var(--primary); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.list-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid var(--line-color); }
.btn-delete-list { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; }
.btn-delete-list:hover { background: var(--danger-light); }
.list-items-wrapper { max-height: 300px; overflow-y: auto; margin-bottom: 20px; border: 1px solid var(--line-color); border-radius: 12px; padding: 10px; }
.list-item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line-color); }
.list-item-row .li-name { flex: 1 1 140px; min-width: 120px; }
.li-price-wrap { display: flex; align-items: center; gap: 5px; }
.li-price-wrap .stepper { width: 110px; }
.li-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.li-shop-btn {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    background: var(--primary-light); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.li-shop-btn:hover { background: var(--primary); color: #fff; }
.list-results-card { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 16px; padding: 20px; }
.lr-row { display: flex; justify-content: space-between; font-size: 1rem; margin-bottom: 10px; }
.lr-input-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.lr-input-row input { width: 120px; padding: 8px; text-align: right; font-weight: 600; }
.lr-divider { height: 1px; background: var(--line-color); margin: 15px 0; }
.lr-time-box { text-align: center; margin-top: 20px; background: var(--primary-light); padding: 16px; border-radius: 14px; color: var(--primary-dark); }
.lr-time-label { font-size: 0.85rem; font-weight: 600; }
.lr-time-val { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; margin: 5px 0; color: var(--primary); }
.lr-time-sub { font-size: 0.78rem; opacity: 0.85; }
.mini-salary-config { background: var(--card-bg); padding: 15px; border-radius: 12px; border: 1px solid var(--line-color); margin-bottom: 15px; }
/* Labels sauber ÜBER den Feldern statt in der Input-Box */
.mini-salary-config .input-label-tiny { position: static; display: block; margin-bottom: 5px; padding: 0; background: transparent; text-transform: uppercase; letter-spacing: 0.03em; }
.btn-link { background: var(--primary-light); color: var(--primary); border: none; padding: 6px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: background 0.2s; }
.btn-link:hover { background: color-mix(in srgb, var(--primary) 22%, var(--card-bg)); }

/* MODAL GLOBAL */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,20,26,0.55); z-index: 1000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); animation: fadeIn 0.2s ease; }
.modal-window { background: var(--card-bg); width: 90%; max-width: 900px; height: 80vh; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--line-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; color: var(--text-main); font-family: var(--serif); font-weight: 600; font-size: 1.25rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-light); }
.modal-close:hover { color: var(--danger); }
.modal-body { flex: 1; display: flex; overflow: hidden; }
.modal-sidebar { width: 200px; background: var(--sidebar-bg); border-right: 1px solid var(--line-color); padding: 20px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.cat-item { padding: 10px 15px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; color: var(--text-main); transition: all 0.2s; }
.cat-item:hover { background: var(--surface-2); }
.cat-item.active { background: var(--primary); color: white; font-weight: 600; }
.modal-content { flex: 1; display: flex; flex-direction: column; padding: 20px; background: var(--card-bg); overflow-y: auto; }
.modal-search-bar { position: relative; margin-bottom: 20px; }
.modal-search-bar input { width: 100%; padding: 12px 12px 12px 40px; border: 1.5px solid var(--line-color); border-radius: 10px; font-size: 1rem; }
.modal-search-bar input:focus { border-color: var(--primary); outline: none; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; overflow-y: auto; padding-bottom: 20px; }
.product-card { border: 1px solid var(--line-color); border-radius: 14px; padding: 15px; cursor: pointer; transition: all 0.2s; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--card-bg); }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 30%, var(--line-color)); }
.product-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary); }
.pc-icon { width: 56px; height: 56px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--primary-light); color: var(--primary-dark); font-family: var(--serif); font-size: 1.6rem; font-weight: 700; }
.pc-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 5px; line-height: 1.3; color: var(--text-main); }
.pc-price { color: var(--text-light); font-size: 0.9rem; }
.pc-check { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border: 2px solid var(--line-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; background: var(--card-bg); }
.product-card.selected .pc-check { background: var(--primary); border-color: var(--primary); }
.product-card.selected .pc-check::after { content: "✓"; color: white; font-size: 0.8rem; font-weight: bold; }
.modal-footer { padding: 15px 25px; border-top: 1px solid var(--line-color); display: flex; justify-content: space-between; align-items: center; background: var(--sidebar-bg); }
.btn-add-selected { background: var(--success); color: white; border: none; padding: 10px 25px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 1rem; transition: background 0.2s; }
.btn-add-selected:hover { background: color-mix(in srgb, var(--success) 88%, #000); }

/* FOOTER */
footer { background: var(--footer-bg); color: var(--footer-text); padding: 30px 20px; margin-top: auto; border-top: 1px solid var(--line-color); }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 15px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--footer-text); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
.copyright { font-size: 0.8rem; opacity: 0.7; margin-top: 10px; }

/* ---------------------------------------------------- */
/* MOBILE                                               */
/* ---------------------------------------------------- */
@media (max-width: 800px) {
    header { padding: 0.85rem 1.1rem; }
    .mobile-menu-btn { display: block; }
    nav {
        display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
        background: var(--card-bg); padding: 10px; border-radius: 0; border: none;
        border-bottom: 1px solid var(--line-color); box-shadow: var(--shadow-md); z-index: 99;
    }
    nav.active { display: flex; }
    .nav-btn { width: 100%; margin-bottom: 5px; text-align: left; border-radius: 10px; }
    .page-grid, .salary-result-grid, .input-row-3, .lists-container, .input-row { grid-template-columns: 1fr; flex-direction: column; }
    .input-row > div { width: 100%; margin-bottom: 10px; }
    .home-card { padding: 22px 18px; }
    .cart-header, .cart-row { grid-template-columns: 1fr; gap: 5px; }
    .cart-row > * { width: 100%; }
    .cart-row-actions { margin-top: 5px; }
    .cart-row-actions .btn-shop { flex: 1; justify-content: center; }
    .lists-sidebar { border-right: none; border-bottom: 1px solid var(--line-color); max-height: 200px; }
    .decision-buttons { grid-template-columns: 1fr; }
    .salary-container { padding: 26px 20px; }
    .modal-window { width: 95%; height: 90vh; border-radius: 14px; }
    .modal-body { flex-direction: column; overflow: hidden; }
    .modal-sidebar { width: 100%; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; border-right: none; border-bottom: 1px solid var(--line-color); flex-shrink: 0; }
    .cat-item { white-space: nowrap; margin-right: 5px; }
    .modal-content { overflow-y: auto; }
    .shop-link-row { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
    .shop-btn-external { display: block; width: 100%; text-align: center; }
    .tooltip-box { width: 200px; left: auto; right: -20px; margin-left: 0; white-space: normal; }
    .tooltip-box::after { left: auto; right: 25px; }
}

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.input-error { border-color: var(--danger) !important; animation: shake 0.3s; }
@keyframes shake { 0% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } 100% { transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* HIGHSCORE & SPAR-LEVEL */
.hs-card {
    display: flex; align-items: center; gap: 18px;
    background: var(--success-light); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
    border-radius: 18px; padding: 18px 22px; margin-top: 25px;
}
.hs-card.hs-empty { background: var(--surface-2); border: 1px dashed var(--line-color); }
.hs-badge { flex-shrink: 0; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); font-family: var(--serif); font-size: 1.5rem; font-weight: 700; border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.hs-main { flex: 1; min-width: 0; }
.hs-title { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--text-main); margin-bottom: 6px; }
.hs-sub { font-size: 0.8rem; color: var(--text-light); margin-top: 5px; }
.hs-progress { height: 8px; background: var(--card-bg); border-radius: 100px; overflow: hidden; border: 1px solid var(--line-color); }
.hs-progress-fill { height: 100%; background: linear-gradient(90deg, var(--success), #57b89c); border-radius: 100px; transition: width 0.6s ease; }
.hs-stats { display: flex; gap: 20px; flex-shrink: 0; text-align: right; }
.hs-stats > div { display: flex; flex-direction: column; }
.hs-val { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; color: var(--success); }
.hs-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); font-weight: 700; }
.hs-fun { margin-top: 10px; font-size: 0.85rem; color: var(--text-light); text-align: center; background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 12px; padding: 10px; }
@media (max-width: 800px) {
    .hs-card { flex-wrap: wrap; }
    .hs-stats { width: 100%; justify-content: space-between; text-align: left; }
}

/* FIXKOSTEN AUFSCHLÜSSELUNG */
.fixcost-toggle { background: none; border: none; color: var(--primary); font-weight: 600; font-size: 0.8rem; cursor: pointer; padding: 6px 0 0 2px; font-family: var(--sans); }
.fixcost-toggle:hover { text-decoration: underline; }
.fixcost-panel { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 14px; padding: 16px; margin-top: 14px; animation: slideIn 0.25s ease; }
.fixcost-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 0.78rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.03em; }
.fixcost-sum strong { color: var(--primary); font-family: var(--serif); font-size: 1.05rem; }
.fixcost-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.fixcost-row { display: grid; grid-template-columns: 2fr 1fr 32px; gap: 8px; align-items: center; }
.fixcost-row input { padding: 9px 12px; font-size: 0.9rem; border-radius: 10px; background: var(--card-bg); }
.btn-add-fixcost { width: 100%; background: var(--card-bg); border: 1px dashed var(--line-color); color: var(--text-light); border-radius: 10px; padding: 9px; cursor: pointer; font-weight: 600; font-size: 0.85rem; font-family: var(--sans); transition: 0.2s; }
.btn-add-fixcost:hover { border-color: var(--primary); color: var(--primary); }

/* SPARZIELE: "Gekauft"-Checkbox */
.bought-check { display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.bought-check input { display: none; width: auto; }
.bought-box {
    width: 24px; height: 24px; border: 2px solid var(--line-color); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: transparent; font-size: 0.85rem; font-weight: 700;
    background: var(--surface-2); transition: all 0.2s;
}
.bought-check:hover .bought-box { border-color: var(--success); }
.bought-check input:checked + .bought-box { background: var(--success); border-color: var(--success); color: #fff; }
.item-bought .li-name, .item-bought .li-price { text-decoration: line-through; opacity: 0.55; }
.item-bought { background: var(--success-light); border-radius: 10px; }

/* NUMBER STEPPER — custom, native spinners entfernt */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.stepper { position: relative; width: 100%; }
.stepper input { padding-right: 34px !important; width: 100%; }
.stepper-btns {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 3px;
}
.stepper-btn {
    width: 22px; height: 15px; padding: 0;
    border: 1px solid var(--line-color); border-radius: 5px;
    background: var(--card-bg); color: var(--text-light);
    font-size: 8px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
}
.stepper-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.stepper-btn:active { transform: scale(0.92); }

/* PRODUKT BILDER */
.pc-image { width: 100%; height: 120px; object-fit: contain; margin-bottom: 10px; border-radius: 8px; }
.product-card:hover .pc-image { transform: scale(1.05); transition: transform 0.2s; }

/* ============================================================
   GEHALTS-ATLAS
   ============================================================ */
.atlas-container { max-width: 1200px; margin: 25px auto 0; background: var(--card-bg); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-color); padding: 40px; }
.atlas-container h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--text-main); margin: 0 0 14px; }
.atlas-container h4 { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: var(--text-main); margin: 0 0 12px; }
.atlas-container h4 small { font-weight: 400; color: var(--text-light); font-family: var(--sans); font-size: 0.8rem; }

.atlas-inputs { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 16px; padding: 20px 20px 6px; margin-bottom: 25px; }

.atlas-layout { display: grid; grid-template-columns: 1fr; gap: 25px; }
@media (min-width: 1000px) { .atlas-layout { grid-template-columns: 1fr 1.1fr; align-items: start; } }

/* Karte */
.atlas-map-card { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 18px; padding: 16px; }
.atlas-map-wrap { max-width: 420px; margin: 0 auto; }
#atlas-map { width: 100%; height: auto; display: block; }
.atlas-land { fill: color-mix(in srgb, var(--text-light) 14%, var(--card-bg)); stroke: var(--line-color); stroke-width: 2; }
.atlas-dot { stroke: var(--card-bg); stroke-width: 1.5; cursor: pointer; transition: r .15s; }
.atlas-dot:hover { stroke: var(--text-main); stroke-width: 2; }
.atlas-dot.selected { stroke: var(--text-main); stroke-width: 3; }
.atlas-legend { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 12px; font-size: 0.75rem; color: var(--text-light); }
.atlas-legend-bar { height: 8px; width: 140px; border-radius: 100px; background: linear-gradient(90deg, #c04f46, #cf9440, #2f6f5e); }

/* Stadt-Suche & Liste */
.atlas-search-wrap { margin-bottom: 10px; }
.atlas-search-wrap input { padding: 11px 14px; font-size: 0.95rem; background: var(--card-bg); }
.atlas-city-list { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; margin-bottom: 14px; padding-right: 4px; }
.atlas-list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card-bg); border: 1px solid var(--line-color); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-family: var(--sans); font-size: 0.88rem; font-weight: 600; color: var(--text-main); transition: border-color .15s, background .15s; }
.atlas-list-item:hover { border-color: var(--primary); }
.atlas-list-item.active { border-color: var(--primary); background: var(--primary-light); }
.atlas-list-item small { font-weight: 400; color: var(--text-light); font-size: 0.72rem; margin-left: 4px; }
.atlas-list-badge { color: #fff; border-radius: 100px; padding: 3px 9px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.atlas-list-empty { color: var(--text-light); font-size: 0.85rem; padding: 8px 4px; }

/* Detail-Panel */
.atlas-detail { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 18px; padding: 22px; }
.atlas-detail-empty { color: var(--text-light); font-size: 0.95rem; text-align: center; padding: 40px 16px; line-height: 1.6; }
.atlas-hero { background: var(--display-card); border-radius: 16px; padding: 22px; color: #e8edf2; margin-bottom: 18px; }
.atlas-hero-city { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.atlas-hero-rank { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: rgba(255,255,255,0.12); border-radius: 100px; padding: 4px 11px; }
.atlas-hero-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; margin-top: 12px; }
.atlas-hero-val { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.atlas-hero-val span { font-size: 1.1rem; font-weight: 500; opacity: 0.8; }
.atlas-hero-sub { font-size: 0.85rem; opacity: 0.85; margin-top: 6px; }

.atlas-block { background: var(--card-bg); border: 1px solid var(--line-color); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.atlas-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-color); }
.atlas-seg { min-width: 2px; }
.seg-tax  { background: #8b95a1; }
.seg-rent { background: var(--danger); }
.seg-nk   { background: #cf9440; }
.seg-food { background: var(--primary); }
.seg-free { background: var(--success); }
.atlas-seg-legends { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 12px; font-size: 0.8rem; color: var(--text-light); }
.atlas-seg-legend { display: flex; align-items: center; gap: 7px; }
.atlas-seg-legend strong { margin-left: auto; color: var(--text-main); font-variant-numeric: tabular-nums; }
.atlas-seg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* Städte-Vergleich (prominenter Block) */
.atlas-compare { background: var(--primary-light); border: 1.5px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.atlas-compare h4 { color: var(--primary-dark); }
.atlas-compare-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.atlas-compare-label { font-size: 0.85rem; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.atlas-compare-select { flex: 1; min-width: 150px; width: auto; padding: 9px 12px; font-size: 0.88rem; border-radius: 10px; background: var(--card-bg); }
.atlas-cmp-table { width: 100%; border-collapse: collapse; }
.atlas-cmp-table th { text-align: left; color: var(--text-light); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0 8px 8px; border-bottom: 2px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.atlas-cmp-table td { padding: 9px 8px; border-bottom: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); font-size: 0.9rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.atlas-cmp-table tr:last-child td { border-bottom: none; }
.atlas-cmp-table td small { color: var(--text-light); font-size: 0.72rem; }
.atlas-cmp-self td { background: color-mix(in srgb, var(--card-bg) 65%, transparent); }
.atlas-cmp-note { display: block; margin-top: 8px; font-size: 0.75rem; color: var(--text-light); line-height: 1.5; }

/* Miet-Quote Benchmark-Hinweis */
.atlas-quote-note { font-size: 0.78rem; color: var(--text-light); line-height: 1.55; margin: 4px 0 10px; }

/* Wohn-Budget */
.atlas-slider-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 10px; }
.atlas-wohn input[type=range] { width: 100%; margin-top: 8px; accent-color: var(--primary); padding: 0; border: none; background: transparent; }
.atlas-wohn-text { font-size: 0.9rem; line-height: 1.55; color: var(--text-main); margin: 10px 0; }
.atlas-floorplans { display: flex; gap: 26px; align-items: flex-end; justify-content: center; padding: 14px 0 4px; }
.atlas-floor { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--text-light); }
.atlas-floor-rect { display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--danger) 18%, var(--card-bg)); border: 2px solid var(--danger); border-radius: 6px; font-size: 0.78rem; font-weight: 700; color: var(--text-main); transition: width .3s, height .3s; }
.atlas-floor-rect.cmp { background: color-mix(in srgb, var(--success) 18%, var(--card-bg)); border-color: var(--success); }
.atlas-reverse { border-top: 1px dashed var(--line-color); margin-top: 14px; padding-top: 14px; }
.atlas-reverse label { font-size: 0.85rem; }
.atlas-reverse-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.9rem; }
.atlas-reverse-row strong { color: var(--primary); font-variant-numeric: tabular-nums; }

.atlas-transfer { text-align: center; margin-top: 4px; }

/* Ranking */
.atlas-ranking-card { background: var(--surface-2); border: 1px solid var(--line-color); border-radius: 18px; padding: 22px; margin-top: 25px; }
.atlas-table-scroll { overflow-x: auto; }
.atlas-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.atlas-table th { text-align: left; color: var(--text-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0 8px 10px; border-bottom: 2px solid var(--line-color); }
.atlas-table td { padding: 10px 8px; border-bottom: 1px solid var(--line-color); font-size: 0.9rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.atlas-rank-row { cursor: pointer; transition: background .15s; }
.atlas-rank-row:hover { background: var(--card-bg); }
.atlas-rank-row.selected { background: var(--primary-light); }

/* Annahmen-Fußnote */
.atlas-assumptions { margin-top: 25px; background: var(--surface-2); border: 1px dashed var(--line-color); border-radius: 14px; padding: 16px 20px; font-size: 0.8rem; color: var(--text-light); line-height: 1.65; }
.atlas-assumptions strong { color: var(--text-main); }

/* Tooltip (Karte) */
.atlas-tooltip { position: fixed; z-index: 300; background: #101720; color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 0.82rem; line-height: 1.5; pointer-events: none; box-shadow: var(--shadow-lg); max-width: 240px; }

/* Mobil: Liste ist der primäre Weg, Karte sekundär */
@media (max-width: 800px) {
    .atlas-container { padding: 22px 16px; border-radius: 18px; }
    .atlas-inputs { padding: 16px 16px 4px; border-radius: 14px; }
    .atlas-city-list { max-height: 240px; }
    .atlas-map-card { padding: 12px; }
    .atlas-map-wrap { max-width: 280px; }
    .atlas-detail { padding: 16px; border-radius: 14px; }
    .atlas-hero { padding: 18px; border-radius: 14px; }
    .atlas-hero-city { font-size: 1.1rem; }
    .atlas-hero-val { font-size: 2.1rem; }
    .atlas-block { padding: 14px; border-radius: 12px; }
    .atlas-seg-legends { grid-template-columns: 1fr; }

    /* Städte-Vergleich: Picker stapeln statt nebeneinander quetschen */
    .atlas-compare-pick { flex-direction: column; align-items: stretch; gap: 8px; }
    .atlas-compare-select { width: 100%; min-width: 0; }

    /* Tabellen: kompakter, horizontal scrollbar bleibt über .atlas-table-scroll erhalten */
    .atlas-table, .atlas-cmp-table { font-size: 0.82rem; }
    .atlas-table th, .atlas-cmp-table th { font-size: 0.68rem; }

    /* Wohn-Budget: Grundrisse dürfen umbrechen statt den Container zu sprengen */
    .atlas-floorplans { flex-wrap: wrap; gap: 16px; row-gap: 14px; }
    .atlas-reverse-row { gap: 10px; }
    .atlas-reverse-row .stepper { max-width: 100px !important; }

    .atlas-ranking-card { padding: 16px; border-radius: 14px; }
}

@media (max-width: 420px) {
    .atlas-container { padding: 18px 12px; }
    .atlas-map-wrap { max-width: 230px; }
    .atlas-hero-val { font-size: 1.75rem; }
    .atlas-hero-rank { font-size: 0.65rem; padding: 3px 8px; }
    .atlas-floor-rect { font-size: 0.68rem; }
}

/* --- SEO / Accessibility helpers --- */
/* Visually hidden but readable by search engines & screen readers */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.noscript-fallback {
    max-width: 720px;
    margin: 40px auto;
    padding: 28px 32px;
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 14px;
    color: var(--text-main);
    line-height: 1.6;
}
.noscript-fallback h2 { margin-top: 0; }
.noscript-fallback ul { padding-left: 20px; }
.noscript-fallback li { margin: 6px 0; }
.noscript-fallback a { color: var(--success); }

/* ============================================================
   Cookie-Consent-Banner  ·  matches hourli card / button system
   ============================================================ */
.cc-banner {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(0);
    width: min(920px, calc(100% - 32px));
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    padding: 22px 24px;
    color: var(--text-main);
    font-family: var(--sans);
    animation: ccSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-banner[hidden] { display: none; }
@keyframes ccSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(18px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.cc-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0 0 8px;
    color: var(--text-main);
}
.cc-text {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-light);
    margin: 0 0 16px;
}
.cc-text a { color: var(--primary); font-weight: 600; text-decoration: none; }
.cc-text a:hover { text-decoration: underline; }

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.cc-actions .cc-spacer { flex: 1 1 auto; }

.cc-btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 11px 20px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .2s, border-color .2s, color .2s, transform .1s;
    white-space: nowrap;
}
.cc-btn:active { transform: scale(0.98); }
.cc-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.cc-btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.cc-btn-secondary { background: var(--surface-2); color: var(--text-main); border-color: var(--line-color); }
.cc-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.cc-btn-ghost { background: transparent; color: var(--text-light); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.cc-btn-ghost:hover { color: var(--primary); }

/* Detail / settings panel */
.cc-details { margin-top: 18px; border-top: 1px solid var(--line-color); padding-top: 16px; }
.cc-details[hidden] { display: none; }
.cc-cat {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-color);
}
.cc-cat:last-child { border-bottom: none; }
.cc-cat-info { flex: 1; }
.cc-cat-name { font-weight: 700; font-size: 0.92rem; color: var(--text-main); margin: 0 0 3px; }
.cc-cat-desc { font-size: 0.82rem; color: var(--text-light); line-height: 1.45; margin: 0; }

/* Toggle switch */
.cc-switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; margin-top: 2px; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--line-color); border-radius: 26px; transition: background .2s;
}
.cc-slider::before {
    content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm);
}
.cc-switch input:checked + .cc-slider { background: var(--primary); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(18px); }
.cc-switch input:disabled + .cc-slider { background: var(--success); cursor: not-allowed; opacity: 0.9; }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 560px) {
    .cc-banner { bottom: 0; border-radius: var(--radius) var(--radius) 0 0; width: 100%; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
    .cc-actions .cc-spacer { display: none; }
    .cc-actions .cc-btn { flex: 1 1 auto; text-align: center; }
    .cc-btn-ghost { flex-basis: 100%; }
}
