:root {
  color-scheme: light;
  --bg: #f4f4f6;
  --panel: #ffffff;
  --border: #dfe2eb;
  --text: #1e1b24;
  --muted: #6b6b82;
  --accent: #0d6efd;
  --danger: #c92c38;
  --radius: 14px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  background: #0f172a;
  color: #f8fafc;
  padding: 24px;
}

.header-body {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.9rem;
}

.app-header .subtitle {
  margin: 4px 0 0;
  color: #cbd5f5;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #94a3b8;
}

.outline-link {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  text-decoration: none;
  color: #f8fafc;
  font-weight: 500;
  font-size: 0.95rem;
}

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  display: grid;
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.panel h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.form {
  display: grid;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.field input,
.field select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
}

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

.type-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
  display: none;
}

.type-hint.visible {
  display: block;
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.fieldset legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.privacy-only {
  display: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(13, 110, 253, 0.05);
  margin-bottom: 16px;
}

.privacy-only.visible {
  display: block;
}

.mode-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: none;
}

.hidden-field {
  display: none;
}

.mode-hint.visible {
  display: block;
}

.privacy-only h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.btn {
  border: 1px solid var(--border);
  background: transparent;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.btn.ghost {
  color: var(--text);
  border-color: var(--border);
}

.btn:hover {
  border-color: var(--accent);
}

.preview {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.preview .label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview p {
  margin: 4px 0 0;
  font-weight: 600;
}

.panel textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  font-family: "Fira Code", "JetBrains Mono", monospace;
  font-size: 0.95rem;
  background: #020617;
  color: #f4f4f6;
}

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

@media (max-width: 640px) {
  .header-body {
    flex-direction: column;
  }

  .actions {
    justify-content: center;
  }

  .panel {
    padding: 18px;
  }
}
