:root {
  --bg: #edf2f7;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(15, 23, 42, 0.1);
  --text: #16212f;
  --muted: #64748b;
  --shadow: 0 28px 60px -28px rgba(15, 23, 42, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.14), transparent 22%),
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 20%),
    linear-gradient(180deg, #eef3f8 0%, #f8fafc 100%);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1600px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
}

.controls,
.preview-zone,
.panel,
.browser-frame,
.phone-frame {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
}

.controls,
.preview-zone {
  border-radius: 28px;
  overflow: hidden;
}

.controls {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.controls-head,
.panel {
  padding: 18px;
  border-radius: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: #7c4a2b;
}

.controls-head h1,
.toolbar h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 0.95;
  font-family: "Iowan Old Style", "Georgia", serif;
}

.controls-head p,
.field label,
.browser-url,
.site-meta,
.app-subtext {
  color: var(--muted);
}

.field-grid,
.template-grid,
.preview-grid,
.button-stack {
  display: grid;
  gap: 12px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.template-grid {
  grid-template-columns: 1fr 1fr;
}

.template-option {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  cursor: pointer;
  text-align: left;
}

.template-option.is-active {
  outline: 2px solid var(--theme-primary, #123c52);
  background: linear-gradient(180deg, rgba(18, 60, 82, 0.08), rgba(255, 255, 255, 0.95));
}

.template-option strong {
  display: block;
  margin-bottom: 6px;
}

.template-option span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.cta-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
}

.cta-button {
  background: linear-gradient(145deg, #123c52, #0a2432);
  color: white;
}

.ghost-button {
  background: #fff;
  color: #123c52;
  border: 1px solid rgba(18, 60, 82, 0.18);
}

.preview-zone {
  padding: 18px;
  display: grid;
  gap: 18px;
}

.impact-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.impact-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,252,0.95) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.32);
}

.impact-card strong {
  display: block;
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.toolbar {
  padding: 8px 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.toolbar-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 60, 82, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
  color: #123c52;
}

.preview-grid {
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
}

.browser-frame,
.phone-frame {
  border-radius: 28px;
  overflow: hidden;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.98);
}

.browser-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d1d5db;
}

.browser-url {
  margin-left: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.site-preview,
.app-preview {
  padding: 22px;
}

.phone-frame {
  padding: 16px 14px;
  background: linear-gradient(180deg, #141d27 0%, #0f1720 100%);
}

.phone-notch {
  width: 120px;
  height: 18px;
  border-radius: 999px;
  background: #0a0f14;
  margin: 0 auto 12px;
}

.app-preview {
  min-height: 740px;
  border-radius: 34px;
  background: white;
}

.site-shell,
.app-shell {
  border-radius: var(--radius, 20px);
  overflow: hidden;
  background: var(--surface, #fff);
  color: var(--theme-text, #1f2937);
  box-shadow: 0 18px 40px -30px rgba(15, 23, 42, 0.4);
}

.site-hero {
  padding: var(--space-xl, 36px);
  background: var(--hero-bg, linear-gradient(135deg, #123c52 0%, #305f77 100%));
  color: white;
  position: relative;
}

.site-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.site-brand {
  font-family: var(--display-font, "Iowan Old Style", serif);
  font-size: 2.8rem;
  line-height: 0.95;
  margin: 0 0 10px;
}

.site-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40px auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 65%);
  pointer-events: none;
}

.site-nav,
.quick-grid,
.news-grid,
.app-grid {
  display: grid;
  gap: 14px;
}

.site-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 24px;
}

.nav-item,
.quick-card,
.news-card,
.app-card {
  border-radius: calc(var(--radius, 20px) - 6px);
  padding: 16px;
  background: var(--card-bg, rgba(255, 255, 255, 0.16));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.12));
}

.news-card {
  min-height: 190px;
  display: grid;
  align-content: end;
  background:
    linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.55) 100%),
    var(--news-bg, linear-gradient(135deg, rgba(18,60,82,0.55) 0%, rgba(232,161,74,0.4) 100%));
  color: white;
}

.news-card p {
  margin: 6px 0 0;
  color: rgba(255,255,255,0.82);
}

.site-content {
  padding: var(--space-lg, 28px);
  display: grid;
  gap: 18px;
}

.quick-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.news-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-section-title,
.app-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 800;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-button,
.app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  border: 0;
  background: var(--button-bg, #fff);
  color: var(--button-text, #123c52);
}

.app-header {
  padding: 24px 24px 16px;
  background: var(--hero-bg, linear-gradient(135deg, #123c52 0%, #305f77 100%));
  color: white;
  position: relative;
}

.app-header::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 18px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.24) 0%, transparent 68%);
}

.app-grid {
  grid-template-columns: 1fr 1fr;
  padding: 18px;
}

.app-card {
  background: var(--app-card-bg, rgba(18, 60, 82, 0.08));
  border-color: rgba(18, 60, 82, 0.1);
}

.app-footer {
  margin: 0 18px 18px;
  padding: 16px;
  border-radius: calc(var(--radius, 20px) - 6px);
  background: var(--surface-alt, #f8fafc);
}

@media (max-width: 1220px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
    max-height: none;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .impact-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .field-grid,
  .template-grid,
  .quick-grid,
  .news-grid,
  .site-nav,
  .app-grid {
    grid-template-columns: 1fr;
  }
}
