:root {
  --navy-950: #07101d;
  --navy-900: #0b1626;
  --navy-850: #102036;
  --navy-800: #132842;
  --blue-600: #1f64cc;
  --blue-500: #2d78e6;
  --blue-400: #5597f0;
  --cyan-400: #44b5e8;
  --gold-500: #c89b3c;
  --green-500: #2f9e66;
  --red-500: #d2535d;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf2f8;
  --ink: #172033;
  --muted: #667085;
  --line: #d8e0eb;
  --line-strong: #c4cfde;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 10px 30px rgba(10, 26, 48, .12);
  --shadow-lg: 0 20px 70px rgba(7, 16, 29, .18);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar: 306px;
  --inspector: 350px;
  --header-h: 64px;
  --mobile-tabs-h: 52px;
  --ease: 160ms ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--navy-950); }
body {
  margin: 0;
  color: var(--ink);
  background: #eef3f9;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(45, 120, 230, .24);
  outline-offset: 2px;
}
a { color: var(--blue-600); }
.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.noscript { padding: 24px; color: white; background: #8b1e2d; }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
  background:
    radial-gradient(circle at 8% 12%, rgba(61, 134, 235, .18), transparent 30%),
    radial-gradient(circle at 85% 85%, rgba(200, 155, 60, .10), transparent 26%),
    linear-gradient(145deg, #07101d 0%, #0d1b2e 47%, #091422 100%);
  color: white;
}
.login-hero {
  padding: clamp(42px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}
.login-hero::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 50%;
  right: -210px; top: 80px;
  box-shadow: 0 0 0 70px rgba(255,255,255,.018), 0 0 0 140px rgba(255,255,255,.012);
  pointer-events: none;
}
.login-brand { position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px; height: 42px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: .08em;
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.03);
}
.brand-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: #95add0; font-weight: 700; }
.brand-name { margin-top: 3px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.login-copy { max-width: 720px; position: relative; z-index: 1; margin: 54px 0; }
.login-copy h1 {
  margin: 0 0 22px;
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6.2vw, 78px);
  line-height: .98;
  font-weight: 500;
  letter-spacing: -.045em;
}
.login-copy p { margin: 0; max-width: 640px; color: #bdc9db; font-size: 17px; line-height: 1.7; }
.login-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 38px; }
.login-point { border-top: 1px solid rgba(255,255,255,.13); padding-top: 14px; color: #9fafc6; font-size: 12px; line-height: 1.55; }
.login-point strong { display: block; color: #f4f7fb; margin-bottom: 3px; font-size: 13px; }
.login-footer { position: relative; z-index: 1; font-size: 11px; color: #788ca9; letter-spacing: .03em; }
.login-panel-wrap {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: clamp(28px, 5vw, 72px);
  background: rgba(255,255,255,.035);
  border-left: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.login-panel {
  width: 100%; max-width: 470px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(9, 20, 34, .84);
  border-radius: 18px;
  padding: clamp(28px, 4vw, 42px);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.login-panel h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.login-panel .lede { color: #9fb0c8; font-size: 14px; line-height: 1.55; margin: 10px 0 26px; }
.auth-button {
  width: 100%; min-height: 52px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  color: white; font-weight: 700;
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
  margin-top: 10px;
}
.auth-button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.25); }
.auth-button.discord { background: #5865f2; border-color: #5865f2; }
.auth-button.discord:hover { background: #6672f3; }
.auth-button.roblox { background: #20242c; }
.auth-button.preview { background: transparent; color: #b8c6d9; border-style: dashed; }
.auth-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; }
.auth-icon svg { width: 24px; height: 24px; fill: currentColor; }
.auth-copy { text-align: left; }
.auth-copy small { display: block; font-size: 10px; color: rgba(255,255,255,.62); font-weight: 500; margin-top: 1px; }
.auth-divider { display: flex; gap: 12px; align-items: center; color: #6e819c; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; margin: 20px 0 9px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: rgba(255,255,255,.08); flex: 1; }
.auth-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); color: #7f91aa; font-size: 11px; line-height: 1.6; }

/* ---------- App shell ---------- */
.studio-shell { height: 100dvh; display: grid; grid-template-rows: var(--header-h) minmax(0,1fr); overflow: hidden; background: #edf2f8; }
.topbar {
  height: var(--header-h);
  background: #0c1728;
  color: white;
  display: flex; align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 2px 8px rgba(5, 15, 28, .15);
  z-index: 50;
}
.topbar .brand-mark { width: 34px; height: 34px; font-size: 10px; }
.topbar-title { min-width: 0; }
.topbar-title strong { display: block; font-size: 14px; line-height: 1.1; }
.topbar-title span { display: block; margin-top: 3px; color: #8296b2; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.topbar-separator { width: 1px; height: 28px; background: rgba(255,255,255,.1); margin: 0 2px; }
.save-state { display: flex; align-items: center; gap: 7px; color: #9eb0c8; font-size: 11px; white-space: nowrap; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ecb8e; box-shadow: 0 0 0 3px rgba(94,203,142,.08); }
.save-dot.saving { background: #e5b858; }
.topbar-spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.toolbar-btn, .icon-btn {
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.035);
  color: #dbe4f1;
  min-height: 34px;
  border-radius: 7px;
  padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 11px; font-weight: 650;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.toolbar-btn:hover, .icon-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: white; }
.toolbar-btn.primary { background: #2d78e6; border-color: #2d78e6; color: white; }
.toolbar-btn.primary:hover { background: #3e84e8; }
.icon-btn { width: 34px; padding: 0; }
.icon-btn svg, .toolbar-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  margin-left: 2px; padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.08);
}
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #27405e; display: grid; place-items:center; font-size: 10px; font-weight: 800; }
.user-copy { max-width: 140px; }
