:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.design-preview {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  color: #241d20;
  background: #f7f3f4;
}

.theme-bar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 76px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(60, 37, 45, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 30px rgba(47, 27, 34, 0.08);
  backdrop-filter: blur(16px);
}

.theme-bar__intro {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 158px;
}

.theme-bar__logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 3px 12px rgba(72, 43, 53, 0.15);
}

.theme-bar__intro div {
  display: grid;
  gap: 2px;
}

.theme-bar__intro strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  white-space: nowrap;
}

.theme-bar__intro span {
  color: #83757a;
  font-size: 11px;
  white-space: nowrap;
}

.theme-tabs {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.theme-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #ded5d8;
  border-radius: 999px;
  color: #5f5257;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-tab:hover {
  border-color: #b98296;
  color: #8f4663;
  transform: translateY(-1px);
}

.theme-tab[aria-current="true"] {
  border-color: #7d304e;
  color: #fff;
  background: #7d304e;
  box-shadow: 0 5px 16px rgba(125, 48, 78, 0.2);
}

.theme-tab:focus-visible,
.open-theme:focus-visible {
  outline: 3px solid rgba(43, 157, 219, 0.35);
  outline-offset: 2px;
}

.open-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #7d304e;
  background: #f8eef2;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.theme-stage {
  flex: 1;
  min-height: 0;
}

.theme-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 980px) {
  .theme-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .theme-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 3px 2px 6px;
    scrollbar-width: thin;
  }

  .open-theme {
    display: none;
  }
}

@media (max-width: 680px) {
  .theme-bar {
    display: block;
    min-height: 0;
    padding: 8px 10px 7px;
  }

  .theme-bar__intro {
    margin-bottom: 7px;
  }

  .theme-bar__logo {
    width: 34px;
    height: 34px;
  }

  .theme-bar__intro strong {
    font-size: 15px;
  }

  .theme-tab {
    flex: 0 0 auto;
    min-width: 42px;
    min-height: 38px;
    padding: 7px 12px;
  }

  .theme-tab span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-tab {
    transition: none;
  }
}
