: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;
}

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

.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;
}

.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-primary {
    background: var(--blue-mid);
    color: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(42, 95, 214, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--blue-accent);
}

.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 {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1.25rem;
}

.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;
}

/* ---------- Results panel ---------- */

.result-card {
    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 {
    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 system (custom, no bootstrap) ---------- */

.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-backdrop-custom[hidden] {
    display: none;
}

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

.modal-box {
    background: #fff;
    border-radius: 1rem;
    width: 100%;
    max-width: 46rem;
    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-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-desc {
    font-size: 0.85rem;
    color: var(--grey-text);
    line-height: 1.45;
    background: #f8faff;
    border: 1px solid #eef2fa;
    border-radius: 0.625rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.9rem;
}

.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 {
    background: #fbfdff;
    border: 1px solid #eef1f8;
    border-radius: 0.75rem;
    padding: 0.9rem;
}

.chart-panel-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.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.2rem;
}

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

.chart-input-group input {
    width: 4.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-soft);
    font-size: 0.78rem;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

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

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

#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;
}

.tooltip-trigger {
    position: relative;
    display: inline-block;
    cursor: help;
}

.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;
}

.tooltip-trigger:hover .price-tooltip {
    display: block;
}

.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;
}