.sunspot-test { --sun-accent: #b45e1e; --sun-cool: #248894; }
.sunspot-test .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sunspot-test .panel-heading h2 { margin-bottom: 6px; }
.sunspot-actions, .sunspot-image-tabs, .sunspot-zoom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sunspot-actions label { display: flex; align-items: center; gap: 6px; font-size: .75rem; }
.sunspot-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-block: 16px; align-items: start; }
.sunspot-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.sunspot-card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sunspot-card h3, .sunspot-card h4 { margin: 3px 0; color: var(--ink); }
.sunspot-card h3 { font-size: 1rem; }
.sunspot-card h4 { font-size: .9rem; }
.sunspot-test button { min-height: 40px; }
.sunspot-image-tabs { margin-bottom: 10px; }
.sunspot-image-tabs button { flex: 1 1 120px; padding: 9px; background: #edf4f8; color: #284658; border: 1px solid #c7dce6; }
.sunspot-image-tabs button[aria-pressed="true"] { background: #153f59; color: #fff; border-color: #153f59; }
.sunspot-picture-stage { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; background: #030507; border-radius: 10px; touch-action: none; cursor: grab; }
.sunspot-picture-stage:active { cursor: grabbing; }
.sunspot-picture-stage:focus-visible { outline: 3px solid var(--sun-accent); outline-offset: 3px; }
.sunspot-picture-stage img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: center; user-select: none; }
.sunspot-picture-stage img[hidden] { display: none; }
.sunspot-picture-stage > p { position: absolute; padding: 20px; color: #c8dae3; font-size: .8rem; }
.sunspot-compare-mask { position: absolute; inset: 0; pointer-events: none; }
.sunspot-compare-line { position: absolute; z-index: 4; top: 0; bottom: 0; left: 50%; width: 44px; transform: translateX(-50%); cursor: ew-resize; touch-action: none; user-select: none; }
.sunspot-compare-line::before { content: ''; position: absolute; inset: 0 auto 0 50%; width: 2px; background: #fff; box-shadow: 0 0 4px #000; }
.sunspot-compare-grip { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 44px; height: 44px; box-sizing: border-box; transform: translate(calc(-50% + var(--sun-grip-offset, 0px)), -50%); border: 2px solid #fff; border-radius: 50%; background: #123c53ee; color: #fff; box-shadow: 0 2px 12px #0008; font: 700 26px/1 system-ui, sans-serif; }
.sunspot-compare-line:is(:hover, .is-dragging) .sunspot-compare-grip { background: #186d85; }
.sunspot-compare-line:focus-visible { outline: none; }
.sunspot-compare-line:focus-visible .sunspot-compare-grip { outline: 3px solid #ffdf85; outline-offset: 3px; }
.sunspot-compare-labels { position: absolute; inset: 9px 9px auto; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.sunspot-compare-labels span { padding: 4px 7px; color: #fff; background: #102333d9; border-radius: 5px; font-size: .65rem; }
.sunspot-view-controls { display: grid; gap: 10px; margin-top: 10px; }
.sunspot-mode-tabs, .sunspot-film-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; }
.sunspot-mode-tabs button { flex: 1; }
.sunspot-mode-tabs button[aria-pressed="true"] { background: #153f59; color: #fff; border-color: #153f59; }
.sunspot-test .sunspot-view-controls label.sunspot-compare-toggle { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.sunspot-test :is(.sunspot-compare-control, .sunspot-film-controls) input[type="range"] { width: 100%; accent-color: var(--sun-cool); }
.sunspot-film-controls { display: grid; gap: 10px; }
.sunspot-film-actions label { flex: 1 1 160px; }
.sunspot-film-actions button { padding: 8px 11px; }
.sunspot-film-actions [data-sun-film-play] { min-width: 95px; }
.sunspot-view-controls [hidden], .sunspot-picture-stage [hidden] { display: none; }
.sunspot-zoom { margin-top: 10px; }
.sunspot-zoom button { padding: 6px 13px; }
.sunspot-zoom span { flex: 1 1 180px; font-size: .7rem; color: var(--muted); }
.sunspot-caption { font-size: .8rem; line-height: 1.6; }
.sunspot-credit, .sunspot-help { color: var(--muted); font-size: .71rem; line-height: 1.6; }
.sunspot-credit { font-size: .63rem; }
.sunspot-note { padding: 9px 12px; background: #edf6fa; border-left: 3px solid var(--sun-cool); border-radius: 7px; color: #294d60; font-size: .76rem; line-height: 1.5; }
.sunspot-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.sunspot-stats > div { display: grid; padding: 12px; border-radius: 10px; background: #f7eadb; color: #703d13; }
.sunspot-stats small { font-size: .67rem; }
.sunspot-stats strong { font-size: 1.55rem; }
.sunspot-region-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-block: 14px; }
.sunspot-test label:not(.sunspot-actions label) { display: grid; gap: 5px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.sunspot-test :is(input[type="search"], select) { width: 100%; min-width: 0; padding: 9px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.sunspot-table-wrap { overflow-x: auto; max-height: 360px; }
.sunspot-table { width: 100%; border-collapse: collapse; font-size: .69rem; }
.sunspot-table :is(th, td) { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sunspot-table thead th { color: var(--muted); font-weight: 700; }
.sunspot-table button { padding: 7px 9px; min-height: 34px; font-size: inherit; color: #174763; background: #edf5f9; border: 1px solid #bed8e3; }
.sunspot-table button[aria-pressed="true"] { color: #fff; background: #174763; }
.sunspot-region-detail { margin-top: 16px; padding: 14px; border-radius: 11px; background: #edf6f8; color: #294d60; }
.sunspot-region-detail dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 9px; }
.sunspot-region-detail dt { font-size: .64rem; }
.sunspot-region-detail dd { margin: 4px 0; font-size: .82rem; font-weight: 800; }
.sunspot-region-detail p { font-size: .71rem; line-height: 1.6; }
.sunspot-chart { display: block; width: 100%; height: clamp(210px, 25vw, 300px); margin-top: 10px; overflow: visible; }
.sunspot-chart .sun-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.sunspot-chart text { fill: var(--muted); font: 12px system-ui, sans-serif; }
.sunspot-chart .sun-monthly, .sunspot-chart .sun-smoothed { fill: none; stroke: var(--sun-accent); stroke-width: 2; stroke-linejoin: round; }
.sunspot-chart .sun-smoothed { stroke: var(--sun-cool); stroke-width: 3; }
.sunspot-chart .sun-selected { stroke: #617f91; stroke-dasharray: 3 4; }
.sunspot-chart circle { fill: var(--sun-accent); stroke: #fff; stroke-width: 2; }
.sunspot-chart-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: .72rem; color: var(--sun-accent); }
.sunspot-chart-legend span + span { color: var(--sun-cool); }
.sunspot-month-control { margin-block: 12px; }
.sunspot-month-control input { width: 100%; accent-color: var(--sun-accent); }
.sunspot-chart-reading { min-height: 2.8em; margin: 0; padding: 10px; font-size: .78rem; color: var(--ink); background: #f4f8fa; border-radius: 8px; }
.sunspot-region-activity, .sunspot-xrays { margin-block: 18px; }
.sunspot-activity-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; }
.sunspot-activity-grid > section { min-width: 0; }
.sunspot-activity-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.sunspot-region-activity :is(header > label, .sunspot-activity-heading > label) { width: min(100%, 220px); }
.sunspot-probability-panel { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f3f8fa; color: #264754; }
.sunspot-probability-panel h4 { color: #264754; }
.sunspot-probabilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-block: 18px; }
.sunspot-probability { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 12px 8px; border: 1px solid #cbdce3; border-top: 4px solid #2f8399; border-radius: 10px; background: #fff; text-align: center; font-size: .75rem; }
.sunspot-probability-m { border-top-color: #a96314; }
.sunspot-probability-x { border-top-color: #b33b50; }
.sunspot-probability strong { display: block; font-size: clamp(.8rem, 1.7vw, 1.5rem); overflow-wrap: anywhere; line-height: 1.3; }
.sunspot-probability meter { width: 100%; height: 10px; }
.sunspot-history-table { margin-top: 12px; font-size: .76rem; }
.sunspot-history-table summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.sunspot-activity-chart { display: block; width: 100%; height: 270px; margin-top: 10px; overflow: visible; }
.sunspot-xray-chart { height: 300px; }
.sunspot-activity-chart text { fill: var(--muted); font: 11px system-ui, sans-serif; }
.sunspot-activity-chart .sun-axis-title { font-weight: 700; }
.sunspot-activity-chart .sun-grid { stroke: var(--line); stroke-width: 1; }
.sunspot-activity-chart .sun-cursor { stroke: #617f91; stroke-dasharray: 3 4; }
.sun-region-line { fill: none; stroke: var(--sun-accent); stroke-width: 2; stroke-linejoin: round; }
.sun-region-point { fill: var(--sun-accent); stroke: var(--surface); stroke-width: 1; }
.sunspot-xray-controls, .sunspot-event-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sunspot-xray-controls { margin-block: 14px; }
.sunspot-test .sunspot-xray-controls label.sunspot-inline-control { display: flex; align-items: center; gap: 7px; }
.sun-flux-line { fill: none; stroke-width: 1.7; stroke-linejoin: round; }
.sun-flux-long { stroke: #ae561c; }
circle.sun-flux-long { fill: #ae561c; }
.sun-flux-short { stroke: #187e96; }
circle.sun-flux-short { fill: #187e96; }
.sunspot-xray-legend span:nth-child(3) { color: #8d3d6a; }
.sun-flux-flagged { stroke-dasharray: 3 4; opacity: .65; }
.sun-flux-flagged-point { fill: var(--surface); stroke-width: 1.5; stroke-dasharray: 2 2; }
.sunspot-xray-legend .sunspot-flag-legend { color: var(--muted); border-bottom: 1px dashed currentColor; }
.sunspot-quality-note { padding: 12px 14px; border-left: 3px solid #25899a; border-radius: 9px; background: #25899a0a; color: var(--muted); font-size: .78rem; line-height: 1.8; }
.sun-event-marker { cursor: pointer; outline: none; }
.sun-event-marker path { fill: #93416d; stroke: #fff; stroke-width: 1; }
.sun-event-marker:focus-visible path { stroke: #173b52; stroke-width: 3; }
.sun-event-selected line { stroke: #93416d; stroke-dasharray: 5 3; stroke-width: 1.5; }
.sunspot-event-heading { margin-top: 25px; }
.sunspot-more { font-size: .8rem; font-weight: 700; }
@media (max-width: 850px) { .sunspot-activity-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
    .sunspot-probability-panel { padding: 12px; }
    .sunspot-probabilities { gap: 7px; }
    .sunspot-probability strong { font-size: 1.05rem; }
}
.sunspot-sources { margin-top: 17px; font-size: .76rem; color: var(--muted); line-height: 1.6; }
.sunspot-sources summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.sunspot-dialog { width: min(94vw, 1100px); max-height: 96dvh; padding: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.sunspot-dialog::backdrop { background: #071725d9; backdrop-filter: blur(5px); }
.sunspot-region-map { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sunspot-region-map[hidden] { display: none; }
.sunspot-map-guides { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sunspot-map-guides line { stroke: #ffe6a9; stroke-width: 1; }
.sunspot-map-guides circle { fill: #08283b; stroke: #ffe6a9; stroke-width: 1.5; }
.sunspot-test label[hidden], .sunspot-test .sunspot-map-marker[hidden] { display: none !important; }
.sunspot-test .sunspot-map-marker { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; min-height: 28px; min-width: 36px; padding: 3px 6px; color: #fff; background: #08283be8; border: 1.5px solid #ffde80; border-radius: 15px; font: 700 12px/1.3 system-ui, sans-serif; box-shadow: 0 1px 7px #000a; cursor: pointer; }
.sunspot-test .sunspot-map-marker:is(:hover, [aria-pressed="true"]) { background: #764314; color: #fff; border-color: #fff; z-index: 2; }
.sunspot-test .sunspot-map-marker:focus-visible { outline: 3px solid #fff; outline-offset: 3px; z-index: 3; }
.sunspot-coronal-help { padding: 12px; margin-block: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.sunspot-coronal-help summary { color: var(--ink); cursor: pointer; font-weight: 700; }
.sunspot-map-status { margin: 0; }
.sunspot-map-dialog { width: min(94vw, 800px); overflow-x: hidden; overflow-wrap: anywhere; }
.sunspot-map-dialog > header button { flex-shrink: 0; white-space: nowrap; }
.sunspot-map-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-block: 16px; }
.sunspot-map-facts > div { padding: 11px; border-radius: 8px; border: 1px solid var(--line); background: #f1f7fa; color: #203e51; }
.sunspot-map-facts dt { font-size: .7rem; }
.sunspot-map-facts dd { margin: 5px 0 0; font-size: .9rem; font-weight: 700; }
.sunspot-map-flares { margin-top: 20px; }
.sunspot-map-flares article { padding: 12px; margin-block: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; }
.sunspot-map-flares article p { font-size: .72rem; }
@media (max-width: 480px) { .sunspot-map-facts { grid-template-columns: 1fr; } }
.sunspot-dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sunspot-dialog h3 { font-size: 1rem; margin: 0; }
.sunspot-dialog .sunspot-picture-stage { width: min(100%, 58dvh); margin: auto; }
[data-sun-dialog] { width: calc(100vw - 24px); max-width: none; height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); box-sizing: border-box; }
[data-sun-dialog][open] { display: flex; flex-direction: column; }
[data-sun-dialog] > header { flex: 0 0 auto; }
[data-sun-dialog-body] { flex: 1; min-height: 0; }
[data-sun-dialog] [data-sun-viewer] { display: grid; height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: 'image tabs' 'image controls' 'image zoom'; gap: 12px 18px; }
[data-sun-dialog] .sunspot-picture-stage { grid-area: image; align-self: center; width: min(100%, calc(100dvh - 128px)); aspect-ratio: 1; margin: auto; }
[data-sun-dialog] .sunspot-image-tabs { grid-area: tabs; margin: 0; }
[data-sun-dialog] .sunspot-view-controls { grid-area: controls; align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 2px; }
[data-sun-dialog] .sunspot-zoom { grid-area: zoom; margin: 0; }
[data-sun-dialog] > p { flex: 0 0 auto; }
@media (max-width: 800px) {
    [data-sun-dialog] { overflow-y: auto; }
    [data-sun-dialog] > header { position: sticky; top: -10px; z-index: 6; padding-block: 6px; background: var(--surface); }
    [data-sun-dialog-body] { flex: 0 0 auto; }
    [data-sun-dialog] [data-sun-viewer] { display: flex; flex-direction: column; height: auto; gap: 12px; }
    [data-sun-dialog] .sunspot-picture-stage { order: -1; width: min(100%, calc(100dvh - 128px)); }
    [data-sun-dialog] .sunspot-view-controls { overflow: visible; }
}
.sunspot-dialog > p { font-size: .72rem; margin-bottom: 0; }
body:has(.sunspot-dialog[open]) { overflow: hidden; }
@media (max-width: 1100px) { .sunspot-overview { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
    .sunspot-card { padding: 11px; }
    .sunspot-region-controls { grid-template-columns: 1fr; }
    .sunspot-test .panel-heading { display: block; }
    .sunspot-actions { margin-top: 12px; }
    .sunspot-dialog { width: 96vw; padding: 10px; }
    body:has([data-admin-subpanel="sonnenflecken"].is-active) { min-width: 0; }
}
