:root {
    /* willhaben-inspired palette */
    --wh-yellow: #ffd100;
    --wh-yellow-dim: rgba(255, 209, 0, 0.12);
    --wh-yellow-glow: rgba(255, 209, 0, 0.25);
    --wh-yellow-text: #1a1a1a;

    --bg-deep: #0d1117;
    --bg-surface: #161b22;
    --bg-elevated: #1c2333;
    --bg-card: rgba(22, 27, 34, 0.92);
    --bg-input: #0d1117;

    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #484f58;

    --border: rgba(48, 54, 61, 0.6);
    --border-focus: var(--wh-yellow);

    --radius: 10px;
    --radius-sm: 6px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(255, 209, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);

    --danger: #f85149;
    --danger-dim: rgba(248, 81, 73, 0.15);
    --success: #3fb950;

    --topbar-h: 64px;
    --aside-w: 380px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* ===== Top Bar ===== */
.topbar {
    position: relative;
    z-index: 1001;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-mark { font-size: 1.4rem; }
.logo-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.logo-accent { color: var(--wh-yellow); font-weight: 700; }

/* Form in top bar */
.topbar-form {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.input-group {
    display: flex;
    gap: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-group:focus-within {
    border-color: var(--wh-yellow);
    box-shadow: 0 0 0 3px var(--wh-yellow-dim);
}

.url-input {
    flex: 1;
    padding: 0 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    height: 42px;
    min-width: 0;
}

.url-input::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-go {
    padding: 0 20px;
    background: var(--wh-yellow);
    color: var(--wh-yellow-text);
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-go:hover {
    background: #ffd700;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.08);
}

.btn-go:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-go .btn-label { display: inline; }
.btn-go.loading .btn-label::before { content: '⏳ '; }

.input-status {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}
.input-status.show { opacity: 1; }
.input-status.ok { color: var(--success); }
.input-status.err { color: var(--danger); }

/* Stats */
.topbar-stats { flex-shrink: 0; }

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
}

.stat-num {
    color: var(--wh-yellow);
    font-weight: 700;
    font-size: 0.95rem;
}

.stat-label {
    color: var(--text-secondary);
}

/* ===== Main Layout ===== */
.main-layout {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Map */
.map-panel {
    flex: 1;
    position: relative;
}

.map-panel .leaflet-container {
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
}

/* Leaflet tile layer - dark muted style via CSS filter */
.map-panel .leaflet-tile-pane {
    filter: brightness(0.75) saturate(0.8) hue-rotate(10deg);
}

/* Leaflet overrides */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-card) !important;
    backdrop-filter: blur(16px);
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
}

.leaflet-popup-content {
    margin: 8px 12px !important;
    font-size: 0.8rem;
    line-height: 1.4;
    min-width: 180px;
    max-width: 260px;
}

.popup-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    display: block;
}

.popup-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-price {
    color: var(--wh-yellow);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.popup-location {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.popup-link {
    color: var(--wh-yellow);
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 6px;
    display: inline-block;
}
.popup-link:hover { text-decoration: underline; }

/* ===== Custom Markers ===== */
.marker-el {
    width: 52px;
    height: 52px;
    background: var(--wh-yellow);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.5);
    transition: transform 0.15s;
    cursor: pointer;
}

.marker-el:hover {
    transform: rotate(-45deg) scale(1.15);
    z-index: 10000 !important;
}

.marker-el-inner {
    width: 38px;
    height: 38px;
    background: var(--wh-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--wh-yellow-text);
    transform: rotate(45deg);
    overflow: hidden;
}

.marker-el-inner.has-img {
    border-radius: 50%;
}
.marker-el-inner.has-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.marker-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    background: var(--bg-elevated);
    color: var(--wh-yellow);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid var(--border);
    pointer-events: none;
    white-space: nowrap;
}

/* ===== Detail Panel (slide from right) ===== */
.detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--aside-w);
    height: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 900;
    display: flex;
    flex-direction: column;
}

.detail-panel.open {
    transform: translateX(0);
}

.detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.15s;
}

.detail-close:hover {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: var(--danger);
}

.detail-inner {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Empty state */
.detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 32px;
    text-align: center;
}

.de-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.de-title {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.de-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Detail content */
.detail-content {
    padding: 24px 20px;
}

.dc-img-wrap {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--bg-input);
}

.dc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dc-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dc-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--wh-yellow);
    margin-bottom: 16px;
}

.dc-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.dc-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.dc-meta-label {
    color: var(--text-muted);
}

.dc-meta-val {
    color: var(--text-secondary);
    text-align: right;
}

.dc-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    max-height: 180px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.dc-link {
    display: block;
    padding: 12px;
    background: var(--wh-yellow);
    color: var(--wh-yellow-text);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.15s;
}

.dc-link:hover {
    background: #ffd700;
    box-shadow: var(--shadow-glow);
}

/* ===== Route & Distance ===== */
.dc-dist-info {
    margin-bottom: 12px;
}

.dc-btn-route {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1a5c2a 0%, #2d8a47 100%);
    color: #fff;
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 16px rgba(63, 185, 80, 0.2);
}

.dc-btn-route:hover {
    background: linear-gradient(135deg, #2d8a47 0%, #3fb950 100%);
    box-shadow: 0 0 24px rgba(63, 185, 80, 0.35);
    transform: translateY(-1px);
}

.dc-btn-route:active {
    transform: translateY(0);
}

.detail-route {
    padding: 0 20px 12px;
}

.dc-btn-route-close {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.dc-btn-route-close:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-dim);
}

/* === Detail Panel Extras === */
.dc-loading {
    text-align: center;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px dashed var(--border);
}

.dc-loading-spinner {
    font-size: 1.5rem;
    margin-bottom: 6px;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dc-loading-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dc-meta-head {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wh-yellow);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

/* Equipment tag grid */
.dc-equip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.dc-equip-tag {
    display: inline-block;
    padding: 3px 9px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.15s;
}

.dc-equip-tag:hover {
    border-color: var(--wh-yellow);
    color: var(--wh-yellow);
}

.dc-feature-val {
    color: var(--success) !important;
    font-weight: 600;
}

.dc-price-change {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 4px 0;
}

.dc-price-old {
    color: var(--danger) !important;
    text-decoration: line-through;
    font-size: 0.78rem;
}

.dc-price-arrow {
    color: var(--text-muted) !important;
    font-size: 0.75rem;
}

.dc-price-new {
    color: var(--success) !important;
    font-weight: 700;
}

.dc-status {
    color: var(--wh-yellow) !important;
    font-weight: 600;
}

/* Days count in timeline */
.dc-days {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 400;
}
.dc-days-end {
    color: var(--success);
}

/* Collapsible equipment section */
.dc-equip-section {
    cursor: pointer;
}
.dc-equip-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.dc-equip-toggle:hover {
    opacity: 0.8;
}
.dc-equip-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.15s;
}

/* ===== Entry List Section ===== */
.list-section {
    flex-shrink: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    max-height: 40vh;
    display: flex;
    flex-direction: column;
}

.list-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
}

.list-toggle:hover {
    background: var(--bg-elevated);
}

.list-count {
    margin-left: auto;
    padding: 2px 10px;
    background: var(--bg-elevated);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--wh-yellow);
}

.list-arrow {
    transition: transform 0.2s;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.list-section.collapsed .list-arrow {
    transform: rotate(-90deg);
}

.list-section.collapsed .list-body {
    display: none;
}

.list-body {
    overflow-y: auto;
    flex: 1;
}

.list-empty {
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Table */
.list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.list-table th {
    position: sticky;
    top: 0;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.list-table td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.3);
    vertical-align: middle;
}

.list-row:hover {
    background: rgba(255, 209, 0, 0.03);
}

.list-row:last-child td {
    border-bottom: none;
}

.th-img { width: 44px; }
.th-price { width: 110px; }
.th-location { width: 160px; }
.th-date { width: 100px; }
.th-action { width: 44px; text-align: center; }

.td-img-wrap {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-elevated);
}

.td-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.td-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-title a:hover {
    color: var(--wh-yellow);
}

.td-price {
    color: var(--wh-yellow);
    font-weight: 600;
    font-size: 0.82rem;
}

.td-location {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.td-date {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}

.btn-delete:hover {
    color: var(--danger);
    background: var(--danger-dim);
}

/* Image fallback */
.td-img-wrap.img-failed {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
}
.td-img-wrap.img-failed img { display: none; }

/* ===== Footer ===== */
.footer {
    flex-shrink: 0;
    text-align: center;
    padding: 10px 24px;
    color: var(--text-muted);
    font-size: 0.72rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    animation: toastIn 0.25s ease;
    max-width: 360px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
}

.toast.success {
    background: rgba(63, 185, 80, 0.92);
    color: #fff;
}
.toast.error {
    background: rgba(248, 81, 73, 0.92);
    color: #fff;
}
.toast.info {
    background: rgba(255, 209, 0, 0.92);
    color: var(--wh-yellow-text);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(30px); }
}

/* ===== Responsive ===== */

/* Tablet landscape & below */
@media (max-width: 1024px) {
    :root {
        --aside-w: 340px;
    }

    .marker-el {
        width: 32px;
        height: 32px;
    }
    .marker-el-inner {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .marker-label {
        font-size: 9px;
        padding: 1px 6px;
        bottom: -16px;
    }

    .detail-panel {
        width: var(--aside-w);
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .topbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 6px;
    }

    .topbar-logo .logo-text {
        font-size: 0.9rem;
    }
    .topbar-logo .logo-mark {
        font-size: 1.1rem;
    }

    .topbar-form {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }

    .url-input {
        height: 38px;
        font-size: 0.85rem;
        padding: 0 12px;
        -webkit-appearance: none;
    }

    .btn-go {
        height: 38px;
        padding: 0 14px;
        font-size: 0.8rem;
    }
    .btn-go .btn-label::before {
        content: '📍 ';
    }

    .stat-badge {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    .stat-num {
        font-size: 0.85rem;
    }

    .input-status {
        position: static;
        margin-top: 4px;
    }

    .detail-panel {
        width: 100%;
        max-width: 100%;
        height: 55%;
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    }

    .detail-panel.open {
        transform: translateY(0);
    }

    /* Drag handle for mobile */
    .detail-panel::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--text-muted);
        border-radius: 2px;
        z-index: 20;
        opacity: 0.5;
    }

    .detail-close {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .detail-inner {
        padding-top: 16px;
    }

    .detail-content {
        padding: 16px 14px;
    }

    .detail-route {
        padding: 0 14px 8px;
    }

    .dc-img-wrap {
        height: 140px;
    }

    .dc-title {
        font-size: 0.95rem;
    }
    .dc-price {
        font-size: 1.15rem;
    }
    .dc-meta {
        padding: 10px 12px;
        gap: 5px;
    }
    .dc-meta-row {
        font-size: 0.75rem;
    }

    .dc-btn-route {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .list-section {
        max-height: 45vh;
    }

    .list-toggle {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .list-table th {
        padding: 8px 10px;
        font-size: 0.65rem;
    }
    .list-table td {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .list-table .th-date,
    .list-table .th-location {
        display: none;
    }
    .list-table .td-date,
    .list-table .td-location {
        display: none;
    }

    .th-price { width: 80px; }
    .th-action { width: 36px; }

    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    .toast {
        max-width: 100%;
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}

/* Phone */
@media (max-width: 480px) {
    .topbar-inner {
        padding: 6px 10px;
        gap: 4px;
    }

    .topbar-logo .logo-text {
        font-size: 0.8rem;
    }
    .topbar-logo .logo-mark {
        font-size: 1rem;
    }

    .url-input {
        height: 36px;
        font-size: 0.8rem;
        padding: 0 10px;
    }
    .url-input::placeholder {
        font-size: 0.78rem;
    }
    .btn-go {
        height: 36px;
        padding: 0 10px;
        font-size: 0.75rem;
        min-width: 44px;
    }
    .btn-go .btn-label::before {
        content: '📍';
    }

    .stat-badge {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .detail-panel {
        height: 65%;
        border-radius: 14px 14px 0 0;
    }

    .detail-content {
        padding: 12px 12px;
    }

    .dc-img-wrap {
        height: 120px;
    }
    .dc-title {
        font-size: 0.85rem;
    }
    .dc-price {
        font-size: 1rem;
    }
    .dc-meta {
        padding: 8px 10px;
        gap: 4px;
    }
    .dc-meta-row {
        font-size: 0.72rem;
    }
    .dc-meta-head {
        font-size: 0.68rem;
        margin-bottom: 5px;
        padding-bottom: 4px;
    }

    .dc-desc {
        font-size: 0.75rem;
        padding: 8px 10px;
        max-height: 120px;
    }
    .dc-link {
        font-size: 0.78rem;
        padding: 10px;
    }

    .dc-btn-route {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .marker-el {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }
    .marker-el-inner {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
    .marker-label {
        display: none;
    }
    /* Show price label only on hover/tap for small markers */
    .marker-el:hover .marker-label,
    .marker-el:focus .marker-label {
        display: block;
    }

    .list-section {
        max-height: 40vh;
    }
    .list-toggle {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    .list-table th {
        padding: 6px 8px;
        font-size: 0.6rem;
    }
    .list-table td {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .td-img-wrap {
        width: 28px;
        height: 28px;
    }
    .btn-delete {
        font-size: 1rem;
        padding: 4px 6px;
    }

    .footer {
        padding: 6px 12px;
        font-size: 0.65rem;
    }

    /* Popup adjustments for small screens */
    .leaflet-popup-content {
        margin: 6px 10px !important;
        font-size: 0.75rem;
        min-width: 140px;
        max-width: 200px;
    }
    .popup-img {
        height: 70px;
    }
    .popup-title {
        font-size: 0.78rem;
    }
    .popup-price {
        font-size: 0.85rem;
    }

    /* Larger touch targets */
    .btn-go,
    .btn-delete,
    .dc-btn-route,
    .dc-link,
    .list-toggle,
    .detail-close,
    .dc-btn-route-close {
        min-height: 44px;
    }
    .url-input {
        min-height: 44px;
    }
}

/* Safe area for modern phones with notch */
@supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .detail-panel {
            padding-bottom: env(safe-area-inset-bottom);
            height: calc(55% + env(safe-area-inset-bottom));
        }
        .footer {
            padding-bottom: calc(6px + env(safe-area-inset-bottom));
        }
    }
    @media (max-width: 480px) {
        .detail-panel {
            height: calc(65% + env(safe-area-inset-bottom));
        }
    }
}

/* Prevent iOS zoom on input focus */
@media (max-width: 768px) {
    input, button, textarea, select {
        font-size: 16px !important;
    }
}
