:root {
    --bg: #f2f5fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe3ef;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --danger: #b42318;
    --success: #027a48;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 450px at -10% -20%, rgba(37, 99, 235, 0.2), transparent 60%),
        radial-gradient(1000px 350px at 120% 0%, rgba(37, 99, 235, 0.18), transparent 58%),
        var(--bg);
}

.page {
    width: min(960px, 100% - 32px);
    margin: 0 auto;
    padding: 42px 0 64px;
}

.landing {
    max-width: 760px;
}

.hero h1,
.header h1 {
    margin: 14px 0 8px;
    font-size: clamp(1.8rem, 2.6vw, 2.3rem);
    line-height: 1.15;
}

.hero p,
.header p {
    margin: 0;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(160deg, #0f172a, #1f2937);
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.card {
    margin-top: 24px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 22px;
}

.card-elevated {
    box-shadow: var(--shadow);
}

.form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.field input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1rem;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.button {
    appearance: none;
    border: none;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--primary), var(--primary-strong));
    color: #fff;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.button:active {
    transform: translateY(0);
}

.button-secondary {
    background: #e9eefb;
    color: #1e3a8a;
}

.dashboard-layout {
    display: grid;
    gap: 8px;
}

.dashboard-header p {
    margin-top: 4px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.status {
    font-weight: 600;
    color: var(--text);
}

.status.error {
    color: var(--danger);
}

.status.success {
    color: var(--success);
}

.grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.item {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    padding: 14px;
}

.item-highlight {
    grid-column: 1 / -1;
}

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

.value {
    margin-top: 6px;
    font-weight: 600;
    font-size: 1rem;
}

.meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.chip-ok {
    background: #d1fadf;
    color: #05603a;
}

.chip-risk {
    background: #fee4e2;
    color: #b42318;
}

.history {
    display: grid;
    gap: 10px;
}

.history-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
}

.history-item:hover {
    border-color: #c4d2ea;
}

.history-meta {
    margin-top: 4px;
    font-size: 0.83rem;
    color: var(--muted);
}

.history-badges {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

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

.map-container {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #f0f0f0;
    aspect-ratio: 16 / 9;
    max-height: 360px;
}

.map-zoom-controls {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(8px);
}

.map-zoom-button {
    appearance: none;
    border: none;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.map-zoom-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.map-zoom-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.map-zoom-reset {
    width: auto;
    padding: 0 12px;
    font-size: 0.82rem;
}

.map-zoom-level {
    min-width: 54px;
    color: #fff;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.map-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.map-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0.42;
    mix-blend-mode: multiply;
}

.map-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.map-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.map-nav-left {
    left: 10px;
}

.map-nav-right {
    right: 10px;
}

.map-info {
    margin-top: 12px;
}

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

.map-counter {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.map-description {
    margin: 6px 0 0;
    font-size: 0.92rem;
}

@media (max-width: 640px) {
    .page {
        width: calc(100% - 22px);
        padding-top: 28px;
    }

    .history-item {
        flex-direction: column;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}
