:root {
  --bg: #15130e;
  --bg-deep: #0c0a06;
  --surface: #1d1a14;
  --surface-2: #26221a;
  --surface-3: #322d22;
  --border: #3a3527;
  --border-soft: #26221a;
  --text: #f0ebde;
  --text-dim: #a59b84;
  --text-dimmer: #6a6151;
  --accent: #e8a5a5;
  --accent-hot: #d98a8a;
  --accent-glow: rgba(232, 165, 165, 0.18);
  --accent-soft: rgba(232, 165, 165, 0.10);
  --danger: #ef6a4a;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --display-font: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono-font: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  display: block;
  color: var(--bg);
}

.brand-mark svg rect {
  fill: var(--bg);
  fill-opacity: 1;
}

.brand-mark svg rect:last-child {
  fill-opacity: 0.55;
}

.brand-text h1 {
  font-family: var(--display-font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.05;
}

.brand-text h1 span {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.brand-text p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--mono-font);
  letter-spacing: 0.1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coffee-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: var(--radius);
  text-decoration: none;
  transition:
    color 0.15s,
    background 0.15s;
}

.coffee-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.coffee-emoji {
  font-size: 14px;
  line-height: 1;
}

.coffee-link svg {
  display: block;
}

/* ---------------- Buttons (consistent everywhere) ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    transform 0.05s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  color: var(--bg);
}

.btn.primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

.btn .plus {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.btn.primary .plus {
  color: var(--bg);
}

.btn.danger {
  color: var(--danger);
  border-color: transparent;
  background: transparent;
}

.btn.danger:hover {
  background: rgba(214, 93, 93, 0.12);
}

/* ---------------- Layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr 360px;
  flex: 1;
  min-height: 0;
}

.panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-panel {
  border-right: none;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 20px 16px;
  flex-shrink: 0;
  gap: 16px;
}

.panel-head h2 {
  font-family: var(--mono-font);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dimmer);
  font-weight: 500;
  margin-bottom: 6px;
}

.panel-head p {
  margin: 0;
  font-family: var(--display-font);
  font-size: 20px;
  color: var(--text);
  font-weight: 400;
  letter-spacing: -0.3px;
}

.editor-head {
  border-bottom: 1px solid var(--border);
  align-items: center;
}

/* ---------------- Tabs ---------------- */
.tabs {
  display: flex;
  gap: 18px;
  align-items: center;
  align-self: stretch;
  padding-top: 6px;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 2px;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  font-weight: 600;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.tab-pane[hidden] {
  display: none;
}

/* ---------------- Section head (inside panes) ---------------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}

.section-head h3 {
  font-family: var(--mono-font);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dimmer);
  font-weight: 500;
}

.badge {
  font-family: var(--mono-font);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ---------------- Slide list ---------------- */
.slide-list {
  list-style: none;
  margin: 0;
  padding: 6px 14px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slide-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  border: 1px solid transparent;
  background: var(--surface-2);
  user-select: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
  position: relative;
}

.slide-list li:hover {
  background: var(--surface-3);
  border-color: var(--border);
}

.slide-list li.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.slide-list .slide-num {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.slide-list li.active .slide-num {
  background: var(--bg);
  border-color: var(--bg);
  color: var(--accent);
}

.slide-list .slide-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slide-list .slide-title {
  font-size: 13.5px;
  font-weight: 500;
  color: inherit;
  letter-spacing: -0.05px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-list li.active .slide-title {
  font-weight: 600;
}

.slide-list .slide-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.slide-list li:hover .slide-actions,
.slide-list li.active .slide-actions {
  display: flex;
}

.icon-btn {
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.6;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  font-size: 12px;
  font-family: inherit;
  transition:
    background 0.15s,
    opacity 0.15s;
}

.icon-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  opacity: 1;
}

.add-section {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-buttons {
  display: flex;
  gap: 8px;
}

.add-buttons .btn {
  flex: 1;
}

.add-feature-btn {
  width: 100%;
  border-style: dashed;
  background: transparent;
  color: var(--text-dim);
}

.add-feature-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-feature-btn[hidden] {
  display: none;
}

/* ---------------- Canvas area ---------------- */
.canvas-area {
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-direction: column;
}

.canvas-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(240, 235, 222, 0.05) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.canvas-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.stage {
  background: #fff;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transform-origin: center center;
  position: relative;
  border-radius: 6px;
}

.canvas-meta {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-dimmer);
  padding: 10px 0 18px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

/* ---------------- Forms ---------------- */
.form {
  padding: 4px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#theme-pane .form {
  padding-top: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field input[type="text"],
.field input[type="number"],
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  outline: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.field input[type="text"]:hover,
.field input[type="number"]:hover,
.field textarea:hover {
  border-color: var(--surface-3);
}

.field input[type="text"]:focus,
.field input[type="number"]:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
  font-family: inherit;
  letter-spacing: 0;
}

/* ---------------- Custom select with chevron ---------------- */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
  transition: border-color 0.15s;
}

.select-wrap:hover::after {
  border-color: var(--text);
}

.select-wrap select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 38px 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  outline: none;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.select-wrap select:hover {
  border-color: var(--surface-3);
}

.select-wrap select:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------------- Custom font add row ---------------- */
.font-add-row {
  display: flex;
  gap: 8px;
}

.font-add-row input[type="text"] {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.font-add-row input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------------- Color swatches ---------------- */
.swatch-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.swatch-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.swatch-field > span:first-child {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.swatch {
  display: block;
  width: 100%;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.swatch:hover {
  border-color: var(--text-dim);
}

.swatch-field:hover .swatch {
  border-color: var(--text-dim);
}

.swatch input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.swatch input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
  border-radius: 10px;
}

.swatch input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 7px;
}

.swatch input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 7px;
}

/* ---------------- Hint text ---------------- */
.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: -4px;
  line-height: 1.5;
  font-style: italic;
}

.hint code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
  font-style: normal;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--text);
}

.hint a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
}

.hint a:hover {
  text-decoration-color: var(--accent);
}

/* ---------------- Upload slots ---------------- */
.upload-group {
  gap: 10px;
}

.upload-slot {
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.upload-slot:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}

.upload-slot input[type="file"] {
  display: none;
}

.upload-preview {
  width: 44px;
  height: 66px;
  border-radius: 7px;
  background: var(--bg-deep);
  flex-shrink: 0;
  background-size: cover;
  background-position: top;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dimmer);
  position: relative;
  overflow: hidden;
}

.upload-preview::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px dashed currentColor;
  border-radius: 4px;
  opacity: 0.7;
}

.upload-preview[style*="background-image"]::after {
  display: none;
}

.upload-preview.icon-preview {
  width: 50px;
  height: 50px;
  border-radius: 11px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.upload-info {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
  flex: 1;
}

.upload-info strong {
  color: var(--text);
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

/* ---------------- Segmented ---------------- */
.segmented {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.empty-editor {
  padding: 28px 20px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.5;
}

.pane-note {
  margin: 0 0 4px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  font-family: var(--display-font);
  font-style: italic;
  font-weight: 400;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.toast[hidden] {
  display: none;
}

/* ---------------- Slide templates (rendered inside #stage) ----------------
 * The .slide-root wrapper is always rendered at its exact target pixel size
 * (1024×500 or 1080×1920) and then visually scaled by transform: scale() on
 * the parent .stage to fit the preview area. On export we capture .slide-root
 * directly at its native pixel size for a pixel-perfect PNG.
 */
.slide-root {
  position: relative;
  overflow: hidden;
  color: #fff;
}

.slide-root .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* --- Feature graphic (1024 × 500) --- */
.slide-feature {
  width: 1024px;
  height: 500px;
}

.slide-feature .content {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 460px;
  padding: 50px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.slide-feature .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  width: fit-content;
}

.slide-feature .eyebrow.has-icon {
  /* Tighter left padding so the icon hugs the pill edge, like t-minus */
  padding: 5px 14px 5px 5px;
  gap: 10px;
}

.slide-feature .eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.slide-feature .eyebrow-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}

.slide-feature .headline {
  font-family: var(--heading-font);
  font-size: 52px;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.slide-feature .subline {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 30px;
  line-height: 1.5;
  opacity: 0.7;
}

.slide-feature .phones-area {
  position: absolute;
  right: 20px;
  top: 0;
  bottom: 0;
  width: 580px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  padding: 24px 28px 0;
  z-index: 2;
}

.slide-feature .mini-phone {
  border: 2.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  overflow: hidden;
  background: #f9f9f9;
  position: relative;
  flex-shrink: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.slide-feature .mini-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  image-rendering: high-quality;
}

.slide-feature .mini-phone.center {
  width: 172px;
  height: 352px;
  margin-bottom: -14px;
  transform: translate3d(0, 20px, 0);
}

.slide-feature .mini-phone.left {
  width: 142px;
  height: 296px;
  transform: rotate(-6deg) translate3d(0, 36px, 0);
}

.slide-feature .mini-phone.right {
  width: 142px;
  height: 296px;
  transform: rotate(6deg) translate3d(0, 36px, 0);
}

.slide-feature .mini-phone .empty-screen {
  width: 100%;
  height: 100%;
  background: #e8edf5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #999;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* --- Screenshot slides (1080 × 1920) --- */
.slide-screenshot {
  width: 1080px;
  height: 1920px;
}

.slide-screenshot .top-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 580px;
  padding: 120px 80px 0;
  z-index: 1;
}

.slide-screenshot .eyebrow {
  font-family: var(--body-font);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.slide-screenshot .eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.slide-screenshot .headline {
  font-family: var(--heading-font);
  font-size: 100px;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -3px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.slide-screenshot .subline {
  font-size: 34px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.7;
}

/* 1-device layout */
.slide-screenshot.layout-1 .phone-wrapper {
  position: absolute;
  left: 280px;
  top: 650px;
  width: 520px;
  height: 1130px;
  z-index: 2;
}

.slide-screenshot.layout-1 .phone-frame {
  position: absolute;
  inset: 0;
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 52px;
  background: #f9f9f9;
  overflow: hidden;
}

/* 2-device layout */
.slide-screenshot.layout-2 .phones-area {
  position: absolute;
  top: 650px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.slide-screenshot.layout-2 .phone-back,
.slide-screenshot.layout-2 .phone-front {
  position: absolute;
  width: 460px;
  height: 1000px;
}

.slide-screenshot.layout-2 .phone-back {
  left: 130px;
  top: 60px;
  transform: rotate(-5deg);
  z-index: 2;
}

.slide-screenshot.layout-2 .phone-front {
  left: 550px;
  top: 90px;
  transform: rotate(4deg);
  z-index: 3;
}

.slide-screenshot.layout-2 .phone-frame {
  position: absolute;
  inset: 0;
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 48px;
  background: #f9f9f9;
  overflow: hidden;
}

/* shared phone shell pieces */
.slide-screenshot .vol-up,
.slide-screenshot .vol-down,
.slide-screenshot .power {
  position: absolute;
  width: 7px;
  background: rgba(255, 255, 255, 0.8);
}

.slide-screenshot .vol-up {
  left: -8px;
  top: 196px;
  height: 50px;
  border-radius: 4px 0 0 4px;
}

.slide-screenshot .vol-down {
  left: -8px;
  top: 258px;
  height: 50px;
  border-radius: 4px 0 0 4px;
}

.slide-screenshot .power {
  right: -8px;
  top: 236px;
  height: 70px;
  border-radius: 0 4px 4px 0;
}

.slide-screenshot .phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  image-rendering: high-quality;
}

.slide-screenshot .phone-frame .empty-screen {
  width: 100%;
  height: 100%;
  background: #f0f4f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab;
  font-size: 22px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.accent-text {
  color: var(--accent);
}

/* ---------------- Clickable hints inside preview ---------------- */
.stage [data-editable-field],
.stage [data-image-slot] {
  cursor: pointer;
}

.stage [data-image-slot]:hover {
  filter: brightness(1.08);
}

/* ---------------- Responsive: stack panels on small screens ---------------- */
@media (max-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow: auto;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 12px 16px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
  }

  .layout {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
  }

  .panel {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .editor-panel {
    border-left: none;
    border-bottom: none;
    overflow: visible;
  }

  .slide-list {
    max-height: 260px;
    overflow-y: auto;
  }

  .canvas-area {
    min-height: 340px;
  }

  .canvas-wrap {
    padding: 20px;
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 10px 12px;
  }

  .brand-text h1 {
    font-size: 19px;
  }

  .brand-text p {
    font-size: 10.5px;
  }

  .topbar-actions .coffee-link span:last-child {
    display: none;
  }

  .canvas-wrap {
    padding: 14px;
    min-height: 240px;
  }

  .canvas-area {
    min-height: 300px;
  }

  .panel-head {
    padding: 18px 16px 12px;
  }

  .form {
    padding: 4px 16px 20px;
  }

  .swatch-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}
