:root {
    --bg-app: #edf1ec;
    --bg-sidebar: #dce4dc;
    --bg-panel: #f7f6f1;
    --bg-map-frame: #e8ede5;
    --text-main: #1f2a22;
    --text-soft: #5f6d63;
    --border-soft: #c8d1c8;
    --accent: #2f6a49;
    --accent-dark: #245338;
    --chip-bg: #e7f3ea;
    --chip-text: #2f6a49;
    --danger: #9f3f37;
    --shadow-soft: 0 8px 24px rgba(30, 50, 35, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    line-height: 1.45;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-soft);
    min-height: 100vh;
}

.sidebar-inner {
    padding: 18px;
    display: grid;
    gap: 16px;
    max-height: 100vh;
    overflow-y: auto;
}

.brand-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 2px 2px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: var(--shadow-soft);
}

.brand-title {
    font-size: 30px;
    line-height: 1;
    margin-bottom: 4px;
}

.brand-subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.panel-header {
    margin-bottom: 12px;
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
}

.locations-panel {
    padding-bottom: 18px;
}

.location-form {
    display: grid;
    gap: 12px;
}

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

.form-row {
    display: grid;
    gap: 6px;
}

.form-row label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
}

.form-row input[type="text"],
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
}

.form-row textarea {
    resize: vertical;
    min-height: 78px;
}

.checkbox-row {
    display: block;
}

.checkbox-row label {
    font-weight: 400;
    color: var(--text-main);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    border: 0;
    background: var(--accent);
    color: #ffffff;
    padding: 11px 16px;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

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

.form-errors {
    margin-bottom: 12px;
    padding: 12px 14px;
    background: #fff0ef;
    border: 1px solid #efc8c4;
    border-radius: var(--radius-sm);
    color: #7b2d26;
}

.form-errors ul {
    margin: 0;
    padding-left: 18px;
}

.empty-text {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

.location-card-list {
    display: grid;
    gap: 12px;
}

.location-card {
    background: #fcfbf7;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 14px;
}

.location-card h3 {
    margin: 0 0 4px;
    font-size: 18px;
    line-height: 1.2;
}

.favorite-star {
    color: #7e6a12;
    font-size: 15px;
    vertical-align: middle;
    margin-left: 4px;
}

.location-meta {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-soft);
}

.location-description {
    margin: 0 0 8px;
    font-size: 14px;
}

.location-coordinates {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-soft);
}

.score-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.score-chip {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 12px;
    font-weight: 700;
}

.location-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}

.danger-link {
    color: var(--danger);
}

.map-pane {
    min-width: 0;
    min-height: 100vh;
    background: var(--bg-app);
}

.map-pane-inner {
    padding: 12px;
    height: 100vh;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .sidebar-inner {
        max-height: none;
        overflow: visible;
    }

    .map-pane-inner {
        height: 70vh;
    }
}

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

    .brand-title {
        font-size: 24px;
    }
}