:root {
  color-scheme: dark;
  --bg: #061321;
  --surface: #0a1a2b;
  --surface-2: #081728;
  --surface-3: #071422;
  --line: #17334d;
  --line-strong: #2a5f86;
  --text: #e6f0f8;
  --muted: #7f9bb3;
  --primary: #00a0e9;
  --primary-dark: #0085d0;
  --primary-soft: rgba(0, 160, 233, .12);
  --navy: #04101d;
  --navy-2: #062338;
  --cyan: #22c7d6;
  --amber: #f0b357;
  --red: #ff6b81;
  --blue: #33b5ff;
  --green: #35d39a;
  --fs-micro: clamp(9px, .56vw, 10px);
  --fs-small: clamp(10px, .64vw, 11px);
  --fs-base: clamp(11px, .72vw, 12px);
  --fs-title: clamp(12px, .82vw, 14px);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 88% -12%, #0b2b45 0, transparent 36rem), var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .4; background-image: linear-gradient(rgba(90, 150, 200, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(90, 150, 200, .055) 1px, transparent 1px); background-size: 34px 34px; }
button, input, select { font: inherit; }
button:focus-visible, .file-button:focus-visible { outline: 2px solid rgba(0, 160, 233, .7); outline-offset: 2px; }
.stats-grid strong, .serial-status b, tbody { font-variant-numeric: tabular-nums; }

.topbar { position: relative; z-index: 5; height: 52px; padding: 0 clamp(14px, 2vw, 30px); display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--primary); background: linear-gradient(100deg, var(--navy) 0, var(--navy-2) 58%, #083752 100%); box-shadow: 0 2px 12px rgba(0, 0, 0, .32); }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.brand-mark { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; overflow: hidden; color: #03121f; border: 0; font: 900 11px monospace; background: linear-gradient(135deg, #0085d0, #22c7d6); clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%); cursor: pointer; transition: filter .15s, border-color .15s; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #071422; }
.brand-mark.has-logo { clip-path: none; border: 1px solid var(--line-strong); border-radius: 5px; background: #071422; }
.brand-mark:hover { filter: brightness(1.1); }
.brand-mark:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.brand-copy { min-width: 0; }
.brand strong, .brand small { display: block; max-width: min(46vw, 420px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.brand strong { font-size: clamp(12px, 1vw, 15px); font-weight: 650; letter-spacing: .04em; color: #eaf5ff; }
.brand small { margin-top: 1px; color: #8fb3cf; font-size: clamp(9px, .66vw, 11px); letter-spacing: .02em; }
.topbar-actions { min-width: 0; display: flex; align-items: center; gap: 10px; }
.system-state { min-width: 0; display: flex; align-items: center; gap: 7px; color: #9dbdd6; font-size: var(--fs-small); }
.fullscreen-button { flex: 0 0 30px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; color: #9dbdd6; border: 1px solid rgba(79, 195, 255, .32); border-radius: 4px; background: rgba(0, 160, 233, .08); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.fullscreen-button:hover { color: #fff; border-color: var(--primary); background: rgba(0, 160, 233, .2); }
.fullscreen-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-button .icon-compress { display: none; }
.fullscreen-button.is-fullscreen .icon-expand { display: none; }
.fullscreen-button.is-fullscreen .icon-compress { display: block; }
.system-state i, .serial-status i { width: 7px; height: 7px; border-radius: 50%; background: #d9a328; box-shadow: 0 0 0 3px rgba(217, 163, 40, .12); }
.system-state i.ok, .serial-status i.active { background: var(--green); box-shadow: 0 0 0 3px rgba(53, 211, 154, .14); }
.system-state i.error { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 107, 129, .14); }

.serial-toolbar { position: relative; z-index: 4; height: 54px; padding: 7px clamp(12px, 1.6vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #0a1a2b; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.toolbar-controls, .toolbar-actions, .command-controls { min-width: 0; display: flex; align-items: center; gap: 7px; }
.command-toggle { height: 32px; padding: 0 10px; display: flex; align-items: center; gap: 7px; color: #a9c1d6; border-right: 1px solid var(--line); font-size: var(--fs-base); white-space: nowrap; cursor: pointer; }
.command-toggle input { width: 15px; height: 15px; accent-color: var(--primary); }
.inline-field { height: 32px; display: flex; align-items: center; gap: 6px; }
.inline-field > span { color: var(--muted); font-size: var(--fs-micro); white-space: nowrap; }
select, input { height: 30px; padding: 0 8px; color: var(--text); border: 1px solid #1d3d58; border-radius: 4px; outline: 0; background: #0a1c2e; }
select:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 160, 233, .16); }
.inline-field select { width: 96px; font-size: var(--fs-small); }
.command-controls .inline-field:first-child select { width: 88px; }
.custom-rate input { width: 60px; }
.custom-rate #rateHint { max-width: 160px; color: var(--amber); font: 10px/1.2 monospace; }
.button { height: 32px; padding: 0 13px; border: 1px solid rgba(0, 160, 233, .38); border-radius: 4px; color: #4fc3ff; background: rgba(0, 160, 233, .1); cursor: pointer; white-space: nowrap; font-size: var(--fs-small); transition: background .15s, border-color .15s, color .15s; }
.button:hover:not(:disabled) { background: rgba(0, 160, 233, .2); border-color: var(--primary); }
.button.primary { color: #03121f; font-weight: 700; border-color: var(--primary); background: var(--primary); }
.button.primary:hover:not(:disabled) { background: #26b4f5; }
.button.ghost { color: var(--green); border-color: rgba(53, 211, 154, .35); background: rgba(53, 211, 154, .08); }
.button.ghost:hover:not(:disabled) { background: rgba(53, 211, 154, .16); border-color: var(--green); }
.button.subtle { color: #9fb8cc; border-color: var(--line); background: transparent; }
.button.subtle:hover:not(:disabled) { background: #12283d; border-color: var(--line-strong); }
.button.running { color: #1a0710; border-color: var(--red); background: var(--red); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.serial-status { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 6px; min-width: 112px; padding-left: 5px; }
.serial-status i { grid-row: 1 / 3; }
.serial-status b { color: var(--text); font-size: var(--fs-small); font-weight: 500; }
.serial-status small { color: var(--muted); font-size: var(--fs-micro); }

.main-container { position: relative; z-index: 1; width: min(1920px, 100%); height: calc(100dvh - 106px); min-height: 0; margin: auto; padding: 10px clamp(8px, 1vw, 16px) 12px; display: flex; gap: 10px; overflow: hidden; }
.visualization-area { min-width: 0; min-height: 0; flex: 1; padding: 7px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; border: 1px solid #14304a; border-radius: 6px; background: var(--surface-3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 4px 14px rgba(0, 0, 0, .22); }
.chart-card, .axis-column { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #17334d; border-radius: 5px; background: #0a1c2d; }
.raw-card { flex: 0 0 50%; display: flex; flex-direction: column; }
.card-title { flex: 0 0 34px; padding: 5px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0d2236, #0a1a2b); }
.card-heading { min-width: 0; }
.card-heading strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-title .card-heading > span { display: block; color: var(--cyan); font: 600 9px/1 Inter, "Noto Sans SC", sans-serif; letter-spacing: .12em; }
.card-title .card-heading > strong { display: block; margin-top: 3px; font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.card-title em { margin-left: 6px; color: var(--muted); font: 400 9px/1 Inter, sans-serif; font-style: normal; letter-spacing: .06em; }
.raw-card canvas { flex: 1; min-height: 0; }
canvas { display: block; width: 100%; height: 100%; }
.legend { display: flex; gap: 4px; }
.legend button { width: 28px; height: 22px; border: 1px solid currentColor; border-radius: 3px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; opacity: .38; }
.legend button.active { opacity: 1; color: #fff; }
.legend .x { color: var(--red); }
.legend .y { color: var(--blue); }
.legend .z { color: var(--green); }
.legend .x.active { background: var(--red); }
.legend .y.active { background: var(--blue); }
.legend .z.active { background: var(--green); }

.analysis-views { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.analysis-view-bar { flex: 0 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.analysis-view-bar > span { color: var(--muted); font-size: var(--fs-micro); letter-spacing: .08em; }
.analysis-switch button { height: 25px; padding: 0 12px; font-size: var(--fs-small); }
.axis-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.trend-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1.45fr 1fr; gap: 7px; }
.spectrum-card { grid-column: 1 / -1; min-height: 0; display: flex; flex-direction: column; }
.trend-card { min-height: 0; display: flex; flex-direction: column; }
.spectrum-card canvas, .trend-card canvas { flex: 1; min-height: 0; }
.chart-note { color: var(--muted); font: 9px/1 monospace; }
.axis-column { display: grid; grid-template-rows: 30px minmax(0, 1fr) minmax(72px, 27%); }
.axis-head { padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0d2236, #0a1a2b); }
.axis-head-end { min-width: 0; display: flex; align-items: center; gap: 5px; }
.axis-head .metric-tooltip { width: min(280px, calc(100vw - 38px)); }
.axis-column { overflow: visible; }
.axis-head span { font: 650 clamp(10px, .76vw, 12px)/1 Inter, "Noto Sans SC", sans-serif; letter-spacing: .04em; }
.axis-head small { color: var(--muted); font: 400 9px/1 Inter, sans-serif; letter-spacing: .08em; }
.axis-head.x span { color: var(--red); }
.axis-head.y span { color: var(--blue); }
.axis-head.z span { color: var(--green); }
.band-canvas, .mini-canvas { min-height: 0; overflow: hidden; background: #081725; }
.mini-canvas { border-top: 1px solid var(--line); }

.info-panel { flex: 0 0 clamp(340px, 24vw, 430px); min-width: 0; min-height: 0; padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow: hidden; border: 1px solid #14304a; border-radius: 6px; background: var(--surface); box-shadow: 0 4px 14px rgba(0, 0, 0, .22); }
.info-section { min-height: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.info-title { height: 32px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0d2236, #0a1a2b); }
.info-title .title-with-help > span { color: #4fc3ff; font-size: var(--fs-base); font-weight: 600; letter-spacing: .06em; }
.info-title small { color: var(--muted); font-size: clamp(9px, .55vw, 10px); }
.info-title i { width: 6px; height: 6px; border-radius: 50%; background: #2b455c; }
.info-title i.active { background: var(--green); box-shadow: 0 0 0 3px rgba(53, 211, 154, .14); animation: pulse 1.2s infinite; }

.view-switch { flex: 0 0 auto; display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.view-switch button { height: 21px; padding: 0 8px; border: 0; color: var(--muted); background: transparent; font-size: var(--fs-micro); letter-spacing: .04em; cursor: pointer; }
.view-switch button + button { border-left: 1px solid var(--line); }
.view-switch button.active { color: #03121f; background: var(--primary); font-weight: 700; }
.title-with-help { display: flex; align-items: center; gap: 5px; min-width: 0; }
.help-wrap { position: relative; display: inline-flex; }
.help-button { width: 17px; height: 17px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(0, 160, 233, .45); border-radius: 50%; color: #4fc3ff; background: rgba(0, 160, 233, .12); font: 700 11px/1 monospace; cursor: help; }
.help-button.tiny { width: 14px; height: 14px; font-size: 9px; }
.help-button:hover, .help-button:focus-visible { color: #03121f; background: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(0, 160, 233, .18); }
.metric-tooltip { position: absolute; z-index: 12; top: calc(100% + 8px); left: -12px; width: min(320px, calc(100vw - 38px)); padding: 12px 13px; display: grid; gap: 6px; color: #b9d0e2 !important; border: 1px solid var(--line-strong); border-radius: 5px; background: #0d2032; box-shadow: 0 14px 34px rgba(0, 0, 0, .45); font: 11px/1.5 Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif !important; font-weight: 400 !important; letter-spacing: 0 !important; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-4px); transition: opacity .16s, transform .16s, visibility .16s; }
.metric-tooltip.align-right { left: auto; right: 0; }
.metric-tooltip.tip-up { top: auto; bottom: calc(100% + 8px); transform: translateY(4px); }
.metric-tooltip strong { color: #fff; font-size: 12px; }
.title-end { display: flex; align-items: center; gap: 6px; }
.info-title .metric-tooltip, .card-title .metric-tooltip { width: min(300px, calc(100vw - 38px)); }
.band-section .metric-tooltip, .analysis-info-section .metric-tooltip { left: -40px; width: min(280px, calc(100vw - 38px)); }
.metric-tooltip b { display: inline; color: #4fc3ff; font-weight: 600; }
.metric-tooltip em { margin-top: 2px; padding-top: 6px; color: var(--amber); border-top: 1px solid var(--line); font-style: normal; }
.help-wrap:hover .metric-tooltip, .help-wrap:focus-within .metric-tooltip { opacity: 1; visibility: visible; transform: none; }
.spectrum-card, .trend-card { overflow: visible; }
.trend-card, .raw-card { container-type: inline-size; }
.trend-card .metric-tooltip, .raw-card .metric-tooltip { width: min(300px, calc(100cqw - 12px)); }

.stats-section { flex: 0 0 auto; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; }
.stats-grid div { min-width: 0; padding: 7px 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid div:nth-child(even) { border-right: 0; }
.stats-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.stats-grid span { display: block; color: var(--muted); font-size: var(--fs-micro); }
.stats-grid strong { display: block; margin-top: 3px; color: #ffcb6b; font: 600 15px monospace; }


.band-section { flex: 1; display: flex; flex-direction: column; }
.table-wrap { min-height: 0; flex: 1; overflow: hidden; container-type: inline-size; }
table { width: 100%; height: 100%; table-layout: fixed; border-collapse: collapse; font-family: "JetBrains Mono", Consolas, monospace; font-size: clamp(9px, .64vw, 11px); line-height: 1.2; }
thead { height: 27px; }
th, td { padding: clamp(2px, .35vh, 5px) clamp(2px, .3vw, 6px); text-align: center; border-bottom: 1px solid var(--line); }
th { color: #9fbcd4; background: #0f2a40; font-size: 1.05em; letter-spacing: .04em; }
th:first-child { width: clamp(36px, 12%, 48px); }
td:first-child { color: var(--band-color, var(--primary)); font-size: 1.08em; font-weight: 800; }
td strong { display: block; color: var(--band-color, var(--text)); font-size: 1em; font-weight: 650; white-space: nowrap; }
td small { display: grid; justify-items: center; gap: 1px; margin-top: 3px; color: color-mix(in srgb, var(--band-color, var(--muted)) 80%, #9fbcd4); font-size: .84em; white-space: nowrap; }
td small span:first-child, td small span:last-child { color: inherit; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, .014); }
tbody tr:hover { background: color-mix(in srgb, var(--band-color, var(--primary)) 10%, transparent); }
td.empty-row { text-align: center; vertical-align: middle; color: var(--muted); font-family: Inter, "Noto Sans SC", sans-serif; font-size: var(--fs-small); letter-spacing: .04em; }

.band-1 { --band-color: #33b5ff; }
.band-2 { --band-color: #35d39a; }
.band-3 { --band-color: #22c7d6; }
.band-4 { --band-color: #f0b357; }
.band-5 { --band-color: #a78bfa; }
.band-6 { --band-color: #ff6b81; }
.band-7 { --band-color: #5b9dff; }
.band-8 { --band-color: #8fd14f; }
.band-9 { --band-color: #c792ea; }
.band-10 { --band-color: #ffa066; }

.stream-status { flex: 0 0 29px; padding: 0 8px; display: flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: var(--surface-3); font-size: var(--fs-micro); overflow: hidden; }
.stream-status i { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #2b455c; }
.stream-status.active i { background: var(--green); box-shadow: 0 0 0 3px rgba(53, 211, 154, .14); }
.stream-status span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.brand-dialog { width: min(472px, calc(100vw - 26px)); max-height: calc(100dvh - 28px); padding: 0; overflow: auto; color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; background: #0b1c2d; box-shadow: 0 30px 72px rgba(0, 0, 0, .58); }
.brand-dialog::backdrop { background: rgba(2, 10, 18, .74); backdrop-filter: blur(3px); }
.dialog-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0f2740, #0a1a2b); }
.dialog-eyebrow { display: block; color: var(--cyan); font: 600 10px/1 monospace; letter-spacing: .16em; }
.dialog-head h2 { margin: 4px 0 0; font-size: 16px; font-weight: 600; }
.icon-button { flex: 0 0 28px; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); background: #12283d; }
.dialog-body { padding: 15px 16px; display: grid; gap: 13px; }
.logo-editor { display: flex; align-items: center; gap: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-3); }
.logo-preview { flex: 0 0 64px; width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; color: #03121f; border: 1px solid var(--line-strong); border-radius: 6px; background: linear-gradient(135deg, #0085d0, #22c7d6); font: 900 18px monospace; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #071422; }
.logo-actions { min-width: 0; display: grid; gap: 7px; }
.logo-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.file-button { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; color: #4fc3ff; border: 1px solid rgba(0, 160, 233, .4); border-radius: 4px; background: rgba(0, 160, 233, .12); font-size: var(--fs-small); cursor: pointer; }
.file-button:hover { background: rgba(0, 160, 233, .2); border-color: var(--primary); }
.logo-actions p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.dialog-field { display: grid; gap: 6px; }
.dialog-field > span { color: var(--muted); font-size: var(--fs-small); letter-spacing: .04em; }
.dialog-field input { height: 34px; font-size: 12px; }
.dialog-actions { padding: 12px 16px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); background: var(--surface-3); }
.dialog-spacer { flex: 1; }

#toast { position: fixed; right: 18px; bottom: 16px; max-width: 420px; padding: 11px 15px; color: var(--text); border: 1px solid var(--line-strong); border-left: 3px solid var(--primary); border-radius: 4px; background: #0d2032; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transform: translateY(80px); opacity: 0; transition: .25s; z-index: 20; font-size: 12px; }
#toast.show { transform: none; opacity: 1; }
#toast.error { border-color: rgba(255, 107, 129, .5); border-left-color: var(--red); }

@keyframes pulse { 50% { opacity: .35; } }
@media (max-height: 720px) { .topbar { height: 46px; }.serial-toolbar { height: 48px; padding-block: 5px; }.main-container { height: calc(100dvh - 94px); padding-block: 7px; }.raw-card { flex-basis: 48%; }.axis-column { grid-template-rows: 26px minmax(0, 1fr) minmax(52px, 30%); }.analysis-view-bar { flex-basis: 22px; }.analysis-switch button { height: 22px; }.stats-grid div { padding-block: 4px; }.info-title { height: 27px; }.stream-status { flex-basis: 24px; } }
@media (max-width: 980px) { .info-panel { flex-basis: 320px; }.toolbar-actions .subtle { display: none; }.brand small { display: none; } }
@media (max-width: 760px) { .topbar { height: 44px; }.brand strong { font-size: 11px; }.system-state span { display: none; }.serial-toolbar { height: 82px; padding: 5px 7px; align-items: stretch; }.toolbar-controls { flex: 1; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 32px 32px; gap: 4px; }.command-toggle { padding-inline: 4px; border: 0; }.inline-field > span { display: none; }.inline-field select { width: 100%; }.command-controls { grid-column: 1 / 4; min-width: 0; }.command-controls .inline-field:first-child { flex: 1; }.command-controls .inline-field:first-child select { width: 100%; }.serial-status { display: none; }.toolbar-actions { align-items: center; }.toolbar-actions .button:not(.ghost) { display: none; }.main-container { height: calc(100dvh - 126px); padding: 5px; gap: 5px; }.visualization-area { padding: 4px; gap: 4px; }.info-panel { flex-basis: 40%; padding: 4px; gap: 4px; }.stats-grid { grid-template-columns: 1fr; }.stats-grid div { padding: 3px 5px; border-right: 0; }.stats-grid div:nth-child(n+3) { display: none; }.stats-grid strong { font-size: 12px; }.axis-grid { gap: 3px; }.analysis-view-bar > span { display: none; }.analysis-switch { width: 100%; }.analysis-switch button { flex: 1; }.analysis-switch button { height: 22px; }.trend-grid { grid-template-columns: 1fr 1fr; gap: 3px; }.axis-head { padding-inline: 4px; }.axis-head small { display: none; }.axis-head .help-wrap { display: none; }.raw-card .help-wrap { display: none; }.info-title small { display: none; }table { font-size: clamp(8px, 1.7vw, 10px); }td small { gap: 2px; margin-top: 1px; }th, td { padding: 1px; } }
@media (max-width: 480px) { .view-switch { display: none; }.info-title .help-wrap { display: none; }.logo-editor { flex-direction: column; align-items: flex-start; }.logo-preview { flex-basis: 56px; width: 56px; height: 56px; font-size: 15px; }.dialog-actions { flex-wrap: wrap; }.dialog-actions .button { flex: 1; } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
.analysis-info-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.spectrum-summary { display: grid; grid-template-columns: repeat(3, 1fr); }
.spectrum-summary div { min-width: 0; padding: 6px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spectrum-summary div:nth-child(3n) { border-right: 0; }
.spectrum-summary div:nth-last-child(-n+3) { border-bottom: 0; }
.spectrum-summary span { display: block; color: var(--muted); font-size: var(--fs-micro); }
.spectrum-summary strong { display: block; margin-top: 3px; color: #ffcb6b; font: 600 14px monospace; }
.dominant-wrap { flex: 0 0 auto; }
.dominant-table { height: auto; }
.dominant-table thead { height: 26px; }
.dominant-table tbody tr { height: auto; }
.dominant-table th, .dominant-table td { padding: 5px 8px; }
.dominant-table td:first-child { width: 36px; font-weight: 700; }
.dominant-x td:first-child { color: var(--red); }
.dominant-y td:first-child { color: var(--blue); }
.dominant-z td:first-child { color: var(--green); }
.subsection-title { flex: 0 0 26px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0d2236, #0a1a2b); }
.subsection-title span { color: #4fc3ff; font-size: var(--fs-small); font-weight: 600; }
.subsection-title small { color: var(--muted); font-size: var(--fs-micro); }
.top-band-list { flex: 0 0 auto; min-height: 0; overflow: hidden; }
.top-band-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 6px 9px; border-bottom: 1px solid var(--line); border-left: 2px solid var(--band-color, var(--primary)); font-size: var(--fs-small); }
.top-band-row:last-child { border-bottom: 0; }
.top-band-code { color: var(--band-color, var(--primary)); font-weight: 700; }
.top-band-freq { color: var(--text); font-family: "JetBrains Mono", Consolas, monospace; }
.top-band-share { color: var(--amber); font-family: "JetBrains Mono", Consolas, monospace; }
.top-band-empty { padding: 14px 9px; color: var(--muted); font-size: var(--fs-small); text-align: center; }
.instant-section { flex: 0 0 auto; }
.instant-wrap { flex: 0 0 auto; }
.instant-table { height: auto; font-size: clamp(8px, .58vw, 10px); }
.instant-table thead { height: 24px; }
.instant-table tbody tr { height: auto; }
.instant-table th, .instant-table td { padding: 4px; }
.instant-table td:first-child { width: 34px; font-weight: 700; }
.instant-x td:first-child { color: var(--red); }
.instant-y td:first-child { color: var(--blue); }
.instant-z td:first-child { color: var(--green); }
.instant-sum td:first-child { color: var(--amber); }

@media (max-height: 820px) {
  .instant-table th, .instant-table td { padding: 3px 4px; }
  .instant-table thead { height: 22px; }
  .spectrum-summary div { padding: 4px 7px; }
  .spectrum-summary strong { font-size: 12px; }
  .stats-grid div { padding-block: 4px; }
}

@media (max-width: 760px) { .instant-section { display: none; } }
.orbit-panel { flex: 1; min-height: 0; display: flex; }
.orbit-card { flex: 1; min-height: 0; }
.orbit-card canvas { flex: 1; min-height: 0; cursor: grab; touch-action: none; }
.orbit-card canvas.dragging { cursor: grabbing; }
.orbit-info-section { flex: 0 0 auto; }
.orbit-summary { display: grid; grid-template-columns: 1fr 1fr; }
.orbit-summary div { padding: 7px 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.orbit-summary div:nth-child(even) { border-right: 0; }
.orbit-summary div:nth-last-child(-n+2) { border-bottom: 0; }
.orbit-summary span { display: block; color: var(--muted); font-size: var(--fs-micro); }
.orbit-summary strong { display: block; margin-top: 3px; color: #ffcb6b; font: 600 13px monospace; }
.orbit-meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.orbit-meta div { padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: var(--fs-small); }
.orbit-meta strong { color: var(--text); font-family: "JetBrains Mono", Consolas, monospace; }
.orbit-help { padding: 8px 9px; color: var(--muted); border-top: 1px solid var(--line); font-size: var(--fs-micro); }
.orbit-info-section .metric-tooltip { left: -40px; width: min(280px, calc(100vw - 38px)); }
.chart-select { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: var(--fs-micro); }
.chart-select select { width: 54px; height: 24px; padding: 0 5px; font-size: var(--fs-small); }
.waterfall-panel { flex: 1; min-height: 0; display: flex; }
.waterfall-card { flex: 1; min-height: 0; }
.waterfall-card canvas { flex: 1; min-height: 0; cursor: grab; touch-action: none; }
.waterfall-card canvas.dragging { cursor: grabbing; }
.waterfall-info-section { flex: 0 0 auto; }
.waterfall-info-section .metric-tooltip { left: -40px; width: min(280px, calc(100vw - 38px)); }
.waterfall-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.waterfall-card { min-width: 0; display: flex; flex-direction: column; }
.orbit-tools { gap: 5px; }
.orbit-tools .button { height: 24px; padding: 0 8px; font-size: var(--fs-micro); }
.orbit-presets button { height: 22px; padding: 0 7px; font-size: 9px; }
.orbit-card canvas.hovering { cursor: crosshair; }
@media (max-width: 900px) { .orbit-tools .orbit-tool { display: none; } }
.orbit-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.orbit-card { min-width: 0; display: flex; flex-direction: column; }
.orbit-plane-card canvas { cursor: default; }

.view3d-panel { flex: 1; min-height: 0; display: flex; }
.view3d-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
@media (max-width: 1200px) { .view3d-grid .chart-note { display: none; } }
@media (max-width: 760px) {
  .view3d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}

.timefreq-panel { flex: 1; min-height: 0; display: flex; }
.timefreq-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1.3fr 1fr; gap: 7px; }
.timefreq-grid > .chart-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.timefreq-grid canvas { flex: 1; min-height: 0; }
.chart-select input { width: 62px; height: 24px; padding: 0 5px; font-size: var(--fs-small); }
.timefreq-info-section { flex: 0 0 auto; }
.timefreq-info-section .metric-tooltip { left: -40px; width: min(280px, calc(100vw - 38px)); }
@media (max-width: 760px) {
  .timefreq-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1.3fr 1fr; }
}

.insight-card { margin: 7px; padding: 9px 10px; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 4px; background: linear-gradient(90deg, rgba(0, 160, 233, .09), rgba(0, 160, 233, .02)); }
.insight-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.insight-label { color: #4fc3ff; font-size: var(--fs-small); font-weight: 600; letter-spacing: .05em; }
.insight-badge { padding: 2px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(120, 170, 210, .08); font-size: var(--fs-micro); }
.insight-badge.ok { color: var(--green); border-color: rgba(53, 211, 154, .35); background: rgba(53, 211, 154, .1); }
.insight-badge.warn { color: var(--amber); border-color: rgba(240, 179, 87, .4); background: rgba(240, 179, 87, .1); }
.insight-badge.info { color: #4fc3ff; border-color: rgba(0, 160, 233, .4); background: rgba(0, 160, 233, .1); }
.insight-text { margin: 0; color: #c5d8e6; font-size: var(--fs-small); line-height: 1.65; white-space: pre-line; }
.insight-text b { color: #ffffff; font-weight: 600; }
@media (max-height: 820px) {
  .insight-card { padding: 7px 8px; }
  .insight-text { line-height: 1.5; }
}

.insight-section { flex: 0 0 auto; }
.insight-section .info-title { gap: 8px; }
.insight-section .insight-card { margin: 7px; }

.insight-cadence { gap: 0; }
.insight-cadence select { width: 48px; height: 20px; padding: 0 4px; font-size: var(--fs-micro); }
.insight-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 5px; color: var(--muted); border-top: 1px solid var(--line); font-size: var(--fs-micro); }
