.websiteStudio {
  --website-bg: #f4f6f9;
  --website-surface: #ffffff;
  --website-surface-strong: #f8fafc;
  --website-line: #dbe1e8;
  --website-text: #111827;
  --website-muted: #64748b;
  --website-accent: #d98b00;
  --website-accent-strong: #a96700;
  --website-danger: #b42318;
  --website-shadow: 0 12px 28px rgba(15, 23, 42, .08);
  display: grid;
  gap: 16px;
  min-width: 0;
  color: var(--website-text);
}

body.theme-dark .websiteStudio {
  --website-bg: #090c12;
  --website-surface: #111620;
  --website-surface-strong: #171d28;
  --website-line: #2a3341;
  --website-text: #f8fafc;
  --website-muted: #a9b4c4;
  --website-accent: #f5a400;
  --website-accent-strong: #ffc13d;
  --website-danger: #ff776d;
  --website-shadow: 0 14px 32px rgba(0, 0, 0, .28);
}

.websiteStudioHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--website-line);
  border-radius: 8px;
  background: var(--website-surface);
  box-shadow: var(--website-shadow);
}

.websiteStudioHeader h2,
.websiteStudioHeader p,
.websiteRegionHead h3,
.websiteRegionHead p,
.websiteSectionTitle h4,
.websiteSectionTitle p {
  margin: 0;
}

.websiteStudioHeader h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.websiteStudioHeader p {
  margin-top: 4px;
  color: var(--website-muted);
  font-size: 13px;
  line-height: 1.45;
}

.websiteStudioLinks,
.websiteEditorActions > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.websiteStudio .websiteButton,
.websiteStudio a.websiteButton,
.websiteStudio .websiteIconButton {
  display: inline-flex;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 9px 13px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--website-line);
  border-radius: 6px;
  background: var(--website-surface-strong);
  color: var(--website-text);
  font: 750 13px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.websiteStudio .websiteButton:hover,
.websiteStudio .websiteIconButton:hover {
  border-color: var(--website-accent);
  color: var(--website-accent-strong);
}

.websiteStudio .websiteButton:focus-visible,
.websiteStudio .websiteIconButton:focus-visible,
.websiteStudio button:focus-visible,
.websiteStudio input:focus-visible,
.websiteStudio textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--website-accent) 30%, transparent);
  outline-offset: 2px;
}

.websiteStudio .websiteButton.is-primary {
  border-color: var(--website-accent);
  background: var(--website-accent);
  color: #171006;
}

.websiteStudio .websiteButton.is-danger {
  border-color: color-mix(in srgb, var(--website-danger) 40%, var(--website-line));
  background: transparent;
  color: var(--website-danger);
}

.websiteStudio .websiteButton:disabled,
.websiteStudio .websiteIconButton:disabled {
  opacity: .55;
  cursor: wait;
}

.websiteStudio .websiteIconButton {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.websiteStudioWorkspace {
  display: grid;
  grid-template-columns: 210px minmax(360px, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.websiteStudioPages,
.websiteStudioEditor,
.websiteStudioPreview {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--website-line);
  border-radius: 8px;
  background: var(--website-surface);
  box-shadow: var(--website-shadow);
}

.websiteStudioPages,
.websiteStudioPreview {
  position: sticky;
  top: 16px;
}

.websiteRegionHead {
  display: flex;
  min-height: 66px;
  padding: 14px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--website-line);
  background: var(--website-surface-strong);
}

.websiteRegionHead h3 {
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.websiteRegionHead p {
  margin-top: 3px;
  color: var(--website-muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.websitePageList {
  display: grid;
  gap: 2px;
  padding: 8px;
}

.websiteStudio .websitePageRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--website-text);
  text-align: left;
  font: inherit;
}

.websiteStudio .websitePageRow:hover {
  background: var(--website-surface-strong);
}

.websiteStudio .websitePageRow.is-active {
  border-color: color-mix(in srgb, var(--website-accent) 55%, var(--website-line));
  background: color-mix(in srgb, var(--website-accent) 10%, var(--website-surface));
}

.websitePageRow span,
.websitePageRow strong,
.websitePageRow small {
  display: block;
  min-width: 0;
}

.websitePageRow strong {
  overflow: hidden;
  color: var(--website-text);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.websitePageRow small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--website-muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.websitePageRow i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--website-muted);
  border-radius: 50%;
  background: transparent;
}

.websitePageRow i.is-live {
  border-color: #22a55a;
  background: #22a55a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22a55a 16%, transparent);
}

.websiteEmptyNote {
  margin: 0;
  padding: 16px 10px;
  color: var(--website-muted);
  font-size: 12px;
  line-height: 1.5;
}

.websiteState {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--website-line);
  border-radius: 999px;
  color: #16804a;
  font-size: 11px;
  font-weight: 800;
}

.websiteState.is-dirty {
  border-color: color-mix(in srgb, var(--website-accent) 50%, var(--website-line));
  color: var(--website-accent-strong);
}

.websiteEditorForm {
  display: grid;
}

.websiteFormSection {
  padding: 20px;
  border-bottom: 1px solid var(--website-line);
}

.websiteSectionTitle {
  display: grid;
  gap: 3px;
  margin-bottom: 15px;
}

.websiteSectionTitle h4 {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

.websiteSectionTitle p {
  color: var(--website-muted);
  font-size: 12px;
  line-height: 1.4;
}

.websiteFieldGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.websiteField,
.websiteSwitch {
  min-width: 0;
}

.websiteField {
  display: grid;
  align-content: start;
  gap: 6px;
}

.websiteField.is-wide,
.websiteSwitch {
  grid-column: 1 / -1;
}

.websiteField > span {
  color: var(--website-text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.websiteField > span b {
  color: var(--website-danger);
}

.websiteField small,
.websiteSwitch small {
  display: block;
  color: var(--website-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.websiteStudio .websiteField input,
.websiteStudio .websiteField textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--website-line);
  border-radius: 6px;
  background: var(--website-surface-strong);
  color: var(--website-text);
  font: 500 14px/1.45 Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.websiteStudio .websiteField input {
  min-height: 42px;
}

.websiteStudio .websiteField textarea {
  min-height: 96px;
  resize: vertical;
}

.websiteStudio #websitePageBody {
  min-height: 210px;
}

.websiteSwitch {
  display: flex;
  min-height: 62px;
  padding: 11px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--website-line);
  border-radius: 6px;
  background: var(--website-surface-strong);
}

.websiteSwitch > span,
.websiteSwitch strong {
  display: block;
}

.websiteSwitch strong {
  font-size: 13px;
  line-height: 1.35;
}

.websiteStudio .websiteSwitch input {
  appearance: none;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--website-line);
  border-radius: 999px;
  background: #9aa5b3;
  cursor: pointer;
}

.websiteStudio .websiteSwitch input::after {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
  content: '';
  transition: transform .16s ease;
}

.websiteStudio .websiteSwitch input:checked {
  border-color: var(--website-accent);
  background: var(--website-accent);
}

.websiteStudio .websiteSwitch input:checked::after {
  transform: translateX(18px);
}

.websiteSearchPreview {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid var(--website-line);
  border-radius: 6px;
  background: #fff;
  color: #202124;
}

.websiteSearchPreview small,
.websiteSearchPreview strong,
.websiteSearchPreview p {
  display: block;
  margin: 0;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
}

.websiteSearchPreview small {
  margin-bottom: 4px;
  color: #188038;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.websiteSearchPreview strong {
  color: #1a0dab;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.websiteSearchPreview p {
  margin-top: 3px;
  color: #4d5156;
  font-size: 13px;
  line-height: 1.45;
}

.websiteEditorActions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  min-height: 66px;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--website-line);
  background: color-mix(in srgb, var(--website-surface) 93%, transparent);
  backdrop-filter: blur(14px);
}

.websiteStatus {
  color: var(--website-muted);
  font-size: 12px;
  line-height: 1.4;
}

.websiteStatus.is-error {
  color: var(--website-danger);
  font-weight: 700;
}

.websitePreviewControls {
  display: flex;
  padding: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--website-line);
}

.websiteSegmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--website-line);
  border-radius: 6px;
  background: var(--website-bg);
}

.websiteStudio .websiteSegmented button {
  width: auto;
  min-height: 32px;
  margin: 0;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--website-muted);
  font: 750 11px/1 Inter, system-ui, sans-serif;
  letter-spacing: 0;
}

.websiteStudio .websiteSegmented button[aria-pressed="true"] {
  background: var(--website-surface);
  color: var(--website-text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.websitePreviewStage {
  display: grid;
  min-height: 510px;
  padding: 14px;
  place-items: start center;
  overflow: auto;
  background-color: var(--website-bg);
  background-image: linear-gradient(45deg, color-mix(in srgb, var(--website-line) 45%, transparent) 25%, transparent 25%), linear-gradient(-45deg, color-mix(in srgb, var(--website-line) 45%, transparent) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, color-mix(in srgb, var(--website-line) 45%, transparent) 75%), linear-gradient(-45deg, transparent 75%, color-mix(in srgb, var(--website-line) 45%, transparent) 75%);
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
}

.websitePreviewShell {
  overflow: hidden;
  border: 1px solid #2a3341;
  border-radius: 6px;
  background: #090b0f;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .2);
  transition: width .2s ease;
}

.websitePreviewShell.is-desktop {
  width: 100%;
  min-width: 270px;
}

.websitePreviewShell.is-mobile {
  width: min(100%, 280px);
}

.websitePreviewShell iframe {
  display: block;
  width: 100%;
  height: 480px;
  border: 0;
  background: #090b0f;
}

.websitePreviewHint {
  margin: 0;
  padding: 11px 14px;
  border-top: 1px solid var(--website-line);
  color: var(--website-muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .websiteStudioWorkspace {
    grid-template-columns: 1fr;
  }

  .websiteStudioPages,
  .websiteStudioPreview {
    position: static;
  }

  .websitePageList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .websitePreviewStage {
    min-height: 570px;
  }

  .websitePreviewShell.is-desktop {
    width: min(100%, 820px);
  }

  .websitePreviewShell.is-mobile {
    width: min(100%, 390px);
  }

  .websitePreviewShell iframe {
    height: 540px;
  }
}

@media (max-width: 680px) {
  .websiteStudioHeader,
  .websiteEditorActions {
    align-items: stretch;
    flex-direction: column;
  }

  .websiteStudioLinks,
  .websiteEditorActions > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .websiteStudio .websiteButton,
  .websiteStudio a.websiteButton {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .websitePageList,
  .websiteFieldGrid {
    grid-template-columns: 1fr;
  }

  .websiteField.is-wide,
  .websiteSwitch {
    grid-column: auto;
  }

  .websiteFormSection {
    padding: 16px;
  }

  .websitePreviewControls {
    align-items: stretch;
    flex-direction: column;
  }

  .websiteSegmented {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .websiteEditorActions > div {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .websitePreviewShell,
  .websiteStudio .websiteSwitch input::after {
    transition: none;
  }
}
