:root {
  --bg: #08090d;
  --surface: rgba(13, 16, 23, 0.92);
  --surface-strong: rgba(18, 21, 30, 0.97);
  --surface-elevated: rgba(27, 31, 42, 0.84);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f6;
  --text-dim: #cbd5e1;
  --muted: #8891a4;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.12);
  --green: #10b981;
  --danger: #ef4444;
  --radius: 8px;
  --radius-sm: 6px;
  --font-sans: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.hidden {
  display: none !important;
}

.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Google Material Symbols normalization */
.ms-icon {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 350, 'GRAD' 0, 'opsz' 20;
  user-select: none;
  flex-shrink: 0;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-subtle {
  animation: spinSlow 4s linear infinite;
  color: var(--amber);
}

/* Scrollbar minimalism */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* CAD Architectural Panel Base */
.studio-panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48);
}

/* Strict Non-Overlapping Grid Shell */
.hud-shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

/* Row 1: Top Command Bar */
.hud-top {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-logo h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.brand-ver {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--amber);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.brand-logo p {
  font-size: 11px;
  color: var(--muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.mode-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mode-badge.local {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.28);
}

.mode-badge.local::before {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.mode-badge.static {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.mode-badge.static::before {
  background: var(--cyan);
}

/* Telemetry Metrics Strip */
.metrics-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(8, 10, 15, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  max-width: 100%;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
}

.metric-item .ms-icon {
  font-size: 15px;
  color: var(--muted);
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.metric-item strong {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.metric-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
}

/* Top Toolbar Actions */
.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-strong);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #f3f4f6;
  color: #090a0f;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}

.btn-amber {
  background: var(--amber-soft);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

.btn-amber:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.58);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(239, 68, 68, 0.6);
}

.btn-icon-only {
  padding: 6px 7px;
  color: var(--text-dim);
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  white-space: nowrap;
}

.btn-mini .ms-icon {
  font-size: 14px;
}

.btn-mini:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.btn-mini.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.icon-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

/* Row 2: 3-Column Non-Overlapping Viewport Lanes */
.hud-middle {
  display: grid;
  grid-template-columns: minmax(250px, 286px) minmax(0, 1fr) minmax(290px, 336px);
  gap: 12px;
  min-height: 0;
  align-items: stretch;
  pointer-events: none;
}

.hud-col-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  pointer-events: none;
}

.hud-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 0;
  pointer-events: none;
}

.hud-col-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  pointer-events: none;
}

/* Left Building Inspector */
.inspector-card {
  pointer-events: auto;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 13px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tag-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--amber-soft);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.inspector-card h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-word;
  letter-spacing: -0.01em;
}

.insp-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.insp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.stat-box {
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  background: rgba(8, 10, 15, 0.65);
  border: 1px solid var(--border);
}

.stat-box span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.stat-box strong {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.insp-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Right Advisor & Docent Panel */
.advisor-panel {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 13px;
}

.advisor-panel.collapsed {
  height: auto;
  align-self: flex-start;
}

.advisor-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.advisor-title .title-glyph {
  font-size: 18px;
  color: var(--amber);
  padding: 5px;
  border-radius: 5px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.advisor-title strong {
  display: block;
  font-weight: 700;
  font-size: 13px;
}

.advisor-title small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.advisor-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  background: rgba(8, 10, 15, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 6px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}

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

.tab-btn.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border);
}

.tab-content {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.advisor-card {
  background: rgba(11, 13, 19, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.advisor-card h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text);
}

.advisor-card h4 .ms-icon {
  font-size: 15px;
  color: var(--amber);
}

.advisor-card p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.archetype-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fcd34d;
  margin-bottom: 5px;
}

.archetype-title .ms-icon {
  font-size: 17px;
  color: var(--amber);
}

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

.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fact-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fact-row span {
  color: var(--muted);
  flex-shrink: 0;
}

.fact-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.progress-row {
  margin-top: 9px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.progress-label span:last-child {
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.progress-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--amber);
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.action-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.action-item-info strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
}

.action-item-info strong .ms-icon {
  font-size: 14px;
  color: var(--muted);
}

.action-item-info small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.audit-log-item {
  font-size: 11px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
}

.audit-log-item:last-child {
  border-bottom: none;
}

.audit-log-item strong {
  font-family: var(--font-mono);
  color: var(--text);
}

/* Center Slot: Deep Scan & Toast */
.scan-overlay {
  pointer-events: auto;
  width: min(380px, 100%);
  padding: 12px 14px;
}

.scan-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.scan-head-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scan-overlay-head > span {
  color: var(--amber);
  font-weight: 700;
}

.scan-bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 7px;
}

.scan-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--amber);
  transition: width 0.25s ease;
}

.scan-stage {
  font-size: 12px;
  color: var(--text-dim);
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  max-width: 100%;
}

.toast .ms-icon {
  font-size: 16px;
  color: var(--amber);
}

/* Row 3: Bottom Timeline Bar */
.hud-bottom {
  pointer-events: auto;
  padding: 8px 14px;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-play {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s, border-color 0.14s;
}

.btn-play:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--amber);
}

.btn-play .ms-icon {
  font-size: 20px;
}

.time-readout {
  min-width: 124px;
  flex-shrink: 0;
}

.time-readout strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  color: var(--text);
}

.time-phase {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.time-phase .ms-icon {
  font-size: 13px;
  color: var(--amber);
}

.slider-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hourly-bars {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: end;
  gap: 3px;
  height: 22px;
  padding: 0 3px;
}

.hour-bar {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  cursor: pointer;
  transition: background 0.14s;
}

.hour-bar:hover {
  background: rgba(255, 255, 255, 0.38);
}

.hour-bar.active {
  background: var(--amber);
}

#time-slider {
  width: 100%;
  accent-color: var(--amber);
  cursor: pointer;
  height: 4px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4, 5, 8, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  overflow: hidden;
}

.modal-card.modal-lg {
  max-width: 880px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.modal-glyph {
  font-size: 20px;
  color: var(--amber);
  padding: 6px;
  border-radius: 6px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.modal-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.modal-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.foot-btns {
  display: flex;
  gap: 8px;
}

.checkpoint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cp-stage {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.cp-stage-wide {
  grid-column: 1 / -1;
}

.cp-stage h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  margin-bottom: 8px;
  color: var(--text);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--amber);
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--amber-soft);
}

.cp-summary-box {
  background: rgba(8, 10, 15, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 12px;
  margin-bottom: 10px;
  color: var(--text-dim);
}

.field-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.text-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(8, 10, 15, 0.85);
  color: var(--text);
  font-size: 12px;
}

.text-input:focus {
  outline: none;
  border-color: var(--amber);
}

.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(8, 10, 15, 0.55);
  border: 1px solid var(--border);
  cursor: pointer;
}

.radio-card:hover {
  border-color: var(--border-strong);
}

.radio-card input[type="radio"] {
  accent-color: var(--amber);
  margin-top: 2px;
}

.radio-card strong {
  display: block;
  font-size: 12px;
}

.radio-card span {
  font-size: 11px;
  color: var(--muted);
}

.stage-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cp-checklist {
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 7px;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(8, 10, 15, 0.65);
  border: 1px solid var(--border);
}

.cp-item input[type="checkbox"] {
  accent-color: var(--amber);
}

.cp-item input[type="text"] {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11.5px;
}

.cp-kind-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--cyan-soft);
  color: var(--cyan);
  flex-shrink: 0;
}

.section-sub {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 9px;
  color: var(--muted);
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 16px;
}

.persona-card {
  padding: 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: border-color 0.14s, background 0.14s;
}

.persona-card:hover {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.06);
}

.persona-card small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 4px;
}

.persona-card strong {
  display: block;
  font-size: 12.5px;
  margin-bottom: 3px;
}

.persona-card p {
  font-size: 11px;
  color: var(--muted);
}

.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  background: rgba(8, 10, 15, 0.48);
}

.drop-glyph {
  font-size: 28px;
  color: var(--muted);
  margin-bottom: 6px;
}

.drop-zone.dragover {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.07);
}

.drop-mode-select {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 10px 0 12px;
  font-size: 12px;
}

.muted-note {
  font-size: 11.5px;
  color: var(--muted);
}

.install-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.code-box {
  background: #050609;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
  overflow-x: auto;
  margin-top: 6px;
}

.link-inline {
  color: var(--cyan);
  text-decoration: underline;
}

/* Minimap & Zoom Widget inside Center Lane Bottom-Right */
.minimap-box {
  pointer-events: auto;
  margin-top: auto;
  align-self: flex-end;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.minimap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.terrain-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.02em;
}

.zoom-btns {
  display: flex;
  gap: 4px;
}

.btn-mini-sq {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.btn-mini-sq:hover {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.16);
}

#minimap-canvas {
  display: block;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: crosshair;
}

/* Groq AI Docent Model Selector & Narrative */
.ai-model-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.select-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(8, 10, 15, 0.9);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 11.5px;
}

.select-input:focus {
  outline: none;
  border-color: var(--amber);
}

.ai-story-block {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.55;
  padding: 7px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--amber);
  margin-top: 6px;
}

.ai-provider-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-left: auto;
}

/* Exclusion & Override Manager Modal */
.kw-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.kw-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 11px;
  font-family: var(--font-mono);
}

.kw-tag button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.manage-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Anchor compatibility for Studio Buttons & Brand Logo */
a.brand-logo,
a.btn {
  color: inherit;
  text-decoration: none;
}

.cam-rotate-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
}

.compass-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  min-width: 18px;
  text-align: center;
  user-select: none;
}

/* Clean View & All Panel Minimize States */
.clean-exit-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 40;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.hud-shell.clean-hidden {
  display: none;
}

.hud-top.minimized {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  gap: 10px;
}

.hud-top.minimized .metrics-bar,
.hud-top.minimized .hud-actions {
  display: none;
}

.inspector-card.minimized {
  padding: 10px 12px;
}

.inspector-card.minimized #inspector-body {
  display: none;
}

.inspector-card.minimized h2 {
  margin-bottom: 0;
  font-size: 13.5px;
}

.minimap-box.minimized #minimap-canvas {
  display: none;
}

.minimap-box.minimized .minimap-head {
  margin-bottom: 0;
}

.hud-bottom.minimized {
  justify-self: center;
  width: fit-content;
  max-width: calc(100vw - 24px);
  padding: 6px 12px;
}

.hud-bottom.minimized #bottom-slider-wrap {
  display: none;
}

.hud-bottom.minimized .timeline-controls {
  gap: 10px;
}

/* Gemini VisualSpec Inspector Tags */
.insp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.spec-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}

.spec-tag.ai {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.32);
  color: #7dd3fc;
}

.spec-tag.addon {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Data Builder Modal Tabs & Site Picker Chips */
.btab-content {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.btab-content.active {
  display: flex;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px 0;
}

.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.site-chip:hover {
  border-color: rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.site-chip.selected {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--amber);
  color: #fef3c7;
}

.site-chip small {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.site-chip.selected small {
  color: #fcd34d;
}

/* Landing Page (index.html) */
body.landing-body {
  margin: 0;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0b101b;
  color: var(--text);
}

.landing-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.landing-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 25%, rgba(11, 16, 27, 0.42), rgba(11, 16, 27, 0.86) 72%);
  backdrop-filter: blur(2px);
}

.landing-wrap {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: 8px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #fcd34d;
}

.hero-kicker .ms-icon {
  font-size: 16px;
  color: var(--amber);
}

.landing-hero h2 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
}

.hero-sub {
  max-width: 680px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0;
}

.mode-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 10px;
  text-align: left;
}

.mode-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.45);
}

.mode-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-glyph {
  font-size: 26px;
  padding: 10px;
  border-radius: 10px;
}

.mode-glyph.amber {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mode-glyph.cyan {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.mode-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mode-card-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.mode-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.mode-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.mode-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2e8f0;
}

.mode-features .ms-icon {
  font-size: 16px;
  color: var(--amber);
  margin-top: 1px;
  flex-shrink: 0;
}

.mode-card-foot {
  padding-top: 4px;
}

.landing-pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.landing-pill-row > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  font-size: 12px;
  color: #cbd5e1;
}

.landing-pill-row .ms-icon {
  font-size: 15px;
  color: #38bdf8;
}

/* Responsive Layout Protection (Zero overlap guaranteed) */
@media (max-width: 980px) {
  .mode-cards {
    grid-template-columns: 1fr;
  }
  .minimap-box {
    display: none;
  }
  .hud-middle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
  }
  .hud-col-left {
    width: 100%;
    max-height: 36vh;
  }
  .hud-col-right {
    width: 100%;
    max-height: 38vh;
  }
  .advisor-panel {
    height: auto;
    max-height: 38vh;
  }
  .checkpoint-grid,
  .persona-grid {
    grid-template-columns: 1fr;
  }
}
