.pssc-page {
    letter-spacing: 0;
}

.pssc-page *,
.pssc-page *::before,
.pssc-page *::after {
    box-sizing: border-box;
}

.pssc-app {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    min-height: calc(100vh - 128px);
    padding: 20px 28px 28px;
}

.pssc-page nav .button {
    letter-spacing: 0;
}

.pssc-page section,
.pssc-page main {
    width: auto;
    margin: 0;
}

.pssc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.pssc-panel,
.pssc-main-panel,
.pssc-map-toolbar {
    text-shadow: none;
}

.pssc-panel {
    width: 100%;
    margin: 0;
    padding: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(8, 32, 44, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    color: #fcf2dc;
}

.pssc-panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.pssc-panel-header h2 {
    margin: 0;
    color: #ffd479;
    font-size: 1rem;
    line-height: 1.2;
}

.pssc-panel-header .pssc-label {
    color: #a6d8ff;
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: right;
}

.pssc-control-row {
    display: grid;
    grid-template-columns: 86px minmax(90px, 1fr) 78px;
    gap: 9px;
    align-items: center;
    margin-bottom: 12px;
}

.pssc-datetime-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.pssc-select-row {
    grid-template-columns: 86px minmax(0, 1fr);
}

.pssc-checkbox-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.pssc-control-row label,
.pssc-checkbox-row label,
.pssc-datetime-row label {
    color: #d0e7ff;
    font-size: 0.83rem;
    line-height: 1.25;
}

.pssc-control-row input[type="number"],
.pssc-control-row select,
.pssc-datetime-row input {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8f8ff;
    padding: 7px 8px;
    font: inherit;
}

.pssc-control-row select option {
    background: #08202c;
}

.pssc-datetime-row input {
    color-scheme: dark;
}

.pssc-control-row input[type="range"] {
    min-width: 0;
    width: 100%;
    margin: 0;
}

.pssc-row-buttons,
.pssc-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pssc-preset-button,
.pssc-season-button {
    min-height: 42px;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.18), rgba(255, 212, 121, 0.08));
    color: #ffefd1;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.15;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pssc-preset-button:hover,
.pssc-season-button:hover,
.pssc-season-button.is-active {
    transform: translateY(-1px);
    border-color: rgba(255, 212, 121, 0.55);
    background: rgba(255, 107, 53, 0.28);
}

.pssc-small-info {
    color: #e3f4ff;
    font-size: 0.82rem;
    line-height: 1.45;
}

.pssc-control-label {
    margin: 4px 0 8px;
    color: #ffd479;
    font-weight: 700;
}

.pssc-full-button {
    display: block;
    width: 100%;
    margin: 0 0 10px;
}

.pssc-export-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.pssc-earth-canvas-wrap,
.pssc-canvas-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: radial-gradient(circle at top, rgba(0, 255, 255, 0.06), transparent 42%), radial-gradient(circle at bottom right, rgba(255, 107, 53, 0.1), transparent 28%), rgba(1, 8, 22, 0.98);
}

.pssc-earth-canvas-wrap {
    padding: 10px;
    margin-bottom: 10px;
}

#pssc-earth-canvas,
#pssc-map-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    background: transparent;
}

.pssc-main-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.pssc-map-toolbar {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(19, 23, 54, 0.92);
    color: #e6f7ff;
}

.pssc-map-metadata {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.pssc-map-metadata p {
    margin: 0;
    min-width: 0;
    font-size: 0.78rem;
    line-height: 1.35;
}

.pssc-canvas-frame {
    flex: 1;
    min-height: 0;
}

.pssc-context-tip {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(4, 15, 33, 0.86);
    color: #d7efff;
    font-size: 0.76rem;
    line-height: 1.35;
    pointer-events: none;
}

.pssc-sources-panel ul {
    margin: 0 0 12px;
    padding-left: 18px;
    color: #cbe8ff;
    font-size: 0.78rem;
    line-height: 1.45;
}

.pssc-sources-panel li {
    margin-bottom: 8px;
}

.pssc-sources-panel .button {
    text-shadow: none;
}

@media (max-width: 1180px) {
    .pssc-app {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .pssc-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .pssc-main-panel {
        order: -1;
    }

    .pssc-map-metadata {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .pssc-page {
        font-size: 14px;
    }

    .pssc-app {
        gap: 14px;
        padding: 14px;
    }

    .pssc-sidebar {
        grid-template-columns: 1fr;
    }

    .pssc-panel {
        padding: 14px;
    }

    .pssc-map-metadata {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pssc-canvas-frame {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #pssc-map-canvas {
        width: min(100%, 92vh);
        max-width: 100%;
        margin: 0 auto;
    }

    .pssc-control-row input[type="number"],
    .pssc-control-row select,
    .pssc-datetime-row input,
    .pssc-preset-button,
    .pssc-season-button,
    .pssc-sources-panel .button {
        min-height: 44px;
        font-size: 0.9rem;
    }
}

@media (max-width: 540px) {
    .pssc-app {
        padding: 10px;
    }

    .pssc-panel {
        border-radius: 6px;
        padding: 12px;
    }

    .pssc-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .pssc-control-row,
    .pssc-select-row,
    .pssc-datetime-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .pssc-checkbox-row,
    .pssc-row-buttons,
    .pssc-segmented,
    .pssc-map-metadata {
        grid-template-columns: 1fr;
    }

    .pssc-earth-canvas-wrap {
        padding: 8px;
    }

    .pssc-map-toolbar {
        padding: 8px 10px;
    }

    .pssc-map-metadata p {
        font-size: 0.72rem;
    }

    #pssc-map-canvas {
        min-width: 560px;
    }

    .pssc-context-tip {
        position: static;
        border-radius: 0;
    }
}

@media (max-width: 390px) {
    #pssc-map-canvas {
        min-width: 520px;
    }

    .pssc-small-info,
    .pssc-sources-panel ul {
        font-size: 0.76rem;
    }
}
