/* Global Defaults that were common or safe to share */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
}

/* =========================================
   Page: Standard (template.html)
   ========================================= */
.page-standard {
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #6366f1;
    --accent-strong: #4f46e5;
    --border-muted: rgba(148, 163, 184, 0.35);
    --shadow-strong: 0 16px 40px rgba(15, 23, 42, 0.28);
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.18);

    background: linear-gradient(145deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
}

.page-standard #map {
    height: 100%;
    width: 100%;
}

.page-standard .toolbar {
    position: absolute;
    z-index: 1000;
    top: 18px;
    left: 3%;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
}

.page-standard .toolbar button {
    border: 0;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.25);
}

.page-standard .camera-toggle-btn {
    background: #e0f2fe;
    color: #0f172a;
    border: 1px solid rgba(14, 165, 233, 0.35);
    box-shadow: none;
    min-width: 230px;
}

.page-standard .camera-toggle-btn:hover {
    filter: none;
    background: #bae6fd;
    transform: none;
}

.page-standard .camera-toggle-btn:active {
    transform: none;
    box-shadow: none;
}

.page-standard .toolbar button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.page-standard .toolbar button:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.page-standard .badge {
    background: var(--text-primary);
    color: #ffffff;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    padding: 3px 10px;
    display: inline-block;
    min-width: 26px;
    text-align: center;
}

.page-standard .info-panel {
    position: absolute;
    top: 18px;
    right: 10px;
    z-index: 1000;
    width: 340px;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-strong);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border: 1px solid var(--border-muted);
}

.page-standard .panel-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-standard .panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.page-standard .panel-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.page-standard .distance-chip {
    align-self: flex-start;
    margin-top: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    background: var(--surface-muted);
    color: var(--accent-strong);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.page-standard .stop-summary {
    margin-top: 8px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-muted);
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.page-standard .stop-summary.is-active {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
}

.page-standard .stop-summary.is-preview {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.page-standard .stop-summary__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.page-standard .stop-summary__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--accent-strong);
}

.page-standard .stop-summary__id {
    font-size: 12px;
    color: var(--text-secondary);
}

.page-standard .stop-summary__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-standard .stop-summary__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.page-standard .stop-summary__stat {
    background: var(--surface);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-standard .stop-summary__stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.page-standard .stop-summary__stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-standard .heatmap-toggle {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.page-standard .heatmap-toggle button {
    flex: 1 1 0;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.page-standard .heatmap-toggle button:hover {
    background: rgba(99, 102, 241, 0.1);
}

.page-standard .heatmap-toggle button.is-active {
    background: linear-gradient(135deg, #fef08a, #b91c1c);
    color: #fffef5;
    border-color: rgba(185, 28, 28, 0.6);
    transform: translateY(-1px);
}

.page-standard .search-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-standard .search-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.page-standard .search-wrapper input {
    width: calc(100% - 12px);
    margin: 0 auto;
    padding: 11px 14px 11px 42px;
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 14px;
    outline: none;
    background: var(--surface-muted);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236366f1' stroke-width='1.5'%3E%3Ccircle cx='7' cy='7' r='5.25'/%3E%3Cpath d='M10.75 10.75 14 14' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px 50%;
}

.page-standard .search-wrapper input:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: #ffffff;
}

.page-standard .suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 12px);
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--border-muted);
}

.page-standard .suggestions.is-visible {
    display: block;
}

.page-standard .suggestion-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.page-standard .suggestion-item span {
    display: block;
    font-weight: 600;
}

.page-standard .suggestion-item small {
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.page-standard .suggestion-item:hover,
.page-standard .suggestion-item.is-active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-strong);
}

.page-standard .route-stop-icon {
    background: transparent;
    border: none;
}

.page-standard .route-stop-icon__inner {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.page-standard .route-stop-icon__inner.is-active {
    transform: translateY(-6px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.32), 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.page-standard .route-stop-icon__inner.is-preview {
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.25), 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.page-standard .route-stop-icon:hover .route-stop-icon__inner {
    transform: translateY(-22px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.32);
}

.page-standard .leaflet-interactive.route-segment {
    cursor: pointer;
}

.page-standard .leaflet-interactive.route-segment-hit {
    cursor: pointer;
}

.page-standard .leaflet-tooltip.route-segment-tooltip {
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    border-radius: 10px;
    border: 0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.page-standard .leaflet-tooltip.route-segment-tooltip .tooltip-distance {
    display: block;
    margin-top: 4px;
    font-weight: 600;
    color: #c7d2fe;
}

.page-standard .leaflet-tooltip.house-tooltip {
    background: rgba(249, 115, 22, 0.92);
    color: #111827;
    border-radius: 9px;
    border: 0;
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.25);
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.4;
}

.page-standard .legend {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .page-standard .toolbar {
        flex-wrap: wrap;
        top: 12px;
        left: 12px;
    }

    .page-standard .info-panel {
        width: calc(100% - 24px);
        top: auto;
        bottom: 12px;
        right: 12px;
    }

    .page-standard .legend {
        display: none;
    }
}

/* =========================================
   Page: Routing (template-routing.html)
   ========================================= */
.page-routing {
    background: #f8fafc;
}

.page-routing * {
    box-sizing: border-box;
}

.page-routing .layout {
    display: flex;
    height: 100%;
}

.page-routing .sidebar {
    width: 360px;
    background: #ffffff;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.15);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.page-routing .sidebar-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    padding: 16px;
    background: rgba(248, 250, 252, 0.8);
}

.page-routing .sidebar-section .content-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 12px;
}

.page-routing .sidebar h1 {
    font-size: 15px;
    margin: 0;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-routing .camera-toggle {
    margin: 6px 0 10px;
}

.page-routing .camera-toggle button {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    background: #eef2ff;
    color: #312e81;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.page-routing .camera-toggle button:hover {
    background: #e0e7ff;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.18);
}

.page-routing .camera-toggle button.is-off {
    background: #f8fafc;
    color: #475569;
    border-color: rgba(148, 163, 184, 0.6);
}

.page-routing .action-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.page-routing .action-btn {
    flex: 1;
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.page-routing .action-btn:hover {
    border-color: #6366f1;
    color: #4338ca;
    background: #eef2ff;
}

.page-routing .summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-routing .summary-item {
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.page-routing .summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.page-routing .summary-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-routing .summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 600;
}

.page-routing .summary-value {
    font-size: 18px;
    font-weight: 700;
}

.page-routing .section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.page-routing .hub-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-routing .hub-button {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .15s ease, background .15s ease;
}

.page-routing .hub-button:hover {
    border-color: rgba(99, 102, 241, 0.45);
}

.page-routing .hub-button.is-active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.55);
}

.page-routing .hub-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #475569;
}

.page-routing .hub-info {
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-routing .hub-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.page-routing .route-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.page-routing .route-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.page-routing .route-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-routing .route-item {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .15s ease, background .15s ease;
}

.page-routing .route-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.page-routing .route-item.is-active {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.6);
}

.page-routing .route-item.is-preview {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.45);
}

.page-routing .route-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
}

.page-routing .route-item-meta {
    font-size: 12px;
    color: #475569;
    display: flex;
    gap: 12px;
}

.page-routing .map {
    flex: 1;
    position: relative;
}

.page-routing #map {
    position: absolute;
    inset: 0;
}

.page-routing .hub-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.25);
}

.page-routing .hub-marker.is-active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.3);
}

.page-routing .house-tooltip {
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    border-radius: 10px;
    border: none;
    padding: 8px 10px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.3);
}

.page-routing .segment-tooltip {
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    border-radius: 10px;
    border: none;
    padding: 8px 10px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.3);
    font-size: 12px;
}

.page-routing .segment-tooltip .distance {
    display: block;
    margin-top: 2px;
    font-weight: 700;
}

.page-routing .route-hit {
    cursor: pointer;
}

.page-routing .floating-panel {
    position: absolute;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 14px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    z-index: 3500;
    backdrop-filter: blur(6px);
    width: 380px;
    max-width: calc(100% - 32px);
}

.page-routing .floating-panel--top {
    top: 16px;
}

.page-routing .floating-panel--top-left {
    top: 16px;
    left: 16px;
}

.page-routing .floating-panel--bottom {
    bottom: 16px;
}

.page-routing .floating-panel--wide {
    width: 420px;
}

.page-routing .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1e1b4b;
    color: #fff;
    border-radius: 14px 14px 0 0;
}

.page-routing .panel-header strong {
    font-size: 14px;
}

.page-routing .panel-subtitle {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.page-routing .panel-toggle {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
}

.page-routing .panel-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.page-routing .panel-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(248, 250, 252, 0.95);
    border-radius: 0 0 14px 14px;
}

.page-routing .floating-panel.minimized .panel-body {
    display: none;
}

.page-routing .floating-panel.minimized {
    opacity: 0.5;
}

.page-routing .panel-body.json-body {
    max-height: 45vh;
    overflow: auto;
    gap: 0;
}

.page-routing .details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.page-routing .detail-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    background: #f8fafc;
}

.page-routing .detail-card strong {
    font-size: 16px;
    display: block;
}

.page-routing .detail-card small {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.page-routing .detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.12);
    font-size: 18px;
}

@media (max-width: 980px) {
    .page-routing .layout {
        flex-direction: column;
    }

    .page-routing .sidebar {
        width: 100%;
        height: 52vh;
    }

    .page-routing .map {
        height: 48vh;
    }
}


/* =========================================
   Page: Hub Selection (template-hubselect.html)
   ========================================= */
.page-hubselect {
    background: #f1f5f9;
}

.page-hubselect * {
    box-sizing: border-box;
}

.page-hubselect .layout {
    display: flex;
    height: 100%;
}

.page-hubselect .sidebar {
    width: 440px;
    background: #ffffff;
    border-right: 1px solid rgba(148, 163, 184, 0.35);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    height: 100%;
    overflow: hidden;
}

.page-hubselect .sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-hubselect .sidebar h1 {
    margin: 0;
    font-size: 20px;
}

.page-hubselect .camera-toggle {
    margin: 6px 0 4px;
}

.page-hubselect .camera-row {
    display: grid;
    grid-template-columns: 1fr 1fr 120px;
    gap: 10px;
    align-items: center;
}

.page-hubselect .camera-toggle button {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    background: #eef2ff;
    color: #312e81;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.page-hubselect .camera-toggle button:hover {
    background: #e0e7ff;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.18);
}

.page-hubselect .camera-toggle button.is-off {
    background: #f8fafc;
    color: #475569;
    border-color: rgba(148, 163, 184, 0.6);
}

.page-hubselect .heatmap-toggle {
    margin: 8px 0 4px;
}

.page-hubselect .heatmap-toggle button {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.page-hubselect .heatmap-toggle button:hover {
    background: #fee2e2;
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 6px 14px rgba(248, 113, 113, 0.18);
}

.page-hubselect .heatmap-toggle button.is-off {
    background: #f8fafc;
    color: #475569;
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: none;
}

@keyframes hub-pulse {
    0% {
        transform: scale(1.0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1.0);
    }
}

.page-hubselect .hub-pulse {
    transform-box: fill-box;
    transform-origin: center center;
}

.page-hubselect .control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-hubselect label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.page-hubselect select,
.page-hubselect input[type="range"] {
    width: 100%;
}

.page-hubselect select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 14px;
    background: #f8fafc;
}

.page-hubselect .range-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #475569;
}

.page-hubselect .stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.page-hubselect .stat-card {
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 88px;
}

.page-hubselect .stat-card--highlight {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(187, 247, 208, 0.3);
}

.page-hubselect .stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.page-hubselect .stat-value {
    font-size: 18px;
    font-weight: 700;
}

.page-hubselect .stat-hint {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    display: none;
}

.page-hubselect .stat-subtext {
    font-size: 12px;
    color: #64748b;
}

.page-hubselect .hub-list-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    min-height: 80px;
}

.page-hubselect #controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    height: 100%;
}

.page-hubselect .info-pane,
.page-hubselect .hub-pane {
    flex: 1 1 0;
    overflow-y: auto;
    padding-right: 6px;
    min-height: 0;
}

.page-hubselect .info-pane {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.page-hubselect .hub-pane {
    display: flex;
    flex-direction: column;
}

.page-hubselect .hub-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-hubselect .hub-item {
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.page-hubselect .hub-item strong {
    display: block;
    font-size: 14px;
}

.page-hubselect .hub-item small {
    color: #475569;
    font-size: 12px;
}

.page-hubselect .hub-item:hover {
    border-color: rgba(37, 99, 235, 0.4);
}

.page-hubselect .hub-item.is-active {
    border-color: rgba(79, 70, 229, 0.7);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
    background: rgba(79, 70, 229, 0.08);
}

.page-hubselect .hub-pane h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.page-hubselect .map {
    flex: 1;
    position: relative;
}

.page-hubselect #map {
    position: absolute;
    inset: 0;
}

.page-hubselect .house-progress {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    max-width: 60vw;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
    display: none;
    flex-direction: column;
    padding: 10px 12px;
    gap: 6px;
    z-index: 600;
    opacity: 0;
    transition: opacity 2.5s ease;
    pointer-events: none;
}

.page-hubselect .house-progress.is-visible {
    display: flex;
    opacity: 1;
}

.page-hubselect .house-progress.is-hiding {
    opacity: 0;
}

.page-hubselect .house-progress__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #cbd5e1;
}

.page-hubselect .house-progress__bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.page-hubselect .house-progress__bar-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, #facc15, #dc2626);
    transition: width 0.15s ease;
}

.page-hubselect .house-progress__meta {
    font-size: 12px;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
}

.page-hubselect .hub-detail-card {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 320px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.25);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 500;
    backdrop-filter: blur(4px);
}

.page-hubselect .hub-detail-card.is-hidden {
    display: none;
}

.page-hubselect .hub-detail-card.is-collapsed .hub-detail-body {
    display: none;
}

.page-hubselect .hub-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    padding-bottom: 12px;
}

.page-hubselect .hub-detail-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-hubselect .hub-detail-title strong {
    font-size: 16px;
}

.page-hubselect .hub-detail-title small {
    color: #64748b;
    font-size: 12px;
}

.page-hubselect .hub-detail-toggle {
    border: none;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-weight: 700;
    color: #4f46e5;
    transition: background .15s ease, color .15s ease;
}

.page-hubselect .hub-detail-toggle:hover {
    background: rgba(99, 102, 241, 0.18);
    color: #312e81;
}

.page-hubselect .hub-detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-hubselect .hub-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.page-hubselect .hub-detail-row {
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-hubselect .hub-detail-row span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 600;
}

.page-hubselect .hub-detail-row strong {
    color: #0f172a;
    font-size: 16px;
}

.page-hubselect .no-data {
    padding: 16px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px dashed rgba(148, 163, 184, 0.6);
    font-size: 14px;
    color: #475569;
}