:root {
    color-scheme: light dark;
    --bg: #0b1220;
    --panel: #131c2e;
    --border: #263148;
    --text: #e7ecf5;
    --muted: #8b97ad;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --error: #f87171;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.navbar {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.navbar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1px;
    flex: 1;
    min-height: 0;
    background: var(--border);
}

.panel {
    background: var(--panel);
    padding: 24px;
    overflow-y: auto;
}

.subtitle {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 0.85rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 16px 0 6px;
    color: var(--text);
}

label.small {
    margin: 0 0 4px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.68rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 10px;
    background: #0d1524;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

.hint {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tab-group {
    margin-top: 4px;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 8px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-panel {
    padding-top: 4px;
}

.tab-panel[hidden] {
    display: none;
}

.empty-hint {
    color: var(--muted);
    font-size: 0.85rem;
}

button#generate-btn {
    width: 100%;
    margin-top: 24px;
    padding: 11px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

button#generate-btn:hover {
    background: var(--accent-hover);
}

button#generate-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.error {
    margin: 10px 0 0;
    color: var(--error);
    font-size: 0.82rem;
    min-height: 1em;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status {
    color: var(--muted);
    font-size: 0.9rem;
}

.status.loading {
    color: var(--accent);
}

.map-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.map-info {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.map-info strong {
    color: var(--text);
}

.download-map-btn {
    flex: 0 0 auto;
    padding: 5px 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.download-map-btn:hover {
    border-color: var(--accent);
}

.image-container {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: auto;
    background: #0d1524;
    padding: 8px;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
}
