:root {
  --bg: #0c0e12;
  --surface: #151820;
  --surface-2: #1b1f29;
  --surface-3: #222735;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --accent: #ff7a18;
  --accent-2: #ff9a4d;
  --success: #b4e414;
  --danger: #ff6b6b;
  --radius: 18px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(255, 122, 24, 0.12), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 0%, rgba(80, 120, 255, 0.06), transparent 45%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.back,
.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

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

.back svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.brand-inline .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 14px rgba(255, 122, 24, 0.55);
}

.hero {
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero p {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 14px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.form-grid {
  display: grid;
  gap: 10px;
}

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

.field label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f131b;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.4;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(255, 122, 24, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.12);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

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

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

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

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  height: 42px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #ff922e, var(--accent));
  color: #1a0d00;
  box-shadow: 0 10px 24px rgba(255, 122, 24, 0.25);
}

.btn-soft {
  background: #f4f6fb;
  color: #11151d;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.preview-shell {
  border-radius: 12px;
  background:
    linear-gradient(45deg, #2a2f3a 25%, transparent 25%),
    linear-gradient(-45deg, #2a2f3a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2f3a 75%),
    linear-gradient(-45deg, transparent 75%, #2a2f3a 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-color: #1a1e27;
  padding: 18px;
  overflow: auto;
  min-height: 280px;
  display: grid;
  place-items: center;
}

.preview-shell.solid {
  background: #0f131b;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.status-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #1b2330;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
}

.status-toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 1180px);
  }
}
