:root {
  --bg: #0b0b0d;
  --surface: #121216;
  --surface-2: #19191f;
  --ink: #f2f2f2;
  --muted: #9aa0a6;
  --brand: #8a2be2;          /* accent purple */
  --focus: #00ffa7;          /* neon green (still used for toggles) */
  --chip: #21212a;
  --chip-border: #343446;
  --ok: #00c776;
  --danger: #ff4d4f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* --- TOP BAR (Purple line UNDER header + animation) --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  overflow: hidden;
}

.topbar::after {
  content: "";
  display: block;
  width: 0%;
  height: 4px;
  background: var(--brand);
  animation: headerLine 2s ease forwards;
}

@keyframes headerLine {
  from { width: 0%; }
  to { width: 100%; }
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px 10px;
}
.brand__mark { font-weight: 800; letter-spacing: .2px; }
.appname { opacity: .9; font-weight: 500; }
.userbox { opacity: .7; font-size: .95rem; }

/* --- LAYOUT --- */
.shell {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 40px;
  max-width: 1280px;
  margin: 28px auto;
  padding: 0 20px;
}
.panel { min-height: 60vh; }
.h1 { font-size: 1.6rem; margin: 0 0 8px; font-weight: 700; }
.h2 { font-size: 1.1rem; margin: 0; font-weight: 700; }
.lead {
  color: var(--muted);
  margin: 8px 0 18px;
  max-width: 44ch;
}

/* --- SELECT --- */
.group { margin: 20px 0 26px; }
.label {
  display: block;
  margin: 0 0 8px;
  color: #cfd3dc;
  font-weight: 700;
}
.select { position: relative; display: inline-flex; width: 100%; }
select {
  appearance: none;
  width: 100%;
  padding: 14px 44px 14px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius);
  outline: none;
}
.select__chev {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .7;
}

/* --- CARD / UPLOAD --- */
.card {
  background: var(--surface);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__header { padding: 16px 16px 0; }
.card__body { padding: 14px 16px 18px; }
.muted { color: var(--muted); margin: 0 0 12px; }

.dropzone {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  border: 1px dashed #3b3b4e;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s ease;
}
.dropzone:focus { outline: 2px solid var(--brand); }
.dropzone input { display: none; }
.dropzone__icon { font-size: 1.6rem; }
.dropzone__title { font-weight: 600; }
.dropzone__hint { color: var(--muted); font-size: .92rem; }
.filelist { list-style: none; padding: 8px 0 0; margin: 0; }
.filelist li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #242437;
  font-size: .95rem;
}
.filelist li:last-child { border-bottom: none; }
.filelist code { opacity: .8; }

/* --- GRID BLOCKS --- */
.grid { display: grid; gap: 22px; }
.block__title {
  font-size: .95rem;
  letter-spacing: .2px;
  color: #cfd3dc;
  margin-bottom: 10px;
  font-weight: 700;
}

/* --- BUTTON CHIPS (Main report type buttons) --- */
.btnrow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.chip {
  background: var(--chip);
  border: 1px solid var(--chip-border);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .25s ease;
}
.chip--lg { padding: 14px 16px; font-weight: 600; }

/* 🔮 Hover and Active Interactions */
.chip:hover {
  border-color: var(--brand); /* show purple stroke */
  box-shadow: 0 0 8px rgba(138, 43, 226, 0.3);
  transform: translateY(-1px);
}

/* ✅ Active chip — purple stroke + glow */
.chip.is-active {
  outline: 2px solid var(--brand);
  border-color: var(--brand);
  background: linear-gradient(180deg, #20202a, #16161d);
  box-shadow: 0 0 14px rgba(138, 43, 226, 0.6);
  transform: translateY(-1px);
}

/* --- TOGGLES (Focus Areas - keep green style) --- */
.toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.toggle {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--chip-border);
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  transition: all .25s ease;
}
.toggle.is-on {
  background: var(--focus);
  color: #0b0b0d;
  border-color: var(--focus);
  box-shadow: 0 0 12px rgba(0, 255, 167, 0.5);
}
.toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.toggle:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- TEXTAREAS & PROMPT --- */
.textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius);
  padding: 14px;
  resize: vertical;
}
.promptbox {
  background: var(--surface);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius);
}
.promptbox__text {
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 0;
  padding: 14px;
  resize: vertical;
}

/* --- ACTION BUTTONS --- */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
  color: #ffffff;
}

/* 🔁 RE-GENERATE → purple border only */
.btn--ghost {
  background: transparent;
  border: 2px solid var(--brand);
  color: #ffffff;
}
.btn--ghost:hover {
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
  transform: translateY(-1px);
}

/* 📄 CREATE REPORT → solid purple background */
.btn--primary {
  background: var(--brand);
  border: 2px solid var(--brand);
  color: #ffffff;
}
.btn--primary:hover {
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
  transform: translateY(-1px);
}

.btn:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* --- STATUS & FOOTER --- */
.status {
  margin-left: 10px;
  color: var(--muted);
  min-height: 1lh;
}
.foot {
  max-width: 1280px;
  margin: 20px auto 40px;
  padding: 0 20px;
  color: #888;
}

/* --- RESPONSIVE --- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; gap: 24px; }
}

.success-box {
  background: #e9ffe9;
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 10px;
  border: 1px solid #8fda8f;
}

.success-box .link {
  font-weight: 600;
  color: #0058cc;
  text-decoration: none;
}

.success-box .link:hover {
  text-decoration: underline;
}