:root {
  color-scheme: light;
  --ink: #111;
  --paper: #fff;
  --muted: #737373;
  --line: #d9d9d9;
  --soft: #f6f6f4;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1180px;
  background: #ededeb;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 14px;
  cursor: pointer;
}

button.primary {
  background: #050505;
  border-color: #050505;
  color: #fff;
}

button.secondary {
  background: #fff;
  border-color: #111;
}

button.danger {
  color: var(--danger);
  border-color: #f1b5ae;
}

.stage4-page-actions,
.stage4-page-row-tools,
.stage4-component-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.stage4-page-actions { margin: 8px 0 10px; }
.stage4-page-actions button { flex: 1; padding: 7px 8px; font-size: 12px; }
.stage4-page-row { margin: 7px 0; border: 1px solid transparent; border-radius: 12px; }
.stage4-page-row.is-active { border-color: #111; }
.stage4-page-row .sidebar-item { width: 100%; text-align: left; border: 0; border-radius: 10px; }
.stage4-page-row-tools { padding: 0 6px 6px; flex-wrap: wrap; }
.stage4-page-row-tools button,
.stage4-component-row > button:not(.sidebar-item) { padding: 5px 7px; font-size: 11px; }
.stage4-component-row { margin: 6px 0; flex-wrap: wrap; }
.stage4-component-row .sidebar-item { flex: 1 1 100%; text-align: left; }

.builder-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.builder-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.builder-brand {
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.builder-logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid #111;
  border-radius: 50%;
  font-size: 18px;
}

.builder-brand strong {
  display: block;
  font-size: 17px;
}

.builder-brand div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.builder-brand .builder-build-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #666;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.builder-notice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #e6dfc9;
  border-radius: 12px;
  background: #fff9e6;
  color: #5f4b14;
  font-size: 13px;
}

.builder-select-label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.builder-select-label select,
.builder-toolbar select,
.builder-toolbar input,
.inspector-form input,
.inspector-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}

.builder-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: auto;
}

.canvas-height-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.canvas-height-control input {
  width: 82px;
}

.side-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.side-preview-toggle input {
  min-height: 0;
  width: 16px;
  height: 16px;
  padding: 0;
}

.builder-import-backup {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #111;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.builder-import-backup input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.layer-toolbar {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.layer-toolbar button {
  white-space: nowrap;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.builder-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 292px minmax(420px, 1fr) 340px;
  gap: 12px;
  padding: 12px;
}

.builder-workspace.is-side-preview {
  grid-template-columns: 292px minmax(420px, 1fr) minmax(340px, 430px) 340px;
}

.builder-sidebar,
.builder-inspector,
.builder-stage,
.side-preview-panel {
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.builder-sidebar,
.builder-inspector {
  display: flex;
  flex-direction: column;
}

.side-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.side-preview-panel[hidden] {
  display: none !important;
}

.side-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.side-preview-header span {
  font-weight: 700;
}

.side-preview-header select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px 8px;
}

.side-preview-frame {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px;
  background: #f3f3f1;
}

.side-preview-viewport {
  margin: 0 auto;
  overflow: hidden;
}

.side-preview-canvas {
  width: 390px;
  min-height: 844px;
  transform-origin: top left;
}

.side-preview-frame .page-preview-shell {
  margin: 0 auto;
}

.builder-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.builder-tabs .tab {
  padding: 8px;
  font-size: 12px;
}

.builder-tabs .is-active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.builder-panel {
  display: none;
  flex: 1;
  overflow: auto;
  padding: 14px;
}

.builder-panel.is-active {
  display: block;
}

.page-list-tools {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 8px;
  padding: 10px 14px 0;
}

.page-list-tools input,
.page-list-tools select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}

.sidebar-item {
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
  border-radius: 14px;
}

.sidebar-item.is-active {
  border-color: #111;
  box-shadow: inset 0 0 0 1px #111;
}

.sidebar-item small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.component-group-title {
  margin: 18px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.builder-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.builder-stage-note {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.builder-stage-note span[data-save-status="dirty"] {
  color: #7a4a00;
}

.builder-stage-note span[data-save-status="saving"] {
  color: #111;
}

.builder-stage-note span.is-save-failed {
  color: var(--danger);
  font-weight: 700;
}

.save-status-wrap,
.save-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.save-status-actions button {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.phone-frame-wrap {
  flex: 1;
  width: 100%;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 28px;
  background: linear-gradient(135deg, #f5f5f5, #ececea);
}

.phone-frame {
  position: relative;
  /* The configured device width is the editable viewport, not the bezel. */
  box-sizing: content-box;
  width: 390px;
  height: 844px;
  min-height: 844px;
  transform-origin: top center;
  background: #fff;
  border: 12px solid #151515;
  border-radius: 34px;
  overflow-x: hidden;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

.phone-scroll-content {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 110px;
  scrollbar-width: none;
}

.phone-scroll-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.phone-page {
  position: relative;
  min-height: 820px;
  padding: 10px 16px 86px;
  background: #fff;
}

.free-canvas-page {
  min-height: var(--builder-canvas-height, 1200px);
}

.phone-section {
  position: relative;
  margin-bottom: 14px;
  padding: 4px 0;
  border: 1px solid transparent;
  border-radius: 18px;
}

.phone-bottom-nav-section {
  position: sticky;
  bottom: 0;
  z-index: 35;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.98);
}

.phone-bottom-nav-section.is-navigation-flow {
  position: relative;
  bottom: auto;
}

.phone-top-nav-fixed {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  pointer-events: none;
  padding: 0 16px;
}

.phone-top-nav-fixed > [data-component-id] {
  pointer-events: auto;
}

.phone-bottom-nav-fixed {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  pointer-events: none;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -1px 0 rgba(17, 17, 17, 0.12);
}

.phone-bottom-nav-fixed .phone-bottom-nav-section {
  position: relative;
  bottom: auto;
  pointer-events: auto;
}

.phone-bottom-nav-section .phone-section-title {
  display: none;
}

.phone-section-title {
  display: none;
  margin: 0 0 8px;
  font-size: 11px;
  color: #aaa;
}

.page-preview-route {
  min-width: 0;
  background: #f5f5f3;
}

.page-preview-shell {
  width: min(390px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 86px;
  background: #fff;
  color: var(--ink);
  overflow-x: hidden;
}

.pb-section {
  position: relative;
  min-height: 120px;
  border-bottom: 1px solid #ececec;
  padding: 14px 0;
}

.pb-section h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.pb-shared-component {
  box-sizing: border-box;
  transform-origin: center center;
  overflow: visible;
}

.pb-shared-component img {
  max-width: none;
}

.pb-shared-shape-frame .pb-free-shape::after {
  border-style: solid;
}

.pb-miniapp-home .pb-section h2,
.phone-page[data-page-id="home"] .phone-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
}

.pb-component,
.pb-image-placeholder,
.pb-hero {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
}

.pb-image-placeholder {
  color: var(--muted);
  background: #fafafa;
}

.pb-hero {
  min-height: 260px;
  border-color: #111;
}

.pb-button {
  width: 100%;
  background: #111;
  color: #fff;
  border-color: #111;
}

.pb-text-component.is-single-line {
  white-space: nowrap;
  overflow: hidden;
}

.pb-text-component.is-multi-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pb-text-component.system-sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.pb-text-component.system-serif {
  font-family: SimSun, "Songti SC", serif;
}

.pb-text-component.system-mono {
  font-family: Consolas, "SFMono-Regular", monospace;
}

.pb-logo-header,
.component-logo-header {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.pb-logo-box,
.component-logo-media {
  width: 74px;
  min-height: 34px;
  display: grid;
  place-items: center;
}

.pb-logo-box img,
.component-logo-media img {
  max-width: 74px;
  max-height: 38px;
  object-fit: contain;
}

.pb-logo-placeholder,
.component-logo-media b {
  font-weight: 900;
  font-size: 16px;
}

.pb-logo-copy,
.component-logo-copy {
  display: grid;
  gap: 2px;
}

.pb-logo-copy strong,
.component-logo-copy strong {
  font-size: 14px;
  letter-spacing: .02em;
}

.pb-logo-copy small,
.component-logo-copy span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .08em;
}

.pb-wechat-capsule,
.component-capsule {
  width: 58px;
  height: 30px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fff;
}

.pb-wechat-capsule i,
.component-capsule i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #111;
}

.pb-hero-carousel,
.component-hero-carousel {
  position: relative;
  min-height: 365px;
  padding: 0 28px 26px 0;
}

.pb-hero-main,
.component-hero-main {
  position: relative;
  min-height: 342px;
  border: 1px solid #111;
  border-radius: 24px;
  overflow: hidden;
  background: #f8f8f6;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .07);
}

.pb-hero-slide {
  position: absolute;
  inset: 0;
  display: none;
}

.pb-hero-slide.is-active {
  display: block;
}

.pb-hero-main img,
.component-hero-main img {
  width: 100%;
  height: 342px;
  object-fit: cover;
  display: block;
}

.pb-hero-placeholder,
.component-hero-empty {
  height: 342px;
  display: grid;
  place-items: center;
  color: #888;
  text-align: center;
  line-height: 1.6;
}

.pb-hero-copy,
.component-hero-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 6px;
  padding: 14px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(17,17,17,.1);
  border-radius: 18px;
}

.pb-hero-copy strong,
.component-hero-copy strong {
  font-size: 19px;
}

.pb-hero-copy small,
.component-hero-copy span {
  color: #5e5e5e;
  font-size: 12px;
}

.pb-hero-copy button,
.component-hero-copy button {
  width: max-content;
  min-width: 112px;
  border-radius: 14px;
  border-color: #111;
  background: #111;
  color: #fff;
  padding: 8px 16px;
}

.pb-hero-next-peek,
.component-hero-next {
  position: absolute;
  top: 18px;
  right: 0;
  width: 34px;
  height: 306px;
  display: grid;
  place-items: center;
  border: 1px solid #d8d8d8;
  border-radius: 18px;
  color: #999;
  background: #fff;
  writing-mode: vertical-rl;
  font-size: 11px;
}

.pb-hero-dots,
.component-dots {
  position: absolute;
  left: 0;
  right: 28px;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pb-hero-dots b,
.pb-hero-dots i,
.pb-hero-dots button,
.component-dots b,
.component-dots i,
.component-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d1d1;
}

.pb-hero-dots b,
.pb-hero-dots button.is-active,
.component-dots b,
.component-dots button.is-active {
  background: #111;
}

.pb-hero-dots button {
  display: block;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.pb-hero-slide-button {
  position: absolute;
  border: 1px solid #111;
  border-radius: 14px;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pb-hero-slide-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.component-dots button {
  display: block;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.pb-quick-entries,
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pb-quick-entries span,
.quick-grid span {
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid #dedede;
  border-radius: 16px;
  background: #fff;
  font-size: 11px;
}

.pb-quick-entries b,
.quick-grid b {
  font-size: 18px;
  line-height: 1;
}

.pb-quick-entries img,
.quick-grid img {
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
}

.pb-product-series,
.component-product-series {
  display: grid;
  gap: 10px;
}

.pb-product-series > div:first-child,
.component-product-series header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.pb-product-series strong,
.component-product-series header strong {
  font-size: 20px;
}

.pb-product-series small,
.component-product-series span,
.component-product-series small {
  color: var(--muted);
  font-size: 11px;
}

.pb-product-grid,
.component-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pb-product-grid article,
.component-product-grid article {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e4e4e4;
  border-radius: 18px;
  background: #fff;
}

.pb-product-grid img,
.component-product-grid img,
.component-product-empty,
.pb-product-placeholder {
  width: 100%;
  aspect-ratio: 1.14;
  border-radius: 14px;
  object-fit: cover;
  background: #f4f4f2;
}

.pb-flat-pattern,
.pb-topic-poster,
.pb-image-card,
.component-flat-pattern,
.component-topic-poster,
.component-image {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e1e1e1;
  border-radius: 22px;
  background: #fff;
}

.pb-flat-pattern img,
.pb-topic-poster img,
.pb-image-card img,
.component-flat-pattern img,
.component-topic-poster img,
.component-image img {
  width: 100%;
  max-height: 210px;
  border-radius: 16px;
  object-fit: cover;
  background: #f7f7f5;
}

.pb-flat-pattern img,
.component-flat-pattern img {
  aspect-ratio: 58 / 18;
  object-fit: contain;
}

.pb-image-empty,
.component-image span,
.component-flat-pattern span,
.component-topic-poster span {
  min-height: 138px;
  display: grid;
  place-items: center;
  border: 1px solid #d5d5d5;
  border-radius: 16px;
  color: var(--muted);
  background: #fafafa;
}

.pb-bottom-nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 50;
  width: min(390px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 10px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
}

.pb-shared-component.is-navigation-flow .pb-bottom-nav {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  width: 100%;
  transform: none;
}

.pb-shared-component.is-navigation-fixed.pb-shared-bottom-nav {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  z-index: 50 !important;
  width: min(390px, 100vw) !important;
  transform: translateX(-50%) !important;
}

.pb-shared-component.is-navigation-fixed.pb-shared-top-nav {
  position: fixed !important;
  left: 50% !important;
  top: 0 !important;
  z-index: 50 !important;
  width: min(390px, 100vw) !important;
  transform: translateX(-50%) !important;
}

.pb-bottom-nav span {
  display: grid;
  place-items: center;
  gap: 3px;
  text-align: center;
  font-size: 12px;
}

.pb-bottom-nav b,
.bottom-nav-preview b {
  font-size: 20px;
  line-height: 1;
}

.pb-bottom-nav .is-active,
.bottom-nav-preview .is-active {
  font-weight: 800;
}

.check-pass {
  color: #087443;
}

.check-fail {
  color: var(--danger);
}

.auth-required-panel,
.auth-required-phone {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
}

.auth-required-panel h2,
.auth-required-phone h2 {
  margin: 0;
  font-size: 18px;
}

.auth-required-panel p,
.auth-required-phone p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-required-phone {
  min-height: 360px;
  place-content: center;
  text-align: center;
}

.builder-component {
  position: relative;
  min-height: 28px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  user-select: none;
}

.builder-component.is-selected {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.08);
}

.builder-component.is-hidden {
  opacity: 0.35;
}

.builder-component.is-shape-frame,
.builder-component.is-frame-group {
  position: absolute;
  margin-bottom: 0;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  pointer-events: none;
}

.builder-component.is-selected.is-shape-frame,
.builder-component.is-selected.is-frame-group {
  border-color: transparent;
  box-shadow: none;
}

.builder-component.is-shape-frame > .component-free-shape,
.builder-component.is-frame-group .component-live-layer,
.builder-component.is-shape-frame > .resize-handle,
.builder-component.is-frame-group > .resize-handle,
.builder-component.is-shape-frame > .component-delete-handle,
.builder-component.is-frame-group > .component-delete-handle {
  pointer-events: auto;
}

.component-frame-edge {
  position: absolute;
  z-index: 90;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  touch-action: none;
}

.component-frame-edge:hover {
  opacity: 1;
  background: rgba(17, 17, 17, .05);
}

.component-frame-edge.is-top,
.component-frame-edge.is-bottom {
  left: -8px;
  right: -8px;
  height: 16px;
  cursor: move;
}

.component-frame-edge.is-top {
  top: -8px;
}

.component-frame-edge.is-bottom {
  bottom: -8px;
}

.component-frame-edge.is-left,
.component-frame-edge.is-right {
  top: -8px;
  bottom: -8px;
  width: 16px;
  cursor: move;
}

.component-frame-edge.is-left {
  left: -8px;
}

.component-frame-edge.is-right {
  right: -8px;
}

.component-layer-stage {
  position: relative;
  width: 100%;
  min-height: 120px;
  overflow: visible;
}

.component-layer-stage.is-bottom-nav-stage {
  min-height: 64px;
  border-top: 1px solid #ddd;
  background: rgba(255, 255, 255, .98);
}

.component-live-layer {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 8px;
  min-height: 8px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #111;
  cursor: move;
  overflow: visible;
  touch-action: none;
  user-select: none;
}

.component-live-layer:hover {
  border-color: rgba(17, 17, 17, .22);
  background: rgba(255, 255, 255, .72);
}

.component-live-layer.is-selected {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, .14);
  background: rgba(255, 255, 255, .88);
}

.component-live-layer.is-locked {
  border-style: solid;
  cursor: not-allowed;
}

.component-free-shape {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1.5px solid #111;
  background: transparent;
  color: #111;
}

.component-free-shape.is-circle {
  border-radius: 50%;
}

.component-free-shape.is-ellipse {
  border-radius: 999px / 55%;
}

.component-free-shape.is-rect,
.component-free-shape.is-frame {
  border-radius: 0;
}

.component-free-shape img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.component-free-shape span {
  padding: 8px;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}

.component-free-shape.is-frame-shape {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  background: var(--frame-bg, transparent); border: 0; clip-path: var(--frame-path);
}
.component-free-shape.is-frame-shape::after { content: ""; position: absolute; inset: 0; border: 1.5px dashed #000; clip-path: var(--frame-path); pointer-events: none; }
.component-free-shape.is-frame-shape img { width: 100%; height: 100%; object-fit: cover; display: block; }
.component-free-shape .frame-empty-label { position: absolute; inset: 0; display: grid; place-items: center; color: #8b8b8b; font-size: 12px; }
.component-free-shape.is-frame-shape em { position: absolute; left: 12px; bottom: 10px; font-style: normal; color: #111; background: rgba(255,255,255,.76); padding: 2px 5px; border-radius: 3px; }
.frame-library-launch { display: grid !important; grid-template-columns: 28px 1fr; text-align: left; gap: 5px 9px; }
.frame-library-launch small { grid-column: 2; }
.frame-library-launch-icon { font-size: 24px; line-height: 1; }

.frame-library-modal { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; background: rgba(0,0,0,.34); padding: 20px; }
.frame-library-modal[hidden] { display: none !important; }
.frame-library-dialog { width: min(920px, 96vw); height: min(760px, 94vh); max-height: min(760px, 94vh); overflow: hidden; background: #fff; border: 1px solid #111; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.26); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.frame-library-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 20px 24px 14px; border-bottom: 1px solid #e7e7e7; }
.frame-library-header h2 { margin: 0 0 6px; font-size: 20px; }.frame-library-header p { margin: 0; color: #666; font-size: 13px; }.frame-library-header button { width: 34px; height: 34px; border: 1px solid #111; background: #fff; border-radius: 50%; font-size: 22px; }
.frame-library-body { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; }
.frame-library-toolbar { padding: 16px 24px 0; display: grid; gap: 12px; }.frame-library-toolbar input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #bbb; border-radius: 8px; }.frame-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }.frame-filter-tabs button { background: #fff; border: 1px solid #bbb; padding: 7px 12px; border-radius: 999px; }.frame-filter-tabs button.is-active { background: #111; color: #fff; border-color: #111; }
.frame-staging-panel { margin: 14px 24px 0; padding: 12px; border: 1px solid #dedede; border-radius: 12px; background: #fafafa; display: grid; gap: 10px; }
.frame-staging-panel strong { display: block; font-size: 13px; }
.frame-staging-panel small { color: #666; font-size: 12px; }
.frame-staging-strip { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scroll-snap-type: x proximity; }
.frame-staged-item { flex: 0 0 96px; display: grid; gap: 5px; padding: 8px; border: 1px solid #cfcfcf; border-radius: 10px; background: #fff; cursor: pointer; scroll-snap-align: start; }
.frame-staged-item .frame-library-thumbnail { height: 54px; }
.frame-staged-item .frame-library-thumbnail svg { width: 48px; height: 48px; }
.frame-staged-item strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-staging-empty { flex: 0 0 auto; color: #777; font-size: 12px; padding: 12px; }
.frame-library-main { overflow-y: auto; overflow-x: hidden; padding: 16px 24px; min-height: 0; }.frame-shape-grid { display: grid; grid-template-columns: repeat(4, minmax(120px,1fr)); gap: 12px; }.frame-shape-card,.frame-layout-card { border: 1px solid #d4d4d4; background: #fff; border-radius: 10px; padding: 10px; text-align: left; display: grid; gap: 6px; cursor: pointer; }.frame-shape-card.is-selected,.frame-layout-card.is-selected { border: 2px solid #111; box-shadow: 0 0 0 2px #eee; }.frame-shape-card strong,.frame-layout-card strong { font-size: 13px; }.frame-shape-card small,.frame-layout-card small { color: #777; font-size: 11px; }
.frame-library-thumbnail { height: 86px; display: grid; place-items: center; background: #fafafa; border-radius: 7px; }.frame-library-thumbnail svg { width: 72px; height: 72px; overflow: visible; }.frame-library-thumbnail path { fill: #fff; stroke: #111; stroke-width: 2; vector-effect: non-scaling-stroke; }
.frame-layout-grid { display: grid; grid-template-columns: repeat(3, minmax(160px,1fr)); gap: 12px; }.frame-layout-mini { height: 92px; position: relative; display: block; border: 1px solid #ededed; background: #fafafa; overflow: hidden; }.frame-layout-mini i { position: absolute; box-sizing: border-box; border: 1px solid #111; background: #fff; }
.frame-library-footer { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid #e7e7e7; padding: 14px 24px; background: #fff; }.frame-library-footer span { margin-right: auto; font-size: 13px; }.frame-library-footer label { font-size: 12px; display: flex; gap: 6px; align-items: center; }.frame-library-footer input { width: 70px; padding: 6px; border: 1px solid #bbb; border-radius: 5px; }.frame-library-footer .primary { padding: 9px 16px; }

@media (max-width: 700px) { .frame-shape-grid { grid-template-columns: repeat(2,minmax(120px,1fr)); }.frame-layout-grid { grid-template-columns: repeat(2,minmax(130px,1fr)); }.frame-library-dialog { max-height: 96vh; }.frame-library-footer span { width: 100%; }.frame-library-footer .primary { width: 100%; } }

.pb-free-shape {
  min-height: 80px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1.5px solid #111;
  background: transparent;
  color: #111;
}

.pb-free-shape.is-circle {
  border-radius: 50%;
  aspect-ratio: 1;
}

.pb-free-shape.is-ellipse {
  border-radius: 999px / 55%;
}

.pb-free-shape.is-rect,
.pb-free-shape.is-frame {
  border-radius: 0;
}

.pb-free-shape img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.pb-free-shape.is-frame-shape {
  width: 100%;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--frame-bg, transparent);
  border: 0;
  clip-path: var(--frame-path);
}
.pb-free-shape.is-frame-shape::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--frame-border-width, 1px) solid var(--frame-border, #111);
  clip-path: var(--frame-path);
  pointer-events: none;
}
.pb-free-shape.is-frame-shape img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-frame-group { position: relative; width: 100%; min-height: 120px; overflow: visible; }
.pb-frame-group-child { position: absolute; overflow: hidden; }

.component-empty-visual {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 40px;
  border: 1px solid transparent;
}

.live-layer-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
  pointer-events: none;
}

.is-logo_image .live-layer-image,
.is-logo_full_image .live-layer-image,
.is-nav_normal_icon .live-layer-image,
.is-nav_active_icon .live-layer-image,
.is-quick_entry_icon .live-layer-image {
  object-fit: contain;
}

.live-layer-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
}

.live-layer-text {
  width: 100%;
  color: #111;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  pointer-events: none;
}

.is-brand_text .live-layer-text,
.is-heading_text .live-layer-text,
.is-product_title .live-layer-text {
  font-weight: 800;
}

.is-nav_text .live-layer-text,
.is-quick_entry_title .live-layer-text {
  font-size: 11px;
}

.is-quick_entry_subtitle .live-layer-text,
.is-product_price .live-layer-text,
.is-helper_text .live-layer-text {
  color: var(--muted);
  font-size: 10px;
}

.live-layer-button {
  display: inline-grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
  padding: 0 10px;
  border-radius: 14px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.is-product_button .live-layer-button {
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 10px;
}

.live-layer-background-label {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, .18);
  border-radius: inherit;
  background: rgba(250, 250, 248, .82);
  color: rgba(17, 17, 17, .36);
  font-size: 10px;
  pointer-events: none;
}

.is-nav_hit_area .live-layer-background-label {
  border-style: solid;
  background: transparent;
  color: transparent;
}

.live-layer-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.live-layer-dots b,
.live-layer-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d1d1;
}

.live-layer-dots b {
  background: #111;
}

.layer-row {
  display: grid;
  gap: 3px;
  text-align: left;
}

.layer-row-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.layer-row-shell .layer-row {
  margin-bottom: 0;
}

.layer-row-actions {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 3px;
}

.layer-row-actions button {
  min-width: 34px;
  padding: 4px 5px;
  border-color: #d4d4d4;
  border-radius: 7px;
  background: #fff;
  color: #333;
  font-size: 10px;
}

.child-layer {
  width: calc(100% - 16px);
  margin-left: 16px;
  border-left: 3px solid #ececec;
  background: #fafafa;
}

.layer-row-shell.is-child {
  margin-left: 16px;
}

.layer-row-shell.is-child .child-layer {
  width: 100%;
  margin-left: 0;
}

.alignment-guide {
  position: absolute;
  z-index: 999;
  pointer-events: none;
  background: #1a73e8;
  box-shadow: 0 0 0 1px rgba(26, 115, 232, .18);
}

.alignment-guide.vertical {
  top: 0;
  bottom: 0;
  width: 1px;
}

.alignment-guide.horizontal {
  left: 0;
  right: 0;
  height: 1px;
}

.alignment-guide span {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
}

.marquee-box {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  border: 1px solid #111;
  background: rgba(17, 17, 17, .08);
}

.component-title,
.component-body {
  padding: 10px 4px;
}

.component-title strong {
  display: block;
  font-size: 22px;
}

.component-body {
  color: var(--muted);
  line-height: 1.6;
}

.component-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 18px;
  background: var(--button-bg, #111);
  color: var(--button-color, #fff);
  font-size: var(--button-font-size, 16px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.component-button.secondary {
  background: #fff;
  color: #111;
  border: 1px solid #111;
}

.component-button-image,
.component-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.component-button-image img {
  display: block;
  max-width: 100%;
  border-radius: 14px;
}

.component-icon-button {
  gap: 6px;
  min-height: 44px;
}

.component-icon-button img,
.bottom-nav-preview img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.component-hero {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px solid #d9d9d9;
  border-radius: 24px;
  background: #fafafa;
  color: #808080;
  text-align: center;
}

.component-hero {
  min-height: 320px;
  border-style: solid;
  font-size: 16px;
}

.bottom-nav-preview {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 10px 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #ddd;
}

.bottom-nav-preview span {
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
  font-size: 11px;
}

.bottom-nav-preview small {
  font-size: 11px;
}

.resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #fff;
  cursor: nwse-resize;
}

.transform-handles {
  position: absolute;
  inset: 0;
  z-index: 130;
  pointer-events: none;
}

.transform-handle,
.rotate-handle {
  position: absolute;
  inset: auto;
  width: 12px;
  height: 12px;
  border: 1.5px solid #111;
  border-radius: 50%;
  background: #fff;
  pointer-events: auto;
  touch-action: none;
}

.transform-handle.is-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.transform-handle.is-n { left: calc(50% - 6px); top: -6px; cursor: ns-resize; }
.transform-handle.is-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.transform-handle.is-e { right: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.transform-handle.is-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.transform-handle.is-s { left: calc(50% - 6px); bottom: -6px; cursor: ns-resize; }
.transform-handle.is-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.transform-handle.is-w { left: -6px; top: calc(50% - 6px); cursor: ew-resize; }

.rotate-handle {
  left: calc(50% - 6px);
  top: -32px;
  cursor: grab;
}

.rotate-handle::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 11px;
  width: 1px;
  height: 20px;
  background: #111;
}

.component-frame-resize-handle {
  z-index: 96;
  opacity: .45;
}

.component-delete-handle {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 120;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-size: 17px;
  line-height: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.component-delete-handle:hover {
  transform: scale(1.05);
}

.builder-component:hover > .component-frame-resize-handle,
.builder-component.is-selected > .component-frame-resize-handle {
  opacity: 1;
}

.layer-resize-handle {
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
}

.builder-inspector {
  padding: 18px;
  overflow: auto;
}

.builder-inspector h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

#inspectorHint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.inspector-form {
  display: grid;
  gap: 12px;
}

.inspector-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.image-upload-target-label {
  display: block;
  color: #777;
  font-size: 12px;
  line-height: 1.4;
}

.image-upload-label.is-ready .image-upload-target-label {
  color: #111;
}

.image-upload-label.is-error .image-upload-target-label {
  color: #b42318;
}

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

.inline-check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.carousel-management-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #111;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .06);
}

.carousel-management-panel[hidden] {
  display: none !important;
}

.carousel-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.carousel-panel-head h3,
.carousel-subpanel h4 {
  margin: 0;
  color: #111;
}

.carousel-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.carousel-count-badge {
  flex: none;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #555;
  font-size: 12px;
  white-space: nowrap;
}

.carousel-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.carousel-command-grid button,
.carousel-thumb-actions button {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid #111;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-size: 12px;
}

.carousel-command-grid button:hover,
.carousel-thumb-actions button:hover {
  background: #111;
  color: #fff;
}

.carousel-command-grid .danger,
.carousel-thumb-actions .danger {
  border-color: #f04438;
  color: #b42318;
}

.carousel-field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.carousel-field input,
.carousel-field select,
.carousel-size-grid input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
}

.carousel-subpanel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.carousel-image-status {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cfcfcf;
  border-radius: 14px;
  background: #fafafa;
}

.carousel-image-status h4 {
  margin: 0 0 6px;
  color: #111;
}

.carousel-image-status p {
  margin: 0;
  color: #222;
  font-weight: 700;
}

.carousel-image-status small {
  display: block;
  margin-top: 4px;
  color: #b42318;
}

.carousel-image-status.is-error {
  border-color: #f04438;
  background: #fff7f6;
}

.carousel-size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.carousel-size-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.carousel-subpanel small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.carousel-thumb-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.carousel-thumb {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafafa;
  overflow: hidden;
}

.carousel-thumb.is-active {
  border-color: #111;
  box-shadow: inset 0 0 0 1px #111;
}

.carousel-thumb.is-hidden {
  opacity: .52;
}

.carousel-thumb-main {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  width: 100%;
  gap: 2px 8px;
  align-items: center;
  padding: 8px;
  border: 0;
  background: transparent;
  text-align: left;
}

.carousel-thumb-main img,
.carousel-thumb-main span {
  grid-row: 1 / span 2;
  width: 72px;
  height: 82px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #999;
  font-size: 12px;
}

.carousel-thumb-main b {
  color: #111;
  font-size: 13px;
}

.carousel-thumb-main small {
  color: var(--muted);
  font-size: 12px;
}

.carousel-thumb-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
}

#jsonPreview {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  background: #111;
  color: #f4f4f4;
  border-radius: 12px;
  font-size: 11px;
}

.history-panel {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.history-item {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.floating-tools {
  position: fixed;
  z-index: 20;
  top: 92px;
  right: 24px;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #111;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  align-items: center;
  user-select: none;
  touch-action: none;
}

.floating-tools[hidden] {
  display: none !important;
}

.floating-tools button {
  background: #fff;
  padding: 7px 10px;
  font-size: 12px;
}

.floating-carousel-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  margin-right: 2px;
  border-right: 1px solid rgba(255, 255, 255, .22);
}

.floating-carousel-tools[hidden] {
  display: none !important;
}

.floating-carousel-tools span {
  min-width: 58px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.floating-carousel-tools button {
  border: 1px solid #fff;
  background: #111;
  color: #fff;
}

.floating-carousel-tools button:hover {
  background: #fff;
  color: #111;
}

.floating-tools-drag {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  cursor: grab;
}

.floating-tools.is-dragging .floating-tools-drag {
  cursor: grabbing;
}

.component-text {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  background: rgba(255, 255, 255, .86);
  font-family: var(--builder-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif);
}

.component-text.is-single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.component-text.is-multi-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  align-content: center;
}

.component-text.is-editing {
  outline: 2px solid #111;
  cursor: text;
  user-select: text;
}

.phone-frame.is-placing-component,
.phone-frame.is-placing-component .phone-page {
  cursor: crosshair;
}

.crop-advanced {
  flex-basis: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 8px 10px;
}

.crop-advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.crop-advanced-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, .52);
}

.crop-modal[hidden] {
  display: none;
}

.crop-dialog {
  width: min(520px, 96vw);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.image-target-dialog {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.image-target-choices {
  display: grid;
  gap: 10px;
}

.image-target-choice {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  color: #111;
  cursor: pointer;
}

.image-target-choice strong {
  display: block;
  font-size: 15px;
}

.image-target-choice span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.crop-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.crop-header h2 {
  margin: 0;
  font-size: 18px;
}

.crop-header p,
.crop-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.crop-header button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
}

.crop-canvas-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #f5f5f3;
  border: 1px solid var(--line);
}

#cropCanvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 12px;
  touch-action: none;
  cursor: grab;
}

.crop-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  align-items: end;
  gap: 10px;
}

.crop-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .builder-shell {
    min-height: 100vh;
    height: auto;
  }

  .builder-topbar {
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .builder-brand,
  .builder-select-label,
  .builder-toolbar,
  .layer-toolbar {
    min-width: 0;
    width: 100%;
  }

  .builder-toolbar {
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .builder-toolbar button,
  .builder-toolbar select {
    flex: none;
    white-space: nowrap;
  }

  .builder-workspace {
    display: grid;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .builder-sidebar,
  .builder-stage,
  .builder-inspector {
    min-width: 0;
  }

  .phone-frame-wrap {
    overflow-x: auto;
  }
}
