/* ============================================================
   research.css — Research Supervisor styles
   ============================================================ */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 0;
  margin-bottom: 2rem;
  flex-wrap: nowrap;
  width: 100%;
}

.nav-back {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  background: rgba(255,255,255,0.10);
  border: 0.5px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  padding: 5px 14px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav-back:hover {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.50);
}

.nav-mode {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}

.research-mode {
  background: rgba(122,184,245,0.15);
  color: #7ab8f5;
  border: 0.5px solid rgba(122,184,245,0.35);
}

.nav-provider {
  font-size: 11px;
  color: rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 3px 10px;
}

.page-header {
  text-align: center;
  padding: 0 1rem 2rem;
}

.page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header h1 span { color: #7ab8f5; }

.page-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.50);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

.header-divider {
  height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(255,255,255,0.08), transparent);
  margin: 0 0 2rem;
}


/* ── Layout ───────────────────────────────────────────────── */
.research-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

.research-left { display: flex; flex-direction: column; gap: 12px; }

.research-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(12px);
}

.research-card-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.50);
  margin-bottom: 0.85rem;
  letter-spacing: 0.04em;
}


/* ── Tool list ────────────────────────────────────────────── */
.tool-list { display: flex; flex-direction: column; gap: 8px; }

.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tool-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(122,184,245,0.25);
}

.tool-item.selected {
  background: rgba(122,184,245,0.10);
  border-color: rgba(122,184,245,0.38);
}

.tool-icon  { font-size: 18px; flex-shrink: 0; }

.tool-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.tool-desc { font-size: 11px; color: rgba(255,255,255,0.40); }


/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 0.85rem; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.40);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-size: 13px;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  outline: none;
  transition: border-color 0.18s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #7ab8f5;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,0.22);
}

.form-group select option { background: #1a1928; color: #ffffff; }

.form-group textarea {
  resize: vertical;
  line-height: 1.6;
}

.hidden { display: none; }


/* ── Research button ──────────────────────────────────────── */
.research-btn {
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  padding: 0.85rem;
  border-radius: 12px;
  border: none;
  background: #185FA5;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease,
              opacity 0.18s ease;
}

.research-btn:hover:not(:disabled) {
  background: #0C447C;
  transform: translateY(-1px);
}

.research-btn:disabled { opacity: 0.40; cursor: not-allowed; }


/* ── Right panel ──────────────────────────────────────────── */
.research-right { display: flex; flex-direction: column; }

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.output-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.30);
}

.copy-btn {
  font-size: 12px;
  font-weight: 500;
  color: #7ab8f5;
  background: rgba(122,184,245,0.10);
  border: 0.5px solid rgba(122,184,245,0.30);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.copy-btn:hover  { background: rgba(122,184,245,0.18); }
.copy-btn.hidden { display: none; }

.output-feed {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  min-height: 560px;
  max-height: 740px;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
  backdrop-filter: blur(12px);
}

.output-feed::-webkit-scrollbar       { width: 4px; }
.output-feed::-webkit-scrollbar-track { background: transparent; }
.output-feed::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 99px;
}

.output-empty {
  text-align: center;
  color: rgba(255,255,255,0.18);
  font-size: 14px;
  padding: 5rem 2rem;
  line-height: 2;
}


/* ── Output blocks ────────────────────────────────────────── */
.output-block {
  margin-bottom: 1.5rem;
  animation: fadeSlideIn 0.22s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.output-block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding: 0 2px;
  color: #7ab8f5;
}

.output-text {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.75;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.output-text p            { margin-bottom: 0.6rem; }
.output-text p:last-child { margin-bottom: 0; }

.output-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.30);
  font-size: 13px;
  padding: 1rem 0;
}

.output-typing-dots { display: flex; gap: 4px; }

.output-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ab8f5;
  animation: typingBounce 1.3s infinite ease-in-out;
}

.output-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.output-typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.35; }
  40%           { transform: translateY(-4px); opacity: 1;    }
}


/* ── Feedback sections ────────────────────────────────────── */
.feedback-section {
  background: rgba(122,184,245,0.06);
  border: 1px solid rgba(122,184,245,0.18);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

.feedback-label {
  font-size: 11px;
  font-weight: 700;
  color: #7ab8f5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.feedback-content {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
  line-height: 1.65;
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 800px) {
  .research-layout { grid-template-columns: 1fr; }
  .output-feed     { min-height: 400px; }
}

@media (max-width: 500px) {
  .page-header h1 { font-size: 26px; }
}

/* ── Prompt refiner ───────────────────────────────────────── */
.refiner-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(122,184,245,0.20);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(12px);
}

.refiner-title {
  font-size: 13px;
  font-weight: 600;
  color: #7ab8f5;
  margin-bottom: 4px;
}

.refiner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.40);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.refiner-card textarea {
  width: 100%;
  font-size: 13px;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color 0.18s ease;
  margin-bottom: 0.65rem;
}

.refiner-card textarea:focus        { border-color: #7ab8f5; }
.refiner-card textarea::placeholder { color: rgba(255,255,255,0.22); }

.refine-btn {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(122,184,245,0.40);
  background: rgba(122,184,245,0.12);
  color: #7ab8f5;
  cursor: pointer;
  transition: all 0.18s ease;
}

.refine-btn:hover:not(:disabled) {
  background: rgba(122,184,245,0.22);
  transform: translateY(-1px);
}

.refine-btn:disabled { opacity: 0.40; cursor: not-allowed; }

.refined-box {
  margin-top: 0.85rem;
  background: rgba(122,184,245,0.06);
  border: 1px solid rgba(122,184,245,0.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  animation: fadeSlideIn 0.22s ease both;
}

.refined-box.hidden { display: none; }

.refined-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7ab8f5;
  margin-bottom: 0.5rem;
}

.refined-text {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.refined-actions { display: flex; gap: 8px; }

.use-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 999px;
  border: none;
  background: #185FA5;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease;
}

.use-btn:hover { background: #0C447C; }

.discard-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.40);
  cursor: pointer;
  transition: all 0.18s ease;
}

.discard-btn:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.30);
}

.clear-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(122,184,245,0.25);
  background: transparent;
  color: #7ab8f5;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-left: auto;
}

.clear-btn:hover {
  background: rgba(122,184,245,0.10);
  border-color: rgba(122,184,245,0.45);
}

/* ── Sub-step navigation ──────────────────────────────────── */
.substep-nav {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 0;
}

.substep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.substep-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.40);
  transition: all 0.18s ease;
}

.substep-label {
  font-size: 10px;
  color: rgba(255,255,255,0.30);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.substep.active .substep-num {
  background: #185FA5;
  border-color: #7ab8f5;
  color: #ffffff;
}

.substep.active .substep-label {
  color: #7ab8f5;
}

.substep.done .substep-num {
  background: rgba(15,110,86,0.30);
  border-color: #6ecfad;
  color: #6ecfad;
}

.substep.done .substep-label {
  color: #6ecfad;
}

.substep:hover .substep-num {
  border-color: rgba(255,255,255,0.35);
  color: #ffffff;
}

.substep-line {
  flex: 1;
  height: 1.5px;
  background: rgba(255,255,255,0.10);
  margin-bottom: 14px;
}

.step-content { animation: fadeSlideIn 0.22s ease both; }
.step-content.hidden { display: none; }

/* ── Code output block ────────────────────────────────────── */
.output-code {
  font-size: 12px;
  font-family: "Fira Code", "Consolas", monospace;
  color: #e2e8f0;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.7;
  white-space: pre;
}

/* ============================================================
   Research page — premium visual upgrade
   ============================================================ */

/* ── Animated background glow ─────────────────────────────── */
.research-layout {
  position: relative;
}

.research-layout::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 60% 40% at 10% 20%,
      rgba(122,184,245,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 90% 70%,
      rgba(110,207,173,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%,
      rgba(168,158,245,0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}


/* ── Page header upgrade ──────────────────────────────────── */
.page-header h1 {
  background: linear-gradient(135deg, #ffffff 0%, #7ab8f5 50%, #6ecfad 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 42px;
  letter-spacing: -0.04em;
}

.page-header h1 span {
  background: linear-gradient(135deg, #7ab8f5 0%, #a89ef5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}


/* ── Research card upgrade ────────────────────────────────── */
.research-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  backdrop-filter: blur(20px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(122,184,245,0.40),
    transparent
  );
}

.research-card:hover {
  border-color: rgba(122,184,245,0.20);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.research-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #7ab8f5;
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ── Tool list upgrade ────────────────────────────────────── */
.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.20s ease;
  position: relative;
  overflow: hidden;
}

.tool-item::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #7ab8f5, #6ecfad);
  opacity: 0;
  transition: opacity 0.20s ease;
  border-radius: 3px 0 0 3px;
}

.tool-item:hover {
  background: rgba(122,184,245,0.08);
  border-color: rgba(122,184,245,0.22);
  transform: translateX(3px);
}

.tool-item:hover::after { opacity: 1; }

.tool-item.selected {
  background: rgba(122,184,245,0.12);
  border-color: rgba(122,184,245,0.40);
}

.tool-item.selected::after { opacity: 1; }

.tool-icon {
  font-size: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(122,184,245,0.30));
}

.tool-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}

.tool-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  line-height: 1.4;
}


/* ── Sub-step nav upgrade ─────────────────────────────────── */
.substep-nav {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.substep-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  transition: all 0.22s ease;
}

.substep-label {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: 3px;
}

.substep.active .substep-num {
  background: linear-gradient(135deg, #185FA5, #3b8bd4);
  border-color: #7ab8f5;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(122,184,245,0.35);
}

.substep.active .substep-label { color: #7ab8f5; }

.substep.done .substep-num {
  background: linear-gradient(135deg, #0F6E56, #1d9e75);
  border-color: #6ecfad;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(110,207,173,0.25);
}

.substep.done .substep-label { color: #6ecfad; }

.substep-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.04)
  );
  margin-bottom: 14px;
}


/* ── Form upgrade ─────────────────────────────────────────── */
.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  font-size: 13px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #ffffff;
  outline: none;
  transition: all 0.20s ease;
  font-family: inherit;
  line-height: 1.6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #7ab8f5;
  background: rgba(122,184,245,0.07);
  box-shadow: 0 0 0 3px rgba(122,184,245,0.10);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,0.18);
}

.form-group select option {
  background: #0f1a2e;
  color: #ffffff;
}

.form-group textarea { resize: vertical; }


/* ── Research button upgrade ──────────────────────────────── */
.research-btn {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  padding: 0.9rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #185FA5 0%, #0e4a8a 100%);
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  transition: all 0.22s ease;
}

.research-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.08),
    transparent
  );
  transition: left 0.5s ease;
}

.research-btn:hover::before { left: 100%; }

.research-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e6fc0 0%, #1254a0 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(24,95,165,0.40);
}

.research-btn:active:not(:disabled) { transform: translateY(0); }
.research-btn:disabled { opacity: 0.35; cursor: not-allowed; }


/* ── Output feed upgrade ──────────────────────────────────── */
.output-feed {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  min-height: 560px;
  max-height: 740px;
  overflow-y: auto;
  padding: 1.75rem;
  scroll-behavior: smooth;
  backdrop-filter: blur(16px);
  position: relative;
}

.output-feed::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(122,184,245,0.25),
    transparent
  );
}

.output-feed::-webkit-scrollbar       { width: 4px; }
.output-feed::-webkit-scrollbar-track { background: transparent; }
.output-feed::-webkit-scrollbar-thumb {
  background: rgba(122,184,245,0.20);
  border-radius: 99px;
}

.output-empty {
  text-align: center;
  color: rgba(255,255,255,0.15);
  font-size: 14px;
  padding: 5rem 2rem;
  line-height: 2.2;
}

.output-empty strong { color: rgba(122,184,245,0.50); }


/* ── Output blocks upgrade ────────────────────────────────── */
.output-block {
  margin-bottom: 1.75rem;
  animation: fadeSlideIn 0.28s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.output-block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  padding: 0 2px;
  color: #7ab8f5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.output-block-label::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background: linear-gradient(to right, #7ab8f5, #6ecfad);
  border-radius: 2px;
}

.output-text {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.80;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.1rem 1.35rem;
  position: relative;
}

.output-text::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, #7ab8f5, transparent);
  border-radius: 2px;
}

.output-text p            { margin-bottom: 0.65rem; }
.output-text p:last-child { margin-bottom: 0; }

.output-code {
  font-size: 12px;
  font-family: "Fira Code", "Consolas", monospace;
  color: #c9d1d9;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(122,184,245,0.12);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  line-height: 1.75;
  white-space: pre;
  position: relative;
}

.output-code::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(122,184,245,0.30),
    rgba(110,207,173,0.20),
    transparent
  );
}


/* ── Typing animation upgrade ─────────────────────────────── */
.output-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  padding: 2rem 0;
  letter-spacing: 0.02em;
}

.output-typing-dots { display: flex; gap: 5px; }

.output-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7ab8f5, #6ecfad);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.output-typing-dots span:nth-child(2) { animation-delay: 0.20s; }
.output-typing-dots span:nth-child(3) { animation-delay: 0.40s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.8); opacity: 0.4; }
  40%           { transform: translateY(-6px) scale(1); opacity: 1;   }
}


/* ── Copy button upgrade ──────────────────────────────────── */
.copy-btn {
  font-size: 12px;
  font-weight: 600;
  color: #7ab8f5;
  background: rgba(122,184,245,0.08);
  border: 0.5px solid rgba(122,184,245,0.25);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.02em;
}

.copy-btn:hover {
  background: rgba(122,184,245,0.16);
  border-color: rgba(122,184,245,0.45);
  transform: translateY(-1px);
}

.copy-btn.hidden { display: none; }

.output-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}


/* ── Refiner card upgrade ─────────────────────────────────── */
.refiner-card {
  background: rgba(122,184,245,0.04);
  border: 1px solid rgba(122,184,245,0.18);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.refiner-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(122,184,245,0.40),
    transparent
  );
}

.refiner-title {
  font-size: 13px;
  font-weight: 700;
  color: #7ab8f5;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.refiner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.refiner-card textarea {
  width: 100%;
  font-size: 13px;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #ffffff;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
  transition: all 0.20s ease;
  margin-bottom: 0.65rem;
}

.refiner-card textarea:focus {
  border-color: #7ab8f5;
  background: rgba(122,184,245,0.07);
  box-shadow: 0 0 0 3px rgba(122,184,245,0.08);
}

.refiner-card textarea::placeholder {
  color: rgba(255,255,255,0.18);
}

.refine-btn {
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(122,184,245,0.35);
  background: rgba(122,184,245,0.10);
  color: #7ab8f5;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.20s ease;
}

.refine-btn:hover:not(:disabled) {
  background: rgba(122,184,245,0.20);
  border-color: rgba(122,184,245,0.55);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(122,184,245,0.15);
}

.refine-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.refined-box {
  margin-top: 0.85rem;
  background: rgba(122,184,245,0.05);
  border: 1px solid rgba(122,184,245,0.20);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  animation: fadeSlideIn 0.22s ease both;
}

.refined-box.hidden { display: none; }

.refined-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7ab8f5;
  margin-bottom: 0.5rem;
}

.refined-text {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.refined-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.use-btn {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #185FA5, #0e4a8a);
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.use-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24,95,165,0.35);
}

.discard-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(255,255,255,0.12);
  background: transparent;
  color: rgba(255,255,255,0.38);
  cursor: pointer;
  transition: all 0.18s ease;
}

.discard-btn:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.28);
}

.clear-btn {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid rgba(122,184,245,0.22);
  background: transparent;
  color: #7ab8f5;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-left: auto;
}

.clear-btn:hover {
  background: rgba(122,184,245,0.10);
  border-color: rgba(122,184,245,0.42);
}


/* ── Implementation mode toggle upgrade ───────────────────── */
.impl-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 4px;
}

.impl-mode-btn {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.38);
  cursor: pointer;
  transition: all 0.20s ease;
  text-align: center;
  letter-spacing: 0.02em;
}

.impl-mode-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.70);
}

.impl-mode-btn.active {
  background: linear-gradient(135deg,
    rgba(24,95,165,0.35),
    rgba(14,74,138,0.25));
  border: 1px solid rgba(122,184,245,0.35);
  color: #7ab8f5;
  box-shadow: 0 2px 8px rgba(24,95,165,0.20);
}


/* ── Feedback section upgrade ─────────────────────────────── */
.feedback-section {
  background: rgba(122,184,245,0.05);
  border: 1px solid rgba(122,184,245,0.15);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.feedback-label {
  font-size: 11px;
  font-weight: 700;
  color: #7ab8f5;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.feedback-content {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
  line-height: 1.65;
}


/* ── Nav upgrade ──────────────────────────────────────────── */
.top-nav {
  padding: 1.5rem 0 0;
  margin-bottom: 2.5rem;
}

.nav-back {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  background: rgba(255,255,255,0.07);
  border: 0.5px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 6px 16px;
  transition: all 0.18s ease;
}

.nav-back:hover {
  background: rgba(255,255,255,0.12);
  transform: translateX(-2px);
}

.research-mode {
  background: rgba(122,184,245,0.12);
  color: #7ab8f5;
  border: 0.5px solid rgba(122,184,245,0.30);
  animation: modePulse 3s ease-in-out infinite;
}

@keyframes modePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122,184,245,0); }
  50%       { box-shadow: 0 0 10px 2px rgba(122,184,245,0.12); }
}

.nav-provider {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.04em;
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 800px) {
  .research-layout    { grid-template-columns: 1fr; }
  .output-feed        { min-height: 400px; }
  .page-header h1     { font-size: 30px; }
}

@media (max-width: 500px) {
  .page-header h1     { font-size: 24px; }
  .substep-label      { display: none; }
}