/* ========================================================================== 
   ExoIntel-Prime WebGL v8 Build Styles
   Author: Biswajit Jana
   ========================================================================== */

:root {
  color-scheme: dark light;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; font-family: var(--font); }
body { background: #060b13; color: #edf4ff; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
#app { min-height: 100vh; }

/* --------------------------------------------------------------------------
   Boot screen
   -------------------------------------------------------------------------- */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 181, 71, 0.13), transparent 26%),
    radial-gradient(circle at 25% 15%, rgba(99, 167, 255, 0.15), transparent 32%),
    radial-gradient(circle at 75% 22%, rgba(80, 198, 223, 0.09), transparent 28%),
    linear-gradient(180deg, #060b13 0%, #0b1220 100%);
}
.boot-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(99, 167, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 167, 255, 0.14) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 68%);
}
.boot-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0%, transparent 52%, rgba(0, 0, 0, 0.30) 100%);
}
.boot-screen.is-fading { opacity: 0; transition: opacity 0.65s ease; pointer-events: none; }
.boot-card {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 32px;
  border: 1px solid rgba(64, 81, 107, 0.92);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(16, 24, 39, 0.94), rgba(13, 21, 36, 0.86));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(22px);
}
.boot-logo {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 1px solid rgba(99, 167, 255, 0.36);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.20), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(99, 167, 255, 0.30), transparent 44%),
    radial-gradient(circle at 50% 50%, rgba(255, 181, 71, 0.24), transparent 72%),
    linear-gradient(135deg, #142033, #0d1524);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 0 46px rgba(99,167,255,.18), 0 18px 44px rgba(0,0,0,.34);
}
.boot-logo svg { width: 78px; height: 78px; display: block; }
.boot-eyebrow { margin: 0 0 6px; color: #ffb547; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.boot-card h1 { margin: 0; color: #edf4ff; font-size: clamp(28px, 3.2vw, 40px); font-weight: 950; letter-spacing: -.025em; }
.boot-description { max-width: 590px; margin: 10px 0 0; color: #9ba9bd; font-size: 14px; line-height: 1.55; }
.boot-status-wrap { margin-top: 16px; }
.boot-status { min-height: 22px; margin: 0 0 10px; color: #edf4ff; font-size: 14px; font-weight: 650; line-height: 1.45; }
.boot-percent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.boot-percent-label { color: #9ba9bd; font-family: var(--mono); font-size: 11px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.boot-percent-value { color: #50c6df; font-family: var(--mono); font-size: 13px; font-weight: 850; }
.boot-metrics { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.boot-metrics span { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid rgba(64,81,107,.86); border-radius: 999px; background: rgba(16,24,39,.62); color: #9ba9bd; font-family: var(--mono); font-size: 10px; font-weight: 750; }
.boot-progress { position: relative; width: 100%; height: 10px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(64,81,107,.42); border: 1px solid rgba(99,167,255,.14); }
.boot-progress span { position: absolute; top: 0; left: 0; bottom: 0; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #4cc9f0 0%, #63a7ff 35%, #8ec5ff 55%, #ffb547 100%); box-shadow: 0 0 16px rgba(99,167,255,.35), 0 0 24px rgba(255,181,71,.18); transition: width .18s linear; }
.boot-card small { display: block; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(64,81,107,.75); color: #75859a; font-family: var(--mono); font-size: 11px; }

/* --------------------------------------------------------------------------
   App themes
   -------------------------------------------------------------------------- */
.exointel-app {
  --bg: #f5f7fb;
  --bg-soft: #eef3f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f6ff;
  --surface-glass: rgba(255,255,255,.92);
  --line: #d9e0ea;
  --line-strong: #b8c3d2;
  --text: #17202a;
  --muted: #637083;
  --muted-2: #8994a5;
  --accent: #1b64d8;
  --accent-2: #123f87;
  --model: #c47a00;
  --data: #176b87;
  --danger: #b42318;
  --ok: #0f7b4f;
  --warn: #9a6700;
  --shadow: 0 16px 42px rgba(22,34,51,.10);
  --plot-bg: #ffffff;
  --grid: #d9e0ea;
  --scene-bg-a: #f9fbfe;
  --scene-bg-b: #edf2f8;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr) 34px;
  color: var(--text);
  background: radial-gradient(circle at 18% 0%, rgba(27,100,216,.075), transparent 34%), radial-gradient(circle at 82% 5%, rgba(196,122,0,.055), transparent 30%), linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
}
.exointel-app.theme-dark {
  --bg: #060b13;
  --bg-soft: #0b1220;
  --surface: #101827;
  --surface-2: #0d1524;
  --surface-3: #142033;
  --surface-glass: rgba(13,21,36,.92);
  --line: #243247;
  --line-strong: #40516b;
  --text: #edf4ff;
  --muted: #9ba9bd;
  --muted-2: #75859a;
  --accent: #63a7ff;
  --accent-2: #8fc0ff;
  --model: #ffb547;
  --data: #50c6df;
  --danger: #ff8a80;
  --ok: #6ee7b7;
  --warn: #facc15;
  --shadow: 0 18px 48px rgba(0,0,0,.38);
  --plot-bg: #0b1220;
  --grid: #243247;
  --scene-bg-a: #08111f;
  --scene-bg-b: #030712;
  background: radial-gradient(circle at 20% -8%, rgba(99,167,255,.14), transparent 35%), radial-gradient(circle at 82% 0%, rgba(255,181,71,.08), transparent 30%), radial-gradient(circle at 50% 38%, rgba(80,198,223,.055), transparent 35%), linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.app-header { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(440px, 1.05fr) minmax(420px, .95fr); align-items: center; gap: 14px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--surface-glass); backdrop-filter: blur(18px); z-index: 10; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-logo { width: 50px; height: 50px; flex: 0 0 auto; filter: drop-shadow(0 12px 22px rgba(0,0,0,.22)); }
.brand h1 { margin: 0; font-size: 16px; font-weight: 950; letter-spacing: .01em; }
.brand p { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.status-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.status-tile { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.status-tile span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .075em; }
.status-tile strong { display: block; margin-top: 2px; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--text); font-weight: 820; font-size: 12px; white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { background: var(--surface-3); border-color: var(--accent); }
.button.primary { color: #160d00; border-color: var(--model); background: linear-gradient(180deg, #ffd38b, var(--model)); box-shadow: 0 8px 18px rgba(0,0,0,.14); }
.theme-switch { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); user-select: none; cursor: pointer; white-space: nowrap; }
.theme-switch input { position: absolute; opacity: 0; pointer-events: none; }
.theme-switch-track { position: relative; width: 42px; height: 22px; border-radius: 999px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, #dbe6f6, #f8fafc); }
.theme-dark .theme-switch-track { background: linear-gradient(180deg, #17243a, #060b13); border-color: #40516b; }
.theme-switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .18s ease, background .18s ease; }
.theme-switch input:checked + .theme-switch-track .theme-switch-thumb { transform: translateX(20px); background: #ffb547; }
.theme-switch-label { min-width: 72px; color: var(--muted); font-size: 12px; font-weight: 850; }
.workspace { min-height: 0; display: grid; grid-template-columns: 350px minmax(0, 1fr) 390px; gap: 14px; padding: 14px; overflow: hidden; }
.left-panel, .right-panel { min-height: 0; display: grid; gap: 12px; overflow: hidden; }
.left-panel { grid-template-rows: 250px minmax(0,1fr); }
.right-panel { grid-template-rows: minmax(0,1fr); }
.main-panel { min-height: 0; display: grid; grid-template-rows: minmax(335px,1fr) 330px; gap: 12px; overflow: hidden; }
.card { min-height: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-glass); box-shadow: var(--shadow); overflow: hidden; }
.card-header { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.card-header h2 { margin: 0; font-size: 13px; font-weight: 950; letter-spacing: .01em; }
.card-header span { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.header-inline { display: flex; align-items: center; gap: 8px; }
.card-body { min-height: 0; padding: 14px; }
.target-card, .science-card, .scene-panel, .control-card { display: grid; grid-template-rows: 44px minmax(0,1fr); }
.target-body { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
.target-search { width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); outline: none; }
.target-search::placeholder { color: var(--muted-2); }
.target-list { min-height: 0; overflow: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.target-row { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; }
.target-row:hover, .target-row.active { border-color: var(--accent); background: var(--surface-3); }
.target-row.active { box-shadow: inset 3px 0 0 var(--accent); }
.target-row strong, .target-row span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.target-row strong { font-size: 12px; }
.target-row span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 900; letter-spacing: .025em; text-transform: uppercase; }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.danger { color: var(--danger); border-color: var(--danger); }
.science-scroll { min-height: 0; overflow: auto; padding: 14px; }
.section-title { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 950; letter-spacing: .10em; text-transform: uppercase; }
.readout-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.readout { min-height: 82px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.readout.wide { grid-column: 1 / -1; }
.readout span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
.readout strong { display: block; margin-top: 8px; font-family: var(--mono); font-size: 17px; font-weight: 950; }
.readout small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.property-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.property { min-height: 54px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.property span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.property strong { display: block; margin-top: 5px; color: var(--text); font-family: var(--mono); font-size: 13px; }
.help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 900; cursor: help; text-transform: none; letter-spacing: 0; flex: 0 0 auto; }
.help-content { position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 100; width: 280px; transform: translateX(-50%) translateY(4px); opacity: 0; pointer-events: none; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-size: 12px; font-weight: 600; line-height: 1.42; text-transform: none; letter-spacing: 0; transition: opacity .12s ease, transform .12s ease; }
.help:hover .help-content, .help:focus .help-content { opacity: 1; transform: translateX(-50%) translateY(0); }
.scene-stage { min-height: 0; position: relative; background: radial-gradient(circle at 50% 42%, rgba(255,181,71,.16), transparent 31%), radial-gradient(circle at 18% 12%, rgba(99,167,255,.12), transparent 25%), radial-gradient(circle at 88% 8%, rgba(80,198,223,.06), transparent 30%), linear-gradient(180deg, var(--scene-bg-a), var(--scene-bg-b)); }
.scene-stage canvas { width: 100%; height: 100%; display: block; }
.scene-overlay { position: absolute; left: 16px; bottom: 16px; max-width: 820px; padding: 10px 12px; border: 1px solid rgba(120,145,180,.38); border-radius: 14px; background: rgba(5,10,18,.50); color: #dbeafe; font-size: 12px; backdrop-filter: blur(12px); box-shadow: 0 14px 34px rgba(0,0,0,.24); }
.plot-card { position: relative; display: grid; grid-template-rows: 44px minmax(0,1fr) 34px; }
.plot-wrap { position: relative; min-height: 0; padding: 0; background: var(--plot-bg); }
.plot-canvas { width: 100%; height: 100%; display: block; }
.assumption-strip { min-height: 34px; display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 5px 12px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.assumption-strip .pill { flex: 0 0 auto; }
.control-list { min-height: 0; overflow: auto; display: grid; gap: 12px; padding: 14px; }
.control-group { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.control-group h3 { margin: 0 0 10px; color: var(--text); font-size: 12px; font-weight: 950; }
.control-row, .toggle-row, .select-row { display: grid; grid-template-columns: 132px minmax(0,1fr) 78px; gap: 10px; align-items: center; min-height: 34px; }
.select-row { grid-template-columns: 132px minmax(0,1fr) 22px; }
.control-row + .control-row, .toggle-row + .toggle-row, .select-row + .select-row { margin-top: 8px; }
.control-row label, .toggle-row label, .select-row label { color: var(--muted); font-size: 12px; }
.control-row output, .toggle-row output { color: var(--text); font-family: var(--mono); font-size: 12px; text-align: right; }
.disabled-note { margin-top: 8px; color: var(--warn); font-size: 11px; line-height: 1.35; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
select { width: 100%; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; background: var(--surface-2); color: var(--text); outline: none; }
.app-footer { display: grid; grid-template-columns: minmax(220px,1fr) auto minmax(220px,1fr); align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--line); background: var(--surface-glass); color: var(--muted); font-size: 11px; }
.app-footer strong { color: var(--text); font-weight: 950; }
.footer-credit { white-space: nowrap; text-align: center; }
.footer-utc { white-space: nowrap; font-family: var(--mono); color: var(--muted); text-align: left; }
.footer-status { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--line-strong); background-clip: padding-box; }
:focus-visible { outline: 3px solid rgba(99,167,255,.40); outline-offset: 2px; }
@media (max-width: 1420px) { .workspace { grid-template-columns: 330px minmax(0,1fr) 350px; } .control-row,.toggle-row,.select-row{grid-template-columns:120px minmax(0,1fr) 62px;} .select-row{grid-template-columns:120px minmax(0,1fr) 22px;} }
@media (max-width: 1180px) { body { overflow: auto; } .exointel-app { height: auto; min-height: 100vh; grid-template-rows: auto auto auto; overflow: visible; } .app-header,.workspace { grid-template-columns: 1fr; } .workspace, .left-panel, .right-panel, .main-panel { overflow: visible; } .left-panel { grid-template-rows: auto auto; } .main-panel { grid-template-rows: 440px 320px; } .status-strip { grid-template-columns: repeat(2,minmax(0,1fr)); } .header-actions { justify-content: flex-start; flex-wrap: wrap; } .app-footer { grid-template-columns: 1fr; align-items: flex-start; min-height: 70px; padding: 8px 16px; } .footer-credit { text-align: left; } .footer-status { text-align: left; white-space: normal; } }
@media (max-width: 680px) { .boot-card { grid-template-columns: 1fr; } .boot-logo { width: 76px; height: 76px; } .boot-logo svg { width: 66px; height: 66px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; } }

/* Physics v11: moon/starspot visibility readout */
.hypothesis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.hypothesis-card {
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.hypothesis-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hypothesis-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}
.hypothesis-card.ok { border-color: var(--ok); }
.hypothesis-card.ok strong { color: var(--ok); }
.hypothesis-card.warn { border-color: var(--warn); }
.hypothesis-card.warn strong { color: var(--warn); }
.hypothesis-card.muted strong { color: var(--muted); }
.hypothesis-note {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  font-size: 11px;
  line-height: 1.38;
}
@media (max-width: 680px) {
  .hypothesis-grid { grid-template-columns: 1fr; }
}
