/* Electric Charge — technical-end visual style, mirrors orbital_motion.
   Info-dialog palette matches light_shadows and gear_builder. */

:root {
  --teal-900:      #004445;
  --teal-700:      #006668;
  --dialog-bg:     #ffffff;
  --dialog-text:   #2C3E3E;
  --dialog-border: #E5EAE9;
  --dialog-tabs-bg: #F8FBFB;
  --tab-text:      #5A6E6E;
  --focus-glow:    #FFD166;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #050a14;
  font-family: Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#sim-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#stage-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#sim-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
  /* Block browser pan/zoom so pointer events drive the canvas directly on touch screens. */
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Visually-hidden focus targets — keyboard users tab through these to interact
   with the canvas. Mouse/touch events pass through to the canvas; the visual
   focus ring is drawn on the canvas itself when the corresponding target is focused. */
.sim-focus-target {
  position: absolute;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: transparent;
  font-size: 1px;
  pointer-events: none;
  overflow: hidden;
  clip-path: inset(50%);
}

.sim-focus-target:focus,
.sim-focus-target:focus-visible {
  outline: none;
}

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Info dialog (palette matches light_shadows / gear_builder) ── */
#info-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  overflow: hidden;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  background: var(--dialog-bg);
}

#info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--teal-900);
  color: #ffffff;
}

.dialog-header h2 {
  font-size: 16px;
  font-weight: 600;
}

#dialog-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#dialog-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

#dialog-close-btn:focus-visible {
  outline: 3px solid var(--focus-glow);
  outline-offset: 2px;
}

.dialog-tabs {
  display: flex;
  border-bottom: 2px solid var(--dialog-border);
  background: var(--dialog-tabs-bg);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 0;
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--tab-text);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--teal-900);
}

.tab-btn.active,
.tab-btn[aria-selected="true"] {
  color: var(--teal-900);
  border-bottom-color: var(--teal-900);
}

.tab-btn:focus-visible {
  outline: 3px solid var(--focus-glow);
  outline-offset: -3px;
}

.dialog-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
  color: var(--dialog-text);
  font-size: 14px;
  line-height: 1.55;
}

.dialog-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-900);
  margin-top: 14px;
  margin-bottom: 6px;
}

.dialog-body h3:first-child {
  margin-top: 0;
}

.dialog-body p {
  margin-bottom: 8px;
}

.dialog-body ul,
.dialog-body ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.dialog-body li {
  margin-bottom: 4px;
}

.dialog-body .standard-tag { display:inline-block; background:#E8F5F5; color:var(--teal-900); font-weight:700; font-size:12px; padding:2px 8px; border-radius:4px; margin-right:6px; }
.dialog-body details { margin:8px 0 10px; border:1px solid #E5EAE9; border-radius:6px; padding:6px 12px; }
.dialog-body summary { cursor:pointer; font-weight:600; color:var(--teal-900); }
.dialog-body details[open] summary { margin-bottom:6px; }

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--dialog-border);
  background: var(--dialog-tabs-bg);
}

.dialog-close-footer {
  background: var(--teal-900);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-family: Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.dialog-close-footer:hover {
  background: var(--teal-700);
}

.dialog-close-footer:focus-visible {
  outline: 3px solid var(--focus-glow);
  outline-offset: 2px;
}
