:root {
  --bg: #0b111b;
  --surface: #121b2b;
  --surface-2: #182338;
  --border: #253450;
  --text: #e8effa;
  --muted: #93a6c5;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
  --ok: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.brand h1 { margin: 0; font-size: 1.15rem; letter-spacing: 0.2px; }
.subtitle { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.badge-shield { color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
.badge-rbac { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.4); }
.badge-quota { color: #fde68a; border-color: rgba(245, 158, 11, 0.35); }

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  padding: 16px 20px;
  min-height: calc(100vh - 72px);
}

.panel { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.card h2 { margin: 0 0 10px; font-size: 0.96rem; color: #dbeafe; }
.muted { color: var(--muted); font-size: 0.85rem; line-height: 1.45; margin: 0 0 12px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 0.84rem; color: var(--muted); }
.field select, .field input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  min-height: 44px;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { min-height: 48px; font-size: 0.94rem; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent); color: #fff; }
.btn-danger { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.65); color: #fecaca; }
.btn-danger-outline { border-color: rgba(239, 68, 68, 0.55); color: #fca5a5; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-tool { min-height: 40px; padding: 8px 12px; font-size: 0.82rem; }

.checklist { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.checklist strong { color: var(--text); }

.viewport-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #bae6fd;
}
.pill-muted { background: rgba(148, 163, 184, 0.12); color: var(--muted); }

.viewport {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: radial-gradient(circle at top, #132037 0%, #090e17 70%);
  padding: 20px;
  min-height: 520px;
}

.viewport-placeholder {
  margin: auto;
  text-align: center;
  max-width: 480px;
}
.shield-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 14px;
}
.viewport-placeholder h3 { margin: 0 0 8px; font-size: 1.25rem; }
.viewport-placeholder p { color: var(--muted); line-height: 1.5; margin: 6px 0; }
.viewport-placeholder .small { font-size: 0.84rem; }

.viewport-live { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.live-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  font-size: 0.86rem;
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.mono { font-family: Consolas, monospace; color: var(--muted); margin-left: auto; font-size: 0.8rem; }

.mock-browser-chrome {
  flex: 1;
  background: #0f1726;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mock-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 0;
  background: #0a101b;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 7px 14px;
  border-radius: 8px 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  background: #131d2f;
}
.tab.active { background: #1c2a44; color: #fff; font-weight: 600; }
.tab-badge { margin-left: auto; font-size: 0.74rem; color: #86efac; padding-bottom: 6px; }

.mock-address-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: #142036;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}
.lock { padding: 3px 7px; border-radius: 6px; background: rgba(34, 197, 94, 0.18); color: #86efac; font-weight: 700; font-size: 0.74rem; }
.route-tag { margin-left: auto; font-size: 0.76rem; color: #7dd3fc; }

.mock-canvas { flex: 1; padding: 22px; display: flex; align-items: center; justify-content: center; }
.mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.mock-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.mock-tile h4 { margin: 0 0 8px; color: #7dd3fc; font-size: 0.92rem; }
.mock-tile p { margin: 0; color: var(--muted); font-size: 0.83rem; line-height: 1.45; }

.toast {
  margin: 0 14px 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 0.85rem;
}
.hidden { display: none !important; }

/* Responsive layout for Mobile & Meta Quest 3 VR Browser */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .mock-grid { grid-template-columns: 1fr; }
}
body.vr-focus .controls { display: none; }
body.vr-focus .layout { grid-template-columns: 1fr; padding: 8px; }
body.vr-focus .btn { min-height: 54px; font-size: 1rem; padding: 12px 18px; }
