:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #696963;
  --line: #d9d8d0;
  --paper: #f7f6f1;
  --panel: #ecebe5;
  --white: #ffffff;
  --accent: #22543d;
  --shadow: 0 24px 70px rgba(23, 23, 20, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { min-height: 100vh; }
button, a { font: inherit; }
a { color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
}

.offer-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px clamp(20px, 2.2vw, 32px) 22px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.brand-row { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(34, 84, 61, 0.09);
}

.offer-copy { margin-top: clamp(6px, 2vh, 20px); }
.eyebrow,
.offer-kicker {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.offer-copy h1,
.error-state h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3.25vw, 50px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.045em;
}
.description {
  max-width: 32rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.offer-box {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.offer-box h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.03em;
}
.offer-intro {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.included-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.included-list li {
  position: relative;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.4;
}
.included-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 800;
}
.next-step {
  margin: 14px 0 0;
  padding: 11px 13px;
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  line-height: 1.45;
}
.disclosure {
  margin: 2px 0 0;
  color: #85847e;
  font-size: 10px;
  line-height: 1.45;
}

.preview-panel {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--panel);
}
.toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 241, 0.96);
}
.device-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}
.device-button {
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.device-button:hover { color: var(--ink); }
.device-button:focus-visible,
.open-direct:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.device-button.is-active {
  background: var(--ink);
  color: var(--white);
}
.device-icon { margin-right: 4px; font-size: 14px; line-height: 0; }
.device-icon-mobile { font-size: 16px; }
.toolbar-meta { display: flex; align-items: center; gap: 16px; }
.viewport-label { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.open-direct { font-size: 12px; font-weight: 700; text-decoration: none; }
.open-direct:hover { text-decoration: underline; text-underline-offset: 3px; }

.stage {
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(14px, 2vw, 26px);
}
.device-shell {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: width 180ms ease, height 180ms ease;
}
.device-shell[data-device="mobile"] {
  border: 10px solid #1c1c1a;
  border-radius: 28px;
  background: #1c1c1a;
}
#preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border: 0;
  background: var(--white);
  transform-origin: top left;
}
.device-shell[data-device="mobile"] #preview-frame {
  border-radius: 18px;
}

.frame-fallback {
  margin: 0 24px 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}
.frame-fallback p { display: inline; margin: 0 6px 0 0; }
.frame-fallback a { font-weight: 700; }

.error-state {
  max-width: 720px;
  margin: 12vh auto;
  padding: 32px;
}
.error-state p:last-child { color: var(--muted); line-height: 1.6; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .offer-panel { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .offer-copy { margin-top: 12px; }
  .offer-copy h1 { max-width: 13ch; font-size: clamp(38px, 11vw, 58px); }
  .disclosure { margin-top: 6px; }
  .preview-panel { min-height: 760px; }
}

@media (max-width: 560px) {
  .offer-panel { padding: 20px; gap: 18px; }
  .toolbar { align-items: flex-start; padding: 10px 12px; }
  .toolbar-meta { align-items: flex-end; flex-direction: column; gap: 4px; }
  .viewport-label { display: none; }
  .open-direct { font-size: 11px; }
  .device-button { padding-inline: 9px; }
  .stage { padding: 16px 10px 24px; }
}

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