:root {
  --bg: #080a0f;
  --panel: rgba(20, 24, 34, 0.72);
  --panel-strong: rgba(27, 32, 44, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f7fb;
  --muted: #aab0c0;
  --soft: #d7dbee;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 15% 12%, rgba(125, 211, 252, 0.14), transparent 30%),
    radial-gradient(circle at 85% 8%, rgba(245, 198, 120, 0.1), transparent 26%),
    linear-gradient(135deg, #080a0f 0%, #111723 48%, #090b12 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 20px 22px 22px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 18px 0 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.05rem;
}

.hero p:last-child {
  max-width: 690px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-badge {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 170px;
}

.hero-badge span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
}

.hidden {
  display: none;
}

.button-row,
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.button,
.preset-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover,
.preset-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(125, 211, 252, 0.42);
  color: #03131c;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.button.secondary {
  background: rgba(125, 211, 252, 0.1);
}

.button.compact {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.preset-bar {
  margin: 0 0 16px;
}

.preset-button {
  flex: 1 1 145px;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--soft);
  font-size: 0.88rem;
}

.controls-grid {
  display: grid;
  gap: 13px;
}

.field,
.segmented-field,
.checkbox-field {
  min-width: 0;
}

.field span,
legend {
  display: block;
  margin: 0 0 7px;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 850;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 38px 0 12px;
  color: var(--text);
  background: var(--panel-strong);
}

select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.72);
  outline-offset: 2px;
}

fieldset {
  margin: 0;
  border: 0;
  padding: 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.segmented-control label {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control input:checked + span {
  color: #03131c;
  background: var(--accent);
}

.segmented-control span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transition: background 150ms ease, color 150ms ease;
}

.checkbox-field {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.checkbox-field legend {
  margin-bottom: 8px;
}

.checkbox-field label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--soft);
  line-height: 1.35;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

#promptOutput {
  width: 100%;
  min-height: 430px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: #f8fafc;
  background: rgba(3, 7, 18, 0.72);
  line-height: 1.55;
}

.copy-status {
  min-height: 22px;
  margin: 9px 0 0;
  color: var(--accent);
  font-size: 0.9rem;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 26px 32px 32px;
  }

  .hero-badge {
    display: flex;
  }

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

  .checkbox-field {
    grid-column: 1 / -1;
  }

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

  .checkbox-field legend {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1020px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 12px;
  }

  .hero {
    padding: 10px 0 14px;
  }

  .hero p:last-child {
    margin-top: 10px;
  }

  .panel {
    padding: 13px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .button,
  .preset-button {
    width: 100%;
  }

  .button-row {
    display: grid;
  }
}
