:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #141414;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #2a2a2a;
    --success: #22c55e;
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --warning-border: rgba(245, 158, 11, 0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    background: #fef3c7;
    color: #1f2937;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui .reload {
    color: #1d4ed8;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

html, body, #app {
    height: 100%;
    margin: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Segoe UI", system-ui, sans-serif;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.app-boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 100%;
    padding: 2rem;
    text-align: center;
}

.app-boot-logo {
    width: min(12rem, 52vw);
    height: auto;
    border-radius: 1.25rem;
    background: #fff;
    padding: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(249, 115, 22, 0.25);
    animation: app-boot-pulse 1.6s ease-in-out infinite;
}

.app-boot-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@keyframes app-boot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.03); opacity: 0.88; }
}

.app-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
}

.app-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 0.55rem 1.25rem;
}

.app-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.app-footer-nav {
    display: flex;
    gap: 1rem;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.app-footer a:hover,
.app-footer a.active {
    color: var(--accent);
}

.legal-shell {
    overflow: hidden;
}

.legal-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
}

.legal-main h1 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
}

.legal-main h2 {
    margin: 1.25rem 0 0.45rem;
    font-size: 1.1rem;
}

.legal-main h3 {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.95rem;
}

.legal-main p,
.legal-main li {
    color: var(--text-muted);
    line-height: 1.55;
}

.legal-main ul {
    padding-left: 1.2rem;
}

.legal-main a {
    color: var(--accent);
}

.legal-main code {
    font-size: 0.85em;
    color: #93c5fd;
}

.legal-note {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: rgba(249, 115, 22, 0.08);
    color: #e5e7eb !important;
}

.legal-section {
    margin-bottom: 0.5rem;
}

.app-header {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    width: 2.75rem;
    height: 2.75rem;
    object-fit: contain;
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.15rem;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.35);
}

.brand-name {
    letter-spacing: -0.02em;
}

.app-nav {
    display: none;
    gap: 1.25rem;
}

.app-nav a {
    color: var(--text-muted);
    text-decoration: none;
}

.app-nav a.active,
.app-nav a:hover {
    color: var(--accent);
}

.app-header-menu {
    display: block;
    position: relative;
    flex-shrink: 0;
}

.app-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-card);
    cursor: pointer;
}

.app-menu-toggle__bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--text-primary);
}

.app-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.app-menu-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 12.5rem;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-card);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.app-menu-panel a {
    padding: 0.7rem 0.85rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}

.app-menu-panel a:hover,
.app-menu-panel a.active {
    color: var(--accent);
    background: rgba(249, 115, 22, 0.12);
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(min(380px, 100%), 42%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "sidebar map";
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-pane {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--border);
    background: var(--bg-secondary);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.filters-pane {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    min-height: 0;
}

.results-pane {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    min-height: 0;
}

.map-pane,
.map-frame,
.map-container,
.map-container > div {
    height: 100%;
    min-height: 0;
}

.map-pane {
    grid-area: map;
    position: relative;
    min-height: 0;
    min-width: 0;
}

.map-frame {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
}

.map-frame:fullscreen {
    background: var(--bg-primary);
}

.map-fullscreen-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1000;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.map-fullscreen-btn:hover {
    background: rgba(37, 99, 235, 0.95);
}

.map-click-hint {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 500;
    margin: 0;
    max-width: calc(100% - 1.5rem);
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
    font-size: 0.8rem;
    line-height: 1.3;
    pointer-events: none;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Shared hover tooltips for icon/action buttons */
.ak-tooltip {
    position: relative;
    display: inline-flex;
}

.ak-tooltip__bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.45rem);
    z-index: 30;
    width: max-content;
    max-width: 12.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 0.2rem);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.ak-tooltip:hover .ak-tooltip__bubble,
.ak-tooltip:focus-within .ak-tooltip__bubble {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.btn-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7ebc6f;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s ease, filter 0.15s ease;
}

.btn-map:hover {
    background: #6aad5d;
}

.btn-map .icon-osm {
    display: block;
}

.btn-gmaps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: none;
    border-radius: 0.5rem;
    color: #fff;
    background: #4285f4;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.btn-gmaps:hover {
    background: #3367d6;
}

.btn-gmaps svg {
    display: block;
}

.btn-details {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-details:hover {
    background: var(--accent);
    color: white;
}

.result-list {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.automat-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.automat-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.automat-card img {
    width: 120px;
    height: 100%;
    object-fit: contain;
    background: var(--bg-secondary);
}

.card-body {
    padding: 0.75rem 0.75rem 0.75rem 0;
}

.card-body h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.coords,
.products {
    margin: 0.15rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.latest-comment {
    margin: 0.35rem 0 0.1rem;
    padding: 0.4rem 0.55rem;
    border-left: 2px solid rgba(249, 115, 22, 0.65);
    background: rgba(15, 23, 42, 0.35);
    border-radius: 0 0.4rem 0.4rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.latest-comment__label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fdba74;
}

.latest-comment__text {
    color: var(--text-primary, #e2e8f0);
}

.latest-comment__author {
    margin-left: 0.25rem;
    opacity: 0.8;
}

.meta {
    display: flex;
    gap: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.status.free,
.status.paid {
    color: var(--success);
}

.rating {
    color: #fbbf24;
}

.status-message {
    padding: 0.5rem 1rem 0.75rem;
    margin: 0;
    color: var(--text-muted);
}

.status-message.error {
    color: #f87171;
}

/* Detail modal (ak- prefix avoids clashing with Bootstrap's .modal/.badge) */
.ak-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
}

.ak-modal {
    position: relative;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ak-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: white;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.ak-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.ak-modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.75rem 0.75rem 0 0;
}

.ak-modal-image-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.ak-modal-image-btn .ak-modal-image {
    display: block;
}

/* Community photos – keep full image visible for any orientation. */
.ak-modal-image--portrait {
    height: min(56vh, 420px);
    object-fit: contain;
    background: var(--bg-secondary);
}

.ak-modal-body {
    padding: 1.25rem;
}

.ak-modal-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.ak-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ak-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ak-badge--type {
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
}

.ak-badge--free {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

.ak-badge--paid {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.ak-badge--pending {
    background: var(--warning-soft);
    color: #fcd34d;
    border: 1px solid var(--warning-border);
}

.ak-detail-grid {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.6rem 1rem;
    margin: 0;
}

.ak-detail-grid dt {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ak-detail-grid dd {
    margin: 0;
    color: var(--text-primary);
    word-break: break-word;
}

.ak-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ak-tag-chips {
    margin-bottom: 0.6rem;
}

.ak-detail-chip {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

.ak-detail-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ak-detail-muted {
    color: var(--text-muted);
}

.ak-modal-osm-link {
    display: inline-block;
    margin-top: 1.25rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.ak-modal-osm-link:hover {
    text-decoration: underline;
}

.ak-badge--rating {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
}

.ak-rating-count {
    color: var(--text-muted);
    font-weight: 400;
}

.rating-count {
    color: var(--text-muted);
    margin-left: 0.15rem;
}

.ak-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.ak-section-title {
    margin: 0 0 0.6rem;
    font-size: 1rem;
}

.ak-field-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ak-input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font: inherit;
}

.ak-input:focus {
    outline: none;
    border-color: var(--accent);
}

.ak-textarea {
    resize: vertical;
}

.ak-stars-input {
    display: flex;
    gap: 0.25rem;
}

.ak-star {
    background: none;
    border: none;
    padding: 0;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--border);
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
}

.ak-star:hover:not(:disabled) {
    transform: scale(1.1);
}

.ak-star--on {
    color: #fbbf24;
}

.ak-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.65rem 0.5rem;
    margin-bottom: 0.75rem;
}

.ak-gallery-figure {
    margin: 0;
    min-width: 0;
}

.ak-gallery-item-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.5rem;
}

.ak-gallery-item-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Gallery thumbnails support portrait and landscape. */
.ak-gallery-item {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    display: block;
}

.ak-gallery-meta {
    margin-top: 0.3rem;
    text-align: center;
}

.ak-gallery-meta__date {
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.25;
}

.ak-upload-hint {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Fullscreen lightbox – large image viewer for phones and desktop. */
.ak-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    outline: none;
    touch-action: pan-y;
    padding:
        max(0.5rem, env(safe-area-inset-top))
        max(0.5rem, env(safe-area-inset-right))
        max(0.5rem, env(safe-area-inset-bottom))
        max(0.5rem, env(safe-area-inset-left));
}

.ak-lightbox-close {
    position: absolute;
    top: max(0.5rem, env(safe-area-inset-top));
    right: max(0.5rem, env(safe-area-inset-right));
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.ak-lightbox-counter {
    position: absolute;
    top: max(0.75rem, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.9rem;
    font-weight: 600;
}

.ak-lightbox-zoom-controls {
    position: absolute;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 0.35rem;
}

.ak-lightbox-zoom-btn {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    border-radius: 999px;
    cursor: pointer;
}

.ak-lightbox-zoom-btn:hover:not(:disabled) {
    background: rgba(249, 115, 22, 0.9);
}

.ak-lightbox-zoom-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.ak-lightbox-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
    padding: 3.25rem 0.25rem 4.25rem;
    overflow: hidden;
    cursor: zoom-in;
    touch-action: none;
}

.ak-lightbox-stage.is-zoomed {
    cursor: grab;
}

.ak-lightbox-stage.is-zoomed:active {
    cursor: grabbing;
}

.ak-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.35rem;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    will-change: transform;
}

.ak-lightbox-caption {
    margin: 0.5rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    justify-content: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.ak-lightbox-caption__date {
    color: rgba(255, 255, 255, 0.55);
}

.admin-image-meta {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
}

.ak-lightbox-nav {
    position: absolute;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    z-index: 2;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.ak-lightbox-nav--prev {
    left: max(0.75rem, env(safe-area-inset-left));
}

.ak-lightbox-nav--next {
    right: max(0.75rem, env(safe-area-inset-right));
}

.ak-lightbox-nav.is-disabled,
.ak-lightbox-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

@media (min-width: 641px) {
    .ak-lightbox-stage {
        padding: 3.5rem 4.5rem;
    }

    .ak-lightbox-zoom-controls {
        top: max(0.65rem, env(safe-area-inset-top));
        bottom: auto;
        left: max(0.65rem, env(safe-area-inset-left));
        transform: none;
    }

    .ak-lightbox-nav {
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.35rem;
    }

    .ak-lightbox-nav--prev {
        left: max(1rem, env(safe-area-inset-left));
    }

    .ak-lightbox-nav--next {
        right: max(1rem, env(safe-area-inset-right));
    }
}

@media (max-width: 640px) {
    .ak-modal-image--portrait {
        height: min(48vh, 360px);
    }

    .ak-lightbox-stage {
        padding-bottom: 5.5rem;
    }

    .ak-lightbox-nav--prev {
        left: max(0.75rem, env(safe-area-inset-left));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }

    .ak-lightbox-nav--next {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

.ak-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.ak-upload:hover:not(.is-busy) {
    transform: translateY(-1px);
}

.ak-upload-icon {
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.ak-upload-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ak-upload-label {
    line-height: 1.1;
}

/* Hide native file UI completely; the label remains the visible control. */
.ak-upload input[type="file"],
.ak-upload .ak-upload-input,
.ak-upload input.ak-upload-input {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
    font-size: 0 !important;
    color: transparent !important;
    background: transparent !important;
    border: 0 !important;
    z-index: 2;
}

.ak-upload input[type="file"]::-webkit-file-upload-button,
.ak-upload input[type="file"]::file-selector-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}

.ak-upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.ak-upload--camera {
    border-color: rgba(126, 188, 111, 0.55);
    color: #bbf7d0;
    background: rgba(34, 84, 45, 0.35);
}

.ak-upload--camera:hover:not(.is-busy) {
    border-color: #7ebc6f;
    background: rgba(34, 84, 45, 0.5);
}

.ak-upload--gallery {
    border-color: rgba(96, 165, 250, 0.55);
    color: #93c5fd;
    background: rgba(30, 64, 175, 0.28);
}

.ak-upload--gallery:hover:not(.is-busy) {
    border-color: #60a5fa;
    background: rgba(30, 64, 175, 0.42);
}

.ak-upload.is-busy {
    opacity: 0.6;
    cursor: default;
}

.ak-upload-actions.is-busy {
    pointer-events: none;
}

.ak-btn-primary {
    align-self: flex-start;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ak-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.ak-btn-primary:disabled {
    opacity: 0.55;
    cursor: default;
}

.ak-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ak-btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
}

.ak-btn-secondary:disabled {
    opacity: 0.55;
    cursor: default;
}

.ak-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.ak-choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ak-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ak-choice:hover {
    border-color: var(--accent);
}

.ak-choice--on {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.ak-choice--disabled,
.ak-choice:disabled {
    opacity: 0.45;
    cursor: default;
}

.ak-produkt-suggest {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.ak-produkt-suggest .ak-choice {
    color: var(--text-muted);
}

.ak-produkt-suggest .ak-choice--on {
    color: #ffffff;
}

.ak-produkt-suggest__hint {
    margin: 0;
}

.ak-produkt-suggest .ak-btn-primary {
    align-self: flex-start;
}

.ak-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.report-picker {
    height: 240px;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.report-coords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.ak-comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ak-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ak-comment {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
}

.ak-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ak-comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.ak-comment-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ak-comment-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.ak-contrib-error {
    margin: 0.4rem 0 0;
    color: #f87171;
    font-size: 0.9rem;
}

.ak-contrib-success {
    margin: 0.4rem 0 0;
    color: #86efac;
    font-size: 0.9rem;
}

/* Custom Leaflet markers (rendered in the global map DOM, not scoped). */
.ak-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-marker__pin {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.ak-marker--selected .ak-marker__pin {
    background: #f97316;
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
    animation: ak-marker-pulse 1.4s ease-in-out infinite;
}

.ak-center-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ak-center-marker__pin {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.45), 0 1px 3px rgba(0, 0, 0, 0.45);
}

@keyframes ak-marker-pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.35), 0 2px 6px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(249, 115, 22, 0.12), 0 2px 6px rgba(0, 0, 0, 0.5);
    }
}

/* Admin area */
.admin-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: var(--bg-primary);
}

.admin-shell--wide {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    max-width: 960px;
    margin: 0 auto;
}

.admin-card {
    width: min(420px, 100%);
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.admin-title {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.admin-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-tab {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
}

.admin-tab.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-section {
    margin-bottom: 1.5rem;
}

.admin-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.admin-section-head .ak-section-title {
    margin-bottom: 0;
}

.admin-entries-filter {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(10rem, 12rem) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-card);
}

.admin-entries-filter .ak-field-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
}

.admin-entries-filter__reset {
    height: 2.75rem;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .admin-entries-filter {
        grid-template-columns: 1fr;
    }

    .admin-entries-filter__reset {
        width: 100%;
    }
}

.admin-pending-images {
    display: grid;
    gap: 0.75rem;
}

.admin-pending-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.admin-pending-card--needs-approval {
    background: var(--warning-soft);
    border-color: var(--warning-border);
    box-shadow: inset 3px 0 0 var(--warning);
}

.admin-pending-card--tags {
    grid-template-columns: 1fr;
}

.admin-pending-thumb {
    width: 88px;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.admin-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-chip-btn {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
}

.admin-chip-btn--danger {
    color: #f87171;
}

.admin-list {
    display: grid;
    gap: 0.5rem;
}

.admin-entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.admin-entry-card--pending {
    background: var(--warning-soft);
    border-color: var(--warning-border);
    box-shadow: inset 3px 0 0 var(--warning);
}

.admin-pending-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: middle;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid var(--warning-border);
}

.admin-entry-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.admin-entry-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}

.admin-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.admin-edit-grid .ak-field-label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-inline-edit {
    display: grid;
    grid-template-columns: 1fr 8rem auto auto;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.admin-community-card {
    padding: 0.85rem 1rem;
}

.admin-community-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.admin-community-text {
    margin: 0 0 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .admin-edit-grid,
    .admin-inline-edit {
        grid-template-columns: 1fr;
    }

    .admin-pending-card {
        grid-template-columns: 72px 1fr;
    }
}

@media (max-width: 960px) {
    .app-header {
        padding: 0.65rem 0.85rem;
        gap: 0.75rem;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .app-shell {
        flex: none;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .split-layout {
        display: flex;
        flex-direction: column;
        flex: none;
        min-height: auto;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .sidebar-pane {
        display: contents;
    }

    .filters-pane {
        order: 1;
        flex: none;
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        /* Keep filters fully visible above the map. */
        overflow: visible;
    }

    .map-pane {
        order: 2;
        flex: none;
        width: 100%;
        height: 42vh;
        min-height: 220px;
        border-bottom: 1px solid var(--border);
    }

    .app-shell--searched .map-pane {
        /* After search: use most of the remaining viewport for the map. */
        height: min(70dvh, calc(100dvh - 12rem));
        min-height: 280px;
    }

    .results-pane {
        order: 3;
        flex: none;
        border-right: none;
        overflow: visible;
    }

    .result-list {
        flex: none;
        min-height: 0;
        overflow: visible;
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 961px) {
    html, body, #app {
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    .app-shell {
        height: 100%;
        max-height: 100%;
    }

    .app-nav--desktop {
        display: flex;
    }

    .app-header-menu {
        display: none;
    }
}

/* Community board */
.community-shell {
    overflow-y: auto;
}

.community-main {
    width: min(720px, 100%);
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}

.community-intro h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
}

.community-compose {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.community-feed {
    margin-top: 0.5rem;
}

.community-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.community-post {
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.community-post--reply {
    margin-top: 0.6rem;
    background: var(--bg-secondary);
}

.community-post-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.community-post-author {
    font-size: 0.95rem;
}

.community-post-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.community-post-text {
    margin: 0 0 0.55rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.community-reply-toggle {
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.community-reply-form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.community-replies {
    margin-top: 0.5rem;
    padding-left: 0.65rem;
    border-left: 2px solid var(--border);
}

@media (max-width: 640px) {
    .community-replies {
        padding-left: 0.4rem;
    }

    .map-pane {
        height: 38vh;
        min-height: 200px;
    }

    .app-shell--searched .map-pane {
        height: min(65dvh, calc(100dvh - 11rem));
        min-height: 260px;
    }

    .automat-card {
        grid-template-columns: 96px 1fr;
    }

    .automat-card img {
        width: 96px;
    }
}
