:root {
    --bg: #f3f7f4;
    --bg-soft: #e7f0ea;
    --card: #ffffff;
    --text: #152017;
    --muted: #506054;
    --primary: #1f5f3b;
    --primary-strong: #184c2f;
    --primary-contrast: #ffffff;
    --secondary: #e7efe9;
    --ring: #8cb9a1;
    --danger: #b13a3a;
    --radius: 16px;
    --shadow: 0 12px 28px rgba(22, 38, 28, 0.08);
    --border: #d9e6de;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, #f7fbf8 0%, transparent 45%),
        radial-gradient(circle at 90% 15%, #e9f4ee 0%, transparent 38%),
        var(--bg);
}

.app {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 1rem 1.4rem;
    display: grid;
    gap: 1rem;
}

.hero {
    padding: 0.2rem 0.2rem 0;
}

.hero-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hero-logo {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(31, 95, 59, 0.24);
    flex-shrink: 0;
}

.hero h1 {
    margin: 0 0 0.2rem;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
}

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

.hero-birds {
    margin-top: 0.9rem;
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    border: 1px solid var(--border);
}

.controls {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
}

.section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.section-head h2 {
    margin: 0;
}

.section-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--bg-soft);
}

.field {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.field span {
    font-weight: 600;
    font-size: 0.95rem;
}

input {
    width: 100%;
    padding: 0.72rem 0.78rem;
    border: 1px solid #c7d8cd;
    border-radius: 10px;
    font-size: 1rem;
    background: #fcfefd;
    transition: border-color 0.15s ease;
}

input:focus,
button:focus {
    outline: 3px solid var(--ring);
    outline-offset: 1px;
}

input:hover {
    border-color: #b8cdbf;
}

.actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

button {
    border: none;
    border-radius: 10px;
    padding: 0.72rem 0.9rem;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: var(--primary-contrast);
}

.secondary {
    background: linear-gradient(180deg, var(--secondary) 0%, #dce8e1 100%);
    color: var(--text);
}

.status {
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.results h2,
.results h3,
.install h2 {
    margin-top: 0;
}

.results h3 {
    margin-bottom: 0.45rem;
}

.summary {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.summary div {
    display: grid;
    grid-template-columns: minmax(130px, auto) 1fr;
    gap: 0.4rem;
    align-items: baseline;
}

.summary dt {
    font-weight: 600;
    color: var(--muted);
}

.summary dd {
    margin: 0;
}

.links {
    margin: 0.9rem 0;
    display: grid;
    gap: 0.45rem;
}

.links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    background: #f4faf6;
    border: 1px solid var(--border);
    padding: 0.52rem 0.65rem;
    border-radius: 10px;
}

.trail-preview {
    margin-top: 0.8rem;
}

canvas {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f7faf8;
}

.map-frame {
    margin-top: 1rem;
}

#osmMap {
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

@media (min-width: 640px) {
    .app {
        padding-top: 1.4rem;
    }

    .hero-logo {
        width: 64px;
        height: 64px;
    }

    .actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 2rem;
    }

    .summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}