:root {
  --bg:          #0d0f14;
  --surface:     #13161f;
  --surface2:    #1c2030;
  --surface3:    #232740;
  --border:      #272c42;
  --border2:     #323859;
  --text:        #e4e8f5;
  --text-muted:  #6b7599;
  --text-dim:    #464e70;
  --accent:      #d40000;
  --accent-h:    #b80000;
  --accent-glow: rgba(212,0,0,0.15);
  --gold:        #e8b84b;
  --green:       #4caf7d;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:        'Courier New', 'Courier', monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
.header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pix-badge {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 3px 7px 2px;
  border-radius: 3px;
}

.show-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text);
}

.tool-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Main layout ── */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  overflow: hidden;
}

/* ── Controls panel ── */
.controls {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}

.controls::-webkit-scrollbar { width: 4px; }
.controls::-webkit-scrollbar-track { background: transparent; }
.controls::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.control-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.label-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
}

.req { color: var(--accent); }

.hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Radio */
.radio-group { display: flex; flex-direction: column; gap: 6px; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-label:hover { border-color: var(--border2); background: var(--surface2); }
.radio-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.radio-label input[type="radio"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pill {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.pill-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Checkboxes */
.checkbox-group { display: flex; flex-direction: column; gap: 5px; }

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.check-label:hover { border-color: var(--border); background: var(--surface2); }
.check-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.check-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.check-box { display: none; }

.check-label span:last-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}

.cta-check .cta-copy {
  font-size: 10px !important;
  font-family: var(--mono);
  letter-spacing: 0 !important;
  font-weight: 400 !important;
  color: var(--text-muted) !important;
  line-height: 1.5;
}

.custom-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.text-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  font-family: var(--font);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.text-input:focus { border-color: var(--accent); }
.text-input::placeholder { color: var(--text-dim); }

.textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 11px;
  font-size: 13px;
  font-family: var(--font);
  width: 100%;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.6;
  min-height: 140px;
}

.textarea:focus { border-color: var(--accent); }
.textarea::placeholder { color: var(--text-dim); }

.controls-footer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.generate-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 13px 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  width: 100%;
}

.generate-btn:hover {
  background: var(--accent-h);
  box-shadow: 0 0 18px var(--accent-glow);
}

.generate-btn:active { transform: scale(0.99); }

.generate-btn:disabled {
  background: var(--surface3);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.error-msg {
  background: rgba(212, 0, 0, 0.08);
  border: 1px solid rgba(212, 0, 0, 0.25);
  color: #f07070;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}

/* ── Output panel ── */
.output-panel {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  gap: 14px;
  overflow: hidden;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

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

.action-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  letter-spacing: 0.04em;
}

.action-btn:hover {
  border-color: var(--border2);
  background: var(--surface3);
}

.action-btn.copied {
  border-color: var(--green);
  color: var(--green);
}

/* Loading */
.loading-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 0;
  flex-shrink: 0;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Output area */
.output-area {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--text);
  overflow-x: hidden;
}

.output-area::-webkit-scrollbar { width: 5px; }
.output-area::-webkit-scrollbar-track { background: transparent; }
.output-area::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.output-placeholder {
  color: var(--text-dim);
  font-family: var(--font);
  font-style: italic;
  font-size: 13px;
  white-space: normal;
}

/* Talent tag highlight in rendered output */
.talent-tag {
  color: var(--gold);
  font-weight: 700;
}

/* Sponsor section hidden in editorial mode */
#sponsor-section.hidden { display: none; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .app { height: auto; overflow: auto; }
  .main { grid-template-columns: 1fr; overflow: visible; }
  .controls {
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    padding-bottom: 0;
  }
  .output-panel { min-height: 60vh; }
  .output-area { min-height: 400px; }
  .controls-footer { position: static; }
}
