:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --muted: #5f6c7b;
    --accent: #2563eb;
    --accent-2: #16a34a;
    --accent-3: #f59e0b;
    --danger: #ef4444;
    --border: #d9e2ec;
    --radius: 14px;
    --shadow: 0 12px 30px rgba(38, 51, 77, 0.15);
    font-family: "Figtree", "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: #0f172a;
}

.app {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.data-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 420px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 14px;
    z-index: 3;
}

.sidebar {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 420px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
    z-index: 3;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(120deg, #e8f0ff, #f2fbff);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.hero h1 {
    margin: 0 0 4px;
    font-size: 22px;
    letter-spacing: 0.2px;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.hero-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.section {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafbff;
}

.location-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.location-label {
    font-weight: 700;
    font-size: 15px;
}

.coords {
    font-size: 12px;
    color: var(--muted);
}

.pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: #e7f0ff;
    color: #1d4ed8;
    font-size: 12px;
    border: 1px solid var(--border);
}

.section h3 {
    margin: 0 0 10px;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.field.inline .inline-input {
    display: flex;
    gap: 8px;
}

.field label {
    color: #334155;
    font-size: 13px;
    letter-spacing: 0.3px;
}

select,
input,
button {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: #0f172a;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

select:focus,
input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button {
    cursor: pointer;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.1px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
    transition: transform 0.05s ease, box-shadow 0.05s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3);
}

button.primary {
    padding: 10px 14px;
}

button.ghost {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid var(--border);
    box-shadow: none;
}

.controls-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.layer-cards {
    display: grid;
    gap: 10px;
}

.layer-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: var(--shadow);
}

.layer-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.layer-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.layer-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.layer-card__desc {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 8px;
}

.layer-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.data-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    max-height: 70vh;
    overflow-y: auto;
}

.data-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    box-shadow: var(--shadow);
}

.data-item + .data-item {
    margin-top: 2px;
}

.data-item__title {
    font-weight: 700;
    margin-bottom: 6px;
}

.data-item__body {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.map .gm-style iframe + div { border: none !important; } /* tidy default focus */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.card {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.card h4 {
    margin: 0 0 6px;
    font-size: 15px;
}

.muted {
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.badge.danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.4);
}

.badge.success {
    color: var(--accent-2);
    border-color: rgba(22, 163, 74, 0.4);
}

.small {
    font-size: 12px;
}

.status-floating {
    position: absolute;
    right: 16px;
    top: 16px;
    background: #0f172a;
    color: #f8fafc;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 13px;
    z-index: 4;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 360px;
    }
    .data-panel {
        width: 360px;
    }
}

@media (max-width: 768px) {
    .map {
        position: relative;
        height: 60vh;
    }
    .sidebar {
        position: static;
        width: auto;
        max-height: none;
        margin: 12px;
    }
    .data-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 12px;
    }
    .app {
        padding-bottom: 12px;
    }
}
