/* ===== Общие стили ===== */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
}
/* ===== Карта ===== */
#map {
    width: 100%;
    height: 100%;
}

/* Скрываем стандартные кнопки масштаба OpenLayers */
.ol-zoom {
    display: none;
}
/* ===== Hover ===== */
#hoverPopup {
    position: absolute;
    display: none;
    background: white;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    pointer-events: none;
    font-size: 14px;
    z-index: 1000;
}
/* ===== Правая панель ===== */
#infoPanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: #ffffff;
    box-shadow: -3px 0 15px rgba(0,0,0,.25);
    display: none;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2000;
}
/* ===== Кнопка закрытия ===== */
#closePanel {
    position: absolute;
    top: 15px;
    right: 15px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
}
/* ===== Заголовок ===== */
#infoPanel h2 {
    margin-top: 0;
    margin-bottom: 25px;
}
/* ===== Поля карточки ===== */
.info-row {
    margin-bottom: 18px;
}
.info-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 4px;
}
.info-value {
    color: #111;
    word-break: break-word;
}

.inn-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1769aa;
    font-weight: 600;
    text-decoration: none;
}

.inn-link:hover {
    color: #0d4f86;
    text-decoration: underline;
}

.inn-link:focus-visible {
    border-radius: 3px;
    outline: 2px solid #1769aa;
    outline-offset: 2px;
}

.inn-link svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

/* ===== Балансовые запасы лицензии ===== */

.balance-section {
    margin-top: 26px;
}

.balance-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: bold;
}

.balance-title span {
    color: #777;
    font-size: 11px;
    font-weight: normal;
    white-space: nowrap;
}

.balance-status {
    padding: 13px;
    border-radius: 7px;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    text-align: center;
}

.balance-records {
    display: grid;
    gap: 10px;
}

.balance-record {
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.balance-record-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    background: #f3f5f7;
}

.balance-record-heading > div {
    display: grid;
    gap: 4px;
}

.balance-record-heading strong {
    font-size: 13px;
}

.balance-unit {
    color: #666;
    font-size: 10px;
    white-space: nowrap;
}

.balance-mineral-badge {
    width: fit-content;
    padding: 2px 5px;
    border-radius: 4px;
    background: #e8f1fb;
    color: #1769aa;
    font-size: 9px;
    font-weight: bold;
    line-height: 1.2;
    text-transform: uppercase;
}

.balance-row {
    padding: 9px 10px;
    border-top: 1px solid #e7e7e7;
}

.balance-label {
    margin-bottom: 7px;
    color: #555;
    font-size: 11px;
    font-weight: bold;
}

.balance-protocol-row {
    background: #fffdf7;
}

.balance-protocol {
    color: #222;
    font-size: 12px;
    line-height: 1.35;
}

.balance-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 6px;
}

.balance-category {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
    padding: 6px 7px;
    border-radius: 5px;
    background: #f7f7f7;
}

.balance-category span {
    color: #777;
    font-size: 10px;
}

.balance-category strong {
    color: #222;
    font-size: 12px;
}

.balance-years {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.balance-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 5px;
    background: #f7f7f7;
}

.balance-year span {
    color: #777;
    font-size: 9px;
}

.balance-year strong {
    color: #222;
    font-size: 11px;
}

/* ===== Координаты лицензии ===== */

.coordinates-section {
    margin-top: 28px;
}

.coordinates-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: bold;
}

.coordinates-test-badge {
    padding: 3px 6px;
    border-radius: 5px;
    background: #fff1e8;
    color: #d85d0b;
    font-size: 9px;
    font-weight: bold;
    line-height: 1.2;
    text-transform: uppercase;
}

.coordinates-crs {
    margin: -4px 0 10px;
    color: #666;
    font-size: 12px;
}

.coordinates-status {
    padding: 14px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
    text-align: center;
}

.coordinates-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.coordinates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.coordinates-table th,
.coordinates-table td {
    padding: 7px 8px;
    border: 1px solid #ddd;
    text-align: center;
    white-space: nowrap;
}

.coordinates-table th {
    background: #f0f0f0;
    font-weight: bold;
}

.coordinates-table th:first-child,
.coordinates-table td:first-child {
    width: 35px;
    text-align: center;
}
/* =======================================
   Панель слоёв
   ======================================= */
#layersButton {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 8px;
    background: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    z-index: 3000;
}
#layersPanel.open {
	display:block;
}
#layersButton:hover {
    background: #f0f0f0;
}

/* =======================================
   Измерение расстояния
   ======================================= */

#measureButton {
    position: fixed;
    top: 70px;
    left: 15px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    font-size: 21px;
    cursor: pointer;
    z-index: 3000;
}

#measureButton:hover {
    background: #f0f0f0;
}

#measureButton.active {
    background: #1677ff;
    color: white;
}

#measureStatus {
    position: fixed;
    bottom: 24px;
    left: 50%;
    min-height: 42px;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 8px 0 16px;
    transform: translateX(-50%);
    border-radius: 8px;
    background: white;
    box-shadow: 0 3px 14px rgba(0,0,0,.3);
    color: #222;
    font-size: 14px;
    font-weight: bold;
    z-index: 3000;
}

#clearMeasure {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 18px;
    cursor: pointer;
}

#clearMeasure:hover {
    background: #f0f0f0;
    color: #111;
}

#map.measure-active,
#map.measure-active * {
    cursor: crosshair !important;
}

#layersPanel {
    position: fixed;
    top: 235px;
    left: 15px;
    width: 290px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    z-index: 3000;
    display: none;
}

/* =======================================
   Пользовательские точки
   ======================================= */

#userPointsButton {
    position: fixed;
    top: 125px;
    left: 15px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    font-size: 21px;
    cursor: pointer;
    z-index: 3000;
}

#userPointsButton:hover {
    background: #f0f0f0;
}

#userPointsButton.active {
    background: #7c3aed;
    color: white;
}

#userPointsPanel {
    position: fixed;
    top: 235px;
    left: 15px;
    width: 330px;
    max-height: calc(100vh - 260px);
    display: none;
    overflow: hidden;
    border-radius: 8px;
    background: white;
    box-shadow: 0 3px 14px rgba(0,0,0,.3);
    z-index: 3000;
}

/* =======================================
   Предварительная оценка обеспеченности
   ======================================= */

#assessmentButton {
    position: fixed;
    top: 180px;
    left: 15px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: #0f766e;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    color: white;
    cursor: pointer;
    z-index: 3000;
}

#assessmentButton span {
    display: none;
}

#assessmentButton:hover {
    background: #0b625c;
}

#assessmentButton svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

#assessmentBackdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
    box-sizing: border-box;
    z-index: 6000;
}

#assessmentWindow {
    width: min(1080px, 100%);
    max-height: calc(100vh - 44px);
    overflow: hidden;
    border-radius: 13px;
    background: #f6f8fb;
    box-shadow: 0 18px 60px rgba(0,0,0,.4);
}

.assessment-window-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 19px 22px;
    border-bottom: 1px solid #dce2e9;
    background: white;
}

.assessment-window-header h2 {
    margin: 3px 0 0;
    color: #172033;
    font-size: 21px;
}

.assessment-kicker {
    color: #0f766e;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: .1em;
    text-transform: uppercase;
}

#closeAssessment {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    border: none;
    border-radius: 7px;
    background: #f1f3f6;
    color: #4b5563;
    font-size: 19px;
    cursor: pointer;
}

#closeAssessment:hover {
    background: #e5e7eb;
    color: #111827;
}

#assessmentContent {
    max-height: calc(100vh - 135px);
    overflow-y: auto;
    padding: 18px 22px 24px;
    box-sizing: border-box;
}

.assessment-loading,
.assessment-empty,
.assessment-error {
    padding: 48px 20px;
    color: #667085;
    text-align: center;
}

.assessment-empty strong,
.assessment-error strong {
    display: block;
    margin-bottom: 8px;
    color: #273142;
    font-size: 17px;
}

.assessment-open-contracts {
    margin-top: 18px;
    padding: 10px 16px;
    border: none;
    border-radius: 7px;
    background: #0f766e;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.assessment-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 14px;
}

.assessment-summary-card {
    min-height: 72px;
    padding: 12px 13px;
    border: 1px solid #dce3ea;
    border-radius: 9px;
    background: white;
    box-sizing: border-box;
}

.assessment-summary-card.wide {
    grid-column: span 2;
}

.assessment-summary-label {
    display: block;
    margin-bottom: 6px;
    color: #758092;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.assessment-summary-value {
    color: #172033;
    font-size: 17px;
    font-weight: bold;
}

.assessment-reserve-summary {
    display: grid;
    gap: 3px;
    color: #273142;
    font-size: 12px;
}

.assessment-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: bold;
}

.assessment-status-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 50%;
}

.assessment-status.green .assessment-status-dot { background: #16a34a; }
.assessment-status.yellow .assessment-status-dot { background: #eab308; }
.assessment-status.red .assessment-status-dot { background: #dc2626; }
.assessment-status.neutral .assessment-status-dot { background: #9ca3af; }

.assessment-section {
    margin-top: 13px;
    padding: 15px;
    border: 1px solid #dce3ea;
    border-radius: 10px;
    background: white;
}

.assessment-section h3 {
    margin: 0 0 12px;
    color: #273142;
    font-size: 15px;
}

.assessment-contract-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
}

.assessment-contract-field.wide {
    grid-column: 1 / -1;
}

.assessment-contract-field span {
    display: block;
    margin-bottom: 3px;
    color: #7a8494;
    font-size: 10px;
}

.assessment-contract-field strong {
    display: block;
    color: #222b3a;
    font-size: 12px;
    line-height: 1.4;
}

.assessment-notice {
    margin-top: 13px;
    padding: 11px 13px;
    border-radius: 8px;
    background: #f4f4f5;
    color: #52525b;
    font-size: 12px;
    line-height: 1.45;
}

.assessment-notice.warning {
    background: #fff8e1;
    color: #795700;
}

.assessment-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.assessment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.assessment-table th,
.assessment-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #e7ebf0;
    text-align: left;
    vertical-align: top;
}

.assessment-table th {
    background: #f7f8fa;
    color: #667085;
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.assessment-table tbody tr:last-child td {
    border-bottom: none;
}

.assessment-table-number {
    white-space: nowrap;
}

.assessment-reserve-lines {
    display: grid;
    gap: 3px;
}

.assessment-row-status {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: bold;
    white-space: nowrap;
}

.assessment-row-status.green { background: #dcfce7; color: #166534; }
.assessment-row-status.yellow { background: #fef9c3; color: #854d0e; }
.assessment-row-status.red { background: #fee2e2; color: #991b1b; }
.assessment-row-status.neutral { background: #e5e7eb; color: #4b5563; }

.assessment-disclaimer {
    margin-top: 15px;
    padding: 14px 16px;
    border-left: 4px solid #64748b;
    border-radius: 7px;
    background: #eef1f5;
    color: #4b5563;
    font-size: 11px;
    line-height: 1.5;
}

.assessment-disclaimer strong {
    display: block;
    margin-bottom: 5px;
    color: #273142;
}

.assessment-disclaimer ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

@media (max-width: 760px) {
    .assessment-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .assessment-contract-grid {
        grid-template-columns: 1fr;
    }

    .assessment-contract-field.wide {
        grid-column: auto;
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #ddd;
    font-size: 17px;
}

.panel-header button {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.user-points-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.user-points-actions button {
    padding: 9px 8px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.user-points-actions button:hover {
    border-color: #7c3aed;
    background: #f7f3ff;
}

#userPointsList {
    max-height: calc(100vh - 310px);
    overflow-y: auto;
}

.user-point-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #eee;
}

.user-point-info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 11px 14px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
}

.user-point-info:hover {
    background: #f7f3ff;
}

.user-point-info span {
    overflow: hidden;
    color: #777;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-user-point {
    width: 42px;
    border: none;
    background: white;
    cursor: pointer;
}

.delete-user-point:hover {
    background: #fff0f0;
}

.user-points-message {
    padding: 18px;
    color: #777;
    text-align: center;
}

#pointAddStatus {
    position: fixed;
    bottom: 24px;
    left: 50%;
    display: none;
    padding: 12px 18px;
    transform: translateX(-50%);
    border-radius: 8px;
    background: #7c3aed;
    box-shadow: 0 3px 14px rgba(0,0,0,.3);
    color: white;
    font-size: 14px;
    font-weight: bold;
    z-index: 3000;
}

#map.point-add-active,
#map.point-add-active * {
    cursor: crosshair !important;
}

#pointFormBackdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    z-index: 5000;
}

#pointForm {
    width: min(520px, calc(100vw - 30px));
    overflow: hidden;
    border-radius: 10px;
    background: white;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

#pointForm > label {
    display: flex;
    margin: 14px 18px;
    flex-direction: column;
    gap: 6px;
    color: #444;
    font-size: 13px;
    font-weight: bold;
}

#pointForm input,
#pointForm textarea,
#pointForm select {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    font: 14px Arial, sans-serif;
}

#pointForm input:focus,
#pointForm textarea:focus,
#pointForm select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124,58,237,.12);
}

.point-coordinate-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 18px;
}

.point-coordinate-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #444;
    font-size: 13px;
    font-weight: bold;
}

.point-coordinate-hint {
    margin: -5px 18px 12px;
    color: #777;
    font-size: 12px;
    line-height: 1.4;
}

#pointFormError {
    min-height: 18px;
    margin: 0 18px;
    color: #c62828;
    font-size: 13px;
}

.point-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 18px 18px;
}

.point-form-actions button {
    padding: 9px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.point-form-actions button.primary {
    border-color: #7c3aed;
    background: #7c3aed;
    color: white;
}

@media (max-width: 600px) {
    .point-coordinate-fields {
        grid-template-columns: 1fr;
    }
}
#layersPanel h3 {
    margin-top: 0;
    margin-bottom: 17px;
}

.layers-section-title {
    margin-bottom: 10px;
    color: #777;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.layers-objects-section {
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid #e2e6ec;
}

.construction-layer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.construction-layer-row label {
    min-width: 0;
    flex: 1;
    margin-bottom: 0 !important;
}

#openConstructionPanel {
    width: 30px;
    height: 30px;
    display: flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d8dee7;
    border-radius: 6px;
    background: #f7f8fa;
    color: #4f5965;
    cursor: pointer;
}

#openConstructionPanel:hover {
    border-color: #1677ff;
    background: #eef5ff;
    color: #1677ff;
}

#openConstructionPanel svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== Панель объектов строительства ===== */

#constructionPanel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    display: none;
    overflow: hidden;
    box-sizing: border-box;
    background: #ffffff;
    box-shadow: -3px 0 15px rgba(0,0,0,.25);
    z-index: 2100;
    flex-direction: column;
}

.construction-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.construction-panel-header h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

#constructionSummary {
    color: #6b7280;
    font-size: 12px;
}

#closeConstructionPanel {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #555;
    font-size: 22px;
    cursor: pointer;
}

#closeConstructionPanel:hover {
    background: #f0f0f0;
}

.construction-panel-tools {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #eceff3;
    background: #fafbfc;
}

#constructionSearch {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d5dae2;
    border-radius: 7px;
    background: white;
    font: 13px Arial, sans-serif;
    outline: none;
}

#constructionSearch:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
}

#constructionList {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

#constructionDetails {
    display: none;
    flex: 0 0 auto;
    max-height: 45vh;
    overflow-y: auto;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #fffaf5;
}

#constructionDetails.visible {
    display: block;
}

#constructionDetails h3 {
    margin: 0 0 14px;
    padding-right: 4px;
    color: #222;
    font-size: 15px;
    line-height: 1.4;
}

.construction-detail-row {
    margin-bottom: 12px;
}

.construction-detail-row:last-child {
    margin-bottom: 0;
}

.construction-detail-label {
    margin-bottom: 3px;
    color: #777;
    font-size: 11px;
}

.construction-detail-value {
    color: #222;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-line;
    word-break: break-word;
}

.construction-item {
    position: relative;
    width: 100%;
    display: block;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 12px 13px 11px 17px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: white;
    color: #222;
    text-align: left;
    cursor: pointer;
}

.construction-item::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 5px;
    width: 4px;
    border-radius: 3px;
    background: #f97316;
}

.construction-item:hover:not(:disabled) {
    border-color: #dce7f7;
    background: #f7faff;
}

.construction-item.active {
    border-color: #f97316;
    background: #fff7ed;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, .16);
}

.construction-item.active::after {
    content: "выбран";
    position: absolute;
    top: 10px;
    right: 9px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f97316;
    color: white;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
}

.construction-item.active .construction-item-status {
    display: none;
}

.construction-item:disabled {
    opacity: .56;
    cursor: not-allowed;
}

.construction-item strong,
.construction-item span {
    display: block;
}

.construction-item .construction-item-contractor {
    margin-top: 3px;
    color: #424b57;
}

.construction-item strong {
    margin-bottom: 5px;
    padding-right: 44px;
    font-size: 13px;
    line-height: 1.35;
}

.construction-item span {
    overflow: hidden;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.construction-item-status {
    position: absolute;
    top: 12px;
    right: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    background: #f1f3f5;
    color: #777;
    font-size: 9px;
    font-style: normal;
}

.construction-empty {
    padding: 30px 18px;
    color: #777;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 600px) {
    #constructionPanel {
        width: min(420px, 100vw);
    }
}
#layersPanel label {
    display: block;
    margin-bottom: 7px;
    cursor: pointer;
    font-size: 15px;
}

#layersPanel label:last-child {
    margin-bottom: 0;
}
#closeLayers {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

/* ===== Sentinel-2 по дате ===== */

#sentinelDateControls {
    display: none;
    margin: 4px 0 14px;
    padding: 12px;
    border-radius: 7px;
    background: #f4f7fb;
}

#sentinelDateControls label {
    margin-bottom: 9px;
    color: #555;
    font-size: 12px;
}

#sentinelDateControls input,
#sentinelDateControls select,
#findSentinelDates,
#showSentinelManualDate {
    box-sizing: border-box;
    width: 100%;
    margin-top: 4px;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    font: 12px Arial, sans-serif;
}

.sentinel-date-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

#findSentinelDates {
    margin: 0 0 9px;
    border-color: #1677ff;
    background: #1677ff;
    color: white;
    cursor: pointer;
}

.sentinel-manual-date {
    margin: 3px 0 9px;
    padding-top: 9px;
    border-top: 1px solid #d8dee8;
}

#showSentinelManualDate {
    margin-top: 0;
    border-color: #777;
    cursor: pointer;
}

#findSentinelDates:disabled {
    cursor: wait;
    opacity: .65;
}

#sentinelDateStatus {
    color: #666;
    font-size: 12px;
    line-height: 1.35;
}

/* ===== Esri World Imagery Wayback ===== */

#waybackControls {
    display: none;
    margin: 4px 0 14px;
    padding: 12px;
    border-radius: 7px;
    background: #f4f7fb;
}

#waybackControls label {
    margin-bottom: 9px;
    color: #555;
    font-size: 12px;
}

#waybackRelease,
#reloadWaybackReleases {
    box-sizing: border-box;
    width: 100%;
    margin-top: 4px;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    font: 12px Arial, sans-serif;
}

#reloadWaybackReleases {
    margin: 0 0 9px;
    border-color: #1677ff;
    background: #1677ff;
    color: white;
    cursor: pointer;
}

#reloadWaybackReleases:disabled {
    cursor: wait;
    opacity: .65;
}

#waybackStatus {
    color: #666;
    font-size: 12px;
    line-height: 1.35;
}
/* =======================================
   Поиск лицензий
   ======================================= */
/* =======================================
   Поиск лицензий
   ======================================= */
#searchBox {
    position: fixed;
    top: 15px;
    left: 70px;
    height: 45px;
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    z-index: 3000;
    overflow: hidden;
}

.search-type-control {
    position: relative;
    width: 235px;
    height: 45px;
    flex: 0 0 235px;
    border-right: 1px solid #e3e6ea;
    background: #f7f8fa;
    transition: background .15s ease, box-shadow .15s ease;
}

.search-type-control:hover {
    background: #f0f3f7;
}

.search-type-control:focus-within {
    background: #eef1f4;
    box-shadow: none;
}

.search-type-icon,
.search-type-chevron {
    position: absolute;
    top: 50%;
    pointer-events: none;
    fill: none;
    stroke: #68717d;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: translateY(-50%);
}

.search-type-icon {
    left: 13px;
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
}

.search-type-chevron {
    right: 12px;
    width: 16px;
    height: 16px;
    stroke-width: 2;
    transition: transform .15s ease, stroke .15s ease;
}

.search-type-control.menu-open .search-type-chevron {
    stroke: #4f5965;
    transform: translateY(-50%) rotate(180deg);
}

#searchType {
    display: none;
}

#searchTypeButton {
    box-sizing: border-box;
    width: 100%;
    height: 45px;
    border: none;
    padding: 0 36px 0 39px;
    background: transparent;
    color: #2f343b;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    outline: none;
    cursor: pointer;
}

#searchTypeLabel {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

#searchTypeMenu {
    position: fixed;
    display: none;
    box-sizing: border-box;
    overflow: hidden;
    padding: 6px;
    border: 1px solid rgba(26, 37, 51, .1);
    border-radius: 9px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 8px 24px rgba(23, 32, 44, .22);
    z-index: 3300;
}

#searchTypeMenu.open {
    display: block;
}

.search-type-option {
    position: relative;
    width: 100%;
    display: block;
    padding: 9px 32px 9px 11px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #303740;
    font: 13px Arial, sans-serif;
    text-align: left;
    cursor: pointer;
}

.search-type-option:hover,
.search-type-option:focus-visible {
    background: #f0f5ff;
    outline: none;
}

.search-type-option.selected {
    background: #e8f2ff;
    color: #0969da;
    font-weight: 600;
}

.search-type-option.selected::after {
    content: "✓";
    position: absolute;
    top: 50%;
    right: 11px;
    color: #1677ff;
    font-size: 14px;
    transform: translateY(-50%);
}
#licenseSearch {
    width: 280px;
    height: 45px;
    border: none;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}
#searchButton {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 1px solid #f0f0f0;
    background: white;
    cursor: pointer;
}

#searchButton svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #1677ff;
    stroke-width: 2;
    stroke-linecap: round;
}
#searchButton:hover {
    background: #f0f0f0;
}

/* ===== Подсказки поиска ===== */

#searchSuggestions {
    position: fixed;
    top: 70px;
    left: 70px;
    width: 430px;
    max-height: 320px;
    display: none;
    overflow-y: auto;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    z-index: 3100;
}

.search-suggestion {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-bottom: 1px solid #eee;
    background: white;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.search-suggestion:hover,
.search-suggestion.active {
    background: #f0f5ff;
}

.search-suggestion-empty {
    padding: 14px;
    color: #777;
    font-size: 14px;
}

/* ===== Результаты поиска ===== */

#searchResults {
    position: fixed;
    top: 70px;
    left: 70px;
    width: 390px;
    max-height: calc(100% - 100px);
    display: none;
    overflow: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    z-index: 3000;
}

#searchResultsHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

#closeResults {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

#searchResultsContent {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    width: 100%;
    padding: 13px 16px;
    flex-direction: column;
    gap: 3px;
    border: none;
    border-bottom: 1px solid #eee;
    background: white;
    text-align: left;
    color: #555;
    cursor: pointer;
}

.search-result-item:hover {
    background: #f0f5ff;
}

.search-result-license {
    color: #111;
    font-size: 15px;
    font-weight: bold;
}

.search-results-message {
    padding: 20px 16px;
    color: #666;
    text-align: center;
}
