/* Right-click map context menu (map/contextMenu.js) */
.map-context-menu {
    position: fixed;
    z-index: 1200;
    padding: 6px;
    min-width: 180px;
}

.map-context-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.map-context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Skew-T view (ui/skewtPopup.js): fills the map container, so it is centered on
   the map and follows the side bars' expand/collapse. Lives inside #map. */
.skewt-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    background: var(--panel-bg, #1b1f27);
    color: var(--text-light);
    container-type: size;
}
.skewt-overlay[hidden] { display: none; }

.skewt-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    box-sizing: border-box;
    overflow-y: auto;       /* a short window scrolls instead of squashing the chart */
}

.skewt-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.skewt-popup-title {
    font-weight: 700;
    font-size: 14px;
}

.skewt-popup-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.skewt-popup-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.skewt-popup-controls select {
    flex: 1 1 auto;
    min-width: 100px;
    background: var(--panel-bg, #1b1f27);
    color: var(--text-light);
    border: 1px solid var(--panel-border, #444);
    border-radius: 6px;
    padding: 5px 6px;
    font-size: 12px;
}

.skewt-status {
    font-size: 12px;
    opacity: 0.75;
    margin-bottom: 8px;
}

.skewt-popup-body {
    flex: 1 0 auto;         /* at least its content: chart minimum + tables; grows on a tall display */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* SHARPpy-style arrangement: the Skew-T at the left, the hodograph and small profile panels at the right,
   the parameter tables in a band underneath. */
.skewt-top {
    flex: 1 1 auto;
    min-height: 460px;      /* below this the skew-T is too short to read */
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 10px;
}
.skewt-top.no-side { grid-template-columns: minmax(0, 1fr); }

.skewt-side {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.skewt-side[hidden] { display: none; }

.skewt-hodo-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 220px;
}

.skewt-minis {
    flex: 0 0 clamp(150px, 26cqh, 230px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.skewt-mini { position: relative; min-width: 0; }

.skewt-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 8px;
    font-size: 12px;
}
.skewt-toggles label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; opacity: 0.9; }

.skewt-summary {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 8px;
}
.skewt-summary:empty { display: none; }

/* The canvas is absolutely positioned inside its wrapper so its own (intrinsic)
   size can never feed back into the layout that sizes it. */
.skewt-canvas-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.skewt-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    display: block;
}

/* Parameter tables (ui/skewtTables.js) */
.skewt-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    align-items: start;
    font-size: 11px;
}
.skewt-tables[hidden] { display: none; }

.skewt-table-wrap {
    min-width: 0;      /* see skewtTables.js's table(): lets this scroll instead of overflowing into the next column */
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.skewt-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.skewt-table caption {
    text-align: left;
    font-weight: 700;
    padding: 4px 6px;
    opacity: 0.9;
}
.skewt-table-note { font-weight: 400; opacity: 0.65; margin-left: 8px; font-size: 10px; }
.skewt-table th, .skewt-table td { padding: 2px 6px; text-align: right; white-space: nowrap; }
.skewt-table thead th { font-weight: 400; opacity: 0.6; border-bottom: 1px solid rgba(255, 255, 255, 0.12); vertical-align: bottom; }
.skewt-table thead th small { display: block; font-size: 9px; opacity: 0.8; }
.skewt-table tbody th { text-align: left; font-weight: 400; opacity: 0.75; }
.skewt-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
.skewt-table tr.is-selected { background: rgba(255, 214, 10, 0.10); }

.skewt-parcel-pick {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--panel-border, #444);
    border-radius: 10px;
    font-size: 10px;
    padding: 1px 8px;
    cursor: pointer;
}
.skewt-parcel-pick[aria-pressed="true"] { border-color: #ffd60a; color: #ffd60a; }

.skewt-indices-empty {
    font-size: 11px;
    opacity: 0.6;
}

.skewt-sample-info {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 8px;
}

.skewt-disclaimer {
    font-size: 10px;
    opacity: 0.65;
    margin-top: 4px;
    line-height: 1.4;
}

/* A narrow map (both bars open on a small window): one column, hodograph and panels under the chart.
   Below this the two-column chart/hodograph layout gets too cramped to read either side. */
@container (max-width: 620px) {
    .skewt-top { grid-template-columns: minmax(0, 1fr); }
    .skewt-canvas-wrap { min-height: 460px; }
    .skewt-hodo-wrap { flex: 0 0 auto; aspect-ratio: 1 / 1; max-height: 360px; }
}

@media (max-width: 560px) {
    .map-context-menu {
        left: 8px !important;
        right: 8px;
        width: auto;
    }
    .skewt-minis { grid-template-columns: repeat(2, minmax(0, 1fr)); flex-basis: auto; }
    .skewt-mini { min-height: 170px; }
}

/* "Snap to a nearby airport" sits at the end of the layer-switch row, set apart from the chart layers. */
.skewt-snap {
    margin-left: auto;
    padding-left: 14px;
    border-left: 1px solid var(--panel-border, #444);
}

/* ---- Interactive Skew-T (2026-10-10): follow switch, model choice, cursor readout, definitions ---- */
.skewt-header-actions { display: inline-flex; align-items: center; gap: 8px; }
.skewt-defs-btn { font: inherit; font-size: 12px; color: var(--mint, #43d2aa); background: transparent;
    border: 1px solid var(--panel-border, #444); border-radius: 5px; padding: 3px 9px; cursor: pointer; }
.skewt-defs-btn[aria-expanded="true"] { border-color: var(--mint, #43d2aa); }
.skewt-follow { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; cursor: pointer; }

.skewt-model-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px;
    margin-bottom: 8px; padding: 6px 8px; border: 1px solid rgba(245, 158, 11, 0.5); border-radius: 6px; background: rgba(245, 158, 11, 0.08); }
.skewt-model-choice[hidden] { display: none; }
.skewt-model-choice button { font: inherit; color: var(--text-light); background: var(--btn-bg, #222a33);
    border: 1px solid var(--panel-border, #444); border-radius: 5px; padding: 2px 10px; cursor: pointer; }
.skewt-model-choice button[aria-pressed="true"] { border-color: var(--mint, #43d2aa); color: var(--mint, #43d2aa); font-weight: 700; }

.skewt-toggle { display: inline-flex; align-items: center; gap: 2px; }

/* Definition buttons: the term itself, underlined dotted; a lone "?" as a small round chip. */
.skewt-def { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: help;
    text-decoration: underline dotted rgba(255, 255, 255, 0.45); text-underline-offset: 2px; }
.skewt-def:hover, .skewt-def:focus-visible { color: var(--mint, #43d2aa); outline: none; }
.skewt-toggle .skewt-def {
    text-decoration: none; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; line-height: 16px; text-align: center;
    color: var(--text-muted, #9aa3ad); border: 1px solid var(--panel-border, #555); background: rgba(0, 0, 0, 0.35); }

/* The cursor overlay sits on the chart and takes the pointer; the readout floats beside the cursor. */
.skewt-cursor { background: transparent; cursor: crosshair; touch-action: none; }
.skewt-cursor:focus-visible { outline: 2px solid var(--mint, #43d2aa); outline-offset: -2px; }
.skewt-readout { position: absolute; z-index: 3; width: max-content; max-width: min(330px, 70%); pointer-events: auto;
    background: rgba(11, 15, 20, 0.94); border: 1px solid var(--panel-border, #444); border-radius: 6px;
    padding: 6px 8px; font-size: 11.5px; line-height: 1.45; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.skewt-readout[hidden] { display: none; }
.skewt-readout-head { font-size: 10.5px; color: var(--text-muted, #9aa3ad); margin-bottom: 3px; }
.skewt-readout-row { display: flex; justify-content: space-between; gap: 12px; }
.skewt-readout-row > span:first-child { color: var(--text-muted, #9aa3ad); white-space: nowrap; }
.skewt-readout-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.skewt-readout-note { margin-top: 3px; font-size: 10.5px; color: var(--text-muted, #9aa3ad); }

/* One definition, next to the term that opened it. */
.skewt-def-pop { position: absolute; z-index: 30; width: min(360px, calc(100% - 16px)); max-height: 60%; overflow: auto;
    background: var(--panel-bg, #1b1f27); border: 1px solid var(--mint, #43d2aa); border-radius: 7px; padding: 10px 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); font-size: 12.5px; line-height: 1.45; }
.skewt-def-pop[hidden] { display: none; }
.skewt-def-close, .skewt-defs-close { float: right; background: none; border: none; color: var(--text-light); font-size: 18px; line-height: 1; cursor: pointer; }
.skewt-def-term { font-weight: 700; color: var(--mint, #43d2aa); margin-bottom: 4px; }
.skewt-def-entry p { margin: 4px 0; }
.skewt-def-more { margin-top: 6px; font-size: 11.5px; }

/* All definitions, as a column over the right of the view. */
.skewt-defs-list { position: absolute; z-index: 25; top: 0; right: 0; bottom: 0; width: min(420px, 100%); overflow-y: auto;
    background: var(--panel-bg, #1b1f27); border-left: 1px solid var(--panel-border, #444); padding: 12px 14px;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.45); font-size: 12.5px; line-height: 1.45; }
.skewt-defs-list[hidden] { display: none; }
.skewt-defs-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.skewt-defs-intro { color: var(--text-muted, #9aa3ad); font-size: 11.5px; }
.skewt-defs-list h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #9aa3ad);
    margin: 14px 0 4px; border-bottom: 1px solid var(--panel-border, #444); padding-bottom: 3px; }
.skewt-defs-list .skewt-def-entry { margin-bottom: 10px; }

/* Narrow chart (phone): the readout docks along an edge as a compact two-column grid (ui/skewtPopup.js). */
.skewt-readout.docked { right: 4px; width: auto; max-width: none; font-size: 10.5px; line-height: 1.35;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; background: rgba(11, 15, 20, 0.9); }
.skewt-readout.docked .skewt-readout-head, .skewt-readout.docked .skewt-readout-note { grid-column: 1 / -1; }
.skewt-readout.docked .skewt-readout-row { gap: 4px; }
.skewt-readout.docked .skewt-readout-row > span:last-child { overflow-wrap: anywhere; } /* wrap, never cut a value off */

/* Observed sounding line and the side panels' pointer tips (2026-10-10). */
.skewt-obs-info { font-size: 12px; color: #ffb54d; margin-bottom: 8px; }
.skewt-obs-info:empty { display: none; }
.skewt-hodo-wrap canvas, .skewt-mini canvas { cursor: crosshair; }
.skewt-panel-tip { position: absolute; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 11px;
    background: rgba(11, 15, 20, 0.94); border: 1px solid var(--panel-border, #444); border-radius: 5px; padding: 3px 6px; }
.skewt-panel-tip[hidden] { display: none; }
.skewt-obs-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.skewt-obs-row .skewt-obs-info { margin-bottom: 0; flex: 1 1 320px; }
.skewt-obs-pick { font-size: 12px; white-space: nowrap; }
.skewt-obs-pick[hidden] { display: none; }
.skewt-obs-pick select { max-width: 260px; margin-left: 4px; background: var(--panel-bg, #1b1f27); color: var(--text-light);
    border: 1px solid var(--panel-border, #444); border-radius: 5px; padding: 2px 4px; font-size: 12px; }
.skewt-table-compare td { font-variant-numeric: tabular-nums; }
