html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app {
    display: flex;
    height: 100%;
}

#sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-right: 1px solid #ddd;
    overflow: hidden;
    transition: width 0.2s ease;
}

body.sidebar-collapsed #sidebar {
    width: 0;
    border-right: none;
}

#sidebar-title {
    padding: 10px 12px;
    font-weight: bold;
    font-size: 13px;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

#station-list {
    flex: 1;
    overflow-y: auto;
}

#map {
    flex: 1;
    height: 100%;
}

.aprs-station-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.aprs-station-item:hover {
    background: #eef2fa;
}

.aprs-station-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #999;
}

.aprs-station-dot.aprs-fresh {
    border-color: #2e9e44;
}

.aprs-station-dot.aprs-warn {
    border-color: #d9a400;
}

.aprs-station-dot.aprs-stale {
    border-color: #888;
    opacity: 0.6;
}

.aprs-station-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
}

.aprs-station-call {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aprs-station-time {
    flex-shrink: 0;
    color: #777;
    font-size: 11px;
}

.aprs-marker {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.aprs-marker.aprs-fresh {
    border-color: #2e9e44;
}

.aprs-marker.aprs-warn {
    border-color: #d9a400;
}

.aprs-marker.aprs-stale {
    border-color: #888;
    opacity: 0.6;
}

.aprs-symbol {
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
}

.aprs-symbol-default {
    background: #999;
    border-radius: 50%;
}

.aprs-arrow {
    position: absolute;
    top: -14px;
    left: 50%;
    margin-left: -6px;
    font-size: 12px;
    color: #2266cc;
    transform-origin: 50% 20px;
}

.aprs-overlay-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    min-width: 12px;
    height: 12px;
    padding: 0 2px;
    border-radius: 3px;
    background: #333;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    line-height: 12px;
    text-align: center;
}

.aprs-recenter-btn {
    display: block;
    padding: 0 10px;
    font-size: 13px;
    line-height: 26px;
    height: 26px;
    text-decoration: none;
    color: #333;
    background: #fff;
    white-space: nowrap;
}

.aprs-recenter-btn:hover {
    background: #f4f4f4;
}

.aprs-sidebar-toggle-btn {
    display: block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    font-size: 16px;
    text-decoration: none;
    color: #333;
    background: #fff;
}

.aprs-sidebar-toggle-btn:hover {
    background: #f4f4f4;
}

.aprs-legend {
    background: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    line-height: 1.6;
    color: #333;
    max-width: 200px;
}

.aprs-legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: bold;
    margin-bottom: 4px;
    cursor: pointer;
}

.aprs-legend-toggle {
    border: none;
    background: none;
    padding: 0;
    font-size: 10px;
    color: #333;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.aprs-legend.collapsed .aprs-legend-header {
    margin-bottom: 0;
}

.aprs-legend.collapsed .aprs-legend-toggle {
    transform: rotate(-90deg);
}

.aprs-legend.collapsed .aprs-legend-body {
    display: none;
}

.aprs-legend-section {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.aprs-legend-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.aprs-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.aprs-legend-empty {
    color: #888;
    font-style: italic;
}

.aprs-legend-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
}

.aprs-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #999;
    background: #fff;
}

.aprs-legend-dot.aprs-fresh {
    border-color: #2e9e44;
}

.aprs-legend-dot.aprs-warn {
    border-color: #d9a400;
}

.aprs-legend-dot.aprs-stale {
    border-color: #888;
    opacity: 0.6;
}

.aprs-legend-arrow {
    display: inline-block;
    width: 18px;
    text-align: center;
    color: #2266cc;
}

.aprs-legend-line {
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 2px solid #3388ff;
    opacity: 0.6;
}
