:root {
  --bg: #03050b;
  --panel: #070a12;
  --panel-2: #0a0f18;
  --border: rgba(255,255,255,0.08);
  --text: #eef2fb;
  --muted: #7f879a;
  --gold: #d4ae05;
  --green: #22e17d;
  --danger: #ff5d5d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #07101e 0%, var(--bg) 26%, #02040a 100%);
  color: var(--text);
  font-family: Inter, sans-serif;
}
.shell { max-width: 1120px; margin: 0 auto; padding: 22px 26px 60px; }
.hero { text-align: center; padding: 10px 0 34px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(212,174,5,0.22); color: var(--gold);
  border-radius: 999px; padding: 14px 24px; font-family: 'IBM Plex Mono', monospace; letter-spacing: .09em; background: rgba(212,174,5,0.08);
}
.hero h1 { margin: 26px 0 10px; font-size: 86px; font-weight: 700; line-height: 1; }
.hero .serif { font-family: 'Playfair Display', serif; font-weight: 600; }
.hero .gold { color: var(--gold); }
.hero p { margin: 0; color: #cfd4df; font-size: 20px; }
.panel {
  background: linear-gradient(180deg, rgba(10,14,24,0.9), rgba(5,8,14,0.96));
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 28px 30px;
  margin-top: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22) inset;
}
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.section-title.mono, .accordion-header span:first-child { font-family: 'IBM Plex Mono', monospace; letter-spacing: .12em; color: #8d93a8; text-transform: uppercase; }
.section-copy, .helper { color: var(--muted); line-height: 1.6; margin-top: 0; }
.helper.compact { margin-top: 8px; margin-bottom: 0; font-size: 13px; }
.field-grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: 2fr 1fr 1fr; }
.field-group label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
input[type="date"], input[type="text"], input[type="time"], textarea, select {
  width: 100%; background: #05070d; color: var(--text); border: 1px solid var(--border); border-radius: 16px;
  min-height: 56px; padding: 16px 18px; font-size: 16px;
}
textarea { min-height: 110px; resize: vertical; }
input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.92;
  filter: invert(96%) sepia(8%) saturate(223%) hue-rotate(181deg) brightness(110%) contrast(92%);
  cursor: pointer;
}
input[type="date"]::-webkit-date-and-time-value { color: var(--text); }

input[type="file"] { color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.status-row { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.status-text.ok { color: var(--green); }
.status-text.error { color: var(--danger); }
.secondary-btn, .skip-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 14px; padding: 12px 16px; cursor:pointer;
}
.skip-btn { padding: 8px 12px; font-size: 13px; color: var(--gold); border-color: rgba(212,174,5,0.25); }
.skip-btn:hover { background: rgba(212,174,5,0.08); }
.chip-row { display:flex; flex-wrap:wrap; gap:10px; margin-top: 16px; }
.chip {
  background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; padding: 12px 16px; cursor:pointer; font-family: 'IBM Plex Mono', monospace;
}
.chip.active { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.budget-grid, .viz-grid { display:grid; gap:16px; }
.budget-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.budget-card {
  position:relative; min-height: 180px; border-radius: 22px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text); padding: 24px; text-align:center; cursor:pointer;
}
.budget-card.selected { border-color: var(--gold); background: linear-gradient(180deg, rgba(212,174,5,0.12), rgba(212,174,5,0.04)); }
.budget-card strong { display:block; font-size: 28px; color:#fff; margin-bottom: 10px; }
.budget-card span { display:block; letter-spacing: .12em; color: var(--muted); font-size: 12px; }
.budget-card small { display:block; margin-top: 18px; color: var(--muted); line-height: 1.5; font-size: 18px; }
.budget-card em { position:absolute; top:14px; right:14px; background: var(--gold); color:#111; font-style:normal; font-weight: 800; padding: 8px 10px; border-radius: 12px; font-size: 12px; }
.tags { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.tag { background: rgba(212,174,5,0.12); color: var(--gold); border:1px solid rgba(212,174,5,0.3); padding:8px 12px; border-radius:999px; }
.viz-grid { grid-template-columns: repeat(3, minmax(0,1fr)); margin-bottom: 18px; align-items: stretch; }
.viz-card { display:block; min-width:0; overflow:hidden; border:1px solid var(--border); border-radius: 22px; padding: 16px; background: var(--panel); }
.viz-canvas-wrap { position: relative; width: 100%; height: 170px; }
.viz-image-wrap { position: relative; width: 100%; height: 170px; }
.viz-image-wrap img { display:block; width:100%; height:100%; object-fit:cover; border-radius: 14px; }
.viz-card canvas { display:block; width:100% !important; height:100% !important; max-width:100%; }
.viz-card.selected { border-color: var(--border); }
.viz-card.static { cursor: default; }
.static-viz-grid .viz-card { box-shadow:none; }
.viz-copy { margin-bottom: 16px; }
.viz-card input { display:none; }
.viz-card strong { display:block; font-size: 18px; margin-top: 10px; }
.viz-card span { display:block; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.cta-wrap { text-align:center; padding: 18px 0 8px; }
.generate-btn {
  min-width: 290px; min-height: 78px; border:none; border-radius: 999px; background: var(--gold); color:#111; font-size: 24px; font-weight: 800; cursor:pointer;
}
.generate-btn.loading { background: #181203; color: #f0d769; }
.plan-label { font-family: 'IBM Plex Mono', monospace; color: var(--muted); margin-top: 18px; font-size: 14px; }
.pipeline-subtitle { text-align:center; color: var(--muted); font-family: 'IBM Plex Mono', monospace; margin-bottom: 24px; }
.pipeline-item { display:grid; grid-template-columns: 20px 1fr auto; gap:14px; align-items:center; padding: 22px 18px; border-top: 1px solid rgba(255,255,255,0.05); }
.pipeline-item:first-child { border-top:none; }
.pipeline-dot { width:12px; height:12px; border-radius:50%; border:2px solid #6d7286; }
.pipeline-item.done .pipeline-dot { background: var(--green); border-color: var(--green); }
.pipeline-item.active { background: rgba(212,174,5,0.08); }
.pipeline-item.active .pipeline-dot { background: var(--gold); border-color: var(--gold); }
.pipeline-item.skipped .pipeline-dot { background: #79703c; border-color: #a1902c; }
.pipeline-item h4 { margin:0 0 6px; font-size: 18px; }
.pipeline-item p { margin:0; color: var(--muted); }
.pipeline-side { display:flex; align-items:flex-end; gap:10px; flex-direction:column; }
.pipeline-meta { color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.pipeline-item.done .pipeline-meta { color: var(--green); }
.pipeline-item.active .pipeline-meta { color: var(--gold); }
.pipeline-item.skipped .pipeline-meta { color: #b6a95f; }
.budget-progress-row { display:grid; grid-template-columns: auto 1fr auto; gap:16px; align-items:center; margin-top: 22px; padding-top: 18px; border-top:1px solid rgba(255,255,255,0.05); }
.budget-progress { height:10px; background:#111522; border-radius:999px; overflow:hidden; }
#budgetBar { width:0%; height:100%; background: var(--gold); }
.accordion .accordion-content { display:none; margin-top: 18px; }
.accordion.open .accordion-content { display:block; }
.accordion-header { width:100%; display:flex; align-items:center; justify-content:space-between; background:none; border:none; color:inherit; padding:0; cursor:pointer; }
.chevron { color: var(--muted); }
.simple-list { display:grid; gap:12px; }
.list-item { border:1px solid var(--border); border-radius:16px; padding:14px 16px; display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.list-item strong { display:block; margin-bottom:4px; }
.list-item small { color: var(--muted); line-height:1.5; }
.empty-state { color: var(--muted); }
.hidden, .modal-backdrop.hidden { display:none !important; }

.hero-meta { display:flex; align-items:center; gap:12px; justify-content:center; margin: 12px 0 6px; flex-wrap:wrap; }
.build-badge, .connection-badge { font-family: "IBM Plex Mono", monospace; font-size: 13px; letter-spacing: 0.08em; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.02); color: var(--muted); }
.connection-badge.ok { color: var(--green); border-color: rgba(24,231,127,0.24); background: rgba(24,231,127,0.06); }
.connection-badge.error { color: #ff6b6b; border-color: rgba(255,107,107,0.24); background: rgba(255,107,107,0.06); }
.skip-btn { appearance:none; border:1px solid rgba(212,174,5,0.28); background: rgba(212,174,5,0.08); color: var(--gold); border-radius: 999px; padding: 7px 12px; font-family: "IBM Plex Mono", monospace; font-size: 12px; cursor:pointer; }
.skip-btn:hover { background: rgba(212,174,5,0.14); }
.skip-btn:disabled { opacity: 0.45; cursor:not-allowed; }

@media (max-width: 860px) {
  .hero h1 { font-size: 56px; }
  .two-col, .three-col, .budget-grid, .viz-grid { grid-template-columns: 1fr; }
  .pipeline-item { grid-template-columns: 20px 1fr; }
  .pipeline-side { grid-column: 2; align-items:flex-start; }
}


.draft-item { align-items: stretch; }
.draft-actions-wrap { display:flex; flex-direction:column; align-items:flex-end; gap:12px; min-width:280px; }
.draft-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.small-btn { padding:10px 12px; font-size:13px; text-decoration:none; display:inline-flex; align-items:center; }
.draft-preview { margin-top:18px; border:1px solid var(--border); border-radius:20px; padding:16px; background: rgba(255,255,255,0.02); }
.draft-preview-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.draft-preview-actions { display:flex; gap:8px; flex-wrap:wrap; }
#draftPreviewFrame { width:100%; min-height:900px; border:1px solid var(--border); border-radius:16px; background:#fff; }
@media (max-width: 860px) {
  .draft-actions-wrap { min-width:0; align-items:flex-start; }
  .draft-actions { justify-content:flex-start; }
  #draftPreviewFrame { min-height:720px; }
}


.api-grid { align-items: start; }
.voice-row { display:flex; gap:10px; flex-wrap:wrap; }
.voice-btn { appearance:none; border:1px solid var(--border); background: rgba(255,255,255,0.02); color: var(--text); border-radius: 999px; padding: 12px 18px; font-family: "IBM Plex Mono", monospace; cursor:pointer; }
.voice-btn.active { border-color: rgba(212,174,5,0.34); background: rgba(212,174,5,0.12); color: var(--gold); }

#latestDraftFrame { width:100%; min-height:900px; border:1px solid var(--border); border-radius:16px; background:#fff; }
#latestDraftSection .section-copy { margin-bottom:14px; }
@media (max-width: 860px) { #latestDraftFrame { min-height:720px; } }

.generate-btn.compact {
  min-width: 100%;
  min-height: 58px;
  font-size: 20px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 10, 0.76);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.access-modal {
  width: min(520px, 100%);
  background: linear-gradient(180deg, rgba(11,15,25,0.98), rgba(7,10,18,0.98));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 28px 24px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.modal-eyebrow {
  margin: 0 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.access-modal h2 {
  margin: 0 0 10px;
  font-size: 32px;
}
.modal-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}
.access-form {
  display: grid;
  gap: 12px;
}
.modal-error {
  color: #ff8686;
  margin: 0;
}
.modal-input {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 0 16px;
  font-size: 18px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.01);
}
.modal-input:focus {
  border-color: rgba(212,174,5,0.38);
  box-shadow: 0 0 0 4px rgba(212,174,5,0.08);
}
.modal-link-row {
  margin: 16px 0 0;
  text-align: center;
}
.modal-link-row a {
  color: var(--gold);
  text-decoration: underline;
}
.modal-link-row a.disabled-link {
  color: var(--muted);
  pointer-events: none;
  text-decoration: none;
}


.text-link-btn { appearance:none; background:none; border:none; color: var(--gold); padding:0; margin-top:8px; font: inherit; cursor:pointer; text-decoration: underline; text-align:left; }
.text-link-btn:hover { opacity:0.88; }
.voice-helper { font-weight:600; color: var(--text); }
#generationSummarySection .section-copy { margin-bottom: 14px; }
.generation-summary { display:grid; gap:16px; }
.summary-card { border:1px solid var(--border); border-radius:18px; padding:16px 18px; background: rgba(255,255,255,0.02); }
.summary-card h4 { margin:0 0 10px; font-size:16px; }
.summary-card ul { margin:0; padding-left: 18px; color: var(--muted); line-height:1.65; }
.summary-card li + li { margin-top:6px; }
.summary-card a { color: var(--gold); text-decoration: underline; }
#progressStatus { min-height: 20px; color: var(--muted); }
#progressStatus.syncing { color: var(--muted); }
#trainingDataGroup.hidden + .field-group { grid-column:auto; }
