* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: system-ui, "Segoe UI", sans-serif; }

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1f2937;
    color: #fff;
    padding: 1rem;
}
.brand { font-weight: 700; font-size: 1.1rem; margin-bottom: 1.25rem; }

/* Logo-Button "Krebs.nrw" (Krabbe + farbiger Schriftzug wie auf der Startseite) */
.brand-btn {
    display: block;
    padding: .5rem .6rem .45rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s;
}
.brand-btn:hover {
    background: linear-gradient(135deg, #ffffff, #f3f4f6);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
    transform: translateY(-1px);
}
.brand-btn:active { transform: translateY(0); }
.brand-btn.active { box-shadow: 0 0 0 3px #60a5fa, 0 2px 8px rgba(0, 0, 0, .35); }
.brand-btn:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.brand-logo { display: block; width: 100%; height: auto; }

.menu { display: flex; flex-direction: column; gap: .5rem; }
.menu-btn {
    display: block;
    padding: .65rem .9rem;
    border-radius: 6px;
    background: linear-gradient(135deg, #4b5563, #374151);
    color: #fff;
    text-decoration: none;
}
.menu-btn:hover { background: linear-gradient(135deg, #5b6472, #434f5e); }
.menu-btn.active { background: linear-gradient(135deg, #60a5fa, #3b82f6); }

.menu-btn-admin { background: linear-gradient(135deg, #f87171, #dc2626); }
.menu-btn-admin:hover { background: linear-gradient(135deg, #fb8888, #ef4444); }
.menu-btn-admin.active { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.menu-btn-login { background: linear-gradient(135deg, #34d399, #059669); margin-bottom: .25rem; }
.menu-btn-login:hover { background: linear-gradient(135deg, #4fe0ac, #10b981); }

.menu-login-status {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .5rem .1rem .75rem;
    margin-bottom: .25rem;
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.menu-login-name { font-size: .9rem; opacity: .9; word-break: break-word; }
.menu-btn-logout {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    border: 0;
    cursor: pointer;
    font-size: .9rem;
    text-align: left;
}
.menu-btn-logout:hover { background: linear-gradient(135deg, #a9b0bb, #77808d); }

.content { flex: 1; padding: 1.5rem 2rem; }

.login { display: flex; flex-direction: column; gap: .75rem; max-width: 320px; text-align: left; }
.login label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.login input { padding: .5rem; font-size: 1rem; }

.home-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 3rem);
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background:
        linear-gradient(rgba(4, 30, 40, .55), rgba(4, 30, 40, .55)),
        url('../images/coral-reef.jpg') center/cover no-repeat;
}

.home-card {
    background: rgba(255, 255, 255, .28);
    backdrop-filter: blur(2px);
    border-radius: 14px;
    padding: 2.5rem 3rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.home-weather {
    width: min(620px, 84vw);
    margin: 1.5rem auto 0;
}
.home-weather .wx-updated {
    color: rgba(255,255,255,.85);
    margin: 0 0 .6rem;
    font-size: .85rem;
}
@media (max-width: 640px) {
    .home-weather .wx-summary { padding: 1.25rem 1.25rem; }
}

.photo-credit {
    position: absolute;
    bottom: 6px;
    right: 10px;
    margin: 0;
    font-size: .7rem;
    color: rgba(255,255,255,.75);
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.photo-credit a { color: rgba(255,255,255,.9); }

.walking-crab {
    position: absolute;
    width: 56px;
    height: auto;
    pointer-events: none;
    animation: crab-walk-around 22s linear infinite;
}

@keyframes crab-walk-around {
    0%   { left: 2%;                 top: calc(100% - 70px); }
    25%  { left: calc(100% - 60px);  top: calc(100% - 70px); }
    50%  { left: calc(100% - 60px);  top: 12px; }
    75%  { left: 2%;                 top: 12px; }
    100% { left: 2%;                 top: calc(100% - 70px); }
}

.crab-leg-a, .crab-leg-b {
    transform-origin: 60px 66px;
    animation: crab-legs .5s ease-in-out infinite alternate;
}
.crab-leg-b { animation-delay: .25s; }

@keyframes crab-legs {
    0%   { transform: rotate(-4deg); }
    100% { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .walking-crab, .crab-leg-a, .crab-leg-b { animation: none; }
}

.btn {
    padding: .55rem 1rem;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.btn:hover { background: linear-gradient(135deg, #7db4fb, #4c8bf5); }
.btn:disabled { opacity: .6; cursor: default; }
.error { color: #b91c1c; }
.error-boundary { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 1.25rem 1.5rem; max-width: 600px; }
.error-boundary-detail { color: #7f1d1d; font-size: .85rem; font-family: monospace; word-break: break-word; }
.success { color: #15803d; }
.register-hint { font-size: .9rem; }
.register-hint a { color: #2563eb; }

#blazor-error-ui { background: #fef3c7; padding: .6rem 1rem; position: fixed; bottom: 0; left: 0; right: 0; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.gallery-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
}
.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.gallery-item img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e5e7eb;
}
.gallery-item figcaption {
    padding: .6rem .8rem;
    font-size: .9rem;
    font-weight: 600;
    color: #1f2937;
}

.form-card {
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.form-card label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .9rem; }
.form-card input, .form-card textarea {
    width: 100%; padding: .5rem; font-size: 1rem; margin-bottom: 1rem;
    border: 1px solid #d1d5db; border-radius: 6px;
}
.form-card textarea { min-height: 140px; font-family: monospace; }

.weather-table { border-collapse: collapse; margin-top: 1rem; width: 100%; max-width: 640px; }
.weather-table th, .weather-table td { border: 1px solid #e5e7eb; padding: .5rem .75rem; text-align: left; }
.weather-table th { background: #f3f4f6; }

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}
.lightbox-content {
    position: relative;
    max-width: min(90vw, 1100px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.lightbox-caption {
    color: #fff;
    margin-top: .75rem;
    font-size: .95rem;
    text-align: center;
}
.wx-dashboard { max-width: 780px; }
.wx-header h1 { margin-bottom: .1rem; }
.wx-station-id { color: #6b7280; font-weight: 400; font-size: 1.1rem; }
.wx-updated { color: #6b7280; margin-top: 0; margin-bottom: 1.5rem; font-size: .9rem; }

.wx-summary {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 2rem;
    align-items: center;
    background: #1976d2;
    color: #fff;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    flex-wrap: wrap;
}

.wx-current { text-align: center; }
.wx-temp { font-size: 3.5rem; font-weight: 700; line-height: 1; }
.wx-unit { font-size: 1.5rem; font-weight: 400; margin-left: .1rem; }
.wx-feels { margin-top: .4rem; opacity: .9; font-size: .95rem; }

.wx-compass { text-align: center; }
.wx-compass-dial {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.55);
    margin: 0 auto .5rem;
}
.wx-compass-dial span {
    position: absolute;
    font-size: .7rem;
    font-weight: 700;
    opacity: .8;
}
.wx-compass-n { top: 2px; left: 50%; transform: translateX(-50%); }
.wx-compass-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.wx-compass-e { right: 4px; top: 50%; transform: translateY(-50%); }
.wx-compass-w { left: 4px; top: 50%; transform: translateY(-50%); }
.wx-compass-needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 34px;
    background: #fff;
    border-radius: 2px;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(calc(var(--wind-deg) * 1deg));
}
.wx-compass-label { font-size: .8rem; opacity: .9; line-height: 1.3; }

.wx-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: .9rem 1.5rem;
}
.wx-stat { display: flex; flex-direction: column; }
.wx-stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.wx-stat-value { font-size: 1.05rem; font-weight: 600; }

.wx-location { margin-top: 1rem; color: #6b7280; font-size: .85rem; }

.wx-summary-footer {
    grid-column: 1 / -1;
    margin-top: 1.1rem;
    padding-top: .85rem;
    border-top: 1px solid rgba(255,255,255,.25);
}

.wx-refresh-row { margin-top: 0; }
.wx-refresh-label {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .8;
    margin-bottom: .3rem;
}
.wx-refresh-bar {
    height: 5px;
    background: rgba(255,255,255,.25);
    border-radius: 3px;
    overflow: hidden;
}
.wx-refresh-bar-fill {
    height: 100%;
    width: 100%;
    background: #f97316;
    border-radius: 3px;
    transform-origin: left;
    animation: wx-refresh-countdown 60s linear forwards;
}
@keyframes wx-refresh-countdown {
    from { width: 100%; }
    to { width: 0%; }
}
@media (prefers-reduced-motion: reduce) {
    .wx-refresh-bar-fill { animation: none; width: 0%; }
}

@media (max-width: 640px) {
    .wx-summary { grid-template-columns: 1fr; text-align: center; }
    .wx-stats { grid-template-columns: repeat(2, 1fr); }
}

.wx-history-title { margin-top: 2rem; }

.wx-history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.wx-mode-switch { display: flex; gap: .4rem; }
.wx-mode-btn {
    padding: .4rem .9rem;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
}
.wx-mode-btn.active { background: #1976d2; color: #fff; border-color: #1976d2; }

.wx-date-nav { display: flex; align-items: center; gap: .5rem; }
.wx-date-nav input[type="date"] { padding: .35rem .5rem; border: 1px solid #d1d5db; border-radius: 6px; }

.wx-history-range { color: #6b7280; font-size: .9rem; margin: 0 0 .5rem; }

.wx-history-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.wx-sparkline { margin-top: 1.5rem; max-width: 640px; }
.wx-sparkline-svg { width: 100%; height: auto; }
.wx-spark-high { fill: none; stroke: #d64545; stroke-width: 2; }
.wx-spark-low { fill: none; stroke: #1976d2; stroke-width: 2; }
.wx-sparkline-legend { font-size: .8rem; color: #6b7280; margin-top: .3rem; }
.wx-legend-high { color: #d64545; }
.wx-legend-low { color: #1976d2; }

.admin-table { width: 100%; max-width: none; }
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-secondary { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.admin-edit-card { margin-top: 1.5rem; max-width: 420px; }

.kv-layout { display: flex; gap: 2rem; align-items: flex-start; }

.kv-tree {
    min-width: 260px;
    max-width: 340px;
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    max-height: 75vh;
    min-height: 140px;
    overflow-y: auto;
}
.kv-list { list-style: none; margin: 0; padding-left: 1.1rem; }
.kv-list-root { padding-left: 0; }
.kv-node { display: flex; align-items: center; gap: .3rem; padding: .15rem 0; border-radius: 4px; }
.kv-node-selected { background: #dbeafe; }
.kv-toggle {
    width: 1.4rem; height: 1.4rem;
    border: 0; background: transparent; cursor: pointer;
    font-size: .8rem; color: #6b7280; flex-shrink: 0;
}
.kv-label { cursor: pointer; font-size: .92rem; }
.kv-label:hover { text-decoration: underline; }
.kv-hint { margin: .75rem 0 0; font-size: .78rem; color: #6b7280; }

.kv-ctx-overlay { position: fixed; inset: 0; z-index: 1999; }
.kv-ctx-menu {
    position: fixed;
    z-index: 2000;
    list-style: none;
    margin: 0;
    padding: .3rem 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.kv-ctx-menu li { padding: .45rem 1rem; cursor: pointer; font-size: .9rem; }
.kv-ctx-menu li:hover { background: #dbeafe; }
.kv-ctx-menu li.kv-ctx-danger { color: #b91c1c; }
.kv-ctx-menu li.kv-ctx-danger:hover { background: #fee2e2; }

.kv-detail { flex: 1; min-width: 320px; }
.kv-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem;
    max-width: none;
    margin-bottom: 1.25rem;
}
.kv-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; }
.kv-form input { padding: .45rem; font-size: .95rem; border: 1px solid #d1d5db; border-radius: 6px; }

.kv-cat-table { width: 100%; max-width: none; margin-bottom: 1.25rem; }
.kv-cat-table input[type="number"] { width: 100px; }
.kv-cat-table input[type="text"], .kv-cat-table input:not([type]) { width: 140px; }
.kv-cat-table select { padding: .35rem; border: 1px solid #d1d5db; border-radius: 6px; min-width: 220px; }
.kv-form input:disabled { background: #f3f4f6; color: #6b7280; }

.btn-calc { background: linear-gradient(135deg, #34d399, #059669); }
.btn-calc:hover { background: linear-gradient(135deg, #6ee7b7, #10b981); }

.kv-berechnung { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed #d1d5db; }
.kv-berechnung h3 { margin: 0 0 .25rem; }
.kv-berechnung-total td { font-weight: 700; border-top: 2px solid #d1d5db; }

.kv-page-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.kv-page-tab {
    padding: .55rem 1.1rem;
    font-size: .9rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
}
.kv-page-tab:hover { background: #e5e7eb; }
.kv-page-tab-active { background: #059669; border-color: #059669; color: #fff; }
.kv-page-tab-active:hover { background: #047857; }

.kv-doku-upload { align-items: flex-start; }
.kv-doku-upload label { max-width: 360px; }

.kv-doku-preview { margin-top: 1.25rem; }
.kv-doku-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.kv-doku-preview-head h3 { margin: 0; word-break: break-all; }
.kv-doku-preview-frame {
    width: 100%;
    height: 75vh;
    min-height: 400px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f3f4f6;
}
.kv-doku-preview-image {
    max-width: 100%;
    max-height: 75vh;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    display: block;
}

.kv-anlagen-box {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}
.kv-anlagen-box h3 { margin-top: 0; }
.kv-anlagen-list { list-style: none; margin: 0; padding: 0; }
.kv-anlagen-list li { padding: .4rem 0; border-bottom: 1px solid #e5e7eb; }
.kv-anlagen-list li:last-child { border-bottom: none; }
.kv-anlagen-list label { display: flex; align-items: center; gap: .5rem; cursor: pointer; }

.kv-ausschnitt-zeile { margin: .4rem 0 0 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.kv-ausschnitt-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.kv-ausschnitt-liste li { border: none; padding: 0; }
.kv-btn-small { padding: .25rem .6rem; font-size: .85rem; }

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}
.kv-danger-link { color: #b91c1c; margin-left: .25rem; }

.kv-ausschnitt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    z-index: 50;
}
.kv-ausschnitt-dialog {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    max-width: 960px;
    width: 100%;
}
.kv-ausschnitt-canvas-wrap {
    position: relative;
    display: inline-block;
    margin-top: .75rem;
    max-width: 100%;
    overflow: auto;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}
.kv-ausschnitt-canvas { display: block; }
.kv-ausschnitt-canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    cursor: crosshair;
}

.reversi-layout { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }

.reversi-board {
    display: grid;
    grid-template-columns: repeat(8, 42px);
    grid-template-rows: repeat(8, 42px);
    gap: 2px;
    background: #0f5c2e;
    padding: 6px;
    border-radius: 8px;
}
.reversi-cell {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #0a3d1e;
    background: #157a3d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reversi-cell:hover { background: #1c9349; }
.reversi-cell img { width: 30px; height: 30px; }
.reversi-cell { position: relative; }
/* zuletzt vom Computer gesetzter Stein: kleines Fähnchen */
.reversi-cell.reversi-last::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 40%; height: 50%;
    transform: translate(-12.5%, -100%); /* Fuß des Mastes in der Feldmitte */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Crect x='1.1' y='1' width='1.8' height='19' rx='.9' fill='%23222'/%3E%3Cpath d='M2.9 1.5 L15 5.2 L2.9 9 Z' fill='%23dc2626' stroke='%23222' stroke-width='.8' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    pointer-events: none;
}
/* Felder, auf die der Spieler setzen kann: hellgrüner Hintergrund */
.reversi-cell.reversi-legal { background: #3fcf78; }
.reversi-cell.reversi-legal:hover { background: #6ee7a0; }

.reversi-side { min-width: 220px; }
.reversi-gameover { font-weight: 700; color: #1976d2; margin-top: .75rem; }

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.logo-heading { margin: 0 0 2.5rem; }
.logo { display: block; height: 220px; max-width: 100%; }

/* "Where we have been": Karte + Ortsliste */
.wow-form { max-width: 480px; margin-bottom: 1.5rem; }
.wow-layout { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.wow-map {
    flex: 2 1 480px;
    height: 65vh;
    min-height: 360px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.wow-map.wow-map-picking { cursor: crosshair; }
.wow-pending-marker { filter: hue-rotate(160deg) saturate(3); }

/* Pins mit Landesflagge + Personen-Kennzeichen (siehe js/map.js) */
.wow-pin-icon { background: none; border: 0; }
.wow-pin { position: relative; width: 40px; height: 52px; }
.wow-pin::after {               /* Spitze des Pins */
    content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    border-left: 8px solid transparent; border-right: 8px solid transparent;
    border-top: 16px solid #fff;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .35));
}
.wow-pin-head {
    position: absolute; top: 0; left: 2px; z-index: 1;
    width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
    border: 3px solid #fff; background: #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
    display: flex; align-items: center; justify-content: center;
}
.wow-pin-head img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wow-pin-head img.wow-pin-flag-contain { object-fit: contain; background: #fff; }
.wow-pin-cc { font: 700 11px/1 system-ui, sans-serif; color: #374151; }
.wow-pin-globe { font-size: 20px; line-height: 1; }
.leaflet-marker-icon:hover .wow-pin-head { transform: scale(1.12); transition: transform .12s; }
.wow-pin-people {
    position: absolute; z-index: 2; top: -6px; left: 26px;
    display: flex;
}
.wow-pin-people .wow-p + .wow-p { margin-left: -5px; }
.wow-p {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    font: 700 9px/1 system-ui, sans-serif; color: #fff;
    vertical-align: middle; box-sizing: content-box;
}
.wow-p-jan     { background: #2563eb; }
.wow-p-frank   { background: #16a34a; }
.wow-p-michela { background: #db2777; }
.wow-p-other   { background: #6b7280; }
.wow-popup-land { font-size: .8rem; color: #4b5563; margin-bottom: .2rem; }
.wow-popup-land img { width: 20px; height: 14px; object-fit: cover; vertical-align: -2px; border-radius: 2px; }
.wow-popup-personen { margin-top: .25rem; }
.wow-popup-personen .wow-p { margin-right: 2px; }

/* Flagge + Personen in der Liste und in den Filter-Buttons */
.wow-list-flag { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; vertical-align: -3px; margin-right: .35rem; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.wow-list-people { margin-left: .5rem; display: inline-flex; gap: 2px; vertical-align: -3px; }
.wow-filter-btn .wow-p { margin-right: .3rem; }
.wow-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}
.wow-filter-btn { padding: .3rem .8rem; font-size: .85rem; }
.wow-filter-btn-active { background: #2563eb; color: #fff; border-color: #2563eb; }
.wow-pin-mode-hint {
    font-size: .8rem;
    color: #9a3412;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: .5rem .75rem;
    margin-bottom: .75rem;
}
.wow-list {
    flex: 1 1 260px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 65vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.wow-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid #e5e7eb;
}
.wow-list li:last-child { border-bottom: none; }
.wow-list li.wow-list-highlight { background: #fef3c7; }
.wow-list-buttons { display: flex; flex-direction: column; gap: .35rem; flex-shrink: 0; }
.wow-form-heading { margin: 1.5rem 0 .25rem; font-size: 1.1rem; }
.wow-list-main { cursor: pointer; flex: 1; }
.wow-list-main:hover strong { text-decoration: underline; }
.wow-list-adresse { font-size: .82rem; color: #6b7280; }
.wow-list-datum {
    margin-left: .5rem;
    font-size: .74rem;
    color: #374151;
    background: #f3f4f6;
    border-radius: 999px;
    padding: .1rem .55rem;
}
.wow-list-personen {
    margin-left: .5rem;
    font-size: .74rem;
    color: #1e3a8a;
    background: #dbeafe;
    border-radius: 999px;
    padding: .1rem .55rem;
}
.wow-personen-checks { display: inline-flex; gap: .9rem; font-weight: 400; }
.wow-person-check { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; margin: 0; }
.wow-person-check input { width: auto; }
.wow-list-notiz { font-size: .82rem; color: #374151; margin-top: .15rem; }
.wow-list-meta { font-size: .7rem; color: #9ca3af; margin-top: .3rem; }
.wow-list-meta + .wow-list-meta { margin-top: 0; }

/* Protokoll "Where we have been" (nur Administratoren) */
.wow-log {
    margin-top: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: .5rem .9rem;
}
.wow-log-toggle { background: none; border: 0; padding: .25rem 0; cursor: pointer; font: inherit; font-weight: 600; color: #991b1b; }
.wow-log-toggle + * { margin-top: .5rem; }
.wow-log-scroll { max-height: 360px; overflow: auto; margin-bottom: .6rem; }
.wow-log-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.wow-log-table th { text-align: left; position: sticky; top: 0; background: #f9fafb; padding: .35rem .5rem; border-bottom: 1px solid #e5e7eb; }
.wow-log-table td { padding: .35rem .5rem; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.wow-log-table td small { color: #6b7280; }
.wow-log-neu td:nth-child(3) { color: #15803d; font-weight: 600; }
.wow-log-edit td:nth-child(3) { color: #1d4ed8; font-weight: 600; }
.wow-log-del td:nth-child(3) { color: #b91c1c; font-weight: 600; }

/* ---------- Abalone ---------- */
.abalone-layout { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.abalone-board { width: 100%; max-width: 560px; height: auto; user-select: none; }
.ab-frame { fill: url(#ab-frame); stroke: #0f172a; stroke-width: 3; }
.ab-hole { fill: #0f172a; stroke: #334155; stroke-width: 1.5; }
.ab-ball { stroke: rgba(0, 0, 0, .35); stroke-width: 1; }
.ab-selectable { cursor: pointer; }
.ab-selectable:hover { stroke: #fde68a; stroke-width: 3; }
.ab-selected, .ab-selected:hover { stroke: #facc15; stroke-width: 4; }
.ab-last { fill: none; stroke: #f97316; stroke-width: 2; stroke-dasharray: 4 3; pointer-events: none; }
.ab-arrow { cursor: pointer; }
.ab-arrow circle { fill: #facc15; stroke: #78350f; stroke-width: 1.5; }
.ab-arrow path { fill: #1f2937; }
.ab-arrow:hover circle { fill: #fb923c; }

.abalone-side { min-width: 240px; max-width: 360px; display: flex; flex-direction: column; gap: .75rem; }
.ab-settings { display: flex; flex-direction: column; gap: .5rem; }
.ab-settings label { display: flex; flex-direction: column; font-size: .9rem; gap: .2rem; }
.ab-settings select { padding: .35rem .5rem; border-radius: 6px; border: 1px solid #cbd5e1; }
.ab-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.ab-status { font-weight: 600; margin: 0; }
.ab-status-end { color: #1976d2; font-size: 1.1rem; }
.ab-info { font-size: .85rem; color: #475569; margin: 0; }
.ab-trays { display: flex; flex-direction: column; gap: .5rem; }
.ab-tray-label { font-size: .85rem; color: #475569; }
.ab-tray { display: flex; gap: 4px; margin-top: .2rem; }
.ab-slot { width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; border: 1px solid #cbd5e1; }
.ab-slot-black { background: radial-gradient(circle at 35% 30%, #6b7280, #1f2937 45%, #030712); border-color: #030712; }
.ab-slot-white { background: radial-gradient(circle at 35% 30%, #fff, #e5e7eb 55%, #9ca3af); border-color: #9ca3af; }
.ab-rules { font-size: .9rem; }
.ab-rules ul { padding-left: 1.2rem; margin: .4rem 0 0; }

/* ---------- Game of Life ---------- */
.gol-intro { color: #475569; max-width: 760px; margin-top: -.25rem; }
.gol-layout { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.gol-stage { flex: 1 1 560px; min-width: 300px; max-width: 1100px; }
.gol-board {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #0b1220;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .35), inset 0 0 0 1px rgba(148, 163, 184, .15);
    cursor: crosshair;
    touch-action: none;
}
.gol-statusbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    align-items: center;
    margin-top: .75rem;
    font-size: .95rem;
}
.gol-stat-label { color: #64748b; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-right: .3rem; }
.gol-badge {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #115e59;
    border-radius: 999px;
    padding: .15rem .7rem;
    font-size: .85rem;
    font-weight: 600;
}

.gol-panel {
    flex: 0 1 300px;
    min-width: 260px;
    background: #fff;
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.gol-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.gol-buttons .btn { width: 100%; }
.gol-play { grid-column: 1 / -1; font-weight: 600; background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.gol-play:hover { background: linear-gradient(135deg, #5eead4, #14b8a6); }
.gol-field { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.gol-field > span { display: flex; justify-content: space-between; color: #334155; font-weight: 600; }
.gol-field em { font-style: normal; font-weight: 400; color: #64748b; }
.gol-field select { padding: .4rem .5rem; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; min-width: 0; }
.gol-field input[type=range] { accent-color: #0d9488; width: 100%; }
.gol-inline { display: flex; gap: .5rem; }
.gol-inline select { flex: 1; }
.gol-check { display: flex; gap: .5rem; align-items: center; font-size: .9rem; color: #334155; }
.gol-check input { accent-color: #0d9488; width: 1rem; height: 1rem; }
.gol-spark { width: 100%; height: 56px; background: #f1f5f9; border-radius: 6px; display: block; }
.gol-rules { font-size: .88rem; color: #334155; }
.gol-rules ul { padding-left: 1.2rem; margin: .4rem 0 0; }

/* ---------- Menü: Gruppe "Games" ---------- */
.menu-btn-group { display: flex; justify-content: space-between; align-items: center; }
.menu-caret { font-size: .8rem; opacity: .8; }
.menu-sub {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin: -.15rem 0 .1rem .9rem;
    padding-left: .6rem;
    border-left: 2px solid rgba(255, 255, 255, .18);
}
.menu-sub-btn { padding: .45rem .75rem; font-size: .92rem; background: linear-gradient(135deg, #3f4855, #2f3742); }
.menu-sub-btn:hover { background: linear-gradient(135deg, #505a68, #3b4552); }
.menu-sub-btn.active { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

/* ---------- Spiele-Übersicht ---------- */
.games-intro { color: #475569; max-width: 720px; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; max-width: 1000px; }
.game-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.game-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
.game-art { height: 140px; display: flex; align-items: center; justify-content: center; }
.game-art svg { height: 100px; width: auto; }
.game-art-reversi { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.game-art-abalone { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }
.game-art-life { background: linear-gradient(135deg, #0f172a, #1e293b); }
.game-art-tsp { background: radial-gradient(120% 120% at 30% 20%, #13253c, #0d1a2b); }
.tsp-intro { color: #475569; max-width: 760px; margin-top: -.25rem; }
.game-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.game-body h2 { margin: 0; font-size: 1.15rem; }
.game-body p { margin: 0; color: #475569; font-size: .92rem; flex: 1; }
.game-play { color: #2563eb; font-weight: 600; font-size: .92rem; margin-top: .3rem; }

/* ---------- Zeitschaltuhren (eWeLink) ---------- */
.ew-banner {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; max-width: 1100px;
}
.ew-banner-demo { background: #fef9c3; border: 1px solid #fde68a; color: #713f12; }
.ew-banner-ok { background: #dcfce7; border: 1px solid #bbf7d0; color: #14532d; }
.ew-banner-error { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.ew-banner code { background: rgba(0,0,0,.06); padding: 0 .3rem; border-radius: 4px; }
.ew-banner-close { margin-left: auto; background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: inherit; }
.ew-connection { display: flex; align-items: center; gap: .5rem; color: #475569; font-size: .9rem; margin-bottom: .75rem; }
.ew-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ew-summary { color: #334155; }
.ew-updated { color: #94a3b8; font-size: .85rem; }

.ew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; max-width: 1100px; }
.ew-card {
    background: #fff; border-radius: 14px; padding: 1rem 1.1rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08); border: 1px solid transparent;
    display: flex; flex-direction: column; gap: .7rem; transition: border-color .2s, box-shadow .2s;
}
.ew-card-on { border-color: #fcd34d; box-shadow: 0 4px 18px rgba(245, 158, 11, .18); }
.ew-card-offline { opacity: .65; }
.ew-card-head { display: flex; align-items: center; gap: .8rem; }
.ew-icon {
    width: 44px; height: 44px; border-radius: 12px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #f1f5f9; transition: background .2s;
}
.ew-icon svg { width: 24px; height: 24px; fill: none; stroke: #64748b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ew-card-on .ew-icon { background: linear-gradient(135deg, #fde68a, #f59e0b); }
.ew-card-on .ew-icon svg { stroke: #fff; }
.ew-title { flex: 1; min-width: 0; }
.ew-name { font-weight: 600; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-model { color: #64748b; font-size: .82rem; display: flex; align-items: center; gap: .3rem; }
.ew-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ew-dot-on { background: #22c55e; }
.ew-dot-off { background: #ef4444; }

/* Kippschalter */
.ew-switch { position: relative; width: 52px; height: 30px; flex: none; }
.ew-switch input { opacity: 0; width: 0; height: 0; }
.ew-slider {
    position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
    background: #cbd5e1; transition: background .2s;
}
.ew-slider::before {
    content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.ew-switch input:checked + .ew-slider { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.ew-switch input:checked + .ew-slider::before { transform: translateX(22px); }
.ew-switch input:disabled + .ew-slider { cursor: not-allowed; opacity: .6; }
.ew-switch input:focus-visible + .ew-slider { outline: 2px solid #3b82f6; outline-offset: 2px; }

.ew-next { font-size: .88rem; color: #475569; background: #f8fafc; border-radius: 8px; padding: .45rem .65rem; }
.ew-link { background: none; border: 0; padding: 0; color: #2563eb; cursor: pointer; font-size: .9rem; text-align: left; }
.ew-link:hover { text-decoration: underline; }

.ew-editor { display: flex; flex-direction: column; gap: .6rem; border-top: 1px solid #e2e8f0; padding-top: .7rem; }
.ew-timer { display: flex; flex-direction: column; gap: .4rem; background: #f8fafc; border-radius: 8px; padding: .5rem .6rem; }
.ew-timer-disabled { opacity: .55; }
.ew-timer-line { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ew-timer select, .ew-timer input[type=time], .ew-timer input[type=date] {
    padding: .3rem .4rem; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font-size: .88rem;
}
.ew-act-on { color: #b45309; font-weight: 600; }
.ew-act-off { color: #475569; }
.ew-mini-check input { width: 1rem; height: 1rem; accent-color: #f59e0b; }
.ew-remove { margin-left: auto; background: none; border: 0; color: #94a3b8; font-size: 1.25rem; cursor: pointer; line-height: 1; }
.ew-remove:hover { color: #dc2626; }
.ew-days { display: flex; gap: .25rem; flex-wrap: wrap; }
.ew-day {
    width: 2.1rem; padding: .25rem 0; border-radius: 6px; border: 1px solid #cbd5e1;
    background: #fff; color: #475569; font-size: .8rem; cursor: pointer;
}
.ew-day-on { background: linear-gradient(135deg, #fbbf24, #f59e0b); border-color: #f59e0b; color: #fff; font-weight: 600; }
.ew-hint { font-size: .82rem; color: #64748b; margin: 0; }
.ew-editor-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ew-spacer { flex: 1; }

/* ---------- Türschloss (Nuki) ---------- */
.nk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; max-width: 1100px; }
.nk-card {
    --nk-accent: #64748b; --nk-soft: #f1f5f9;
    background: #fff; border-radius: 16px; padding: 1.1rem 1.2rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08); border-top: 4px solid var(--nk-accent);
    display: flex; flex-direction: column; gap: .8rem;
}
.nk-locked   { --nk-accent: #16a34a; --nk-soft: #dcfce7; }
.nk-unlocked { --nk-accent: #f59e0b; --nk-soft: #fef3c7; }
.nk-warn     { --nk-accent: #ea580c; --nk-soft: #ffedd5; }
.nk-alert    { --nk-accent: #dc2626; --nk-soft: #fee2e2; }
.nk-neutral  { --nk-accent: #3b82f6; --nk-soft: #dbeafe; }
.nk-head { display: flex; align-items: center; gap: 1rem; }
.nk-badge {
    width: 64px; height: 64px; border-radius: 50%; flex: none;
    background: var(--nk-soft); display: flex; align-items: center; justify-content: center;
}
.nk-badge svg { width: 32px; height: 32px; fill: none; stroke: var(--nk-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nk-title { min-width: 0; }
.nk-name { font-weight: 700; font-size: 1.15rem; }
.nk-state { font-size: 1.05rem; color: var(--nk-accent); font-weight: 600; }
.nk-type { font-size: .8rem; color: #94a3b8; }
.nk-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.nk-chip {
    display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem;
    background: #f1f5f9; color: #334155; border-radius: 999px; padding: .2rem .6rem;
}
.nk-chip-warn { background: #ffedd5; color: #9a3412; }
.nk-chip-alert { background: #fee2e2; color: #991b1b; font-weight: 600; }
.nk-battery { width: 22px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; display: inline-block; }
.nk-battery span { position: absolute; left: 1px; top: 1px; bottom: 1px; background: currentColor; border-radius: 1px; max-width: calc(100% - 2px); }
.nk-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; }
.nk-btn {
    padding: .65rem .5rem; border: 0; border-radius: 10px; color: #fff; font-weight: 600;
    font-size: .92rem; cursor: pointer; transition: filter .15s, transform .1s;
}
.nk-btn:hover:not(:disabled) { filter: brightness(1.08); }
.nk-btn:active:not(:disabled) { transform: scale(.98); }
.nk-btn:disabled { opacity: .4; cursor: default; }
.nk-btn-lock { background: linear-gradient(135deg, #22c55e, #15803d); }
.nk-btn-unlock { background: linear-gradient(135deg, #fbbf24, #d97706); }
.nk-btn-open { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.nk-confirm {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: .7rem .8rem;
    display: flex; flex-direction: column; gap: .5rem; font-weight: 600; color: #7c2d12;
}
.nk-confirm-buttons { display: flex; gap: .5rem; justify-content: flex-end; }
.nk-log { list-style: none; margin: 0; padding: 0; border-top: 1px solid #e2e8f0; max-height: 320px; overflow-y: auto; }
.nk-log li { display: flex; gap: .7rem; padding: .45rem .1rem; border-bottom: 1px solid #f1f5f9; font-size: .86rem; }
.nk-log li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: .35rem; flex: none; background: #cbd5e1; }
.nk-log-open::before { background: #f59e0b !important; }
.nk-log-close::before { background: #16a34a !important; }
.nk-log-time { color: #64748b; white-space: nowrap; min-width: 6.5rem; }
.nk-log-text { display: flex; flex-direction: column; }
.nk-log-who { color: #64748b; font-size: .8rem; }
.nk-log-empty { color: #94a3b8; }

/* Türschloss: Code-Freigabe */
.nk-pin {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    max-width: 1100px; margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 12px;
    background: #f1f5f9; border: 1px solid #e2e8f0;
}
.nk-pin-open { background: #fef3c7; border-color: #fcd34d; }
.nk-pin-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; width: 100%; }
.nk-pin-icon { font-size: 1.4rem; }
.nk-pin-text { flex: 1 1 260px; color: #334155; }
.nk-pin-text span { color: #64748b; }
.nk-pin input {
    width: 8.5rem; padding: .5rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 1.05rem; letter-spacing: .25em; text-align: center;
}

/* ---------- Administration: Einzelrechte ---------- */
.perm-card { max-width: 560px; }
.perm-group { border: 1px solid #e2e8f0; border-radius: 8px; padding: .5rem .8rem .7rem; margin: 0 0 .7rem; }
.perm-group legend { font-weight: 600; color: #334155; padding: 0 .3rem; font-size: .9rem; }
.perm-item { display: flex !important; flex-direction: row !important; align-items: center; gap: .5rem; margin: .3rem 0; font-weight: 400; }
.perm-item input { width: 1rem; height: 1rem; margin: 0; }
.perm-note { font-size: .82rem; color: #64748b; }
.perm-spacer { flex: 1; }

/* Where we have been: Suche */
.wow-search {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    margin-bottom: .6rem; position: relative; max-width: 720px;
}
.wow-search-icon { position: absolute; left: .7rem; top: .55rem; font-size: .95rem; opacity: .6; pointer-events: none; }
.wow-search-input {
    flex: 1 1 260px; min-width: 0; padding: .55rem 2.2rem .55rem 2.2rem;
    border: 1px solid #cbd5e1; border-radius: 999px; font-size: .95rem; background: #fff;
}
.wow-search-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.wow-search-input::-webkit-search-cancel-button { display: none; }
.wow-search-clear {
    margin-left: -2.4rem; width: 1.8rem; height: 1.8rem; border: 0; border-radius: 50%;
    background: #e2e8f0; color: #475569; font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.wow-search-clear:hover { background: #cbd5e1; }
.wow-search-count { font-size: .85rem; color: #64748b; margin-left: .4rem; }
.wow-search .btn { flex: none; }
.wow-search-results {
    list-style: none; margin: -.2rem 0 .8rem; padding: .3rem; max-width: 720px;
    background: #fff; border-radius: 12px; box-shadow: 0 6px 20px rgba(15, 23, 42, .15);
}
.wow-search-results li button {
    display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%;
    padding: .55rem .7rem; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer;
}
.wow-search-results li button:hover, .wow-search-results li button:focus { background: #eff6ff; outline: none; }
.wow-search-results li button span { font-size: .8rem; color: #64748b; }
.wow-search-empty { padding: .6rem .7rem; color: #64748b; font-size: .9rem; }

/* =====================================================================
   Handy / Tablet: Burger-Menü und responsive Seiten
   ===================================================================== */

/* Elemente, die es nur auf dem Handy gibt */
.mobile-bar, .sidebar-backdrop, .sidebar-close { display: none; }

/* Raster überall so, dass sie nie breiter als der Bildschirm werden */
.gallery { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.games-grid { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.ew-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.nk-grid { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.wx-history-tables { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.content { min-width: 0; }

@media (max-width: 860px) {
    /* ---------- Rahmen: Kopfleiste + ausklappbares Menü ---------- */
    .app { flex-direction: column; }

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: .75rem;
        position: sticky;
        top: 0;
        z-index: 900;
        height: 56px;
        padding: 0 .75rem;
        background: #1f2937;
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    }
    .mobile-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
    .mobile-brand.brand-btn { padding: .25rem .45rem; border-radius: 8px; }
    .mobile-brand .brand-logo { width: auto; height: 34px; }

    .burger {
        width: 44px; height: 44px;
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        padding: 0 10px; border: 0; border-radius: 8px;
        background: transparent; cursor: pointer;
    }
    .burger:active { background: rgba(255, 255, 255, .12); }
    .burger span { display: block; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s, opacity .2s; }
    .menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-open .burger span:nth-child(2) { opacity: 0; }
    .menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(82vw, 300px);
        z-index: 1001;
        overflow-y: auto;
        padding: 1rem 1rem 2rem;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, .35);
    }
    .menu-open .sidebar { transform: none; }

    .sidebar-backdrop {
        display: block;
        position: fixed; inset: 0;
        z-index: 1000;
        background: rgba(15, 23, 42, .5);
        opacity: 0; pointer-events: none;
        transition: opacity .25s ease;
    }
    .menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    .sidebar-close {
        display: block;
        position: absolute; top: .55rem; right: .6rem;
        width: 40px; height: 40px;
        border: 0; border-radius: 8px;
        background: transparent; color: #fff;
        font-size: 1.8rem; line-height: 1; cursor: pointer;
    }
    .sidebar .brand { padding-right: 2.5rem; }
    .menu-btn { padding: .8rem .9rem; }

    /* ---------- allgemeiner Inhalt ---------- */
    .content { padding: 1rem .85rem 2rem; }
    h1 { font-size: 1.5rem; margin: .4rem 0 .8rem; }
    h2 { font-size: 1.25rem; }

    /* Eingabefelder mit 16px: verhindert das automatische Hineinzoomen auf dem iPhone */
    input, select, textarea { font-size: 16px; }

    .form-card, .admin-edit-card, .login, .wow-form, .perm-card { max-width: 100%; }
    .form-card { padding: 1rem; }

    /* breite Tabellen seitlich wischbar statt die Seite zu sprengen */
    .weather-table, .admin-table, .kv-cat-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        max-width: 100%;
    }
    .kv-cat-table select { min-width: 160px; }

    .lightbox-overlay { padding: .5rem; }
    .lightbox-close { top: -2.2rem; right: .25rem; }

    /* ---------- Startseite ---------- */
    .home-page { min-height: calc(100vh - 56px - 2rem); padding: 1rem .5rem; }
    .home-card { padding: 1.5rem 1rem; width: 100%; }
    .home-weather { width: 100%; }
    .logo-heading { margin-bottom: 1.25rem; }
    .logo { height: 130px; margin: 0 auto; }
    .walking-crab { width: 40px; }

    /* ---------- Wetter ---------- */
    .wx-summary { padding: 1.25rem 1rem; gap: 1.25rem; }
    .wx-temp { font-size: 2.8rem; }
    .wx-history-controls { flex-direction: column; align-items: stretch; }
    .wx-mode-switch { justify-content: space-between; }
    .wx-mode-btn { flex: 1; }
    .wx-date-nav { justify-content: space-between; flex-wrap: wrap; }
    .wx-date-nav input[type="date"] { flex: 1; min-width: 0; }

    /* ---------- Verwaltung ---------- */
    .kv-layout { flex-direction: column; gap: 1rem; }
    .kv-tree { min-width: 0; max-width: none; width: 100%; max-height: 45vh; }
    .kv-detail { min-width: 0; width: 100%; }
    .kv-form { grid-template-columns: 1fr; }
    .kv-page-tabs { flex-wrap: wrap; }
    .kv-doku-preview-frame { height: 60vh; min-height: 300px; }
    .kv-doku-preview-head { flex-wrap: wrap; }
    .kv-ausschnitt-overlay { padding: .5rem; }
    .kv-ausschnitt-dialog { padding: .8rem; }

    /* ---------- Where we have been ---------- */
    .wow-map { flex: 1 1 100%; height: 50vh; min-height: 300px; }
    .wow-list { flex: 1 1 100%; max-height: none; }
    .wow-list li { flex-direction: column; align-items: stretch; }
    .wow-list-buttons { flex-direction: row; }
    .wow-list-buttons .btn { flex: 1; }
    .wow-personen-checks { flex-wrap: wrap; }
    .wow-search { max-width: none; }

    /* ---------- Games ---------- */
    .reversi-layout, .abalone-layout, .gol-layout { gap: 1rem; }
    .reversi-board {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: none;
        width: min(100%, 380px);
        padding: 4px;
    }
    .reversi-cell { width: auto; height: auto; aspect-ratio: 1; }
    .reversi-cell img { width: 72%; height: 72%; }
    .reversi-side, .abalone-side { min-width: 0; max-width: none; width: 100%; }
    .ab-arrow circle { r: 15px; }          /* größere Tippfläche für die Zugpfeile */
    .gol-stage { flex: 1 1 100%; min-width: 0; }
    .gol-panel { flex: 1 1 100%; min-width: 0; }
    .gol-statusbar { gap: .4rem 1rem; font-size: .9rem; }

    /* ---------- Zeitschaltuhren / Türschloss ---------- */
    .ew-toolbar { gap: .6rem; }
    .ew-card, .nk-card { padding: .9rem; }
    .nk-badge { width: 54px; height: 54px; }
    .nk-pin { padding: .7rem; }
    .nk-pin-form input { flex: 1 1 7rem; width: auto; }
    .nk-log-time { min-width: 5.5rem; }

    /* ---------- Administration ---------- */
    .admin-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 420px) {
    .wx-stats { grid-template-columns: 1fr 1fr; gap: .7rem 1rem; }
    .gol-buttons { grid-template-columns: 1fr 1fr; }
    .nk-actions { grid-template-columns: 1fr; }
    .ew-timer-line select, .ew-timer-line input { flex: 1 1 auto; }
}

/* =====================================================================
   Administration: Benutzerkarten + Dialoge
   ===================================================================== */
.adm-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; max-width: 1200px; }
.adm-stats { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-stat { display: inline-flex; align-items: center; gap: .35rem; background: #fff; border-radius: 999px; padding: .3rem .8rem; font-size: .88rem; color: #475569; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.adm-stat strong { color: #0f172a; }
.adm-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.adm-dot-on { background: #22c55e; }
.adm-search { flex: 0 1 280px; min-width: 0; padding: .5rem .9rem; border: 1px solid #cbd5e1; border-radius: 999px; font-size: .95rem; background: #fff; }
.adm-search:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }

.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 1rem; max-width: 1200px; }
.adm-card { background: #fff; border-radius: 14px; padding: 1rem 1.1rem; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.adm-head { display: flex; align-items: center; gap: .8rem; }
.adm-avatar {
    position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; color: #fff; background: #94a3b8;
}
.adm-avatar.adm-r-admin { background: linear-gradient(135deg, #f87171, #dc2626); }
.adm-avatar.adm-r-power { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.adm-avatar.adm-r-standard { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.adm-avatar-online { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.adm-ident { flex: 1; min-width: 0; }
.adm-username { font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-fullname { color: #64748b; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-role { flex: none; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .2rem .65rem; background: #f1f5f9; color: #475569; }
.adm-role.adm-r-admin { background: #fee2e2; color: #b91c1c; }
.adm-role.adm-r-power { background: #ede9fe; color: #6d28d9; }
.adm-role.adm-r-standard { background: #dbeafe; color: #1d4ed8; }
.adm-mail { color: #2563eb; font-size: .88rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-mail:hover { text-decoration: underline; }
.adm-perms { display: flex; flex-wrap: wrap; gap: .3rem; }
.adm-perm { font-size: .75rem; background: #f1f5f9; color: #334155; border-radius: 6px; padding: .15rem .5rem; }
.adm-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .8rem; color: #64748b; }
.adm-card-actions { display: flex; gap: .5rem; margin-top: auto; padding-top: .3rem; border-top: 1px solid #f1f5f9; }
.adm-card-actions .btn { flex: 1; padding-top: .5rem; padding-bottom: .5rem; }
.adm-card-actions .adm-delete { flex: 0 0 auto; }

/* Dialoge */
.adm-modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1100; }
.adm-modal {
    position: fixed; z-index: 1101;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto;
    background: #fff; border-radius: 16px; padding: 1.2rem 1.3rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
}
.adm-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.adm-modal-head h3 { margin: 0; font-size: 1.15rem; }
.adm-modal-close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #f1f5f9; font-size: 1.4rem; line-height: 1; cursor: pointer; color: #475569; }
.adm-modal-close:hover { background: #e2e8f0; }
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
.adm-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: #334155; }
.adm-form input, .adm-form select { padding: .55rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; background: #fff; min-width: 0; }
.adm-form input:focus, .adm-form select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.adm-perm-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.adm-modal-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }

@media (max-width: 860px) {
    .adm-search { flex: 1 1 100%; }
    .adm-form, .adm-perm-groups { grid-template-columns: 1fr; }
    /* Dialog als Blatt von unten */
    .adm-modal {
        top: auto; bottom: 0; left: 0; transform: none;
        width: 100%; max-height: 90vh;
        border-radius: 18px 18px 0 0;
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    }
    .adm-modal-actions .btn { flex: 1 1 auto; }
}

/* ---------- KFZ-Kosten ---------- */
.kfz-notice { max-width: 1200px; margin-bottom: 1rem; padding: .7rem 1rem; border-radius: 10px; font-weight: 500; }
.kfz-notice-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.kfz-notice-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.kfz-vehicles { display: flex; gap: .6rem; flex-wrap: wrap; max-width: 1200px; margin-bottom: 1rem; }
.kfz-vehicle {
    --kfz-color: #3b82f6;
    display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem;
    border-radius: 999px; border: 2px solid #e2e8f0; background: #fff; color: #334155;
    font-size: .95rem; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.kfz-vehicle:hover { border-color: var(--kfz-color); }
.kfz-vehicle-active { border-color: var(--kfz-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kfz-color) 22%, transparent); font-weight: 600; }
.kfz-vehicle-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--kfz-color); flex: none; }
.kfz-vehicle-add { border-style: dashed; color: #64748b; }
.kfz-plate {
    font-family: "DIN Alternate", "Arial Narrow", sans-serif; font-size: .75rem; font-weight: 700; letter-spacing: .04em;
    border: 1.5px solid #1e293b; border-left: 6px solid #1d4ed8; border-radius: 4px; padding: 0 .35rem; background: #fff; color: #0f172a;
    white-space: nowrap;
}

.kfz-card {
    background: #fff; border-radius: 16px; padding: 1.1rem 1.25rem; box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
    min-width: 0;
}
.kfz-card h2 { margin: 0 0 .6rem; font-size: 1.15rem; color: #1e293b; }
.kfz-empty { max-width: 560px; text-align: center; padding: 2rem; }
.kfz-sub { margin: -.3rem 0 .9rem; color: #64748b; font-size: .9rem; }

.kfz-tabs { display: flex; gap: .3rem; max-width: 1200px; margin-bottom: 1rem; border-bottom: 2px solid #e2e8f0; overflow-x: auto; scrollbar-width: none; }
.kfz-tabs::-webkit-scrollbar { display: none; }
.kfz-tab {
    background: none; border: 0; padding: .6rem 1rem; font-size: .95rem; color: #64748b; cursor: pointer; white-space: nowrap;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.kfz-tab:hover { color: #1e293b; }
.kfz-tab-active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.kfz-grid-2 { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 1.1rem; max-width: 1200px; margin-bottom: 1.1rem; align-items: start; }

.kfz-form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem .9rem; }
.kfz-form label { display: block; font-size: .85rem; font-weight: 600; color: #475569; min-width: 0; }
.kfz-form input, .kfz-form select, .kfz-filters select {
    font: inherit; font-weight: 400; font-size: 1rem; color: #0f172a; padding: .55rem .65rem;
    border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; width: 100%; box-sizing: border-box; min-width: 0;
}
.kfz-form label > input, .kfz-form label > select { display: block; margin-top: .3rem; }
.kfz-form label > .kfz-hint { display: block; margin-top: .3rem; }
.kfz-form input:focus, .kfz-form select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.kfz-form input[type="color"] { padding: .15rem; height: 2.55rem; cursor: pointer; }
.kfz-span-2 { grid-column: 1 / -1; }
.kfz-opt { font-weight: 400; color: #94a3b8; font-size: .78rem; }
.kfz-hint { font-size: .82rem; color: #64748b; font-weight: 400; margin: .6rem 0 0; }
.kfz-form .kfz-hint { margin: 0; }

.kfz-segment { display: grid; grid-template-columns: 1fr 1fr; background: #f1f5f9; border-radius: 10px; padding: 4px; gap: 4px; }
.kfz-seg { border: 0; background: none; padding: .55rem .4rem; border-radius: 8px; font-size: .92rem; color: #475569; cursor: pointer; }
.kfz-seg-active { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }

.kfz-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }

.kfz-list-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.kfz-list-head h2 { margin: 0; }
.kfz-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.kfz-filters select { width: auto; font-size: .9rem; padding: .4rem .55rem; }

.kfz-entries { list-style: none; margin: 0; padding: 0; max-height: 620px; overflow-y: auto; }
.kfz-entry { display: flex; align-items: center; gap: .75rem; padding: .6rem .3rem; border-bottom: 1px solid #f1f5f9; }
.kfz-entry:last-child { border-bottom: 0; }
.kfz-entry-edit { background: #eff6ff; border-radius: 10px; }
.kfz-entry-icon {
    width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; background: #f1f5f9;
}
.kfz-t-kraftstoff { background: #fef3c7; }
.kfz-t-strom { background: #dbeafe; }
.kfz-t-standard { background: #f1f5f9; }
.kfz-entry-main { flex: 1; min-width: 0; }
.kfz-entry-top { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.kfz-entry-date { color: #64748b; font-size: .82rem; }
.kfz-entry-details { color: #64748b; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.kfz-entry-amount { font-weight: 700; color: #0f172a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kfz-entry-actions { display: flex; gap: .15rem; }
.kfz-entry-actions button {
    background: none; border: 0; cursor: pointer; font-size: 1rem; width: 34px; height: 34px; border-radius: 8px; color: #64748b;
}
.kfz-entry-actions button:hover { background: #f1f5f9; color: #0f172a; }
.kfz-list-sum { display: flex; justify-content: space-between; padding-top: .7rem; margin-top: .3rem; border-top: 2px solid #e2e8f0; color: #475569; }
.kfz-list-sum strong { color: #0f172a; }

.kfz-overview-title span { font-weight: 400; color: #64748b; font-size: .95rem; margin-left: .3rem; }
.kfz-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; max-width: 1200px; margin-bottom: 1.1rem; }
.kfz-tile {
    background: #fff; border-radius: 14px; padding: .85rem 1rem; box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
    display: flex; flex-direction: column; gap: .15rem;
}
.kfz-tile span { font-size: .8rem; color: #64748b; }
.kfz-tile strong { font-size: 1.35rem; color: #0f172a; font-variant-numeric: tabular-nums; }
.kfz-tile em { font-style: normal; font-size: .8rem; color: #94a3b8; }
.kfz-tile-main { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.kfz-tile-main span, .kfz-tile-main strong { color: #fff; }

.kfz-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.kfz-bars li { display: grid; grid-template-columns: 1fr 3rem; grid-template-areas: "label label" "track pct"; gap: .25rem .5rem; align-items: center; }
.kfz-bar-label { grid-area: label; display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.kfz-bar-track { grid-area: track; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.kfz-bar { height: 100%; border-radius: 999px; background: #94a3b8; }
.kfz-bar.kfz-t-kraftstoff { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.kfz-bar.kfz-t-strom { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.kfz-bar.kfz-t-standard { background: linear-gradient(90deg, #a5b4fc, #6366f1); }
.kfz-bar-pct { grid-area: pct; font-size: .78rem; color: #64748b; text-align: right; }

.kfz-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem; height: 200px; align-items: end; }
.kfz-month { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .25rem; font-size: .72rem; color: #64748b; }
.kfz-month-bar { width: 100%; max-width: 34px; max-height: calc(100% - 1.2rem); min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #60a5fa, #2563eb); }

.kfz-table-wrap { overflow-x: auto; }
.kfz-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.kfz-table th { text-align: right; color: #64748b; font-weight: 600; padding: .45rem .6rem; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.kfz-table td { text-align: right; padding: .45rem .6rem; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.kfz-table th:first-child, .kfz-table td:first-child { text-align: left; }
.kfz-table tbody tr:hover { background: #f8fafc; }

.kfz-import { margin-top: 0; }

@media (max-width: 860px) {
    .kfz-grid-2 { grid-template-columns: 1fr; }
    .kfz-card { padding: .95rem 1rem; border-radius: 14px; }
    .kfz-tiles { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .kfz-tile-main { grid-column: 1 / -1; }
    .kfz-tile strong { font-size: 1.15rem; }
    .kfz-tab { padding: .55rem .7rem; font-size: .9rem; }
    .kfz-vehicle { padding: .4rem .75rem; font-size: .9rem; }
    .kfz-months { height: 150px; gap: .2rem; }
    .kfz-month { font-size: .62rem; }
    .kfz-entry { gap: .5rem; }
    .kfz-entry-icon { width: 32px; height: 32px; font-size: .95rem; }
    .kfz-entry-actions { flex-direction: column; }
    .kfz-entry-actions button { height: 28px; }
    .kfz-entries { max-height: none; }
}
@media (max-width: 420px) {
    .kfz-form { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .kfz-entry-actions button { width: 30px; }
}

/* KFZ-Kosten: Kauf/Verkauf */
.kfz-form-sep { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; border-top: 1px solid #e2e8f0; padding-top: .7rem; margin-top: .2rem; }
.kfz-form-sep .kfz-opt { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: .3rem; }
.kfz-sold { font-size: .7rem; background: #f1f5f9; color: #64748b; border-radius: 999px; padding: .05rem .45rem; }
.kfz-section-title { max-width: 1200px; margin: .2rem 0 .6rem; font-size: 1rem; color: #475569; }
.kfz-tile-main em { color: rgba(255, 255, 255, .8); }

/* KFZ-Kosten: Wertentwicklung */
.kfz-tile-value { border: 2px solid #22c55e; }
.kfz-tile-value strong { color: #15803d; }
.kfz-t-wert { background: #dcfce7; }
.kfz-values { margin-top: 1rem; border-top: 1px solid #e2e8f0; padding-top: .3rem; max-height: 320px; }
.kfz-chart { width: 100%; height: auto; display: block; }
.kfz-chart-grid { stroke: #e2e8f0; stroke-width: 1; }
.kfz-chart-label { fill: #64748b; font-size: 13px; }
@media (max-width: 860px) { .kfz-chart-label { font-size: 21px; } }
.kfz-chart-line { fill: none; stroke: #2563eb; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.kfz-chart-est { stroke: #94a3b8; stroke-dasharray: 7 6; }
.kfz-chart-point { fill: #fff; stroke: #2563eb; stroke-width: 3; }

/* ---------- Solaranlage (AlphaESS) ---------- */
.pv-page { max-width: 1200px; --pv-pv: #e8a20c; --pv-load: #2f6fdc; --pv-bat: #12a17a; --pv-grid: #8b5cf6; }
.pv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pv-head h1 { margin: 0 0 .2rem; }
.pv-sub { color: #64748b; font-size: .92rem; }
.pv-sn { color: #94a3b8; }
.pv-head-right { display: flex; align-items: center; gap: .8rem; }
.pv-updated { color: #64748b; font-size: .85rem; display: inline-flex; align-items: center; gap: .4rem; }
.pv-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pv-pulse 2s infinite; }
@keyframes pv-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.pv-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 1.1rem 1.3rem; margin-bottom: 1rem; box-shadow: 0 2px 10px rgba(15,23,42,.04); }
.pv-card h2 { font-size: 1.05rem; margin: 0 0 .7rem; color: #0f172a; }
.pv-card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .4rem; }
.pv-card-head h2 { margin: 0; }
.pv-muted { color: #94a3b8; }
.pv-small { font-size: .8rem; margin: .4rem 0 0; }

.pv-top { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: 1rem; }
.pv-top .pv-card { margin-bottom: 1rem; }

/* Energiefluss */
.pv-flow { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.pv-wire { fill: none; stroke: #e2e8f0; stroke-width: 4; stroke-linecap: round; }
.pv-flowline { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; animation: pv-flow 1.5s linear infinite; }
.pv-flowline.rev { animation-direction: reverse; }
.pv-flow-pv { stroke: var(--pv-pv); }
.pv-flow-load { stroke: var(--pv-load); }
.pv-flow-grid { stroke: var(--pv-grid); }
.pv-flow-bat { stroke: var(--pv-bat); }
@keyframes pv-flow { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .pv-flowline { animation: none; stroke-dasharray: none; } .pv-live-dot { animation: none; } }
.pv-hub { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 2; }
.pv-hub-glyph { fill: none; stroke: #64748b; stroke-width: 1.6; stroke-linejoin: round; }
.pv-node > circle { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 2; transition: fill .3s, stroke .3s; }
.pv-glyph, .pv-glyph * { fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pv-node-pv.on > circle { fill: #fef3c7; stroke: var(--pv-pv); }
.pv-node-pv.on .pv-glyph, .pv-node-pv.on .pv-glyph * { stroke: #b45309; }
.pv-node-load.on > circle { fill: #dbeafe; stroke: var(--pv-load); }
.pv-node-load.on .pv-glyph { stroke: #1d4ed8; }
.pv-node-grid.on > circle { fill: #ede9fe; stroke: var(--pv-grid); }
.pv-node-grid.on .pv-glyph { stroke: #6d28d9; }
.pv-node-bat > circle { fill: #f8fafc; stroke: #e2e8f0; stroke-width: 6; }
.pv-node-bat .pv-soc-ring { fill: none; stroke: var(--pv-bat); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .6s; }
.pv-soc-text { font-size: 15px; font-weight: 700; fill: #0f172a; }
.pv-node-value { font-size: 16px; font-weight: 700; fill: #0f172a; }
.pv-node-label { font-size: 11.5px; fill: #64748b; }
.pv-details { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; justify-content: center; font-size: .85rem; color: #64748b; margin-top: .4rem; }
.pv-details strong { color: #0f172a; }

/* Heute-Kacheln */
.pv-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.pv-tile { background: #f8fafc; border-radius: 12px; padding: .65rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
.pv-tile-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.pv-tile strong { font-size: 1.3rem; color: #0f172a; }
.pv-tile small { font-size: .8rem; font-weight: 500; color: #64748b; }
.pv-tile-main { grid-column: 1 / -1; background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.pv-tile-main .pv-tile-label, .pv-tile-main small { color: rgba(255,255,255,.88); }
.pv-tile-main strong { color: #fff; font-size: 1.9rem; }
.pv-bar { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: .2rem; }
.pv-bar > span { display: block; height: 100%; background: var(--pv-bat); border-radius: 99px; }
.pv-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid #e2e8f0; }
.pv-totals div { display: flex; flex-direction: column; }
.pv-totals span { font-size: .72rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.pv-totals strong { font-size: 1.05rem; color: #0f172a; }

/* Diagramme */
.pv-date-nav { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.pv-date-nav input[type="date"] { padding: .35rem .5rem; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; }
.pv-nav-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 1.15rem; line-height: 1; }
.pv-nav-btn:disabled { opacity: .4; cursor: default; }
.pv-link { background: none; border: 0; color: #2563eb; cursor: pointer; font: inherit; font-size: .9rem; padding: .2rem .3rem; }
.pv-range-label { font-size: .9rem; color: #334155; min-width: 9.5rem; text-align: center; }
.pv-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; font-size: .85rem; color: #334155; margin: .3rem 0 .4rem; }
.pv-legend-sum { color: #64748b; margin-left: auto; }
.pv-sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: .35rem; vertical-align: middle; }
.pv-sw-pv { background: var(--pv-pv); }
.pv-sw-load { background: var(--pv-load); }
.pv-chart-wrap { position: relative; }
.pv-chart { width: 100%; height: auto; display: block; overflow: visible; }
.pv-grid { stroke: #eef2f6; stroke-width: 1; }
.pv-axis { fill: #94a3b8; font-size: 11px; }
.pv-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pv-line-pv { stroke: var(--pv-pv); }
.pv-line-load { stroke: var(--pv-load); }
.pv-line-soc { stroke: var(--pv-bat); }
.pv-area-pv { fill: var(--pv-pv); opacity: .18; }
.pv-area-soc { fill: var(--pv-bat); opacity: .12; }
.pv-crosshair { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 3; }
.pv-dot { stroke: #fff; stroke-width: 2; }
.pv-dot-pv { fill: var(--pv-pv); }
.pv-dot-load { fill: var(--pv-load); }
.pv-dot-soc { fill: var(--pv-bat); }
.pv-hit { fill: transparent; cursor: crosshair; }
.pv-bar-pv { fill: var(--pv-pv); }
.pv-bar-load { fill: var(--pv-load); }
.pv-bar-hover { fill: #f1f5f9; }
.pv-subchart-title { font-size: .9rem; color: #475569; margin: .9rem 0 .2rem; font-weight: 600; }
.pv-tip { position: absolute; top: 4px; transform: translateX(12px); background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: .5rem .65rem; font-size: .8rem; line-height: 1.45; pointer-events: none; white-space: nowrap; box-shadow: 0 6px 20px rgba(15,23,42,.25); z-index: 2; }
.pv-tip-left { transform: translateX(calc(-100% - 12px)); }
.pv-tip strong { color: #fff; margin-left: .3rem; }
.pv-tip-time { font-weight: 700; color: #fff; margin-bottom: .15rem; }
.pv-tip-sub { color: #94a3b8; }
.pv-table-wrap { overflow-x: auto; }
.pv-table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.pv-table th, .pv-table td { padding: .4rem .6rem; text-align: right; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
.pv-table th:first-child, .pv-table td:first-child { text-align: left; }
.pv-table th { color: #64748b; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

/* Wallbox */
.pv-ev-card { --ev: #0ea5e9; }
.pv-ev-today { font-size: .88rem; color: #64748b; }
.pv-ev-today strong { color: #0f172a; }
.pv-ev-list { display: grid; gap: .8rem; }
.pv-ev { display: grid; grid-template-columns: auto minmax(180px, 1fr) minmax(200px, 1.2fr); align-items: center; gap: 1.1rem; background: #f8fafc; border-radius: 14px; padding: .8rem 1rem; --tone: #94a3b8; --tone-bg: #f1f5f9; }
.pv-ev-charging { --tone: #0ea5e9; --tone-bg: #e0f2fe; }
.pv-ev-ready    { --tone: #12a17a; --tone-bg: #dcfce7; }
.pv-ev-paused   { --tone: #d97706; --tone-bg: #fef3c7; }
.pv-ev-fault    { --tone: #dc2626; --tone-bg: #fee2e2; }
.pv-ev-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--tone-bg); display: grid; place-items: center; }
.pv-ev-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--tone); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pv-ev-icon .pv-ev-screen { fill: var(--tone-bg); }
.pv-ev-charging .pv-ev-bolt { animation: pv-ev-blink 1.4s ease-in-out infinite; }
@keyframes pv-ev-blink { 50% { opacity: .25; } }
.pv-ev-main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.pv-ev-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--tone); }
.pv-ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.pv-ev-charging .pv-ev-dot { animation: pv-pulse 2s infinite; }
.pv-ev-power { font-size: 1.7rem; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.15; }
.pv-ev-meter { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.pv-ev-meter > span { display: block; height: 100%; background: var(--tone); border-radius: 99px; transition: width .6s; }
.pv-ev-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem .9rem; }
.pv-ev-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.pv-ev-facts dd { margin: 0; font-size: .95rem; font-weight: 600; color: #0f172a; overflow-wrap: anywhere; }

/* Wallbox-Zeile in der Solaranlage-Kachel im Dashboard */
.db-ev { --tone: #6b7280; --tone-bg: #f3f4f6; display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .7rem; margin-top: .6rem; padding: .5rem .75rem; border-radius: 10px; background: var(--tone-bg); }
.db-ev-charging { --tone: #0284c7; --tone-bg: #e0f2fe; }
.db-ev-ready    { --tone: #12a17a; --tone-bg: #dcfce7; }
.db-ev-paused   { --tone: #b45309; --tone-bg: #fef3c7; }
.db-ev-fault    { --tone: #dc2626; --tone-bg: #fee2e2; }
.db-ev-label { font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.db-ev-status { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--tone); }
.db-ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.db-ev-charging .db-ev-dot { animation: pv-pulse 2s infinite; }
.db-ev-power { margin-left: auto; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-ev-current { font-size: .8rem; color: #6b7280; }

@media (max-width: 860px) {
    .pv-top { grid-template-columns: 1fr; gap: 0; }
    .pv-card { padding: .9rem 1rem; border-radius: 14px; }
    .pv-axis { font-size: 18px; }
    .pv-legend-sum { margin-left: 0; width: 100%; }
    .pv-head-right { width: 100%; justify-content: space-between; }
    .pv-ev { grid-template-columns: auto 1fr; }
    .pv-ev-facts { grid-column: 1 / -1; }
}

/* ---------- Rolläden (Somfy TaHoma) ---------- */
.rl-page { max-width: 1200px; }
.rl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.rl-head h1 { margin: 0 0 .2rem; }
.rl-sub { color: #64748b; font-size: .92rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.rl-head-right { display: flex; align-items: center; gap: .8rem; }
.rl-updated { color: #94a3b8; font-size: .85rem; }

.rl-quick { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: .8rem 1.1rem; margin-bottom: 1.2rem; }
.rl-quick-group { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.rl-quick-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-right: .2rem; }
.rl-scene { border: 1px solid #c7d2fe; background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #3730a3; border-radius: 999px; padding: .4rem .9rem; cursor: pointer; font: inherit; font-size: .9rem; }
.rl-scene:hover:not(:disabled) { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }

.rl-room { margin-bottom: 1.2rem; }
.rl-room-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.rl-room-head h2 { font-size: 1rem; margin: 0; color: #334155; }
.rl-room-actions { display: flex; gap: .3rem; }
.rl-mini { width: 30px; height: 26px; border-radius: 7px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: .75rem; color: #475569; }
.rl-mini:hover:not(:disabled) { background: #f1f5f9; }

.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.rl-card { display: flex; gap: .9rem; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: .8rem .95rem; box-shadow: 0 2px 10px rgba(15,23,42,.04); transition: border-color .2s, box-shadow .2s; }
.rl-card.rl-moving { border-color: #93c5fd; box-shadow: 0 4px 18px rgba(59,130,246,.15); }
.rl-card.rl-offline { opacity: .6; }
.rl-visual { flex: 0 0 64px; }
.rl-visual svg { width: 64px; height: auto; display: block; }
.rl-visual-awning svg { width: 72px; }
.rl-window { fill: #dbeafe; stroke: #94a3b8; stroke-width: 2; }
.rl-window-unknown { fill: #f1f5f9; stroke-dasharray: 4 3; }
.rl-window-bar { stroke: #94a3b8; stroke-width: 1.5; }
.rl-box { fill: #cbd5e1; }
.rl-shutter { fill: #64748b; transition: height .6s ease; }
.rl-slat { stroke: #475569; stroke-width: 1; }
.rl-awn-box { fill: #94a3b8; }
.rl-awn-cloth { fill: #f59e0b; opacity: .85; transition: d .6s ease; }
.rl-ground { stroke: #cbd5e1; stroke-width: 2; }
.rl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.rl-name { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-state { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; color: #475569; }
.rl-type { color: #94a3b8; font-size: .78rem; }
.rl-moving-label { color: #2563eb; font-weight: 600; }
.rl-buttons { display: flex; gap: .35rem; }
.rl-btn { min-width: 44px; height: 34px; padding: 0 .7rem; border-radius: 9px; border: 1px solid #d1d5db; background: linear-gradient(180deg, #fff, #f1f5f9); cursor: pointer; font: inherit; font-size: .9rem; color: #334155; }
.rl-btn:hover:not(:disabled) { background: linear-gradient(180deg, #f8fafc, #e2e8f0); }
.rl-btn:disabled { opacity: .45; cursor: default; }
.rl-btn-up { color: #1d4ed8; }
.rl-btn-down { color: #334155; }
.rl-buttons .rl-btn { flex: 1; }
.rl-slider { display: flex; align-items: center; gap: .5rem; }
.rl-slider input[type="range"] { flex: 1; accent-color: #3b82f6; }
.rl-slider-value { font-size: .8rem; color: #64748b; min-width: 2.8rem; text-align: right; }
.rl-log { margin-top: 1rem; }
.rl-log .pv-table { margin-top: .5rem; }
.rl-log-devices { text-align: left !important; white-space: normal !important; color: #475569; }

@media (max-width: 860px) {
    .rl-quick { padding: .7rem .8rem; gap: .6rem; }
    .rl-grid { grid-template-columns: 1fr; }
    .rl-btn { height: 40px; }
    .rl-head-right { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .rl-shutter, .rl-awn-cloth { transition: none; } }

/* ---------- Verwaltung: Kontoauszüge ---------- */
.ka-page { max-width: 1200px; }
.ka-upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; max-width: none; margin-bottom: 1.5rem; }
.ka-upload .kv-hint { margin: 0; flex-basis: 100%; }
.ka-upload-label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; }
.ka-check { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.ka-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.ka-toolbar h2 { margin: 0; }
.ka-toolbar label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; }
.ka-toolbar select { padding: .35rem .5rem; border: 1px solid #d1d5db; border-radius: 6px; }
.ka-table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }
.ka-table { width: 100%; max-width: none; margin: 0; }
.ka-table td { vertical-align: top; }
.ka-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ka-neg { color: #b91c1c; }
.ka-pos { color: #047857; }
.ka-file { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-in-jahr { width: 70px; padding: .3rem; border: 1px solid #d1d5db; border-radius: 6px; }
.ka-in-nr { width: 52px; padding: .3rem; border: 1px solid #d1d5db; border-radius: 6px; }
.ka-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.ka-actions .btn { padding: .35rem .7rem; font-size: .8rem; }
.ka-badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.ka-badge-open { background: #fef3c7; color: #92400e; }
.ka-badge-ok { background: #dcfce7; color: #166534; }
.ka-detail { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed #d1d5db; }
.ka-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ka-detail-head h3 { margin: 0; }
.ka-warn { margin: .75rem 0; padding: .6rem 1rem .6rem 2rem; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; font-size: .85rem; color: #92400e; }
.ka-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.ka-summary > div { background: #fff; border-radius: 10px; padding: .7rem .9rem; box-shadow: 0 1px 4px rgba(0,0,0,.1); display: flex; flex-direction: column; gap: .2rem; }
.ka-summary span { font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.ka-summary strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.ka-check-ok { border-left: 4px solid #16a34a; }
.ka-check-bad { border-left: 4px solid #dc2626; }
.ka-check-bad strong { color: #b91c1c; }
.ka-buchungstext { font-weight: 600; }
.ka-zweck { white-space: pre-line; font-size: .85rem; color: #4b5563; margin-top: .15rem; }
.ka-pos-table td:nth-child(2), .ka-pos-table td:nth-child(3) { white-space: nowrap; }
.ka-raw summary { cursor: pointer; font-size: .85rem; color: #4b5563; }
.ka-raw pre { max-height: 360px; overflow: auto; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: .75rem; font-size: .75rem; }
@media (max-width: 760px) {
    .ka-upload { flex-direction: column; align-items: stretch; }
    .ka-file { max-width: 120px; }
    .kv-page-tabs { flex-wrap: wrap; }
}

/* ---------- Verwaltung: Kontoauszüge – Prüfregeln & Prüfung ---------- */
.ka-subtabs { margin-bottom: 1.25rem; }
.ka-subtabs .kv-page-tab { padding: .4rem .9rem; font-size: .85rem; }
.btn-check { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.btn-check:hover { background: linear-gradient(135deg, #c4b5fd, #8b5cf6); }
.kp-badge-bad { background: #fee2e2; color: #991b1b; }
.kp-badge-off { background: #e5e7eb; color: #4b5563; margin-left: .35rem; }
.kp-inaktiv td { color: #9ca3af; }
.kp-intro { margin: 0 0 1rem; max-width: 900px; }
.kp-form { margin-bottom: 1.5rem; }
.kp-form-title { grid-column: 1 / -1; margin: 0; }
.kp-form select { padding: .45rem; font-size: .95rem; border: 1px solid #d1d5db; border-radius: 6px; }
.kp-wide { grid-column: 1 / -1; }
.kp-label { font-size: .85rem; font-weight: 600; display: block; margin-bottom: .35rem; }
.kp-monate-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .3rem; }
.kp-monat { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: .25rem;
    padding: .35rem 0; border: 1px solid #d1d5db; border-radius: 6px; font-weight: 500 !important; cursor: pointer; background: #fff; }
.kp-monat input { display: none; }
.kp-monat-on { background: #ede9fe; border-color: #7c3aed; color: #5b21b6; font-weight: 700 !important; }
.kp-monate-presets { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.kp-monate-presets .btn { padding: .25rem .6rem; font-size: .75rem; }
.kp-such { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.kp-result { background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 10px; padding: .9rem 1rem; margin: 1rem 0 1.25rem; }
.kp-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .6rem; }
.kp-result-head h4 { margin: 0; }
.kp-result-head .kv-hint { margin: 0; flex: 1; }
.kp-result-table { background: #fff; }
.kp-status { white-space: nowrap; }
.kp-status-ok { background: #dcfce7; color: #166534; }
.kp-status-fehlt { background: #fee2e2; color: #991b1b; }
.kp-status-teilweise, .kp-status-abweichend { background: #ffedd5; color: #9a3412; }
.kp-status-mehrfach { background: #fef3c7; color: #92400e; }
.kp-row-fehlt td { background: #fff5f5; }
.kp-treffer { font-size: .8rem; }
.kp-treffer-abw { color: #9a3412; font-weight: 600; }
.kp-rest { margin-top: .75rem; font-size: .85rem; }
.kp-rest summary { cursor: pointer; color: #4b5563; }
.kp-rest ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.kp-regel-cell { white-space: nowrap; }
.kp-plus { padding: .2rem .55rem !important; font-size: .75rem !important; }
@media (max-width: 760px) {
    .kp-monate-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- Verwaltung: Kontoauszüge – Statistik ---------- */
.ks-page { max-width: 1100px; }
.ks-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ks-seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.ks-seg button { border: 0; background: #fff; padding: .4rem .9rem; font-size: .85rem; font-weight: 600; color: #374151; cursor: pointer; }
.ks-seg button + button { border-left: 1px solid #d1d5db; }
.ks-seg .ks-seg-on { background: #059669; color: #fff; }
.ks-kpis { margin-top: .5rem; }
.ks-chart-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.1); padding: .75rem 1rem 1rem; margin-bottom: 1.25rem; }
.ks-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .8rem; color: #4b5563; margin-bottom: .25rem; }
.ks-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.ks-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ks-sw-ein { background: #059669; }
.ks-sw-aus { background: #dc2626; }
.ks-sw-ueb { background: #4f46e5; height: 3px; border-radius: 2px; width: 16px; }
.ks-chart { width: 100%; height: auto; display: block; }
.ks-grid { stroke: #eef0f2; stroke-width: 1; }
.ks-zero { stroke: #9ca3af; stroke-width: 1; }
.ks-axis { fill: #6b7280; font-size: 11px; font-variant-numeric: tabular-nums; }
.ks-axis-y { text-anchor: end; }
.ks-axis-x { text-anchor: middle; }
.ks-hit { fill: transparent; }
.ks-group:hover .ks-hit { fill: rgba(79, 70, 229, .06); }
.ks-bar-ein { fill: #059669; }
.ks-bar-aus { fill: #dc2626; }
.ks-line { fill: none; stroke: #4f46e5; stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
.ks-dot { fill: #4f46e5; stroke: #fff; stroke-width: 2; pointer-events: none; }
.ks-table .ks-ueb { font-weight: 700; }
.ks-leer td { color: #9ca3af; }
.ks-ohne td { font-style: italic; color: #6b7280; }
.ks-h3 { margin: 1.5rem 0 .5rem; }

/* ---------- Dashboard ---------- */
.db-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.db-head-right { display: flex; align-items: center; gap: .75rem; }
.db-head-right .kv-hint { margin: 0; }
.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; margin-top: 1rem; }
.db-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); padding: 1rem 1.15rem 1.15rem; min-width: 0; }
.db-wide { grid-column: 1 / -1; }
.db-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.db-card-head h2 { margin: 0; font-size: 1.1rem; }
.db-more { margin-left: auto; font-size: .82rem; color: #2563eb; text-decoration: none; white-space: nowrap; }
.db-more:hover { text-decoration: underline; }
.db-demo { background: #e0e7ff; color: #3730a3; }
.db-sub { font-weight: 600; color: #374151; }
.db-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }

.db-solar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.db-metric { background: #f8fafc; border-radius: 10px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.db-metric-pv { background: #fffbeb; }
.db-metric-label { font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }
.db-metric-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-soc { display: block; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-top: .2rem; }
.db-soc span { display: block; height: 100%; background: #12a17a; border-radius: 3px; }
.db-solar-today { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .75rem; font-size: .82rem; color: #4b5563; }

.db-lock { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px;
    background: var(--nk-soft, #f1f5f9); border-left: 4px solid var(--nk-accent, #64748b); flex-wrap: wrap; }
.db-lock-icon { font-size: 1.5rem; }
.db-lock-main { display: flex; flex-direction: column; flex: 1; min-width: 120px; }
.db-lock-name { font-weight: 600; }
.db-lock-state { font-size: .88rem; color: var(--nk-accent, #374151); font-weight: 600; }
.db-chips { display: flex; flex-wrap: wrap; gap: .3rem; }

.db-shutter-summary { margin: 0 0 .6rem; }
.db-room + .db-room { margin-top: .8rem; }
.db-room-head { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin-bottom: .35rem; }
.db-shutter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 170px); align-items: center; gap: .6rem; }
.db-shutters .db-shutter { background: #fff; border-radius: 10px; padding: .5rem .75rem; }   /* jeder Rolladen ein eigenes Feld */
.db-shutters .db-shutter-name { font-weight: 600; }
.db-shutter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-shutter-pos { display: flex; flex-direction: column; gap: .15rem; }
.db-pos-bar { display: block; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.db-pos-bar span { display: block; height: 100%; background: #3b82f6; border-radius: 3px; transition: width .6s; }
.db-pos-text { font-size: .75rem; color: #6b7280; }
.db-btns { display: inline-flex; gap: .25rem; }
.db-btns button { width: 2rem; height: 1.8rem; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; font-size: .75rem; color: #374151; }
.db-btns button:hover:not(:disabled) { background: #dbeafe; border-color: #3b82f6; }
.db-btns button:disabled { opacity: .45; cursor: default; }
.db-offline { opacity: .55; }

.db-switches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }   /* immer 2 pro Zeile */
.db-switches li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: #f8fafc; border-radius: 10px; padding: .6rem .75rem; min-height: 2.8rem; }
.db-switches li { container-type: inline-size; }
.db-switch-name { overflow: hidden; overflow-wrap: break-word; line-height: 1.2; font-size: min(.95rem, 11cqi); font-weight: 600;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-width: 0; }
.db-switches .db-pill { flex: none; }
.db-pill { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: #e5e7eb; color: #4b5563; }
.db-pill-on { background: #dcfce7; color: #166534; }
.db-pill-off { background: #fee2e2; color: #991b1b; }

@media (max-width: 760px) {
    .db-grid { grid-template-columns: 1fr; }
}

/* Dashboard: alle Kacheln gleich groß – feste Zeilenhöhe, Inhalt scrollt bei Bedarf */
.db-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); grid-auto-rows: 440px; align-items: stretch; }
.db-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; box-sizing: border-box; }
.db-card-head { flex: none; }
.db-card-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: .15rem; }
/* Wetter kompakt für die Kachelbreite */
.db-card-weather .wx-summary { grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem 1.1rem; }
.db-card-weather .wx-temp { font-size: 2.8rem; }
.db-card-weather .wx-compass-dial { width: 72px; height: 72px; }
.db-card-weather .wx-compass-needle { height: 26px; }
.db-card-weather .wx-stats { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
.db-card-weather .wx-stat-label { font-size: .66rem; overflow-wrap: anywhere; }
.db-card-weather .wx-stat-value { font-size: .95rem; }
.db-card-weather .wx-summary-footer { grid-column: 1 / -1; }
.db-card-weather .wx-updated { margin-bottom: .4rem; color: rgba(255,255,255,.85); font-size: .8rem; }
@media (max-width: 760px) {
    .db-grid { grid-template-columns: 1fr; grid-auto-rows: 440px; }
    .db-card-weather .wx-summary { grid-template-columns: 1fr 1fr; text-align: left; }
}

/* Dashboard: Regenradar (js/radar.js) – Karte füllt die Kachel, Steuerleiste darunter */
.db-card-radar .db-card-body { overflow: hidden; padding-right: 0; display: flex; flex-direction: column; }
.rr-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .5rem; position: relative; }
.rr-map { flex: 1; min-height: 0; border-radius: 10px; overflow: hidden; background: #e5e7eb; }
.rr-map .rr-base { filter: grayscale(.55) brightness(1.04); }
.rr-map .leaflet-control-attribution { font-size: .62rem; }
.rr-controls { flex: none; display: flex; align-items: center; gap: .6rem; }
.rr-play { flex: none; width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%; cursor: pointer; color: #fff; font-size: .85rem;
    background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 1px 4px rgba(37, 99, 235, .35); }
.rr-play:hover { background: linear-gradient(135deg, #7cb5fb, #3b82f6); }
.rr-slider { flex: 1; min-width: 0; accent-color: #2563eb; }
.rr-time { flex: none; font-size: .82rem; font-weight: 600; color: #374151; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rr-status { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 500; background: rgba(255,255,255,.92);
    padding: .4rem .8rem; border-radius: 8px; font-size: .85rem; color: #6b7280; box-shadow: 0 1px 6px rgba(0,0,0,.12); }

/* Regenradar: Kachel anklickbar → große Darstellung im Dialog (RegenRadarDialog) */
.rr-map.rr-clickable, .rr-map.rr-clickable .leaflet-interactive, .rr-map.rr-clickable .leaflet-grab { cursor: zoom-in; }
.rr-expand { width: 1.9rem; height: 1.9rem; display: flex; align-items: center; justify-content: center; border-radius: 8px;
    background: rgba(255,255,255,.92); color: #1e3a8a; font-size: 1.1rem; font-weight: 700; box-shadow: 0 1px 5px rgba(0,0,0,.2); pointer-events: none; }
.rrd-modal { width: min(1100px, calc(100vw - 2rem)); height: min(820px, calc(100vh - 2rem)); display: flex; flex-direction: column; overflow: hidden; }
.rrd-modal .adm-modal-head { flex: none; }
.rrd-head-right { display: flex; align-items: center; gap: .8rem; }
.rrd-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rr-wrap.rr-large .rr-map .leaflet-control-attribution { font-size: .72rem; }
.rr-wrap.rr-large .rr-time { font-size: .95rem; }
@media (max-width: 860px) {
    .rrd-modal { height: 88vh; max-height: 88vh; }
}

/* ---------- Menü: aufklappbare Gruppe als Button (z. B. "Bilder") ---------- */
.menu-btn-toggle { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-btn-group-active { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.menu-btn-group-active:hover { background: linear-gradient(135deg, #7cb5fb, #4f8ff7); }

/* ---------- Verwaltung: Memo beim Mieter ---------- */
.kv-memo { margin: 1.25rem 0; display: flex; flex-direction: column; gap: .3rem; max-width: 760px; }
.kv-memo label { font-size: .85rem; font-weight: 600; }
.kv-memo textarea { width: 100%; box-sizing: border-box; padding: .5rem .6rem; font: inherit; font-size: .95rem;
    border: 1px solid #d1d5db; border-radius: 6px; resize: vertical; min-height: 5.5rem; }
.kv-memo .kv-hint { margin-top: 0; }
.kv-memo-status { margin-left: .4rem; font-weight: 600; color: #047857; }

/* ===================== Aktien ===================== */
.ak-layout { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 1.1rem; max-width: 1300px; align-items: start; margin-top: 1rem; }
.ak-left { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.ak-add-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.ak-isin-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace !important; letter-spacing: .06em; text-transform: uppercase; }
.kfz-form input.ak-valid { border-color: #22c55e; }
.kfz-form input.ak-invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .15); }
.ak-hint-err { color: #b91c1c; font-size: .82rem; }
.ak-count { display: inline-block; margin-left: .35rem; padding: .05rem .5rem; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .78rem; vertical-align: middle; }

.ak-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.ak-item { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 80px auto 1.8rem; align-items: center; gap: .55rem;
           padding: .5rem .55rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.ak-item:hover { background: #f8fafc; }
.ak-item:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }
.ak-item-active { background: #eff6ff; border-color: #bfdbfe; }
.ak-item-top { box-shadow: inset 3px 0 0 #3b82f6; }
.ak-order input { width: 100%; padding: .3rem .35rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: .9rem; text-align: center; background: #fff; }
.ak-order input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.ak-main { display: flex; flex-direction: column; min-width: 0; }
.ak-name { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-meta { font-size: .76rem; color: #64748b; display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .4rem; font-variant-numeric: tabular-nums; }
.ak-sym { font-family: ui-monospace, Consolas, monospace; background: #f1f5f9; color: #334155; border-radius: 4px; padding: 0 .3rem; }
.ak-dash { background: #dbeafe; color: #1d4ed8; border-radius: 999px; padding: 0 .4rem; font-weight: 600; font-size: .68rem; }
.ak-spark { width: 80px; height: 28px; display: block; }
.ak-spark polyline { fill: none; stroke: #94a3b8; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.ak-spark polyline.ak-up { stroke: #059669; }
.ak-spark polyline.ak-down { stroke: #dc2626; }
.ak-price { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ak-price-value { font-weight: 700; color: #0f172a; }
.ak-chg { font-size: .82rem; font-weight: 600; color: #64748b; font-variant-numeric: tabular-nums; }
.ak-chg.ak-up { color: #047857; }
.ak-chg.ak-down { color: #b91c1c; }
.ak-muted { color: #94a3b8; }
.ak-small { font-size: .76rem; margin-top: .15rem; }
.ak-del { width: 1.8rem; height: 1.8rem; border: 0; border-radius: 6px; background: transparent; color: #94a3b8; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.ak-del:hover { background: #fee2e2; color: #b91c1c; }

.ak-detail { position: sticky; top: 1rem; }
.ak-empty { text-align: center; color: #64748b; padding: 3rem 1rem; }
.ak-empty-icon { font-size: 2.6rem; margin-bottom: .5rem; }
.ak-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.ak-detail-head h2 { margin: 0 0 .25rem; }
.ak-quote { text-align: right; }
.ak-quote-price { font-size: 2rem; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ak-quote .ak-chg { font-size: .95rem; }

.ak-ranges { display: flex; flex-wrap: wrap; gap: .25rem; background: #f1f5f9; border-radius: 10px; padding: .25rem; width: fit-content; max-width: 100%; margin-bottom: .7rem; }
.ak-range { border: 0; background: transparent; padding: .35rem .7rem; border-radius: 7px; font: inherit; font-size: .85rem; font-weight: 600; color: #475569; cursor: pointer; }
.ak-range:hover { color: #0f172a; }
.ak-range-active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.ak-range-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; font-size: .88rem; color: #475569; margin-bottom: .3rem; }
.ak-range-summary .ak-chg { font-size: .9rem; }

.ak-chart-wrap { transition: opacity .2s; }
.ak-loading { opacity: .5; }
.ak-chart { --ak-color: #2563eb; }
.ak-chart.ak-up { --ak-color: #059669; }
.ak-chart.ak-down { --ak-color: #dc2626; }
.ak-line { fill: none; stroke: var(--ak-color); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ak-grad-top { stop-color: var(--ak-color); stop-opacity: .22; }
.ak-grad-bottom { stop-color: var(--ak-color); stop-opacity: 0; }
.ak-basis { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 2 4; }
.ak-dot { fill: var(--ak-color); stroke: #fff; stroke-width: 2; }
.ak-chart-placeholder { height: 240px; display: grid; place-items: center; color: #64748b; background: #f8fafc; border-radius: 10px; }

.ak-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: 1rem; }
.ak-stat { font-weight: 700; font-variant-numeric: tabular-nums; color: #0f172a; }
.ak-settings { margin-top: 1rem; border-top: 1px solid #e2e8f0; padding-top: .7rem; }
.ak-settings summary { cursor: pointer; font-weight: 600; color: #475569; }
.ak-settings-form { margin-top: .7rem; }
.ak-confirm { max-width: 420px; }

/* Dashboard-Kachel */
.db-stock { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; align-items: center; gap: .6rem; background: #f8fafc; border-radius: 10px; padding: .5rem .7rem; }
.db-stock-main { display: flex; flex-direction: column; min-width: 0; }
.db-stock-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-stock-isin { font-size: .72rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.db-stock-price { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.db-stock-value { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
    .ak-layout { grid-template-columns: minmax(0, 1fr); }
    .ak-detail { position: static; }
}
@media (max-width: 520px) {
    .ak-item { grid-template-columns: 3rem minmax(0, 1fr) auto 1.6rem; }
    .ak-item .ak-spark { display: none; }
    .ak-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ak-quote { text-align: left; }
    .ak-quote-price { font-size: 1.6rem; }
    .db-stock { grid-template-columns: minmax(0, 1fr) auto; }
    .db-stock .ak-spark { display: none; }
}

/* ---------- Dashboard: Teich-Temperatur (RainPoint) in der Kachel Türschloss ---------- */
.db-pond { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid #e5e7eb; }
.db-pond .db-room-head { margin-bottom: .45rem; }
.db-pond-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; background: #f0f9ff; }
.db-pond-main { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 0; }
.db-pond-temp { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-pond-temp small { font-size: .9rem; font-weight: 600; color: #64748b; }
.db-pond-cold { color: #1d4ed8; }
.db-pond-cool { color: #0e7490; }
.db-pond-mild { color: #047857; }
.db-pond-warm { color: #c2410c; }

/* Garagentor im Dashboard: nur die Zeile (abgerundetes Feld) des Tors blinkt rot,
   das länger als TUYA_GARAGE_ALARM_MINUTES offen ist */
.db-garage { border-radius: 0; }   /* gerade Trennlinie über "Garage" */
/* Garage oben in der Kachel "Sensoren": ohne Trennlinie darüber; darunter Abstand zur Sensorliste */
.db-card-body > .db-garage:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.db-card-body > .db-garage + .db-list { margin-top: .8rem; }
.db-garage-alarm .db-room-head { color: #7f1d1d; font-weight: 700; }
/* Überschrift "Garage" wie die Kachelüberschrift (h2); beim Alarm rot */
.db-garage-alarm .db-card-head h2 { color: #b91c1c; }
.db-garage-row-alarm { animation: db-garage-blink 1s ease-in-out infinite; }
.db-garage-row-alarm .db-lock-state { color: #7f1d1d; font-weight: 700; }
@keyframes db-garage-blink {
    0%, 100% { background-color: #fca5a5; box-shadow: 0 0 0 2px #dc2626; }
    50%      { background-color: #fee2e2; box-shadow: 0 0 0 2px rgba(220, 38, 38, .25); }
}
@media (prefers-reduced-motion: reduce) {
    .db-garage-row-alarm { animation: none; background-color: #fca5a5; box-shadow: 0 0 0 2px #dc2626; }
}

/* ---------- Anzeige-Konto "Dashboard": kein Menü, Dashboard formatfüllend ---------- */
.app-kiosk .content { padding: 1rem 1.25rem; width: 100%; }
.app-kiosk .db-grid { margin-top: .75rem; }
.db-logout { white-space: nowrap; }

/* ---------- Wallbox-Ladeprotokoll (Seite Solaranlage) ---------- */
.pv-btn-active { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.pv-log { border-color: #bae6fd; }
.pv-log-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin: .6rem 0 .9rem; }
.pv-log-sum > div { background: #f0f9ff; border-radius: 12px; padding: .55rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.pv-log-sum span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.pv-log-sum strong { font-size: 1.15rem; color: #0f172a; }
.pv-log-sum small { font-size: .78rem; color: #64748b; font-weight: 500; }
.pv-log-table td { vertical-align: middle; }
.pv-log-barcol { width: 40%; }
.pv-log-bar { display: block; height: 8px; background: #e0f2fe; border-radius: 99px; overflow: hidden; }
.pv-log-bar > span { display: block; height: 100%; background: var(--ev, #0ea5e9); border-radius: 99px; }
.pv-log-zero td { color: #94a3b8; }
.pv-log-open { margin-left: .35rem; font-size: .7rem; background: #e0f2fe; color: #0369a1; border-radius: 99px; padding: .05rem .45rem; }
.pv-log-click { cursor: pointer; }
.pv-log-click:hover td { background: #f8fafc; }
@media (max-width: 600px) {
  .pv-log-barcol { width: 25%; }
  .pv-head-right { flex-wrap: wrap; }
}

/* ---------- Leistung je String (Seite Solaranlage) ---------- */
.pv-str { border-color: #fde68a; }
.pv-str-c1 { --s: #e8a20c; }
.pv-str-c2 { --s: #0f9d8a; }
.pv-str-c3 { --s: #7c3aed; }
.pv-str-c4 { --s: #e11d48; }
.pv-str-c5 { --s: #0284c7; }
.pv-str-c6 { --s: #64748b; }
.pv-str .pv-sw, .pv-str-tile .pv-sw { background: var(--s, #e8a20c); }
.pv-str-line { stroke: var(--s); }
.pv-str-dot { fill: var(--s); }
.pv-str-tile { border-left: 4px solid var(--s); }
.pv-str-tile small { font-size: .78rem; color: #64748b; font-weight: 500; }
.pv-str-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #f1f5f9; }
.pv-str-split > span { display: block; height: 100%; background: var(--s); }
.pv-str-split > span + span { box-shadow: inset 2px 0 0 #fff; }

/* ---------- Dashboard: X-Sense-Rauchmelder in der Kachel "Sensoren" ---------- */
.db-card-body > .db-smoke:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.db-garage + .db-smoke { margin-top: .8rem; }
.db-smoke + .db-list, .db-smoke + .error { margin-top: .8rem; }
.db-smoke .db-room-head { margin-bottom: .45rem; gap: .5rem; justify-content: flex-start; }
.db-smoke-sum { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; color: #475569; }
.db-card-head h2 { white-space: nowrap; }
.db-card-head .db-smoke-sum { font-size: .82rem; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.db-smoke-sum-alarm { color: #b91c1c; font-weight: 700; }
.db-smoke-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }   /* immer 2 Melder pro Zeile */
.db-smoke-item { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .6rem .75rem; border-radius: 10px; min-height: 3.4rem;
    background: var(--nk-soft, #f1f5f9); border-left: 4px solid var(--nk-accent, #64748b); }
.db-smoke-icon { flex: none; font-size: 1.45rem; line-height: 1; }
.db-smoke-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
/* Name passt sich der Feldbreite an, statt mitten im Wort umzubrechen */
.db-smoke-item { container-type: inline-size; }
.db-smoke-name { font-weight: 600; font-size: min(1rem, 11.5cqi); line-height: 1.2; overflow: hidden; overflow-wrap: break-word; hyphens: manual;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.db-smoke-state { font-size: .84rem; font-weight: 600; color: var(--nk-accent, #374151); }
.db-smoke-item.db-garage-row-alarm .db-smoke-state { color: #7f1d1d; }
.db-smoke-co { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #475569; }
.db-co-ok { color: #475569; }
.db-co-raised { color: #c2410c; }
.db-co-high { color: #b91c1c; }

/* ---------- Dashboard: Kacheln hellgrau; innere Felder weiß, damit sie sich abheben ---------- */
.db-card { background: #eef1f4; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.db-card .db-metric, .db-card .db-switches li, .db-card .db-stock { background: #fff; }
.db-card .db-metric-pv { background: #fffbeb; }
.db-card .db-pond { border-top-color: #d6dce3; }

/* ---------- Dashboard: Wallbox-Überschrift + Tageswerte als Tabelle (Kachel Solaranlage) ---------- */
.db-ev-head { margin: .9rem 0 .45rem; }
.db-ev-head + .db-ev { margin-top: 0; }
.db-today { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: .9rem; font-size: .95rem; font-variant-numeric: tabular-nums; }
.db-today th, .db-today td { background: #fff; }
.db-today tr:first-child th { border-top-left-radius: 10px; }
.db-today tr:first-child td { border-top-right-radius: 10px; }
.db-today tr:last-child th { border-bottom-left-radius: 10px; }
.db-today tr:last-child td { border-bottom-right-radius: 10px; }
.db-today caption { caption-side: top; text-align: left; font-size: .85rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; padding-bottom: .25rem; }
.db-today th, .db-today td { padding: .32rem .7rem; border-top: 1px solid #e5e7eb; }
.db-today tr:first-child th, .db-today tr:first-child td { border-top: none; }
.db-today th { text-align: left; font-weight: 500; color: #374151; white-space: nowrap; }
.db-today td { text-align: right; font-weight: 700; white-space: nowrap; }

/* =====================================================================
   Dashboard kompakt: auf Bildschirmen ab 1000px Breite und bis 1000px Höhe
   (z. B. 1280×800) passen alle Kacheln ohne Scrollen auf den Bildschirm.
   Höchstens 4 Spalten, Zeilenhöhe = halbe Fensterhöhe abzüglich Kopfzeile.
   ===================================================================== */
@media (min-width: 1000px) and (max-height: 1000px) {
    .content:has(.db-grid) { padding: .75rem 1rem; }
    .db-head { gap: .5rem; }
    .db-head h1 { font-size: 1.35rem; margin: 0; }
    .db-head .btn { padding: .3rem .75rem; font-size: .85rem; }
    .db-grid, .app-kiosk .db-grid {
        margin-top: .5rem;
        gap: .6rem;
        /* Spaltenzahl kommt aus Dashboard.razor (--db-cols = Kacheln / 2, mindestens 4) → immer 2 Zeilen */
        grid-template-columns: repeat(auto-fit, minmax(max(180px, calc((100% - (var(--db-cols, 4) - 1) * .6rem) / var(--db-cols, 4))), 1fr));
        grid-auto-rows: max(200px, calc((100vh - 4.6rem) / 2));
        grid-auto-rows: max(200px, calc((100dvh - 4.6rem) / 2));
    }
    .db-card { padding: .55rem .7rem .65rem; border-radius: 10px; }
    .db-card-head { margin-bottom: .4rem; gap: .4rem; }
    .db-card-head h2 { font-size: .95rem; }
    .db-more { font-size: .72rem; }
    .db-card .ka-badge { font-size: .65rem; padding: .1rem .4rem; }
    .db-list { gap: .3rem; }
    .db-card .kv-hint, .db-card .error { font-size: .78rem; }

    /* Wetter */
    .db-card-weather .wx-summary { gap: .4rem .6rem; padding: .55rem .7rem; border-radius: 10px; }
    .db-card-weather .wx-temp { font-size: 2rem; }
    .db-card-weather .wx-unit { font-size: 1rem; }
    .db-card-weather .wx-feels { font-size: .75rem; margin-top: .2rem; }
    .db-card-weather .wx-compass-dial { width: 52px; height: 52px; margin-bottom: .2rem; }
    .db-card-weather .wx-compass-dial span { font-size: .55rem; }
    .db-card-weather .wx-compass-needle { height: 18px; }
    .db-card-weather .wx-compass-label { font-size: .68rem; }
    .db-card-weather .wx-stats { gap: .25rem .6rem; }
    .db-card-weather .wx-stat-label { font-size: .58rem; }
    .db-card-weather .wx-stat-value { font-size: .8rem; }
    .db-card-weather .wx-updated { font-size: .68rem; margin-bottom: .2rem; }

    /* Regenradar */
    .rr-wrap { gap: .3rem; }
    .rr-play { width: 1.7rem; height: 1.7rem; font-size: .7rem; }
    .rr-time { font-size: .72rem; }

    /* Aktien */
    .db-stock { grid-template-columns: minmax(0, 1fr) 48px auto; gap: .4rem; padding: .3rem .5rem; border-radius: 8px; }
    .db-stock .ak-spark { width: 48px; height: 20px; }
    .db-stock-name { font-size: .82rem; }
    .db-stock-isin { font-size: .62rem; }
    .db-stock-value { font-size: .82rem; }
    .db-stock .ak-chg { font-size: .7rem; }

    /* Solaranlage + Wallbox */
    .db-solar { gap: .35rem; }
    .db-metric { padding: .3rem .5rem; border-radius: 8px; gap: 0; }
    .db-metric-label { font-size: .6rem; }
    .db-metric-value { font-size: 1rem; }
    .db-soc { height: 4px; margin-top: .1rem; }
    .db-solar-today { margin-top: .35rem; font-size: .7rem; gap: .1rem .6rem; }
    .db-ev { margin-top: .35rem; padding: .3rem .5rem; gap: .1rem .5rem; border-radius: 8px; }
    .db-ev-label { font-size: .6rem; }
    .db-ev-status { font-size: .78rem; }
    .db-ev-power { font-size: .92rem; }
    .db-ev-current { font-size: .68rem; }
    .db-ev-head { margin: .35rem 0 .25rem; }
    .db-today { margin-top: .3rem; font-size: .82rem; }
    .db-today caption { font-size: .7rem; padding-bottom: .12rem; }
    .db-today th, .db-today td { padding: .1rem .55rem; }
    .db-card .db-pond { margin-top: .4rem; padding-top: .35rem; }
    .db-card .db-solar { gap: .3rem; }
    .db-card .db-metric { padding: .22rem .5rem; }
    .db-card .db-ev { padding: .22rem .5rem; }
    .db-card .db-pond-row { padding: .22rem .5rem; }
    .db-card .db-pond-temp { font-size: 1.1rem; }
    .db-card .db-pond .db-card-head { margin-bottom: .25rem; }

    /* Türschloss, Sensoren, Teich */
    .db-lock { gap: .45rem; padding: .3rem .5rem; border-radius: 8px; }
    .db-lock-icon { font-size: 1.1rem; }
    .db-lock-main { min-width: 80px; }
    .db-lock-name { font-size: .82rem; }
    .db-lock-state { font-size: .72rem; }
    .db-chips { gap: .2rem; }
    .db-card .nk-chip { font-size: .62rem; padding: .05rem .35rem; }
    .db-pond { margin-top: .45rem; padding-top: .4rem; }
    .db-pond .db-room-head { margin-bottom: .25rem; }
    .db-pond-row { gap: .45rem; padding: .3rem .5rem; border-radius: 8px; }
    .db-pond-temp { font-size: 1.2rem; }
    .db-pond-temp small { font-size: .7rem; }
    .db-card-body > .db-garage + .db-list { margin-top: .45rem; }
    .db-garage + .db-smoke, .db-smoke + .db-list, .db-smoke + .error { margin-top: .45rem; }
    .db-smoke .db-room-head { margin-bottom: .25rem; }
    .db-card-head .db-smoke-sum { font-size: .72rem; }
    .db-smoke-grid { gap: .35rem; }
    .db-smoke-item { gap: .45rem; padding: .45rem .5rem; border-radius: 8px; min-height: 2.9rem; }
    .db-smoke-icon { display: none; }   /* Farbe (und beim Alarm das rote Blinken) zeigt den Zustand */
    .db-smoke-name { font-size: min(.88rem, 12.5cqi); }
    .db-smoke-state { font-size: .72rem; }
    .db-smoke-co { font-size: .7rem; }

    /* Rolläden */
    .db-shutter-summary { margin-bottom: .35rem; }
    .db-room + .db-room { margin-top: .45rem; }
    .db-room-head { font-size: .66rem; }
    .db-shutter { grid-template-columns: minmax(0, 1fr) minmax(70px, 110px); gap: .4rem; font-size: .8rem; }
    .db-shutters .db-shutter { padding: .3rem .5rem; border-radius: 8px; }
    .db-pos-bar { height: 4px; }
    .db-pos-text { font-size: .64rem; }

    /* Zeitschaltuhren */
    .db-switches { gap: .35rem; }
    .db-switches li { padding: .45rem .5rem; gap: .3rem; border-radius: 8px; min-height: 2.4rem; }
    .db-switch-name { font-size: min(.84rem, 12cqi); }
    .db-pill { font-size: .66rem; padding: .08rem .45rem; }
}

/* ===================== Besucher-Statistik ===================== */
.st-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.st-ranges { display: flex; flex-wrap: wrap; gap: .3rem; background: #f1f5f9; padding: .25rem; border-radius: 10px; }
.st-range { border: 0; background: transparent; padding: .45rem .8rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .88rem; color: #334155; }
.st-range:hover { background: #e2e8f0; }
.st-range-active, .st-range-active:hover { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; }
.st-custom { display: flex; align-items: center; gap: .35rem; }
.st-custom input { padding: .35rem .45rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: .88rem; }
.st-check { display: flex; align-items: center; gap: .4rem; font-size: .88rem; color: #334155; cursor: pointer; }
.st-reload { margin-left: auto; }

.st-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; margin-bottom: 1rem; transition: opacity .2s; }
.st-loading { opacity: .55; }
.st-kpi { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: 0 2px 10px rgba(15,23,42,.04); min-width: 0; }
.st-kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; display: flex; align-items: center; gap: .35rem; }
.st-kpi strong { font-size: 1.65rem; color: #0f172a; font-variant-numeric: tabular-nums; }
.st-kpi small { font-size: .76rem; color: #64748b; }
.st-kpi-live { background: linear-gradient(135deg, #34d399, #059669); border-color: transparent; }
.st-kpi-live .st-kpi-label, .st-kpi-live small { color: rgba(255,255,255,.9); }
.st-kpi-live strong { color: #fff; }
.st-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: st-pulse 1.8s ease-in-out infinite; }
@keyframes st-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.st-up { color: #059669; font-weight: 600; }
.st-down { color: #dc2626; font-weight: 600; }
.st-flat { color: #64748b; font-weight: 600; }

.st-legend { display: flex; gap: 1rem; font-size: .8rem; color: #475569; }
.st-legend span { display: flex; align-items: center; gap: .35rem; }
.st-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.st-sw-views { background: #93c5fd; }
.st-sw-visitors { background: #059669; height: 3px; border-radius: 2px; }
.st-chart { width: 100%; height: auto; display: block; }
.st-col { fill: #93c5fd; }
.st-hit { fill: transparent; }
g:hover > .st-hit { fill: rgba(59,130,246,.07); }
g:hover > .st-col { fill: #3b82f6; }
.st-line { fill: none; stroke: #059669; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.st-dot { fill: #fff; stroke: #059669; stroke-width: 2; vector-effect: non-scaling-stroke; }

.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }
.st-sub { margin-top: 1.2rem !important; }
.st-empty { font-size: .85rem; margin: 0; }
.st-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.st-list li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .35rem .55rem; border-radius: 6px; font-size: .88rem; overflow: hidden; }
.st-bar { position: absolute; left: 0; top: 0; bottom: 0; background: #e0edff; border-radius: 6px; z-index: 0; }
.st-list-label, .st-list-val { position: relative; z-index: 1; }
.st-list-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0f172a; }
.st-list-val { font-variant-numeric: tabular-nums; font-weight: 600; color: #0f172a; white-space: nowrap; }
.st-list-val small { font-weight: 400; color: #64748b; }

.st-histo { display: grid; gap: 3px; align-items: end; height: 120px; }
.st-histo-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.st-histo-bar { width: 100%; background: linear-gradient(180deg, #60a5fa, #3b82f6); border-radius: 3px 3px 0 0; }
.st-histo-col:hover .st-histo-bar { background: #1d4ed8; }
.st-histo-col span { font-size: .68rem; color: #94a3b8; height: 1rem; line-height: 1rem; margin-top: 2px; }

.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.st-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 600; padding: .4rem .6rem; border-bottom: 1px solid #e2e8f0; }
.st-table td { padding: .4rem .6rem; border-bottom: 1px solid #f1f5f9; color: #334155; }
.st-row-new td { font-weight: 600; color: #0f172a; }
.st-nowrap { white-space: nowrap; }

@media (max-width: 1200px) { .st-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
    .st-kpis { grid-template-columns: repeat(2, 1fr); }
    .st-kpi strong { font-size: 1.35rem; }
    .st-reload { margin-left: 0; }
    .st-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .st-live-dot { animation: none; } }

/* ===================== Dashboard: Termine des Tages ===================== */
.db-termin-date { margin-left: auto; font-size: .82rem; font-weight: 600; color: #475569; white-space: nowrap; }
.db-termine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.db-termin { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 10px; background: #fff;
    border-left: 4px solid #3b82f6; min-width: 0; }
.db-termin-time { flex: none; min-width: 4rem; display: flex; flex-direction: column; line-height: 1.15; font-variant-numeric: tabular-nums; }
.db-termin-from { font-weight: 700; color: #1e3a8a; }
.db-termin-to { font-size: .74rem; color: #64748b; }
.db-termin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.db-termin-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.db-termin-sub { font-size: .76rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-termin .nk-chip { flex: none; }
.db-termin-allday { border-left-color: #8b5cf6; }
.db-termin-allday .db-termin-from { color: #5b21b6; font-size: .78rem; }
.db-termin-now { border-left-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 1px #bbf7d0 inset; }
.db-termin-now .db-termin-from { color: #166534; }
.db-termin-nowchip { background: #dcfce7; color: #166534; font-weight: 700; }
.db-termin-past { opacity: .5; border-left-color: #cbd5e1; }
.db-termin-cancelled { border-left-color: #fca5a5; opacity: .7; }
.db-termin-cancelled .db-termin-title, .db-termin-cancelled .db-termin-from { text-decoration: line-through; }
.db-termin-none { margin: .6rem 0; font-size: 1.05rem; font-weight: 600; color: #475569; }
.db-termin-next { margin: .6rem 0 0; font-size: .85rem; color: #475569; }
.db-termin-warn { margin: 0 0 .5rem; font-size: .78rem; color: #b45309; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-termin-day { margin: .7rem 0 .3rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.db-termin-day:first-child, .db-termin-warn + .db-termin-day { margin-top: 0; }
.db-termin-day-today { color: #1d4ed8; }

/* Termine in der kompakten Dashboard-Ansicht (1280×800, siehe oben) */
@media (min-width: 1000px) and (max-height: 1000px) {
    .db-termin-date { font-size: .72rem; }
    .db-termine { gap: .3rem; }
    .db-termin { gap: .5rem; padding: .3rem .5rem; border-radius: 8px; }
    .db-termin-time { min-width: 3.4rem; }
    .db-termin-from { font-size: .82rem; }
    .db-termin-to, .db-termin-sub { font-size: .66rem; }
    .db-termin-title { font-size: .82rem; }
    .db-termin-none { font-size: .9rem; margin: .4rem 0; }
    .db-termin-next, .db-termin-warn { font-size: .72rem; }
    .db-termin-allday .db-termin-from { font-size: .7rem; }
    .db-termin-day { margin: .4rem 0 .2rem; font-size: .62rem; }
    .db-termin { padding: .22rem .5rem; }
    .db-termin-main { line-height: 1.12; }
    .db-termin-title { -webkit-line-clamp: 1; }
}
.pv-hist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .4rem 0 .2rem; }

/* ---------- Whisky ---------- */
.whisky-intro { color: #475569; max-width: 760px; }
.whisky-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 1rem; margin-top: 1.25rem; }
.whisky-link-tile {
    display: flex; gap: .9rem; align-items: center;
    padding: 1rem 1.2rem; border-radius: 10px; text-decoration: none; color: #1f2937;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s;
}
.whisky-link-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.whisky-link-tile strong { display: block; font-size: 1.1rem; color: #92400e; }
.whisky-link-tile span span { font-size: .9rem; color: #57534e; }
.whisky-link-icon { font-size: 2rem; line-height: 1; }

.whisky-layout { display: flex; gap: 1.25rem; align-items: stretch; margin-top: 1rem; }
.whisky-map {
    flex: 1 1 auto; min-width: 0;
    height: 70vh; min-height: 380px;
    border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.12);
    background: #aad3df;
}
.whisky-panel { flex: 0 0 300px; display: flex; }
.whisky-panel-hint {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 1.5rem; border-radius: 10px; border: 2px dashed #e7d3a8; color: #78716c; background: #fffbf2;
}
.whisky-panel-hint p { margin: .3rem 0; }
.whisky-panel-hint-icon { font-size: 2.6rem; }
.whisky-panel-total { font-size: .88rem; margin-top: .8rem !important; }

.whisky-card {
    position: relative; flex: 1; align-self: flex-start;
    padding: 1.2rem 1.25rem 1rem; border-radius: 12px; color: #fff;
    background: linear-gradient(160deg, #b45309, #78350f);
    box-shadow: 0 6px 18px rgba(120, 53, 15, .35);
    animation: whisky-in .2s ease-out;
}
@keyframes whisky-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.whisky-card-close {
    position: absolute; top: .4rem; right: .5rem;
    border: 0; background: none; color: rgba(255,255,255,.8); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.whisky-card-close:hover { color: #fff; }
.whisky-card-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; padding-right: 1.2rem; }
.whisky-card-flag { width: 54px; height: auto; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.whisky-card-head h2 { margin: 0; font-size: 1.35rem; }
.whisky-card-region { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #fde68a; }
.whisky-card-count {
    display: flex; flex-direction: column; align-items: center;
    padding: .9rem; border-radius: 10px; background: rgba(255,255,255,.12); margin-bottom: 1rem;
}
.whisky-card-number { font-size: 2.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.whisky-card-label { font-size: .9rem; color: #fde68a; }
.whisky-card-section { font-size: .92rem; margin-bottom: .75rem; }
.whisky-card-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #fde68a; margin-bottom: .2rem; }
.whisky-card-note { font-size: .88rem; color: rgba(255,255,255,.9); margin-bottom: .75rem; }
.whisky-card-source { font-size: .72rem; color: rgba(255,255,255,.7); border-top: 1px solid rgba(255,255,255,.2); padding-top: .5rem; }
.whisky-footnote { font-size: .8rem; color: #78716c; max-width: 900px; margin-top: 1rem; }

/* Pins: Flagge im Kreis + Brennerei-Anzahl (siehe js/whisky.js) */
.whisky-pin-icon { background: none; border: 0; }
.whisky-pin { position: relative; width: 34px; height: 46px; cursor: pointer; }
.whisky-pin::after {
    content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 14px solid #b45309;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.3));
}
.whisky-pin-head {
    position: absolute; top: 0; left: 2px; z-index: 1;
    width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
    border: 3px solid #b45309; background: #fef3c7; box-shadow: 0 2px 5px rgba(0,0,0,.35);
    transition: transform .12s;
}
.whisky-pin-head img { width: 100%; height: 100%; object-fit: cover; }
.whisky-pin-count {
    position: absolute; z-index: 2; top: -7px; left: 20px;
    min-width: 18px; padding: 1px 4px; border-radius: 9px;
    background: #1f2937; color: #fff; font: 700 10px/14px system-ui, sans-serif; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.4); white-space: nowrap;
}
.whisky-pin:hover .whisky-pin-head { transform: scale(1.15); }
.whisky-pin-active .whisky-pin-head { border-color: #facc15; transform: scale(1.25); }
.whisky-pin-active::after { border-top-color: #facc15; }

@media (max-width: 860px) {
    .whisky-layout { flex-direction: column; }
    .whisky-map { height: 55vh; min-height: 300px; }
    .whisky-panel { flex: 0 0 auto; }
    .whisky-panel-empty { display: none; }
}

/* ---------- Whisky: Ablauf der Herstellung ---------- */
.wh-flow {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
    margin: 1.25rem 0 1.5rem; padding: .9rem; border-radius: 12px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7); box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.wh-flow-step {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem;
    width: 96px; padding: .6rem .3rem .5rem; border: 0; border-radius: 10px; cursor: pointer;
    background: #fff; color: #78350f; font: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s, background .12s;
}
.wh-flow-step:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(120,53,15,.2); }
.wh-flow-step-active { background: linear-gradient(160deg, #b45309, #78350f); color: #fff; }
.wh-flow-icon { font-size: 1.7rem; line-height: 1; }
.wh-flow-nr {
    position: absolute; top: -6px; left: -6px; width: 20px; height: 20px; border-radius: 50%;
    background: #1f2937; color: #fff; font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center;
}
.wh-flow-title { font-size: .82rem; font-weight: 600; }
.wh-flow-arrow { color: #d97706; font-size: 1.6rem; font-weight: 700; line-height: 1; }

.wh-abv { margin-bottom: 2rem; }
.wh-abv h2, .wh-compare h2 { font-size: 1.2rem; color: #78350f; margin: 0 0 .6rem; }
.wh-abv-bars { display: flex; gap: 1rem; align-items: flex-end; max-width: 620px; }
.wh-abv-item { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.wh-abv-track {
    position: relative; width: 100%; max-width: 70px; height: 150px;
    border-radius: 8px 8px 4px 4px; background: #f5f5f4; overflow: hidden;
}
.wh-abv-fill {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(0deg, #92400e, #d97706 70%, #fbbf24);
}
.wh-abv-value { margin-top: .35rem; font-weight: 700; color: #78350f; font-variant-numeric: tabular-nums; font-size: .9rem; }
.wh-abv-label { font-size: .78rem; color: #78716c; text-align: center; }

.wh-steps { list-style: none; margin: 0; padding: 0; max-width: 900px; }
.wh-step { position: relative; display: flex; gap: 1rem; padding-bottom: 1.5rem; scroll-margin-top: 1rem; }
.wh-step::before {                      /* Verbindungslinie */
    content: ""; position: absolute; left: 25px; top: 52px; bottom: 0; width: 3px; background: #fde68a;
}
.wh-step:last-child::before { display: none; }
.wh-step-marker {
    flex: 0 0 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #b45309, #78350f); box-shadow: 0 2px 6px rgba(120,53,15,.35);
}
.wh-step-icon { font-size: 1.6rem; line-height: 1; }
.wh-step-card {
    flex: 1; min-width: 0; padding: 1rem 1.25rem; border-radius: 12px;
    background: #fff; border: 1px solid #f1e4c7; box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .3s, border-color .3s;
}
.wh-step-highlight .wh-step-card { border-color: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.25); }
.wh-step-nr { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #b45309; font-weight: 700; }
.wh-step-card h2 { margin: .1rem 0 .5rem; font-size: 1.3rem; color: #1f2937; }
.wh-step-en { font-size: .85rem; font-weight: 400; font-style: italic; color: #a8a29e; margin-left: .3rem; }
.wh-step-card p { margin: 0 0 .6rem; line-height: 1.55; color: #374151; }
.wh-step-list { margin: 0 0 .8rem; padding-left: 1.2rem; color: #374151; line-height: 1.5; }
.wh-step-list li { margin-bottom: .25rem; }
.wh-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: .5rem; margin-bottom: .7rem; }
.wh-fact { display: flex; flex-direction: column; padding: .45rem .7rem; border-radius: 8px; background: #fffbeb; border-left: 3px solid #d97706; }
.wh-fact-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #92400e; }
.wh-fact-value { font-weight: 600; color: #1f2937; font-size: .92rem; }
.wh-tip { font-size: .88rem; color: #57534e; background: #f5f5f4; border-radius: 8px; padding: .55rem .75rem; line-height: 1.45; }
.wh-tip strong { color: #78350f; }

.wh-compare { margin-top: 1rem; max-width: 1000px; }
.wh-table-wrap { overflow-x: auto; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.wh-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; min-width: 620px; }
.wh-table th, .wh-table td { padding: .55rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid #f1e4c7; }
.wh-table thead th { background: linear-gradient(160deg, #b45309, #78350f); color: #fff; font-weight: 600; }
.wh-table tbody th { color: #92400e; white-space: nowrap; background: #fffbeb; }
.wh-table tbody tr:last-child th, .wh-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 860px) {
    .wh-flow { justify-content: center; }
    .wh-flow-arrow { display: none; }
    .wh-flow-step { width: calc(25% - .4rem); min-width: 76px; }
    .wh-abv-bars { gap: .5rem; }
    .wh-abv-track { height: 110px; }
    .wh-step-marker { flex-basis: 40px; height: 40px; }
    .wh-step-icon { font-size: 1.2rem; }
    .wh-step::before { left: 19px; top: 40px; }
    .wh-step-card { padding: .8rem .9rem; }
}

/* ---------- Whisky: Deutsche Whiskys ---------- */
.wde-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.wde-search {
    display: flex; align-items: center; gap: .4rem; flex: 1 1 260px; max-width: 420px;
    padding: .45rem .7rem; border-radius: 8px; border: 1px solid #e7d3a8; background: #fff;
}
.wde-search input { border: 0; outline: 0; flex: 1; font: inherit; min-width: 0; background: transparent; }
.wde-select { padding: .5rem .6rem; border-radius: 8px; border: 1px solid #e7d3a8; background: #fff; font: inherit; }
.wde-count { font-size: .85rem; color: #78716c; }
.wde-map { height: 72vh; }
.wde-panel { flex-basis: 330px; }
.wde-panel .whisky-panel-hint { justify-content: flex-start; padding-top: 1.25rem; max-height: 72vh; overflow-y: auto; }
.wde-list { list-style: none; margin: .8rem 0 0; padding: 0; width: 100%; text-align: left; }
.wde-list li + li { border-top: 1px solid #f1e4c7; }
.wde-list button {
    display: block; width: 100%; padding: .45rem .3rem; border: 0; background: none; cursor: pointer;
    text-align: left; font: inherit; font-size: .88rem; color: #78350f;
}
.wde-list button:hover { background: #fef3c7; }
.wde-list button span { display: block; font-size: .75rem; color: #a8a29e; }
.wde-more { font-size: .78rem; }
.wde-card h2 { margin: .1rem 0 .6rem; font-size: 1.3rem; line-height: 1.25; padding-right: 1.2rem; }
.wde-badge { display: inline-block; margin-bottom: .6rem; padding: .1rem .5rem; border-radius: 9px; background: #fde68a; color: #78350f; font-size: .75rem; font-weight: 600; }
.wde-facts { margin: 0 0 .8rem; }
.wde-facts > div { padding: .45rem 0; border-top: 1px solid rgba(255,255,255,.18); }
.wde-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #fde68a; }
.wde-facts dd { margin: .1rem 0 0; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.wde-facts a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.wde-fact-big dd { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.wde-hint { font-size: .78rem; color: rgba(255,255,255,.7); }
.wde-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.wde-links a {
    padding: .35rem .7rem; border-radius: 7px; background: rgba(255,255,255,.15); color: #fff;
    text-decoration: none; font-size: .85rem;
}
.wde-links a:hover { background: rgba(255,255,255,.28); }

.wde-pin-icon { background: none; border: 0; }
.wde-pin {
    position: relative; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    background: linear-gradient(135deg, #d97706, #92400e); border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,.35); transition: transform .12s;
}
.wde-pin span { display: block; transform: rotate(45deg); font-size: 13px; line-height: 22px; text-align: center; }
.wde-pin:hover { transform: rotate(-45deg) scale(1.15); }
.wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); transform: rotate(-45deg) scale(1.3); }
.wde-pin-inaktiv { filter: grayscale(1); opacity: .7; }

@media (max-width: 860px) {
    .wde-map { height: 55vh; }
    .wde-panel .whisky-panel-hint { max-height: none; }
}

/* ---------- Whisky: Schottische Whiskys (Farbe je Whisky-Region) ---------- */
.wsc-regions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.wsc-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid #e7d3a8; background: #fff; color: #44403c; font: inherit; font-size: .85rem; cursor: pointer;
}
.wsc-chip small { color: #a8a29e; }
.wsc-chip:hover { background: #fffbeb; }
.wsc-chip-on { background: #78350f; border-color: #78350f; color: #fff; }
.wsc-chip-on small { color: #fde68a; }
.wsc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--wsc-c, #d97706); }
.wsc-region-text { font-size: .85rem; line-height: 1.45; text-align: left; color: #57534e; }

.wsc-chip-speyside, .wsc-pin-speyside { --wsc-c: #d97706; --wsc-c2: #92400e; }
.wsc-chip-highland, .wsc-pin-highland { --wsc-c: #7c3aed; --wsc-c2: #4c1d95; }
.wsc-chip-lowland, .wsc-pin-lowland { --wsc-c: #16a34a; --wsc-c2: #14532d; }
.wsc-chip-islay, .wsc-pin-islay { --wsc-c: #475569; --wsc-c2: #0f172a; }
.wsc-chip-island, .wsc-pin-island { --wsc-c: #0891b2; --wsc-c2: #164e63; }
.wsc-chip-campbeltown, .wsc-pin-campbeltown { --wsc-c: #dc2626; --wsc-c2: #7f1d1d; }
.wde-pin[class*="wsc-pin-"] { background: linear-gradient(135deg, var(--wsc-c), var(--wsc-c2)); }
.wde-pin[class*="wsc-pin-"].wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }

.wsc-card-highland { background: linear-gradient(160deg, #6d28d9, #3b0764); }
.wsc-card-lowland { background: linear-gradient(160deg, #15803d, #14532d); }
.wsc-card-islay { background: linear-gradient(160deg, #475569, #0f172a); }
.wsc-card-island { background: linear-gradient(160deg, #0e7490, #164e63); }
.wsc-card-campbeltown { background: linear-gradient(160deg, #b91c1c, #7f1d1d); }

/* ---------- Whisky: Asiatische Whiskys (Farbe je Land) ---------- */
.was-flag { width: 18px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); vertical-align: -2px; }
.was-card-land { display: flex; align-items: center; gap: .4rem; }
.was-pin-jp { --wsc-c: #dc2626; --wsc-c2: #7f1d1d; }
.was-pin-tw { --wsc-c: #2563eb; --wsc-c2: #1e3a8a; }
.was-pin-in { --wsc-c: #ea580c; --wsc-c2: #7c2d12; }
.was-pin-cn { --wsc-c: #ca8a04; --wsc-c2: #713f12; }
.was-pin-kr { --wsc-c: #7c3aed; --wsc-c2: #3b0764; }
.was-pin-il { --wsc-c: #0891b2; --wsc-c2: #164e63; }
.was-pin-pk { --wsc-c: #16a34a; --wsc-c2: #14532d; }
.was-pin-bt { --wsc-c: #db2777; --wsc-c2: #831843; }
.wde-pin[class*="was-pin-"] { background: linear-gradient(135deg, var(--wsc-c), var(--wsc-c2)); }
.wde-pin[class*="was-pin-"].wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }
.was-card-jp { background: linear-gradient(160deg, #b91c1c, #450a0a); }
.was-card-tw { background: linear-gradient(160deg, #1d4ed8, #172554); }
.was-card-in { background: linear-gradient(160deg, #c2410c, #431407); }
.was-card-cn { background: linear-gradient(160deg, #a16207, #422006); }
.was-card-kr { background: linear-gradient(160deg, #6d28d9, #2e1065); }
.was-card-il { background: linear-gradient(160deg, #0e7490, #083344); }
.was-card-pk { background: linear-gradient(160deg, #15803d, #052e16); }
.was-card-bt { background: linear-gradient(160deg, #be185d, #500724); }

/* Whisky: Disclaimer-Kachel unten auf der Einstiegsseite (volle Breite, flach) */
.whisky-disclaimer {
    display: flex; gap: .75rem; align-items: flex-start;
    margin-top: 2rem; padding: .85rem 1.1rem; border-radius: 10px;
    background: #f5f5f4; border: 1px solid #e7e5e4; border-left: 4px solid #d97706;
    color: #57534e; font-size: .88rem; line-height: 1.5;
}
.whisky-disclaimer p { margin: 0; }
.whisky-disclaimer strong { color: #44403c; }
.whisky-disclaimer-icon { font-size: 1.2rem; line-height: 1.3; }

/* ---------- Whisky: Statistik ---------- */
.wst-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: .8rem; margin: 1.2rem 0 1.5rem; }
.wst-tile {
    padding: .9rem 1rem; border-radius: 12px; color: #fff;
    background: linear-gradient(160deg, #b45309, #78350f); box-shadow: 0 2px 8px rgba(120,53,15,.25);
}
.wst-tile-value { font-size: 1.7rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.wst-tile-label { font-size: .86rem; line-height: 1.4; margin-top: .25rem; }
.wst-tile-src { font-size: .7rem; color: #fde68a; margin-top: .4rem; }

.wst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 1rem; }
.wst-card { background: #fff; border: 1px solid #f1e4c7; border-radius: 12px; padding: 1rem 1.2rem; box-shadow: 0 1px 4px rgba(0,0,0,.05); min-width: 0; }
.wst-wide { margin-top: 1rem; }
.wst-card h2 { margin: 0; font-size: 1.15rem; color: #78350f; }
.wst-sub { margin: .15rem 0 .8rem; font-size: .82rem; color: #78716c; }
.wst-bars { display: flex; flex-direction: column; gap: 4px; }
.wst-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 4.6rem; align-items: center; gap: .6rem; padding: 2px 4px; border-radius: 6px; cursor: default; }
.wst-row:hover { background: #fffbeb; }
.wst-name { font-size: .85rem; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wst-track { height: 14px; display: block; }
.wst-bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: #d97706; transition: background .12s; }
.wst-row:hover .wst-bar { background: #92400e; }
.wst-val { font-size: .85rem; font-weight: 600; color: #1f2937; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wst-note { font-size: .8rem; color: #57534e; margin: .7rem 0 0; line-height: 1.45; }
.wst-src { display: inline-block; font-size: .72rem; color: #a8a29e; margin: .5rem 0 0; }
.wst-src a, a.wst-src { color: #92400e; }

.wst-records { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1rem; }
.wst-record { display: flex; gap: .8rem; padding: .9rem; border-radius: 10px; background: #fffbeb; border-left: 4px solid #d97706; }
.wst-record-icon { font-size: 1.8rem; line-height: 1; }
.wst-record-kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #b45309; font-weight: 700; }
.wst-record-title { font-weight: 600; color: #1f2937; margin-top: .1rem; }
.wst-record-value { font-size: 1.5rem; font-weight: 700; color: #78350f; margin: .15rem 0; font-variant-numeric: tabular-nums; }
.wst-record-text { font-size: .84rem; color: #57534e; line-height: 1.45; }
.wst-table { min-width: 480px; }
.wst-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 640px) {
    .wst-row { grid-template-columns: minmax(80px, 42%) 1fr 3.8rem; gap: .4rem; }
    .wst-name { white-space: normal; line-height: 1.2; }
    .wst-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .wst-tile { padding: .75rem .8rem; }
    .wst-tile-value { font-size: 1.25rem; }
    .wst-tile-label { font-size: .78rem; }
}

/* ---------- Whisky: US Whisky ---------- */
.wus-toggle { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: #44403c; cursor: pointer; }
.wus-pin-kern { --wsc-c: #b91c1c; --wsc-c2: #7f1d1d; }
.wus-pin-craft { --wsc-c: #d97706; --wsc-c2: #92400e; }
.wde-pin[class*="wus-pin-"] { background: linear-gradient(135deg, var(--wsc-c), var(--wsc-c2)); }
.wde-pin[class*="wus-pin-"].wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }
.wus-card-ky { background: linear-gradient(160deg, #b91c1c, #450a0a); }
.wus-card-tn { background: linear-gradient(160deg, #1f2937, #030712); }

/* ===== Whisky: Australien (wau-*) und Amerika ohne USA (wam-*) ===== */
.wau-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, var(--wsc-c), var(--wsc-c2)); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.wau-pin-tas { --wsc-c: #059669; --wsc-c2: #064e3b; }
.wau-pin-vic { --wsc-c: #1d4ed8; --wsc-c2: #1e3a8a; }
.wau-pin-nsw { --wsc-c: #0ea5e9; --wsc-c2: #075985; }
.wau-pin-sa  { --wsc-c: #dc2626; --wsc-c2: #7f1d1d; }
.wau-pin-wa  { --wsc-c: #f59e0b; --wsc-c2: #92400e; }
.wau-pin-qld { --wsc-c: #9333ea; --wsc-c2: #4c1d95; }
.wau-pin-act { --wsc-c: #64748b; --wsc-c2: #1e293b; }
.wde-pin[class*="wau-pin-"] { background: linear-gradient(135deg, var(--wsc-c), var(--wsc-c2)); }
.wde-pin[class*="wau-pin-"].wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }
.wau-card-tas { background: linear-gradient(160deg, #047857, #022c22); }
.wau-card-vic { background: linear-gradient(160deg, #1d4ed8, #172554); }
.wau-card-nsw { background: linear-gradient(160deg, #0369a1, #082f49); }
.wau-card-sa  { background: linear-gradient(160deg, #b91c1c, #450a0a); }
.wau-card-wa  { background: linear-gradient(160deg, #b45309, #451a03); }
.wau-card-qld { background: linear-gradient(160deg, #7e22ce, #3b0764); }
.wau-card-act { background: linear-gradient(160deg, #475569, #0f172a); }
.wam-flag { width: 18px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); vertical-align: -2px; }
.wam-card-land { display: flex; align-items: center; gap: .4rem; }
.wam-pin-ca { --wsc-c: #dc2626; --wsc-c2: #7f1d1d; }
.wam-pin-mx { --wsc-c: #16a34a; --wsc-c2: #14532d; }
.wam-pin-br { --wsc-c: #eab308; --wsc-c2: #713f12; }
.wam-pin-ar { --wsc-c: #38bdf8; --wsc-c2: #0c4a6e; }
.wam-pin-cl { --wsc-c: #2563eb; --wsc-c2: #1e3a8a; }
.wde-pin[class*="wam-pin-"] { background: linear-gradient(135deg, var(--wsc-c), var(--wsc-c2)); }
.wde-pin[class*="wam-pin-"].wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }
.wam-card-ca { background: linear-gradient(160deg, #b91c1c, #450a0a); }
.wam-card-mx { background: linear-gradient(160deg, #15803d, #052e16); }
.wam-card-br { background: linear-gradient(160deg, #a16207, #422006); }
.wam-card-ar { background: linear-gradient(160deg, #0369a1, #082f49); }
.wam-card-cl { background: linear-gradient(160deg, #1d4ed8, #172554); }

/* ===== Whisky: Stories (wsy-*) ===== */
.wsy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.wsy-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid #e7e5e4; border-top: 4px solid var(--wsy-c, #92400e); border-radius: 12px; padding: 1rem 1.1rem .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.wsy-card h2 { font-size: 1.08rem; margin: .5rem 0 .4rem; line-height: 1.3; color: #1c1917; }
.wsy-card p { margin: 0 0 .6rem; font-size: .93rem; line-height: 1.5; color: #44403c; }
.wsy-head { display: flex; align-items: center; gap: .5rem; }
.wsy-icon { font-size: 1.6rem; line-height: 1; }
.wsy-year { font-weight: 700; font-size: .9rem; color: var(--wsy-c, #92400e); }
.wsy-cat { margin-left: auto; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--wsy-c, #92400e); border-radius: 999px; padding: .15rem .55rem; }
.wsy-fact { background: color-mix(in srgb, var(--wsy-c, #92400e) 9%, #fff); border-radius: 8px; padding: .5rem .7rem; }
.wsy-fact strong { font-weight: 600; color: #1c1917; }
.wsy-src { margin-top: auto; padding-top: .4rem; font-size: .78rem; color: #78716c; }
.wsy-src a { color: inherit; }
.wsy-kurios { --wsy-c: #7c3aed; }
.wsy-krimi { --wsy-c: #1f2937; }
.wsy-kata { --wsy-c: #dc2626; }
.wsy-rekord { --wsy-c: #b45309; }
.wsy-geschichte { --wsy-c: #0f766e; }

/* ===== Whisky: Irland (wir-*), Europa (weu-*), Afrika & Neuseeland (wao-*) ===== */
.wir-flag, .weu-flag, .wao-flag { width: 18px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); vertical-align: -2px; }
.wir-card-land, .weu-card-land, .wao-card-land { display: flex; align-items: center; gap: .4rem; }
.wde-pin[class*="wir-pin-"], .wde-pin[class*="weu-pin-"], .wde-pin[class*="wao-pin-"] { background: linear-gradient(135deg, var(--wsc-c, #b45309), var(--wsc-c2, #78350f)); }
.wde-pin[class*="wir-pin-"].wde-pin-active, .wde-pin[class*="weu-pin-"].wde-pin-active, .wde-pin[class*="wao-pin-"].wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }
.wir-pin-ie { --wsc-c: #16a34a; --wsc-c2: #14532d; }
.wir-pin-gb-nir { --wsc-c: #2563eb; --wsc-c2: #1e3a8a; }
.wir-card-ie { background: linear-gradient(160deg, #15803d, #052e16); }
.wir-card-gb-nir { background: linear-gradient(160deg, #1d4ed8, #172554); }
.weu-pin-gb-eng { --wsc-c: #dc2626; --wsc-c2: #7f1d1d; } .weu-card-gb-eng { background: linear-gradient(160deg, #b91c1c, #450a0a); }
.weu-pin-gb-wls { --wsc-c: #16a34a; --wsc-c2: #14532d; } .weu-card-gb-wls { background: linear-gradient(160deg, #15803d, #052e16); }
.weu-pin-fr { --wsc-c: #2563eb; --wsc-c2: #1e3a8a; } .weu-card-fr { background: linear-gradient(160deg, #1d4ed8, #172554); }
.weu-pin-ch { --wsc-c: #e11d48; --wsc-c2: #881337; } .weu-card-ch { background: linear-gradient(160deg, #be123c, #4c0519); }
.weu-pin-at { --wsc-c: #f43f5e; --wsc-c2: #9f1239; } .weu-card-at { background: linear-gradient(160deg, #be123c, #4c0519); }
.weu-pin-se { --wsc-c: #0ea5e9; --wsc-c2: #075985; } .weu-card-se { background: linear-gradient(160deg, #0369a1, #082f49); }
.weu-pin-dk { --wsc-c: #b91c1c; --wsc-c2: #450a0a; } .weu-card-dk { background: linear-gradient(160deg, #991b1b, #450a0a); }
.weu-pin-no { --wsc-c: #7c3aed; --wsc-c2: #3b0764; } .weu-card-no { background: linear-gradient(160deg, #6d28d9, #2e1065); }
.weu-pin-fi { --wsc-c: #38bdf8; --wsc-c2: #0c4a6e; } .weu-card-fi { background: linear-gradient(160deg, #0284c7, #082f49); }
.weu-pin-is { --wsc-c: #0891b2; --wsc-c2: #164e63; } .weu-card-is { background: linear-gradient(160deg, #0e7490, #083344); }
.weu-pin-nl { --wsc-c: #f97316; --wsc-c2: #9a3412; } .weu-card-nl { background: linear-gradient(160deg, #ea580c, #431407); }
.weu-pin-be { --wsc-c: #eab308; --wsc-c2: #713f12; } .weu-card-be { background: linear-gradient(160deg, #a16207, #422006); }
.weu-pin-it { --wsc-c: #059669; --wsc-c2: #064e3b; } .weu-card-it { background: linear-gradient(160deg, #047857, #022c22); }
.weu-pin-es { --wsc-c: #ca8a04; --wsc-c2: #7c2d12; } .weu-card-es { background: linear-gradient(160deg, #b45309, #451a03); }
.weu-pin-li { --wsc-c: #4f46e5; --wsc-c2: #312e81; } .weu-card-li { background: linear-gradient(160deg, #4338ca, #1e1b4b); }
.wao-pin-za { --wsc-c: #16a34a; --wsc-c2: #14532d; } .wao-card-za { background: linear-gradient(160deg, #15803d, #052e16); }
.wao-pin-nz { --wsc-c: #1f2937; --wsc-c2: #030712; } .wao-card-nz { background: linear-gradient(160deg, #1f2937, #030712); }

/* ===== Whisky: Wissensseiten (wart-*, wfa-*, wvk-*, wzs-*, wlx-*) ===== */
.wart-h2 { font-size: 1.25rem; margin: 1.6rem 0 .5rem; color: #1c1917; }
.wart-hint { font-size: .88rem; color: #78716c; margin: 0 0 .6rem; }
.wart-typ h2 { margin-top: .4rem; }
.wart-table-wrap { overflow-x: auto; border: 1px solid #e7e5e4; border-radius: 12px; background: #fff; }
.wart-table { border-collapse: collapse; width: 100%; min-width: 860px; font-size: .9rem; }
.wart-table th, .wart-table td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid #f0eeec; }
.wart-table thead th { background: #78350f; color: #fff; font-weight: 600; position: sticky; top: 0; }
.wart-table tbody th { font-weight: 700; color: #1c1917; min-width: 150px; }
.wart-table tbody th small { display: block; font-weight: 400; font-size: .75rem; color: #78716c; margin-top: .15rem; }
.wart-table tbody tr:nth-child(even) { background: #fafaf9; }
.wart-facts { display: grid; gap: .6rem; margin-bottom: 1.2rem; }
.wart-fact { display: flex; gap: .7rem; align-items: flex-start; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: .7rem .9rem; }
.wart-fact > span { font-size: 1.3rem; line-height: 1.2; }
.wart-fact p { margin: 0; font-size: .93rem; line-height: 1.5; color: #44403c; }

.wfa-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; align-items: stretch; margin-bottom: .5rem; }
.wfa-size { background: #fff; border: 1px solid #e7e5e4; border-radius: 12px; padding: .8rem; text-align: center; display: flex; flex-direction: column; align-items: center; }
.wfa-barrel { height: 110px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: .4rem; }
.wfa-barrel span { display: block; height: var(--wfa-h); width: calc(var(--wfa-h) * .72); border-radius: 40% / 18%; background:
  repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 2px, transparent 2px 14px),
  linear-gradient(180deg, transparent 18%, #1c1917 18% 22%, transparent 22% 78%, #1c1917 78% 82%, transparent 82%),
  radial-gradient(ellipse at 50% 50%, #b45309, #78350f); box-shadow: inset 0 0 8px rgba(0,0,0,.35); }
.wfa-size strong { font-size: .98rem; }
.wfa-liter { font-size: .85rem; color: #b45309; font-weight: 600; }
.wfa-size p { font-size: .8rem; color: #57534e; margin: .35rem 0 0; line-height: 1.4; }

.wvk-steps { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem; counter-reset: wvk; }
.wvk-steps li { display: flex; gap: .6rem; background: #fff; border: 1px solid #e7e5e4; border-radius: 12px; padding: .8rem; counter-increment: wvk; }
.wvk-step-icon { font-size: 1.6rem; line-height: 1; }
.wvk-steps strong::before { content: counter(wvk) ". "; color: #b45309; }
.wvk-steps p { margin: .25rem 0 0; font-size: .88rem; line-height: 1.45; color: #44403c; }
.wvk-wheel { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.wvk-aroma { border: 2px solid var(--wvk-c); background: #fff; color: var(--wvk-c); border-radius: 999px; padding: .4rem .85rem; font-weight: 600; cursor: pointer; font-size: .92rem; }
.wvk-aroma:hover { background: color-mix(in srgb, var(--wvk-c) 10%, #fff); }
.wvk-aroma-on { background: var(--wvk-c); color: #fff; }
.wvk-aroma-detail { border-left: 5px solid var(--wvk-c); background: color-mix(in srgb, var(--wvk-c) 8%, #fff); border-radius: 0 10px 10px 0; padding: .7rem 1rem; margin-bottom: 1rem; }
.wvk-aroma-detail p { margin: .3rem 0 0; font-size: .92rem; }
.wvk-ppm { display: grid; gap: .45rem; background: #fff; border: 1px solid #e7e5e4; border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; }
.wvk-ppm-row { display: grid; grid-template-columns: minmax(140px, 260px) 1fr 110px; gap: .7rem; align-items: center; font-size: .9rem; }
.wvk-ppm-bar { height: 12px; background: #f5f5f4; border-radius: 999px; overflow: hidden; }
.wvk-ppm-bar span { display: block; height: 100%; background: linear-gradient(90deg, #a8a29e, #374151); border-radius: 999px; }
.wvk-ppm-val { color: #57534e; text-align: right; }
@media (max-width: 600px) { .wvk-ppm-row { grid-template-columns: 1fr 80px; } .wvk-ppm-bar { grid-column: 1 / -1; grid-row: 2; } }

.wzs-line { list-style: none; padding: 0; margin: 1rem 0; position: relative; }
.wzs-line::before { content: ""; position: absolute; left: 114px; top: 0; bottom: 0; width: 3px; background: linear-gradient(#d97706, #78350f); border-radius: 3px; }
.wzs-item { display: grid; grid-template-columns: 92px 36px 1fr; gap: .4rem; align-items: start; margin-bottom: .9rem; }
.wzs-year { font-weight: 700; color: #92400e; text-align: right; padding-top: .55rem; font-size: .9rem; }
.wzs-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid #d97706; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.wzs-body { background: #fff; border: 1px solid #e7e5e4; border-radius: 12px; padding: .65rem .9rem; }
.wzs-body strong { display: block; font-size: 1rem; color: #1c1917; }
.wzs-body p { margin: .25rem 0 0; font-size: .9rem; line-height: 1.5; color: #44403c; }
.wzs-land { float: right; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #78716c; }
.wzs-more { display: inline-block; margin-top: .3rem; font-size: .82rem; color: #b45309; }
@media (max-width: 600px) { .wzs-item { grid-template-columns: 60px 32px 1fr; } .wzs-line::before { left: 81px; } .wzs-year { font-size: .78rem; } }

.wlx-abc { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 1rem; }
.wlx-abc a { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 8px; background: #fff; border: 1px solid #e7e5e4; color: #92400e; font-weight: 700; text-decoration: none; }
.wlx-abc a:hover { background: #fef3c7; }
.wlx-group { scroll-margin-top: 1rem; }
.wlx-group h2 { font-size: 1.5rem; color: #b45309; border-bottom: 2px solid #fde68a; margin: 1.2rem 0 .5rem; padding-bottom: .2rem; }
.wlx-list { margin: 0; display: grid; gap: .5rem; }
.wlx-item { background: #fff; border: 1px solid #e7e5e4; border-radius: 10px; padding: .6rem .85rem; }
.wlx-item dt { font-weight: 700; color: #1c1917; }
.wlx-item dt small { font-weight: 400; color: #78716c; }
.wlx-item dd { margin: .2rem 0 0; font-size: .92rem; line-height: 1.5; color: #44403c; }

.wau-pin-nz { --wsc-c: #1f2937; --wsc-c2: #030712; }
.wau-card-nz { background: linear-gradient(160deg, #1f2937, #030712); }

/* Menü: zweite Ebene (Whisky › Destillerien) */
.menu-sub-2 { margin-left: .6rem; }
.menu-sub-2 .menu-sub-btn { font-size: .88rem; padding: .38rem .7rem; background: linear-gradient(135deg, #353d48, #272e37); }
.menu-sub-2 .menu-sub-btn:hover { background: linear-gradient(135deg, #47505d, #343c47); }
.menu-sub-2 .menu-sub-btn.active { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

/* ===== Whisky: Sortiment-Button und -Fenster (wso-*) ===== */
.wso-btn { display: inline-flex; align-items: center; gap: .45rem; margin: .2rem 0 .7rem; padding: .5rem .9rem; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; background: rgba(255,255,255,.14); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.wso-btn:hover { background: rgba(255,255,255,.26); }
.wso-badge { background: #facc15; color: #422006; border-radius: 999px; padding: 0 .5rem; font-size: .8rem; }
.wso-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 2000; }
.wso-dialog { position: fixed; z-index: 2001; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); max-height: min(80vh, 640px); display: flex; flex-direction: column; background: #fff; color: #1c1917; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.wso-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.2rem .8rem; background: linear-gradient(135deg, #92400e, #451a03); color: #fff; }
.wso-head h3 { margin: .1rem 0 0; font-size: 1.2rem; }
.wso-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #fcd34d; }
.wso-close { border: 0; background: transparent; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.wso-list { list-style: none; margin: 0; padding: .4rem 0; overflow-y: auto; }
.wso-list li { padding: .5rem 1.2rem; border-bottom: 1px solid #f0eeec; font-size: .95rem; }
.wso-list li::before { content: "🥃"; margin-right: .55rem; font-size: .85rem; }
.wso-foot { padding: .7rem 1.2rem; font-size: .76rem; color: #78716c; background: #fafaf9; display: flex; flex-direction: column; gap: .2rem; }

/* ---------- Dashboard: bis zu 7 Aktien – Zeilen etwas kompakter, damit alle in die Kachel passen ---------- */
.db-stocks { gap: .35rem; }
.db-stocks .db-stock { padding-top: .35rem; padding-bottom: .35rem; }

/* ---------- Dashboard: Aktie anklicken → Detailfenster mit Kursverlauf ---------- */
.db-stock-click { cursor: pointer; transition: background .15s, box-shadow .15s; }
.db-stock-click:hover, .db-stock-click:focus-visible { box-shadow: 0 0 0 2px #93c5fd inset; outline: none; }
.akd-modal { width: min(860px, calc(100vw - 2rem)); padding: 1.2rem 1.4rem 1.3rem; }
.akd-modal .ak-detail-head h2 { font-size: 1.3rem; }
.akd-head-right { display: flex; align-items: flex-start; gap: .9rem; }
.akd-modal .ak-chart-placeholder { height: 260px; }
@media (max-width: 860px) {
    .akd-modal { width: 100%; }
    .akd-head-right { width: 100%; justify-content: space-between; }
    .akd-modal .ak-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Dashboard: Blitzortung (LightningMaps.org als iframe) – Karte füllt die Kachel */
.db-card-lightning .db-card-body { overflow: hidden; padding-right: 0; display: flex; }
/* Blitzkarte (Shared/BlitzKarte.razor): Blitzortung.org / Windy als iframe */
.bk-wrap { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: .6rem; }
.bk-frame-box { flex: 1; min-height: 0; position: relative; }
.bk-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; background: #0f172a; }
.bk-expand { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background: transparent; cursor: zoom-in; border-radius: 10px; }
.bk-expand:focus-visible { outline: 3px solid #f59e0b; outline-offset: -3px; }
.bk-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.bk-switch-btn { border: 1px solid #cbd5e1; background: linear-gradient(#ffffff, #eef2f7); color: #1f2937; border-radius: 999px; padding: .35rem .9rem; font-size: .92rem; cursor: pointer; }
.bk-switch-btn:hover { background: linear-gradient(#f8fafc, #e2e8f0); }
.bk-switch-btn.bk-active { background: linear-gradient(#fbbf24, #f59e0b); border-color: #d97706; color: #1f2937; font-weight: 600; }
.bk-source { margin-left: auto; }
.bk-hint { margin: 0; font-size: .82rem; color: #6b7280; }
.bk-page { display: flex; flex-direction: column; height: calc(100vh - 4rem); min-height: 520px; }
.bk-page h1 { margin-bottom: .6rem; }
.bk-page .bk-wrap { flex: 1; }
.rrd-body .bk-wrap { padding: .6rem; }
@media (max-width: 700px) {
    .bk-page { height: calc(100vh - 6rem); min-height: 420px; }
    .bk-switch-btn { padding: .3rem .7rem; font-size: .85rem; }
    .bk-source { margin-left: 0; }
}

/* ---------- Dashboard kompakt: ungerade Kachelzahl → Blitzortung doppelt breit (Wetter bleibt einfach breit), beide Zeilen gefüllt ---------- */
@media (min-width: 1000px) and (max-height: 1000px) {
    .db-grid > .db-span-2 { grid-column: span 2; }
    /* breites Wetter: Zusammenfassung und Kennzahlen nebeneinander statt untereinander */
    .db-card-weather.db-span-2 .wx-summary { grid-template-columns: auto auto minmax(0, 1fr); align-items: center; }
    .db-card-weather.db-span-2 .wx-stats { grid-column: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* fünf schmalere Spalten: Aktienzeilen ohne ISIN, damit 7 Aktien sicher passen */
    .db-grid[style*="--db-cols:5"] .db-stock-isin { display: none; }
}

/* ---------- Deutsche Münzen / Sammlermünzen Euro ---------- */
.sm-intro { color: #475569; max-width: 820px; }
.sm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1rem; margin-top: 1.25rem; }
.sm-link-tile {
    display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 10px; text-decoration: none; color: #1f2937;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0); box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s;
}
.sm-link-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.sm-link-tile strong { display: block; font-size: 1.1rem; color: #1e3a5f; }
.sm-link-tile span span { font-size: .9rem; color: #475569; }
.sm-link-coins { display: flex; align-items: center; flex: 0 0 auto; }
.sm-link-coins .sm-coin + .sm-coin { margin-left: -14px; }

/* Münz-Medaillon */
.sm-coin {
    flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; font-family: Georgia, "Times New Roman", serif; line-height: 1; user-select: none;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), inset 0 0 0 5px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.25);
}
.sm-coin-big { width: 66px; height: 66px; }
.sm-coin-val { font-size: 1.25rem; font-weight: 700; }
.sm-coin-big .sm-coin-val { font-size: 1.3rem; }
.sm-coin-eur { font-size: .5rem; letter-spacing: .14em; margin-top: 2px; font-family: system-ui, sans-serif; font-weight: 600; }
.sm-m-silber { background: radial-gradient(circle at 32% 28%, #ffffff 0%, #e2e8f0 35%, #94a3b8 80%, #64748b 100%); color: #334155; }
.sm-m-gold { background: radial-gradient(circle at 32% 28%, #fff7cc 0%, #fcd34d 35%, #d4a017 75%, #a16207 100%); color: #713f12; }
.sm-m-cu { background: radial-gradient(circle at 32% 28%, #f8fafc 0%, #cbd5e1 40%, #8b97a8 100%); color: #1e293b; }
.sm-coin-ring::before {
    content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 4px solid rgba(56,189,248,.65); box-shadow: 0 0 6px rgba(56,189,248,.5);
}
.sm-coin-ring > span { position: relative; }

/* Kennzahlen */
.sm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 1rem 0; max-width: 820px; }
.sm-stat { background: #fff; border: 1px solid #e2e8f0; border-left: 5px solid #94a3b8; border-radius: 10px; padding: .6rem .9rem; display: flex; flex-direction: column; }
.sm-stat-gold { border-left-color: #d4a017; }
.sm-stat-cu { border-left-color: #38bdf8; }
.sm-stat-plan { border-left-color: #a78bfa; }
.sm-stat-num { font-size: 1.7rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sm-stat-lbl { font-size: .82rem; color: #64748b; }

/* Filter */
.sm-filter { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.sm-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.sm-filter-lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; min-width: 72px; }
.sm-chip {
    padding: .3rem .75rem; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: #334155;
    font: inherit; font-size: .85rem; cursor: pointer;
}
.sm-chip:hover { background: #f1f5f9; }
.sm-chip-on { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }
.sm-chip-on:hover { background: #24476f; }
.sm-chip-gold.sm-chip-on { background: #a16207; border-color: #a16207; }
.sm-chip-silber.sm-chip-on { background: #475569; border-color: #475569; }
.sm-chip-cu.sm-chip-on { background: #0369a1; border-color: #0369a1; }
.sm-search { margin-left: auto; flex: 1 1 220px; max-width: 340px; padding: .35rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: .9rem; }

/* Jahres-Sprungleiste */
.sm-years {
    position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .25rem; margin: .8rem 0 .3rem; padding: .45rem .3rem;
    background: rgba(248,250,252,.95); backdrop-filter: blur(4px); border-bottom: 1px solid #e2e8f0;
}
.sm-year-link { padding: .15rem .45rem; border-radius: 6px; font-size: .8rem; color: #1e3a5f; text-decoration: none; font-variant-numeric: tabular-nums; }
.sm-year-link:hover { background: #e2e8f0; }
.sm-count, .sm-empty { font-size: .85rem; color: #64748b; margin: .3rem 0; }

/* Jahresabschnitte */
.sm-year { margin-top: 1.4rem; scroll-margin-top: 4.5rem; }
.sm-year-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem; margin: 0 0 .6rem; border-bottom: 2px solid #e2e8f0; padding-bottom: .3rem; }
.sm-year-num { font-size: 1.7rem; color: #1e3a5f; font-variant-numeric: tabular-nums; }
.sm-year-sub { font-size: .85rem; font-weight: 400; color: #64748b; }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: .8rem; }

.sm-card { display: flex; gap: .85rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .8rem .9rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.sm-card-plan { border-style: dashed; background: #fafaff; }
.sm-card-body { min-width: 0; flex: 1; }
.sm-card-body h3 { margin: .25rem 0 .4rem; font-size: 1rem; color: #0f172a; line-height: 1.3; }
.sm-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.sm-tag { font-size: .7rem; padding: .1rem .5rem; border-radius: 999px; background: #f1f5f9; color: #334155; white-space: nowrap; }
.sm-tag-silber { background: #e2e8f0; color: #334155; }
.sm-tag-gold { background: #fef3c7; color: #92400e; }
.sm-tag-cu { background: #e0f2fe; color: #075985; }
.sm-tag-serie { background: #eef2ff; color: #3730a3; }
.sm-tag-plan { background: #ede9fe; color: #6d28d9; }
.sm-facts { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; margin: 0; font-size: .84rem; }
.sm-facts dt { color: #64748b; }
.sm-facts dd { margin: 0; color: #1e293b; overflow-wrap: anywhere; }
.sm-facts small { color: #94a3b8; }
.sm-rand { margin: .45rem 0 0; font-size: .82rem; font-style: italic; color: #334155; overflow-wrap: anywhere; }
.sm-rand span { font-style: normal; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-right: .3rem; }
.sm-note { margin: .4rem 0 0; font-size: .8rem; color: #475569; background: #f8fafc; border-left: 3px solid #cbd5e1; padding: .3rem .5rem; border-radius: 0 6px 6px 0; }

/* Wissenswertes */
.sm-info { margin-top: 2.2rem; }
.sm-info h2 { color: #1e3a5f; }
.sm-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; }
.sm-info-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .9rem 1.1rem; }
.sm-info-box h3 { margin: .2rem 0 .5rem; font-size: 1rem; color: #0f172a; }
.sm-info-box h3:not(:first-child) { margin-top: 1rem; }
.sm-timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid #cbd5e1; }
.sm-timeline li { position: relative; padding: 0 0 .55rem .9rem; font-size: .85rem; color: #334155; }
.sm-timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #64748b; }
.sm-timeline b { color: #1e3a5f; margin-right: .25rem; }
.sm-mints { border-collapse: collapse; font-size: .85rem; }
.sm-mints th { text-align: left; padding: .15rem .8rem .15rem 0; color: #1e3a5f; font-family: Georgia, serif; font-size: 1rem; }
.sm-mints td { padding: .15rem 0; color: #334155; }
.sm-small { font-size: .84rem; color: #475569; line-height: 1.5; }
.sm-series { list-style: none; padding: 0; margin: 0; font-size: .86rem; }
.sm-series li { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; padding: .25rem 0; border-bottom: 1px solid #f1f5f9; }
.sm-series small { color: #64748b; }
.sm-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; align-self: center; }
.sm-footnote { font-size: .78rem; color: #64748b; max-width: 900px; margin-top: 1.2rem; }

@media (max-width: 640px) {
    .sm-card { padding: .7rem; gap: .65rem; }
    .sm-coin { width: 48px; height: 48px; }
    .sm-coin-big { width: 54px; height: 54px; }
    .sm-coin-val { font-size: 1.05rem; }
    .sm-coin-big .sm-coin-val { font-size: 1.05rem; }
    .sm-search { margin-left: 0; max-width: none; }
    .sm-filter-lbl { min-width: 100%; }
    .sm-years { position: static; }
}

/* Gedenkmünzen vor 1949: Epochen */
.sm-ep-kaiser { --sm-ep: #7c2d12; }
.sm-ep-weimar { --sm-ep: #1e3a5f; }
.sm-ep-ns { --sm-ep: #52525b; }
.sm-stat.sm-ep-kaiser, .sm-stat.sm-ep-weimar, .sm-stat.sm-ep-ns { border-left-color: var(--sm-ep); }
.sm-epoch { margin: 2rem 0 .2rem; padding: .7rem 1rem; border-radius: 12px; background: #fff; border: 1px solid #e2e8f0; border-left: 6px solid var(--sm-ep); }
.sm-epoch h2 { margin: 0; color: var(--sm-ep); font-size: 1.35rem; }
.sm-epoch h2 small { font-size: .9rem; font-weight: 400; color: #64748b; margin-left: .4rem; }
.sm-epoch p { margin: .25rem 0 0; font-size: .88rem; color: #475569; }

/* Münzfotos (Wikimedia Commons) */
.sm-photo-wrap { flex: 0 0 112px; width: 112px; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.sm-photo-btn { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.sm-photo-btn:focus-visible { outline: 2px solid #1e3a5f; outline-offset: 2px; }
.sm-photo { display: block; width: 112px; height: 112px; object-fit: contain; border-radius: 8px; background: #f8fafc; }
.sm-photo-credit { font-size: .62rem; line-height: 1.2; color: #94a3b8; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.sm-photo-credit:hover { color: #475569; text-decoration: underline; }
.sm-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.82); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sm-lightbox-fig { position: relative; margin: 0; background: #fff; border-radius: 12px; padding: 1rem; max-width: min(92vw, 900px); max-height: 92vh; display: flex; flex-direction: column; gap: .6rem; }
.sm-lightbox-fig img { max-width: 100%; max-height: 72vh; object-fit: contain; align-self: center; }
.sm-lightbox-fig figcaption { font-size: .82rem; color: #475569; }
.sm-lightbox-fig figcaption a { color: #1e3a5f; }
.sm-lightbox-close { position: absolute; top: .3rem; right: .5rem; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #64748b; }
@media (max-width: 640px) {
    .sm-photo-wrap { flex-basis: 84px; width: 84px; }
    .sm-photo { width: 84px; height: 84px; }
}

/* ---------- BMW / Modellreihen ---------- */
.bmw-k-vorkrieg { --bmw-k: #78350f; }
.bmw-k-klassiker { --bmw-k: #a16207; }
.bmw-k-kompakt { --bmw-k: #0891b2; }
.bmw-k-mittel { --bmw-k: #1d4ed8; }
.bmw-k-ober { --bmw-k: #1e3a5f; }
.bmw-k-sport { --bmw-k: #dc2626; }
.bmw-k-m { --bmw-k: #312e81; }
.bmw-k-x { --bmw-k: #15803d; }
.bmw-k-i { --bmw-k: #7c3aed; }

.bmw-intro { color: #475569; max-width: 820px; }
.bmw-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1rem; margin-top: 1.25rem; }
.bmw-link-tile {
    display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 10px; text-decoration: none; color: #1f2937;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0); box-shadow: 0 1px 4px rgba(0,0,0,.12); transition: transform .12s, box-shadow .12s;
}
.bmw-link-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.bmw-link-tile strong { display: block; font-size: 1.1rem; color: #1e3a5f; }
.bmw-link-tile span span { font-size: .9rem; color: #475569; }
.bmw-badge {
    flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 32% 28%, #3b82f6 0%, #1d4ed8 45%, #1e3a5f 100%); color: #fff; font-weight: 700; font-size: .95rem;
    letter-spacing: .03em; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.25);
}

/* Kennzahlen */
.bmw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 1rem 0; max-width: 820px; }
.bmw-stat { background: #fff; border: 1px solid #e2e8f0; border-left: 5px solid #1d4ed8; border-radius: 10px; padding: .6rem .9rem; display: flex; flex-direction: column; }
.bmw-stat-akt { border-left-color: #16a34a; }
.bmw-stat-num { font-size: 1.7rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bmw-stat-lbl { font-size: .82rem; color: #64748b; }

/* Filter */
.bmw-filter { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.bmw-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.bmw-filter-lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; min-width: 72px; }
.bmw-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; border: 1px solid #cbd5e1;
    background: #fff; color: #334155; font: inherit; font-size: .85rem; cursor: pointer;
}
.bmw-chip:hover { background: #f1f5f9; }
.bmw-chip-on { background: var(--bmw-k, #1e3a5f); border-color: var(--bmw-k, #1e3a5f); color: #fff; }
.bmw-chip-on:hover { background: var(--bmw-k, #1e3a5f); filter: brightness(1.12); }
.bmw-chip-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bmw-k); }
.bmw-chip-on .bmw-chip-dot { background: #fff; }
.bmw-chip-plain { color: #64748b; }
.bmw-search { margin-left: auto; flex: 1 1 220px; max-width: 340px; padding: .35rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: .9rem; }
.bmw-count { font-size: .85rem; color: #64748b; margin: .6rem 0 .3rem; }

/* Detail zur ausgewählten Generation */
.bmw-detail {
    position: relative; display: flex; gap: 1rem; align-items: flex-start; margin: .4rem 0 .8rem; padding: .8rem 2.4rem .8rem 1rem;
    background: #fff; border: 1px solid #e2e8f0; border-left: 6px solid var(--bmw-k); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.bmw-detail-code, .bmw-card-code {
    flex: 0 0 auto; min-width: 64px; padding: .5rem .6rem; border-radius: 8px; background: var(--bmw-k, #1e3a5f); color: #fff;
    font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; font-size: .95rem; line-height: 1.2;
}
.bmw-detail-body { min-width: 0; flex: 1; }
.bmw-detail h3 { margin: 0 0 .35rem; color: #0f172a; }
.bmw-detail-close { position: absolute; top: .3rem; right: .5rem; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #64748b; }
.bmw-facts { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; margin: 0; font-size: .86rem; }
.bmw-facts dt { color: #64748b; }
.bmw-facts dd { margin: 0; color: #1e293b; overflow-wrap: anywhere; }
.bmw-info { margin: .45rem 0 0; font-size: .84rem; color: #475569; background: #f8fafc; border-left: 3px solid #cbd5e1; padding: .3rem .5rem; border-radius: 0 6px 6px 0; }

/* Zeitstrahl (Gantt) */
.bmw-gantt-scroll { overflow-x: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; -webkit-overflow-scrolling: touch; }
.bmw-gantt { --label-w: 170px; --lane-h: 26px; min-width: 1000px; padding-bottom: .4rem; }
.bmw-axis, .bmw-row { display: flex; }
.bmw-row-label {
    position: sticky; left: 0; z-index: 3; flex: 0 0 var(--label-w); width: var(--label-w); padding: 0 .6rem; background: #fff;
    border-right: 1px solid #e2e8f0; font-size: .82rem; color: #1e293b; display: flex; align-items: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bmw-track { position: relative; flex: 1; margin-right: 14px; }
.bmw-axis { position: sticky; top: 0; z-index: 4; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.bmw-axis .bmw-row-label { background: #f8fafc; }
.bmw-axis .bmw-track { height: 28px; }
.bmw-tick { position: absolute; top: 6px; transform: translateX(-50%); font-size: .75rem; color: #64748b; font-variant-numeric: tabular-nums; }
.bmw-gantt-kat { position: sticky; left: 0; padding: .55rem .6rem .2rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--bmw-k); width: max-content; }
.bmw-row .bmw-track { height: calc(var(--lanes) * var(--lane-h) + 8px); }
.bmw-row { border-bottom: 1px solid #f1f5f9; }
.bmw-row:hover .bmw-row-label { background: #f8fafc; }
.bmw-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: #eef2f7; }
.bmw-today { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(220,38,38,.45); z-index: 1; }
.bmw-bar {
    position: absolute; z-index: 2; height: calc(var(--lane-h) - 6px); min-width: 6px; padding: 0 .35rem; border: 1px solid rgba(255,255,255,.7);
    border-radius: 5px; background: var(--bmw-k); color: #fff; font: inherit; font-size: .7rem; font-weight: 600; line-height: 1;
    display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.15);
    transition: filter .1s, transform .1s;
}
.bmw-bar span { overflow: hidden; text-overflow: clip; }
.bmw-bar:hover { filter: brightness(1.15); z-index: 3; }
.bmw-bar:focus-visible { outline: 2px solid #0f172a; outline-offset: 1px; }
.bmw-bar-akt { border-radius: 5px 0 0 5px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-right: 12px; }
.bmw-bar-sel { box-shadow: 0 0 0 2px #0f172a; z-index: 3; }
.bmw-bar.bmw-k-m { background: linear-gradient(to bottom, var(--bmw-k) 0 75%, #0ea5e9 75% 83%, #1e3a8a 83% 91%, #dc2626 91%); }
.bmw-legend-note { font-size: .78rem; color: #64748b; margin: .35rem 0 0; }

/* Listenansicht */
.bmw-kat { margin-top: 1.6rem; }
.bmw-kat-head { margin: 0 0 .3rem; color: var(--bmw-k); border-bottom: 3px solid var(--bmw-k); padding-bottom: .25rem; }
.bmw-kat-head small { font-size: .85rem; font-weight: 400; color: #64748b; margin-left: .4rem; }
.bmw-reihe-head { margin: 1rem 0 .5rem; font-size: 1.05rem; color: #0f172a; }
.bmw-reihe-head small { font-weight: 400; color: #64748b; margin-left: .35rem; font-size: .85rem; }
.bmw-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: .7rem; }
.bmw-card { display: flex; gap: .8rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .75rem .85rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bmw-card-akt { border-color: #86efac; }
.bmw-card-body { min-width: 0; flex: 1; }
.bmw-card-top { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.bmw-card h4 { margin: 0 0 .35rem; font-size: .98rem; color: #0f172a; }
.bmw-tag-akt { font-size: .68rem; padding: .08rem .45rem; border-radius: 999px; background: #dcfce7; color: #166534; }

/* Chronik */
.bmw-chronik { margin-top: 2.2rem; max-width: 900px; }
.bmw-chronik h2 { color: #1e3a5f; }
.bmw-timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid #cbd5e1; }
.bmw-timeline li { position: relative; padding: 0 0 .6rem .9rem; font-size: .88rem; color: #334155; }
.bmw-timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #1d4ed8; }
.bmw-timeline b { color: #1e3a5f; margin-right: .3rem; }
.bmw-footnote { font-size: .78rem; color: #64748b; max-width: 900px; margin-top: 1.2rem; }

@media (max-width: 640px) {
    .bmw-gantt { --label-w: 104px; --lane-h: 24px; min-width: 820px; }
    .bmw-row-label { font-size: .74rem; padding: 0 .4rem; }
    .bmw-search { margin-left: 0; max-width: none; }
    .bmw-filter-lbl { min-width: 100%; }
    .bmw-detail { flex-direction: column; gap: .5rem; }
    .bmw-card { padding: .65rem; gap: .6rem; }
    .bmw-card-code { min-width: 54px; font-size: .85rem; }
}

/* ---------- BMW / Firmengeschichte ---------- */
.bmw-badge-hist { background: radial-gradient(circle at 32% 28%, #fde68a 0%, #d4a017 45%, #92400e 100%); color: #1f1300; }
.bmwh-t-firma { --bmwh: #1e3a5f; --bmwh-bg: #e0e7f1; }
.bmwh-t-luft { --bmwh: #0369a1; --bmwh-bg: #e0f2fe; }
.bmwh-t-moto { --bmwh: #b45309; --bmwh-bg: #fef3c7; }
.bmwh-t-auto { --bmwh: #1d4ed8; --bmwh-bg: #dbeafe; }
.bmwh-t-werk { --bmwh: #4b5563; --bmwh-bg: #e5e7eb; }
.bmwh-t-sport { --bmwh: #dc2626; --bmwh-bg: #fee2e2; }
.bmwh-chip.bmw-chip-on { background: var(--bmwh); border-color: var(--bmwh); }
.bmwh-ico { font-size: .95rem; line-height: 1; }

/* Epochen-Leiste */
.bmwh-epochnav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: .5rem; overflow-x: auto;
    margin: 1rem 0 .8rem; padding-bottom: .3rem; -webkit-overflow-scrolling: touch;
}
.bmwh-epochlink {
    display: flex; flex-direction: column; gap: .15rem; padding: .55rem .7rem; border-radius: 10px; text-decoration: none;
    background: linear-gradient(160deg, #1e3a5f, #1d4ed8); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: transform .12s, filter .12s;
}
.bmwh-epochlink:hover { transform: translateY(-2px); filter: brightness(1.1); }
.bmwh-epochlink-jahre { font-size: .72rem; letter-spacing: .05em; opacity: .8; font-variant-numeric: tabular-nums; }
.bmwh-epochlink-name { font-size: .85rem; font-weight: 600; line-height: 1.25; }

/* Epoche */
.bmwh-epoch { margin-top: 2.2rem; scroll-margin-top: 1rem; }
.bmwh-epoch-head {
    display: flex; gap: 1rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 14px;
    background: linear-gradient(120deg, #0f172a, #1e3a5f 60%, #1d4ed8); color: #e2e8f0;
}
.bmwh-epoch-nr {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.45); font-weight: 700; font-size: 1.2rem; color: #fff;
}
.bmwh-epoch-head h2 { margin: 0; color: #fff; font-size: 1.3rem; }
.bmwh-epoch-head h2 small { font-size: .85rem; font-weight: 400; color: #93c5fd; margin-left: .4rem; white-space: nowrap; }
.bmwh-epoch-head p { margin: .3rem 0 0; font-size: .9rem; color: #cbd5e1; max-width: 860px; }

/* Zeitleiste */
.bmwh-line { list-style: none; margin: 1rem 0 0; padding: 0; position: relative; }
.bmwh-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: 19px; width: 3px; border-radius: 2px; background: linear-gradient(#cbd5e1, #e2e8f0); }
.bmwh-item { position: relative; padding: 0 0 .9rem 52px; }
.bmwh-dot {
    position: absolute; left: 4px; top: .55rem; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--bmwh-bg); border: 2px solid var(--bmwh); font-size: .95rem; z-index: 1;
}
.bmwh-card {
    background: #fff; border: 1px solid #e2e8f0; border-top: 3px solid var(--bmwh); border-radius: 12px; padding: .7rem .9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: box-shadow .12s, transform .12s;
}
.bmwh-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.bmwh-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .6rem; }
.bmwh-year { font-size: 1.35rem; font-weight: 700; color: var(--bmwh); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bmwh-date { font-size: .8rem; color: #64748b; }
.bmwh-tag { margin-left: auto; font-size: .68rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bmwh-bg); color: var(--bmwh); font-weight: 600; white-space: nowrap; }
.bmwh-card h3 { margin: .3rem 0 .25rem; font-size: 1rem; color: #0f172a; }
.bmwh-card p { margin: 0; font-size: .88rem; color: #475569; line-height: 1.5; }
.bmwh-item-big .bmwh-card { background: linear-gradient(135deg, #fff 60%, var(--bmwh-bg)); border-width: 1px 1px 1px 1px; border-top-width: 4px; }
.bmwh-item-big .bmwh-dot { width: 40px; height: 40px; left: 1px; top: .4rem; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--bmwh-bg); }
.bmwh-item-big .bmwh-card h3 { font-size: 1.08rem; }

/* breite Bildschirme: Karten abwechselnd links und rechts der Mittellinie */
@media (min-width: 1100px) {
    .bmwh-line::before { left: 50%; margin-left: -1.5px; }
    .bmwh-item { width: 50%; padding: 0 2.6rem 1rem 0; }
    .bmwh-item:nth-child(even) { margin-left: 50%; padding: 0 0 1rem 2.6rem; }
    .bmwh-item:nth-child(odd) .bmwh-dot { left: auto; right: -17px; }
    .bmwh-item:nth-child(even) .bmwh-dot { left: -17px; }
    .bmwh-item-big:nth-child(odd) .bmwh-dot { right: -20px; }
    .bmwh-item-big:nth-child(even) .bmwh-dot { left: -20px; }
    .bmwh-item + .bmwh-item { margin-top: -2.2rem; }
    .bmwh-item:nth-child(odd) .bmwh-card-head { flex-direction: row-reverse; }
    .bmwh-item:nth-child(odd) .bmwh-tag { margin-left: 0; margin-right: auto; }
    .bmwh-item:nth-child(odd) .bmwh-card { text-align: right; }
}

@media (max-width: 640px) {
    .bmwh-epoch-head { padding: .75rem .8rem; gap: .7rem; }
    .bmwh-epoch-nr { width: 36px; height: 36px; font-size: 1rem; }
    .bmwh-epoch-head h2 { font-size: 1.1rem; }
    .bmwh-item { padding-left: 46px; }
    .bmwh-dot { width: 30px; height: 30px; left: 5px; font-size: .85rem; }
    .bmwh-item-big .bmwh-dot { width: 34px; height: 34px; left: 3px; }
    .bmwh-year { font-size: 1.15rem; }
}

/* ---------- BMW / 3er im Detail ---------- */
.bmw-badge-3er { font-size: 1.7rem; font-family: Georgia, "Times New Roman", serif; background: radial-gradient(circle at 32% 28%, #93c5fd 0%, #2563eb 45%, #0f172a 100%); }
.bmw-more { display: inline-block; margin-top: .45rem; font-size: .85rem; font-weight: 600; color: #1d4ed8; text-decoration: none; }
.bmw-reihe-head .bmw-more { margin: 0 0 0 .6rem; font-size: .8rem; }
.bmw-more:hover { text-decoration: underline; }

/* Generationen-Reiter */
.b3-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr); gap: .4rem; overflow-x: auto; margin: 1rem 0 .8rem; padding-bottom: .3rem; }
.b3-tab {
    display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem .4rem; border-radius: 10px; cursor: pointer; font: inherit;
    background: #fff; border: 1px solid #cbd5e1; color: #1e3a5f; transition: background .12s, transform .12s;
}
.b3-tab:hover { background: #f1f5f9; transform: translateY(-1px); }
.b3-tab-code { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.b3-tab-jahre { font-size: .72rem; color: #64748b; white-space: nowrap; }
.b3-tab-on { background: linear-gradient(160deg, #1e3a5f, #1d4ed8); border-color: #1d4ed8; color: #fff; box-shadow: 0 3px 10px rgba(29,78,216,.3); }
.b3-tab-on:hover { background: linear-gradient(160deg, #1e3a5f, #1d4ed8); }
.b3-tab-on .b3-tab-jahre { color: #bfdbfe; }

/* Generation */
.b3-gen-head {
    display: flex; gap: 1.1rem; align-items: center; padding: 1rem 1.2rem; border-radius: 14px;
    background: linear-gradient(120deg, #0f172a, #1e3a5f 55%, #1d4ed8); color: #e2e8f0;
}
.b3-gen-code {
    flex: 0 0 auto; min-width: 92px; padding: .5rem .7rem; border-radius: 12px; text-align: center; font-size: 2rem; font-weight: 800;
    color: #fff; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.35); font-variant-numeric: tabular-nums;
}
.b3-gen-nr { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #93c5fd; }
.b3-gen-head h2 { margin: .1rem 0 .25rem; color: #fff; }
.b3-gen-head p { margin: 0; font-size: .9rem; color: #cbd5e1; max-width: 900px; }
.b3-gen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: .8rem; margin-top: .8rem; }
.b3-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .8rem 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); min-width: 0; }
.b3-box h3 { margin: 0 0 .5rem; font-size: 1rem; color: #1e3a5f; }
.b3-box h3 small { font-weight: 400; color: #64748b; font-size: .8rem; margin-left: .3rem; }
.b3-box-wide { grid-column: 1 / -1; }
.b3-box-m { background: linear-gradient(90deg, #0ea5e9 0 33%, #1e3a8a 33% 66%, #dc2626 66%) top / 100% 5px no-repeat, #fff; padding-top: 1rem; }
.b3-box-warn { background: #fffbeb; border-color: #fde68a; }
.b3-box-warn h3 { color: #92400e; }
.b3-facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0; font-size: .86rem; }
.b3-facts dt { color: #64748b; }
.b3-facts dd { margin: 0; color: #1e293b; overflow-wrap: anywhere; }
.b3-small { font-size: .84rem; color: #475569; line-height: 1.5; margin: .5rem 0 0; }
.b3-dims { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.b3-dims > div { background: #f8fafc; border-radius: 8px; padding: .45rem .6rem; display: flex; flex-direction: column; }
.b3-dim-num { font-size: 1.15rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.b3-dim-lbl { font-size: .74rem; color: #64748b; }
.b3-list { margin: 0; padding-left: 1.1rem; font-size: .87rem; color: #334155; line-height: 1.5; }
.b3-list li + li { margin-top: .2rem; }
.b3-list-plus { list-style: none; padding-left: 0; }
.b3-list-plus li { position: relative; padding-left: 1.3rem; }
.b3-list-plus li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.b3-list-warn { list-style: none; padding-left: 0; }
.b3-list-warn li { position: relative; padding-left: 1.3rem; }
.b3-list-warn li::before { content: "!"; position: absolute; left: .2rem; top: .05rem; width: .9rem; height: .9rem; border-radius: 50%; background: #f59e0b; color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.b3-motors { width: 100%; border-collapse: collapse; font-size: .87rem; }
.b3-motors th { text-align: left; color: #1e3a5f; padding: .4rem .8rem .4rem 0; white-space: nowrap; vertical-align: top; }
.b3-motors td { padding: .4rem .8rem .4rem 0; color: #334155; border-top: 1px solid #f1f5f9; vertical-align: top; }
.b3-motors tr:first-child td { border-top: 0; }
.b3-motor-ps { white-space: nowrap; font-weight: 600; color: #0f172a; font-variant-numeric: tabular-nums; }

/* Abschnitte */
.b3-section { margin-top: 2.2rem; }
.b3-section > h2 { color: #1e3a5f; border-bottom: 3px solid #1d4ed8; padding-bottom: .25rem; }
.b3-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: .8rem; }
.b3-compare-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .8rem 1rem; }
.b3-compare-box h3 { margin: 0 0 .5rem; font-size: .95rem; color: #1e3a5f; }
.b3-cbar-row {
    display: grid; grid-template-columns: 44px 1fr auto; gap: .5rem; align-items: center; width: 100%; padding: .2rem .25rem; margin: 0;
    border: 0; background: none; font: inherit; cursor: pointer; border-radius: 6px; text-align: left;
}
.b3-cbar-row:hover { background: #f1f5f9; }
.b3-cbar-lbl { font-size: .8rem; font-weight: 600; color: #334155; }
.b3-cbar-track { height: 12px; border-radius: 6px; background: #f1f5f9; overflow: hidden; }
.b3-cbar { display: block; height: 100%; border-radius: 6px; background: #93c5fd; }
.b3-cbar-on .b3-cbar { background: #1d4ed8; }
.b3-cbar-on .b3-cbar-lbl { color: #1d4ed8; }
.b3-cbar-val { font-size: .78rem; color: #475569; font-variant-numeric: tabular-nums; white-space: nowrap; }
.b3-table-wrap { overflow-x: auto; }
.b3-m3 { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .87rem; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; }
.b3-m3 thead th { background: #0f172a; color: #fff; text-align: left; padding: .5rem .7rem; font-weight: 600; }
.b3-m3 thead tr { box-shadow: inset 0 -4px 0 0 #dc2626; }
.b3-m3 td { padding: .45rem .7rem; border-top: 1px solid #f1f5f9; color: #334155; }
.b3-m3 tbody tr:nth-child(even) { background: #f8fafc; }
.b3-timeline { max-width: 900px; }

@media (max-width: 640px) {
    .b3-gen-head { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .85rem; }
    .b3-gen-code { font-size: 1.5rem; min-width: 76px; }
    .b3-motors th { display: block; padding-bottom: 0; }
    .b3-motors tr { display: grid; grid-template-columns: auto 1fr; border-top: 1px solid #f1f5f9; padding: .3rem 0; }
    .b3-motors th { grid-column: 1 / -1; }
    .b3-motors td { border-top: 0; padding: .1rem .6rem .1rem 0; }
}
@media (min-width: 641px) { .b3-motors th, .b3-motors .b3-motor-ps { width: 1%; padding-right: 1.4rem; } }
.bmw-badge-x3 { font-size: 1.25rem; font-weight: 800; background: radial-gradient(circle at 32% 28%, #86efac 0%, #15803d 50%, #052e16 100%); }
.bmw-badge-x5 { font-size: 1.25rem; font-weight: 800; background: radial-gradient(circle at 32% 28%, #cbd5e1 0%, #475569 50%, #0f172a 100%); }
.b3-matrix th:not(:first-child), .b3-matrix-cell { text-align: center; white-space: nowrap; }
.b3-matrix-yes { color: #166534; font-weight: 600; }
.b3-matrix-no { color: #94a3b8; }
.b3-matrix-na { color: #64748b; font-style: italic; }

/* ---------- Chili ---------- */
.chili-link-tile { background: linear-gradient(135deg, #fee2e2, #fca5a5); }
.chili-link-tile strong { color: #991b1b; }
.chili-disclaimer { border-left-color: #dc2626; }

/* Farben je Capsicum-Art */
.chili-art-annuum     { --chili-c: #dc2626; }
.chili-art-chinense   { --chili-c: #ea580c; }
.chili-art-frutescens { --chili-c: #ca8a04; }
.chili-art-baccatum   { --chili-c: #16a34a; }
.chili-art-pubescens  { --chili-c: #7c3aed; }
.chili-art-wild       { --chili-c: #64748b; }
.chili-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--chili-c, #94a3b8); flex: 0 0 auto; }

.chili-filter { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.chili-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .3rem .75rem; border-radius: 999px; cursor: pointer;
    border: 1px solid #fecaca; background: #fff; color: #44403c; font-size: .88rem;
}
.chili-chip:hover { background: #fef2f2; }
.chili-chip-active { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.chili-chip-active .chili-dot { box-shadow: 0 0 0 2px #fff; }

.chili-map { background: #aad3df; }
.chili-panel { flex-basis: 340px; }
.chili-panel-hint { border-color: #fca5a5; background: #fff7f5; justify-content: flex-start; max-height: 70vh; overflow-y: auto; }
.chili-hint-block { width: 100%; text-align: left; margin-top: 1rem; font-size: .85rem; color: #57534e; }
.chili-hint-block p { margin: .35rem 0; }
.chili-hint-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #b91c1c; font-weight: 600; margin-bottom: .35rem; }
.chili-hint-art { display: flex; gap: .5rem; align-items: baseline; margin: .3rem 0; }

.chili-card {
    position: relative; flex: 1; align-self: flex-start;
    padding: 1.2rem 1.25rem 1rem; border-radius: 12px; color: #fff;
    background: linear-gradient(160deg, #b91c1c, #450a0a);
    box-shadow: 0 6px 18px rgba(127, 29, 29, .35);
    animation: whisky-in .2s ease-out;
    max-height: 70vh; overflow-y: auto;
}
.chili-card-region { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #fecaca; }
.chili-card-rolle { font-size: .9rem; line-height: 1.45; padding: .7rem .8rem; border-radius: 10px; background: rgba(255,255,255,.12); margin-bottom: 1rem; }
.chili-card-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #fecaca; margin-bottom: .4rem; }
.chili-card-note { font-size: .88rem; color: rgba(255,255,255,.9); margin-bottom: .75rem; }

.chili-sorten { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.chili-sorte { padding: .55rem .7rem; border-radius: 8px; background: rgba(0,0,0,.18); border-left: 4px solid var(--chili-c); transition: opacity .15s; }
.chili-sorte-dim { opacity: .4; }
.chili-sorte-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.chili-sorte-head strong { font-size: .95rem; }
.chili-sorte-art { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; color: #fecaca; white-space: nowrap; }
.chili-shu { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; }
.chili-shu-bar { position: relative; flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(34,197,94,.35), rgba(250,204,21,.35), rgba(239,68,68,.45)); }
.chili-shu-bar span { position: absolute; top: -1px; height: 8px; border-radius: 4px; background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.7); }
.chili-shu-text { font-size: .74rem; color: #fee2e2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chili-sorte-info { font-size: .8rem; color: rgba(255,255,255,.85); margin-top: .3rem; line-height: 1.4; }

/* Pins (siehe js/chili.js) */
.chili-pin { position: relative; width: 34px; height: 46px; cursor: pointer; }
.chili-pin::after {
    content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 14px solid #b91c1c;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.3));
}
.chili-pin-head {
    position: absolute; top: 0; left: 2px; z-index: 1;
    width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
    border: 3px solid #b91c1c; background: #fee2e2; box-shadow: 0 2px 5px rgba(0,0,0,.35);
    transition: transform .12s;
}
.chili-pin-head img { width: 100%; height: 100%; object-fit: cover; }
.chili-pin-ur .chili-pin-head { border-color: #15803d; }
.chili-pin-ur::after { border-top-color: #15803d; }
.chili-pin-count {
    position: absolute; z-index: 2; top: -7px; left: 20px;
    min-width: 18px; padding: 1px 4px; border-radius: 9px;
    background: #1f2937; color: #fff; font: 700 10px/14px system-ui, sans-serif; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.4); white-space: nowrap;
}
.chili-pin:hover .chili-pin-head { transform: scale(1.15); }
.chili-pin-active .chili-pin-head { border-color: #facc15; transform: scale(1.25); }
.chili-pin-active::after { border-top-color: #facc15; }

@media (max-width: 860px) {
    .chili-panel { flex-basis: auto; }
    .chili-card, .chili-panel-hint { max-height: none; }
}

/* ---------- Chili: Schärfeklassen ---------- */
.cs-h2 { margin-top: 2.2rem; }
.cs-scale { display: flex; flex-direction: column; gap: .35rem; margin-top: 1.2rem; max-width: 1000px; }
.cs-row { border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); border-left: 6px solid var(--cs-c); overflow: hidden; }
.cs-row-head {
    width: 100%; display: grid; grid-template-columns: 3.2rem minmax(150px, 1.1fr) 9rem minmax(0, 1.4fr) 2.2rem;
    align-items: center; gap: .8rem; padding: .5rem .9rem .5rem .6rem;
    border: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--cs-c) 14%, #fff), #fff 60%);
    font: inherit; color: #1f2937; text-align: left; cursor: pointer;
}
.cs-row-head:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--cs-c) 24%, #fff), #fff 70%); }
.cs-grad {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.6rem; height: 2.6rem; border-radius: 50%;
    background: var(--cs-c); color: #fff; font-weight: 800; font-size: 1.05rem;
    box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
.cs-main { display: flex; flex-direction: column; }
.cs-label { font-weight: 700; }
.cs-range { font-size: .82rem; color: #57534e; font-variant-numeric: tabular-nums; }
.cs-peppers { font-size: .95rem; letter-spacing: -.15em; white-space: nowrap; }
.cs-beispiel { font-size: .85rem; color: #57534e; }
.cs-count {
    justify-self: end; min-width: 1.8rem; padding: .1rem .45rem; border-radius: 999px;
    background: #f5f5f4; color: #44403c; font-size: .78rem; font-weight: 700; text-align: center;
}
.cs-row-open .cs-count { background: var(--cs-c); color: #fff; }
.cs-detail { padding: .6rem 1rem .9rem 4.6rem; border-top: 1px solid #f1f5f9; animation: whisky-in .2s ease-out; }
.cs-detail-text { margin: 0 0 .6rem; color: #44403c; }
.cs-detail-empty { margin: 0; font-size: .88rem; color: #78716c; font-style: italic; }
.cs-sorten { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: .4rem .9rem; }
.cs-sorten li {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: .55rem;
    align-items: center; padding: .35rem .5rem; border-radius: 6px; background: #fafaf9; border-left: 3px solid var(--chili-c);
}
.cs-sorten img { grid-row: span 2; width: 24px; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.cs-sorte-name { font-size: .9rem; }
.cs-sorte-name small { color: #78716c; }
.cs-sorte-art { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: #57534e; }
.cs-sorte-shu { grid-column: 2 / 4; font-size: .76rem; color: #78716c; font-variant-numeric: tabular-nums; }

/* Vergleich (logarithmisch) */
.cs-compare { max-width: 1000px; margin-top: .8rem; padding: 1rem 1.1rem; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cs-axis { position: relative; height: 1.3rem; margin-left: calc(11rem + .8rem); margin-right: calc(11rem + .8rem); border-bottom: 1px solid #e7e5e4; }
.cs-axis span { position: absolute; transform: translateX(-50%); font-size: .7rem; color: #78716c; white-space: nowrap; }
.cs-cmp-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 11rem; gap: .8rem; align-items: center; padding: .28rem 0; }
.cs-cmp-name { font-size: .88rem; text-align: right; }
.cs-cmp-ref .cs-cmp-name { color: #57534e; font-style: italic; }
.cs-cmp-track {
    position: relative; height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, #dcfce7, #fef9c3 45%, #fee2e2 75%, #f3e8ff);
}
.cs-cmp-bar { position: absolute; top: 0; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #f97316, #b91c1c); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.cs-cmp-ref .cs-cmp-bar { background: #475569; }
.cs-cmp-val { font-size: .78rem; color: #57534e; font-variant-numeric: tabular-nums; }

/* Rekorde */
.cs-records { list-style: none; margin: .8rem 0 0; padding: 0 0 0 1rem; max-width: 760px; border-left: 3px solid #fca5a5; }
.cs-records li { position: relative; display: flex; gap: .9rem; align-items: baseline; padding: .4rem 0 .4rem .4rem; }
.cs-records li::before { content: ""; position: absolute; left: -1.5rem; top: .85rem; width: 12px; height: 12px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.cs-rec-year { font-weight: 800; color: #b91c1c; min-width: 3rem; }
.cs-rec-body small { color: #78716c; }
.cs-rec-shu { display: block; font-size: .85rem; color: #44403c; font-variant-numeric: tabular-nums; }

/* Hintergrund-Kacheln */
.cs-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; margin-top: 2rem; }
.cs-fact { padding: 1rem 1.2rem; border-radius: 10px; background: #fff7f5; border: 1px solid #fecaca; }
.cs-fact h3 { margin: 0 0 .5rem; font-size: 1.05rem; color: #991b1b; }
.cs-fact p { margin: .4rem 0; font-size: .9rem; line-height: 1.5; color: #44403c; }

@media (max-width: 860px) {
    .cs-row-head { grid-template-columns: 2.8rem minmax(0, 1fr) 2rem; gap: .6rem; }
    .cs-grad { width: 2.3rem; height: 2.3rem; font-size: .95rem; }
    .cs-peppers, .cs-beispiel { display: none; }
    .cs-detail { padding-left: 1rem; }
    .cs-axis { margin-left: 0; margin-right: 0; }
    .cs-cmp-row { grid-template-columns: minmax(0, 1fr); gap: .15rem; padding: .4rem 0; }
    .cs-cmp-name { text-align: left; }
}

/* ---------- Chili: A–Z ---------- */
.az-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.az-search { flex: 1 1 260px; max-width: 460px; padding: .5rem .8rem; border: 1px solid #d6d3d1; border-radius: 8px; font: inherit; }
.az-select { padding: .5rem .7rem; border: 1px solid #d6d3d1; border-radius: 8px; font: inherit; background: #fff; }
.az-letters {
    position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .2rem;
    margin-top: .9rem; padding: .45rem .3rem; background: rgba(255,255,255,.95); backdrop-filter: blur(4px);
    border-bottom: 1px solid #fee2e2;
}
.az-letter {
    min-width: 1.9rem; padding: .25rem .35rem; border: 0; border-radius: 6px; cursor: pointer;
    background: #fef2f2; color: #991b1b; font-weight: 700; font-size: .85rem;
}
.az-letter:hover:not(:disabled) { background: #b91c1c; color: #fff; }
.az-letter:disabled { background: none; color: #d6d3d1; cursor: default; }
.az-count { font-size: .85rem; color: #78716c; margin: .6rem 0 0; }
.az-empty { color: #78716c; font-style: italic; }
.az-group { scroll-margin-top: 3.5rem; }
.az-group-letter { margin: 1.4rem 0 .5rem; font-size: 1.6rem; color: #b91c1c; border-bottom: 2px solid #fecaca; padding-bottom: .15rem; }
.az-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .7rem; }
.az-card {
    position: relative; display: flex; flex-direction: column; gap: .3rem; overflow: hidden;
    padding: .9rem .9rem .7rem; border: 1px solid #f5f5f4; border-radius: 10px; background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.1); font: inherit; color: #1f2937; text-align: left; cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.az-card:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,.14); }
.az-card-top { position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--az-c); }
.az-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.az-card-head strong { font-size: 1.02rem; }
.az-grad {
    flex: 0 0 auto; min-width: 1.8rem; padding: .1rem .4rem; border-radius: 999px;
    color: #fff; font-size: .75rem; font-weight: 800; text-align: center;
}
.az-card-syn { font-size: .78rem; color: #78716c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.az-card-meta { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: #44403c; flex-wrap: wrap; }
.az-card-meta img { width: 20px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.az-card-art { display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; font-size: .76rem; color: #57534e; }
.az-card-shu { font-size: .78rem; color: #78716c; font-variant-numeric: tabular-nums; }

/* Detail-Dialog */
.az-overlay {
    position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(15, 23, 42, .55); animation: az-fade .15s ease-out;
}
@keyframes az-fade { from { opacity: 0; } to { opacity: 1; } }
.az-dialog {
    width: min(760px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column;
    border-radius: 14px; background: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.35); overflow: hidden;
}
.az-dlg-head {
    position: relative; padding: 1.1rem 1.3rem; color: #fff;
    background: linear-gradient(135deg, var(--az-c), color-mix(in srgb, var(--az-c) 45%, #000));
}
.az-dlg-close { position: absolute; top: .4rem; right: .6rem; border: 0; background: none; color: rgba(255,255,255,.85); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.az-dlg-close:hover { color: #fff; }
.az-dlg-title { display: flex; gap: .9rem; align-items: center; padding-right: 1.5rem; }
.az-dlg-title img { width: 56px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.az-dlg-title h2 { margin: .1rem 0; font-size: 1.5rem; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.az-dlg-land { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.az-dlg-syn { font-size: .85rem; opacity: .9; }
.az-dlg-body { padding: 1.1rem 1.3rem; overflow-y: auto; }
.az-heat { display: flex; align-items: center; gap: .9rem; padding: .8rem .9rem; border-radius: 10px; background: #fafaf9; border: 1px solid #f5f5f4; }
.az-heat-grad { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.1rem; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.az-heat-main { flex: 1; min-width: 0; }
.az-heat-label { font-weight: 700; margin-bottom: .35rem; }
.az-heat-bar { height: 8px; }
.az-heat-bar span { height: 10px; background: #b91c1c; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.az-heat-shu { font-size: .82rem; color: #57534e; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.az-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1.1rem; margin: 1rem 0; }
.az-facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #b91c1c; font-weight: 600; margin-bottom: .15rem; }
.az-facts dd { margin: 0; font-size: .92rem; line-height: 1.45; color: #292524; }
.az-story { padding: .8rem 1rem; border-radius: 10px; background: #fff7ed; border-left: 4px solid var(--az-c); }
.az-story-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: #9a3412; font-weight: 600; }
.az-story p { margin: .3rem 0 0; font-size: .93rem; line-height: 1.55; color: #292524; }
.az-art-info { display: flex; gap: .5rem; align-items: baseline; margin-top: .9rem; font-size: .84rem; color: #57534e; }
.az-dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem .9rem; border-top: 1px solid #f5f5f4; background: #fafaf9; }
.az-nav { flex: 0 1 34%; border: 0; background: none; color: #b91c1c; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .3rem .4rem; border-radius: 6px; }
.az-nav:last-child { text-align: right; }
.az-nav:hover:not(:disabled) { background: #fee2e2; }
.az-nav:disabled { color: #d6d3d1; cursor: default; }
.az-links { font-size: .82rem; color: #a8a29e; white-space: nowrap; }
.az-links a { color: #57534e; }

@media (max-width: 640px) {
    .az-facts { grid-template-columns: minmax(0, 1fr); }
    .az-overlay { padding: 0; align-items: stretch; }
    .az-dialog { max-height: 100vh; border-radius: 0; }
    .az-links { display: none; }
    .az-nav { flex-basis: 48%; }
}

/* ---------- Chili: Rezepte ---------- */
.rz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: .8rem; margin-top: .4rem; }
.rz-card {
    display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1rem;
    border: 1px solid #fee2e2; border-radius: 12px; background: linear-gradient(160deg, #fff, #fff7f5);
    box-shadow: 0 1px 3px rgba(0,0,0,.08); font: inherit; color: #1f2937; text-align: left; cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.rz-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(127,29,29,.15); }
.rz-card-icon { font-size: 2rem; line-height: 1; padding-top: .15rem; }
.rz-card-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.rz-card-kat { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #b91c1c; font-weight: 600; }
.rz-card-body strong { font-size: 1.05rem; }
.rz-card-meta { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: #57534e; }
.rz-card-meta img { width: 20px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.rz-card-foot { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; color: #57534e; margin-top: .15rem; }

.rz-dialog { width: min(900px, 100%); }
.rz-dlg-head { --az-c: #b91c1c; }
.rz-desc { margin: 0 0 .9rem; color: #44403c; line-height: 1.5; }
.rz-facts { display: flex; flex-wrap: wrap; gap: .5rem; }
.rz-facts > div { display: flex; flex-direction: column; padding: .45rem .75rem; border-radius: 8px; background: #fafaf9; border: 1px solid #f5f5f4; }
.rz-facts span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #78716c; }
.rz-facts strong { font-size: .9rem; }
.rz-chilis { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .8rem; font-size: .85rem; color: #57534e; }
.rz-chili-link { padding: .2rem .6rem; border-radius: 999px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; text-decoration: none; font-size: .82rem; }
.rz-chili-link:hover { background: #b91c1c; color: #fff; }
.rz-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.4rem; margin-top: 1.1rem; }
.rz-cols h3 { margin: 0 0 .5rem; font-size: 1.05rem; color: #991b1b; }
.rz-sec-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.rz-sec-head h3 { margin: 0; }
.rz-portionen { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: #44403c; }
.rz-portionen button {
    width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid #fecaca; background: #fff;
    color: #b91c1c; font-size: 1.05rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.rz-portionen button:hover:not(:disabled) { background: #b91c1c; color: #fff; }
.rz-portionen button:disabled { color: #d6d3d1; cursor: default; }
.rz-zutaten ul { list-style: none; margin: 0; padding: 0; }
.rz-zutaten li { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .5rem; padding: .35rem .2rem; border-bottom: 1px dashed #f5f5f4; font-size: .9rem; cursor: pointer; }
.rz-menge { font-weight: 700; color: #292524; text-align: right; font-variant-numeric: tabular-nums; }
.rz-schritte ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.rz-schritte li { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; line-height: 1.5; cursor: pointer; }
.rz-nr {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #b91c1c; color: #fff; font-size: .82rem; font-weight: 700;
}
.rz-done { opacity: .45; text-decoration: line-through; }
.rz-done .rz-nr { background: #16a34a; }
.rz-hinweis { font-size: .76rem; color: #a8a29e; margin: .6rem 0 0; }
.rz-tipp { margin-top: 1.1rem; --az-c: #f59e0b; }

@media (max-width: 720px) {
    .rz-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Verwaltung: kopiertes Abrechnungsjahr / Markierung kopierter Werte ---------- */
.kv-detail input.kv-kopiert,
.kv-detail select.kv-kopiert,
.kv-detail textarea.kv-kopiert { background: #fef3c7; border-color: #f59e0b; box-shadow: inset 3px 0 0 #f59e0b; }
.kv-feld { display: flex; align-items: center; gap: .4rem; font-weight: 400; margin-bottom: 1rem; }
.kv-feld input { flex: 1; min-width: 0; margin-bottom: 0; }
.kv-kopiert-marker {
    display: inline-flex; align-items: center; margin-left: .35rem; padding: .12rem .45rem;
    font-size: .72rem; font-weight: 600; line-height: 1.3; white-space: nowrap; cursor: pointer;
    color: #92400e; background: #fde68a; border: 1px solid #f59e0b; border-radius: 999px;
}
.kv-feld .kv-kopiert-marker { margin-left: 0; }
.kv-memo .kv-kopiert-marker { align-self: flex-start; margin-left: 0; }
.kv-kopiert-marker:hover { background: #bbf7d0; border-color: #16a34a; color: #166534; }
.kv-kopiert-zaehler {
    display: inline-block; min-width: 1.2rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; line-height: 1.2rem; text-align: center; color: #92400e; background: #fde68a;
}
.kv-kopiert-hinweis {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem;
    margin: 0 0 1rem; padding: .6rem .8rem; font-size: .88rem; color: #78350f;
    background: #fffbeb; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: 8px;
}
.kv-kopie-box { margin-top: 1rem; border: 1px solid #a7f3d0; background: #f0fdf4; }
.kv-kopie-box h3 { grid-column: 1 / -1; margin: 0; }
.kv-kopie-box .kv-hint, .kv-kopie-box .admin-actions { grid-column: 1 / -1; margin-top: 0; }

/* KFZ-Kosten: Strompreis-Änderungen „gültig ab“ in der Fahrzeugmaske */
.kfz-preise { display: flex; flex-direction: column; gap: .5rem; }
.kfz-preise-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .9rem; font-weight: 600; color: #334155; }
.kfz-preise .btn-small { padding: .3rem .8rem; font-size: .85rem; }
.kfz-preis-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; }
.kfz-preis-del { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: .45rem .6rem; cursor: pointer; line-height: 1; }
.kfz-preis-del:hover { background: #fee2e2; border-color: #fca5a5; }
@media (max-width: 600px) {
    .kfz-preis-row { grid-template-columns: 1fr 1fr; }
    .kfz-preis-del { grid-column: span 2; }
}


/* ---------- Thermen & Spaßbäder (Pins und Kachel je Art, Anmerkung des Admins) ---------- */
.wth-therme { --wth-c: #f97316; --wth-c2: #b91c1c; }
.wth-spassbad { --wth-c: #38bdf8; --wth-c2: #1d4ed8; }
.wth-beides { --wth-c: #a78bfa; --wth-c2: #6d28d9; }
.wde-pin.wth-pin { background: linear-gradient(135deg, var(--wth-c), var(--wth-c2)); }
.wde-pin.wth-pin.wde-pin-active { background: linear-gradient(135deg, #facc15, #d97706); }
.wth-types { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.wth-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--wth-c, #64748b), var(--wth-c2, #334155)); }
.wth-panel-hint { border-color: #bae6fd; background: #f0f9ff; }
.wth-panel-hint .wde-list li + li { border-top-color: #e0f2fe; }
.wth-panel-hint .wde-list button { color: #075985; }
.wth-panel-hint .wde-list button:hover { background: #e0f2fe; }
.whisky-card.wth-card-therme { background: linear-gradient(160deg, #c2410c, #7f1d1d); }
.whisky-card.wth-card-spassbad { background: linear-gradient(160deg, #0284c7, #1e3a8a); }
.whisky-card.wth-card-beides { background: linear-gradient(160deg, #7c3aed, #3b0764); }
.wth-badge { background: rgba(255,255,255,.9); color: #1e293b; }
.wth-note { margin: 0 0 .8rem; padding: .7rem .8rem; border-radius: 9px; background: rgba(255,255,255,.95); color: #1e293b; }
.wth-note-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: #0369a1; margin-bottom: .25rem; }
.wth-note-text { font-size: .92rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.wth-note-meta { margin-top: .35rem; font-size: .72rem; color: #64748b; }
.wth-edit { margin: 0 0 .8rem; display: flex; flex-direction: column; gap: .35rem; }
.wth-edit label { font-size: .75rem; color: rgba(255,255,255,.85); }
.wth-edit textarea { width: 100%; box-sizing: border-box; padding: .5rem .6rem; border-radius: 8px; border: 0; font: inherit; font-size: .9rem; resize: vertical; }
.wth-edit-buttons { display: flex; gap: .5rem; }
.wth-edit-hint { margin: 0; font-size: .72rem; color: rgba(255,255,255,.7); }
.wth-btn { padding: .4rem .8rem; border-radius: 7px; border: 0; background: #fff; color: #1e293b; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.wth-btn:hover { background: #f1f5f9; }
.wth-btn:disabled { opacity: .6; cursor: default; }
.wth-btn-ghost { background: rgba(255,255,255,.15); color: #fff; }
.wth-btn-ghost:hover { background: rgba(255,255,255,.28); }
.wth-btn-edit { margin-bottom: .8rem; background: rgba(255,255,255,.15); color: #fff; font-weight: 400; }
.wth-btn-edit:hover { background: rgba(255,255,255,.28); }
.wth-error { margin: 0 0 .8rem; padding: .4rem .6rem; border-radius: 7px; background: #fee2e2; color: #991b1b; font-size: .82rem; }

/* ===== Genealogie (Seite /genealogie) ===== */
.gen-empty { max-width: 640px; background: #fff; border-radius: 16px; padding: 1.6rem 1.8rem; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); }
.gen-empty h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.gen-empty p { margin: 0 0 1.1rem; color: #475569; line-height: 1.5; }
.gen-empty-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.gen-stats { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .25rem 0 1rem; }
.gen-stat { padding: .35rem .8rem; border-radius: 999px; background: #fff; color: #475569; font-size: .9rem; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.gen-stat strong { color: #0f172a; }
.gen-chip { padding: .35rem .75rem; border: 1px solid #cbd5e1; border-radius: 999px; background: #f8fafc; color: #334155; font: inherit; font-size: .88rem; cursor: pointer; }
.gen-chip span { margin-left: .3rem; color: #94a3b8; font-size: .8rem; }
.gen-chip:hover { background: #eff6ff; border-color: #93c5fd; }
.gen-chip-active, .gen-chip-active:hover { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.gen-chip-active span { color: #dbeafe; }

.gen-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.gen-toolbar-spacer { flex: 1 1 auto; }
.gen-search { display: flex; align-items: center; gap: .5rem; flex: 1 1 260px; max-width: 420px; padding: .5rem .9rem; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; }
.gen-search:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.gen-search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; background: transparent; }
.gen-select { padding: .5rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font: inherit; max-width: 100%; }
.gen-ok { margin: 0 0 1rem; padding: .6rem .9rem; border-radius: 10px; background: #dcfce7; color: #166534; }
.gen-btn-small { padding: .35rem .7rem; font-size: .88rem; }
.gen-muted { color: #64748b; }

.gen-layout { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.gen-list { position: sticky; top: 1rem; background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); overflow: hidden; }
.gen-list-head { padding: .6rem .9rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; border-bottom: 1px solid #e2e8f0; }
.gen-list-body { max-height: calc(100vh - 8rem); overflow-y: auto; padding: .3rem; }
.gen-list-more { padding: .4rem .6rem .7rem; margin: 0; }

.gen-row { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .42rem .6rem; border: 0; border-radius: 8px; background: transparent; color: #0f172a; font: inherit; font-size: .93rem; text-align: left; cursor: pointer; }
.gen-row:hover { background: #f1f5f9; }
.gen-row-active, .gen-row-active:hover { background: #dbeafe; }
.gen-row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-row-life { flex: 0 0 auto; color: #64748b; font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gen-sex { flex: 0 0 auto; width: .6rem; height: .6rem; border-radius: 50%; background: #94a3b8; }
.gen-sex-m { background: #3b82f6; }
.gen-sex-f { background: #ec4899; }

.gen-detail { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.gen-panel { background: #fff; border-radius: 14px; padding: 1rem 1.2rem 1.1rem; box-shadow: 0 2px 10px rgba(15, 23, 42, .08); min-width: 0; }
.gen-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.gen-panel-head .gen-h3 { margin: 0; }
.gen-h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
.gen-h3 { margin: 1rem 0 .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; }
.gen-panel > .gen-h3:first-child { margin-top: 0; }

.gen-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; padding: 1.1rem 1.3rem; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #64748b, #334155); box-shadow: 0 2px 10px rgba(15, 23, 42, .15); }
.gen-head-m { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.gen-head-f { background: linear-gradient(135deg, #db2777, #9d174d); }
.gen-head-main { min-width: 0; }
.gen-head h2 { margin: 0; font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
.gen-head-life { margin: .35rem 0 0; color: rgba(255, 255, 255, .92); white-space: pre-wrap; }
.gen-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.gen-head-actions .btn { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .45); }
.gen-head-actions .btn:hover { background: rgba(255, 255, 255, .3); }
.gen-head-actions .btn-danger { background: rgba(127, 29, 29, .55); }
.gen-head-actions .btn-danger:hover { background: #b91c1c; }
.gen-confirm { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-weight: 600; }
.gen-back { display: inline-block; margin: 0 0 .5rem; padding: .2rem .6rem; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; background: rgba(255, 255, 255, .15); color: #fff; font: inherit; font-size: .82rem; cursor: pointer; }
.gen-back:hover { background: rgba(255, 255, 255, .3); }

.gen-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem 1.4rem; margin: 0; }
.gen-fact dt { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; }
.gen-fact dd { margin: .15rem 0 0; color: #0f172a; overflow-wrap: anywhere; }
.gen-note { margin: 0; white-space: pre-wrap; color: #334155; line-height: 1.5; overflow-wrap: anywhere; }
.gen-note-small { font-size: .88rem; color: #64748b; }

.gen-cards { display: flex; flex-wrap: wrap; gap: .6rem; }
.gen-card { display: flex; flex-direction: column; gap: .1rem; min-width: 170px; max-width: 260px; padding: .5rem .75rem; border: 1px solid #e2e8f0; border-left: 4px solid #94a3b8; border-radius: 10px; background: #f8fafc; color: #0f172a; font: inherit; text-align: left; }
button.gen-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
button.gen-card:hover { box-shadow: 0 3px 10px rgba(15, 23, 42, .15); transform: translateY(-1px); }
.gen-card-m { border-left-color: #3b82f6; background: #eff6ff; }
.gen-card-f { border-left-color: #ec4899; background: #fdf2f8; }
.gen-card-empty { border-style: dashed; border-left-style: dashed; color: #94a3b8; background: #fff; }
.gen-card-active { box-shadow: 0 0 0 2px #0f172a; }
.gen-card-compact { min-width: 140px; padding: .35rem .6rem; }
.gen-card-role { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #64748b; }
.gen-card-name { font-weight: 600; overflow-wrap: anywhere; }
.gen-card-compact .gen-card-name { font-size: .9rem; }
.gen-card-life { font-size: .8rem; color: #64748b; font-variant-numeric: tabular-nums; }

.gen-couple { padding: .8rem 0; border-top: 1px solid #e2e8f0; }
.gen-couple:first-of-type { border-top: 0; padding-top: 0; }
.gen-couple-head { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-start; }
.gen-couple-info { flex: 1 1 220px; display: flex; flex-direction: column; gap: .25rem; color: #334155; font-size: .93rem; }
.gen-couple-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; }
.gen-children { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0 0 1rem; padding-left: 1rem; border-left: 2px solid #e2e8f0; }

.gen-tree-scroll { overflow-x: auto; padding-bottom: .3rem; }
.gen-tree { display: grid; grid-template-columns: repeat(4, minmax(165px, 1fr)); grid-template-rows: repeat(8, minmax(3.3rem, auto)); gap: .35rem .9rem; min-width: 720px; }
.gen-tree-cell { display: flex; align-items: center; min-width: 0; }
.gen-tree-cell .gen-card { width: 100%; min-width: 0; max-width: none; }

.gen-desc { display: flex; flex-direction: column; }
.gen-desc-row { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .35rem .5rem; border: 0; border-radius: 8px; background: transparent; color: #0f172a; font: inherit; font-size: .93rem; text-align: left; cursor: pointer; }
.gen-desc-row:hover { background: #f1f5f9; }
.gen-desc-gen { flex: 0 0 4.2rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; }

/* Dialoge */
.gen-form .gen-full { grid-column: 1 / -1; }
.gen-form textarea { padding: .55rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; resize: vertical; min-width: 0; }
.gen-form textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.adm-form label.gen-check, .gen-check { display: flex; flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; font-size: .92rem; color: #334155; }
.adm-form label.gen-check input, .gen-check input { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; margin-top: .15rem; padding: 0; }
.gen-warn { color: #b91c1c; font-weight: 600; }
.gen-pick { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; font-size: .93rem; }
.gen-pick-label { flex: 0 0 5.2rem; font-size: .85rem; font-weight: 600; color: #334155; }
.gen-pick-val { color: #0f172a; }
.gen-picker { display: flex; flex-direction: column; gap: .4rem; padding: .6rem; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; }
.gen-picker-list { max-height: 210px; overflow-y: auto; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; }
.gen-modes { display: flex; flex-direction: column; gap: .7rem; margin-top: 1rem; }
.gen-file { display: block; margin-top: .4rem; max-width: 100%; font: inherit; }
@media (min-width: 861px) {
    .adm-modal.gen-modal { width: min(700px, calc(100vw - 2rem)); }
}
/* Dialog "Stammbaum als PDF": breiter, Felder dürfen nie über den Rand ragen */
.gen-modal-wide .adm-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gen-modal-wide .adm-form input, .gen-modal-wide .adm-form select { width: 100%; box-sizing: border-box; }
@media (min-width: 861px) {
    .adm-modal.gen-modal.gen-modal-wide { width: min(860px, calc(100vw - 2rem)); }
}
@media (max-width: 600px) {
    .gen-modal-wide .adm-form { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .gen-layout { grid-template-columns: 1fr; }
    .gen-list { position: static; }
    .gen-list-body { max-height: 260px; }
    .gen-head h2 { font-size: 1.3rem; }
    .gen-children { margin-left: 0; }
    .gen-card { min-width: 140px; }
}
@media (prefers-reduced-motion: reduce) { button.gen-card { transition: none; } button.gen-card:hover { transform: none; } }

/* ---------- "Zurück"-Knopf oben links: blauer Kreis mit rotem Pfeil, 20 px (führt eine Menü-Ebene höher) ---------- */
.back-btn {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 0 .6rem;
    border-radius: 50%;
    line-height: 0;
    vertical-align: top;
    transition: transform .15s, filter .15s;
}
.back-btn svg { display: block; }
.back-btn:hover { transform: scale(1.12); filter: brightness(1.15); }
.back-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
@media print { .back-btn { display: none; } }
