:root {
  --bg-deep: #050810;
  --bg-panel: rgba(8, 18, 32, 0.82);
  --border: rgba(0, 212, 255, 0.22);
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.45);
  --accent-warm: #ff6b35;
  --accent-cold: #4da6ff;
  --text: #e8f4fc;
  --text-muted: #7a9bb8;
  --glow: 0 0 24px rgba(0, 212, 255, 0.15);
  --font-display: "Orbitron", sans-serif;
  --font-body: "Noto Sans SC", sans-serif;
  --panel-width: 340px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(0, 100, 180, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0, 212, 255, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

.app {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.panel-column {
  position: relative;
  width: var(--panel-width);
  flex-shrink: 0;
  min-height: 0;
  overflow: visible;
  transition: width 0.22s ease;
}

.app.panel-collapsed .panel-column {
  width: 0;
  min-width: 0;
}

.panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--glow);
  overflow: hidden;
  transition: opacity 0.18s ease, border-color 0.22s ease;
}

.app.panel-collapsed .panel {
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.panel-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.app.panel-collapsed .panel-body { display: none; }

.panel-toggle-btn {
  position: absolute;
  left: 100%;
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  width: 28px;
  height: 52px;
  padding: 0;
  border-radius: 0 8px 8px 0;
  border: 1px solid var(--border);
  border-left: none;
  background: rgba(8, 18, 32, 0.95);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.panel-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.12);
}

.panel-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-header h1 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.panel-tagline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.panel-tagline {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1.45;
  text-shadow: 0 0 18px rgba(0, 212, 255, 0.35);
}

.panel-fullscreen-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0, 40, 70, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.panel-fullscreen-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.panel-bottom {
  flex-shrink: 0;
  padding: 10px 14px 18px;
  border-top: 1px solid var(--border);
  background: rgba(5, 12, 24, 0.45);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 14px 0 8px;
  opacity: 0.9;
}

.section-label:first-child { margin-top: 2px; }

.display-controls .section-label {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
}

.display-controls .slider-label {
  font-size: 0.88rem;
}

.display-controls .slider-val {
  font-size: 0.84rem;
}

.display-controls .toggle-check {
  font-size: 0.88rem;
  line-height: 1.4;
}

.display-controls .toggle-check-input {
  width: 16px;
  height: 16px;
}

.cyclone-toggle-row {
  flex-direction: column;
  gap: 10px;
}

.cyclone-toggle-row .toggle-check {
  min-width: 0;
  width: 100%;
}

.knowledge-select-wrap { margin-bottom: 14px; }

.knowledge-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 40, 70, 0.5);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.84rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300d4ff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.knowledge-select:hover,
.knowledge-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.slider-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
}

.slider-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.slider-val {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  text-align: right;
  min-width: 2.8em;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 212, 255, 0.2);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  cursor: pointer;
}

input[type="range"]:disabled,
input[type="range"].slider-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

input[type="range"]:disabled::-webkit-slider-thumb,
input[type="range"].slider-locked::-webkit-slider-thumb {
  cursor: not-allowed;
  box-shadow: none;
}

.slider-row-progress {
  grid-template-columns: auto 1fr auto auto;
}

.slider-row-progress .slider-val {
  min-width: 2.4em;
}

.passage-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.45);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.passage-play-btn svg {
  display: block;
}

.passage-play-btn:hover {
  background: rgba(0, 212, 255, 0.16);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}

.passage-play-btn:active {
  transform: translateY(1px);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: calc(50% - 8px);
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
}

.toggle-check-input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-check:has(.toggle-check-input:checked) {
  color: var(--accent);
}

.toggle-check-label {
  flex: 1;
}

.knowledge-box {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 20, 40, 0.5);
  font-size: 0.8rem;
  line-height: 1.75;
  max-height: min(42vh, 320px);
  overflow-y: auto;
}

.knowledge-box h3 {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.knowledge-box ul {
  margin: 8px 0 0 18px;
  color: var(--text-muted);
}

.knowledge-box strong { color: var(--text); }

.knowledge-intro {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.knowledge-box--compare {
  margin-bottom: 0;
  padding: 8px 10px;
  max-height: none;
  overflow: visible;
}

.knowledge-box--compare h3 {
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.knowledge-compare-table-wrap {
  max-height: 132px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.knowledge-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.66rem;
  line-height: 1.38;
}

.knowledge-compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--accent);
  font-weight: 600;
  background: rgba(8, 22, 40, 0.98);
  box-shadow: 0 1px 0 rgba(0, 212, 255, 0.18);
}

.knowledge-compare-table th,
.knowledge-compare-table td {
  border: 1px solid rgba(0, 212, 255, 0.14);
  padding: 3px 5px;
  text-align: left;
  vertical-align: top;
}

.knowledge-compare-table tbody tr:nth-child(even) {
  background: rgba(0, 30, 55, 0.28);
}

.knowledge-compare-table td:first-child {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.knowledge-compare-table td:not(:first-child) {
  color: var(--text-muted);
}

.panel--compare-knowledge .panel-bottom {
  flex-shrink: 1;
  min-height: 0;
  max-height: 38%;
  padding-top: 8px;
  padding-bottom: 12px;
}

.panel--compare-knowledge .panel-bottom .section-label {
  margin: 4px 0 6px;
}

.panel--compare-knowledge .panel-scroll {
  flex: 1 1 auto;
  min-height: 180px;
}

.copyright-entry {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.copyright-text-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.copyright-text-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}

.modal-overlay[hidden] { display: none !important; }

.modal-dialog {
  max-width: 440px;
  padding: 18px 16px;
  border-radius: 8px;
  background: rgba(8, 18, 32, 0.98);
  border: 1px solid var(--border);
}

.modal-title {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--accent);
  text-align: center;
}

.copyright-qr-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.copyright-qr-item {
  flex: 1 1 150px;
  max-width: 200px;
  text-align: center;
}

.copyright-qr-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.copyright-qr-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.copyright-note {
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.modal-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(0, 40, 70, 0.6);
  cursor: pointer;
}

.viewport-wrap {
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  background: #182638;
}

#canvas-container {
  position: absolute;
  inset: 0;
  background: #182638;
}

#canvas-container canvas { display: block; width: 100% !important; height: 100% !important; }

.hud-tl {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0 0 8px 0;
  background: rgba(5, 12, 24, 0.6);
  pointer-events: none;
}

.hud-block {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  font-family: var(--font-display);
}

.hud-block:last-child { border-right: none; }

.hud-label {
  display: block;
  font-size: 0.65rem;
  color: var(--accent-dim);
}

.hud-stat {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--accent);
}

.legend {
  position: absolute;
  bottom: 80px;
  right: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(5, 15, 28, 0.85);
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.legend.visible { opacity: 1; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--text-muted);
}

.legend-swatch {
  width: 22px;
  height: 10px;
  border-radius: 2px;
}

.schematic-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.88);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.schematic-overlay.visible { opacity: 1; }

.schematic-overlay .schematic-title {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

.schematic-overlay canvas {
  width: 100%;
  height: auto;
  display: block;
}

.occluded-schematic-panel {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  width: min(342px, calc(100% - 24px));
  padding: 5px 8px 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  z-index: 5;
  pointer-events: none;
}

.occluded-schematic-panel.visible {
  display: block;
}

.occluded-schematic-title {
  display: block;
  width: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  color: #333;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.occluded-schematic-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: #fff;
  overflow: visible;
}

.cyclone-schematic-panel {
  display: none;
  position: absolute;
  inset: 28px 16px 48px 16px;
  padding: 8px 10px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  z-index: 6;
  pointer-events: none;
  overflow-y: auto;
  box-sizing: border-box;
}

.cyclone-schematic-panel.visible {
  display: grid;
  place-content: safe center;
  justify-items: center;
}

.cyclone-schematic-panel--judge {
  pointer-events: auto;
}

.cyclone-schematic-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 840px;
}

.cyclone-schematic-stage {
  position: relative;
  width: 100%;
  overflow: visible;
}

.cyclone-schematic-side {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  align-self: stretch;
}

.cyclone-schematic-panel--judge .cyclone-schematic-side {
  flex: 0 0 256px;
  width: 256px;
  max-width: 256px;
}

.cyclone-schematic-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: #fff;
}

.cyclone-schematic-panel--judge .cyclone-judge-aside {
  position: static;
  flex: 0 0 248px;
  width: 248px;
  max-width: 248px;
  max-height: none;
  align-self: flex-start;
  pointer-events: auto;
  overflow-y: auto;
}

.cyclone-schematic-panel--judge .cyclone-schematic-body {
  max-width: none;
  gap: 10px;
}

.cyclone-schematic-panel--judge .cyclone-schematic-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 840px;
}

.cyclone-schematic-panel--judge .cyclone-schematic-layout {
  max-width: none;
  width: 100%;
}

.cyclone-judge-aside {
  display: none;
  flex-shrink: 0;
  pointer-events: none;
}

.cyclone-judge-aside:not([hidden]) {
  display: block;
}

.cyclone-judge-aside[hidden] {
  display: none !important;
}

.cyclone-schematic-panel--judge .cyclone-judge-intro {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 5;
  width: max-content;
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 11px 14px 10px;
  font-size: 0.88rem;
  line-height: 1.52;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  box-sizing: border-box;
}

.cyclone-judge-intro[hidden] {
  display: none !important;
}

.cyclone-schematic-panel--judge .cyclone-judge-steps {
  font-size: 0.88rem;
  line-height: 1.48;
  padding: 10px 11px 9px;
}

.cyclone-schematic-panel--judge .cyclone-judge-step-text {
  font-size: 0.88rem;
}

.cyclone-schematic-panel--judge .cyclone-judge-step-num {
  width: 21px;
  height: 21px;
  font-size: 0.74rem;
  line-height: 21px;
}

.cyclone-judge-intro {
  margin: 0;
  padding: 12px 12px 11px;
  border: 1px solid rgba(48, 118, 210, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #444;
}

.cyclone-judge-steps {
  list-style: none;
  margin: 0;
  padding: 12px 12px 10px;
  border: 1px solid rgba(48, 118, 210, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #444;
}

.cyclone-judge-step {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 7px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.cyclone-judge-step:last-child {
  margin-bottom: 0;
}

.cyclone-judge-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #666;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

.cyclone-judge-step-text {
  flex: 1;
  font-size: 0.82rem;
}

.cyclone-judge-step-head {
  font-weight: 700;
  color: #1a4a8a;
}

.cyclone-judge-step-note {
  font-weight: 400;
  color: #555;
}

.cyclone-judge-step.is-current .cyclone-judge-step-head {
  color: #0d3d7a;
}

.cyclone-judge-step.is-current .cyclone-judge-step-note {
  color: #444;
  font-weight: 500;
}

.cyclone-judge-step.is-done .cyclone-judge-step-head {
  color: #1a4a8a;
}

.cyclone-judge-step.is-current {
  background: rgba(48, 118, 210, 0.1);
}

.cyclone-judge-step.is-current .cyclone-judge-step-text {
  font-weight: 400;
}

.cyclone-judge-step.is-current .cyclone-judge-step-num {
  background: #3076d2;
  color: #fff;
}

.cyclone-judge-step.is-done {
  color: #333;
}

.cyclone-judge-step[hidden] {
  display: none !important;
}

.cyclone-judge-step.is-done .cyclone-judge-step-num {
  background: #d4e8ff;
  color: #3076d2;
}

.cyclone-judge-btn {
  flex-shrink: 0;
  margin-top: 10px;
  padding: 7px 28px;
  border: 1px solid rgba(48, 118, 210, 0.55);
  border-radius: 4px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fc 100%);
  color: #1a4a8a;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(48, 118, 210, 0.12);
}

.cyclone-judge-btn:hover {
  background: linear-gradient(180deg, #fff 0%, #e6f0ff 100%);
  border-color: rgba(48, 118, 210, 0.75);
}

.cyclone-judge-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.cyclone-judge-weather-summary {
  display: none;
  width: 100%;
  margin: 0;
  padding: 9px 10px 8px;
  border: 1px solid rgba(48, 118, 210, 0.18);
  border-radius: 4px;
  background: #f8fbff;
  box-sizing: border-box;
}

.cyclone-judge-weather-summary:not([hidden]) {
  display: block;
}

.cyclone-judge-weather-title {
  margin: 0 0 7px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #555;
}

.cyclone-judge-weather-line {
  margin: 0 0 7px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #333;
  text-align: left;
}

.cyclone-judge-weather-line:last-child {
  margin-bottom: 0;
}

.cyclone-judge-weather-label {
  font-size: 0.94rem;
  font-weight: 700;
  color: #d62828;
  letter-spacing: 0.06em;
}

.cyclone-judge-weather-summary[hidden] {
  display: none !important;
}

.cyclone-schematic-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 980px;
}

.cyclone-schematic-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.cyclone-schematic-title {
  flex-shrink: 0;
  width: 100%;
  font-size: 0.72rem;
  font-weight: 600;
  color: #333;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.cyclone-schematic-panel canvas {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  max-width: 840px;
  height: auto;
  border-radius: 2px;
  background: #fff;
}

.cyclone-schematic-stage canvas {
  max-width: none;
}

.cyclone-schematic-legend {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: #fafafa;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #333;
  box-sizing: border-box;
}

.cyclone-schematic-legend[hidden] {
  display: none !important;
}

.cyclone-legend-title {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #555;
}

.cyclone-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cyclone-legend-item:last-of-type {
  margin-bottom: 0;
}

.cyclone-legend-icon {
  flex-shrink: 0;
  display: block;
}

.cyclone-legend-swatch {
  flex-shrink: 0;
  width: 28px;
  height: 14px;
  border-radius: 2px;
}

.cyclone-legend-swatch--cold-rain {
  background: rgba(48, 118, 210, 0.32);
  border: 1px solid rgba(48, 118, 210, 0.55);
}

.cyclone-legend-swatch--warm-rain {
  background: rgba(210, 45, 45, 0.32);
  border: 1px solid rgba(210, 45, 45, 0.55);
}

.cyclone-legend-unit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.68rem;
  color: #666;
}

.viewport-wrap--cyclone #canvas-container,
.viewport-wrap--cyclone .grid-deco,
.viewport-wrap--cyclone .scanline,
.viewport-wrap--cyclone .hud-tl,
.viewport-wrap--cyclone .legend,
.viewport-wrap--cyclone .schematic-overlay {
  visibility: hidden;
  pointer-events: none;
}

.hint-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(5, 15, 28, 0.75);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px);
  pointer-events: none;
}

.grid-deco {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
}

.weather-trend-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
  width: min(308px, calc(100% - 32px));
  max-width: 308px;
  padding: 8px 10px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.9);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  z-index: 6;
  pointer-events: none;
}

.weather-trend-title {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  line-height: 1.3;
}

.weather-trend-panel.compare-dual {
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.weather-trend-panel.compare-dual > #weatherTrendLegendSingle {
  display: none;
}

.weather-trend-slot {
  width: min(308px, calc(100% - 32px));
  max-width: 308px;
  padding: 8px 10px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.9);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.weather-trend-panel.compare-dual .weather-trend-slot--cold {
  position: absolute;
  top: 16px;
  right: 16px;
}

.weather-trend-panel.compare-dual .weather-trend-slot--warm {
  position: absolute;
  right: 16px;
  bottom: 52px;
}

.weather-trend-subtitle {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 3px;
  line-height: 1.25;
}

.weather-trend-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
  background: rgba(8, 20, 36, 0.85);
}

.weather-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.wt-leg::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-right: 5px;
  vertical-align: middle;
  border-radius: 1px;
}

.wt-temp::before { background: #ff7744; }
.wt-pres::before { background: #4da6ff; }
.wt-hum::before { background: #44ddaa; }
.wt-cursor::before { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .panel-column { width: 100%; }
  .panel { max-height: 42vh; }
}
