:root {
  --black: #060607;
  --ink: #12141a;
  --muted: #66707d;
  --line: rgba(10, 12, 16, 0.12);
  --blue: #0a84ff;
  --soft: #f3f6f9;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 390px) 1fr;
  background: #e8edf3;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.editor-panel {
  height: 100vh;
  overflow: auto;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 22px;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 1.65rem;
  line-height: 1;
}

h2 {
  font-size: 0.96rem;
  margin-bottom: 12px;
}

.preview-link,
button,
.import-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  padding: 10px 14px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.secondary,
.import-btn {
  background: var(--white);
  color: var(--ink);
}

.tool-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  padding: 11px 12px;
}

input[type="color"] {
  height: 44px;
  padding: 4px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.hint,
.status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.section-list {
  display: grid;
  gap: 8px;
}

.section-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  cursor: grab;
}

.section-item.dragging {
  opacity: 0.5;
}

.section-item.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.drag-handle {
  color: var(--muted);
  font-weight: 900;
}

.section-name {
  font-weight: 760;
}

.visibility {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.visibility input {
  width: auto;
}

.actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), var(--white) 24%);
  padding: 18px 0 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.import-btn input {
  display: none;
}

.preview-stage {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 18px;
  gap: 14px;
}

.preview-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.preview-bar button {
  background: var(--white);
  color: var(--ink);
}

.preview-bar button.active {
  background: var(--blue);
  color: var(--white);
}

iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 20px 70px rgba(17, 24, 39, 0.18);
  justify-self: center;
  transition: width 180ms ease;
}

iframe.tablet {
  width: 820px;
  max-width: 100%;
}

iframe.mobile {
  width: 390px;
  max-width: 100%;
}

.section-copy-field.hidden {
  display: none;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    height: auto;
    max-height: none;
  }

  .preview-stage {
    min-height: 720px;
  }
}
