* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f4f4;
    color: #222;
}

body {
    overflow: hidden;
}

code {
    font-family: Consolas, Monaco, monospace;
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 6px;
}

.app {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: 100vh;
}

.panel {
    padding: 16px;
    border-right: 1px solid #ddd;
    background: #fff;
    overflow-y: auto;
}

.panel h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.muted {
    margin: 0 0 16px;
    color: #666;
    line-height: 1.5;
}

.legend {
    margin-bottom: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.legend-dot-red {
    background: #ff0000;
}

.legend-dot-green {
    background: #0a8f1f;
}

.stats {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #f8f8f8;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    margin-bottom: 16px;
}

.progress-wrap {
    margin-bottom: 16px;
}

.progress-bar {
    height: 12px;
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #ddd;
}

#progress-bar-fill {
    width: 0%;
    height: 100%;
    background: #d40000;
    transition: width 0.2s ease;
}

#status {
    margin-top: 8px;
    font-size: 14px;
    color: #444;
    line-height: 1.4;
}

.sub-status {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

button {
    border: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #222;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    opacity: 0.9;
}

.box {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    background: #fafafa;
}

.box summary {
    cursor: pointer;
    font-weight: bold;
}

#failed-list {
    margin: 10px 0 0;
    padding-left: 18px;
}

#failed-list li {
    margin-bottom: 6px;
    line-height: 1.4;
    word-break: break-word;
}

.map-wrap {
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

.popup-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.popup-list li {
    margin-bottom: 4px;
}

.leaflet-popup-content {
    line-height: 1.5;
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 70vh;
        height: auto;
        min-height: 100vh;
    }

    .panel {
        border-right: 0;
        border-bottom: 1px solid #ddd;
    }

    .map-wrap {
        min-height: 70vh;
    }
}
