/* ==========================================================================
   Design Tokens & Base Setup
   ========================================================================== */
:root {
    --bg-color: #f8fafc;
    --bg-outer: #cbd5e1;
    --card-bg: #ffffff;
    --surface-subtle: #f8fafc;
    --primary-color: #72b2dc;
    --primary-hover: #5fa3cf;
    --primary-dark: #1a5f8c;
    --primary-tint: #e0f2fe;
    --text-color: #1e293b;
    --text-strong: #000000;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 24px;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #1e293b;
    --bg-outer: #020617;
    --card-bg: #1e293b;
    --surface-subtle: #0f172a;
    --primary-color: #72b2dc;
    --primary-hover: #5fa3cf;
    --primary-dark: #7ec8e3;
    --primary-tint: #1e3a4f;
    --text-color: #e2e8f0;
    --text-strong: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-outer);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    padding: 0;
}

/* ==========================================================================
   App Container & Base Page Structure
   ========================================================================== */
.app-container {
    background-color: var(--card-bg);
    padding: calc(env(safe-area-inset-top, 20px) + 15px) 20px calc(env(safe-area-inset-bottom, 0px) + 85px) 20px;
    box-shadow: var(--shadow);
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100dvh;
    border-radius: 0;
}

@media (min-width: 480px) {
    body {
        padding: 20px;
    }
    .app-container {
        width: 100%;
        max-width: 380px;
        height: 640px;
        border-radius: var(--border-radius);
        padding: 30px 20px 90px 20px;
    }
}

/* ==========================================================================
   Header Design & Dynamic Status Indicator
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
    padding: 0 4px;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.75px;
}

.title-accent {
    color: var(--primary-color);
    font-weight: 500;
}

.header-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #64748b; /* Neutral fallback before check */
    transition: background-color 0.3s ease;
}

/* Dynamic status classes with clean box-shadow pulse loops */
.status-dot.online {
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

.status-dot.offline {
    background-color: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.app-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
    flex: 1;
    overflow-y: auto;
}

/* ==========================================================================
   Buttons & Form-Inputs
   ========================================================================== */
.track-btn {
    width: 100%;
    max-width: 280px;
    padding: 14px 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(114, 178, 220, 0.15);
    margin-bottom: 20px;
    flex-shrink: 0;
}

.track-btn:hover {
    background-color: var(--primary-hover);
}

.settings-input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-subtle);
    color: var(--text-color);
    transition: var(--transition);
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--card-bg);
}

/* ==========================================================================
   Status Indicators & Info-Cards
   ========================================================================== */
.status-container {
    min-height: 24px;
    margin-bottom: 25px;
}

#status {
    font-size: 0.9rem;
    font-weight: 500;
}

.status-ready { color: #0284c7; }
.status-preview { color: #0284c7; }
.status-loading { color: #d97706; animation: pulse 1.5s infinite; }
.status-success { color: #16a34a; }
.status-error { color: #dc2626; }

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.response-card, .settings-card {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--card-bg);
}

.card-header {
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-strong);
}

#res-time-span {
    color: var(--primary-hover);
    font-weight: 600;
}

.flex-rows { display: flex; flex-direction: column; }
.row-split { display: flex; justify-content: space-between; width: 100%; }
.row-full { width: 100%; }
.cell { padding: 14px 16px; display: flex; flex-direction: column; }
.address-cell { flex: 1; min-width: 0; }
.elevation-cell { flex-shrink: 0; }
#res-elevation { font-size: 0.85rem; font-weight: 400; line-height: 1.4; color: var(--text-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.text-right { align-items: flex-end; text-align: right; }

.label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.value { font-size: 0.95rem; font-weight: 600; color: var(--text-strong); }
.address-text { font-size: 0.85rem; font-weight: 400; line-height: 1.4; }

.address-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-color);
}

.address-container span {
    white-space: normal;
    word-wrap: break-word;
}

.address-container svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke: var(--text-muted);
}

.log-card-address.address-container svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.log-card-elevation {
    color: var(--text-muted);
}

.temp-display-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.embedded-weather-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   History Log Card List
   ========================================================================== */
.history-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 20px;
}

.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 4px; }

.log-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    flex-shrink: 0;
}

.log-card:hover {
    border-color: var(--primary-color);
}

.log-card.expanded {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(114, 178, 220, 0.08);
}

.log-card-clickable-area {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
}

.log-card-id { color: var(--text-color); font-weight: 700; }

.log-card-accuracy-badge { 
    padding: 2px 7px; 
    border-radius: 6px; 
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.log-accuracy-icon {
    width: 12px;
    height: 12px;
}

.log-card-body { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.log-card-address { font-size: 0.85rem; line-height: 1.4; color: var(--text-color); flex-grow: 1; word-break: break-word; }

.log-card-temp {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-card-action-tray {
    max-height: 0;
    opacity: 0;
    background-color: var(--surface-subtle);
    border-top: 1px solid transparent;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s linear, 
                padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.log-card.expanded .log-card-action-tray {
    max-height: 60px;
    opacity: 1;
    padding: 10px 14px;
    border-top-color: var(--border-color);
}

.tray-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    background: none;
    transition: var(--transition);
}

.btn-action-maps {
    color: var(--primary-dark);
    background-color: var(--primary-tint);
    text-decoration: none;
}
.btn-action-maps:hover {
    background-color: #bae6fd;
}
.btn-action-maps .action-icon {
    stroke: var(--primary-dark);
}

.btn-action-share {
    color: #047857;
    background-color: #d1fae5;
}
.btn-action-share:hover {
    background-color: #a7f3d0;
}
.btn-action-share .action-icon {
    stroke: #047857;
}

.btn-action-delete {
    color: #dc2626;
    background-color: #fee2e2;
}
.btn-action-delete:hover {
    background-color: #fecaca;
}
.btn-action-delete .action-icon {
    stroke: #dc2626;
}

.action-icon {
    width: 14px;
    height: 14px;
}

.card-leave-animate {
    animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-105%);
        opacity: 0;
        margin-bottom: -70px;
    }
}

.temp-blue { color: #1d4ed8; background-color: #dbeafe; }
.temp-blue .embedded-weather-icon { stroke: #1d4ed8; }
.temp-lightblue { color: #1a5f8c; background-color: #e0f2fe; }
.temp-lightblue .embedded-weather-icon { stroke: #1a5f8c; }
.temp-orange { color: #b45309; background-color: #fef3c7; }
.temp-orange .embedded-weather-icon { stroke: #b45309; }
.temp-red { color: #b91c1c; background-color: #fee2e2; }
.temp-red .embedded-weather-icon { stroke: #b91c1c; }
.temp-none { color: var(--text-muted); background-color: #f1f5f9; }
.temp-none .embedded-weather-icon { stroke: var(--text-muted); }

/* ==========================================================================
   UV Index Display (Locate + History)
   ========================================================================== */
.uv-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-muted);
    background-color: #f1f5f9;
}

.uv-low { color: #16a34a; background-color: #d1fae5; }
.uv-medium { color: #d97706; background-color: #fef9c3; }
.uv-high { color: #b45309; background-color: #fef3c7; }
.uv-very-high { color: #b91c1c; background-color: #fee2e2; }

/* ==========================================================================
   Settings Page Configuration
   ========================================================================== */
.settings-card { padding: 20px 16px; }
.settings-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; color: var(--primary-dark); }
.form-group { width: 100%; margin-bottom: 20px; display: flex; flex-direction: column; }
.help-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.settings-status { font-size: 0.85rem; text-align: center; font-weight: 500; min-height: 18px; }

/* ==========================================================================
   Dark Mode Toggle Switch (Settings Page)
   ========================================================================== */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 26px;
    background-color: var(--border-color);
    border: none;
    border-radius: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.toggle-switch[aria-checked="true"] {
    background-color: var(--primary-color);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.toggle-switch[aria-checked="true"] .toggle-knob {
    transform: translateX(18px);
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom, 5px);
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    background-color: var(--surface-subtle);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

@media (min-width: 480px) {
    .bottom-nav {
        border-bottom-left-radius: var(--border-radius);
        border-bottom-right-radius: var(--border-radius);
        padding-bottom: 5px;
        height: 70px;
    }
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    width: 33.33%;
    height: 100%;
    transition: var(--transition);
}

.nav-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
    transition: var(--transition);
}

.nav-item.active { color: var(--primary-dark); }
.nav-item.active .nav-icon { transform: translateY(-2px); stroke: var(--primary-dark); }
.nav-label { font-size: 0.75rem; font-weight: 500; }

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Locate Page: 2-Step Action Group
   ========================================================================== */
.locate-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    margin-bottom: 14px;
}

.locate-action-group .track-btn {
    margin-bottom: 0;
}

.track-btn--save {
    background-color: var(--card-bg);
    color: var(--primary-dark);
    border: 1.5px solid var(--primary-color);
    box-shadow: none;
}

.track-btn--save:hover {
    background-color: var(--primary-tint);
}

/* ==========================================================================
   Preview Badge (Info-Hinweis Vorschau-Modus)
   ========================================================================== */
.preview-badge {
    width: 100%;
    max-width: 280px;
    background-color: #fef9c3;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.1px;
    margin-bottom: 14px;
    animation: fadeIn 0.2s ease-out;
}

/* ==========================================================================
   Navigation History Badge additions
   ========================================================================== */
.nav-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--surface-subtle);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 10;
    animation: badgePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Input with Toggle Icon (User ID Masking)
   ========================================================================== */
.input-with-icon {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Make space on the right of the input so text doesn't slide under the icon */
.input-with-icon .settings-input {
    padding-right: 44px;
}

.toggle-password-trigger {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-password-trigger:hover {
    color: var(--primary-color);
    background-color: var(--surface-subtle);
}

.eye-icon {
    width: 20px;
    height: 20px;
    pointer-events: none; /* Prevents click issues inside SVG */
}

/* ==========================================================================
   Status Toast Notification
   ========================================================================== */
.status-toast {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status-toast--online {
    background-color: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.status-toast--offline {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}


/* ==========================================================================
   History View Toggle Bar
   ========================================================================== */
.history-view-toggle {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.view-toggle-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.view-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.view-toggle-btn--active {
    background-color: var(--primary-tint);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.view-toggle-btn--active svg {
    stroke: var(--primary-dark);
}

/* ==========================================================================
   History Map Container
   ========================================================================== */
.history-map {
    width: 100%;
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    min-height: 300px;
}

/* Leaflet popup customisation */
.map-popup {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.map-popup-index {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.map-popup-address {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.3;
}

.map-popup-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.map-popup-share {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #047857;
    background-color: #d1fae5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: inherit;
}

.map-popup-share:hover {
    background-color: #a7f3d0;
}

.map-popup-share svg {
    width: 12px;
    height: 12px;
    stroke: #047857;
    flex-shrink: 0;
}

/* ==========================================================================
   Locate Page Map
   ========================================================================== */
.locate-map {
    width: 100%;
    height: 180px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Leaflet Popup – Dark Mode Override
   ========================================================================== */
[data-theme="dark"] .leaflet-popup-content-wrapper,
[data-theme="dark"] .leaflet-popup-tip {
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .leaflet-popup-close-button {
    color: var(--text-muted);
}

[data-theme="dark"] .leaflet-popup-close-button:hover {
    color: var(--text-color);
}

/* ==========================================================================
   Pull-to-Refresh Indicator
   ========================================================================== */
#ptr-indicator {
    width: 100%;
    height: 0;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: height 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
}

#ptr-indicator svg {
    width: 22px;
    height: 22px;
    stroke: var(--primary-color);
    transition: transform 0.1s linear;
}

#ptr-indicator.ptr-spinning svg {
    animation: ptr-spin 0.6s linear infinite;
}

@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Skeleton Loader (History)
   ========================================================================== */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.skel {
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--border-color) 25%,
        var(--surface-subtle) 50%,
        var(--border-color) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-card {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.skeleton-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.skel-id           { width: 48px;  height: 12px; }
.skel-badge        { width: 52px;  height: 20px; border-radius: 6px; }
.skel-address-line { width: 75%;   height: 12px; }
.skel-address-short{ width: 45%;   height: 12px; }
.skel-temp         {
    width: 56px;
    height: 28px;
    border-radius: 6px;
    position: absolute;
    right: 0;
    top: 0;
}

/* ==========================================================================
   History Search / Filter Bar
   ========================================================================== */
.history-search-bar {
    width: 100%;
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* Suchfeld ausblenden wenn Map-View aktiv (history-map nicht hidden) */
#history-map:not(.hidden) ~ * .history-search-bar,
#page-history:has(#history-map:not(.hidden)) .history-search-bar {
    display: none;
}

.history-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.history-search-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.history-search-input {
    width: 100%;
    padding: 9px 36px 9px 34px;
    font-size: 0.88rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-subtle);
    color: var(--text-color);
    transition: var(--transition);
}

.history-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--card-bg);
}

/* Nativer ×-Button vom type=search ausblenden */
.history-search-input::-webkit-search-cancel-button { display: none; }

.history-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.history-search-clear:hover {
    color: var(--text-color);
    background-color: var(--surface-subtle);
}

.history-search-clear svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.history-no-results {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 8px 0 4px;
}

.app-container {
    overscroll-behavior-y: contain;
}

.history-list {
    overscroll-behavior-y: contain;
}

/* ==========================================================================
   Attribution Block (Settings Page)
   ========================================================================== */
.attribution-block {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.attribution-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.attribution-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.attribution-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.attribution-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.attribution-link--offline {
    color: var(--error-color, #dc2626);
}

/* Chrome Android Fix: CSS-Variablen in dynamisch gesetztem Content erzwingen */
#backend-info,
#backend-info * {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: normal;
}