/* Turion Satellite shell — design tokens + components.
 * Loaded by every /satellite/*.html page.
 * Spec: docs/superpowers/specs/2026-05-09-turion-satellite-frontend-design.md §5.
 */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Backgrounds */
  --bg-0: #07090f; --bg-1: #0a0e1a; --bg-2: #141b2d; --bg-3: #1a2030;
  /* Borders */
  --border: #2a3142; --border-2: #3a4358;
  /* Text */
  --text-1: #e6eef7; --text-2: #9ab1c8; --text-3: #5a6b7e;
  /* Accents */
  --blue: #2563EB; --blue-1: #3B82F6; --orange: #F97316;
  --green: #10b981; --amber: #f59e0b; --red: #ef4444; --purple: #a06bc0;
  /* Misc */
  --grid: rgba(60,80,120,0.10);
  --focus-ring: 2px solid var(--blue-1);
  --radius: 6px;
  --transition: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--bg-0); color: var(--text-1);
  font-family: 'Fira Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'Fira Code', ui-monospace, monospace; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus rings */
*:focus-visible { outline: var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

/* Top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-logo { font-weight: 600; font-size: 15px; color: var(--text-1); text-decoration: none; }
.topbar-logo:hover { color: var(--blue-1); }
.topbar-user { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--text-2); }

/* Main container */
.main { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* Headings */
h1 { font-weight: 600; letter-spacing: -0.02em; font-size: 24px; margin: 0 0 4px; }
h2 { font-weight: 600; font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
h3 { font-weight: 500; font-size: 13px; margin: 0 0 4px; color: var(--text-2);
     text-transform: uppercase; letter-spacing: 0.08em; }
.subtitle { color: var(--text-3); font-size: 12px; margin: 0; }
.section-label {
  font-family: 'Fira Code', monospace; font-size: 11px; color: var(--orange);
  letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 8px;
}

/* Panels */
.panel { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2);
  display: flex; justify-content: space-between; align-items: center; font-size: 12px;
}
.panel-body { padding: 18px; }
.panel.glow { box-shadow: 0 0 24px rgba(37,99,235,0.15); }

/* KPI strip */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 768px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 12px 14px; background: var(--bg-2); border-radius: 6px; border: 1px solid var(--border); }
.kpi-label {
  font-family: 'Fira Code', monospace; font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.kpi-value { font-family: 'Fira Code', monospace; font-size: 22px; color: var(--text-1); font-weight: 500; margin-top: 2px; }

/* Buttons */
button, .btn { font-family: 'Fira Sans', sans-serif; cursor: pointer; }
.btn-primary {
  background: var(--blue); color: #fff; border: none; padding: 8px 14px;
  border-radius: 5px; font-size: 13px; font-weight: 500; transition: background var(--transition);
  min-height: 36px;
}
.btn-primary:hover { background: var(--blue-1); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-cta { background: var(--orange); color: #0a0e1a; border: none; padding: 8px 14px;
  border-radius: 5px; font-size: 13px; font-weight: 600; min-height: 36px; }
.btn-cta:hover { background: #fb923c; }
.btn-secondary {
  background: transparent; border: 1px solid var(--border-2); color: var(--text-2);
  padding: 7px 13px; border-radius: 5px; font-size: 13px; min-height: 36px;
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover { border-color: var(--blue-1); color: var(--blue-1); }
.btn-danger { background: var(--red); color: #fff; border: none; padding: 8px 14px;
  border-radius: 5px; font-size: 13px; min-height: 36px; }

/* Tags */
.tag {
  display: inline-block; padding: 2px 7px; background: var(--bg-3); color: var(--text-2);
  border-radius: 3px; font-family: 'Fira Code', monospace; font-size: 10px;
  letter-spacing: 0.05em; margin-right: 4px;
}
.tag-ok     { background: rgba(16,185,129,0.15); color: var(--green);  border: 1px solid rgba(16,185,129,0.3); }
.tag-warn   { background: rgba(245,158,11,0.15); color: var(--amber);  border: 1px solid rgba(245,158,11,0.3); }
.tag-danger { background: rgba(239,68,68,0.15);  color: var(--red);    border: 1px solid rgba(239,68,68,0.3); }
.tag-blue   { background: rgba(37,99,235,0.15);  color: var(--blue-1); border: 1px solid rgba(37,99,235,0.3); }

/* CAD viewer */
.cad { background: #050811; border: 1px solid var(--border); border-radius: 4px; }
.cad svg { display: block; max-width: 100%; height: auto; }
.cad.grid {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Breadcrumb */
.crumb { font-family: 'Fira Code', monospace; font-size: 11px; color: var(--text-3); }
.crumb a { color: var(--text-2); text-decoration: none; }
.crumb a:hover { color: var(--blue-1); }
.crumb-sep { color: var(--text-3); margin: 0 6px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-family: 'Fira Code', monospace; font-size: 12px; }
table.data th {
  text-align: left; padding: 8px 12px; background: var(--bg-2); color: var(--text-3);
  font-weight: 500; border-bottom: 1px solid var(--border); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
table.data tr:hover td { background: rgba(37,99,235,0.05); color: var(--text-1); }

/* Forms */
input[type="email"], input[type="text"], input[type="password"], textarea, select {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px;
  color: var(--text-1); font-family: 'Fira Sans', sans-serif; font-size: 14px;
  padding: 10px 12px; width: 100%; min-height: 44px;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue-1); }

/* Inline grid bg helper */
.grid-bg {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Skeleton loader */
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.skeleton { background: var(--bg-2); border-radius: 4px; animation: skeleton-pulse 1.5s ease-in-out infinite; }

/* Empty state */
.empty { padding: 48px 24px; text-align: center; color: var(--text-3); }
.empty h3 { color: var(--text-2); margin-bottom: 8px; }

/* Responsive grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1024px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Toast */
.toast {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 16px; max-width: 360px; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.toast-error { border-color: var(--red); }
.toast-success { border-color: var(--green); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(7,9,15,0.7); backdrop-filter: blur(4px);
  z-index: 50; display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius);
  width: min(560px, calc(100vw - 32px)); max-height: 80vh; overflow: auto;
}
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ============================================================================
   Phase 27: BOM-child callouts on CAD frame
   ============================================================================ */

.cad-frame { position: relative; }   /* Anchor for toggle button */

/* Toggle button: small chip at top-right of CAD frame */
.cad-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  padding: 4px 10px;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-2, #cde);
  background: rgba(20, 30, 50, 0.75);
  border: 1px solid rgba(110, 140, 180, 0.5);
  border-radius: 4px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  display: none;          /* JS sets to inline-block only when children exist */
}
.cad-toggle:hover, .cad-toggle:focus {
  background: rgba(40, 60, 90, 0.9);
  border-color: rgba(160, 200, 240, 0.7);
  outline: none;
}

/* Callout group inside CAD svg */
.callouts { transition: opacity 200ms ease; }
.cad-frame.callouts-hidden .callouts {
  opacity: 0;
  pointer-events: none;
}

.callout-link { cursor: pointer; }
.callout-link:hover .callout-bg,
.callout-link:focus .callout-bg {
  fill: #2a3550;
  fill-opacity: 0.92;
}
.callout-link:focus { outline: none; }
.callout-link:focus .callout-bg {
  stroke: #9ed0ff;
  stroke-width: 0.3;
}

.callout-bg {
  fill: #1a2030;
  fill-opacity: 0.7;
  stroke: rgba(160, 180, 200, 0.3);
  stroke-width: 0.15;
}
.callout-text {
  fill: #fff;
  font-family: 'Fira Code', monospace;
  font-size: 2.2px;
  pointer-events: none;     /* clicks pass through text to the <a> */
}
.leader-line {
  stroke: #6a8aa8;
  stroke-width: 0.25;
  stroke-dasharray: 1, 0.5;
  pointer-events: none;
}
.leader-dot {
  fill: #cde;
  pointer-events: none;
}
