.studio {
  width: min(1720px, 100%);
}

/* The shared SVG is the visible Studio mark. Keep the image circular here as a
   layout guard, rather than relying on pseudo-elements on the replaced <img>
   element, which browsers do not render consistently. border-radius is kept as
   the broad fallback; clip-path makes the circular boundary explicit for
   browser/PWA shells that otherwise paint the replaced element as a square. */
.brand-mark {
  position: relative;
  border-radius: 50%;
  clip-path: circle(50% at 50% 50%);
  overflow: hidden;
  background: #1d4ed8;
}

.studio-jump {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.studio-jump:hover { opacity: .9; }
.studio-jump:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--text) 35%, transparent);
  outline-offset: 2px;
}

.beta35-strip {
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.studio-launchpad .beta35-strip {
  margin: 0;
}

.beta35-strip strong {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 10px;
  letter-spacing: .03em;
}

.beta35-strip a {
  margin-left: auto;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.beta35-strip a:hover { text-decoration: underline; }
#designer { scroll-margin-top: 12px; }
#designer:target { box-shadow: inset 0 0 0 2px var(--border-strong); }

/* Source stays immediately available, but the visual result gets the larger
   default working surface expected from a RAD IDE. */
.editor-pane textarea {
  height: clamp(330px, 36vh, 470px);
}

.result-pane {
  min-height: clamp(700px, 82vh, 980px);
}

.result-pane .designer-view,
.result-pane .app-preview {
  min-height: clamp(650px, 76vh, 920px);
  max-height: none;
}

.result-pane .designer-canvas {
  min-height: clamp(600px, 70vh, 860px);
  max-height: none;
  background-color: #e4e5e8;
  background-image: none;
}

.result-pane #designer .designer-toolbar {
  position: sticky;
  top: 42px;
  z-index: 6;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.result-pane .tabs {
  box-shadow: 0 6px 18px rgb(0 0 0 / 3%);
}

.result-pane .tab.active {
  position: relative;
}

.result-pane .tab.active::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: .72;
}

.designer-control:focus-visible,
.patch-window:focus-visible,
.designer-canvas:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--text) 40%, transparent);
  outline-offset: 2px;
}

@media (min-width: 1381px) {
  .result-pane #designer .designer-surface.designer-inspector-bottom {
    grid-template-rows: minmax(440px, 1fr) minmax(170px, 250px);
  }
  .result-pane #designer .designer-surface.designer-inspector-bottom .designer-inspector {
    max-height: 250px;
  }
}

@media (max-width: 920px) {
  .studio-jump { flex: 1 1 auto; }
  .beta35-strip { align-items: flex-start; flex-wrap: wrap; }
  .beta35-strip a { margin-left: 0; }
  .editor-pane textarea { height: clamp(360px, 48vh, 560px); }
  .result-pane,
  .result-pane .designer-view,
  .result-pane .app-preview,
  .result-pane .designer-canvas {
    min-height: 560px;
  }
  .result-pane #designer .designer-toolbar { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .result-pane .tab,
  .studio-jump { transition: none !important; }
}
