/* Attribution do mapa inicia colapsado (evita flash) */
.maplibregl-ctrl-attrib-inner {
    display: none !important;
}
.maplibregl-ctrl-attrib.attrib-ready[open] .maplibregl-ctrl-attrib-inner {
    display: block !important;
}

.maplibregl-ctrl-top-right {
    z-index: 6;
}

.locate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #333;
}

.locate-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ============================================
   Content & Map
   ============================================ */

.map-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    flex: 1;
}

.map-bottom-bar {
    position: absolute;
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: calc(100% - 48px);
    display: flex;
    justify-content: center;
}

/* ============================================
   Map Side Bar — botões à direita
   ============================================ */

.map-side-bar {
    position: absolute;
    top: 80px;
    bottom: 100px;
    right: 24px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 52px;
    width: 52px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

.side-icon {
    position: relative;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.75) 60%, rgba(245, 252, 240, 0.7) 100%);
    border: 1px solid rgba(165, 232, 122, 0.45);
    border-radius: 50%;
    box-shadow:
        0 6px 14px -6px rgba(22, 101, 52, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    will-change: transform;
    transition:
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease,
        border-color 0.35s ease,
        background 0.35s ease;
    z-index: 2;
}

/* Halo verde que pulsa do ícone para fora no hover */
.side-icon::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(165, 232, 122, 0.55), rgba(165, 232, 122, 0) 70%);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: -1;
}

.side-label {
    position: absolute;
    right: 64px;
    top: 50%;
    padding: 10px 18px;
    background: linear-gradient(135deg, #BCEF8F 0%, #A5E87A 50%, #8BD55A 100%);
    color: #14532d;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.01em;
    line-height: var(--line-height-tight);
    white-space: nowrap;
    border-radius: var(--radius-full);
    box-shadow:
        0 8px 20px -8px rgba(91, 168, 50, 0.55),
        0 2px 6px rgba(22, 101, 52, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    opacity: 0;
    transform: translate(14px, -50%) scale(0.9);
    transform-origin: right center;
    pointer-events: none;
    will-change: transform, opacity;
    transition:
        opacity 0.35s ease,
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

/* Setinha apontando para o ícone */
.side-label::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #A5E87A, #8BD55A);
    border-radius: 2px;
    box-shadow: 1px -1px 0 rgba(255, 255, 255, 0.4) inset;
}

/* Brilho que desliza pela legenda — sutil */
.side-label::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 65%);
    background-size: 220% 100%;
    background-position: 120% 0;
    pointer-events: none;
}

.side-btn:hover .side-label,
.side-btn:focus-visible .side-label {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
}

.side-btn:hover .side-label::before {
    animation: side-label-shine 1.1s ease-out 0.1s 1;
}

@keyframes side-label-shine {
    0%   { background-position: 120% 0; }
    100% { background-position: -40% 0; }
}

.side-btn:hover .side-icon,
.side-btn:focus-visible .side-icon {
    transform: scale(1.12) rotate(-4deg);
    background:
        radial-gradient(circle at 30% 25%, #ffffff, #E8FAD8 55%, #BCEF8F 100%);
    border-color: #8BD55A;
    box-shadow:
        0 12px 24px -8px rgba(91, 168, 50, 0.55),
        0 2px 6px rgba(22, 101, 52, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.side-btn:hover .side-icon::before,
.side-btn:focus-visible .side-icon::before {
    opacity: 1;
    transform: scale(1.35);
    animation: side-icon-halo 1.8s ease-out infinite;
}

@keyframes side-icon-halo {
    0%, 100% { transform: scale(1.35); opacity: 0.85; }
    50%      { transform: scale(1.55); opacity: 0.4; }
}

.side-btn:active .side-icon {
    transform: scale(1.02) rotate(-2deg);
    transition-duration: 0.15s;
}

/* ============================================
   Side bar — botão "mais" com popover horizontal
   ============================================ */

.side-more {
    position: relative;
    width: 52px;
    height: 52px;
}

.side-more[hidden] {
    display: none;
}

.side-more-btn .side-icon {
    gap: 4px;
}

.side-more-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8BD55A;
    box-shadow: 0 1px 2px rgba(22, 101, 52, 0.25);
    transition: background 0.3s ease;
}

.side-more:hover .side-more-dot,
.side-more:focus-within .side-more-dot {
    background: #15803d;
}

/* Botão "mais" — sem escala/rotação no hover */
.side-more-btn:hover .side-icon,
.side-more-btn:focus-visible .side-icon {
    transform: none;
}

.side-more-btn:active .side-icon {
    transform: scale(0.98);
}

.side-more-btn .side-label {
    display: none;
}

/* Popover — linha horizontal à esquerda do botão "mais" */
.side-more-popover {
    position: absolute;
    right: 64px;
    top: 50%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(165, 232, 122, 0.5);
    border-radius: 40px;
    box-shadow:
        0 16px 36px -14px rgba(22, 101, 52, 0.35),
        0 4px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    opacity: 0;
    pointer-events: none;
    transform: translate(24px, -50%) scale(0.85);
    transform-origin: right center;
    will-change: transform, opacity;
    transition:
        opacity 0.35s ease,
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 6;
}

.side-more-popover::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(165, 232, 122, 0.5);
    border-top: 1px solid rgba(165, 232, 122, 0.5);
    border-radius: 2px;
}

.side-more:hover .side-more-popover,
.side-more:focus-within .side-more-popover {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%) scale(1);
}

/* Buffer invisível entre botão e popover */
.side-more::before {
    content: "";
    position: absolute;
    right: 52px;
    top: 50%;
    width: 20px;
    height: 80px;
    transform: translateY(-50%);
    pointer-events: none;
}

.side-more:hover::before {
    pointer-events: auto;
}

/* Stagger — cascata de entrada */
.side-more-popover .side-btn {
    opacity: 0;
    transform: translateX(18px) scale(0.6);
    transition:
        opacity 0.35s ease,
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.side-more:hover .side-more-popover .side-btn,
.side-more:focus-within .side-more-popover .side-btn {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.side-more-popover .side-btn:nth-child(1) { transition-delay: 0.05s; }
.side-more-popover .side-btn:nth-child(2) { transition-delay: 0.10s; }
.side-more-popover .side-btn:nth-child(3) { transition-delay: 0.15s; }
.side-more-popover .side-btn:nth-child(4) { transition-delay: 0.20s; }
.side-more-popover .side-btn:nth-child(5) { transition-delay: 0.25s; }
.side-more-popover .side-btn:nth-child(6) { transition-delay: 0.30s; }

/* Dentro do popover: labels acima do ícone */
.side-more-popover .side-btn .side-label {
    right: auto;
    left: 50%;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translate(-50%, 6px) scale(0.9);
    transform-origin: center bottom;
}

.side-more-popover .side-btn:hover .side-label,
.side-more-popover .side-btn:focus-visible .side-label {
    transform: translate(-50%, 0) scale(1);
}

.side-more-popover .side-btn .side-label::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -5px;
    transform: translateX(-50%) rotate(45deg);
}

/* ============================================
   Register Button
   ============================================ */

.btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: 14px 22px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border: none;
    border-radius: 18px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(22, 163, 74, 0.45), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: register-float 4s ease-in-out infinite;
}

.btn-register[hidden] {
    display: none;
}

.btn-register:hover {
    animation: none;
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 36px rgba(22, 163, 74, 0.6), 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-register:active {
    animation: none;
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.35);
}

.btn-register:disabled,
.btn-register:disabled:hover {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transform: none;
    animation: none;
    cursor: not-allowed;
    opacity: 0.68;
    overflow: visible;
}

.btn-register:disabled .btn-register-icon {
    animation: none;
    filter: grayscale(0.35) opacity(0.85);
}

.btn-register:disabled .btn-register-shimmer {
    display: none;
}

.btn-register[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: #fff;
    background: rgba(17, 24, 39, 0.92);
    padding: 7px 16px;
    border-radius: var(--radius-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

.btn-register[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .btn-register[data-tooltip]::after {
        display: none;
    }
}

.btn-register-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: none;
    pointer-events: none;
}

.btn-register-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
    animation: btn-pin-float 3s ease-in-out infinite;
}

@keyframes btn-pin-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

.btn-register:hover .btn-register-icon {
    animation: none;
    transform: translateY(-2px) scale(1.12);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 14px rgba(255, 255, 255, 0.35));
}

.btn-register-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    text-align: center;
}

.btn-register-title {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: #ffffff;
    line-height: var(--line-height-tight);
    letter-spacing: -0.01em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-register-subtitle {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    color: rgba(255, 255, 255, 0.82);
    line-height: var(--line-height-tight);
}

.btn-register-arrow {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-register:hover .btn-register-arrow {
    transform: translateX(4px);
}

@keyframes register-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

@keyframes register-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

@media (max-width: 480px) {
    .btn-register {
        width: 100%;
        padding: 14px 20px;
        animation: none;
        border-radius: 14px;
    }

    .btn-register-subtitle {
        white-space: normal;
    }

    .joint-option-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Module Panel — micro front-end container
   ============================================ */

.module-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
    z-index: 10;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.module-panel.panel-open {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    flex-shrink: 0;
}

.panel-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    transition: background 0.15s ease, color 0.15s ease;
}

.panel-close:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
}

.module-placeholder {
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

/* Sidebar button active state */
.side-btn-active .side-icon {
    transform: scale(1.12) rotate(-4deg);
    background:
        radial-gradient(circle at 30% 25%, #ffffff, #E8FAD8 55%, #BCEF8F 100%);
    border-color: #8BD55A;
    box-shadow:
        0 12px 24px -8px rgba(91, 168, 50, 0.55),
        0 2px 6px rgba(22, 101, 52, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.side-btn-active .side-icon::before {
    opacity: 1;
    transform: scale(1.35);
    animation: side-icon-halo 1.8s ease-out infinite;
}

/* Sidebar recua quando painel abre */
.module-panel.panel-open ~ .map-side-bar {
    right: 404px;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
    .map-side-bar {
        right: 12px;
        gap: 10px;
    }

    .side-btn,
    .side-icon {
        width: 44px;
        height: 44px;
    }

    .side-icon {
        font-size: 20px;
    }

    .side-label {
        right: 56px;
        padding: 8px 14px;
    }

    .module-panel {
        width: 100%;
        max-width: 100vw;
    }

    .module-panel.panel-open ~ .map-side-bar {
        right: 12px;
    }
}

/* ============================================
   Joint Modal — localização e registro de uso
   ============================================ */

.joint-modal-pin {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(188, 239, 143, 0.3), rgba(139, 213, 90, 0.15));
    border: 2px solid rgba(139, 213, 90, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 0 10px rgba(188, 239, 143, 0.12), 0 4px 20px rgba(22, 163, 74, 0.18);
}

.joint-modal-leaf {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(188, 239, 143, 0.35), rgba(139, 213, 90, 0.2));
    border: 2px solid rgba(139, 213, 90, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    line-height: 1;
    margin: 0 auto 20px;
    box-shadow: 0 0 0 10px rgba(188, 239, 143, 0.1);
}

.joint-option-group {
    margin-bottom: 20px;
}

.joint-option-label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.joint-option-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.joint-option-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.joint-option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 16px 8px 13px;
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.13s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.joint-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.joint-option-emoji {
    font-size: 28px;
    line-height: 1;
    transition: transform 0.13s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.joint-option-qty {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    letter-spacing: 0.12em;
    line-height: 1;
    transition: transform 0.13s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.joint-option-card:has(input:checked) .joint-option-qty {
    color: #166534;
}

.joint-option-card:hover .joint-option-qty {
    transform: scale(1.12) translateY(-1px);
}

.joint-option-text {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.2;
}

.joint-option-card:hover {
    border-color: #a5e87a;
    background: rgba(188, 239, 143, 0.13);
}

.joint-option-card:hover .joint-option-emoji {
    transform: scale(1.12) translateY(-1px);
}

.joint-option-card:has(input:checked) {
    background: linear-gradient(160deg, #BCEF8F 0%, #A5E87A 55%, #8BD55A 100%);
    border-color: transparent;
    box-shadow:
        0 0 0 1.5px rgba(139, 213, 90, 0.7),
        0 6px 16px rgba(91, 168, 50, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transform: translateY(-2px) scale(1.04);
}

.joint-option-card:has(input:checked) .joint-option-emoji {
    transform: scale(1.18) translateY(-1px);
}

.joint-option-card:has(input:checked) .joint-option-text {
    color: #166534;
    font-weight: var(--font-weight-semibold);
}

.joint-form-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border) 20%, var(--color-border) 80%, transparent);
    margin: 4px 0 20px;
}

.joint-activate-loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.joint-modal-card {
    max-width: 460px;
    min-width: 320px;
}

.joint-modal-card .auth-header {
    margin-bottom: 28px;
}

.joint-modal-card .auth-form {
    gap: 0;
}

.joint-modal-card {
    max-height: min(90dvh, 860px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.joint-detail-section {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.25s ease,
        transform  0.25s ease;
    margin-bottom: 0;
    pointer-events: none;
}

.joint-detail-section.is-visible {
    max-height: 800px;
    opacity: 1;
    transform: translateY(0);
    margin-bottom: 16px;
    pointer-events: auto;
}

.joint-detail-subsection {
    margin-bottom: 10px;
}

.joint-detail-subsection + .joint-detail-subsection {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.joint-detail-subsection-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 20px;
    padding: 3px 10px;
    margin-bottom: 8px;
}

.joint-category-header {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin: 10px 0 6px;
    user-select: none;
}

.joint-category-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
    opacity: 0.5;
}

.joint-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.joint-detail-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface-2);
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        border-color  0.15s ease,
        background    0.15s ease,
        color         0.15s ease,
        transform     0.12s ease,
        box-shadow    0.15s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.joint-detail-chip input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.joint-detail-chip:hover {
    border-color: rgba(165, 232, 122, 0.6);
    background: rgba(188, 239, 143, 0.08);
    color: var(--text-primary);
}

.joint-detail-chip:has(input:checked) {
    background: linear-gradient(135deg, #BCEF8F 0%, #8BD55A 100%);
    border-color: transparent;
    color: #14532d;
    font-weight: var(--font-weight-semibold);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(139, 213, 90, 0.4);
}

@media (hover: none) {
    .joint-detail-chip:hover {
        border-color: var(--color-border);
        background: var(--color-surface-2);
        color: var(--text-secondary);
    }
    .joint-detail-chip:active {
        transform: scale(0.96);
    }
}

.joint-custom-field {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.22s ease;
}

.joint-custom-field.is-visible {
    max-height: 70px;
    opacity: 1;
    margin-top: 10px;
}

.joint-custom-input {
    width: 100%;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface-2);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.joint-custom-input::placeholder {
    color: var(--text-muted, var(--text-secondary));
    opacity: 0.6;
}

.joint-custom-input:focus {
    border-color: rgba(165, 232, 122, 0.7);
    box-shadow: 0 0 0 3px rgba(139, 213, 90, 0.15);
}

.joint-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.joint-detail-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    opacity: 0.8;
}

.joint-detail-error {
    font-size: 11px;
    color: #f87171;
    margin-top: 6px;
    display: none;
}

.joint-detail-error.is-visible {
    display: block;
}

.joint-submit-row {
    margin-top: 20px;
}

@media (max-width: 360px) {
    .joint-option-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Success view ────────────────────────────────────────────────────────── */

.joint-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5) var(--space-5);
    text-align: center;
}

.joint-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(22, 163, 74, 0.4);
    animation: success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.joint-success-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.joint-success-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.joint-success-title {
    font-family: var(--font-family);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.joint-success-message {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
    max-width: 280px;
}

.joint-success-btn {
    width: 100%;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px 32px;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: opacity 0.15s;
}

.joint-success-btn:hover { opacity: 0.9; }

.joint-success-progress {
    width: 100%;
    height: 3px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.joint-success-progress-bar {
    height: 100%;
    width: 100%;
    background: #22c55e;
    transform-origin: left;
    transform: scaleX(1);
}

.joint-success-progress-bar--running {
    transition: transform 7s linear;
    transform: scaleX(0);
}

@keyframes success-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ── Nearby usage popup ──────────────────────────────────────────────────── */

.nearby-popup-wrap .maplibregl-popup-content {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
    padding: 12px 14px 10px;
    min-width: 200px;
    max-width: 260px;
    font-family: var(--font-family);
}

.nearby-popup-wrap .maplibregl-popup-tip {
    border-top-color: var(--color-surface);
}

.nearby-popup-wrap .maplibregl-popup-close-button {
    display: none;
}

.nearby-popup__user {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    margin-bottom: 4px;
}

.nearby-popup__badges {
    font-size: 14px;
    line-height: 1;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.nearby-popup__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: 6px;
}

.nearby-popup__chat {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}

.nearby-popup__chat:not([disabled]) {
    cursor: pointer;
    opacity: 1;
}

.nearby-popup__chat:not([disabled]):hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.nearby-popup__msg {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin: 0 0 6px;
    line-height: 1.45;
}

.nearby-popup__time {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
