* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 380px;
    background: #ffffff;
    padding: 22px;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #dc2626;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.brand h2 { margin: 0; }
.brand p { margin: 4px 0 0; color: #6b7280; font-size: 13px; }

.subtitle {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: bold; font-size: 13px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #dc2626; }

button {
    width: 100%;
    padding: 13px;
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}
button:hover { background: #b91c1c; }
button:disabled { background: #9ca3af; cursor: not-allowed; }

.history-link {
    display: block;
    text-align: center;
    margin: 12px 0;
    color: #dc2626;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
}

hr { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0; }

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.result-panel {
    flex: 1;
    background: #ffffff;
    padding: 22px;
    overflow-y: auto;
    border-top: 1px solid #e5e7eb;
}

.result-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.result-header h2 { margin: 0; }
.result-header span { color: #6b7280; font-size: 13px; }

#result { line-height: 1.7; white-space: normal; }

.summary-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
}

.metric {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #e5e7eb;
}
.metric:last-child { border-bottom: none; }
.metric b { color: #dc2626; }

.loading {
    margin-top: 12px;
    padding: 11px;
    background: #fff7ed;
    color: #9a3412;
    border-radius: 10px;
    font-size: 14px;
}
.hidden { display: none; }

.error {
    color: #b91c1c;
    background: #fee2e2;
    padding: 13px;
    border-radius: 10px;
}

.info-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 13px;
    border-radius: 10px;
    color: #374151;
}

@media (max-width: 900px) {
    .app { flex-direction: column; overflow: auto; height: auto; }
    .sidebar { width: 100%; }
    #map { height: 420px; }
    body { overflow: auto; }
    .result-header { flex-direction: column; align-items: flex-start; }
}
