/* ========================================
   NOM DE COOKIE - Main Stylesheet
   ======================================== */

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier Prime', 'Courier New', monospace;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre, .content-box {
    font-family: 'Courier Prime', 'Courier New', monospace;
}

/* ========================================
   THEME - Dark (default) / Light
   ======================================== */

:root {
    --color-bg: #1a1a1a;
    --color-bg-header: rgba(26, 26, 26, 0.7);
    --color-bg-card: rgba(40, 40, 40, 0.8);
    --color-text: #e0e0e0;
    --color-text-muted: #999999;
    --color-accent: #4a9eff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.4);
    
    --light-bg: #f5f5f5;
    --light-bg-header: rgba(255, 255, 255, 0.7);
    --light-bg-card: rgba(255, 255, 255, 0.8);
    --light-text: #333333;
    --light-text-muted: #666666;
    
    --header-height: 64px;
    --footer-height: 40px;
    --max-width: 1200px;
}

body.light-theme {
    --color-bg: var(--light-bg);
    --color-bg-header: var(--light-bg-header);
    --color-bg-card: var(--light-bg-card);
    --color-text: var(--light-text);
    --color-text-muted: var(--light-text-muted);
}

/* ========================================
   HEADER
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--color-bg-header);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-bottom: 1px solid var(--color-text-muted);
    z-index: 100;
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
}

.header__logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header__logo:hover {
    text-decoration: none;
}

.header__logo-text {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: var(--color-text);
    line-height: 1;
    transform: translateY(4px);
}

.header__menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.header__menu-icon {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: all 0.3s ease;
}

.header__menu-icon::before,
.header__menu-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    left: 0;
    transition: all 0.3s ease;
}

.header__menu-icon::before {
    top: -8px;
}

.header__menu-icon::after {
    top: 8px;
}

/* Close (X) icon state */
.header__menu-icon.active {
    background-color: transparent;
}

.header__menu-icon.active::before {
    top: 0;
    transform: rotate(45deg);
}

.header__menu-icon.active::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Desktop nav (inside header) */
.header__nav--desktop {
    display: flex;
    align-items: center;
}

.header__nav--desktop .header__nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

/* Mobile nav overlay (outside header for proper backdrop-filter) */
.header__nav--mobile {
    display: none;
}

.header__nav-link {
    color: var(--color-text);
    font-weight: bold;
    font-size: 0.95rem;
}

.header__nav-link:hover {
    text-decoration: none;
    opacity: 0.8;
}

.header__theme-toggle {
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid var(--color-text-muted);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    margin-left: 1.5rem;
    color: var(--color-text);
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.header__theme-toggle:hover {
    background-color: rgba(26, 26, 26, 0.95);
    border-color: var(--color-text);
}

body.light-theme .header__theme-toggle {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--light-text);
}

body.light-theme .header__theme-toggle:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background-color: var(--color-bg-header);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    z-index: 10;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--color-text-muted);
}

.footer p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.footer-eyes-inline {
    height: 0.5em;
    width: auto;
    vertical-align: middle;
    margin: 0 0.05em;
}

body.light-theme .footer {
    background-color: rgba(0, 0, 0, 0.6);
    border-top: none;
}

body.light-theme .footer p {
    color: #e0e0e0;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* ========================================
   SHARED COMPONENTS
   ======================================== */

.content-box {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid rgba(128, 128, 128, 0.5);
    border-right: 4px solid rgba(128, 128, 128, 0.5);
    border-top: 1px solid rgba(128, 128, 128, 0.5);
    border-bottom: 1px solid rgba(128, 128, 128, 0.5);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    overflow-wrap: break-word;
}

body.light-theme .content-box {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ========================================
   FILTERS & LISTS
   ======================================== */

.filters__search,
.filters__select {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-text-muted);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    accent-color: var(--color-text-muted);
}

.filters__select option {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* Force dark-themed native dropdown controls */
.filters__select {
    color-scheme: dark;
}

body.light-theme .filters__select {
    color-scheme: light;
}

body.light-theme .filters__search,
body.light-theme .filters__select {
    border-color: rgba(0, 0, 0, 0.2);
}

.filters__search {
    flex: 1;
    min-width: 200px;
}

/* Search input clear (X) button — monochrome and larger */
.filters__search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 1.2em;
    width: 1.2em;
    border-radius: 50%;
    background: var(--color-text-muted);
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12" stroke="white" stroke-width="3" fill="none" stroke-linecap="round"/></svg>') center/contain no-repeat;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 6L6 18M6 6l12 12" stroke="white" stroke-width="3" fill="none" stroke-linecap="round"/></svg>') center/contain no-repeat;
    cursor: pointer;
}

.filters__search::-moz-search-clear-button {
    font-size: 1.2em;
    color: var(--color-text-muted);
}

.filters__search:focus,
.filters__select:focus {
    outline: none;
    border-color: var(--color-text-muted);
}

body.light-theme .filters__search:focus,
body.light-theme .filters__select:focus {
    border-color: var(--color-text);
}

.count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
    padding: 0.5rem 0 1rem 0;
}

.count span {
    font-weight: bold;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background-color: var(--color-bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0;
}

.card__from-label {
    color: var(--color-text);
    font-size: 0.85rem;
}

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

.card__header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.card__sender {
    color: var(--color-text);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card__body {
    margin-bottom: 0.5rem;
}

.card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
}

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

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

.card--expanded .card__meta {
    order: 2;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
}

.card--expanded .card__details {
    order: 1;
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */

.load-more {
    display: none;
    margin: 1rem auto;
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-text-muted);
    border-radius: 8px;
    padding: 0.5rem 2rem;
    cursor: pointer;
}

.load-more:hover {
    border-color: var(--color-text);
}

.load-more--visible {
    display: block;
}

/* ========================================
   CARD LIST STATUS
   ======================================== */

.card-list__loading,
.card-list__empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.card-list__error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
}

.card-list__hidden {
    display: none;
}

/* ========================================
   CARD ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card--new {
    animation: fadeInDown 0.3s ease forwards;
}

.card--fadein {
    animation: fadeInUp 0.3s ease;
}

/* ========================================
   FILTER TOGGLE
   ======================================== */

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Desktop: search and filters all in one line */
.filters-header {
    display: contents;
}

.filters {
    display: contents;
}

.filters-toggle {
    display: none;
}

/* ========================================
   BACK TO TOP
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 3.5rem;
    right: 1rem;
    width: 2.2rem;
    height: 2.2rem;
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid var(--color-text-muted);
    border-radius: 50%;
    color: var(--color-text);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    -webkit-tap-highlight-color: transparent;
}

.back-to-top:hover {
    background-color: rgba(26, 26, 26, 0.95);
    border-color: var(--color-text);
}

body.light-theme .back-to-top {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .back-to-top:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   CARD EXPANSION (Nodes)
   ======================================== */

.card--expandable {
    cursor: pointer;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card__expand-icon {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    transition: transform 0.3s ease;
    display: inline-block;
}

.card--expanded .card__expand-icon {
    transform: rotate(90deg);
}

.card__details {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0;
}

.card--expanded .card__details {
    display: flex;
    margin-top: 0.5rem;
    animation: fadeInUp 0.2s ease;
}


.card__details-grid {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card__detail-row {
    display: flex;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.1rem 0;
    gap: 0.5rem;
}

.card__detail-label {
    color: var(--color-text-muted);
    flex: 0 0 50%;
    text-align: right;
    padding-right: 0;
}

.card__detail-value {
    color: var(--color-text);
    flex: 0 0 50%;
    text-align: left;
    word-break: break-word;
    margin-left: 0.5rem;
}

/* Battery bar */

/* Battery bar inside detail rows */

.card__detail-value--battery {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card__battery-bar {
    flex: 0 0 80px;
    height: 10px;
    background-color: rgba(128, 128, 128, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.card__battery-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: var(--battery-width, 0%);
}

.card__battery-fill--high {
    background-color: #4caf50;
}

.card__battery-fill--medium {
    background-color: #ff9800;
}

.card__battery-fill--low {
    background-color: #f44336;
}

.card__details .card__body.content-box {
    flex: 1 1 180px;
    min-width: 180px;
    margin-top: 0;
    padding: 0.5rem 0.75rem;
}

.card__details .card__map {
    flex: 0 0 auto;
    width: 100%;
    min-height: 200px;
}

/* Node map inside expanded card */

.card__map {
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 0.75rem;
    position: relative;
    border: 1px solid var(--color-text-muted);
}

body.light-theme .card__map {
    border-color: rgba(0, 0, 0, 0.15);
}

.card__map.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 50000 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    background: var(--color-bg) !important;
    box-shadow: none !important;
}


/* ========================================
   MAP PAGE
   ======================================== */

.map-wrapper {
    margin-top: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.map-wrapper--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    margin: 0;
}

.map-wrapper--fullscreen .map-container {
    border-radius: 0;
    border: none;
    height: 100vh;
}

.map-wrapper--fullscreen .map {
    height: 100vh;
    border-radius: 0;
}

.map-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-text-muted);
    z-index: 1;
}

body.light-theme .map-container {
    border-color: rgba(0, 0, 0, 0.15);
}

.map {
    height: calc(100vh - var(--header-height) - var(--footer-height) - 120px);
    min-height: 400px;
    border-radius: 12px;
}

.map-wrapper--fullscreen .map {
    height: 100vh;
    border-radius: 0;
}

.map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 500;
    border: 1px solid rgba(153, 153, 153, 0.4);
}

body.light-theme .map-legend {
    background-color: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.15);
}

.map-legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text);
}

.map-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.map-legend__dot--mediumfast {
    background-color: #FF10F0;
}

.map-legend__dot--longfast {
    background-color: #39ff14;
}

/* Themed Leaflet controls for dark mode */

.leaflet-control-zoom a,
.map-fullscreen-btn {
    background-color: var(--color-bg) !important;
    color: var(--color-text) !important;
    border: 1px solid var(--color-text-muted) !important;
    font-size: 1rem;
    line-height: 1.5;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.leaflet-control-zoom a:hover,
.map-fullscreen-btn:hover {
    background-color: var(--color-bg) !important;
    color: var(--color-text) !important;
    border-color: var(--color-text) !important;
}

.leaflet-control-zoom {
    border: none !important;
}

.map-fullscreen-control.leaflet-bar {
    border: none !important;
}

.leaflet-control-zoom a {
    border-color: var(--color-text-muted) !important;
}

body.light-theme .leaflet-control-zoom a,
body.light-theme .map-fullscreen-btn {
    background-color: var(--light-bg) !important;
    color: var(--light-text) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
}

body.light-theme .leaflet-control-zoom a:hover,
body.light-theme .map-fullscreen-btn:hover {
    background-color: var(--light-bg) !important;
    border-color: var(--light-text) !important;
}

.map-fullscreen-control {
    margin-top: 4px !important;
    margin-left: 10px !important;
}

/* Leaflet controls: above tiles (400) but we keep the mobile nav (z-index 1100) above them */
.leaflet-top,
.leaflet-bottom {
    z-index: 600 !important;
}

/* Fullscreen map Leaflet controls above everything */
.map-wrapper--fullscreen .leaflet-top,
.map-wrapper--fullscreen .leaflet-bottom {
    z-index: 600 !important;
}

/* Leaflet popups themed */
.leaflet-popup-content-wrapper {
    background-color: rgba(26, 26, 26, 0.95) !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(153, 153, 153, 0.4) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-tip {
    background-color: rgba(26, 26, 26, 0.95) !important;
    border: 1px solid rgba(153, 153, 153, 0.4) !important;
}

.leaflet-popup-close-button {
    color: #999999 !important;
}

.leaflet-popup-close-button:hover {
    color: #e0e0e0 !important;
}

.leaflet-popup-content {
    margin: 0.75rem 1rem !important;
}

body.light-theme .leaflet-popup-content-wrapper {
    background-color: rgba(255, 255, 255, 0.92) !important;
    color: #333333 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .leaflet-popup-tip {
    background-color: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .leaflet-popup-close-button {
    color: #666666 !important;
}

body.light-theme .leaflet-popup-close-button:hover {
    color: #333333 !important;
}

.map-popup {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    min-width: 180px;
}

.map-popup__name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #4a9eff;
}

body.light-theme .map-popup__name {
    color: #2563eb;
}

.map-popup__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0;
}

.map-popup__label {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

body.light-theme .map-popup__label {
    color: var(--light-text-muted);
}

.map-popup__value {
    color: var(--color-text);
    text-align: right;
    word-break: break-word;
}

body.light-theme .map-popup__value {
    color: var(--light-text);
}

/* ========================================
   PACKET CONTENT (JSON pre)
   ======================================== */

.card__body pre {
    margin: 0;
    font-family: 'Courier Prime', 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--color-text);
}

/* ========================================
   RESPONSIVE - Mobile
   ======================================== */

@media (max-width: 768px) {
    .header__inner {
        position: relative;
    }
    
    .header__menu-toggle {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .header__nav--desktop {
        display: none;
    }
    
    .header__nav--mobile {
        display: flex;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-bg-header);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        padding: 0.5rem 1rem 1rem;
        border-bottom: 1px solid var(--color-text-muted);
        z-index: 1100;
        flex-direction: column;
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .header__nav--mobile.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .header__nav--mobile .header__nav-list {
        list-style: none;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
    }
    
    .header__nav--mobile .header__nav-link {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.1rem;
    }
    
    .header__theme-toggle {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .header__logo-text {
        font-size: 2rem;
        transform: translateY(3px);
    }
    
    .header.menu-open {
        border-bottom: none;
    }
    
    .main {
        padding: 0.5rem;
    }
    
    /* Filters on mobile: search + toggle on one row, dropdowns collapsible */
    .filters-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-header {
        display: flex;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .filters-toggle {
        display: flex;
        width: 2.5rem;
        min-width: 2.5rem;
        padding: 0;
        background-color: var(--color-bg);
        color: var(--color-text);
        border: 1px solid;
        border-color: var(--color-text-muted);
        border-radius: 8px;
        cursor: pointer;
        font-size: 1rem;
        transition: transform 0.3s ease;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }
    
    .filters-toggle:hover {
        border-color: var(--color-text-muted);
    }
    
    .filters-toggle:focus {
        outline: none;
        border-color: var(--color-text-muted);
    }
    
    body.light-theme .filters-toggle {
        border-color: rgba(0, 0, 0, 0.2);
        background-color: rgba(245, 245, 245, 0.9);
    }
    
    body.light-theme .filters-toggle:hover,
    body.light-theme .filters-toggle:focus {
        border-color: var(--color-text);
    }
    
    .filters-toggle::after {
        content: '▼';
    }
    
    .filters-toggle.active::after {
        content: '\25B2';
    }
    
    .filters__search {
        flex: 1;
        min-width: 0;
    }
    
    .filters {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    }
    
    .filters.active {
        max-height: 200px;
        opacity: 1;
        transition: max-height 0.3s ease-in, opacity 0.2s ease-in;
    }
    
    .filters__select {
        width: 100%;
    }
    
    .back-to-top {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
        bottom: 3.25rem;
        right: 0.75rem;
    }
    
    /* Node details stack vertically on mobile */
    .card__details {
        flex-direction: column;
    }
    
    .card__details .card__body.content-box {
        flex: 0 0 auto;
        min-width: 100%;
    }
    
    /* Map page adjustments */
    .map {
        height: calc(100vh - var(--header-height) - var(--footer-height) - 160px);
        min-height: 300px;
    }
    
    .map-legend {
        bottom: 0.5rem;
        left: 0.5rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Node map in card is shorter on mobile */
    .card__map {
        height: 180px;
    }
}

/* ========================================
   ABOUT PAGE
   ======================================== */

.about-page {
    max-width: 800px;
    margin: 0 auto;
}

/* Level 1: On the page (no card) */
.about-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.about-faq {
    margin-bottom: 1.5rem;
}

.about-q {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-q:last-child {
    margin-bottom: 0;
}

.about-q__label {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.15rem;
}

.about-q__answer {
    display: block;
}

.about-footer {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* Level 2: Outer card (shadow, no border) */
.about-page .card {
    border: none;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.about-heading {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-text-muted);
    padding-bottom: 0.5rem;
}

.about-heading--no-border {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.about-subheading {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
}

.about-page .card > p {
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.about-cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Level 3: Nested content-box (bordered) */
.about-card {
    width: 100%;
}

.about-card .card__detail-row {
    flex-direction: column;
    gap: 0;
    padding: 0.4rem 0;
}

.about-card .card__detail-label {
    flex: none;
    text-align: left;
    font-weight: bold;
    font-size: 0.8rem;
}

.about-card .card__detail-value {
    text-align: left;
}

.about-card--contact {
    max-width: 600px;
}

.about-card .card__detail-value--mono {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.about-card .card__detail-value a {
    color: var(--color-accent);
}
