:root {
    --bg: #ece8dc;
    --bg-soft: rgba(255, 255, 255, 0.76);
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: rgba(255, 255, 255, 0.98);
    --border: rgba(71, 82, 58, 0.18);
    --text: #1d2722;
    --muted: #667162;
    --accent: #5a6c43;
    --accent-strong: #394338;
    --accent-soft: rgba(90, 108, 67, 0.12);
    --gold: #9c8a3c;
    --success: #55713f;
    --warning: #9c7a25;
    --danger: #c53b4b;
    --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.16);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.1);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --container: 1180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(90, 108, 67, 0.16), transparent 32%),
        radial-gradient(circle at top right, rgba(156, 138, 60, 0.18), transparent 28%),
        linear-gradient(180deg, #f4f1e8 0%, #ece8dc 52%, #e4e0d1 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
}

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

.live-shell {
    width: min(100%, var(--container));
    margin: 0 auto;
    padding: 18px;
}

.live-app {
    display: grid;
    gap: 18px;
    padding: 6px 0 26px;
}

.live-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 246, 239, 0.9));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}

.live-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(90, 108, 67, 0.14), transparent 68%);
    pointer-events: none;
}

.live-hero {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.live-eyebrow {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.live-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 10px 10px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(71, 82, 58, 0.12);
    box-shadow: 0 14px 28px rgba(34, 44, 30, 0.1);
}

.live-brand__logo {
    width: 52px;
    height: 52px;
    display: block;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(34, 44, 30, 0.16);
}

.live-brand__text {
    display: grid;
    gap: 2px;
}

.live-brand__label {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.live-brand__subline {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.live-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-start;
}

.live-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 16px;
    border: 1px solid rgba(71, 82, 58, 0.14);
    background: var(--bg-soft);
    box-shadow: var(--shadow-md);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.live-chip--accent {
    background: linear-gradient(180deg, rgba(90, 108, 67, 0.16), rgba(156, 138, 60, 0.12));
    color: #435239;
}

.live-chip--warning {
    background: rgba(156, 122, 37, 0.12);
    color: #7d6013;
}

.live-chip--danger {
    background: rgba(197, 59, 75, 0.12);
    color: #9f2333;
}

.live-chip--success {
    background: rgba(85, 113, 63, 0.12);
    color: #435a31;
}

.live-refresh-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 40px 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(71, 82, 58, 0.14);
    background: var(--bg-soft);
    box-shadow: var(--shadow-md);
    color: var(--text);
}

.live-refresh-control::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.live-refresh-control:focus-within {
    outline: 3px solid rgba(90, 108, 67, 0.22);
    outline-offset: 2px;
}

.live-refresh-control__select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    min-width: 72px;
    padding: 11px 8px 11px 0;
    cursor: pointer;
}

.live-refresh-control__select:focus {
    outline: none;
}

.live-map-card {
    padding: 18px;
}

.live-map-card__header,
.live-map-card__footer {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.live-map-card__header {
    margin-bottom: 16px;
}

.live-map-card__label {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.live-map-card h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.live-map-card__status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid rgba(71, 82, 58, 0.14);
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.live-status-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--warning);
    box-shadow: 0 0 0 6px rgba(156, 122, 37, 0.14);
    flex: 0 0 auto;
}

.live-status-dot.is-live {
    background: var(--success);
    box-shadow: 0 0 0 6px rgba(85, 113, 63, 0.14);
}

.live-status-dot.is-error {
    background: var(--danger);
    box-shadow: 0 0 0 6px rgba(197, 59, 75, 0.12);
}

.live-status-dot.is-idle {
    background: var(--warning);
}

.live-map-frame {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius-xl) - 6px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.2)),
        linear-gradient(135deg, rgba(90, 108, 67, 0.08), rgba(156, 138, 60, 0.08));
    border: 1px solid rgba(71, 82, 58, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.live-map {
    height: clamp(360px, 62vh, 760px);
    width: 100%;
    z-index: 1;
}

.live-map .leaflet-control-zoom,
.live-map .leaflet-bar {
    border: 0;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.live-map .leaflet-control-zoom a {
    width: 38px;
    height: 38px;
    line-height: 38px;
    color: var(--text);
}

.live-map .leaflet-control-fullscreen a,
.live-map .leaflet-control-zoom-fullscreen {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.96);
}

.live-map .leaflet-control-fullscreen a {
    background-size: 18px 18px;
}

.live-map .leaflet-control-attribution {
    border-radius: 12px 0 0 0;
    background: rgba(255, 255, 255, 0.9);
    color: var(--muted);
}

.live-map-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: 18px;
    background: linear-gradient(180deg, rgba(236, 232, 220, 0.24), rgba(236, 232, 220, 0.68));
}

.live-map-overlay[hidden] {
    display: none;
}

.state-card {
    width: min(100%, 420px);
    display: grid;
    gap: 16px;
    justify-items: center;
    text-align: center;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(71, 82, 58, 0.14);
    box-shadow: 0 28px 52px rgba(15, 23, 42, 0.16);
}

.state-card__icon {
    width: 66px;
    height: 66px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    position: relative;
    background: rgba(90, 108, 67, 0.12);
}

.state-card__icon::before,
.state-card__icon::after {
    content: "";
    position: absolute;
    border-radius: 999px;
}

.state-card--loading .state-card__icon::before {
    inset: 10px;
    border: 3px solid rgba(90, 108, 67, 0.2);
    border-top-color: var(--accent);
    animation: dribu-spin 1s linear infinite;
}

.state-card--loading .state-card__icon::after {
    inset: 25px;
    background: var(--gold);
}

.state-card--error .state-card__icon,
.state-card--invalid .state-card__icon {
    background: rgba(197, 59, 75, 0.12);
}

.state-card--error .state-card__icon::before,
.state-card--invalid .state-card__icon::before {
    content: "!";
    position: static;
    color: var(--danger);
    font-size: 2rem;
    font-weight: 800;
}

.state-card--empty .state-card__icon {
    background: rgba(156, 122, 37, 0.12);
}

.state-card--empty .state-card__icon::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 18px;
    border: 3px dashed rgba(156, 122, 37, 0.55);
}

.state-card__copy h2,
.state-card__copy h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    line-height: 1.15;
}

.state-card__copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.state-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #5a6c43 0%, #8e7e34 100%);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 26px rgba(90, 108, 67, 0.2);
}

.state-card__action:hover,
.state-card__action:focus-visible {
    transform: translateY(-1px);
}

.state-card__action:focus-visible,
.live-map .leaflet-control-zoom a:focus-visible {
    outline: 3px solid rgba(90, 108, 67, 0.22);
    outline-offset: 2px;
}

.live-map-card__footer {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.live-map-card__footer p {
    margin: 0;
}

.live-map-card__hint {
    max-width: 36ch;
    text-align: right;
}

.dribu-div-icon {
    background: transparent;
    border: 0;
}

.dribu-user-marker {
    --marker-color: #5a6c43;
    width: 54px;
    height: 54px;
    padding: 4px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 241, 231, 0.94));
    border: 3px solid var(--marker-color);
    box-shadow:
        0 16px 30px rgba(15, 23, 42, 0.2),
        0 6px 14px rgba(15, 23, 42, 0.14);
    transform: translateZ(0);
}

.dribu-user-marker__inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--marker-color);
}

.dribu-user-marker__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.dribu-user-marker__fallback {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.dribu-user-marker:not(.is-fallback) .dribu-user-marker__fallback {
    display: none;
}

.dribu-user-marker.is-fallback .dribu-user-marker__image {
    display: none;
}

.live-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@keyframes dribu-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 860px) {
    .live-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .live-chip-group {
        justify-content: flex-end;
        max-width: 360px;
    }
}

@media (max-width: 859px) {
    .live-map-card__header,
    .live-map-card__footer {
        flex-direction: column;
    }

    .live-map-card__hint {
        text-align: left;
    }

    .live-map-card__status {
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .live-shell {
        padding: 12px;
    }

    .live-hero,
    .live-map-card {
        padding: 16px;
    }

    .live-map {
        height: clamp(360px, 56vh, 520px);
    }

    .live-chip {
        width: 100%;
        justify-content: center;
    }

    .live-refresh-control {
        width: 100%;
        justify-content: center;
    }

    .state-card {
        padding: 20px;
    }
}
