/* The labelled bottom bar and its sheet (shared by both sites; js/bottombar.js builds them).
   Uses the site's colour variables: --card-bg, --bg, --border, --text-main, --text-muted, --accent, --btn-text, --shadow. */
:root {
    --bar-h: 56px;
    --bar-space: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}

.bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
    height: var(--bar-space); padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex; align-items: stretch; justify-content: center;
    background: var(--bg); border-top: 1px solid var(--border);
}
.bar-item {
    flex: 1 1 0; max-width: 150px; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: none; cursor: pointer; padding: 4px 2px;
    color: var(--text-muted); font-family: inherit; font-size: 0.68rem; font-weight: 500; line-height: 1.1;
    -webkit-tap-highlight-color: transparent;
}
.bar-icon { font-size: 1.25rem; line-height: 1; display: flex; align-items: center; justify-content: center; height: 24px; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar-item.active { color: var(--accent); font-weight: 600; }
.bar-item:focus-visible, .more-row:focus-visible, .bar-sheet-close:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 12px; }

/* The one action that matters most: a raised round button */
.bar-item.primary { color: var(--text-main); }
.bar-item.primary .bar-icon {
    width: 48px; height: 34px; border-radius: 11px;
    background: var(--accent); color: var(--btn-text); font-size: 1.3rem; font-weight: 600;
}

/* Sheet above the bar: the More list, and short lists the site shows from a bar entry */
.bar-sheet-overlay {
    position: fixed; inset: 0; bottom: var(--bar-space); z-index: 1400;
    background: rgba(8, 12, 18, 0.45);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
}
.bar-sheet-overlay.open { opacity: 1; visibility: visible; }
.bar-sheet {
    width: 100%; max-width: 560px; max-height: 80%; overflow-y: auto;
    background: var(--bg); color: var(--text-main);
    border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px var(--shadow);
    padding: 0.5rem 0.9rem 0.9rem; transform: translateY(24px); transition: transform 0.2s;
}
.bar-sheet-overlay.open .bar-sheet { transform: translateY(0); }
/* A sheet that works with the map (placing a point): the map behind it stays live */
.bar-sheet-overlay.map-free { background: none; pointer-events: none; }
.bar-sheet-overlay.map-free .bar-sheet { pointer-events: auto; }
.bar-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.bar-sheet-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.bar-sheet-close {
    width: 44px; height: 44px; border: none; background: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.5rem; line-height: 1; margin-right: -0.5rem;
}

/* The More list: sections of rows, each showing its current value */
.more-list { display: flex; flex-direction: column; gap: 0.2rem; padding-bottom: 0.3rem; }
.more-head { margin: 0.7rem 0 0.3rem 0.2rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.more-head:first-child { margin-top: 0.1rem; }
.more-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card-bg); }
.more-row {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 48px; padding: 0 0.75rem;
    background: none; border: none; border-top: 1px solid var(--border); cursor: pointer;
    color: var(--text-main); font-family: inherit; font-size: 0.95rem; font-weight: 500; text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.more-row:first-child { border-top: none; }
.more-row:active { background: var(--fill, rgba(127, 127, 127, 0.12)); }
.more-icon { flex: 0 0 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; line-height: 1; color: var(--text-muted); }
.more-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-end { flex: 0 0 auto; display: flex; align-items: center; gap: 0.25rem; color: var(--text-muted); }
.more-value { font-size: 0.9rem; max-width: 9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-chevron { display: flex; opacity: 0.6; }
.more-row.closed { cursor: default; }
.more-row.closed:active { background: none; }
.more-row.closed .more-icon, .more-row.closed .more-label { opacity: 0.45; }
.more-closed { font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 999px; background: var(--fill, rgba(127, 127, 127, 0.14)); color: var(--text-muted); white-space: nowrap; }
.more-switch { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--border); transition: background 0.15s; }
.more-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.more-switch.on { background: var(--accent); }
.more-switch.on::after { transform: translateX(18px); }
.more-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--fill, var(--border)); }
.more-seg-opt { min-width: 2.6rem; padding: 0.35rem 0.6rem; border-radius: 7px; font-size: 0.85rem; font-weight: 600; text-align: center; color: var(--text-muted); }
.more-seg-opt.on { background: var(--bg); color: var(--text-main); box-shadow: 0 1px 3px var(--shadow); }
@media (prefers-reduced-motion: reduce) { .more-switch, .more-switch::after { transition: none; } }

/* The marker detail sheet (css/mobile.css) rests on the bar, not under it */
body.has-bar .detail-sheet { bottom: var(--bar-space); padding-bottom: 0; z-index: 1450; }

@media (prefers-reduced-motion: reduce) {
    .bar-sheet-overlay, .bar-sheet { transition: none; }
}

/* --- The admin Menu Editor (js/menueditor.js) --- */
.me-title { margin: 1.25rem 0 0.25rem; color: var(--text-main); }
.me-help { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 0.75rem; }
.me-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem; margin-bottom: 0.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.me-row.me-hidden { opacity: 0.55; }
.me-input { padding: 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text-main); font-size: 1rem; min-width: 0; }
.me-icon { width: 3.6rem; text-align: center; }
.me-label { flex: 1 1 9rem; }
.me-url { flex: 2 1 14rem; }
.me-btn { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text-main); cursor: pointer; }
.me-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.me-remove { color: var(--danger); }
.me-show { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; min-height: 40px; }
.me-note { font-size: 0.75rem; color: var(--text-muted); }
.me-preview { max-width: 420px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg); }
.me-preview-sheet { padding: 0.75rem; max-height: 420px; overflow-y: auto; }
.me-group { margin: 0.9rem 0 0.4rem; }
.me-group .me-input { font-weight: 700; width: min(100%, 16rem); }
.me-preview .bottom-bar { position: static; height: var(--bar-h); padding: 0; box-shadow: none; --btn-text: #fff; }
.me-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.me-status { color: var(--text-muted); font-size: 0.9rem; }

/* Short notes, actions and the "How it works" lines shown in the sheet */
.sheet-note { margin: 0 0 0.75rem; font-size: 0.9rem; line-height: 1.45; color: var(--text-muted); }
.sheet-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.sheet-actions button { min-height: 46px; width: 100%; padding: 0 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); color: var(--text-main); font-family: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.sheet-actions button:first-child { background: var(--accent); border-color: var(--accent); color: var(--btn-text, #fff); }
.sheet-version { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--text-muted); text-align: right; }
.howto { margin: 0 0 0.9rem; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.howto > div { display: flex; gap: 0.75rem; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); }
.howto > div:last-child { border-bottom: none; }
.howto dt { flex: 0 0 4.6rem; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.howto dd { margin: 0; font-size: 0.9rem; line-height: 1.4; color: var(--text-muted); }

/* Near me: the closest few places, as rows in the sheet */
.near-empty { margin: 0.25rem 0 0.75rem; line-height: 1.4; font-size: 0.9rem; }
.near-row { width: 100%; display: flex; align-items: center; gap: 0.7rem; text-align: left; margin-bottom: 0.4rem; padding: 0.4rem 0.6rem; min-height: 54px; border-radius: 12px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-main); font-family: inherit; cursor: pointer; }
.near-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.near-text strong { font-size: 0.95rem; }
.near-text strong small { font-weight: 500; font-size: 0.8rem; color: var(--text-muted); }
.near-text span { font-size: 0.82rem; line-height: 1.3; color: var(--text-muted); }
.near-actions { display: flex; gap: 0.5rem; margin-top: 0.2rem; }
.near-actions button { flex: 1; min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text-main); font-family: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; }

/* A quiet text action under a list, such as "Show everything" under the map's filters */
.sheet-reset { display: block; width: 100%; min-height: 44px; margin-top: 0.6rem; border: none; background: none; color: var(--accent); font-family: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
