.magnetosphere-test { --mag-accent: #73e0f5; --mag-gold: #ffd17d; --mag-pink: #ff89bb; --mag-blue: #237cad; }
.magnetosphere-test [hidden] { display: none !important; }
.magnetosphere-test .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.magnetosphere-test :is(button, input, select) { font: inherit; }
.magnetosphere-test button { min-height: 40px; padding: 9px 13px; font-size: .78rem; border: 1px solid #cadce8; border-radius: 10px; color: #1a415b; background: #f5fafe; cursor: pointer; font-weight: 700; }
.magnetosphere-test button:hover { background: #e3f1fa; }
.magnetosphere-test button:disabled { opacity: .48; cursor: default; }
.magnetosphere-test :is(button,input,select):focus-visible { outline: 3px solid #d99d3f; outline-offset: 3px; }
.magnetosphere-test label { font-size: .76rem; color: var(--muted); }
.magnetosphere-test input[type="range"] { width: 100%; accent-color: #2784a9; cursor: pointer; }
.magnetosphere-test select { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); }
.mag-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.mag-actions > label { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.mag-actions > label:has(select) { display: grid; }
.mag-status { padding: 13px 16px; margin-block: 14px; border-left: 4px solid #2b8eab; border-radius: 10px; color: #3d6274; background: #edf7fb; line-height: 1.6; font-size: .82rem; }
.mag-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-block: 16px; }
.mag-mode-tabs { display: flex; gap: 7px; }
.mag-mode-tabs button[aria-pressed="true"] { color: #fff; background: #194969; border-color: #194969; }
.mag-mode-tabs button[data-mag-mode="demo"][aria-pressed="true"] { background: #8a376b; border-color: #8a376b; }
.mag-demo { margin-bottom: 16px; border: 1px solid #e9b4d1; background: #fff4fa; color: #6c3256; border-radius: 14px; padding: 17px; }
.mag-demo strong { font-size: .95rem; }
.mag-demo p { margin: 7px 0 13px; font-size: .8rem; }
.mag-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.mag-demo-sliders { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-top: 18px; }
.mag-demo-sliders label { display: grid; gap: 8px; color: #783a60; font-weight: 700; }
.mag-demo-sliders output { font-size: 1rem; font-weight: 800; }
.mag-display-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 0; border-radius: 20px; overflow: hidden; border: 1px solid #264567; box-shadow: 0 14px 35px #081a3533; }
.mag-scene { min-height: 570px; position: relative; overflow: hidden; color: #d9f4ff; isolation: isolate; background: radial-gradient(ellipse at 37% 48%,#13324d 0%,#0a1a31 35%,#040d20 76%); }
.mag-scene::before { content: ''; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 0 45%,#e9a74d20,transparent 35%),radial-gradient(ellipse at 90% 20%,#6644aa22,transparent 55%); }
.mag-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mag-scene-top, .mag-scene-bottom { position: absolute; left: 17px; right: 17px; z-index: 2; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.mag-scene-top { top: 16px; }
.mag-scene-top p { margin: 8px 0; font-size: .72rem; color: #b5cde1; line-height: 1.5; max-width: 380px; }
.mag-data-badge { display: inline-block; padding: 6px 10px; border-radius: 99px; border: 1px solid #4e9eb7; background: #123e54cc; color: #bdf5ff; font-size: .71rem; font-weight: 800; }
.magnetosphere-test[data-view="demo"] .mag-data-badge { background: #602a53e6; border-color: #cf7fab; color: #ffd5ee; }
.magnetosphere-test[data-view="history"] .mag-data-badge { background: #5c4327e6; border-color: #bc995c; color: #ffdeaa; }
.magnetosphere-test .mag-reference-toggle { display: flex; align-items: center; gap: 6px; color: #e0eefb; font-size: .68rem; padding: 7px 9px; background: #0a182ac9; border-radius: 9px; }
.mag-scene-bottom { bottom: 16px; align-items: center; font-size: .72rem; color: #b8d9ed; }
.mag-zoom { display: flex; align-items: center; gap: 5px; }
.mag-zoom button { background: #0e243bd9; color: #dcf5ff; border-color: #41617e; padding: 7px 11px; min-height: 36px; }
.mag-zoom button:hover { background: #28425c; }
.mag-scene-empty { position: absolute; top: 44%; left: 12%; right: 12%; text-align: center; color: #e0e9f6; font-size: .9rem; }
.mag-reference-path { fill: none; stroke: #d8e9fb; opacity: .42; stroke-width: 1.5; stroke-dasharray: 6 7; }
.mag-before-path { fill: none; stroke: #b9acff; stroke-width: 2.5; stroke-dasharray: 10 5; opacity: .95; }
.mag-legend .mag-key-before { border-top: 2px dashed #8871d8; }
.mag-compare-card { margin: 14px 0; padding: 15px 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
.magnetosphere-test .mag-compare-toggle { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: .85rem; font-weight: 800; }
.mag-compare-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 15px; }
.mag-compare-fields label { display: grid; gap: 8px; min-width: 0; }
.mag-compare-fields select { width: 100%; }
.mag-compare-result { padding: 12px 14px; border-left: 3px solid #8c76c9; background: #8471b710; border-radius: 9px; font-size: .83rem; line-height: 1.7; overflow-wrap: anywhere; }
.mag-small-note { font-size: .74rem; color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.mag-arrival-card, .mag-explanation { margin-top: 18px; padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); }
.mag-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mag-arrival-card h3, .mag-explanation h3 { font-size: 1.05rem; margin: 7px 0 12px; }
.mag-estimate-label { padding: 6px 10px; border-radius: 99px; background: #d6a44018; border: 1px solid #c69e6b70; font-size: .7rem; color: var(--ink); }
.mag-journey { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 13px 0; }
.mag-journey > div { min-width: 0; padding: 16px; border-radius: 12px; background: #3c9bbc0b; border: 1px solid var(--line); }
.mag-journey span { display: block; font-size: .73rem; color: var(--muted); line-height: 1.5; }
.mag-journey strong { display: block; color: var(--ink); font-size: 1rem; margin-top: 10px; overflow-wrap: anywhere; }
.mag-arrival-card p, .mag-explanation p { font-size: .83rem; line-height: 1.8; margin-block: 10px; }
.mag-arrival-card details { font-size: .76rem; color: var(--muted); }
.mag-arrival-card summary { cursor: pointer; color: var(--ink); font-weight: 750; }
.mag-explanation { background: linear-gradient(120deg,#2e9fa00b,#7b76b80b),var(--surface); border-left: 4px solid #469daf; }
.mag-boundary-fill { fill: url(#mag-skin); }
.mag-sheath-fill { fill: url(#mag-sheath-light); }
.mag-shock-line { fill: none; stroke: #efbe7b; stroke-width: 1.8; stroke-dasharray: 4 7; opacity: .9; }
.mag-imf-arrows { fill: none; stroke: var(--mag-bz-color,#8de5ef); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.mag-legend .mag-key-shock { border-top: 2px dashed #c28b45; }
.mag-legend .mag-key-sheath { height: 10px; border-top: none; background: #d7a35635; border: 1px solid #c28b4559; }
.mag-legend .mag-key-imf { border-top: none; width: 20px; }
.mag-key-imf::before { content: '↕'; color: #41839e; font-size: 18px; }
.mag-visual-summary { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 12px 15px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: .8rem; line-height: 1.6; }
.mag-boundary-line { fill: none; stroke: var(--mag-accent); stroke-width: 2.3; }
.mag-boundary-glow { fill: none; stroke: var(--mag-accent); stroke-width: 7; opacity: .65; }
.mag-field-lines path { fill: none; stroke: #63b5ee; stroke-width: 1.2; opacity: .45; }
.mag-field-lines path:nth-child(even) { stroke: #b49dfc; opacity: .32; }
.mag-particle { fill: none; stroke: #ffe3a4; opacity: .63; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 42; animation: mag-flow calc(var(--mag-flow-time,3s) * var(--mag-speed-factor,1)) linear infinite; animation-play-state: paused; }
.magnetosphere-test[data-motion="on"] .mag-particle { animation-play-state: running; }
@keyframes mag-flow { to { stroke-dashoffset: var(--mag-flow-offset,-440px); } }
.mag-geo-ring { fill: none; stroke: #cfb1ff; stroke-width: 1; stroke-dasharray: 3 5; opacity: .65; }
.mag-distance { stroke: var(--mag-accent); stroke-width: 1; stroke-dasharray: 4 4; opacity: .65; }
.mag-nose { fill: #dcfbff; stroke: var(--mag-accent); stroke-width: 2; }
.mag-earth-land { fill: #6ac4a7; opacity: .8; }
.mag-earth-label { font: 14px system-ui,sans-serif; fill: #d2eeff; }
.mag-axis-label { font: 12px system-ui,sans-serif; fill: #9ab8d0; }
.mag-axis-line { stroke: #64849f; stroke-width: 1; opacity: .3; }
.mag-readout { padding: 24px 21px; color: #dfedfa; background: linear-gradient(145deg,#162b43,#0b182b); }
.mag-readout .eyebrow { color: #91d0e8; font-size: .64rem; }
.mag-readout h3 { color: #e2f2ff; font-size: .91rem; margin: 9px 0 13px; }
.mag-main-value { display: flex; align-items: baseline; gap: 10px; color: var(--mag-accent); }
.mag-main-value strong { font-size: 3.6rem; line-height: 1.1; letter-spacing: -.04em; }
.mag-main-value > span { font-size: 1.1rem; }
.mag-kilometres { margin: 7px 0 16px; color: #d5e5f3; font-weight: 700; font-size: 1rem; }
.mag-comparison { font-size: .74rem; line-height: 1.6; padding: 10px; border-radius: 9px; background: #ffffff0b; color: #d5e8f7; }
.mag-inputs { margin: 15px 0; }
.mag-inputs > div { padding: 11px 0; border-bottom: 1px solid #8eb0cc26; }
.mag-inputs dt { font-size: .69rem; color: #a9c4db; }
.mag-inputs dd { margin: 5px 0 0; font-size: .96rem; font-weight: 750; color: #eef7ff; }
.mag-readout-note { font-size: .69rem; color: #a9c4db; line-height: 1.65; margin-bottom: 0; }
.mag-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 15px 0 9px; font-size: .72rem; color: var(--muted); }
.mag-legend > span { display: flex; align-items: center; gap: 8px; }
.mag-legend i { display: inline-block; width: 25px; border-top: 3px solid #3394ad; }
.mag-legend .mag-key-reference { border-top: 2px dashed #7b94ab; }
.mag-legend .mag-key-geo { border-top: 2px dotted #9d76cc; }
.mag-scene-description, .mag-chart-help { font-size: .73rem; line-height: 1.7; color: var(--muted); }
.mag-timeline { padding: 15px 17px; margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f2f8fc; }
.mag-timeline-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.mag-timeline strong { color: #21435b; font-size: .85rem; }
.mag-timeline p { margin: 6px 0; color: #59758b; font-size: .75rem; }
.mag-history-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; margin-top: 22px; background: var(--surface); }
.mag-history-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mag-history-heading h3 { margin: 7px 0; font-size: 1rem; color: var(--ink); }
.mag-chart { width: 100%; height: 280px; display: block; margin-block: 15px; }
.mag-chart text { font: 11px system-ui,sans-serif; fill: var(--muted); }
.mag-chart .mag-grid { stroke: var(--line); }
.mag-chart .mag-data-line { fill: none; stroke: #227e9f; stroke-width: 2; stroke-linejoin: round; }
.mag-chart .mag-chart-reference { fill: none; stroke: #8f6bb8; stroke-dasharray: 5 4; }
.mag-chart .mag-chart-cursor { stroke: #546f88; stroke-dasharray: 3 4; }
.mag-chart .mag-chart-point { fill: #267c9c; stroke: var(--surface); stroke-width: 2; }
.mag-chart-reading { padding: 12px; border-radius: 10px; background: #eef6fa; color: #284b60; font-size: .79rem; line-height: 1.65; }
.mag-context-note { margin-top: 18px; padding: 16px 18px; border-left: 4px solid #7b8fb7; border-radius: 10px; color: #43617a; background: #edf3fa; }
.mag-context-note strong { font-size: .84rem; }
.mag-context-note p { font-size: .77rem; line-height: 1.75; margin-bottom: 0; }
.mag-details { margin-top: 18px; color: var(--muted); font-size: .77rem; line-height: 1.75; }
.mag-details summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.mag-source-times { display: grid; gap: 10px; }
.mag-source-times dt { font-weight: 750; }
.mag-source-times dd { margin: 3px 0 0; }
.mag-dialog { width: min(96vw,1600px); max-height: 96dvh; overflow: auto; padding: 17px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); }
.mag-dialog::backdrop { background: #020819e8; backdrop-filter: blur(6px); }
.mag-dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.mag-dialog > header h3 { font-size: 1rem; }
.mag-dialog .mag-scene { min-height: 62dvh; }
body:has(.mag-dialog[open]) { overflow: hidden; }
@media (max-width:1050px) {
    .mag-display-grid { grid-template-columns: minmax(0,1fr); }
    .mag-scene { min-height: 480px; }
    .mag-inputs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
    .mag-readout { padding: 20px; }
    .mag-main-value strong { font-size: 3rem; }
}
@media (max-width:600px) {
    .mag-compare-fields, .mag-journey { grid-template-columns: 1fr; }
    .mag-compare-card, .mag-arrival-card, .mag-explanation { padding: 14px; }
    body:has([data-admin-subpanel="magnetosphaere"].is-active) { min-width: 0; }
    .mag-demo-sliders { grid-template-columns: 1fr; gap: 14px; }
    .mag-scene { min-height: 360px; }
    .mag-scene-top { left: 10px; right: 10px; flex-wrap: wrap; gap: 3px; }
    .mag-scene-top p { max-width: 245px; }
    .mag-scene-bottom { left: 10px; right: 10px; gap: 6px; font-size: .62rem; }
    .mag-zoom button { padding: 6px 9px; }
    .mag-inputs { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .mag-inputs dd { font-size: .85rem; overflow-wrap: anywhere; }
    .mag-history-card { padding: 12px; }
    .mag-timeline { padding: 13px; }
    .mag-toolbar .mag-actions { gap: 6px; }
    .magnetosphere-test button { padding-inline: 10px; }
    .mag-actions, .mag-actions > label, .magnetosphere-test select { max-width: 100%; }
    .mag-dialog { padding: 10px; width: 97vw; }
    .mag-dialog .mag-scene { min-height: 360px; }
    .magnetosphere-test .panel-heading { display: block; }
}
