.lnpm-widget {
    max-width: 960px;
    margin: 0 auto;
    font-family: inherit;
}

.lnpm-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-bottom: 16px;
}

.lnpm-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}

.lnpm-control-group label {
    white-space: nowrap;
}

.lnpm-controls select {
    padding: 4px 8px;
    width: auto;
    max-width: 260px;
}

@media (max-width: 480px) {
    .lnpm-control-group {
        flex: 1 1 100%;
    }
    .lnpm-controls select {
        max-width: none;
        flex: 1;
    }
}

.lnpm-location {
    margin-bottom: 18px;
}

.lnpm-location h2 {
    margin: 0 0 4px 0;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.lnpm-location h2 small {
    font-weight: 400 !important;
    color: #666;
    font-size: 1em !important;
}

.lnpm-location p {
    margin: 0;
    color: #555;
    font-size: 0.9em;
}

.lnpm-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.lnpm-card {
    background: #10182f;
    color: #f2f4fb;
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    min-height: 148px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lnpm-card-icon {
    font-size: 2.3em;
    line-height: 1;
    margin-bottom: 6px;
}

.lnpm-card-title {
    font-weight: 600;
    font-size: 1.05em;
}

.lnpm-card-sub {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 2px;
}

.lnpm-card-milkyway {
    position: relative;
    background-size: cover;
    background-position: center;
    justify-content: flex-end;
    padding: 0;
    overflow: hidden;
}

.lnpm-card-milkyway .lnpm-card-overlay {
    width: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.75) 70%);
    padding: 30px 10px 12px;
}

.lnpm-card-milkyway.lnpm-mw-yes .lnpm-card-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(20,90,60,0.85) 70%);
}

.lnpm-card-milkyway.lnpm-mw-no .lnpm-card-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(95,30,43,0.85) 70%);
}

.lnpm-darkness-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 28px;
}

.lnpm-darkness-card {
    background: #10182f;
    color: #f2f4fb;
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    min-height: 148px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lnpm-darkness-card .lnpm-card-sub {
    font-size: 0.72em;
    line-height: 1.25;
}

.lnpm-darkness-card .lnpm-card-title {
    font-size: 0.95em;
    margin-bottom: 2px;
}

.lnpm-darkness-nodata {
    background: #2b2f3d;
}

.lnpm-darkness-green {
    background: #1e7e2e;
}

.lnpm-darkness-yellow {
    background: #c9a800;
    color: #201d00;
}

.lnpm-darkness-red {
    background: #a11d1d;
}

.lnpm-darkness-legend {
    background: #1a2140;
    align-items: stretch;
    text-align: left;
}

.lnpm-darkness-legend .lnpm-card-title {
    text-align: center;
    margin-bottom: 8px;
}

.lnpm-legend-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8em;
    line-height: 1.35;
    padding: 5px 4px;
    border-radius: 4px;
}

.lnpm-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 2px;
}

.lnpm-legend-green .lnpm-legend-swatch { background: #2ecc40; }
.lnpm-legend-yellow .lnpm-legend-swatch { background: #ffe600; }
.lnpm-legend-red .lnpm-legend-swatch { background: #ff3b3b; }

.lnpm-darkness-card svg {
    margin: 4px 0;
}

.lnpm-legend-row svg {
    flex-shrink: 0;
}

.lnpm-legend-active {
    background: rgba(255,255,255,0.12);
    font-weight: 600;
}

@media (max-width: 600px) {
    .lnpm-darkness-row {
        grid-template-columns: 1fr;
    }
}

.lnpm-map-block {
    margin-bottom: 28px;
}

.lnpm-map {
    width: 100%;
    height: 260px;
    border-radius: 10px;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 0.9em;
    text-align: center;
}

.lnpm-map-address {
    margin: 8px 0 0 0;
    font-size: 0.85em;
    color: #555;
    text-align: center;
}

.lnpm-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

.lnpm-chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

.lnpm-chart-container canvas {
    max-width: 100%;
}

.lnpm-chart-block h3 {
    margin-bottom: 6px;
}

.lnpm-chart-caption {
    margin: 8px 0 0 0;
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

@media (max-width: 900px) {
    .lnpm-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .lnpm-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}


.lnpm-heatmap-wrap {
    position: relative;
    width: 100%;
}

.lnpm-heatmap-wrap canvas {
    display: block;
    max-width: 100%;
}

.lnpm-heatmap-tip {
    display: none;
    position: absolute;
    pointer-events: none;
    background: rgba(16, 24, 47, 0.92);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 5;
}

.lnpm-medusa-axis {
    margin: 4px 0 8px 0;
}

.lnpm-map-layers {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    font-size: 0.9em;
}

.lnpm-map-layers input[type="range"] {
    vertical-align: middle;
    width: 120px;
}

.lnpm-map-credit {
    margin: 4px 0 0 0;
    font-size: 0.75em;
    color: #777;
    text-align: center;
}

.lnpm-atlas-legend {
    margin-top: 12px;
    padding: 12px;
    background: #10182f;
    color: #f2f4fb;
    border-radius: 10px;
}

.lnpm-atlas-legend h4 {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    color: #f2f4fb;
}

.lnpm-atlas-legend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 14px;
}

.lnpm-atlas-row {
    display: grid;
    grid-template-columns: 18px 26px 1fr;
    grid-template-rows: auto auto;
    column-gap: 6px;
    align-items: center;
    font-size: 0.78em;
    line-height: 1.3;
    padding: 3px 0;
}

.lnpm-atlas-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.35);
    vertical-align: middle;
}

.lnpm-atlas-zone { font-weight: 700; }
.lnpm-atlas-lpi { grid-column: 3; opacity: 0.7; font-size: 0.9em; }
.lnpm-atlas-mag { grid-column: 3; }
.lnpm-atlas-row .lnpm-atlas-swatch { grid-row: 1 / span 2; }
.lnpm-atlas-row .lnpm-atlas-zone { grid-row: 1 / span 2; grid-column: 2; }

.lnpm-atlas-note {
    margin: 10px 0 0 0;
    font-size: 0.75em;
    opacity: 0.8;
    line-height: 1.4;
}

.lnpm-atlas-click {
    margin: 8px 0 0 0;
    padding: 8px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.85em;
}

@media (max-width: 700px) {
    .lnpm-atlas-legend-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
    .lnpm-atlas-legend-grid { grid-template-columns: 1fr; }
}

.lnpm-clouds-row {
    display: grid;
    grid-template-columns: minmax(0, 520px);
    justify-content: center;
    gap: 18px;
}

.lnpm-cloud-card {
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    min-width: 0;
}

.lnpm-cloud-card h3 {
    margin: 0 0 10px 0;
    font-size: 1em;
    text-align: center;
}

.lnpm-cloud-card h3 small {
    font-weight: 400;
    color: #777;
    font-size: 0.8em;
}

.lnpm-cloud-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lnpm-cloud-pie {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}

.lnpm-cloud-table {
    border-collapse: collapse;
    font-size: 0.85em;
    width: 100%;
}

.lnpm-cloud-table th {
    text-align: right;
    color: #3a9bd6;
    font-weight: 600;
    padding: 2px 6px;
}

.lnpm-cloud-table td {
    padding: 4px 6px;
    text-align: right;
}

.lnpm-cloud-table td:first-child { text-align: left; white-space: nowrap; }

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

.lnpm-info {
    position: relative;
    display: table;
    margin: 6px auto 0 auto;
    text-align: center;
}

.lnpm-info-btn {
    background: #eef2f8;
    border: 1px solid #cfd8e6;
    border-radius: 999px;
    color: #2c3e91;
    cursor: help;
    font-size: 0.8em;
    padding: 3px 12px;
}

.lnpm-info:hover .lnpm-info-btn,
.lnpm-info:focus-within .lnpm-info-btn,
.lnpm-info.is-open .lnpm-info-btn {
    background: #2c3e91;
    border-color: #2c3e91;
    color: #fff;
}

.lnpm-info-panel {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: 6px;
    width: 440px;
    max-width: 92vw;
    padding: 10px 14px;
    background: #10182f;
    color: #f2f4fb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-size: 0.85em;
    line-height: 1.5;
    text-align: left;
    z-index: 20;
}

.lnpm-info:hover .lnpm-info-panel,
.lnpm-info:focus-within .lnpm-info-panel,
.lnpm-info.is-open .lnpm-info-panel {
    display: block;
}
