:root {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fafafc;
  --ink: #1d1d1f;
  --ink-secondary: #6e6e73;
  --ink-tertiary: #86868b;
  --rose: #e11d48;
  --rose-hover: #be123c;
  --rose-soft: rgba(225, 29, 72, 0.085);
  --rose-border: rgba(225, 29, 72, 0.22);
  --stage-accent: #e11d48;
  --good: #059669;
  --good-bg: #ecfdf5;
  --good-border: rgba(5, 150, 105, 0.26);
  --edge: 1px solid rgba(0, 0, 0, 0.06);
  --edge-strong: 1px solid rgba(0, 0, 0, 0.1);
  --shadow-panel:
    0 1px 2px rgba(0, 0, 0, 0.024),
    0 10px 30px -10px rgba(15, 23, 42, 0.06);
  --shadow-float:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 20px 46px -14px rgba(15, 23, 42, 0.11);
  --shadow-glass:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 12px 32px -12px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:
    "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font: 14px/1.48 var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex: none;
}

i {
  font-style: normal;
  display: inline-flex;
  align-items: center;
}

/* ================================================================
   1. STICKY FROSTED GLASS TOP NAVBAR & BRAND SQUIRCLE
   ================================================================ */
.studio-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 58px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav,
main {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 40px);
}

.nav {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand,
.actions,
.heading,
.section-head,
.panel-head,
.intro,
.export,
footer,
.person,
.paper-title,
.paper-head,
button,
.family {
  display: flex;
  align-items: center;
}

.brand {
  font-weight: 660;
  letter-spacing: -0.03em;
  font-size: 15.5px;
  gap: 10px;
  color: var(--ink);
}

.quote,
.head-badge {
  display: grid;
  place-items: center;
  flex: none;
}




.actions {
  gap: 10px;
}

/* ================================================================
   BUTTON SYSTEM (APPLE MICRO-LIFT + 0.97 TACTILE PRESS)
   ================================================================ */
button {
  font: inherit;
  font-weight: 560;
  cursor: pointer;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: var(--edge);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 240ms var(--spring),
    box-shadow 220ms ease;
}

button:hover:not(:disabled) {
  background: #f4f4f6;
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.34;
  cursor: default;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}

.btn-secondary {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 580;
  color: var(--ink-secondary);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}

.btn-secondary:hover:not(:disabled) {
  background: #ffffff;
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.13);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.055);
}

.license {
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 620;
  color: var(--rose);
  background: var(--rose-soft);
  border: 1px solid var(--rose-border);
}

.license:hover:not(:disabled) {
  background: rgba(225, 29, 72, 0.13);
  border-color: rgba(225, 29, 72, 0.32);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.14);
}

.license.is-pro {
  color: var(--good);
  background: var(--good-bg);
  border-color: var(--good-border);
}

.license.is-pro:hover:not(:disabled) {
  background: #d1fae5;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.12);
}

.wide {
  width: 100%;
}

.primary {
  color: #ffffff;
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);
  border: 1px solid rgba(190, 18, 60, 0.35);
  border-radius: 13px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 630;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 2px rgba(225, 29, 72, 0.2),
    0 8px 20px -5px rgba(225, 29, 72, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #fb4766 0%, #d41540 100%);
  transform: translateY(-1.5px);
  box-shadow:
    0 2px 4px rgba(225, 29, 72, 0.24),
    0 12px 26px -6px rgba(225, 29, 72, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.primary:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 2px 8px -2px rgba(225, 29, 72, 0.35);
}

/* ================================================================
   2. HEADER TITLE AREA
   ================================================================ */
.crumb {
  margin: 18px 0 8px;
  color: var(--ink-tertiary);
  font-size: 12px;
  font-weight: 520;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crumb a:hover {
  color: var(--ink);
}

.intro {
  justify-content: space-between;
  margin-bottom: 20px;
}

.intro h1 {
  font-size: clamp(34px, 3.8vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.055em;
  font-weight: 740;
  color: var(--ink);
}

.intro h1 span {
  color: var(--rose);
}

.intro p {
  color: var(--ink-secondary);
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.48;
  max-width: 680px;
  letter-spacing: -0.01em;
}

/* ================================================================
   3. WORKSPACE GRID & MACOS STICKY CONSOLE ARCHITECTURE
   ================================================================ */
.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: var(--edge);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.right {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section-head,
.panel-head,
.export,
footer {
  justify-content: space-between;
  gap: 12px;
}

/* Left Panel: Fixed Header + Independent Scrollable Body + Sticky Footer */
.panel.console {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 76px;
  height: clamp(660px, calc(100vh - 96px), 840px);
}

.console-head {
  flex: none;
  padding: 16px 18px 14px;
  border-bottom: var(--edge);
  background: rgba(255, 255, 255, 0.9);
}

.console-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.console-sub {
  font-size: 11.5px;
  color: var(--ink-tertiary);
  margin-top: 1px;
  letter-spacing: -0.005em;
}

.console-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 20px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
}

.console-body::-webkit-scrollbar {
  width: 4px;
}

.console-body::-webkit-scrollbar-track {
  background: transparent;
}

.console-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
}

.console-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
}

.console-foot {
  position: relative;
  flex: none;
  padding: 14px 16px;
  border-top: var(--edge);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -8px 20px -12px rgba(15, 23, 42, 0.08);
}

.console-foot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 22px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.92) 100%
  );
  pointer-events: none;
}

h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.number {
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-variant-numeric: tabular-nums;
}

.empty-card {
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  background: linear-gradient(180deg, #fbfbfd 0%, #f6f6f9 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fadeUp 320ms var(--spring) both;
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, 0.14);
}

.empty-icon svg {
  width: 20px;
  height: 20px;
}

.empty-card strong {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.empty-card .hint {
  max-width: 260px;
}

.empty-sample-link {
  margin-top: 4px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rose);
  background: #ffffff;
  border: 1px solid var(--rose-border);
}

.empty-sample-link:hover:not(:disabled) {
  background: var(--rose-soft);
}

.row {
  border: var(--edge);
  border-radius: 14px;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #ffffff;
  transition:
    border-color 180ms ease,
    box-shadow 220ms ease,
    transform 240ms var(--spring),
    background 180ms ease;
  animation: fadeUp 340ms var(--spring) both;
  animation-delay: calc(var(--i, 0) * 38ms);
}

.row:last-child {
  margin-bottom: 0;
}

.row.is-featured {
  border-color: color-mix(in srgb, var(--stage-accent) 26%, rgba(0, 0, 0, 0.06));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--stage-accent) 3.5%, #ffffff) 0%,
    #ffffff 100%
  );
}

.row:hover {
  border-color: rgba(0, 0, 0, 0.13);
  box-shadow: 0 5px 16px -6px rgba(15, 23, 42, 0.08);
}

.row .person {
  gap: 10px;
}

.av {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 660;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail {
  flex: 1;
  min-width: 0;
}

.detail-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail strong,
.detail small,
.excerpt {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail strong {
  font-size: 13px;
  font-weight: 640;
  color: var(--ink);
}

.featured-chip {
  flex: none;
  font-size: 10px;
  font-weight: 660;
  padding: 1.5px 7px;
  border-radius: 999px;
  color: var(--stage-accent);
  background: color-mix(in srgb, var(--stage-accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--stage-accent) 22%, transparent);
}

.detail small,
.excerpt,
.export > span {
  font-size: 12px;
  color: var(--ink-secondary);
}

.excerpt {
  margin: 6px 0 8px;
  color: #4b4b52;
}

.tools {
  display: flex;
  gap: 3px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.tools button {
  padding: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-tertiary);
}

.tools button:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.055);
  color: var(--ink);
  transform: none;
}

.tools button.is-pinned {
  color: var(--stage-accent);
  background: color-mix(in srgb, var(--stage-accent) 10%, transparent);
}

.tools svg {
  width: 13.5px;
  height: 13.5px;
}

.tools .rating {
  margin-right: auto;
  color: var(--stage-accent);
  font-size: 12.5px;
  letter-spacing: 1px;
}

/* ================================================================
   4. APPLE SPRING SEGMENTED CONTROLS & ADOBE FLOATING STAGE INSPECTOR
   ================================================================ */
.stage-panel {
  overflow: visible;
}

.stage-canvas {
  padding: clamp(14px, 1.8vw, 22px);
  border-radius: 22px;
  background-color: #f3f4f7;
  background-image:
    radial-gradient(rgba(15, 23, 42, 0.095) 0.9px, transparent 0.9px),
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.72),
      transparent 68%
    );
  background-size: 16px 16px, 100% 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-inspector {
  position: relative;
  z-index: 12;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.055),
    var(--shadow-glass);
  border-radius: 17px;
  padding: 10px 12px;
  display: grid;
  gap: 9px;
}

.inspector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.inspector-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.utility-row {
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.055);
  gap: 10px;
}

.utility-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.utility-label {
  font-size: 10.5px;
  font-weight: 660;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-tertiary);
}

.bar-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.08);
  flex: none;
}

.seg-track {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.055);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.seg-track.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seg-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 3px);
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 1px 1px rgba(0, 0, 0, 0.04);
  transition: transform 360ms var(--spring);
  pointer-events: none;
  z-index: 0;
}

.seg-track.three .seg-thumb {
  width: calc((100% - 6px) / 3);
}

.seg-track[data-active="0"] .seg-thumb {
  transform: translateX(0%);
}

.seg-track[data-active="1"] .seg-thumb {
  transform: translateX(100%);
}

.seg-track[data-active="2"] .seg-thumb {
  transform: translateX(200%);
}

.seg-track button {
  position: relative;
  z-index: 1;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 560;
  color: var(--ink-secondary);
  white-space: nowrap;
  gap: 5px;
  transition: color 200ms ease;
}

.seg-track button svg {
  width: 13px;
  height: 13px;
}

.seg-track button:hover:not(:disabled) {
  background: transparent;
  transform: none;
  color: var(--ink);
}

.seg-track button:active:not(:disabled) {
  transform: scale(0.97);
}

.seg-track button.on,
.seg-track button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 640;
}

.seg-track button.on i,
.seg-track button[aria-pressed="true"] i {
  color: var(--stage-accent);
}

.radius-seg button {
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.swatches {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: var(--swatch);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition:
    transform 260ms var(--spring),
    box-shadow 220ms ease;
}

.swatch:hover:not(:disabled) {
  background: var(--swatch);
  transform: scale(1.14);
}

.swatch.on {
  box-shadow:
    0 0 0 1.5px #ffffff,
    0 0 0 3.2px var(--swatch),
    0 3px 8px rgba(0, 0, 0, 0.16);
  transform: scale(1.06);
}

.swatch svg {
  width: 11px;
  height: 11px;
  color: #ffffff;
  stroke-width: 2.8;
}

.meta-pills {
  gap: 6px;
}

.pill-toggle {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 580;
  color: var(--ink-tertiary);
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  gap: 6px;
}

.pill-toggle:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.07);
  color: var(--ink);
  transform: none;
}

.pill-toggle .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  transition: background 200ms ease, transform 240ms var(--spring);
}

.pill-toggle.on {
  background: #ffffff;
  color: var(--ink);
  border-color: rgba(0, 0, 0, 0.09);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pill-toggle.on .pill-dot {
  background: var(--stage-accent);
  transform: scale(1.1);
}

.paper-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sample-pill:empty {
  display: none;
}

.sample-pill {
  font-size: 11px;
  font-weight: 630;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, 0.18);
}

.paper[data-theme="dark"] .sample-pill {
  background: color-mix(in srgb, var(--stage-accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--stage-accent) 34%, transparent);
  color: color-mix(in srgb, var(--stage-accent) 45%, #ffffff 55%);
}

/* ================================================================
   5. HOST-CONTEXT LIVE CANVAS STAGE (ZERO FAKE BROWSER CHROME)
   ================================================================ */
.stage-frame {
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    var(--shadow-float);
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  transition:
    max-width 440ms var(--spring),
    border-color 300ms ease,
    box-shadow 320ms ease;
}

.stage-frame.mobile {
  max-width: 390px;
}

.stage-frame[data-theme="dark"] {
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 60px -16px rgba(0, 0, 0, 0.42);
}

.paper {
  padding: clamp(20px, 2.2vw, 28px);
  background: #f8f8fa;
  transition:
    background 380ms var(--spring),
    color 260ms ease;
}

.paper[data-theme="dark"] {
  background: #0b0b0f;
  color: #f5f5f7;
}

.paper[data-theme="glass"] {
  background:
    radial-gradient(
      circle at 10% 14%,
      color-mix(in srgb, var(--stage-accent) 18%, transparent),
      transparent 48%
    ),
    radial-gradient(circle at 88% 16%, rgba(129, 140, 248, 0.2), transparent 46%),
    radial-gradient(circle at 78% 88%, rgba(56, 189, 248, 0.16), transparent 52%),
    linear-gradient(155deg, #f7f6fb 0%, #eef2fa 100%);
}

.paper-head {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 2px 18px;
}

.paper-title {
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.quote {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--stage-accent) 12%, transparent);
  color: var(--stage-accent);
  transition: background 280ms ease, color 280ms ease;
}

.paper[data-theme="dark"] .quote {
  background: color-mix(in srgb, var(--stage-accent) 22%, rgba(255, 255, 255, 0.04));
  color: color-mix(in srgb, var(--stage-accent) 42%, #ffffff 58%);
  border: 1px solid color-mix(in srgb, var(--stage-accent) 34%, rgba(255, 255, 255, 0.08));
}

.quote svg {
  width: 16px;
  height: 16px;
}

.editable-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.editable-title {
  font-size: 21px;
  font-weight: 710;
  letter-spacing: -0.04em;
  color: inherit;
  padding: 2px 7px;
  margin: -2px -7px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: text;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.editable-title:hover {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.08);
}

.paper[data-theme="dark"] .editable-title:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.editable-title:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--stage-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-accent) 18%, transparent);
  outline: none;
}

.paper[data-theme="dark"] .editable-title:focus {
  background: rgba(22, 22, 26, 0.95);
  color: #ffffff;
}

.edit-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--ink-tertiary);
  opacity: 0.45;
  transition: opacity 180ms ease, transform 220ms var(--spring);
  pointer-events: none;
}

.edit-cue svg {
  width: 12px;
  height: 12px;
}

.editable-wrap:hover .edit-cue,
.editable-wrap:focus-within .edit-cue {
  opacity: 0.95;
  color: var(--stage-accent);
  transform: translateX(1px);
}

.wall-stats:empty {
  display: none;
}

.wall-stats {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.065);
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.paper[data-theme="dark"] .wall-stats {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
}

.wall-stats b {
  color: var(--stage-accent);
  margin-right: 4px;
}

/* ================================================================
   6. SYNTAX-HIGHLIGHTED EMBED CODE CAPSULE (ZERO SCROLLBARS)
   ================================================================ */
.panel-head {
  min-height: 58px;
  padding: 12px 20px;
  border-bottom: var(--edge);
  background: rgba(255, 255, 255, 0.9);
}

.heading {
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.head-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--rose-soft);
  color: var(--rose);
}

.head-badge svg {
  width: 15px;
  height: 15px;
}

.code-meta {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.048);
  border: 1px solid rgba(0, 0, 0, 0.055);
  color: var(--ink-secondary);
}

.copy-btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 620;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--ink);
  min-width: 124px;
}

.copy-btn:hover:not(:disabled) {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.16);
}

.copy-btn.is-copied {
  background: var(--good-bg);
  color: var(--good);
  border-color: var(--good-border);
  box-shadow: 0 4px 12px -4px rgba(5, 150, 105, 0.25);
}

.copy-btn.is-copied:hover:not(:disabled) {
  background: #d1fae5;
}

.code-shell {
  position: relative;
  margin: 14px 20px 12px;
  border-radius: 14px;
  background: #121216;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.code-shell::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 76px;
  background: linear-gradient(
    90deg,
    rgba(18, 18, 22, 0) 0%,
    rgba(18, 18, 22, 0.78) 54%,
    #121216 92%
  );
  pointer-events: none;
}

.embed pre {
  margin: 0;
  padding: 14px 48px 14px 16px;
  color: #e4e4e7;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font: 12px/1.6 var(--font-mono);
  white-space: nowrap;
}

.embed pre::-webkit-scrollbar {
  display: none;
}

.tok-punct {
  color: #71717a;
}

.tok-tag {
  color: #fb7185;
  font-weight: 600;
}

.tok-attr {
  color: #93c5fd;
}

.tok-str {
  color: #86efac;
}

.export {
  padding: 0 20px 16px;
}

.btn-export {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  background: var(--surface-soft);
}

/* ================================================================
   7. MODAL, FORM, FOOTER & TOAST
   ================================================================ */
.field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink);
}

input,
select,
textarea {
  font: inherit;
  font-weight: 450;
  color: var(--ink);
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
  outline: none;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

footer {
  margin: 28px 0 24px;
  padding: 18px 0;
  border-top: var(--edge);
  font-size: 12px;
  color: var(--ink-tertiary);
}

#family {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.family {
  gap: 5px;
}

.family b {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

dialog {
  border: var(--edge);
  border-radius: 20px;
  width: min(460px, 94vw);
  max-height: 90dvh;
  padding: 24px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.icon-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-secondary);
}

.icon-close:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
  color: var(--ink);
  transform: none;
}

.error {
  color: #be123c;
  font-size: 12.5px;
  font-weight: 560;
  margin: 10px 0;
}

.error:empty {
  margin: 0;
}

#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(29, 29, 31, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 560;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  z-index: 80;
  animation: fadeUp 240ms var(--spring) both;
}

#toast:empty,
[hidden] {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports (transition-behavior: allow-discrete) {
  dialog {
    opacity: 0;
    scale: 0.97;
    transition:
      opacity 180ms ease,
      scale 240ms var(--spring),
      display 240ms allow-discrete,
      overlay 240ms allow-discrete;
  }
  dialog[open] {
    opacity: 1;
    scale: 1;
  }
  @starting-style {
    dialog[open] {
      opacity: 0;
      scale: 0.97;
    }
  }
}

/* ================================================================
   8. RESPONSIVE & SHOWROOM MODE
   ================================================================ */
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: minmax(290px, 330px) minmax(0, 1fr);
  }
  .bar-divider {
    display: none;
  }
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel.console {
    position: static;
    height: auto;
    max-height: 480px;
  }
}

@media (max-width: 640px) {
  .studio-nav {
    height: 56px;
  }
  .brand {
    font-size: 14.5px;
    gap: 8px;
  }
  .actions {
    gap: 6px;
  }
  .btn-secondary,
  .license {
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .panel-head {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .code-shell {
    margin: 12px 14px 10px;
  }
  .export {
    flex-wrap: wrap;
    padding: 0 14px 14px;
  }
  #family {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::view-transition-group(*) {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

html.showroom body > header,
html.showroom .crumb,
html.showroom footer {
  display: none;
}

html.showroom main {
  margin: 0 auto;
  padding: 14px 16px;
}

html.showroom .intro {
  margin: 0 0 12px;
  padding: 0;
}

html.showroom .intro h1 {
  font-size: 28px;
}

html.showroom .intro p {
  font-size: 13px;
  margin-top: 4px;
}

html.showroom .panel.console {
  position: static;
  height: 560px;
}

.brand-control{background:transparent;border:0;padding:0;text-align:left;cursor:pointer;color:#065cb2}
