/* Authentication is a product entry, not a terminal. Isolated from the testing
   workspace so form/panel changes never affect run rendering. */
html body.studio-workspace #auth-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  grid-template-rows: 84px minmax(min-content, 1fr) 60px;
  gap: 0 clamp(32px, 5vw, 88px);
  width: 100%;
  height: 100dvh;
  padding: 0 max(32px, calc((100vw - 1280px) / 2));
  box-sizing: border-box;
  overflow: auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  isolation: isolate;
}
html body.studio-workspace #auth-gate[hidden],
html body.studio-workspace #auth-gate [hidden] { display: none !important; }
html body.studio-workspace #auth-gate *,
html body.studio-workspace #auth-gate *::before,
html body.studio-workspace #auth-gate *::after { box-sizing: border-box; }
html body.studio-workspace #auth-gate :is(.terminal-accessbar, .auth-eyebrow) { display: none; }
html body.studio-workspace #auth-gate .auth-masthead {
  grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--border);
}
html body.studio-workspace #auth-gate .auth-brand {
  display: inline-flex; align-items: center; gap: 11px; color: var(--text);
  font: 650 22px/1 var(--font-ui); letter-spacing: .16em; text-decoration: none;
}
html body.studio-workspace #auth-gate .auth-brand-symbol {
  display: block; width: 34px; height: 34px;
  background: var(--brand-mark-image) center / contain no-repeat;
}
html body.studio-workspace #auth-gate .theme-control {
  display: inline-flex; align-items: center; gap: 10px; font: 12px var(--font-ui);
  color: var(--text-muted); margin: 0;
}
html body.studio-workspace #auth-gate .theme-control select {
  min-height: 34px; width: auto; padding: 6px 28px 6px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text-secondary); font: 12px var(--font-ui);
}
html body.studio-workspace #auth-gate .auth-story {
  grid-column: 1; grid-row: 2; align-self: center; min-width: 0;
  padding: 40px 0; border: 0; background: transparent; box-shadow: none;
  transform: none; animation: none;
}
html body.studio-workspace #auth-gate .auth-story::before,
html body.studio-workspace #auth-gate .auth-story::after { content: none; }
html body.studio-workspace #auth-gate .auth-kicker {
  margin: 0 0 24px; color: var(--text-muted); font: 550 10px/1.6 var(--font-ui); letter-spacing: .17em;
}
html body.studio-workspace #auth-gate .auth-story h2 {
  margin: 0; font: 550 clamp(36px, 3.8vw, 56px)/1.13 var(--font-ui);
  letter-spacing: -.055em; color: var(--text); text-wrap: balance;
}
html body.studio-workspace #auth-gate .auth-story h2 > span { color: var(--text-muted); }
html body.studio-workspace #auth-gate .auth-story-copy {
  margin: 24px 0 38px; color: var(--text-secondary); font: 400 14px/1.85 var(--font-ui);
  max-width: 48ch;
}
html body.studio-workspace #auth-gate .auth-method {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 500px; padding-top: 22px; border-top: 1px solid var(--border);
}
html body.studio-workspace #auth-gate .auth-method > div { padding: 0 12px 0 0; }
html body.studio-workspace #auth-gate .auth-method-number {
  display: block; color: var(--text-faint); font: 400 10px/1 var(--font-ui);
  font-variant-numeric: tabular-nums; margin-bottom: 14px;
}
html body.studio-workspace #auth-gate .auth-method strong { font: 550 13px/1.5 var(--font-ui); color: var(--text); }
html body.studio-workspace #auth-gate .auth-method p { margin: 6px 0 0; font: 400 11px/1.8 var(--font-ui); color: var(--text-muted); }
html body.studio-workspace #auth-gate .auth-story-caption { display: flex; align-items: center; gap: 8px; margin: 32px 0 0; font: 11px/1.6 var(--font-ui); color: var(--text-muted); }
html body.studio-workspace #auth-gate .auth-story-caption > span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
html body.studio-workspace #auth-gate .auth-panel {
  grid-column: 2; grid-row: 2; min-width: 0; width: 100%;
  align-self: center; justify-self: end; padding: 28px 0;
  animation: none; display: block;
}
html body.studio-workspace #auth-gate .auth-card {
  width: 100%; max-width: 440px; margin: 0 0 0 auto; padding: 32px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface-1); box-shadow: 0 12px 40px #00000008;
}
html body.studio-workspace #auth-gate .auth-card-emblem { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 24px; }
html body.studio-workspace #auth-gate .auth-card-emblem > span { width: 25px; height: 25px; background: var(--brand-mark-image) center / contain no-repeat; }
html body.studio-workspace #auth-gate .auth-card-kicker { margin: 0 0 9px; color: var(--text-muted); font: 550 9px/1.5 var(--font-ui); letter-spacing: .12em; }
html body.studio-workspace #auth-gate .auth-card h1 { margin: 0; color: var(--text); font: 550 28px/1.25 var(--font-ui); letter-spacing: -.04em; }
html body.studio-workspace #auth-gate .auth-copy { margin: 11px 0 26px; color: var(--text-muted); font: 400 12px/1.75 var(--font-ui); }
html body.studio-workspace #auth-gate .auth-card form { display: flex; flex-direction: column; gap: 0; }
html body.studio-workspace #auth-gate .auth-card label { display: block; margin: 18px 0 9px; color: var(--text-secondary); font: 550 12px/1.4 var(--font-ui); }
html body.studio-workspace #auth-gate .auth-card form > label:first-child { margin-top: 0; }
html body.studio-workspace #auth-gate .auth-card label::before { content: none; }
html body.studio-workspace #auth-gate .auth-card input:not([type="checkbox"]) {
  display: block; width: 100%; min-height: 46px; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  color: var(--text); background: var(--surface-2); font: 400 13px/1.5 var(--font-ui);
  box-shadow: none; transition: border-color 120ms;
}
html body.studio-workspace #auth-gate .auth-card input:not([type="checkbox"]):focus { outline: 2px solid var(--text-muted); outline-offset: 2px; border-color: transparent; box-shadow: none; }
html body.studio-workspace #auth-gate .auth-card input::placeholder { color: var(--text-faint); }
html body.studio-workspace #auth-gate .auth-password-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
html body.studio-workspace #auth-gate .auth-card .auth-show { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; color: var(--text-muted); font: 400 11px var(--font-ui); cursor: pointer; }
html body.studio-workspace #auth-gate .auth-show input { appearance: auto; width: 14px; height: 14px; min-height: 14px; padding: 0; margin: 0; accent-color: var(--brand-primary); }
html body.studio-workspace #auth-gate :is(.auth-switch, .auth-recovery-link) { width: auto; min-height: 36px; margin: 0; padding: 4px 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); font: 500 11px/1.5 var(--font-ui); cursor: pointer; text-decoration: none; }
html body.studio-workspace #auth-gate :is(.auth-switch, .auth-recovery-link):hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
html body.studio-workspace #auth-gate .auth-submit {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px;
  margin: 18px 0 0; padding: 12px 18px; border: 1px solid var(--brand-primary); border-radius: 9px;
  background: var(--brand-primary) !important; color: var(--brand-on-primary) !important;
  box-shadow: none; font: 600 13px/1.5 var(--font-ui); text-transform: none;
}
html body.studio-workspace #auth-gate .auth-submit::before,
html body.studio-workspace #auth-gate .auth-submit::after { content: none; }
html body.studio-workspace #auth-gate .auth-submit:hover:not(:disabled) { background: var(--brand-primary-hover) !important; border-color: var(--brand-primary-hover); box-shadow: none; }
html body.studio-workspace #auth-gate .auth-submit:disabled { opacity: .55; cursor: wait; }
html body.studio-workspace #auth-gate .auth-account-switch { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 16px; color: var(--text-muted); font: 11px var(--font-ui); }
html body.studio-workspace #auth-gate .auth-account-note { display: flex; align-items: flex-start; justify-content: center; gap: 7px; border-top: 1px solid var(--border); padding-top: 19px; margin: 16px 0 0; font: 10px/1.6 var(--font-ui); color: var(--text-muted); }
html body.studio-workspace #auth-gate .auth-account-note svg { flex: 0 0 14px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.3; }
html body.studio-workspace #auth-gate .auth-hint { font: 11px/1.65 var(--font-ui); color: var(--text-muted); margin: 10px 0 0; }
html body.studio-workspace #auth-gate .auth-error { margin: 12px 0 0; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-3); color: var(--text); font: 12px/1.65 var(--font-ui); }
html body.studio-workspace #auth-gate .auth-panel:not(#signin-panel) .auth-switch { display: block; margin: 12px auto 0; text-align: center; }
html body.studio-workspace #auth-gate :is(button, a, select):focus-visible { outline: 2px solid var(--text-muted); outline-offset: 3px; }
html body.studio-workspace #auth-gate .auth-bottom { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 0; border-top: 1px solid var(--border); color: var(--text-faint); font: 10px/1.6 var(--font-ui); }
html body.studio-workspace #auth-gate .auth-bottom span > span { margin: 0 8px; color: var(--border-strong); }
@media (min-width: 1600px) {
  html body.studio-workspace #auth-gate { padding-inline: max(64px, calc((100vw - 1360px) / 2)); }
}
@media (min-width: 901px) and (max-height: 800px) {
  html body.studio-workspace #auth-gate { grid-template-rows: 72px minmax(min-content, 1fr) 48px; }
  html body.studio-workspace #auth-gate .auth-panel { padding-block: 24px; }
  html body.studio-workspace #auth-gate .auth-card { padding: 28px; }
  html body.studio-workspace #auth-gate .auth-card-emblem { display: none; }
  html body.studio-workspace #auth-gate .auth-account-note { margin-top: 12px; padding-top: 14px; }
}
@media (max-width: 900px) {
  html body.studio-workspace #auth-gate { grid-template-columns: minmax(0, 1fr); grid-template-rows: 72px minmax(min-content, 1fr) auto; gap: 0; padding-inline: 24px; }
  html body.studio-workspace #auth-gate .auth-story { display: none; }
  html body.studio-workspace #auth-gate .auth-panel { grid-column: 1; justify-self: center; padding: 32px 0; }
  html body.studio-workspace #auth-gate .auth-card { margin: 0 auto; max-width: 440px; }
  html body.studio-workspace #auth-gate .auth-bottom { justify-content: center; text-align: center; }
  html body.studio-workspace #auth-gate .auth-bottom > span:last-child { display: none; }
}
@media (max-width: 480px) {
  html body.studio-workspace #auth-gate { padding-inline: 20px; }
  html body.studio-workspace #auth-gate .auth-brand { font-size: 19px; }
  html body.studio-workspace #auth-gate .auth-brand-symbol { width: 30px; height: 30px; }
  html body.studio-workspace #auth-gate .theme-control > span { display: none; }
  html body.studio-workspace #auth-gate .theme-control select { min-height: 40px; }
  html body.studio-workspace #auth-gate .auth-card { padding: 24px 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
  html body.studio-workspace #auth-gate .auth-panel { padding: 16px 0 24px; }
  html body.studio-workspace #auth-gate .auth-account-note { justify-content: flex-start; }
  html body.studio-workspace #auth-gate .auth-card input:not([type="checkbox"]) { font-size: 16px; }
  html body.studio-workspace #auth-gate :is(.auth-show, .auth-switch, .auth-recovery-link) { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html body.studio-workspace #auth-gate *, html body.studio-workspace #auth-gate *::before, html body.studio-workspace #auth-gate *::after { animation: none !important; transition: none !important; }
}
