/* LCC Web SDK harness — shell, settings panel, diagnostics.
   All classes are prefixed `lcc-` so nothing collides with Cesium's own
   widget CSS, which is loaded on the Cesium page. */

:root {
  --lcc-bg: #0b0d12;
  --lcc-surface: #14171f;
  --lcc-surface-2: #1b1f2a;
  --lcc-border: #2a2f3d;
  --lcc-text: #e6e9ef;
  --lcc-text-dim: #9aa3b5;
  --lcc-accent: #4da3ff;
  --lcc-good: #4ade80;
  --lcc-bad: #f87171;
  --lcc-warn: #fbbf24;
  --lcc-nav-h: 48px;
  --lcc-panel-w: 372px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--lcc-bg);
  color: var(--lcc-text);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------------------------------------------------------------- nav */

.lcc-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--lcc-nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 14px;
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--lcc-border);
  z-index: 20;
}

.lcc-nav-brand { display: flex; flex-direction: column; line-height: 1.2; }
.lcc-nav-brand strong { font-size: 13px; letter-spacing: 0.01em; }
.lcc-nav-brand span { font-size: 10.5px; color: var(--lcc-text-dim); }

.lcc-nav-toggle {
  display: flex;
  background: var(--lcc-surface);
  border: 1px solid var(--lcc-border);
  border-radius: 8px;
  padding: 2px;
}

.lcc-nav-tab {
  padding: 5px 16px;
  border-radius: 6px;
  color: var(--lcc-text-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 12.5px;
  transition: background 0.12s, color 0.12s;
}
.lcc-nav-tab:hover { color: var(--lcc-text); }
.lcc-nav-tab-active { background: var(--lcc-accent); color: #05070c; }

.lcc-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lcc-nav-warn {
  font-size: 10.5px;
  color: var(--lcc-warn);
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
  cursor: help;
}

/* -------------------------------------------------------------- stage */

.lcc-stage {
  position: fixed;
  top: var(--lcc-nav-h);
  left: 0;
  right: var(--lcc-panel-w);
  bottom: 0;
  transition: right 0.18s ease;
}
body.lcc-panel-hidden .lcc-stage { right: 0; }

.lcc-stage > canvas,
.lcc-stage > .lcc-viewer {
  display: block;
  width: 100%;
  height: 100%;
}

/* Cesium injects its own credit container; keep it out of the way. */
.lcc-credit { position: absolute; bottom: 2px; left: 6px; font-size: 10px; color: var(--lcc-text-dim); z-index: 5; }
.lcc-credit-sink { display: none; }

.lcc-overlay-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--lcc-text-dim);
  font-size: 13px;
  pointer-events: none;
}
.lcc-overlay-msg strong { display: block; color: var(--lcc-text); margin-bottom: 4px; }

.lcc-progress {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: transparent;
  z-index: 6;
}
.lcc-progress-bar {
  height: 100%;
  width: 0;
  background: var(--lcc-accent);
  transition: width 0.2s;
}

/* -------------------------------------------------------------- panel */

.lcc-panel {
  position: fixed;
  top: var(--lcc-nav-h);
  right: 0;
  bottom: 0;
  width: var(--lcc-panel-w);
  display: flex;
  flex-direction: column;
  background: var(--lcc-surface);
  border-left: 1px solid var(--lcc-border);
  z-index: 15;
  transition: transform 0.18s ease;
}
body.lcc-panel-hidden .lcc-panel { transform: translateX(100%); }

.lcc-panel-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--lcc-border);
  flex: 0 0 auto;
}
.lcc-panel-title { display: flex; align-items: baseline; gap: 8px; }
.lcc-panel-engine { font-size: 11px; color: var(--lcc-accent); }
.lcc-panel-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--lcc-text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.lcc-panel-close:hover { color: var(--lcc-text); }

.lcc-panel-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }

/* ------------------------------------------------------------ section */

.lcc-section { border-bottom: 1px solid var(--lcc-border); }

.lcc-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: none;
  border: none;
  color: var(--lcc-text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.lcc-section-head:hover { background: var(--lcc-surface-2); }
.lcc-section-title { font-weight: 600; font-size: 12.5px; }
.lcc-chev { margin-left: auto; color: var(--lcc-text-dim); font-size: 10px; }

.lcc-section-content { padding: 2px 12px 12px; }
.lcc-section-disabled .lcc-section-title { color: var(--lcc-text-dim); }

/* -------------------------------------------------------------- badge */

.lcc-badge {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.lcc-badge-sm { font-size: 9px; padding: 1px 5px; }
.lcc-badge-live { color: var(--lcc-good); border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.08); }
.lcc-badge-reload { color: var(--lcc-warn); border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.lcc-badge-engine { color: var(--lcc-accent); border-color: rgba(77, 163, 255, 0.3); background: rgba(77, 163, 255, 0.08); }

/* ---------------------------------------------------------------- row */

.lcc-row { padding: 7px 0; border-top: 1px solid rgba(42, 47, 61, 0.5); }
.lcc-row:first-child { border-top: none; }
.lcc-row-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.lcc-label { font-size: 12px; color: var(--lcc-text); }
.lcc-value { margin-left: auto; font-size: 11.5px; color: var(--lcc-text-dim); font-variant-numeric: tabular-nums; }
.lcc-value-warn { color: var(--lcc-warn); font-weight: 600; }

.lcc-row-disabled { opacity: 0.45; }
.lcc-row-disabled .lcc-label { color: var(--lcc-text-dim); }
.lcc-row-dead .lcc-label { text-decoration: line-through; color: var(--lcc-text-dim); }

.lcc-note {
  margin: 4px 0 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--lcc-text-dim);
}
.lcc-note-warn { color: var(--lcc-warn); }

/* ------------------------------------------------------------- inputs */

.lcc-range-wrap { display: flex; align-items: center; }
.lcc-range { width: 100%; accent-color: var(--lcc-accent); }
input[type="range"] { height: 18px; }

.lcc-select, .lcc-number, .lcc-text {
  width: 100%;
  background: var(--lcc-bg);
  color: var(--lcc-text);
  border: 1px solid var(--lcc-border);
  border-radius: 5px;
  padding: 5px 7px;
  font: inherit;
  font-size: 12px;
}
.lcc-select:focus, .lcc-number:focus, .lcc-text:focus {
  outline: none;
  border-color: var(--lcc-accent);
}
.lcc-color { width: 44px; height: 26px; padding: 0; border: 1px solid var(--lcc-border); border-radius: 5px; background: none; }

.lcc-vec3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.lcc-vec3-part { width: 100%; }

/* switch */
.lcc-switch { position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; }
.lcc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.lcc-switch-track {
  position: absolute;
  inset: 0;
  background: var(--lcc-border);
  border-radius: 999px;
  transition: background 0.14s;
}
.lcc-switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--lcc-text-dim);
  transition: transform 0.14s, background 0.14s;
}
.lcc-switch input:checked + .lcc-switch-track { background: rgba(77, 163, 255, 0.35); }
.lcc-switch input:checked + .lcc-switch-track::after { transform: translateX(16px); background: var(--lcc-accent); }
.lcc-switch input:disabled + .lcc-switch-track { opacity: 0.4; cursor: not-allowed; }

/* ----------------------------------------------------------- jog slider */

.lcc-jog { display: block; }
.lcc-jog-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.lcc-jog-label { font-size: 12px; }
.lcc-jog-valgroup { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.lcc-jog-num {
  width: 88px;
  background: var(--lcc-bg);
  color: var(--lcc-text);
  border: 1px solid var(--lcc-border);
  border-radius: 4px;
  padding: 3px 5px;
  font: inherit;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.lcc-jog-unit { font-size: 10.5px; color: var(--lcc-text-dim); width: 14px; }
.lcc-jog-reset {
  background: none;
  border: none;
  color: var(--lcc-text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.lcc-jog-reset:hover { color: var(--lcc-accent); }

/* The centre detent makes the spring-return behaviour legible at a glance. */
.lcc-jog-wrap {
  position: relative;
  padding: 2px 0;
}
.lcc-jog-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--lcc-border);
}
.lcc-jog-range { width: 100%; accent-color: var(--lcc-accent); position: relative; }

/* ----------------------------------------------------------- nudge pad */

.lcc-nudge { display: flex; flex-direction: column; gap: 4px; }
.lcc-nudge-row { display: flex; align-items: center; gap: 4px; }
.lcc-nudge-tag { font-size: 10.5px; color: var(--lcc-text-dim); width: 40px; }
.lcc-nudge-btn {
  flex: 1;
  background: var(--lcc-surface-2);
  color: var(--lcc-text);
  border: 1px solid var(--lcc-border);
  border-radius: 4px;
  padding: 3px 0;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.lcc-nudge-btn:hover { border-color: var(--lcc-accent); color: var(--lcc-accent); }

/* ------------------------------------------------------------ actions */

.lcc-actions { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.lcc-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.lcc-btn {
  background: var(--lcc-surface-2);
  color: var(--lcc-text);
  border: 1px solid var(--lcc-border);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.lcc-btn:hover { border-color: var(--lcc-accent); color: var(--lcc-accent); }
.lcc-btn-sm { padding: 4px 10px; font-size: 11.5px; }
.lcc-btn-xs { padding: 2px 6px; font-size: 10px; }

.lcc-btn-primary {
  background: var(--lcc-accent);
  color: #05070c;
  border-color: var(--lcc-accent);
  font-weight: 600;
}
.lcc-btn-primary:hover { color: #05070c; filter: brightness(1.08); }

.lcc-btn-attention { animation: lcc-pulse 1.6s ease-in-out infinite; }
@keyframes lcc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(77, 163, 255, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(77, 163, 255, 0); }
}

.lcc-pending { color: var(--lcc-warn); }

.lcc-action {
  width: 100%;
  background: var(--lcc-surface-2);
  color: var(--lcc-text);
  border: 1px solid var(--lcc-border);
  border-radius: 5px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lcc-action:hover:not(:disabled) { border-color: var(--lcc-accent); color: var(--lcc-accent); }
.lcc-action:disabled { opacity: 0.4; cursor: not-allowed; }

/* ------------------------------------------------------------- source */

.lcc-source { display: flex; flex-direction: column; gap: 6px; }
.lcc-source-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10.5px;
  color: var(--lcc-text-dim);
}
.lcc-source-info b { color: var(--lcc-text); font-weight: 600; }

/* -------------------------------------------------------- diagnostics */

.lcc-diag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 330px;
  background: rgba(20, 23, 31, 0.93);
  border: 1px solid var(--lcc-border);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  z-index: 10;
  font-size: 11.5px;
}

.lcc-diag-head {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--lcc-border);
}
.lcc-diag-head strong { font-size: 11.5px; }
.lcc-diag-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--lcc-text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 3px;
}

.lcc-diag-body { padding: 8px 10px; }

.lcc-diag-grid {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 2px 8px;
  margin: 0;
}
.lcc-diag-grid dt { color: var(--lcc-text-dim); font-size: 10.5px; }
.lcc-diag-grid dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.lcc-good { color: var(--lcc-good); }
.lcc-bad { color: var(--lcc-bad); }
.lcc-dim { color: var(--lcc-text-dim); }

.lcc-diag-log-wrap { margin-top: 8px; border-top: 1px solid var(--lcc-border); padding-top: 6px; }
.lcc-diag-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--lcc-text-dim);
  font-size: 10px;
  margin-bottom: 3px;
}
.lcc-diag-log {
  margin: 0;
  max-height: 108px;
  overflow-y: auto;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--lcc-text-dim);
  white-space: pre-wrap;
}

/* ------------------------------------------------------------ landing */

.lcc-landing {
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lcc-landing-inner { max-width: 760px; width: 100%; }
.lcc-landing h1 { font-size: 24px; margin: 0 0 6px; }
.lcc-landing .lcc-sub { color: var(--lcc-text-dim); margin: 0 0 26px; }

.lcc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }
@media (max-width: 660px) { .lcc-cards { grid-template-columns: 1fr; } }

.lcc-card {
  display: block;
  padding: 18px;
  background: var(--lcc-surface);
  border: 1px solid var(--lcc-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--lcc-text);
  transition: border-color 0.14s, transform 0.14s;
}
.lcc-card:hover { border-color: var(--lcc-accent); transform: translateY(-2px); }
.lcc-card h2 { margin: 0 0 6px; font-size: 16px; }
.lcc-card p { margin: 0; color: var(--lcc-text-dim); font-size: 12px; line-height: 1.5; }

.lcc-facts {
  background: var(--lcc-surface);
  border: 1px solid var(--lcc-border);
  border-radius: 10px;
  padding: 16px 18px;
}
.lcc-facts h3 { margin: 0 0 10px; font-size: 13px; }
.lcc-facts dl { display: grid; grid-template-columns: 190px 1fr; gap: 5px 12px; margin: 0; font-size: 12px; }
.lcc-facts dt { color: var(--lcc-text-dim); }
.lcc-facts dd { margin: 0; }
.lcc-facts code { font: 11px ui-monospace, Consolas, monospace; color: var(--lcc-accent); }
