:root {
    --color-navy: #122840;
    --color-navy-2: #203852;
    --color-terracotta: #c8755a;
    --color-terracotta-dark: #a95d46;
    --color-paper: #f7f2e9;
    --color-paper-2: #eee7dc;
    --color-surface: #fffdf8;
    --color-border: #e0d8ca;
    --color-text: #203246;
    --color-muted: #718093;
    --color-green: #7caa82;
    --color-green-soft: #dcebdd;
    --color-amber: #e3b75f;
    --color-amber-soft: #f6e1a0;
    --color-red: #bf5b52;
    --shadow-soft: 0 14px 34px rgba(32, 50, 70, 0.14);
    --shadow-card: 0 8px 18px rgba(32, 50, 70, 0.1);
    --radius: 8px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --bottom-nav-height: 78px;
    --z-map-controls: 420;
    --z-preview: 650;
    --z-filter-sheet: 680;
    --z-bottom-nav: 700;
    --z-modal: 850;
    --z-account-menu: 900;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--color-paper);
    color: var(--color-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

html,
body {
    overflow-x: hidden;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.84), rgba(238, 231, 220, 0.92)),
        var(--color-paper);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(200, 117, 90, 0.42);
    outline-offset: 2px;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 72px;
    padding: var(--space-3) var(--space-4);
    background: rgba(247, 242, 233, 0.92);
    border-bottom: 1px solid rgba(224, 216, 202, 0.9);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-width: 120px;
    min-height: 48px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
}

.brand-wordmark-text {
    color: var(--color-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-style: italic;
    font-weight: 900;
    line-height: 1;
}

.brand-raven-img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.brand-raven-only {
    display: none;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-word {
    color: var(--color-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 700;
    line-height: 1;
}

.brand-sub,
.eyebrow,
.meta,
.muted {
    color: var(--color-muted);
}

.brand-sub {
    margin-top: 3px;
    font-size: 0.72rem;
    font-weight: 800;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    min-width: 0;
}

.mode-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.mode-switch a {
    min-height: 34px;
    padding: var(--space-2);
    color: var(--color-muted);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 900;
}

.mode-switch a.active {
    color: #fff;
    background: var(--color-navy);
}

.nav-link,
.user-pill,
.btn,
.chip,
.chip-select,
input,
select,
textarea {
    border-radius: var(--radius);
}

.nav-link,
.user-pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 var(--space-3);
    color: var(--color-navy);
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid rgba(224, 216, 202, 0.9);
    font-size: 0.92rem;
    font-weight: 700;
}

.user-pill {
    gap: var(--space-2);
}

.user-pill {
    cursor: pointer;
}

.account-menu {
    position: relative;
}

.account-menu-panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    z-index: var(--z-account-menu);
    min-width: 160px;
    padding: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

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

.account-menu-panel a {
    display: block;
    min-height: 40px;
    padding: var(--space-2) var(--space-3);
    border-radius: 6px;
    font-weight: 900;
}

.account-menu-panel a:hover,
.account-menu-panel a:focus-visible {
    background: var(--color-paper-2);
}

.avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #fff;
    background: var(--color-terracotta);
    border-radius: 999px;
    font-size: 0.85rem;
}

.panel,
.hero {
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid rgba(224, 216, 202, 0.86);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.hero {
    padding: var(--space-5);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(18, 40, 64, 0.98) 0%, rgba(18, 40, 64, 0.98) 64%, rgba(200, 117, 90, 0.32) 64%),
        var(--color-navy);
    border-color: rgba(18, 40, 64, 0.2);
}

.hero.compact {
    max-width: 920px;
    margin: var(--space-5) auto 0;
}

.hero .eyebrow {
    color: rgba(255, 255, 255, 0.68);
}

.eyebrow {
    margin-bottom: var(--space-2);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

h1,
h2,
h3,
.title {
    color: var(--color-navy);
    line-height: 1.08;
}

.hero h1 {
    max-width: 620px;
    margin-bottom: var(--space-3);
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.15rem;
}

.hero p {
    max-width: 620px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 var(--space-4);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.1;
}

.btn.primary {
    color: #fff;
    background: var(--color-terracotta);
    box-shadow: 0 8px 16px rgba(200, 117, 90, 0.25);
}

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

.btn.secondary {
    color: var(--color-navy);
    background: #fff;
    border-color: var(--color-border);
}

.btn.ghost {
    color: var(--color-navy);
    background: rgba(255, 255, 255, 0.68);
    border-color: var(--color-border);
}

.btn.danger {
    color: #fff;
    background: var(--color-red);
}

.map-layout {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4);
}

.home-layout {
    display: grid;
    gap: var(--space-4);
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--space-4);
}

.home-search {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
}

.home-search h1 {
    margin-bottom: 0;
    color: var(--color-navy);
    font-size: clamp(1.2rem, 5vw, 1.8rem);
}

.home-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.home-action-card,
.mood-choice,
.music-mood,
.mini-card {
    border-radius: var(--radius);
}

.home-action-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: var(--space-3);
    min-height: 82px;
    padding: var(--space-3);
    color: var(--color-navy);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    font-weight: 950;
    text-align: left;
    cursor: pointer;
}

.home-action-card span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    background: var(--color-green-soft);
    border-radius: var(--radius);
    font-size: 1.15rem;
}

.home-action-card.music span {
    background: #d9e7f0;
}

.home-section {
    display: grid;
    gap: var(--space-3);
}

.mood-grid,
.music-mood-list {
    display: grid;
    gap: var(--space-2);
}

.mood-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.mood-choice,
.music-mood {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
}

.mood-choice {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    min-height: 0;
}

.mood-choice > span[aria-hidden="true"] {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    background: var(--color-green-soft);
    border-radius: 10px;
}

.mood-choice-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mood-choice-copy strong,
.mood-choice-copy small {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.mood-choice.active,
.music-mood.active {
    border-color: var(--color-terracotta);
    box-shadow: 0 0 0 2px rgba(200, 117, 90, 0.16);
}

.music-mood {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
}

.music-mood small {
    grid-column: 2;
    color: var(--color-muted);
    font-weight: 700;
}

.music-mood.disabled {
    opacity: 0.68;
}

.recommendation-card {
    display: grid;
    grid-template-columns: minmax(160px, 0.36fr) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    padding: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.recommendation-photo {
    display: block;
    overflow: hidden;
    min-height: 100%;
    background: #fff;
}

.recommendation-photo > img,
.mini-card > img,
.result-image > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommendation-photo > img,
.recommendation-photo > .photo-placeholder {
    aspect-ratio: 16 / 9;
}

.recommendation-copy {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(255, 253, 248, 0.98);
}

.recommendation-copy .preview-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recommendation-photo .photo-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
}

.title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.rating-stack {
    display: grid;
    justify-items: center;
    min-width: 78px;
    padding: var(--space-2);
    color: #fff;
    background: var(--color-navy);
    border-radius: var(--radius);
}

.recommendation-reason {
    margin: 0;
    color: var(--color-navy);
    font-weight: 850;
}

.rating-stack strong {
    font-size: 1.35rem;
    line-height: 1;
}

.rating-stack span {
    font-size: 0.72rem;
    font-weight: 900;
}

.mini-carousel,
.horizontal-cards {
    display: grid;
    grid-auto-columns: minmax(170px, 220px);
    grid-auto-flow: column;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-1);
    scroll-snap-type: x proximity;
}

.mini-card {
    display: grid;
    gap: var(--space-2);
    min-height: 100%;
    padding: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    scroll-snap-align: start;
}

.mini-card > img,
.mini-card > .thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 0;
    border-radius: 6px;
}

.mini-card span:not(.thumb) {
    color: var(--color-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.home-map-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
}

.map-hero {
    min-width: 0;
}

.map-modebar {
    position: sticky;
    top: 73px;
    z-index: 390;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: var(--space-2);
    background: rgba(247, 242, 233, 0.92);
    border: 1px solid rgba(224, 216, 202, 0.88);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
}

.result-count {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.location-cta-row {
    display: flex;
    justify-content: flex-start;
}

.location-cta {
    display: inline-flex;
    gap: var(--space-2);
    width: auto;
    min-height: 42px;
    background: var(--color-terracotta);
}

.location-cta[hidden] {
    display: none;
}

.active-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.mood-chip,
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 34px;
    padding: 0 var(--space-2);
    color: var(--color-navy);
    background: #fff;
    border: 1px solid rgba(200, 117, 90, 0.38);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 900;
}

.filter-chip {
    max-width: 100%;
}

.filter-chip span:nth-last-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sort-form {
    min-width: min(100%, 260px);
    margin-left: auto;
}

.list-sort-form {
    width: 100%;
    max-width: 360px;
    margin: 0 0 var(--space-3);
}

.list-sort-form label {
    display: grid;
    gap: var(--space-1);
    color: var(--color-navy);
    font-size: 0.86rem;
    font-weight: 900;
}

.search-trigger-row,
.map-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.search-trigger-row {
    justify-content: space-between;
}

.map-inline-actions {
    margin-top: var(--space-3);
}

.map-layout.show-list-only .main-map,
.map-layout:not(.show-list-only) .list-panel {
    display: none;
}

.map-layout.show-list-only .view-map-location,
.map-layout:not(.show-list-only) .view-list-location {
    display: none;
}

.page-panel,
.form-panel,
.metric-panel {
    padding: var(--space-4);
}

.search-panel {
    min-width: 0;
}

.filter-sheet {
    padding: var(--space-4);
}

.filter-sheet-backdrop {
    display: none;
}

.filter-sheet-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.filter-sheet-head h2,
.filter-sheet-head p {
    margin-bottom: 0;
}

.searchrow,
.toolbar-form {
    display: grid;
    gap: var(--space-2);
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-3);
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
}

textarea {
    min-height: 120px;
    padding-top: var(--space-3);
    resize: vertical;
}

.chips,
.tags,
.scoreline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chips {
    margin-top: var(--space-3);
}

.chip,
.chip-select,
.tag {
    min-height: 36px;
    padding: 0 var(--space-3);
    color: var(--color-navy);
    background: #fff;
    border: 1px solid var(--color-border);
    font-size: 0.88rem;
    font-weight: 700;
}

.chip,
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.chip input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.tag {
    background: var(--color-green-soft);
    border-color: transparent;
}

.tag.bad {
    color: #7b302b;
    background: #f2d7cf;
}

.list-panel .head,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.list-panel h2,
.page-panel h2,
.form-section h2,
.metric-panel h2,
.chmantis-tile h2 {
    margin-bottom: var(--space-3);
    font-size: 1.05rem;
}

.cards,
.admin-list {
    display: grid;
    gap: var(--space-3);
}

.card {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    color: var(--color-text);
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.card-main {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: var(--space-3);
    min-width: 0;
}

.card:hover,
.card.is-selected {
    border-color: rgba(200, 117, 90, 0.62);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.result-card {
    grid-template-columns: minmax(112px, 0.24fr) minmax(0, 1fr) minmax(136px, 0.24fr);
    align-items: stretch;
    overflow: hidden;
}

.result-image {
    position: relative;
    display: block;
    min-height: 132px;
    overflow: hidden;
    border-radius: var(--radius);
}

.result-image .thumb {
    height: 100%;
    min-height: 132px;
}

.result-copy {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    min-width: 0;
}

.result-copy .title {
    color: var(--color-navy);
    font-size: 1.08rem;
}

.result-copy p {
    margin-bottom: 0;
}

.result-score {
    display: grid;
    align-content: start;
    gap: var(--space-2);
}

.result-score strong {
    width: fit-content;
    min-width: 64px;
    padding: var(--space-2);
    color: #fff;
    background: var(--color-navy);
    border-radius: var(--radius);
    font-size: 1.45rem;
    line-height: 1;
    text-align: center;
}

.result-score span,
.result-score em {
    color: var(--color-muted);
    font-style: normal;
    font-size: 0.82rem;
    font-weight: 900;
}

.card-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.card-action-row .btn {
    min-height: 44px;
    justify-content: center;
    padding-inline: var(--space-3);
}

.thumb,
.photo {
    background:
        linear-gradient(135deg, #8ba0ad 0 50%, #a6b893 50% 70%, #d7b57a 70%),
        #d8c9b2;
    border-radius: var(--radius);
}

.photo-placeholder {
    display: grid;
    gap: var(--space-2);
    place-items: center;
    min-width: 0;
    overflow: hidden;
    padding: var(--space-3);
    color: var(--color-muted);
    background:
        linear-gradient(135deg, rgba(139, 160, 173, 0.28) 0 50%, rgba(166, 184, 147, 0.28) 50% 70%, rgba(215, 181, 122, 0.28) 70%),
        #fff;
    font-weight: 900;
    text-align: center;
}

.photo-placeholder .photo-placeholder-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    opacity: 0.82;
}

img[hidden],
[data-photo-placeholder][hidden] {
    display: none !important;
}

.thumb {
    min-height: 72px;
    width: 100%;
    object-fit: cover;
}

.title {
    margin-bottom: 3px;
    font-weight: 900;
}

.meta {
    margin-bottom: var(--space-2);
    font-size: 0.88rem;
}

.score,
.quiet {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 var(--space-2);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
}

.score {
    color: #fff;
    background: var(--color-navy);
}

.quiet {
    color: #365a38;
    background: var(--color-green-soft);
}

.distance {
    min-height: 28px;
    color: var(--color-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.main-map {
    position: relative;
    min-height: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
}

.modal-open {
    overflow: hidden;
}

.info-button {
    width: 44px;
    padding: 0;
    border-radius: 999px;
}

.seg {
    display: inline-flex;
    padding: 3px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.seg button {
    min-height: 38px;
    padding: 0 var(--space-3);
    color: var(--color-muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 900;
}

.seg button.active {
    color: #fff;
    background: var(--color-navy);
}

.floating {
    min-height: 42px;
    padding: 0 var(--space-3);
    color: var(--color-navy);
    background: rgba(255, 253, 248, 0.95);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    font-weight: 800;
}

.leaflet-shell,
.edit-map {
    min-height: 420px;
    height: min(62vh, 620px);
    overflow: hidden;
    background: #d8dfd1;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.leaflet-tile-pane {
    opacity: 0.96;
    filter: saturate(0.78) sepia(0.07) hue-rotate(-4deg) brightness(1.025) contrast(0.94);
}

.leaflet-control-zoom.leaflet-bar {
    overflow: hidden;
    border: 1px solid rgba(18, 40, 64, 0.18);
    border-radius: var(--radius);
    box-shadow: 0 6px 16px rgba(18, 40, 64, 0.14);
}

.leaflet-control-zoom.leaflet-bar a {
    color: var(--color-navy);
    background: rgba(255, 253, 248, 0.94);
    border-bottom-color: rgba(18, 40, 64, 0.12);
    font-weight: 800;
}

.leaflet-control-zoom.leaflet-bar a:hover,
.leaflet-control-zoom.leaflet-bar a:focus {
    color: var(--color-terracotta-dark);
    background: var(--color-paper);
}

.leaflet-control-attribution {
    color: #68747d;
    background: rgba(247, 242, 233, 0.86) !important;
    font-size: 10px;
    backdrop-filter: blur(5px);
}

.leaflet-control-attribution a {
    color: #41596c;
}

.leaflet-control-container {
    position: relative;
    z-index: var(--z-map-controls);
}

.map-mood-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    align-items: center;
    gap: var(--space-3);
}

.map-mood-strip h1 {
    margin-bottom: var(--space-1);
    font-size: clamp(1.35rem, 5vw, 2rem);
}

.map-mood-strip p {
    margin: 0;
}

.marker-preview {
    position: absolute;
    right: var(--space-3);
    bottom: var(--space-3);
    left: var(--space-3);
    z-index: var(--z-preview);
    max-height: min(58vh, 430px);
    overflow: auto;
    padding: var(--space-3);
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid rgba(200, 117, 90, 0.26);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(18, 40, 64, 0.16);
    backdrop-filter: blur(8px) saturate(0.9);
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transform-origin: var(--preview-origin-x, 50%) var(--preview-origin-y, 100%);
    transition: opacity 150ms ease, transform 150ms ease;
}

.marker-preview.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.preview-summary {
    display: grid;
    grid-template-columns: minmax(118px, 0.34fr) minmax(0, 1fr);
    gap: var(--space-3);
    align-items: stretch;
}

.preview-summary .preview-carousel {
    height: 100%;
    min-height: 132px;
    max-height: 220px;
}

.preview-summary .preview-copy {
    display: grid;
    align-content: start;
    gap: var(--space-2);
    min-width: 0;
}

.preview-control-area {
    position: sticky;
    top: 0;
    z-index: calc(var(--z-preview) + 2);
    display: flex;
    justify-content: flex-end;
    height: 0;
    pointer-events: none;
}

.preview-close {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--color-navy);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    font-weight: 900;
    pointer-events: auto;
    touch-action: manipulation;
}

.preview-postit {
    position: relative;
    align-self: start;
    width: fit-content;
    max-width: min(100%, 22rem);
    margin: 0;
    padding: var(--space-3);
    background: #f7e8a7;
    border: 1px solid rgba(184, 139, 43, 0.22);
    border-radius: 6px 8px 12px 8px;
    box-shadow: 0 10px 16px rgba(96, 68, 20, 0.12);
    font-weight: 700;
    line-height: 1.42;
    transform: rotate(-1deg);
}

.preview-postit::before,
.detail-postit-primary::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 18px;
    width: 54px;
    height: 14px;
    background: rgba(255, 253, 248, 0.62);
    border: 1px solid rgba(224, 216, 202, 0.42);
    transform: rotate(-3deg);
}

.preview-postit strong,
.preview-postit span {
    display: block;
}

.preview-postit strong {
    margin-bottom: var(--space-1);
    color: #604414;
    font-family: Georgia, "Times New Roman", serif;
}

.preview-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.preview-copy h2 {
    margin: 0;
    padding-right: 46px;
    font-size: 1.05rem;
}

.preview-copy .meta {
    margin: 0;
}

.preview-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.preview-metrics span {
    display: grid;
    min-width: 88px;
    padding: var(--space-2);
    color: var(--color-muted);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.76rem;
    font-weight: 900;
}

.preview-metrics strong {
    color: var(--color-navy);
    font-size: 1.12rem;
}

.preview-fact-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.preview-fact-row span {
    padding: 4px 7px;
    color: var(--color-navy);
    background: var(--color-green-soft);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 850;
}

.preview-facts {
    display: grid;
    grid-template-columns: minmax(86px, 0.42fr) 1fr;
    gap: var(--space-1) var(--space-2);
    margin: var(--space-2) 0;
    font-size: 0.9rem;
}

.preview-facts dt {
    color: var(--color-muted);
    font-weight: 800;
}

.preview-facts dd {
    margin: 0;
    min-width: 0;
}

.preview-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) repeat(2, 44px);
    gap: var(--space-2);
    align-items: stretch;
}

.preview-actions .btn {
    min-height: 44px;
    justify-content: center;
}

.preview-chmantis {
    margin: 0;
    padding: var(--space-3);
    transform: none;
}

.photo-carousel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, #8ba0ad 0 50%, #a6b893 50% 70%, #d7b57a 70%),
        #d8c9b2;
    border-radius: var(--radius);
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    scroll-snap-align: start;
}

.carousel-slide > img,
.carousel-slide > .photo-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}

.carousel-control {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--color-navy);
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 900;
    transform: translateY(-50%);
}

.carousel-control.prev {
    left: var(--space-2);
}

.carousel-control.next {
    right: var(--space-2);
}

.carousel-dots {
    position: absolute;
    right: var(--space-3);
    bottom: var(--space-3);
    left: var(--space-3);
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    pointer-events: none;
}

.carousel-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(18, 40, 64, 0.22);
    border-radius: 999px;
    cursor: pointer;
    pointer-events: auto;
}

.carousel-dots button.active {
    background: #fff;
    border-color: var(--color-navy);
}

.preview-carousel {
    height: clamp(150px, 32vh, 240px);
}

.preview-carousel .carousel-track,
.preview-carousel .carousel-slide {
    height: 100%;
}

.edit-map {
    min-height: 320px;
    margin-bottom: var(--space-3);
}

.score-marker {
    position: relative;
    width: 90px;
    height: 64px;
    pointer-events: auto;
    --marker-lift: 0px;
}

.score-marker-label {
    position: absolute;
    bottom: 18px;
    left: 50%;
    z-index: 2;
    display: grid;
    min-width: 42px;
    min-height: 30px;
    padding: 0 6px;
    place-items: center;
    color: var(--color-navy);
    background: rgba(255, 250, 240, 0.96);
    border: 2px solid var(--color-navy);
    border-radius: 6px;
    box-shadow: 0 5px 13px rgba(18, 40, 64, 0.22);
    font-size: 0.78rem;
    font-weight: 950;
    line-height: 1;
    transform: translateX(calc(-50% + var(--label-x, 0px))) translateY(calc(var(--label-y, 0px) - var(--marker-lift)));
    transition: color 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.score-marker-point {
    position: absolute;
    bottom: 0;
    left: 50%;
    z-index: 3;
    width: 11px;
    height: 11px;
    background: var(--color-navy);
    border: 2px solid var(--color-surface);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(18, 40, 64, 0.38);
    transform: translateX(-50%);
}

.score-marker-leader {
    position: absolute;
    bottom: 5px;
    left: 50%;
    z-index: 1;
    width: var(--leader-length, 13px);
    height: 1px;
    background: rgba(18, 40, 64, 0.58);
    transform: rotate(var(--leader-angle, -90deg));
    transform-origin: 0 50%;
}

.score-marker.is-draft .score-marker-label,
.score-marker.is-draft .score-marker-point {
    background: #b58a43;
}

.score-marker.is-draft .score-marker-label {
    color: #fffdf8;
    border-color: #fffdf8;
}

.score-marker.is-disabled .score-marker-label,
.score-marker.is-disabled .score-marker-point {
    background: var(--color-muted);
}

.score-marker.is-disabled .score-marker-label {
    color: #fff;
    border-color: rgba(255, 253, 248, 0.9);
}

.score-marker.is-unrated:not(.is-draft):not(.is-disabled) .score-marker-label {
    color: #874732;
    background: #f2ddd3;
    border-color: #fffdf8;
}

.score-marker.is-unrated:not(.is-draft):not(.is-disabled) .score-marker-point {
    background: var(--color-terracotta-dark);
}

.score-marker.is-selected .score-marker-label,
.score-marker.is-selected .score-marker-point {
    background: var(--color-terracotta);
}

.score-marker.is-selected .score-marker-label {
    color: #fffdf8;
    border-color: #fffdf8;
    box-shadow: 0 0 0 3px rgba(200, 117, 90, 0.24), 0 8px 20px rgba(18, 40, 64, 0.35);
}

.score-marker.is-selected .score-marker-point {
    width: 15px;
    height: 15px;
    box-shadow: 0 0 0 4px rgba(200, 117, 90, 0.24);
    transform: translate(-50%, 2px);
}

.leaflet-marker-icon:hover .score-marker,
.leaflet-marker-icon:focus .score-marker {
    --marker-lift: 2px;
}

.leaflet-marker-icon:hover .score-marker-label,
.leaflet-marker-icon:focus .score-marker-label {
    border-color: var(--color-terracotta);
    box-shadow: 0 0 0 3px rgba(200, 117, 90, 0.15), 0 7px 17px rgba(18, 40, 64, 0.26);
}

.leaflet-marker-icon:focus {
    outline: none;
}

.collection-actions,
.personal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.collection-counts {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.collection-actions {
    grid-column: 1 / -1;
}

.collection-icon-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.collection-icon-actions form {
    margin: 0;
}

.collection-highlight,
.collection-tip {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: var(--space-2);
    background: rgba(248, 222, 146, 0.42);
    border: 1px solid rgba(177, 119, 22, 0.2);
    border-radius: 8px;
    color: var(--color-navy);
    font-size: 0.86rem;
}

.collection-highlight span {
    color: #b17716;
    font-size: 1.05rem;
    letter-spacing: 0;
}

.collection-tip {
    background: rgba(255, 253, 248, 0.82);
}

.collection-empty-state {
    display: grid;
    gap: var(--space-3);
    justify-items: start;
    padding: var(--space-4);
    background: rgba(255, 253, 248, 0.86);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.collection-empty-state h3,
.collection-empty-state p {
    margin: 0;
}

.collection-empty-state h3 {
    color: var(--color-navy);
    font-size: 1.15rem;
}

.collection-empty-photo {
    width: min(100%, 280px);
    aspect-ratio: 4 / 3;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.collection-actions form,
.personal-actions form {
    margin: 0;
}

.btn.is-active {
    color: #fff;
    background: var(--color-navy);
}

.collection-error {
    position: fixed;
    right: var(--space-3);
    bottom: calc(var(--bottom-nav-height) + var(--space-3));
    z-index: var(--z-modal);
    max-width: min(92vw, 360px);
    padding: var(--space-3);
    color: #7b302b;
    background: #f7e1dc;
    border: 1px solid rgba(191, 91, 82, 0.32);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    font-weight: 800;
}

.bottomnav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-bottom-nav);
    display: flex;
    gap: var(--space-2);
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    padding:
        var(--space-2)
        max(var(--space-3), env(safe-area-inset-right))
        calc(var(--space-2) + env(safe-area-inset-bottom))
        max(var(--space-3), env(safe-area-inset-left));
    background: rgba(255, 253, 248, 0.96);
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    scroll-padding-inline: var(--space-3);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.bottomnav::-webkit-scrollbar {
    display: none;
}

.bottomnav a {
    display: grid;
    flex: 0 0 auto;
    min-width: 76px;
    min-height: 54px;
    place-items: center;
    padding: var(--space-1) var(--space-2);
    color: var(--color-muted);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 900;
    scroll-snap-align: center;
    white-space: nowrap;
}

.bottomnav a span:first-child {
    font-size: 1rem;
    line-height: 1;
}

.bottomnav a span:last-child {
    line-height: 1;
}

.bottomnav a.active {
    color: #fff;
    background: var(--color-navy);
}

.dashboard-layout,
.edit-layout,
.detail-page,
.login-layout {
    padding: var(--space-4);
}

.dashboard-layout,
.edit-layout,
.detail-page {
    display: grid;
    gap: var(--space-4);
}

.toolbar-form {
    margin-bottom: var(--space-4);
}

.admin-row {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.row-actions,
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.row-actions form,
.inline-form {
    margin: 0;
}

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

.duplicate-box summary {
    min-height: 36px;
    cursor: pointer;
    font-weight: 800;
}

.form-panel {
    display: grid;
    gap: var(--space-5);
    max-width: 920px;
    margin: 0 auto var(--space-6);
}

.filter-groups,
.rating-filter-list,
.access-rule-editor,
.chantal-accordion {
    display: grid;
    gap: var(--space-3);
}

.filter-groups {
    margin-top: var(--space-3);
}

.filter-group,
.accordion-panel {
    padding: var(--space-3);
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.filter-group.primary-filter {
    border-color: rgba(124, 170, 130, 0.7);
    background: rgba(220, 235, 221, 0.5);
}

.filter-group > summary,
.accordion-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    cursor: pointer;
    color: var(--color-navy);
    font-weight: 950;
}

.filter-group > summary strong,
.accordion-panel > summary span {
    min-width: 28px;
    min-height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--color-navy);
    border-radius: 999px;
    font-size: 0.78rem;
}

.filter-actions {
    display: grid;
    gap: var(--space-2);
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: var(--space-2);
    font-weight: 800;
}

.toggle-row input {
    width: auto;
    min-height: 0;
}

.rating-filter-list label {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.2fr) 42px;
    align-items: center;
    gap: var(--space-2);
}

.rating-filter-list input[type="range"] {
    padding: 0;
}

.access-rule-row {
    border-color: rgba(200, 117, 90, 0.34);
}

.access-explanation[hidden] {
    display: none;
}

.session-location-card {
    position: sticky;
    top: 73px;
    z-index: 390;
    display: grid;
    gap: var(--space-3);
    margin: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 253, 248, 0.98);
    border: 1px solid rgba(200, 117, 90, 0.34);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.session-location-card.compact {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    margin: var(--space-2) var(--space-3);
    padding: var(--space-2);
}

.session-location-card p {
    margin-bottom: 0;
}

.session-location-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.good {
    color: #315c37;
}

.location-sheet[hidden] {
    display: none;
}

.location-sheet {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    align-items: end;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    align-items: end;
    padding: var(--space-3);
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
    background: rgba(18, 40, 64, 0.34);
}

.mood-dialog {
    position: relative;
    display: grid;
    gap: var(--space-3);
    width: min(100%, 520px);
    max-height: min(82vh, 680px);
    margin: 0 auto;
    overflow: auto;
    padding: var(--space-4);
    background: rgba(255, 253, 248, 0.98);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.delete-dialog {
    max-width: 520px;
}

.delete-summary {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-3);
    color: var(--color-navy);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
}

.modal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: var(--space-3);
    align-items: start;
}

.modal-head h2 {
    margin-bottom: var(--space-1);
    font-size: 1.22rem;
}

.mood-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.mood-grid.compact .mood-choice {
    min-height: 0;
    align-content: start;
}

.mood-choice small {
    color: var(--color-muted);
    font-weight: 700;
    line-height: 1.28;
}

.location-panel {
    display: grid;
    gap: var(--space-3);
}

.form-section {
    display: grid;
    gap: var(--space-3);
}

details.form-section {
    padding: var(--space-3);
    background: rgba(255, 253, 248, 0.72);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

details.form-section > summary {
    min-height: 44px;
    cursor: pointer;
    color: var(--color-navy);
    font-size: 1.02rem;
    font-weight: 900;
}

details.form-section[open] > summary {
    margin-bottom: var(--space-3);
}

.section-tabs {
    display: flex;
    position: sticky;
    top: 84px;
    z-index: 360;
    flex-wrap: nowrap;
    gap: var(--space-2);
    max-width: 100%;
    overflow-x: auto;
    padding: var(--space-2);
    background: rgba(247, 242, 233, 0.94);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.section-tabs a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: var(--space-2) var(--space-3);
    color: var(--color-navy);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-weight: 800;
}

.section-tabs a.active {
    color: #fff;
    background: var(--color-navy);
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.help,
.caution {
    padding: var(--space-3);
    border-radius: var(--radius);
    font-weight: 800;
}

.help {
    color: var(--color-muted);
    background: #fff;
    border: 1px solid var(--color-border);
}

.caution {
    color: #76561c;
    background: #f5e6bd;
}

.repeat-list,
.fact-editor-grid,
.photo-actions {
    display: grid;
    gap: var(--space-3);
}

.repeat-card {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.seat-editor {
    background: rgba(247, 242, 233, 0.72);
}

.fact-editor {
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
}

.fact-editor.pro {
    border-color: rgba(124, 170, 130, 0.56);
}

.fact-editor.contra {
    border-color: rgba(191, 91, 82, 0.42);
}

.form-grid {
    display: grid;
    gap: var(--space-3);
}

label span {
    display: block;
    margin-bottom: var(--space-1);
    color: var(--color-navy);
    font-size: 0.86rem;
    font-weight: 800;
}

label {
    min-width: 0;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.checkbox-row label,
label.checkbox-row {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: var(--space-2);
    font-weight: 800;
}

.checkbox-row input,
label.checkbox-row input {
    width: auto;
    min-height: 0;
}

.accuracy-pill,
.alert {
    min-height: 40px;
    padding: var(--space-3);
    border-radius: var(--radius);
    font-weight: 800;
}

.alert.good {
    color: #315c37;
    background: var(--color-green-soft);
}

.accuracy-pill {
    color: var(--color-muted);
    background: #fff;
    border: 1px solid var(--color-border);
}

.accuracy-pill.good {
    color: #315c37;
    background: var(--color-green-soft);
}

.rating-grid {
    display: grid;
    gap: var(--space-3);
}

.rating-summary,
.photo-message {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.photo-message[hidden] {
    display: none;
}

.rating-card {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.rating-card.is-unrated {
    border-style: dashed;
}

.rating-card input[type="range"] {
    padding: 0;
}

.rating-controls {
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    gap: var(--space-2);
}

.accuracy-pill.warn {
    color: #76561c;
    background: #f5e6bd;
}

.accuracy-pill.bad,
.alert {
    color: #7b302b;
    background: #f2d7cf;
}

.clear-state {
    min-height: 32px;
    margin-left: var(--space-2);
    color: #7b302b;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(123, 48, 43, 0.18);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
}

.sticky-actions {
    position: sticky;
    bottom: var(--space-3);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2);
    background: rgba(255, 253, 248, 0.96);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.detail-intro,
.detail-summary-card {
    min-width: 0;
}

.detail-intro {
    display: grid;
    gap: 0;
}

.detail-carousel {
    height: clamp(220px, 38vh, 380px);
    border-radius: var(--radius) var(--radius) 0 0;
}

.detail-carousel .carousel-track,
.detail-carousel .carousel-slide {
    height: 100%;
}

.detail-summary-card {
    display: grid;
    gap: var(--space-3);
    margin-top: -1px;
    padding: var(--space-4);
    border-radius: 0 0 var(--radius) var(--radius);
}

.detail-title-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 0.28fr);
    align-items: start;
    gap: var(--space-3);
}

.detail-title-grid .chmantis-tile {
    justify-self: end;
    width: min(38vw, 156px);
    min-width: 132px;
    min-height: 0;
    margin: 0;
    padding: var(--space-3);
}

.detail-summary-card h1 {
    margin-bottom: 0;
    font-size: clamp(1.45rem, 8vw, 2.15rem);
}

.summary-metrics,
.status-chips,
.compact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.summary-metrics span {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-1);
    min-height: 34px;
    padding: 0 var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.summary-metrics strong {
    color: var(--color-navy);
    font-size: 1rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 var(--space-2);
    color: var(--color-navy);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
}

.status-chip.good {
    color: #365a38;
    background: var(--color-green-soft);
    border-color: transparent;
}

.status-chip.bad {
    color: #7b302b;
    background: #f2d7cf;
    border-color: transparent;
}

.compact-facts {
    display: grid;
    grid-template-columns: minmax(110px, 0.45fr) minmax(0, 1fr);
    gap: var(--space-2);
    margin: 0;
}

.compact-facts dt {
    color: var(--color-muted);
    font-weight: 800;
}

.compact-facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.action-row form {
    margin: 0;
}

.icon-action {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--color-navy);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 900;
}

.icon-action.is-active,
.icon-action:hover {
    color: #fff;
    background: var(--color-navy);
    border-color: var(--color-navy);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.main-photo,
.gallery-strip img,
.photo-admin-preview > img,
.photo-admin-preview > .photo-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-photo-placeholder {
    display: grid;
    gap: var(--space-2);
    min-height: 180px;
    place-items: center;
    padding: var(--space-3);
    color: var(--color-muted);
    background: rgba(255, 253, 248, 0.78);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    font-weight: 900;
    text-align: center;
}

.gallery-panel {
    padding: var(--space-4);
}

.gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--space-2);
}

.gallery-strip a {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.criteria-list {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.criteria-list span {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.procontra-grid {
    display: grid;
    gap: var(--space-3);
}

.fact-list-card {
    padding: var(--space-3);
    border-radius: var(--radius);
}

.fact-list-card.pro {
    background: var(--color-green-soft);
}

.fact-list-card.contra {
    background: #f2d7cf;
}

.fact-list-card ul {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding-left: 18px;
}

.fact-list-card li span,
.seat-list-public span {
    display: block;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.fact-list.compact {
    margin-bottom: var(--space-3);
}

.seat-list-public {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding-left: 18px;
}

.photo-panel {
    gap: var(--space-4);
}

.upload-row {
    display: grid;
    gap: var(--space-3);
}

.photo-grid {
    display: grid;
    gap: var(--space-3);
}

.photo-admin-card {
    position: relative;
    display: grid;
    gap: var(--space-2);
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.drag-handle {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--color-navy);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: grab;
    font-weight: 900;
}

.photo-card-actions,
.delete-row,
.selected-file {
    display: grid;
    gap: var(--space-2);
}

.photo-card-actions .btn,
.delete-row .btn {
    min-width: 0;
    justify-content: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.selected-files {
    display: grid;
    gap: var(--space-2);
}

.selected-file {
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.selected-file progress {
    width: 100%;
}

.crop-box {
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.crop-box summary {
    min-height: 36px;
    cursor: pointer;
    font-weight: 900;
}

.crop-preview {
    position: relative;
    overflow: hidden;
    margin: var(--space-2) 0;
    border-radius: var(--radius);
    cursor: crosshair;
}

.crop-preview > img,
.crop-preview > .photo-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.crop-target {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--color-terracotta);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.photo-admin-preview {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: #fffdf8;
}

.photo-role-label {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 0 var(--space-2);
    color: var(--color-muted);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
}

.photo-role-label.is-main {
    color: #fff;
    background: var(--color-navy);
    border-color: var(--color-navy);
}

.photo-grid-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-start;
}

.photo-grid-actions .btn {
    width: auto;
    min-width: min(100%, 220px);
}

.editor-empty-photo {
    width: min(100%, 260px);
    aspect-ratio: 4 / 3;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.detail-grid {
    display: grid;
    gap: var(--space-4);
}

.detail-page,
.detail-grid,
.detail-grid > *,
.detail-intro > *,
.preview-copy,
.card-main > div {
    min-width: 0;
}

.detail-page,
.detail-page p,
.detail-page dd,
.detail-page li,
.marker-preview,
.card {
    overflow-wrap: anywhere;
}

.mode-simple .extended-only,
body:not(.mode-developer) .developer-only {
    display: none !important;
}

.chantal-reduced-editor .advanced-only {
    display: none !important;
}

.chantal-reduced-editor .hero.compact {
    display: none;
}

.chantal-reduced-editor .form-panel {
    max-width: 760px;
}

.fact-list {
    display: grid;
    grid-template-columns: minmax(110px, 0.42fr) 1fr;
    gap: var(--space-2) var(--space-3);
    margin: 0 0 var(--space-5);
}

.fact-list dt {
    color: var(--color-muted);
    font-weight: 800;
}

.fact-list dd {
    margin: 0;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
}

.metric {
    display: grid;
    gap: 2px;
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.metric strong {
    color: var(--color-navy);
    font-size: 1.35rem;
}

.metric span {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.chmantis-tile {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: var(--space-2);
    aspect-ratio: 1 / 1;
    width: min(100%, 160px);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    color: #442b0d;
    text-align: center;
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 250, 212, 0.9), rgba(240, 202, 105, 0.92) 66%, rgba(212, 160, 53, 0.96)),
        #f0cc6b;
    border: 2px solid #b87c17;
    outline: 1px solid rgba(255, 253, 248, 0.72);
    outline-offset: -7px;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(96, 68, 20, 0.16), inset 0 1px 0 rgba(255, 253, 248, 0.68);
    transform: rotate(-0.5deg);
}

.chmantis-tile:empty {
    display: none;
}

.chmantis-tile h2 {
    margin-bottom: var(--space-1);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(0.9rem, 4.8vw, 1.08rem);
    line-height: 1.08;
}

.chmantis-tile p {
    margin-bottom: 0;
    color: #604414;
    font-weight: 800;
}

.chmantis-stars {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    color: #b07713;
    font-size: 1.55rem;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 253, 248, 0.55);
}

.chmantis-stars .active {
    color: #b07713;
}

.chmantis-note {
    display: grid;
    gap: var(--space-1);
    padding-top: var(--space-2);
    border-top: 1px dashed rgba(96, 68, 20, 0.34);
    font-size: 0.82rem;
    line-height: 1.25;
}

.comparison-table,
.comparison-row {
    display: grid;
    gap: var(--space-2);
}

.comparison-row {
    grid-template-columns: minmax(100px, 1fr) minmax(82px, 0.8fr) minmax(82px, 0.8fr);
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.88rem;
}

.comparison-row.head {
    color: var(--color-navy);
    font-weight: 900;
    background: var(--color-paper-2);
}

.access-rule-list {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.access-rule-list p {
    margin: 0;
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.embedded-map {
    position: relative;
}

.legend-sheet[hidden] {
    display: none;
}

.legend-sheet {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    align-items: end;
}

.legend-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 40, 64, 0.32);
}

.legend-panel {
    position: relative;
    max-height: min(84vh, 720px);
    overflow: auto;
    padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-soft);
}

.legend-list {
    display: grid;
    grid-template-columns: minmax(72px, 0.28fr) 1fr;
    gap: var(--space-2);
}

.legend-list dt {
    color: var(--color-navy);
    font-weight: 900;
}

.legend-list dd {
    margin: 0;
}

.postit-panel {
    position: relative;
    display: grid;
    gap: var(--space-2);
    width: fit-content;
    max-width: min(100%, 24rem);
    margin-bottom: var(--space-4);
    padding: var(--space-4) var(--space-4) var(--space-3);
    background: #f7e8a7;
    border: 1px solid rgba(184, 139, 43, 0.22);
    border-radius: 6px 8px 12px 8px;
    box-shadow: 0 10px 16px rgba(96, 68, 20, 0.12);
    transform: rotate(-0.6deg);
}

.detail-postit-primary h2 {
    margin-bottom: 0;
    color: #604414;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
}

.detail-postit-primary p {
    margin: 0;
    color: var(--color-text);
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.detail-short-description {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.detail-short-description h2 {
    margin: 0;
    font-size: 1rem;
}

.visit-list,
.simple-list,
.history-list,
.settings-list,
.postit-grid {
    display: grid;
    gap: var(--space-3);
}

.visit-card,
.settings-row {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.visit-card.with-photo {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

.visit-card-media {
    display: block;
    min-height: 112px;
    background: var(--color-cream);
}

.visit-card-media > img,
.visit-card-media > .photo-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 112px;
    object-fit: cover;
}

.visit-card-copy {
    display: grid;
    align-content: center;
    gap: var(--space-2);
    min-width: 0;
    padding: var(--space-3);
}

.visit-card-copy h2,
.visit-card-copy h3,
.visit-card-copy p {
    margin: 0;
}

.visit-card-copy .section-head {
    align-items: center;
}

.settings-row {
    grid-template-columns: minmax(180px, 1fr);
}

.simple-list a {
    display: block;
    padding: var(--space-2);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-weight: 800;
}

.postit-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.chip.is-disabled {
    opacity: 0.68;
}

.installation {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-border);
}

.installation h3 {
    margin-bottom: var(--space-1);
}

.login-layout,
.auth-wrap {
    display: grid;
    min-height: calc(100vh - 72px);
    place-items: center;
}

.login-card,
.auth-card {
    display: grid;
    width: min(100%, 420px);
    gap: var(--space-4);
    padding: var(--space-5);
    background: rgba(255, 253, 248, 0.96);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.login-card h1,
.auth-card h1 {
    margin-bottom: 0;
}

.login-brand-composition {
    display: grid;
    justify-items: center;
    gap: var(--space-1);
}

.login-wordmark-text {
    color: var(--color-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.35rem, 12vw, 4rem);
    font-style: italic;
    font-weight: 900;
    line-height: 0.95;
}

.login-raven {
    display: block;
    width: min(78vw, 280px);
    height: auto;
    margin-top: -26px;
    object-fit: contain;
}

.login-brand-composition p {
    margin: -10px 0 var(--space-2);
    color: var(--color-navy);
    font-weight: 950;
}

.form-stack {
    display: grid;
    gap: var(--space-3);
}

@media (max-width: 899px) {
    body.filter-open {
        overflow: hidden;
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

    .nav-link {
        display: none;
    }

    .brand-wordmark-text {
        font-size: 1.45rem;
    }

    .brand-raven-img {
        width: 28px;
        height: 28px;
    }

    .home-layout,
    .map-layout {
        padding: var(--space-3);
    }

    .map-layout {
        gap: var(--space-3);
    }

    .home-search-form,
    .home-actions,
    .recommendation-card,
    .result-card,
    .map-mood-strip,
    .detail-title-grid,
    .session-location-card.compact {
        grid-template-columns: 1fr;
    }

    .recommendation-photo {
        min-height: 0;
    }

    .recommendation-photo > img,
    .recommendation-photo > .photo-placeholder {
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    .result-score {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }

    .result-score .card-action-row {
        grid-column: 1 / -1;
    }

    .result-score strong {
        font-size: 1.2rem;
    }

    .map-mood-strip {
        padding: var(--space-3);
    }

    .map-mood-strip h1 {
        font-size: 1.2rem;
    }

    .map-mood-strip .btn {
        min-height: 40px;
    }

    .map-modebar {
        top: 68px;
        align-items: center;
        flex-direction: row;
        padding: var(--space-2);
    }

    .list-sort-form {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .app-shell {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--space-4));
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .seg {
        width: 100%;
    }

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

    .map-modebar .seg {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    .leaflet-shell {
        min-height: 240px;
        height: clamp(240px, 38vh, 340px);
        touch-action: pan-y !important;
    }

    .map-inline-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .map-inline-actions .floating {
        flex: 0 0 auto;
        width: auto;
    }

    .search-trigger-row {
        flex-wrap: nowrap;
    }

    .search-trigger-row .btn {
        flex: 0 0 auto;
    }

    .search-trigger-row .muted {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .active-filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-top: 0;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .active-filter-row::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        flex: 0 0 auto;
        max-width: min(82vw, 300px);
    }

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

    .search-panel {
        position: fixed;
        inset: 0;
        z-index: var(--z-filter-sheet);
        padding: 0;
    }

    .filter-sheet-backdrop {
        position: absolute;
        inset: 0 0 calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)) 0;
        display: block;
        width: 100%;
        height: auto;
        padding: 0;
        background: rgba(18, 40, 64, 0.34);
        border: 0;
    }

    .filter-sheet {
        position: absolute;
        right: var(--space-2);
        bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        left: var(--space-2);
        max-height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom) - 84px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--space-3);
        border-radius: var(--radius) var(--radius) 0 0;
        box-shadow: var(--shadow-soft);
    }

    .filter-sheet-head {
        position: sticky;
        top: calc(-1 * var(--space-3));
        z-index: 2;
        margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) var(--space-3);
        padding: var(--space-3);
        background: rgba(255, 253, 248, 0.98);
        border-bottom: 1px solid var(--color-border);
    }

    .filter-actions {
        position: sticky;
        bottom: calc(-1 * var(--space-3));
        z-index: 2;
        margin: var(--space-3) calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
        padding: var(--space-3);
        background: rgba(255, 253, 248, 0.98);
        border-top: 1px solid var(--color-border);
    }

    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .fact-list,
    .preview-facts {
        grid-template-columns: 1fr;
    }

    .fact-list dt,
    .preview-facts dt {
        margin-top: var(--space-2);
    }

    .fact-list dd,
    .preview-facts dd {
        overflow-wrap: anywhere;
    }

    .preview-summary {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

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

    .preview-actions .btn {
        min-width: 0;
        padding-inline: var(--space-1);
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .preview-actions .icon-action {
        justify-self: start;
    }

    .marker-preview {
        position: fixed;
        right: var(--space-2);
        bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--space-2));
        left: var(--space-2);
        max-height: min(58dvh, 420px);
        padding: var(--space-2);
    }

    .preview-summary .preview-carousel {
        width: 100%;
        min-height: 0;
        max-height: none;
        aspect-ratio: 16 / 9;
    }

    .preview-summary .carousel-slide,
    .preview-summary .carousel-slide > img,
    .preview-summary .carousel-slide > .photo-placeholder {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .preview-metrics {
        gap: var(--space-1);
    }

    .preview-metrics span {
        min-width: 0;
        padding: var(--space-1) var(--space-2);
    }

    .visit-card.with-photo {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .visit-card-media,
    .visit-card-media > img,
    .visit-card-media > .photo-placeholder {
        min-height: 104px;
    }

    .sticky-actions {
        bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .rating-filter-list label,
    .comparison-row {
        grid-template-columns: 1fr;
    }

    .btn,
    .floating,
    input,
    select,
    textarea {
        max-width: 100%;
    }

    .detail-page {
        padding: var(--space-3);
    }

    .detail-carousel {
        height: clamp(210px, 36vh, 340px);
    }

    .detail-summary-card {
        padding: var(--space-3);
    }

    .detail-title-grid .chmantis-tile {
        justify-self: start;
        width: min(100%, 150px);
        min-height: 0;
    }

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

    .mood-dialog {
        max-height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom) - var(--space-4));
        margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }

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

    .account-menu {
        max-width: 100%;
    }

    .account-menu-panel {
        right: 0;
        max-width: calc(100vw - 2 * var(--space-4));
    }
}

@media (max-width: 420px) {
    .brand-lockup {
        display: none;
    }

    .brand-raven-only {
        display: block;
    }

    .brand-sub {
        display: none;
    }

    .home-action-card {
        grid-template-columns: 1fr;
    }

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

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

    .mood-dialog {
        padding: var(--space-3);
    }
}

@media (max-width: 899px) and (orientation: landscape) {
    .topbar {
        min-height: 58px;
        padding-block: var(--space-2);
    }

    .map-modebar {
        top: 58px;
    }

    .leaflet-shell {
        min-height: 210px;
        height: clamp(210px, 58vh, 300px);
    }

    .marker-preview {
        max-height: min(62vh, 250px);
    }

    .filter-sheet {
        max-height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom) - 66px);
    }

    .mood-dialog {
        max-height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom) - var(--space-2));
    }
}

@media (min-width: 560px) {
    .searchrow,
    .toolbar-form {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .toolbar-form {
        grid-template-columns: minmax(220px, 1fr) 190px auto auto;
    }

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

@media (min-width: 900px) {
    .topbar {
        padding-right: var(--space-5);
        padding-left: var(--space-5);
    }

    .map-layout {
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
        grid-template-areas:
            "hero mode"
            "trigger location"
            "trigger map"
            "search map"
            "list map";
        max-width: 1320px;
        margin: 0 auto;
        padding: var(--space-5);
    }

    .map-hero {
        grid-area: hero;
        align-self: start;
    }

    .map-modebar {
        grid-area: mode;
        top: 96px;
        align-self: start;
        justify-content: space-between;
    }

    .search-trigger-row {
        grid-area: trigger;
        align-self: start;
    }

    .location-cta-row {
        grid-area: location;
        align-self: start;
    }

    .search-panel {
        grid-area: search;
        align-self: start;
    }

    .list-panel {
        grid-area: list;
    }

    .main-map {
        grid-area: map;
        position: sticky;
        top: 160px;
        align-self: start;
    }

    .leaflet-shell {
        height: min(62vh, 640px);
        min-height: 480px;
    }

    .bottomnav {
        display: none;
    }

    .dashboard-layout,
    .edit-layout,
    .detail-page {
        max-width: 1120px;
        margin: 0 auto;
        padding: var(--space-5);
    }

    .admin-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .duplicate-box {
        grid-column: 1 / -1;
    }

    .detail-intro {
        grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
        align-items: stretch;
    }

    .detail-carousel {
        height: auto;
        min-height: 360px;
        border-radius: var(--radius) 0 0 var(--radius);
    }

    .detail-summary-card {
        margin-top: 0;
        border-radius: 0 var(--radius) var(--radius) 0;
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        align-items: start;
    }

    .fact-editor-grid,
    .procontra-grid,
    .photo-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .upload-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

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

    .photo-card-actions {
        grid-template-columns: 1fr;
    }

    .settings-row {
        grid-template-columns: minmax(180px, 1.1fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr);
        align-items: end;
    }

    .delete-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}
