    :root {
      color-scheme: dark;
      --bg: #071216;
      --panel: #0d1d22;
      --panel-2: #12272c;
      --text: #edf7f5;
      --muted: #8eaaa7;
      --line: #254047;
      --accent: #77e4c8;
      --auger: #ffb45d;
      --over-photon: #ff6f7f;
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-width: 1120px; background: radial-gradient(circle at 10% 0%, #123038 0, var(--bg) 36%); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; }
    button, input, select { font: inherit; }
    .app { max-width: 1900px; margin: auto; padding: 28px; }
    header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 22px; }
    .eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
    h1 { margin: 5px 0 2px; font-size: 29px; letter-spacing: -.03em; }
    .subtitle, .hint { color: var(--muted); }
    .seo-intro { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
    .header-actions { display: flex; align-items: center; gap: 14px; }
    .app-menu { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #08171b; }
    .app-menu a { padding: 7px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 12px; white-space: nowrap; }
    .app-menu a[aria-current="page"] { background: var(--panel-2); color: var(--accent); }
    .app-menu a:hover, .app-menu a:focus-visible { color: var(--text); outline: 1px solid var(--accent); }
    @media (max-width: 1450px) { .header-actions { flex-wrap: wrap; justify-content: flex-end; } .app-menu { flex-basis: 100%; justify-content: flex-end; } }
    .status { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
    .reset-all { padding: 7px 11px; border: 1px solid #713846; border-radius: 7px; color: #ff9aaa; background: #29151b; cursor: pointer; font-size: 11px; }
    .reset-all:hover { border-color: var(--over-photon); color: #fff; }
    .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
    .layout { display: grid; grid-template-columns: minmax(760px, 1fr) 340px; gap: 18px; }
    .panel { border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 18px 60px #0004; }
    .toolbar { display: flex; gap: 8px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
    .toolbar strong { margin-right: auto; }
    .plot-layout-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; cursor: pointer; font-size: 11px; }
    .plot-layout-button:hover, .plot-layout-button:focus { border-color: var(--accent); outline: none; }
    .analysis-state-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .analysis-state-control select { min-width: 190px; padding: 7px 30px 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; }
    .analysis-state-control select:focus { border-color: var(--accent); }
    .segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #08171b; }
    .segmented button { padding: 6px 10px; color: var(--muted); border: 0; border-radius: 5px; background: transparent; cursor: pointer; }
    .segmented button.active { color: #06201a; background: var(--accent); font-weight: 700; }
    .check { color: var(--muted); font-size: 12px; }
    .source-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: #08171b80; }
    .source-bar label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
    .source-bar select, .source-bar input { height: 42px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; }
    .source-bar select { min-width: 220px; padding: 0 34px 0 12px; font-size: 16px; font-weight: 700; }
    .source-bar input { width: 145px; padding: 0 12px; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
    .source-bar select:focus, .source-bar input:focus { border-color: var(--accent); }
    .source-bar input:invalid { border-color: #ff7d91; }
    .source-unit { height: 34px; display: flex; align-items: center; color: var(--muted); font-size: 12px; }
    .axis-control { display: grid; gap: 4px; margin-left: auto; }
    .axis-control > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
    .axis-control .segmented button { padding-inline: 8px; font-size: 12px; }
    .layer-control { display: flex; align-items: center; gap: 12px; min-height: 34px; }
    .source-bar .layer-control .check { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
    .layer-control input { width: auto; height: auto; margin: 0; accent-color: var(--accent); }
    .plot-wrap { position: relative; height: 430px; padding: 20px 22px 48px; }
    #plot { width: 100%; height: 100%; overflow: visible; cursor: crosshair; user-select: none; touch-action: none; }
    #plot.offset-dragging { cursor: move; }
    .plot-help { position: absolute; top: 7px; right: 22px; color: var(--muted); font-size: 12px; pointer-events: none; }
    .cursor-readout { position: absolute; top: 7px; left: 92px; min-width: 92px; color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none; }
    .axis-label { position: absolute; bottom: 12px; left: 50%; color: var(--muted); font-size: 14px; transform: translateX(-50%); }
    .y-axis-label { position: absolute; top: 50%; left: 8px; color: var(--muted); font-size: 14px; transform: translate(-50%, -50%) rotate(-90deg); white-space: nowrap; }
    .plot-legend { position: absolute; z-index: 3; display: grid; gap: 5px; min-width: 130px; padding: 9px 10px; border: 1px solid #426069; border-radius: 8px; background: #08171be8; box-shadow: 0 8px 24px #0008; cursor: grab; user-select: none; touch-action: none; }
    .plot-legend[hidden] { display: none; }
    .plot-legend.dragging { cursor: grabbing; }
    .plot-legend-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; cursor: default; }
    .plot-legend-swatch { width: 22px; height: 3px; flex: 0 0 auto; border-radius: 2px; background: var(--legend-color); }
    .drag-menu { position: absolute; z-index: 4; display: grid; min-width: 190px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #08171bf7; box-shadow: 0 12px 35px #000a; }
    .drag-menu[hidden] { display: none; }
    .drag-menu button { padding: 8px 10px; border: 0; border-radius: 6px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
    .drag-menu button:hover, .drag-menu button:focus { color: #06201a; background: var(--accent); outline: none; }
    .drag-menu button:disabled { color: #58706f; background: transparent; cursor: not-allowed; }
    .drag-menu-separator { height: 1px; margin: 4px 5px; background: var(--line); }
    .analysis-message { position: absolute; z-index: 5; top: 38px; left: 50%; max-width: 70%; padding: 8px 12px; border: 1px solid #713846; border-radius: 8px; color: #ffb1bd; background: #29151bf2; font-size: 12px; transform: translateX(-50%); box-shadow: 0 8px 25px #0008; }
    .analysis-message[hidden] { display: none; }
    .legend { display: flex; gap: 18px; padding: 0 22px 16px; color: var(--muted); font-size: 12px; }
    .legend i { display: inline-block; width: 16px; height: 2px; margin: 0 6px 3px 0; background: var(--accent); }
    .legend .auger { height: 0; background: transparent; border-top: 2px dashed var(--auger); }
    .periodic-panel { grid-column: 1 / -1; padding: 18px; }
    .energy-details { grid-column: 1 / -1; overflow: hidden; }
    .energy-details summary { display: flex; align-items: center; gap: 10px; padding: 13px 18px; cursor: pointer; list-style: none; }
    .energy-details summary::-webkit-details-marker { display: none; }
    .energy-details summary::before { content: '▸'; color: var(--accent); transition: transform .15s; }
    .energy-details[open] summary::before { transform: rotate(90deg); }
    .energy-details summary strong { font-size: 13px; }
    .energy-details summary .hint { margin-left: auto; font-size: 11px; }
    .energy-list { max-height: 358px; padding: 0 18px 15px; overflow: auto; border-top: 1px solid var(--line); }
    .energy-list .empty { min-height: 80px; }
    .energy-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: #08171b80; }
    .energy-mode-controls { display: grid; gap: 8px; }
    .energy-mode-controls select, .element-entry input { min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; }
    .element-entry { display: grid; gap: 4px; }
    .element-entry > label { color: var(--muted); font-size: 10px; font-weight: 700; }
    .element-entry-inputs { display: flex; gap: 8px; }
    .element-entry input { width: 220px; flex: 1; }
    .element-entry button, .remove-element { border: 1px solid var(--line); border-radius: 6px; background: #10272c; color: var(--text); cursor: pointer; }
    .element-entry button { padding: 0 14px; }
    #elementEntryMessage { color: var(--muted); font-size: 11px; }
    #elementEntryMessage:empty { display: none; }
    .energy-row-actions .remove-element { width: 28px; height: 28px; font-size: 16px; }
    .selected-energy-layout { display: grid; grid-template-columns: 36px minmax(0, 1fr); width: max-content; min-width: 100%; align-items: start; }
    .energy-row-actions { position: sticky; left: 0; z-index: 2; margin-top: 10px; background: var(--panel); }
    .energy-actions-heading { position: sticky; top: 0; height: 36px; background: var(--panel); z-index: 1; }
    .energy-row-action { height: 40px; display: flex; align-items: center; }
    .selected-energy-layout .energy-table th, .selected-energy-layout .energy-table td { height: 40px; box-sizing: border-box; }
    .selected-energy-layout .energy-table thead th { height: 36px; }
    .selected-energy-layout .energy-table th:first-child { left: 36px; }
    .energy-tools [hidden] { display: none; }
    .energy-tools input:focus-visible, .energy-tools select:focus-visible, .energy-tools button:focus-visible, .remove-element:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .energy-tools .segmented { align-self: center; }
    .energy-tools .segmented button { padding-inline: 12px; font-size: 12px; }
    .energy-search-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
    .energy-search-fields[hidden] { display: none; }
    .energy-search-control { display: grid; gap: 4px; }
    .energy-search-control > label, .energy-search-control > .control-label { color: var(--muted); font-size: 10px; font-weight: 700; }
    .energy-search-inputs { display: flex; align-items: center; gap: 8px; }
    .energy-search-inputs input[type="number"] { width: 112px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; font-variant-numeric: tabular-nums; }
    .energy-search-inputs input[type="number"]:focus { border-color: var(--accent); }
    .energy-search-inputs input[type="range"] { width: 150px; accent-color: var(--accent); cursor: pointer; }
    .energy-search-inputs .unit { color: var(--muted); font-size: 11px; }
    .energy-search-summary { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
    .energy-table { min-width: 100%; margin-top: 10px; border-spacing: 0; border-collapse: separate; font-variant-numeric: tabular-nums; }
    .energy-table th, .energy-table td { min-width: 96px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
    .energy-table thead th { position: sticky; top: 0; z-index: 1; color: var(--muted); background: var(--panel); font-size: 11px; }
    .energy-table th:first-child, .energy-table td:first-child { position: sticky; left: 0; min-width: 58px; text-align: left; background: var(--panel); }
    .energy-table th:nth-child(2), .energy-table td:nth-child(2) { min-width: 72px; text-align: left; }
    .energy-table tbody tr.is-hidden { opacity: .38; }
    .energy-list .splitting-note { color: var(--muted); }
    .energy-value { color: var(--text); font-size: 13px; font-weight: 650; }
    .atomic-number { margin-left: 2px; font-size: .68em; font-weight: 700; vertical-align: super; }
    .energy-value.is-over-photon { color: var(--over-photon); }
    .energy-legend { color: var(--over-photon); font-size: 11px; }
    .data-panel { grid-column: 1 / -1; overflow: hidden; }
    .data-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; user-select: none; }
    .data-head::-webkit-details-marker { display: none; }
    .data-head::before { content: '▸'; color: var(--accent); transition: transform .15s; }
    .data-panel[open] > .data-head::before { transform: rotate(90deg); }
    .data-head strong { font-size: 13px; }
    .data-head .hint { margin-right: auto; font-size: 11px; }
    .file-button { position: relative; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; cursor: pointer; font-size: 11px; overflow: hidden; }
    .file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
    .data-browser { display: grid; gap: 10px; max-height: 540px; padding: 13px 18px 16px; overflow: auto; }
    .data-file { border: 1px solid var(--line); border-radius: 9px; background: #08171b66; overflow: hidden; }
    .data-file-name, .data-group-name { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; user-select: none; }
    .data-file-name::-webkit-details-marker, .data-group-name::-webkit-details-marker { display: none; }
    .data-file-name { padding: 9px 11px; color: var(--text); font-size: 12px; word-break: break-all; }
    .data-file-name .file-name-text { margin-right: auto; }
    .delete-data { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #713846; border-radius: 6px; color: #ff9aaa; background: #29151b; cursor: pointer; font-size: 11px; }
    .delete-data:hover { border-color: var(--over-photon); color: #fff; }
    .data-file-name::before, .data-group-name::before { content: '▸'; flex: 0 0 auto; color: var(--accent); transition: transform .15s; }
    .data-file[open] > .data-file-name::before, .data-group[open] > .data-group-name::before { transform: rotate(90deg); }
    .data-groups { display: grid; gap: 8px; padding: 0 10px 10px; }
    .data-group-wrap { position: relative; }
    .data-group { border-top: 1px solid var(--line); }
    .data-group-name { min-height: 38px; padding: 8px 175px 6px 2px; color: var(--accent); font-size: 12px; overflow-wrap: anywhere; }
    .group-plot-actions { position: absolute; z-index: 2; top: 5px; right: 2px; display: flex; gap: 5px; }
    .group-plot-toggle { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #4c8d7e; border-radius: 6px; color: var(--accent); background: #08171b; cursor: pointer; font-size: 10px; font-weight: 700; }
    .group-plot-toggle:hover, .group-plot-toggle:focus { color: #fff; border-color: var(--accent); outline: none; }
    .group-plot-toggle:disabled { color: #58706f; border-color: var(--line); cursor: not-allowed; }
    .data-series { display: grid; gap: 8px; padding: 0 0 3px 22px; }
    .series-entry { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(560px, 1.1fr); align-items: start; gap: 9px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #08171b80; }
    .series-entry.is-graph-selected { border-color: var(--accent); box-shadow: 0 0 0 2px #77e4c833, 0 0 22px #77e4c822; }
    .series-row { display: flex; min-width: 0; }
    .series-option { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #08171b; cursor: pointer; font-size: 12px; }
    .series-row .series-option { width: 100%; box-sizing: border-box; }
    .series-option:has(input:checked) { color: var(--text); border-color: color-mix(in srgb, var(--series-color) 70%, var(--line)); background: color-mix(in srgb, var(--series-color) 12%, #08171b); }
    .series-option input { margin: 0; accent-color: var(--series-color); }
    .series-option small { color: var(--muted); font-variant-numeric: tabular-nums; }
    .series-row { gap: 7px; align-items: stretch; }
    .series-row-actions { display: flex; gap: 5px; flex: 0 0 auto; }
    .series-row-actions button { min-width: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #08171b; cursor: pointer; font-size: 11px; font-weight: 700; }
    .series-row-actions button:hover, .series-row-actions button:focus { color: var(--text); border-color: var(--accent); outline: none; }
    .series-row-actions .add-fit { color: var(--accent); border-color: #4c8d7e; font-size: 16px; line-height: 1; }
    .data-error { color: #ff93a3; font-size: 11px; }
    .periodic-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
    .periodic-head h2 { margin: 0; font-size: 16px; }
    .periodic { display: grid; grid-template-columns: repeat(18, minmax(43px, 1fr)); gap: 5px; }
    .element { position: relative; aspect-ratio: 1.08; padding: 4px; border: 1px solid #29454b; border-radius: 6px; color: #b6cbc8; background: #102328; cursor: pointer; transition: .15s; }
    .element:hover { border-color: var(--accent); transform: translateY(-1px); }
    .element.selected { color: #06201a; border-color: var(--accent); background: var(--accent); box-shadow: 0 0 18px #77e4c833; }
    .element.no-data { opacity: .32; cursor: not-allowed; }
    .element .z { position: absolute; top: 3px; left: 4px; font-size: 8px; opacity: .7; }
    .element .symbol { font-size: 15px; font-weight: 750; }
    aside { padding: 17px; }
    aside h2 { margin: 0 0 4px; font-size: 16px; }
    .selection { min-height: 330px; max-height: 430px; margin-top: 16px; padding-right: 3px; overflow: auto; }
    .empty { display: grid; place-items: center; min-height: 240px; color: var(--muted); text-align: center; }
    .chip { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--panel-2); text-align: left; cursor: pointer; }
    .chip.off { opacity: .42; }
    .swatch { width: 9px; height: 32px; border-radius: 9px; }
    .chip strong { display: block; }
    .chip small { color: var(--muted); }
    .chip .remove { margin-left: auto; padding: 4px 7px; border: 0; color: var(--muted); background: none; cursor: pointer; }
    .clear { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
    .notice { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
    .tooltip { position: fixed; z-index: 3; display: none; pointer-events: none; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171bf2; font-size: 11px; box-shadow: 0 8px 25px #0008; }
    .site-footer { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 90%, transparent); box-shadow: 0 18px 60px #0003; overflow: hidden; }
    .footer-disclosure > summary { display: flex; align-items: baseline; gap: 12px; min-height: 54px; padding: 16px 18px; cursor: pointer; list-style: none; }
    .footer-disclosure > summary::-webkit-details-marker { display: none; }
    .footer-disclosure > summary::before { content: '▸'; flex: 0 0 auto; color: var(--accent); transition: transform .15s; }
    .footer-disclosure[open] > summary::before { transform: rotate(90deg); }
    .footer-title { color: var(--text); font-size: 16px; font-weight: 750; }
    .footer-summary { color: var(--muted); font-size: 12px; }
    .footer-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 0 18px 18px 42px; }
    .footer-detail { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #08171b80; font-size: 11px; line-height: 1.6; }
    .footer-detail h3 { margin: 0 0 7px; color: var(--text); font-size: 12px; }
    .footer-detail p { margin: 0; }
    .footer-detail p + p { margin-top: 9px; }
    .footer-detail a { color: var(--accent); text-underline-offset: 3px; }
    .footer-detail a:hover, .footer-detail a:focus { color: #b5ffee; }
    .analysis-dialog { width: min(520px, calc(100vw - 40px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--panel); box-shadow: 0 24px 80px #000c; }
    .analysis-dialog::backdrop { background: #02090caa; }
    .analysis-dialog form { padding: 20px; }
    .analysis-dialog h2 { margin: 0 0 5px; font-size: 18px; }
    .analysis-dialog p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
    .analysis-range { display: flex; align-items: end; gap: 10px; }
    .analysis-range label { display: grid; flex: 1; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .analysis-range input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; }
    .analysis-range input:focus { border-color: var(--accent); }
    .analysis-range span { padding-bottom: 9px; color: var(--muted); }
    .analysis-dialog .dialog-error { margin: 12px 0 0; color: #ff93a3; }
    .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
    .dialog-actions button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; cursor: pointer; }
    .dialog-actions .primary { border-color: var(--accent); color: #06201a; background: var(--accent); font-weight: 700; }
    .plot-layout-dialog { width: min(900px, calc(100vw - 40px)); }
    .plot-layout-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; min-height: 390px; }
    .plot-layout-body[hidden] { display: none; }
    .plot-series-pane { display: flex; min-width: 0; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #08171b80; }
    .plot-series-head, .plot-series-actions { display: flex; align-items: center; gap: 7px; }
    .plot-series-head { justify-content: space-between; margin-bottom: 8px; }
    .plot-series-head span { color: var(--muted); font-size: 10px; }
    .plot-series-actions { margin-bottom: 8px; }
    .plot-series-actions button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #08171b; cursor: pointer; font-size: 10px; }
    .plot-series-actions button:hover { color: var(--text); border-color: var(--accent); }
    .plot-series-list { display: grid; align-content: start; gap: 6px; max-height: 340px; overflow: auto; }
    .plot-series-row { display: grid; grid-template-columns: 18px 16px minmax(0, 1fr); align-items: center; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #08171b; cursor: grab; user-select: none; }
    .plot-series-row:active { cursor: grabbing; }
    .plot-series-row.is-selected { color: var(--text); border-color: color-mix(in srgb, var(--series-color) 70%, var(--line)); background: color-mix(in srgb, var(--series-color) 12%, #08171b); }
    .plot-series-row.is-hidden .plot-series-name { opacity: .5; text-decoration: line-through; }
    .plot-series-row.dragging { opacity: .35; }
    .plot-series-row.drag-over { border-top-color: var(--accent); box-shadow: inset 0 2px var(--accent); }
    .plot-series-row input { margin: 0; accent-color: var(--series-color); }
    .plot-drag-handle { color: #627c7a; font-size: 14px; text-align: center; }
    .plot-series-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
    .plot-layout-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .plot-layout-controls[hidden] { display: none; }
    .plot-layout-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .plot-layout-controls label.wide { grid-column: 1 / -1; }
    .plot-layout-controls input:not([type="checkbox"]), .plot-layout-controls select { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; }
    .plot-layout-controls input[type="color"] { padding: 4px; cursor: pointer; }
    .plot-layout-controls input:focus, .plot-layout-controls select:focus { border-color: var(--accent); }
    .plot-color-control { display: grid; grid-column: 1 / -1; grid-template-columns: 120px 1fr; align-items: end; gap: 10px; }
    .plot-color-presets { display: flex; flex-wrap: wrap; gap: 7px; min-height: 39px; align-items: center; }
    .plot-color-presets button { width: 25px; height: 25px; padding: 0; border: 2px solid #ffffff40; border-radius: 50%; background: var(--preset-color); cursor: pointer; }
    .plot-color-presets button:hover, .plot-color-presets button:focus, .plot-color-presets button.active { border-color: #fff; outline: none; box-shadow: 0 0 0 2px var(--accent); }
    .plot-layout-controls .marker-fill-option { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 39px; }
    .marker-fill-option input { accent-color: var(--accent); }
    .plot-offsets-dialog { width: min(520px, calc(100vw - 40px)); }
    .series-fitting { display: block; border-left: 3px solid #4c8d7e; border-radius: 5px; background: #0b2024; overflow: hidden; }
    .series-fitting-head { display: flex; align-items: center; gap: 9px; min-height: 27px; }
    .series-fitting > .series-fitting-head { padding: 7px 9px; cursor: pointer; list-style: none; }
    .series-fitting > .series-fitting-head::-webkit-details-marker { display: none; }
    .series-fitting > .series-fitting-head::before { content: '▸'; color: var(--accent); transition: transform .15s; }
    .series-fitting[open] > .series-fitting-head::before { transform: rotate(90deg); }
    .series-fitting-head strong { color: var(--accent); font-size: 11px; }
    .series-fitting-head .hint { margin-right: auto; font-size: 10px; }
    .series-fit-results { display: grid; gap: 6px; padding: 0 9px 9px; }
    .fit-result-card { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #08171b99; }
    .fit-result-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 700; }
    .fit-result-title input { accent-color: var(--fit-color, var(--accent)); }
    .fit-result-title i { width: 22px; height: 3px; border-radius: 2px; background: var(--fit-color, var(--accent)); }
    .fit-result-meta { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
    .fit-result-actions { display: flex; gap: 6px; }
    .fit-result-actions button { min-width: 25px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #08171b; cursor: pointer; font-size: 10px; }
    .fit-result-actions button:hover { color: var(--text); border-color: var(--accent); }
    .fit-dialog { width: min(980px, calc(100vw - 40px)); }
    .fit-spectrum-name { margin-top: -5px; color: var(--accent); font-weight: 700; }
    .fit-main-fields { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 10px; }
    .fit-main-fields label, .fit-peak-row label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .fit-main-fields input, .fit-main-fields select, .fit-peak-row input { width: 100%; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; box-sizing: border-box; }
    .fit-main-fields input:focus, .fit-main-fields select:focus, .fit-peak-row input:focus { border-color: var(--accent); }
    .fit-peak-heading { display: flex; justify-content: space-between; gap: 12px; margin: 17px 0 8px; }
    .fit-peak-heading span, .fit-note { color: var(--muted); font-size: 11px; }
    .fit-peak-rows { display: grid; gap: 7px; }
    .fit-peak-row { display: grid; grid-template-columns: 52px repeat(4, minmax(0, 1fr)); align-items: end; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #08171b80; }
    .fit-peak-number { align-self: center; color: var(--accent); font-size: 12px; font-weight: 800; }
    .fit-overlay { pointer-events: none; }
    .fit-annotation { pointer-events: none; paint-order: stroke; stroke: #071216; stroke-width: 4px; stroke-linejoin: round; }
    .fit-style-dialog { width: min(620px, calc(100vw - 40px)); }
    .fit-style-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .fit-style-fields label:not(.fit-check) { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .fit-style-fields input:not([type="checkbox"]), .fit-style-fields select { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; }
    .fit-style-fields input[type="color"] { padding: 4px; }
    .fit-check { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
    .fit-check input { accent-color: var(--accent); }
    @media (max-width: 760px) {
      .series-entry { grid-template-columns: 1fr; }
      .fit-main-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .fit-peak-row { grid-template-columns: 45px repeat(2, minmax(0, 1fr)); }
    }
    .offset-interval-fields, .legend-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .offset-interval-fields label, .legend-edit-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .offset-interval-fields input, .legend-edit-fields input { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #08171b; outline: none; }
    .offset-interval-fields input:focus, .legend-edit-fields input:focus { border-color: var(--accent); }
    .dialog-actions .danger { border-color: #713846; color: #ff9aaa; background: #29151b; }
    .dialog-spacer { flex: 1; }
    .mobile-autoscale-button { display: none; }
    @media (max-width: 1100px) { .app { padding: 18px; } .layout { grid-template-columns: 1fr 270px; } }
    @media (max-width: 760px) {
      body {
        min-width: 0;
        overflow-x: hidden;
        background:
          radial-gradient(ellipse 135% 760px at 12% 0%, #123038 0, #0b2026 44%, rgba(7, 18, 22, 0) 82%),
          var(--bg);
      }
      .app { width: 100%; padding: 10px; }
      header { position: relative; display: block; min-width: 0; margin-bottom: 12px; padding-right: 0; }
      h1 { font-size: 24px; }
      .subtitle { font-size: 12px; }
      .seo-intro { max-width: calc(100vw - 36px); font-size: 12px; }
      .header-actions { position: static; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
      .header-actions .app-menu { flex-basis: auto; margin-right: auto; }
      .header-actions .status { display: none; }
      .reset-all { min-height: 34px; }
      .layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
      .layout > section.panel:not(.periodic-panel) { order: 1; }
      .energy-details { order: 2; }
      .periodic-panel { order: 3; }
      .layout > aside { order: 4; }
      .data-panel { order: 5; }
      .panel { min-width: 0; border-radius: 10px; }
      .toolbar { flex-wrap: wrap; align-items: stretch; padding: 10px; }
      .toolbar strong { flex: 1 1 auto; align-self: center; }
      #plotLegendButton, #plotOffsetsButton, #plotLayoutButton, .analysis-state-control { display: none; }
      .plot-layout-button { min-height: 38px; flex: 1 1 auto; }
      .mobile-autoscale-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 38px; }
      .analysis-state-control { flex: 1 1 100%; align-items: stretch; }
      .analysis-state-control select { min-width: 0; width: 100%; min-height: 40px; }
      .plot-wrap { height: 310px; padding: 12px 8px 42px; touch-action: none; }
      #plot { touch-action: none; }
      .plot-help { display: none; }
      .cursor-readout { display: none; }
      .drag-menu { display: none !important; }
      .axis-label { width: 100%; font-size: 12px; text-align: center; }
      .y-axis-label { left: 4px; font-size: 12px; }
      .legend { flex-wrap: wrap; gap: 10px 16px; padding: 0 12px 12px; }
      .source-bar { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px; padding: 10px; }
      .source-bar label, .axis-control, .layer-control { min-width: 0; }
      .source-bar select, .source-bar input { width: 100%; min-width: 0; height: 44px; font-size: 16px; }
      .source-unit { display: none; }
      .axis-control { grid-column: 1 / -1; margin-left: 0; }
      .axis-control .segmented button { flex: 1; min-height: 38px; }
      .layer-control { grid-column: 1 / -1; justify-content: flex-start; gap: 18px; min-height: 38px; }
      .source-bar .layer-control .check { min-height: 38px; font-size: 13px; }
      aside { padding: 12px; }
      .selection { min-height: 120px; max-height: 220px; margin-top: 12px; }
      .chip { min-height: 48px; }
      .clear { min-height: 42px; }
      .energy-details summary, .data-head { flex-wrap: wrap; align-items: center; padding: 11px 12px; }
      .energy-details summary .hint, .data-head .hint { flex: 1 1 100%; margin: 0; }
      .energy-tools { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 10px; }
      .energy-tools .segmented button { flex: 1; min-height: 38px; }
      .energy-search-fields { display: grid; grid-template-columns: 1fr; gap: 10px; }
      .energy-search-inputs input[type="number"], .energy-search-inputs input[type="range"] { flex: 1; width: auto; }
      .energy-search-summary { margin-left: 0; white-space: normal; }
      .energy-list { max-height: 300px; padding: 0 10px 12px; }
      .energy-table th, .energy-table td { min-width: 82px; padding: 8px; }
      .data-panel { display: none; }
      .data-head .file-button { flex: 1 1 100%; min-height: 40px; display: grid; place-items: center; }
      .data-browser { max-height: none; padding: 10px; }
      .data-groups { padding: 0 8px 8px; }
      .data-group-name { padding: 8px 2px 6px; }
      .group-plot-actions { position: static; display: grid; grid-template-columns: 1fr 1fr; padding: 0 0 8px 22px; }
      .group-plot-toggle { min-height: 36px; }
      .data-series { padding-left: 0; }
      .series-entry { grid-template-columns: 1fr; padding: 7px; }
      .series-row { display: grid; grid-template-columns: 1fr auto; }
      .series-option { min-width: 0; min-height: 42px; }
      .series-row-actions button { min-width: 36px; min-height: 36px; }
      .periodic-panel { min-width: 0; padding: 12px; }
      .periodic-head { align-items: start; flex-direction: column; gap: 4px; }
      .periodic { width: 100%; max-width: 100%; grid-template-columns: repeat(18, minmax(36px, 1fr)); gap: 4px; overflow-x: auto; padding-bottom: 8px; }
      .element { min-width: 36px; min-height: 38px; padding: 3px; }
      .element .symbol { font-size: 13px; }
      .site-footer { margin-top: 12px; border-radius: 10px; }
      .footer-disclosure > summary { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 4px 8px; min-height: 52px; padding: 12px; }
      .footer-summary { grid-column: 2; }
      .footer-details { grid-template-columns: 1fr; gap: 8px; padding: 0 12px 12px 34px; }
      .footer-detail { font-size: 12px; }
      .plot-layout-dialog, .fit-dialog, .fit-style-dialog, .plot-offsets-dialog, .analysis-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); overflow: auto; }
      .analysis-dialog form { padding: 14px; }
      .plot-layout-body { grid-template-columns: 1fr; min-height: 0; }
      .plot-layout-controls, .fit-style-fields, .offset-interval-fields, .legend-edit-fields { grid-template-columns: 1fr; }
      .plot-color-control { grid-template-columns: 1fr; }
      .fit-main-fields { grid-template-columns: 1fr; }
      .fit-peak-row { grid-template-columns: 40px 1fr; }
      .dialog-actions { flex-wrap: wrap; }
      .dialog-actions button { min-height: 40px; }
    }
