/* Fermi-LLM - analysis outputs (outputs.js), shared by the desktop page and
   the phone page. Colors come from each page's theme tokens; m.css maps the
   phone's onto these names. */

/* Compact data table (e.g. ROI sources), reused for any tabular result-card content */
.table-scroll { overflow-x: auto; margin-top: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th, .data-table td { padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--text-secondary); font-weight: 600; }
.data-table th.num, .data-table td.num { text-align: right; font-family: var(--font-mono); }
.data-table tbody tr:hover { background: var(--bg-hover); }

.results-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
}

/* Headline science metric cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.metric-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 8px 10px;
}
.metric-card.good { border-left-color: var(--success); }
.metric-card.warn { border-left-color: var(--warning); }
.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    word-break: break-all;
}
.metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.metric-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}
/* Headline row of the Outputs panel: three wider tiles (fit, TS, flux). */
.metric-grid-3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.metric-grid-3 .metric-value { word-break: normal; overflow-wrap: anywhere; }
.param-unit { color: var(--text-muted); font-size: 10px; }

/* Output cards (plots + charts) */
.output-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.output-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.output-card-body { text-align: center; }
/* The enlarge button of a plot card (outputs.js outputCard / openPlotPopup) */
.output-card.has-plot { position: relative; }
.output-card.has-plot .output-card-title { padding-right: 30px; }
.output-card-enlarge {
    position: absolute; top: 6px; right: 6px;
    width: 24px; height: 24px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-panel); color: var(--text-muted); cursor: pointer;
}
.output-card-enlarge svg { width: 14px; height: 14px; }
.output-card-enlarge:hover, .output-card-enlarge:focus-visible { color: var(--accent); border-color: var(--accent); }
.plot-popup {
    position: fixed; inset: 0; z-index: 1100;
    background: var(--overlay, var(--scrim, rgba(15, 23, 42, 0.5)));
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.plot-popup-box {
    background: var(--bg-panel); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    width: min(1200px, 100%); max-width: 100%; max-height: calc(100vh - 32px);
    display: flex; flex-direction: column; overflow: hidden;
}
.plot-popup-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.plot-popup-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; color: var(--text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plot-popup-close { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.plot-popup-close:hover { color: var(--text-primary); }
.plot-popup-body { padding: 12px 14px; overflow: auto; min-height: 0; }
.plot-popup-body .sed-svg, .plot-popup-body .bar-svg, .plot-popup-body .map-row-svg { width: 100%; height: auto; display: block; }
.plot-popup-body .roi-svg { max-width: none; width: 100%; }
.plot-popup-body .output-img-link { display: block; }
.plot-popup-body .output-img { max-width: 100%; max-height: calc(100vh - 32px - 48px - 110px); width: auto; height: auto; }
.plot-popup-body .map-readout { text-align: left; }
.plot-popup-body .output-note { margin-top: 8px; text-align: left; }
.plot-popup-body .lc-plot-head { margin-bottom: 6px; }
/* Customize and Save (outputs.js setupPlotCustomizer): tools in the head,
   a panel beside the plot (below it on a narrow window). */
.plot-popup-main { display: flex; flex: 1 1 auto; min-height: 0; }
.plot-popup-main > .plot-popup-body { flex: 1 1 auto; min-width: 0; }
.plot-popup-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.plot-popup-tools[hidden] { display: none; }
.pp-btn { font: inherit; font-size: 12px; line-height: 1.2; padding: 4px 9px; border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-primary); cursor: pointer; }
.pp-btn:hover { border-color: var(--text-muted); }
.pp-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pp-btn:disabled { opacity: 0.5; cursor: progress; }
/* The panel: section cards that scroll, Reset / Save kept at the foot. */
.plot-popup-custom { flex: 0 0 304px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-left: 1px solid var(--border);
    background: var(--bg-secondary, var(--bg-panel)); font-size: 12.5px; }
.plot-popup-custom[hidden] { display: none; }
.pp-secs { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 10px; }
.pp-sec { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.pp-sec-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 11px; border: 0; background: none;
    font: inherit; font-size: 12.5px; font-weight: 650; color: var(--text-primary); cursor: pointer; text-align: left; border-radius: 8px 8px 0 0; }
.pp-sec-head:hover { background: var(--bg-secondary, rgba(127, 127, 127, 0.06)); }
.pp-sec:not(.pp-folded) > .pp-sec-head { border-bottom: 1px solid var(--border); }
.pp-folded > .pp-sec-head { border-radius: 8px; }
.pp-sec-body { padding: 4px 11px 9px; }
.pp-folded > .pp-sec-body, .pp-src.pp-folded > .pp-src-body { display: none; }
.pp-chev { width: 7px; height: 7px; border-right: 1.6px solid var(--text-muted); border-bottom: 1.6px solid var(--text-muted); transform: rotate(45deg) translate(-2px, -2px); flex: 0 0 auto; transition: transform 0.12s; }
.pp-folded > .pp-sec-head .pp-chev, .pp-src.pp-folded .pp-src-toggle .pp-chev { transform: rotate(-45deg); }
.pp-sub { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 11px 0 3px; padding-top: 8px; border-top: 1px dashed var(--border); }
/* Series cards (an SED's Points, Line and Shade), grouped by source. */
.pp-card { border: 1px solid var(--border); border-radius: 7px; margin: 7px 0; background: var(--bg-panel); }
.pp-card-head { display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 8px; background: var(--bg-secondary, rgba(127, 127, 127, 0.06)); border-radius: 7px 7px 0 0; }
.pp-card-plain .pp-card-head, .pp-off .pp-card-head { border-radius: 7px; }
.pp-card-title { flex: 1 1 auto; font-weight: 600; font-size: 12.5px; color: var(--text-primary); }
.pp-glyph { display: inline-flex; width: 18px; justify-content: center; }
.pp-glyph svg { width: 16px; height: 12px; }
.pp-card-body { padding: 2px 8px 4px; border-top: 1px solid var(--border); }
.pp-off .pp-card-body { display: none; }
.pp-off .pp-card-title, .pp-off .pp-glyph { opacity: 0.45; }
.pp-eye { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: 5px;
    background: none; color: var(--text-secondary); cursor: pointer; }
.pp-eye:hover { border-color: var(--border); color: var(--text-primary); }
.pp-eye svg { width: 16px; height: 16px; }
.pp-shapes { display: inline-flex; gap: 3px; }
.pp-shape-btn { width: 26px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border);
    border-radius: 5px; background: var(--bg-panel); color: var(--text-secondary); cursor: pointer; }
.pp-shape-btn svg { width: 11px; height: 11px; fill: currentColor; }
.pp-shape-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.pp-shape-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pp-src { margin: 8px 0 4px; }
.pp-src + .pp-src { border-top: 1px solid var(--border); padding-top: 8px; }
.pp-src-head { display: flex; align-items: center; gap: 6px; }
.pp-src-toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 2px; border: 0; background: none; font: inherit;
    font-weight: 600; color: var(--text-primary); cursor: pointer; text-align: left; }
.pp-src-toggle .pp-chev { margin-left: 2px; }
.pp-src-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-src-swatches { display: inline-flex; gap: 4px; }
.pp-src-swatches .pp-swatch { width: 18px; height: 18px; border-radius: 4px; }
.pp-src-body { padding-left: 4px; }
.pp-link { justify-content: flex-start; margin-top: 2px; }
.pp-link .pp-check-inline { color: var(--text-primary); font-size: 12.5px; }
.pp-link-note { margin: 0 0 4px; }
.pp-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; margin: 5px 0; font-size: 12.5px; color: var(--text-primary); text-align: left; }
.pp-row[hidden] { display: none; }
.pp-row > span:first-child { flex: 0 0 auto; }
.pp-row select, .pp-row input[type="text"], .pp-row input[type="number"] { font: inherit; font-size: 12px; max-width: 150px; min-width: 0;
    padding: 3px 5px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--bg-panel); color: var(--text-primary); }
.pp-row.pp-wide input[type="text"] { flex: 1; max-width: none; }
.pp-row input[type="number"] { width: 70px; }
.pp-color { position: relative; display: inline-flex; flex: 0 0 auto; }
.pp-color input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.pp-swatch, .pp-chip { width: 24px; height: 24px; padding: 0; border: 1px solid rgba(127, 127, 127, 0.45); border-radius: 5px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.pp-swatch:hover:not(:disabled), .pp-chip:hover { border-color: var(--text-secondary); }
.pp-swatch:disabled { opacity: 0.35; cursor: default; }
.pp-check-inline { display: inline-flex; flex-direction: row; align-items: center; margin: 0; gap: 4px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.pp-colorpop { position: fixed; z-index: 1110; background: var(--bg-panel); color: var(--text-primary); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); padding: 8px 10px 10px; width: max-content; }
.pp-pop-head { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 2px 0 5px; }
.pp-chips { display: grid; grid-template-columns: repeat(9, 22px); gap: 5px; margin-bottom: 7px; }
.pp-chips .pp-chip { width: 22px; height: 22px; }
.pp-basics { padding-bottom: 7px; border-bottom: 1px solid var(--border); }
/* The colour wheel: hue round it, saturation from the centre, darkened by
   the brightness bar. */
.pp-wheel-row { display: flex; gap: 12px; align-items: stretch; margin: 2px 0 10px; }
.pp-wheel { position: relative; width: 200px; height: 200px; border-radius: 50%; cursor: crosshair; touch-action: none; flex: 0 0 auto;
    background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0)),
        conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.pp-wheel-dim { position: absolute; inset: 0; border-radius: 50%; background: #000; opacity: 0; pointer-events: none; }
.pp-wheel-dot, .pp-vbar-thumb { position: absolute; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4); }
.pp-wheel-dot { width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid #fff; border-radius: 50%; box-sizing: border-box; }
.pp-vbar { position: relative; width: 16px; border-radius: 8px; cursor: ns-resize; touch-action: none; flex: 0 0 auto; }
.pp-vbar-thumb { left: -3px; right: -3px; height: 6px; margin-top: -3px; border: 2px solid #fff; border-radius: 4px; box-sizing: border-box; }
.pp-wheel:focus-visible, .pp-vbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pp-compare { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.pp-cmp { width: 30px; height: 22px; border-radius: 5px; border: 1px solid rgba(127, 127, 127, 0.45); }
.pp-cmp-arrow { color: var(--text-muted); font-size: 12px; }
.pp-compare .pp-hex { margin-left: auto; }
.pp-pop-actions { justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; }
.pp-chip.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.pp-pop-foot { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.pp-hex { width: 84px; font: inherit; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px;
    border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--bg-panel); color: var(--text-primary); }
.pp-row.pp-check { justify-content: flex-start; gap: 6px; }
.pp-pair { display: inline-flex; align-items: center; gap: 6px; }
.pp-row select.pp-dash { width: 46px; padding: 3px 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.pp-num, .pp-file { display: inline-flex; align-items: center; gap: 4px; }
.pp-row .pp-num input[type="number"] { width: 46px; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.pp-num input[type="number"]::-webkit-inner-spin-button, .pp-num input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pp-unit { font-size: 11.5px; color: var(--text-muted); }
.pp-step { display: inline-flex; flex-direction: column; }
.pp-step button { font-size: 8px; line-height: 1; width: 20px; height: 12px; padding: 0; border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-secondary); cursor: pointer; }
.pp-step button:first-child { border-radius: 4px 4px 0 0; border-bottom: none; }
.pp-step button:last-child { border-radius: 0 0 4px 4px; }
.pp-step button:hover { color: var(--text-primary); background: var(--bg-secondary); }
.pp-row.pp-wide .pp-file { flex: 1; min-width: 0; }
.pp-row.pp-wide .pp-file input[type="text"] { flex: 1; max-width: none; }
.pp-formats { display: inline-flex; gap: 3px; }
.pp-swatches { display: inline-grid; grid-template-columns: repeat(3, 38px); gap: 4px; justify-items: center; }
.pp-cols { margin-bottom: 0; }
.pp-cols .pp-swatches span { font-size: 11px; color: var(--text-muted); }
.pp-foot { display: flex; justify-content: space-between; gap: 8px; flex: 0 0 auto; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--bg-panel); }
.pp-btn.pp-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 5px 14px; }
.pp-btn.pp-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.pp-series-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.pp-note { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.pp-status { padding: 6px 14px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }
.pp-status[hidden] { display: none; }
.pp-status.pp-error { color: var(--error, #dc2626); }
/* A transparent background shows as a checkerboard. */
.pp-transparent svg.sed-svg, .pp-transparent svg.bar-svg, .pp-transparent svg.roi-svg, .pp-transparent svg.map-row-svg {
    background: repeating-conic-gradient(rgba(128, 128, 128, 0.18) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
@media (max-width: 759px) {
    .plot-popup-main { flex-direction: column; overflow: auto; }
    .plot-popup-main > .plot-popup-body { flex: none; min-height: auto; overflow: visible; }
    .plot-popup-custom { flex: none; border-left: none; border-top: 1px solid var(--border); overflow: visible; }
    .pp-secs { overflow: visible; }
    .pp-foot { position: sticky; bottom: 0; }
    .plot-popup-head { flex-wrap: wrap; }
    .plot-popup-tools { order: 3; width: 100%; justify-content: flex-start; }
}
.output-img-link { display: inline-block; max-width: 100%; }
.output-img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}
.output-img-caption {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    word-break: break-all;
}
.output-img-caption a { color: var(--accent); text-decoration: none; }
.output-img-caption a:hover { text-decoration: underline; }
/* The numbers under a map image (readoutHtml): peak, position, value at the target */
.map-readout {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.45;
}
.sed-svg, .bar-svg, .roi-svg {
    width: 100%;
    height: auto;
    background: var(--chart-bg);
    border-radius: var(--radius-sm);
}
.roi-svg { max-width: 480px; display: block; margin: 0 auto; }
.roi-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    font-size: 11px;
    color: var(--text-secondary);
    margin: 6px 0 8px;
}
.roi-legend span { display: inline-flex; align-items: center; gap: 4px; }
.roi-swatch { width: 14px; height: 14px; flex: none; }
.output-note {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 10px;
    padding: 6px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}
.output-warning {
    font-size: 12px;
    color: var(--warning);
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin: 0 0 10px;
}

/* Point readout and zoom on the SED / light-curve plots (outputs.js). */
.sed-svg { touch-action: pan-y; }
.sed-svg.zoomed { cursor: grab; }
.sed-svg g.pt { cursor: pointer; }
.sed-svg g.pt .pt-dot { transition: transform 0.1s; transform-box: fill-box; transform-origin: center; }
.sed-svg g.pt:hover .pt-dot, .sed-svg g.pt.pt-on .pt-dot { transform: scale(1.6); }
/* ROI plot: a hovered or tapped source stands out while its readout is up. */
.roi-svg g.pt { cursor: pointer; }
.roi-svg g.pt:hover .roi-mark, .roi-svg g.pt.pt-on .roi-mark { stroke-width: 2.6; stroke: var(--text-primary); }
/* As wide as its longest line, up to the cap; a longer line wraps inside
   the card (a hanging indent marks the continuation), never past its edge. */
.plot-tip {
    position: fixed;
    z-index: 1200;
    box-sizing: border-box;
    width: max-content;
    max-width: min(560px, calc(100vw - 16px));
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 7px 8px;
    font-size: 11.5px;
    line-height: 1.4;
    pointer-events: none;
    --tip-box: color-mix(in srgb, #000 5%, var(--bg-panel));
    --tip-bar: color-mix(in srgb, var(--tip-accent, var(--accent)) 40%, var(--bg-panel));
}
:root[data-theme="dark"] .plot-tip {
    --tip-box: color-mix(in srgb, #000 30%, var(--bg-panel));
    --tip-bar: color-mix(in srgb, var(--tip-accent, var(--accent)) 55%, var(--bg-panel));
}
/* The title: the name bold in the accent colour, then "| other name" and
   tags; a pinned card adds its buttons at the right. */
.plot-tip-h { color: var(--text-primary); display: flex; align-items: flex-start; gap: 8px; }
.plot-tip-title { flex: 1; min-width: 0; }
/* --tip-accent: the series colour on a plot of several (tipColorAttr). */
.plot-tip-name { font-weight: 700; color: var(--tip-accent, var(--accent)); }
:root[data-theme="dark"] .plot-tip-name { color: var(--tip-accent, var(--accent-hover, var(--accent))); }
.plot-tip-sep { color: var(--text-muted); margin: 0 6px; }
.plot-tip-alt { color: var(--text-secondary); }
.plot-tip-tag {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; margin-left: 4px; white-space: nowrap;
}
/* The other lines: a darker box with a pale bar on its left. */
.plot-tip-box {
    margin-top: 6px; padding: 5px 8px;
    background: var(--tip-box); border-left: 3px solid var(--tip-bar); border-radius: 0 4px 4px 0;
}
.plot-tip-title, .plot-tip-l { overflow-wrap: anywhere; padding-left: 1.5em; text-indent: -1.5em; }
.plot-tip-l { font-family: var(--font-mono); }
/* The label of a line ("TS:", "Flux (…):") in the text font, bold. */
.plot-tip-k { font-family: var(--font-sans, inherit); font-weight: 700; color: var(--text-primary); }
/* The fit state ("Fixed", "Free", "Normalization free"): muted, italic. */
.plot-tip-note { margin-top: 3px; font-style: italic; color: var(--text-muted); }
/* Pinned by a click or tap: it takes the pointer, with its buttons. */
.plot-tip.pinned { pointer-events: auto; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.26); }
.plot-tip-actions { display: inline-flex; gap: 4px; flex: none; margin: -2px -2px 0 0; }
.plot-tip-btn {
    width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-panel);
    color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; text-decoration: none;
}
.plot-tip-btn svg { width: 13px; height: 13px; pointer-events: none; }   /* the click is the link's, not the icon's (Safari) */
.plot-tip-btn:hover, .plot-tip-btn:focus-visible { color: var(--accent); border-color: var(--accent); }


/* The normalization correlation matrix (gta.fit_correlation(): outputs.js
   renderProductCards and the task report), shaded by |r|. */
.data-table.corr th.corr-h { max-width: 7em; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.data-table.corr td.corr-1 { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.data-table.corr td.corr-2 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.data-table.corr td.corr-3 { background: color-mix(in srgb, var(--accent) 48%, transparent); font-weight: 600; }
.data-table.corr td.corr-d { color: var(--text-muted); }
.data-table.corr td.corr-na { color: var(--text-muted); }
.study-hists { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; }
.study-hist { flex: 1 1 220px; min-width: 0; }
.study-hist svg { width: 100%; height: auto; display: block; }
.study-hist-title { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.file-list { margin: 4px 0 0; padding-left: 1.2em; font-size: 12px; }
.file-list code { font-family: var(--font-mono); font-size: 11.5px; }
.file-list .file-size { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
.file-list .file-gone { color: var(--text-muted); font-style: italic; font-size: 11.5px; margin-left: 4px; }

/* The MJD / Date switch above a light-curve plot (outputs.js lcPlotHtml). */
.lc-plot-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.plot-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.plot-seg button { border: none; background: none; color: var(--text-muted); font-size: 11px; padding: 2px 9px; cursor: pointer; font: inherit; font-size: 11px; }
.plot-seg button + button { border-left: 1px solid var(--border); }
.plot-seg button.on { background: var(--accent); color: var(--on-accent, #fff); }
.data-table td.warn-text { color: var(--warn, #b26a00); font-weight: 600; }

/* FermiPy's product plots drawn here (outputs.js plotViewsHtml, buildSkyMapSvg,
   buildHistSvg): the switch between a card's plots, the maps, the histograms. */
.plot-views-head { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.plot-views-head .plot-seg { flex-wrap: wrap; max-width: 100%; }
.plot-view[hidden] { display: none; }
.skymap-svg { max-width: 560px; display: block; margin: 0 auto; }
.skymap-svg g.map-px { cursor: crosshair; }
.skymap-svg g.map-src:hover .roi-mark, .skymap-svg g.map-src.pt-on .roi-mark { stroke-width: 2.6; }
.hist-svg g.pt:hover .pt-bar, .hist-svg g.pt.pt-on .pt-bar { opacity: 0.95; }
.plot-popup-body .skymap-svg { max-width: none; }
.plot-popup-body .plot-views-head { margin-bottom: 6px; }
/* The links to FermiPy's PNGs under a drawing wrap (the phone keeps a
   single file link to one line). */
.outputs .output-img-caption.fermipy-links, .output-img-caption.fermipy-links { white-space: normal; word-break: normal; }
/* The controls above a map (outputs.js skyMapHtml): the ROI sources shown, the colour map. */
.skymap-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 11px; color: var(--text-secondary); }
.skymap-cmap { display: inline-flex; align-items: center; gap: 5px; }
.skymap-cmap select { font: inherit; font-size: 11px; padding: 1px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input, var(--chart-bg)); color: var(--text-primary); }

/* Catalog points on a task's SED card: the switch above the plot. */
.sed-cat-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.sed-cat-lbl { font-size: 11px; color: var(--text-muted); }
.sed-cat-seg { flex-wrap: wrap; max-width: 100%; }

/* Plots handed over as data: the script's own (fermillm_plots) and the
   comparisons saved from Compare, under the task's other outputs. */
.custom-plots, .kept-comparisons { margin-top: 10px; }
.rec-head { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 4px 0 6px; }
.rec-table { overflow-x: auto; }
.rec-table table { border-collapse: collapse; font-size: 12px; width: 100%; }
.rec-table th, .rec-table td { padding: 3px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.rec-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.kept-comparison .linkish { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }

/* The TS cube card (outputs.js cubePlaneControls, cubeSedHtml): the energy
   bin stepper above the TS-per-energy map, the pixel line above the SED. */
.cube-planes { justify-content: flex-start; }
.cube-planes .cube-step { font: inherit; font-size: 13px; line-height: 1; padding: 1px 7px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input, var(--chart-bg)); color: var(--text-primary); cursor: pointer; }
.cube-planes .cube-step:disabled { opacity: 0.4; cursor: default; }
.cube-plane-state, .cube-sed-where { color: var(--text-muted); }
.cube-sed-where { text-align: right; }
