/* Modern Aerodynamic Engineering Design System */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f293d;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-input: #151d30;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #38bdf8;
  
  --text-main: #f3f4f6;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --accent-gold: #facc15;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;
  --accent-orange: #ff8c00;
  --accent-blue: #3b82f6;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* App Header */
.app-header {
  background: linear-gradient(180deg, #111827 0%, rgba(17, 24, 39, 0.95) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}


.brand-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 340px 330px 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1920px;
  margin: 0 auto;
}

.inputs-column,
.outputs-column {
  align-self: start;
}

.outputs-column {
  position: relative;
  z-index: 30;
}

@media (max-width: 1400px) {
  .main-layout {
    grid-template-columns: 320px 310px 1fr;
  }
}

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
  }
  .visuals-column {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .visuals-column {
    grid-column: span 1;
  }
  .visuals-layout-grid {
    flex-direction: column;
  }
  .visuals-sidebar-col {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  .control-key-panel {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    position: static;
  }
}

/* Card Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-btn {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast, 0.15s ease);
  user-select: none;
}

.badge-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: rgba(56, 189, 248, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
}

.badge-btn:active {
  transform: translateY(0);
  background: rgba(56, 189, 248, 0.45);
}

.badge-btn.badge-applied {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

/* Input Fields */
.input-group-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-label {
  font-size: 0.83rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.unit {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.form-control-wrap {
  width: 120px;
  display: flex;
  align-items: center;
  position: relative;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: all 0.2s;
  text-align: right;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.form-input-text {
  text-align: left;
}

/* Alpha Expression Input Box with Button */
.expr-input-wrap {
  display: flex;
  gap: 4px;
  width: 100%;
}

.expr-input-wrap .form-input {
  flex: 1;
  text-align: left;
  font-family: var(--font-mono);
}

.btn-alpha {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-alpha:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

/* Outputs Table & Metrics */
.output-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.output-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 30px 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.output-row:hover {
  background: rgba(255, 255, 255, 0.04);
  z-index: 50;
}

.output-row .info-icon {
  position: absolute;
  top: 7px;
  right: 7px;
}

.output-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.output-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.output-value .sub-value {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: normal;
}

/* Info Icon & Tooltips */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
  user-select: none;
  cursor: help;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.info-icon:hover {
  background: #38bdf8;
  color: #0b0f19;
  z-index: 100;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.tooltip-box {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: normal;
  width: 330px;
  max-width: 90vw;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 1000;
  display: none;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}

.tooltip-box::-webkit-scrollbar {
  width: 4px;
}

.tooltip-box::-webkit-scrollbar-track {
  background: transparent;
}

.tooltip-box::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

.tooltip-box h4 {
  font-size: 0.8rem;
  color: #38bdf8;
  margin-bottom: 4px;
}

.tooltip-box code {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 8px 5px 28px;
  text-indent: -20px;
  border-radius: 4px;
  margin: 4px 0;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  line-height: 1.45;
  color: #facc15;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.tooltip-vars {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.tooltip-vars li {
  line-height: 1.35;
}

.tooltip-vars strong {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.tt-val {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
}

.info-icon:hover .tooltip-box {
  display: block;
}

/* Visuals Column */
.visuals-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Visuals Section Layout Grid */
.visuals-layout-grid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

/* Side Column: Image Key & Control + Blade Forces Windows (255px) */
.visuals-sidebar-col {
  width: 255px;
  min-width: 240px;
  max-width: 275px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 25;
}

/* Vector Toggles Side Panel */
.control-key-panel {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(8px);
}

/* Blade Forces & Intermediate Values Panel */
.blade-forces-panel {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  position: relative;
  backdrop-filter: blur(8px);
}

.blade-forces-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.blade-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blade-header-title h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
}

.blade-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blade-picker-select {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blade-picker-select:hover,
.blade-picker-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.blade-forces-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.blade-forces-section-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 700;
  padding: 4px 2px 2px 2px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  margin-top: 4px;
}

.blade-force-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 26px 4px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.blade-force-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.25);
  z-index: 50;
}

.blade-force-row .info-icon {
  position: absolute;
  top: 5px;
  right: 5px;
}

.blade-force-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.73rem;
}

.blade-force-label-wrap strong {
  color: #e2e8f0;
}

.blade-force-val-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  font-family: var(--font-mono);
}

.bf-val {
  font-weight: 600;
  color: #38bdf8;
  font-size: 0.74rem;
}

.bf-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.control-key-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.key-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.key-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.control-key-header h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
}


/* Vertical Vector Switches List */
.vector-toggles-vertical {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vector-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
  transition: all 0.2s ease;
  overflow: hidden;
}

.vector-toggle-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.vector-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.vector-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--vec-color, #fff);
  flex-shrink: 0;
}

.vector-arrow-line {
  flex: 1;
  height: 2px;
  min-width: 12px;
  max-width: 28px;
  background: var(--vec-color, #fff);
  position: relative;
  border-radius: 1px;
  flex-shrink: 1;
}

.vector-arrow-line::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -3px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--vec-color, #fff);
}

/* Switch Toggle Styling - strictly bounded */
.switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 16px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
  box-sizing: border-box;
}

.slider:before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 2px;
  bottom: 2px;
  background-color: #94a3b8;
  transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--vec-color, #0284c7);
  border-color: transparent;
}

input:checked + .slider:before {
  transform: translateX(14px);
  background-color: #ffffff;
}

/* Panel Utility Controls */
.panel-utility-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  box-sizing: border-box;
}

.scale-slider-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.scale-slider-wrap input[type="range"] {
  flex: 1;
  max-width: 80px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.panel-btn-row {
  display: flex;
  gap: 6px;
}

.panel-btn-row .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.72rem;
  padding: 4px 6px;
}

/* Right Column: Diagram and Graphs directly underneath */
.diagram-and-graphs-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Diagram Container */
.diagram-card {
  position: relative;
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 580px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.diagram-header-overlay {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.diagram-title-badge {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  backdrop-filter: blur(4px);
}

.diagram-toolbar {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diagram-canvas-wrap {
  flex: 1;
  position: relative;
  cursor: grab;
}

.diagram-canvas-wrap:active {
  cursor: grabbing;
}

.diagram-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Diagram Controls Footer */
.diagram-controls-footer {
  background: rgba(17, 24, 39, 0.9);
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.animation-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.playback-speed-group {
  flex: 0 1 240px;
  min-width: 190px;
}

.slider-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
}

.slider-control-group label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.slider-control-group input[type="range"] {
  flex: 1;
  accent-color: #38bdf8;
  cursor: pointer;
}

.value-display-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: #38bdf8;
  min-width: 48px;
  text-align: center;
}

.control-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  transition: all var(--transition-fast, 0.15s ease);
}

.control-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.control-num-input {
  background: transparent;
  border: none;
  outline: none;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
  width: 42px;
  padding: 0;
  margin: 0;
  -moz-appearance: textfield;
}

.playback-speed-group .control-num-input {
  width: 52px;
}

.control-num-input::-webkit-outer-spin-button,
.control-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.control-unit-symbol {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.chart-canvas-wrap {
  width: 100%;
  height: 230px;
  position: relative;
}

.chart-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Modal for lookup table */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.table-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.table-preview th, .table-preview td {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
}

.table-preview th {
  background: var(--bg-tertiary);
  color: #38bdf8;
}

.table-preview tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
