:root {
  color-scheme: light;
  
  --bg: #f7f8fc;
  --surface: #fff;
  --surface-2: #f0f2f8;
  --text: #171827;
  --muted: #696d7e;
  --line: #dfe2eb;
  
  --text-muted: var(--muted);
  --border: var(--line);
  
  --primary: #6557e8;
  --primary-2: #877bff;
  --success: #12805c;
  --warning: #ad6419;
  --danger: #b43b52;
  --shadow: 0 18px 55px rgba(34, 38, 73, .09);
  --radius: 18px;
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

button,
input,
textarea,
select {
  font: inherit
}

button {
  cursor: pointer
}

a {
  color: inherit
}

.site-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1440px)/2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(101, 87, 232, .27)
}

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

.ghost-button,
.theme-toggle,
.icon-button,
.copy-button,
.primary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 13px;
  font-weight: 700
}

.ghost-button:hover,
.theme-toggle:hover,
.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.theme-toggle,
.icon-button {
  width: 40px;
  padding: 8px
}

.hero {
  text-align: center;
  padding: 70px 20px 48px
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 12px
}

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.03;
  letter-spacing: -.055em;
  margin: 0
}

.hero h1 span {
  background: linear-gradient(90deg, var(--primary), #a65eea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.hero-copy {
  max-width: 730px;
  margin: 22px auto 16px;
  font-size: 18px;
  color: var(--muted)
}

.trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--success);
  font-weight: 700;
  font-size: 13px
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr);
  gap: 24px;
  align-items: start
}

.builder-panel,
.output-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow)
}

.builder-panel {
  overflow: hidden
}

.output-panel {
  padding: 18px;
  position: sticky;
  top: 86px
}

.mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2)
}

.mode-button,
.preview-tab,
.code-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px;
  border-radius: 9px;
  font-weight: 800
}

.mode-button.active,
.preview-tab.active,
.code-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 9px rgba(23, 24, 39, .08)
}

.form-section {
  border-bottom: 1px solid var(--line)
}

.form-section:last-child {
  border: 0
}

.form-section summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  font-weight: 800;
  cursor: pointer
}

.form-section summary::-webkit-details-marker {
  display: none
}

.form-section summary span:first-child {
  display: flex;
  gap: 11px;
  align-items: center
}

.form-section summary b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--primary)
}

.summary-status {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em
}

.section-content {
  padding: 2px 20px 22px
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px
}

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

.field>span:first-child,
.check-grid legend {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted)
}

.field em {
  float: right;
  font-style: normal;
  font-weight: 600
}

.full {
  grid-column: 1/-1
}

.field input,
.field textarea,
.field select,
.dialog-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.dialog-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent)
}

.field textarea {
  resize: vertical
}

.check-grid {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px
}

.check-grid legend {
  padding: 0 6px
}

.check-grid label,
.toggle-field {
  display: flex;
  align-items: flex-start;
  gap: 9px
}

.toggle-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg)
}

.toggle-field input {
  margin-top: 4px;
  accent-color: var(--primary)
}

.toggle-field span {
  display: flex;
  flex-direction: column
}

.toggle-field small {
  color: var(--muted)
}

.conditional-fields,
.schema-extra {
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding-top: 3px
}

.conditional-fields:not(.hidden),
.schema-extra:not(.hidden) {
  display: grid
}

.color-input {
  display: grid !important;
  grid-template-columns: 44px 1fr;
  gap: 8px
}

.color-input input[type=color] {
  padding: 3px;
  height: 43px
}

.preview-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: var(--surface-2);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 15px
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--surface)
}

.google-preview {
  padding: 18px
}

.google-site {
  display: flex;
  gap: 10px;
  align-items: center
}

.google-favicon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  font-weight: 800;
  color: var(--primary)
}

.google-site span:last-child {
  display: flex;
  flex-direction: column
}

.google-site small {
  color: var(--muted)
}

.google-title {
  font-size: 20px;
  color: #1558c0;
  margin: 10px 0 3px
}

.google-preview p {
  margin: 0;
  color: var(--muted)
}

.social-image {
  aspect-ratio: 1200/630;
  background: linear-gradient(135deg, #e8e5ff, #c9c5ff);
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center
}

.social-image span {
  background: rgba(255, 255, 255, .86);
  padding: 5px 8px;
  border-radius: 7px;
  color: #4f4b6b;
  font-weight: 800
}

.social-copy {
  padding: 14px
}

.social-copy small {
  color: var(--muted)
}

.social-copy b {
  display: block;
  font-size: 17px;
  margin: 3px 0
}

.social-copy p {
  margin: 0;
  color: var(--muted)
}

.browser-top {
  padding: 7px 12px;
  background: #6557e8;
  color: #fff;
  display: flex;
  justify-content: space-between;
  font-size: 11px
}

.browser-toolbar {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  gap: 8px;
  padding: 10px;
  background: var(--surface-2);
  align-items: center;
  text-align: center
}

.browser-toolbar div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px
}

.browser-page {
  padding: 28px;
  text-align: center;
  min-height: 150px
}

.audit-summary {
  display: flex;
  gap: 13px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 13px;
  padding: 13px;
  margin: 14px 0
}

.audit-summary>div {
  width: 57px;
  height: 57px;
  border: 5px solid var(--primary);
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center
}

.audit-summary strong {
  font-size: 18px;
  line-height: 1
}

.audit-summary span {
  font-size: 9px;
  color: var(--muted)
}

.audit-summary p {
  display: flex;
  flex-direction: column;
  margin: 0
}

.audit-summary small {
  color: var(--muted)
}

.warnings {
  padding: 0;
  margin: 0 0 14px;
  list-style: none;
  display: grid;
  gap: 7px
}

.warnings li {
  padding: 9px 11px;
  border-radius: 9px;
  background: #fff7e9;
  color: var(--warning);
  font-size: 12px
}

.warnings li.error {
  background: #fff0f2;
  color: var(--danger)
}

.warnings li.success {
  background: #eaf8f2;
  color: var(--success)
}

.code-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden
}

.code-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px;
  background: var(--surface-2)
}

.code-toolbar>div {
  display: flex;
  gap: 5px
}

.copy-button,
.primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary)
}

.copy-button:hover,
.primary-button:hover {
  background: var(--primary-2)
}

pre {
  margin: 0;
  background: #111421;
  color: #dce2ff;
  max-height: 420px;
  overflow: auto;
  padding: 18px;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap
}

footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 25px 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px
}

footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap
}

footer a {
  text-decoration: none
}

footer a:hover {
  color: var(--primary)
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(760px, calc(100% - 30px))
}

dialog::backdrop {
  background: rgba(10, 12, 25, .64);
  backdrop-filter: blur(4px)
}

.dialog-card {
  background: var(--surface);
  color: var(--text);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow)
}

.dialog-header,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 15px
}

.dialog-header h2 {
  margin: 0
}

.dialog-header p {
  margin: 5px 0 17px;
  color: var(--muted)
}

.dialog-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 15px
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #111421;
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 40
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0)
}

.hidden {
  display: none !important
}

body.dark {
  color-scheme: dark;
  --bg: #10121c;
  --surface: #181b28;
  --surface-2: #202433;
  --text: #f1f3ff;
  --muted: #a5aabd;
  --line: #303545;
  --shadow: 0 18px 55px rgba(0, 0, 0, .25)
}

body.dark .google-title {
  color: #8ab4f8
}

body.dark .warnings li {
  background: #382d1c
}

body.dark .warnings li.error {
  background: #3d2028
}

body.dark .warnings li.success {
  background: #17362c
}

@media(max-width:1000px) {
  .app-shell {
    grid-template-columns: 1fr
  }
  
  .output-panel {
    position: static
  }
  
  .hero {
    padding-top: 52px
  }
}

@media(max-width:640px) {
  .site-header {
    padding: 0 15px
  }
  
  .header-actions .ghost-button {
    display: none
  }
  
  .hero {
    padding: 43px 16px 34px
  }
  
  .hero-copy {
    font-size: 16px
  }
  
  .app-shell {
    padding: 0 12px 45px
  }
  
  .two-columns,
  .conditional-fields:not(.hidden),
  .schema-extra:not(.hidden) {
    grid-template-columns: 1fr
  }
  
  .full {
    grid-column: auto
  }
  
  .output-panel {
    padding: 12px
  }
  
  .check-grid {
    grid-template-columns: 1fr
  }
  
  footer {
    flex-direction: column;
    gap: 12px
  }
  
  .form-section summary {
    padding: 16px
  }
  
  .section-content {
    padding-left: 16px;
    padding-right: 16px
  }
}

.legal-page {
  width: min(100% - 44px, 780px);
  margin: 72px auto 96px;
  font-size: 17px;
  line-height: 1.75;
}

.legal-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-page h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.legal-updated {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.legal-page section {
  margin-top: 42px;
}

.legal-page h2 {
  margin: 0 0 14px;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.legal-page p {
  margin: 0 0 18px;
}

.legal-page ul {
  margin: 0 0 22px;
  padding-left: 24px;
}

.legal-page li {
  margin: 7px 0;
  padding-left: 4px;
}

.legal-page a {
  color: var(--primary);
  text-underline-offset: 3px;
}

.legal-page a:hover {
  text-decoration-thickness: 2px;
}

.legal-note {
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.legal-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.tool-link {
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.tool-link:hover {
  background:
    color-mix(in srgb, var(--primary) 10%, transparent);
}

@media (max-width: 600px) {
  .legal-page {
    width: min(100% - 32px, 780px);
    margin-top: 48px;
    font-size: 16px;
  }
  
  .legal-header {
    margin-bottom: 38px;
  }
  
  .legal-page section {
    margin-top: 34px;
  }
  
  .legal-page h2 {
    font-size: 22px;
  }
  
  .legal-navigation {
    flex-direction: column;
  }
}