:root {
  --studio-header-h: 68px;
  --studio-guide-w: 252px;
  --studio-inspector-w: 388px;
  --studio-surface: #101827;
  --studio-surface-2: #151f31;
  --studio-surface-3: #1a263a;
  --studio-line: rgba(148, 163, 184, 0.16);
  --studio-line-strong: rgba(148, 163, 184, 0.25);
  --studio-copy: #eef4ff;
  --studio-muted: #94a3b8;
  --studio-blue: #3478f6;
  --studio-blue-soft: rgba(52, 120, 246, 0.16);
}

body.studio-ready {
  padding-top: var(--studio-header-h);
  background: #08111f;
  color: var(--studio-copy);
}

.studio-ready .dh {
  height: var(--studio-header-h);
  padding: 0 20px;
  gap: 12px;
  background: #0b1423;
  border-bottom-color: var(--studio-line);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.studio-ready .dh-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 13px;
}

.studio-ready .dh-back:hover,
.studio-ready .dh-back:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.studio-ready .dh-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #8fb8ff;
  background: var(--studio-blue-soft);
  font-size: 20px;
}

.studio-ready .dh-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.studio-ready .dh-badge {
  border-radius: 5px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.studio-ready .dh-sep { display: none; }
.studio-ready .dh-actions { gap: 8px !important; }
.studio-ready .dh-actions > a[href*="github"] { display: none; }
.studio-ready .dh-actions > span { color: var(--studio-muted) !important; }

.studio-ready .d-btn,
.studio-ready .bg-select {
  min-height: 36px;
  border-color: var(--studio-line-strong);
  border-radius: 8px;
  background: #131e2f;
  color: var(--studio-copy);
  font-size: 13px;
}

.studio-ready .d-btn {
  justify-content: center;
  padding: 7px 12px;
}

.studio-ready .d-btn:hover,
.studio-ready .bg-select:hover {
  border-color: rgba(96, 165, 250, 0.62);
  background: #18263a;
}

.studio-ready .d-btn:focus-visible,
.studio-ready .bg-select:focus-visible,
.studio-ready button:focus-visible,
.studio-ready input:focus-visible,
.studio-ready textarea:focus-visible {
  outline: 2px solid #7bb0ff;
  outline-offset: 2px;
}

.studio-ready .d-btn-accent,
.studio-ready .studio-export-btn {
  border-color: var(--studio-blue);
  background: var(--studio-blue);
  color: #fff;
}

.studio-ready #theme-select {
  min-width: 176px !important;
  font-size: 13px !important;
}

.studio-ready .te-body {
  display: grid;
  grid-template-columns: var(--studio-guide-w) minmax(480px, 1fr) var(--studio-inspector-w);
  min-height: 0;
  background: #08111f;
}

.studio-guide {
  min-width: 0;
  overflow: hidden auto;
  background: #0c1626;
  border-right: 1px solid var(--studio-line);
  scrollbar-width: thin;
}

.studio-guide-inner { padding: 22px 16px 18px; }

.studio-step {
  position: relative;
  padding: 0 0 22px 38px;
}

.studio-step:not(:last-of-type)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 34px;
  bottom: 4px;
  width: 1px;
  background: var(--studio-line);
}

.studio-step-number {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 50%;
  background: #152238;
  color: #a9b9d0;
  font-size: 13px;
  font-weight: 700;
}

.studio-step.is-active .studio-step-number {
  border-color: rgba(52, 120, 246, 0.72);
  background: #1b4f9e;
  color: #fff;
}

.studio-step-title {
  padding-top: 3px;
  color: #f3f7ff;
  font-size: 14px;
  font-weight: 650;
}

.studio-step-copy {
  margin-top: 2px;
  color: var(--studio-muted);
  font-size: 12px;
  line-height: 1.55;
}

.studio-template-list {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.studio-template {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--studio-line-strong);
  border-radius: 8px;
  background: #0a1220;
  color: #dbe7fa;
  cursor: pointer;
  text-align: left;
}

.studio-template img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  opacity: 0.88;
}

.studio-template span {
  display: block;
  padding: 7px 9px 8px;
  font-size: 12px;
}

.studio-template:hover { border-color: rgba(96, 165, 250, 0.68); }
.studio-template.is-selected {
  border-color: #4f8fff;
  box-shadow: 0 0 0 2px rgba(52, 120, 246, 0.22);
}

.studio-template.is-selected::after {
  content: "\2713";
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--studio-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.studio-tip {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
  border-top: 1px solid var(--studio-line);
  color: var(--studio-muted);
  font-size: 12px;
  line-height: 1.55;
}

.studio-tip i { color: #fbbf24; font-size: 18px; }

.studio-ready .te-right {
  min-width: 0;
  background: #091321;
  border-right: 1px solid var(--studio-line);
}

.studio-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 18px;
  background: #0c1626;
  border-bottom: 1px solid var(--studio-line);
}

.studio-preview-heading h1 {
  margin: 0;
  color: #f6f9ff;
  font-size: 15px;
  font-weight: 650;
}

.studio-preview-heading p {
  margin: 2px 0 0;
  color: var(--studio-muted);
  font-size: 12px;
}

.studio-ready .preview-toolbar {
  min-height: 52px;
  padding: 8px 18px;
  background: #0d1727;
  border-bottom-color: var(--studio-line);
}

.studio-ready .preview-toggle {
  padding: 3px;
  border-radius: 9px;
  background: #09111e;
}

.studio-ready .preview-btn {
  min-height: 34px;
  padding: 6px 13px;
  border-color: transparent;
  border-radius: 7px;
  color: #9eabc0;
  font-size: 12px;
}

.studio-ready .preview-btn.active {
  border-color: rgba(96, 165, 250, 0.35);
  background: #1d4f98;
  color: #fff;
}

.studio-ready .preview-area {
  margin: 16px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 10px;
  background: #08101c;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.studio-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 8px 18px;
  background: #0c1626;
  border-top: 1px solid var(--studio-line);
  color: var(--studio-muted);
  font-size: 12px;
}

.studio-zoom { display: flex; align-items: center; gap: 8px; }
.studio-zoom button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--studio-line-strong);
  border-radius: 7px;
  background: #121d2e;
  color: #dbe7f7;
  cursor: pointer;
}

.studio-ready .te-left {
  width: auto;
  min-width: 0;
  background: #0e1929;
  border-right: 0;
  overflow: hidden;
}

.studio-inspector-heading {
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--studio-line);
}

.studio-inspector-heading h2 {
  margin: 0;
  color: #f6f9ff;
  font-size: 15px;
}

.studio-inspector-heading p {
  margin-top: 3px;
  color: var(--studio-muted);
  font-size: 12px;
}

.studio-ready .mode-toggle {
  gap: 6px;
  padding: 10px 14px;
  border-bottom-color: var(--studio-line);
}

.studio-ready .mode-btn {
  bottom: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--studio-line);
  border-radius: 8px;
  color: #9aa8bd;
  font-size: 12px;
}

.studio-ready .mode-btn.active {
  border-color: rgba(96, 165, 250, 0.42);
  background: var(--studio-blue-soft);
  color: #dbeafe;
}

.studio-ready .editor-scroll {
  padding: 12px 14px 20px;
}

.studio-ready .var-group {
  overflow: hidden;
  margin: 0 0 10px;
  border: 1px solid var(--studio-line);
  border-radius: 9px;
  background: #121d2e;
}

.studio-ready .var-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  color: #e7eefb;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  user-select: none;
}

.studio-ready .var-group-title:hover { background: rgba(255, 255, 255, 0.025); }
.studio-ready .var-group-title small {
  display: block;
  margin-top: 2px;
  color: var(--studio-muted);
  font-size: 11px;
  font-weight: 400;
}

.studio-ready .var-group-title i { color: #91b7f6; font-size: 17px; }
.studio-ready .var-group-body { padding: 0 12px 10px; }
.studio-ready .var-group.is-collapsed .var-group-body { display: none; }

.studio-ready .var-row {
  grid-template-columns: minmax(112px, 1fr) auto;
  min-height: 40px;
  gap: 8px;
  margin: 0;
  padding: 7px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.studio-ready .var-label {
  color: #b8c4d6;
  font-family: var(--d-font);
  font-size: 12px;
}

.studio-ready .var-inputs { gap: 5px; }
.studio-ready input[type="color"] {
  width: 32px;
  height: 30px;
  border-radius: 6px;
}

.studio-ready input[type="text"].hex-input { width: 78px; }
.studio-ready input[type="text"].rgba-input { width: 135px; }
.studio-ready input[type="text"].text-input { width: 145px; }

.studio-ready input[type="text"],
.studio-ready .alpha-input,
.studio-ready .color-fmt-btn {
  min-height: 30px;
  border-color: var(--studio-line-strong);
  border-radius: 6px;
  background: #0b1524;
  color: #dce8f8;
}

.studio-ready .var-section-sep { display: none; }

.studio-ready .export-panel {
  padding: 12px 14px 14px;
  border-top-color: var(--studio-line);
  background: #0c1626;
}

.studio-ready .export-panel-title {
  margin-bottom: 8px;
  color: #cbd8e9;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.studio-ready .export-btns { gap: 6px; }
.studio-ready .export-btns .d-btn { flex: 1 1 72px; }
.studio-ready .copy-feedback { min-height: 0; }

.studio-ready .cfe-file-bar,
.studio-ready .cfe-preset-bar,
.studio-ready .cfe-toolbar {
  border-color: var(--studio-line);
  background: #0c1626;
}

.studio-ready .cfe-textarea { font-size: 12px; }

.studio-history-button[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
}

.studio-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #86efac;
}

.studio-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

@media (max-width: 1180px) {
  :root {
    --studio-guide-w: 218px;
    --studio-inspector-w: 350px;
  }
  .studio-guide-inner { padding-inline: 12px; }
  .studio-ready .dh-actions > span { display: none; }
  .studio-ready #theme-select { min-width: 145px !important; }
}

@media (max-width: 980px) {
  .studio-ready .te-body { grid-template-columns: minmax(420px, 1fr) 340px; }
  .studio-guide { display: none; }
  .studio-ready .dh-badge,
  .studio-ready .studio-history-label { display: none; }
}

@media (max-width: 760px) {
  body.studio-ready { overflow: auto; }
  .studio-ready .dh { position: sticky; min-width: 680px; }
  .studio-ready .te-body {
    min-width: 680px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(620px, calc(100vh - var(--studio-header-h))) 620px;
  }
  .studio-ready .te-right { border-right: 0; }
  .studio-ready .te-left { border-top: 1px solid var(--studio-line); }
}
