:root {
    --blue-dark: #1a2a4a;
    --blue-accent: #1849b4;
    --blue-mid: #2a5fd6;
    --blue-soft: #4d8dff;
    --blue-hover: #7aa7ff;
    --blue-bg-1: #eef1f6;
    --blue-bg-2: #dbe8ff;
    --blue-grad-1: #d2e2fe;
    --blue-grad-2: #eef4ff;
    --grey-text: #4a5a72;
    --grey-label: #8a9bb8;
    --border-soft: rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6fb;
    color: #1b1e23;
}

/* =========================================================
   WELCOME INFORMATION MODAL
   ========================================================= */

.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 1rem;

    background: rgba(18, 28, 48, 0.58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    opacity: 0;
    transition: opacity 0.22s ease;
}

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

.welcome-modal.is-open {
    opacity: 1;
}


/* ---------------------------------------------------------
   Dialog
   --------------------------------------------------------- */

.welcome-modal__dialog {
    position: relative;

    width: min(920px, 100%);
    max-height: calc(100vh - 2rem);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.15rem;

    box-shadow:
        0 2rem 5rem rgba(12, 25, 55, 0.30),
        0 0.5rem 1.5rem rgba(12, 25, 55, 0.14);

    transform: translateY(18px) scale(0.97);
    opacity: 0;

    transition:
        transform 0.28s cubic-bezier(0.2, 0.85, 0.3, 1.15),
        opacity 0.2s ease;
}

.welcome-modal.is-open .welcome-modal__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}


/* ---------------------------------------------------------
   Close button
   --------------------------------------------------------- */

.welcome-modal__close {
    position: absolute;
    z-index: 5;

    top: 0.8rem;
    right: 0.8rem;

    width: 2.25rem;
    height: 2.25rem;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.88);
    color: #203354;

    font-family: Arial, sans-serif;
    font-size: 1.65rem;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 0.25rem 0.8rem rgba(15, 35, 70, 0.14);

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.welcome-modal__close:hover {
    background: #ffffff;
    color: var(--blue-accent);
    transform: scale(1.06);
}

.welcome-modal__close:active {
    transform: scale(0.96);
}

.welcome-modal__close:focus-visible {
    outline: 3px solid rgba(42, 95, 214, 0.3);
    outline-offset: 2px;
}


/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.welcome-modal__hero {
    flex: 0 0 auto;

    margin: 0.9rem 0.9rem 0;

    height: 245px;

    overflow: hidden;

    border-radius: 0.9rem;

    background:
        linear-gradient(
            135deg,
            #dbe8ff,
            #eef4ff
        );
}

.welcome-modal__hero-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    user-select: none;
}


/* ---------------------------------------------------------
   Main content
   --------------------------------------------------------- */

.welcome-modal__content {
    padding: 0.55rem 0.9rem 0;

    overflow-y: auto;
}


/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */

.welcome-section {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);

    gap: 1rem;

    padding: 1rem 0.85rem;

    border-bottom: 1px solid #e9eef7;
}

.welcome-section:last-child {
    border-bottom: 0;
}


/* Icon */

.welcome-section__icon {
    width: 3.9rem;
    height: 3.9rem;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 1rem;

    flex-shrink: 0;
}

.welcome-section__icon svg {
    width: 2rem;
    height: 2rem;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Audience icon */

.welcome-section--audience .welcome-section__icon {
    background: #edf4ff;
    color: var(--blue-accent);
}


/* Features icon */

.welcome-section--features .welcome-section__icon {
    background: #edf8f1;
    color: #2d9b58;
}


/* Limits icon */

.welcome-section--limits {
    background: linear-gradient(
        90deg,
        rgba(255, 247, 232, 0.65),
        rgba(255, 252, 244, 0.35)
    );
}

.welcome-section--limits .welcome-section__icon {
    background: #fff4df;
    color: #d98a00;
}


/* Text */

.welcome-section__body {
    min-width: 0;
}

.welcome-section__body h2 {
    margin: 0 0 0.45rem;

    color: var(--blue-dark);

    font-size: 1.15rem;
    font-weight: 750;
    line-height: 1.25;
}

.welcome-section__body p {
    margin: 0;

    color: #4a5a72;

    font-size: 0.83rem;
    line-height: 1.55;
}

.welcome-section__body p + p {
    margin-top: 0.55rem;
}

.welcome-section__body strong {
    color: #263a5c;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Features
   --------------------------------------------------------- */

.welcome-features {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    column-gap: 2rem;
    row-gap: 0.5rem;
}

.welcome-feature {
    display: flex;
    align-items: flex-start;

    gap: 0.5rem;

    color: #354762;

    font-size: 0.78rem;
    line-height: 1.45;
}

.welcome-feature--wide {
    grid-column: 1 / -1;
}

.welcome-feature__check {
    flex: 0 0 auto;

    margin-top: 0.05rem;

    color: #2d9b58;

    font-size: 0.9rem;
    font-weight: 800;
}

.welcome-feature-group {
    margin-top: 1rem;
}

.welcome-feature-group h2 {
    margin: 0 0 0.65rem;

    color: var(--blue-dark);

    font-size: 0.95rem;
    font-weight: 750;
    line-height: 1.25;
}

.welcome-feature-group + .welcome-feature-group {
    margin-top: 1.25rem;
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.welcome-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    margin: 0.25rem 0.9rem 0.9rem;
    padding: 0.75rem 0.9rem;

    border-radius: 0.75rem;

    background: linear-gradient(
        135deg,
        #eef4ff,
        #e4efff
    );
}


/* Hint */

.welcome-modal__hint {
    display: flex;
    align-items: center;

    gap: 0.5rem;

    color: var(--blue-accent);

    font-size: 0.76rem;
    line-height: 1.35;
}

.welcome-modal__hint svg {
    width: 1.25rem;
    height: 1.25rem;

    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
}


/* Start button */

.welcome-modal__start {
    flex: 0 0 auto;

    border: 0;
    border-radius: 0.625rem;

    padding: 0.7rem 1.25rem;

    background: linear-gradient(
        135deg,
        var(--blue-mid),
        var(--blue-accent)
    );

    color: #ffffff;

    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 0.3rem 0.8rem rgba(42, 95, 214, 0.28);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.welcome-modal__start:hover {
    transform: translateY(-1px);

    background: linear-gradient(
        135deg,
        var(--blue-accent),
        #4f8cff
    );

    box-shadow:
        0 0.5rem 1.1rem rgba(42, 95, 214, 0.35);
}

.welcome-modal__start:active {
    transform: translateY(0);
}

.welcome-modal__start:focus-visible {
    outline: 3px solid rgba(42, 95, 214, 0.25);
    outline-offset: 2px;
}


/* ---------------------------------------------------------
   Prevent page scrolling while modal is open
   --------------------------------------------------------- */

body.welcome-modal-open {
    overflow: hidden;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 720px) {

    .welcome-modal {
        padding: 0.5rem;
    }

    .welcome-modal__dialog {
        max-height: calc(100vh - 1rem);
        border-radius: 0.9rem;
    }

    .welcome-modal__hero {
        height: 180px;

        margin:
            0.65rem
            0.65rem
            0;
    }

    .welcome-modal__content {
        padding:
            0.35rem
            0.65rem
            0;
    }

    .welcome-section {
        grid-template-columns: 52px minmax(0, 1fr);

        gap: 0.75rem;

        padding: 0.8rem 0.45rem;
    }

    .welcome-section__icon {
        width: 2.8rem;
        height: 2.8rem;

        border-radius: 0.75rem;
    }

    .welcome-section__icon svg {
        width: 1.45rem;
        height: 1.45rem;
    }

    .welcome-section__body h2 {
        font-size: 0.95rem;
    }

    .welcome-section__body p {
        font-size: 0.78rem;
    }

    .welcome-features {
        grid-template-columns: 1fr;

        gap: 0.45rem;
    }

    .welcome-feature--wide {
        grid-column: auto;
    }

    .welcome-modal__footer {
        flex-direction: column;
        align-items: stretch;

        margin:
            0.2rem
            0.65rem
            0.65rem;
    }

    .welcome-modal__hint {
        justify-content: center;

        text-align: center;
    }

    .welcome-modal__start {
        width: 100%;
    }
}


@media (max-width: 480px) {

    .welcome-modal__hero {
        height: 145px;
    }

    .welcome-modal__close {
        top: 0.5rem;
        right: 0.5rem;

        width: 2rem;
        height: 2rem;
    }

    .welcome-section {
        grid-template-columns: 1fr;
    }

    .welcome-section__icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    .welcome-modal,
    .welcome-modal__dialog,
    .welcome-modal__start,
    .welcome-modal__close {
        transition: none;
    }
}

.page {
    max-width: 64rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}


.action-group {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.action-group-description {
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.action-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 0.3rem;
}

.action-group-text {
    max-width: 70rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--grey-text);
}

.action-group .actions-row {
    margin-top: 0;
}

.action-group .actions-secondary {
    margin-top: 0;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--blue-accent);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 0.625rem;
    background: #eef4ff;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.back-link:hover {
    background: #dfeaff;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.app-header-icon {
    width: 2.25rem;
    height: 2.25rem;
    background: var(--blue-mid);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-header-text h1 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--blue-dark);
    font-weight: 700;
}

.app-header-text p {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
    color: var(--grey-label);
    letter-spacing: 0.02em;
}

.app-intro {
    background: linear-gradient(135deg, var(--blue-grad-2), var(--blue-grad-1));
    border-radius: 0.9rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.app-intro-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--blue-dark);
}

.app-intro-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.app-intro-feature {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-accent);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
}

.card {
    background: #fff;
    border-radius: 0.9rem;
    box-shadow: 0 2px 0.625rem rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin: 0 0 0.9rem;
}

.filters {
    background: linear-gradient(135deg, var(--blue-grad-1), var(--blue-grad-2));
    padding: 1rem;
    border-radius: 0.9rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 11rem;
    min-width: 11rem;
}

.filter-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--grey-label);
    padding-left: 0.2rem;
}

.filter {
    position: relative;
}

.filter select,
.filter input {
    width: 100%;
    padding: 0.625rem 2.25rem 0.625rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.8125rem;
    color: #333;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.filter input {
    cursor: text;
    padding-right: 0.75rem;
}

.filter select:hover,
.filter input:hover {
    border-color: var(--blue-hover);
    box-shadow: 0 0 0 0.1875rem rgba(122, 167, 255, 0.15);
}

.filter select:focus,
.filter input:focus {
    border-color: var(--blue-soft);
    box-shadow: 0 0 0 0.1875rem rgba(77, 141, 255, 0.25);
}

.filter.has-arrow::after {
    content: "▾";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 0.75rem;
}

.address-hint {
    font-size: 0.78rem;
    color: var(--grey-label);
    margin-top: 0.5rem;
    padding-left: 0.15rem;
    transition: color 0.15s ease;
}

.address-hint.ok {
    color: #1d8a4f;
}

.address-hint.ok::before {
    content: "✓ ";
    font-weight: 700;
}

.address-hint.warn {
    color: #a5720a;
}

.address-hint.warn::before {
    content: "! ";
    font-weight: 700;
}

.card-params {
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 55%);
    border: 1px solid #e7edf8;
    position: relative;
    overflow: hidden;
}

.card-params::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--blue-mid), var(--blue-soft));
}

.card-params .card-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-params .card-title::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 0.2rem;
    background: var(--blue-mid);
    display: inline-block;
}

.fields-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 2rem;
    background: var(--blue-bg-2);
    color: var(--blue-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.9rem;
}

.fields-badge::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--blue-mid);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.9rem;
}

.field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--grey-label);
    margin-bottom: 0.3rem;
    padding-left: 0.15rem;
}

.field-control {
    position: relative;
}

.field select,
.field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border-soft);
    background: #fff;
    font-size: 0.85rem;
    color: #222;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.field select {
    appearance: none;
    cursor: pointer;
    padding-right: 2.1rem;
}

.field-control.has-arrow::after {
    content: "▾";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 0.7rem;
}

.field select:hover,
.field input:hover {
    border-color: var(--blue-hover);
}

.field select:focus,
.field input:focus {
    border-color: var(--blue-soft);
    box-shadow: 0 0 0 0.1875rem rgba(77, 141, 255, 0.25);
}

#suggestions {
    margin-top: 0.4rem;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: 0 0.375rem 1rem rgba(0, 0, 0, 0.08);
}

.suggestion {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    cursor: pointer;
    color: #333;
}

.suggestion:last-child {
    border-bottom: 0;
}
.suggestion:hover {
    background: var(--blue-bg-2);
    color: var(--blue-accent);
}

#map {
    height: 22rem;
    width: 100%;
    border-radius: 0.75rem;
    margin-top: 0.9rem;
    overflow: hidden;
    border: 1px solid #e3e8f2;
}

.map-category-control {
    display:flex;
    align-items:center;
    gap:.6rem;
    background:rgba(255,255,255,.85);
    padding:.5rem .9rem;
    border-radius:2rem;
    box-shadow:0 4px 14px rgba(0,0,0,.15);
    font-size:.9rem;
    color:#343a40;
    user-select:none;
    position:relative;
    z-index:1000;
}

.map-category-control select {
    appearance:none;
    -webkit-appearance:none;
    cursor:pointer;
    border:none;
    background:transparent;
    font-size:.9rem;
    color:#343a40;
    padding:.15rem 1.8rem .15rem .2rem;
    outline:none;
    font-weight:500;
    background-image:linear-gradient(45deg,transparent 50%,#343a40 50%),linear-gradient(135deg,#343a40 50%,transparent 50%);
    background-position:calc(100% - 12px) 50%,calc(100% - 7px) 50%;
    background-size:5px 5px,5px 5px;
    background-repeat:no-repeat;
}

.map-category-control select:hover {
    color:var(--blue-mid);
}

.map-category-control select:focus {
    outline:none;
}

.location-popup .maplibregl-popup-content {
    background:rgba(255,255,255,.9);
    padding:1rem 1.1rem;
    border-radius:1rem;
    box-shadow:0 4px 14px rgba(0,0,0,.15);
    font-size:.9rem;
    color:#343a40;
    min-width:220px;
}

.location-popup .maplibregl-popup-close-button {
    color:#343a40;
    font-size:1.1rem;
    padding:.4rem .6rem;
}

.location-popup .maplibregl-popup-close-button:hover {
    background:transparent;
    color:var(--blue-mid);
}

.location-popup .maplibregl-popup-tip {
    border-top-color:rgba(255,255,255,.9);
}

.popup-title {
    font-weight:600;
    font-size:1rem;
    color:#212529;
    margin-bottom:.4rem;
}

.popup-category {
    display:inline-block;
    background:rgba(42,95,214,.12);
    color:var(--blue-mid);
    padding:.2rem .6rem;
    border-radius:1rem;
    font-size:.8rem;
    margin-bottom:.5rem;
}

.popup-address {
    line-height:1.4;
    margin-bottom:.4rem;
}

.popup-distance {
    font-weight:500;
    color:#495057;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}


.btn-outline {
    background: #f4f7ff;
    color: var(--blue-accent);
    border-color: rgba(31, 79, 191, 0.2);
}

.btn-outline:hover:not(:disabled) {
    background: #e9f0ff;
    border-color: rgba(31, 79, 191, 0.35);
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 0.15rem solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner-dark {
    border: 0.15rem solid #e0e6f0;
    border-top-color: var(--blue-mid);
}

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

.actions-row {
    position: relative;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1.25rem;
    padding: 1.25rem;

    /* Brilliant grid */
    background-image:
        linear-gradient(
            rgba(42, 95, 214, 0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(42, 95, 214, 0.08) 1px,
            transparent 1px
        );

    background-size: 24px 24px;

    border: 1px solid rgba(42, 95, 214, 0.18);
    border-radius: 1rem;

    box-shadow:
        inset 0 0 2rem rgba(42, 95, 214, 0.06),
        0 0 1.5rem rgba(42, 95, 214, 0.08);
}


/* Brilliant glowing line moving across the grid */
.actions-row::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 40%,
        rgba(80, 150, 255, 0.08) 50%,
        transparent 60%,
        transparent 100%
    );

    background-size: 200% 100%;
    animation: gridShine 5s linear infinite;

    pointer-events: none;
    border-radius: inherit;
}


/* Make buttons stay above the grid */
.actions-row .btn {
    position: relative;
    z-index: 1;
}


/* Primary buttons */
.btn-primary {
    position: relative;
    overflow: hidden;

    background: linear-gradient(
        135deg,
        var(--blue-mid),
        var(--blue-accent)
    );

    color: #fff;

    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow:
        0 0.25rem 0.75rem rgba(42, 95, 214, 0.3),
        0 0 1rem rgba(42, 95, 214, 0.12);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}


/* Glossy light sweep */
.btn-primary::before {
    content: "";
    position: absolute;

    top: 0;
    left: -120%;

    width: 60%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );

    transform: skewX(-20deg);
    transition: left 0.6s ease;

    pointer-events: none;
}


.btn-primary:hover:not(:disabled) {
    background: linear-gradient(
        135deg,
        var(--blue-accent),
        #4f8cff
    );

    transform: translateY(-2px);

    box-shadow:
        0 0.5rem 1.25rem rgba(42, 95, 214, 0.4),
        0 0 1.5rem rgba(42, 95, 214, 0.35);
}


.btn-primary:hover:not(:disabled)::before {
    left: 130%;
}


.btn-primary:active:not(:disabled) {
    transform: translateY(0);

    box-shadow:
        0 0.2rem 0.5rem rgba(42, 95, 214, 0.3);
}


/* Grid light animation */
@keyframes gridShine {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.actions-secondary {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e3e8f2;
}

.actions-secondary[hidden] {
    display: none;
}


.result-card {
    margin-top: 1rem;
    border: 1px solid var(--blue-bg-2);
    background: linear-gradient(135deg, #fbfdff, #f2f7ff);
    animation: fadeInUp 0.35s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(0.6rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-price {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--blue-accent);
    line-height: 1.1;
}

.result-sub {
    color: var(--grey-text);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.result-stat {
    background: #fff;
    border-radius: 0.625rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #e6ecf7;
}

.result-stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-label);
    font-weight: 700;
}

.result-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-top: 0.2rem;
}

.result-error {
    color: #b3261e;
    background: #fdecea;
    border: 1px solid #f6cbc7;
    border-radius: 0.625rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.85rem;
}

.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 48, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-above {
    z-index: 1051;
}

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

.modal-backdrop-custom.open {
    opacity: 1;
}

.modal-box {
    background: #fff;
    border-radius: 1rem;
    width: 100%;
    max-width: 52rem;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1.5rem 3rem rgba(20, 28, 48, 0.25);
    transform: scale(0.96) translateY(0.5rem);
    opacity: 0;
    transition:
        transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2),
        opacity 0.18s ease;
}

.modal-backdrop-custom.open .modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-box.modal-xl {
    max-width: 56rem;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #edf1f8;
    flex-shrink: 0;
}

.modal-head-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.modal-head-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.55rem;
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-head h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.modal-head-subtitle {
    font-size: 0.72rem;
    color: var(--grey-label);
    margin-top: 0.1rem;
}

.modal-head-subtitle:empty {
    display: none;
}

.modal-close {
    border: 0;
    background: #f1f4fa;
    color: #5a6a85;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #e3e9f5;
    color: var(--blue-dark);
}

.modal-body-custom {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: var(--grey-label);
    font-size: 0.85rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f0f3f9;
    font-size: 0.85rem;
}

.data-row:last-child {
    border-bottom: 0;
}
.data-row .k {
    color: var(--grey-text);
}
.data-row .v {
    color: #1b1e23;
    font-weight: 600;
    text-align: right;
}

#objectsMap {
    height: 28rem;
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e3e8f2;
}

#objectsMap[hidden] {
    display: none;
}

.objects-count {
    font-size: 0.8rem;
    color: var(--grey-text);
    margin-bottom: 0.6rem;
}

.objects-count[hidden] {
    display: none;
}

.detail-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--blue-accent);
    margin-bottom: 0.15rem;
}

.detail-address {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1b1e23;
    margin-bottom: 0.9rem;
}

.detail-description-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0.8rem 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #e3e8f2;
    border-radius: 0.6rem;
    background: #f7f9fd;
    color: var(--blue-accent, #1849b4);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.detail-description-toggle:hover {
    background: #eef4ff;
}

.detail-description-toggle .arrow {
    transition: transform 0.15s ease;
}

.detail-description-toggle.open .arrow {
    transform: rotate(180deg);
}

.detail-description {
    display: none;
    margin: 0 0 0.9rem;
    padding: 0.8rem;
    border: 1px solid #e3e8f2;
    border-radius: 0.6rem;
    background: #fff;
    color: var(--grey-text, #4a5a72);
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.detail-description.open {
    display: block;
}

.detail-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.detail-links a {
    text-decoration: none;
}

.objects-toolbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.objects-toolbar[hidden] {
    display: none;
}

.objects-toolbar label {
    font-size: 0.8rem;
    color: var(--grey-text);
    font-weight: 600;
}

.objects-toolbar .filter {
    min-width: 11rem;
}

#objectsStats {
    margin-top: 1.1rem;
}
#objectsStats[hidden] {
    display: none;
}

#objectsStatCards {
    margin-bottom: 0.9rem;
}

.detail-group {
    margin-bottom: 1.1rem;
}
.detail-group:last-child {
    margin-bottom: 0;
}

.detail-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--grey-label);
    margin-bottom: 0.35rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

@media (max-width: 700px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.objects-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

@media (max-width: 700px) {
    .objects-charts {
        grid-template-columns: 1fr;
    }
}

.chart-panel-description {
  font-size:12px;
  line-height:1.5;
  color:#637394;
  margin:8px 0 12px;
}

.chart-panel-description strong {
  color:#0f2342;
}

.chart-formula {
  display:inline-block;
  padding:6px 10px;
  margin-bottom:10px;
  background:#f2f5f9;
  border:1px solid #dbe4f0;
  border-radius:7px;
  font-family:monospace;
  font-size:12px;
  color:#0f2342;
}

.chart-panel--pie {
    display: flex;
    flex-direction: column;
}

.chart-panel {
    --panel-accent-1: var(--blue-mid);
    --panel-accent-2: var(--blue-soft);
    background: #fbfdff;
    border: 1px solid #eef1f8;
    border-radius: 0.9rem;
    padding: 1rem 1rem 0.9rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 0.75rem rgba(20, 28, 48, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.chart-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.22rem;
    background: linear-gradient(90deg, var(--panel-accent-1), var(--panel-accent-2));
}

.chart-panel:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(20, 28, 48, 0.07);
    transform: translateY(-1px);
}

.chart-panel--sale {
    --panel-accent-1: #1849b4;
    --panel-accent-2: #4d8dff;
}

.chart-panel--rent {
    --panel-accent-1: #0f9d6b;
    --panel-accent-2: #4fd8a5;
}

.chart-panel--mult {
    --panel-accent-1: #7a3fd1;
    --panel-accent-2: #b088f5;
}

.chart-panel--yield {
    --panel-accent-1: #c98a12;
    --panel-accent-2: #f5c452;
}

.chart-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.chart-panel-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--panel-accent-1), var(--panel-accent-2));
    box-shadow: 0 2px 0.5rem rgba(0, 0, 0, 0.12);
}

.chart-panel-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.chart-panel:not(:has(.chart-panel-title-row)) .chart-panel-title {
    margin-bottom: 0.5rem;
}

.chart-inputs {
    display: flex;
    gap: 0.6rem;
}

.chart-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chart-input-group label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--grey-label);
}

.chart-input-control {
    display: flex;
    align-items: stretch;
    width: 4.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-soft);
    background: #fff;
    overflow: hidden;
    transition: all 0.15s ease;
}

.chart-input-control:hover {
    border-color: var(--blue-hover);
}

.chart-input-control:focus-within {
    border-color: var(--blue-soft);
    box-shadow: 0 0 0 0.1875rem rgba(77, 141, 255, 0.25);
}

.chart-input-group input {
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0.15rem 0.3rem 0.55rem;
    border: 0;
    background: transparent;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--blue-dark);
    outline: none;
}

.chart-input-suffix {
    flex: 0 0 auto;
    padding: 0.3rem 0.45rem 0.3rem 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--grey-label);
    background: #f4f7fc;
    display: flex;
    align-items: center;
}

#locationFrame {
    width: 100%;
    height: 26rem;
    border: 0;
    border-radius: 0.75rem;
    background: #f4f6fb;
}

#objectsDashboard {
    margin-top: 1.4rem;
}

.location-radius-control {
    background: #fbfdff;
    border: 1px solid #eef1f8;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
}

.location-radius-control label {
    display: block;
    font-size: 0.8rem;
    color: var(--grey-text);
    margin-bottom: 0.5rem;
}

.location-radius-control label b {
    color: var(--blue-dark);
}

.location-radius-control input[type="range"] {
    width: 100%;
    accent-color: var(--blue-accent, #1849b4);
}

@media (max-width: 600px) {
    .page {
        padding: 1rem 0.65rem 3rem;
    }
    .filters {
        flex-direction: column;
    }
}

.map-wrapper {
    position: relative;
}

#zones-toggle-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 0.9rem;
    border-radius: 2rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    color: #343a40;
    user-select: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 2.6rem;
    height: 1.5rem;
    flex: 0 0 auto;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: background-color 0.25s;
    border-radius: 1.5rem;
}

.switch .slider::before {
    position: absolute;
    content: "";
    height: 1.1rem;
    width: 1.1rem;
    left: 0.2rem;
    bottom: 0.2rem;
    background-color: #fff;
    transition: transform 0.25s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.switch input:checked + .slider {
    background-color: var(--blue-mid);
}

.switch input:checked + .slider::before {
    transform: translateX(1.1rem);
}

.switch input:disabled + .slider {
    opacity: 0.5;
    cursor: wait;
}


.price-tooltip {
    position: absolute;
    bottom: calc(100% + 12px); /* popup above */
    left: 50%;
    transform: translateX(-50%);

    display: none;

    min-width: 340px;
    max-width: 500px;
    max-height: 400px;
    overflow-y: auto;

    padding: 14px;
    border-radius: 8px;

    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);

    text-align: left;
    font-size: 13px;
    line-height: 1.45;

    z-index: 9999;
}

.price-tooltip hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #eee;
}

.price-tooltip strong {
    color: #222;
}

#locationScores {
    margin: 20px 0;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 15px;
}

.rating-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #eee;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
}

.rating-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rating-name {
    font-size: 14px;
    color: #555;
}

.rating-value {
    font-size: 26px;
    font-weight: 700;
}

.rating-bar {
    height: 8px;
    background: #ededed;
    border-radius: 10px;
    overflow: hidden;
}

.rating-progress {
    height: 100%;
    background: #4caf50;
}

.location-header-card {
    background: #fff;
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
}

.location-header-address {
    font-size: 18px;
    font-weight: 600;
}

.location-header-coords {
    margin-top: 10px;
    color: var(--grey-text);
}

.deal-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem;
    background: #eef4ff;
    border: 1px solid #dbe8ff;
    border-radius: 0.75rem;
    gap: 0.2rem;
}

.deal-toggle button {
    border: 0;
    background: transparent;
    color: var(--grey-text);
    padding: 0.45rem 0.9rem;
    border-radius: 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.deal-toggle button:hover {
    color: var(--blue-accent);
    background: rgba(255, 255, 255, 0.7);
}

.deal-toggle button.active {
    background: var(--blue-mid);
    color: #fff;
    box-shadow: 0 0.2rem 0.5rem rgba(42, 95, 214, 0.25);
}

.deal-toggle button:active {
    transform: scale(0.97);
}

.deals-toolbar{
    display:flex;
    align-items:center;
    gap:1rem;
    flex-wrap:wrap;
    margin-bottom:1rem;
}

.deals-radius{
    display:flex;
    align-items:center;
    gap:.7rem;
    padding:.75rem 1rem;
    border:1px solid #dbe8ff;
    border-radius:.75rem;
    background:linear-gradient(135deg,#eef4ff,#f9fbff);
}

.deals-radius input{
    width:220px;
}

.deals-radius-value{
    min-width:70px;
    font-weight:700;
    color:#1a2a4a;
}

.deals-table-wrap{
    overflow:auto;
    border:1px solid #e5ebf5;
    border-radius:.75rem;
    box-shadow:0 .2rem .8rem rgba(0,0,0,.04);
}

.deals-table{
    width:100%;
    border-collapse:collapse;
    white-space:nowrap;
    font-size:.8rem;
}

.deals-table th{
    position:sticky;
    top:0;
    background:#fbfdff;
    padding:.75rem;
    color:#8a9bb8;
    text-transform:uppercase;
    font-size:.66rem;
    letter-spacing:.05em;
    border-bottom:1px solid #e8edf6;
}

.deals-table td{
    padding:.7rem .75rem;
    border-bottom:1px solid #eef2f8;
}

.deals-table tbody tr{
    transition:.12s;
}

.deals-table tbody tr:nth-child(even){
    background:#fcfdff;
}

.deals-table tbody tr:hover{
    background:#eef4ff;
}

.deals-table td.num{
    text-align:right;
    font-variant-numeric:tabular-nums;
}

.deals-table td.street{
    max-width:18rem;
    overflow:hidden;
    text-overflow:ellipsis;
}

.deal-badge{
    display:inline-block;
    padding:.18rem .55rem;
    border-radius:.45rem;
    background:#eef4ff;
    color:#1849b4;
    font-weight:700;
}

.details-wrap {
    position: relative;
    display: inline-flex;
}

.details-btn {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 1px solid var(--blue-soft);
    background: #eef4ff;
    color: var(--blue-accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: help;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.details-btn:hover {
    background: var(--blue-mid);
    color: white;
}

.details-popover {
    position: absolute;
    left: 50%;
    top: calc(100% + 0.35rem);
    transform: translateX(-50%);
    width: 20rem;
    max-height: 11rem;
    overflow-y: auto;

    background: white;
    border-radius: 0.75rem;
    padding: 0.9rem;

    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.15);
    border: 1px solid #e5ebf5;

    font-size: 0.78rem;
    color: #334155;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    
    z-index: 9999;
}

.details-wrap:hover .details-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-0.15rem);
}

.details-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 0.7rem;
}

.details-title {
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 0.4rem;
}

.details-popover hr {
    border: 0;
    border-top: 1px solid #e5ebf5;
    margin: 0.5rem 0;
}

.details-popover div:not(.details-title) {
    margin-bottom: 0.25rem;
}

.details-popover:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.param-row {
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.45rem;

    background: #f7faff;
    border: 1px solid #e5ebf5;
    border-radius: 0.55rem;

    transition: background 0.15s ease, border-color 0.15s ease;
}

.param-row:hover {
    background: var(--blue-bg-2);
    border-color: var(--blue-hover);
}

.param-key {
    color: var(--grey-label);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    margin-bottom: 0.25rem;
    
    /* allow full names */
    white-space: normal;
    word-break: break-word;
}

.param-value {
    color: var(--blue-dark);
    font-size: 0.85rem;
    font-weight: 600;

    background: white;
    padding: 0.25rem 0.45rem;
    border-radius: 0.35rem;
    border: 1px solid #e5ebf5;

    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}

/* =========================
   Report Modal
   ========================= */

#reportModal .modal-box {
    width: min(100% - 2rem, 42rem);
}

#reportModal .modal-body-custom {
    padding: 1.25rem;
}

#reportModal .report-description {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--grey-text);
}

#reportModal .report-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed #e3e8f2;
}

#reportModal .report-actions .btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
}

#reportModal #reportChapters {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

#reportModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e7edf8;
}

#reportModal #generateReportButton {
    min-width: 10rem;
}

/* Адаптивность */
@media (max-width: 30rem) {
    #reportModal .modal-body-custom {
        padding: 1rem;
    }

    #reportModal .report-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #reportModal .report-actions .btn {
        width: 100%;
    }

    #reportModal .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    #reportModal #generateReportButton {
        width: 100%;
    }
}

#analyticsListingsModal .modal-box {
    width: min(64rem, calc(100vw - 2rem));
    max-width: 64rem;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    border-radius: 1rem;
    background: #f4f6fb;
    box-shadow: 0 1.5rem 4rem rgba(26, 42, 74, 0.2);
}

#analyticsListingsModal .modal-head {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-accent));
    color: #fff;
    border-bottom: 0;
}

#analyticsListingsModal .modal-head h5 {
    color: #fff;
}

#analyticsListingsModal .modal-body-custom {
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 7rem);
}

.analytics-listings {
    width: 100%;
    min-width: 0;
}

.analytics-listings-summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0 1.1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--blue-grad-1), var(--blue-grad-2));
    color: var(--blue-dark);
    font-size: 0.8rem;
}

.analytics-listings-summary-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 0.6rem;
    background: var(--blue-accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
}

.analytics-listing-group {
    margin-bottom: 1.1rem;
    padding: 0.9rem;
    background: #fff;
    border: 1px solid #e7edf8;
    border-radius: 0.9rem;
    box-shadow: 0 2px 0.625rem rgba(0, 0, 0, 0.04);
}

.analytics-listing-group:last-child {
    margin-bottom: 0;
}

.analytics-listing-group h4 {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.analytics-listing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.7rem;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
}

.analytics-listing-badge::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
}

.analytics-listing-badge--min { background: linear-gradient(135deg, #0f9d6b, #4fd8a5); }
.analytics-listing-badge--q1 { background: linear-gradient(135deg, #2a8fd6, #6ab8ff); }
.analytics-listing-badge--median { background: linear-gradient(135deg, var(--blue-mid), var(--blue-soft)); }
.analytics-listing-badge--q3 { background: linear-gradient(135deg, #c98a12, #f5c452); }
.analytics-listing-badge--max { background: linear-gradient(135deg, #c0392b, #e77a6d); }

.analytics-listing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.7rem;
}

.analytics-listing-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem;
    border: 1px solid #e7edf8;
    border-radius: 0.8rem;
    background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.analytics-listing-card:hover {
    border-color: var(--blue-hover);
    box-shadow: 0 0.4rem 1.1rem rgba(24, 73, 180, 0.1);
    transform: translateY(-2px);
}

.analytics-listing-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.analytics-listing-unit-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--blue-accent);
    line-height: 1.2;
}

.analytics-listing-unit-price span {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--grey-label);
    text-transform: none;
    letter-spacing: 0;
}

.analytics-listing-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.5rem;
    background: var(--blue-accent);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.analytics-listing-link:hover {
    background: var(--blue-mid);
    transform: translateY(-1px);
}

.analytics-listing-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.analytics-listing-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem 0.55rem;
    background: #f4f7fc;
    border-radius: 0.5rem;
}

.analytics-listing-stat-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--grey-label);
}

.analytics-listing-stat-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.analytics-listing-card-address {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    color: var(--grey-text);
    font-size: 0.76rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.analytics-listing-card-address svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--blue-soft);
}

.analytics-listing-card-date {
    color: var(--grey-label);
    font-size: 0.68rem;
    padding-top: 0.3rem;
    border-top: 1px dashed #e7edf8;
}

.analytics-empty {
    margin: 0;
    padding: 0.8rem;
    border-radius: 0.6rem;
    background: #f7f9fc;
    color: var(--grey-label);
    font-size: 0.76rem;
    text-align: center;
}

@media (max-width: 600px) {
    #analyticsListingsModal .modal-box {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        border-radius: 0.8rem;
    }

    #analyticsListingsModal .modal-body-custom {
        padding: 0.65rem;
        max-height: calc(100vh - 5rem);
    }

    .analytics-listing-group {
        padding: 0.7rem;
    }

    .analytics-listing-cards {
        grid-template-columns: 1fr;
    }
}