* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6fb;
  color: #222;
  line-height: 1.6;
}
.container {
  max-width: 900px;
  margin: 20px auto;
  padding: 0;
  background: transparent;
}

/* ---------- Header / Banner ------------------------------------------ */
.promo-banner {
  position: relative;
  overflow: hidden;
  background: #2d6cdf;
  color: #fff;
  text-align: center;
  padding: 38px 24px 30px;
  border-radius: 18px;
  margin-bottom: 24px;
  box-shadow:
    0 10px 30px rgba(45,108,223,.25),
    0 2px 6px rgba(45,108,223,.15);
}
.promo-banner::after {
  /* Subtle inner highlight on the top edge so the banner reads as glossy. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  padding: 4px;
  box-shadow:
    0 4px 12px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.25);
}
.promo-banner h1 {
  margin: 0;
  font-size: 2.4em;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.promo-sub {
  margin: 6px 0 0;
  font-size: 1.15em;
  font-weight: 400;
  opacity: .9;
}
.banner-links {
  margin-top: 14px;
  display: inline-flex;
  gap: 8px;
}
.gh-link {
  display: inline-block;
  padding: 6px 18px;
  min-width: 92px;
  text-align: center;
  font-size: .8em;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  text-decoration: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.gh-link:hover {
  background: rgba(255,255,255,.28);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

/* ---------- Sections ------------------------------------------------- */
.section-title {
  font-size: .85em;
  font-weight: 700;
  color: #333;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

/* ---------- How it works (legacy, currently unused) ------------------ */
.how-it-works {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
}
.steps li {
  background: #f7f8fc;
  border: 1px solid #e8ecf4;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #2d6cdf;
  color: #fff;
  font-weight: 700;
  font-size: .85em;
}
.step-label { font-weight: 700; color: #1f2a44; font-size: .95em; }
.step-desc { font-size: .85em; color: #5a6a8a; line-height: 1.4; }
@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------- Form section --------------------------------------------- */
.form-section {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow:
    0 1px 3px rgba(31,42,68,.04),
    0 10px 30px rgba(31,42,68,.06);
  border: 1px solid #eef1f7;
}
label { display: block; margin: 0 0 18px; font-weight: 600; font-size: .92em; color: #333; }
input, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  font: inherit;
  font-size: .95em;
  border: 1px solid #d4d9e4;
  border-radius: 9px;
  background: #fafbfd;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 4px rgba(45,108,223,.15);
  background: #fff;
}
textarea { resize: vertical; }

/* File input — render as a soft dropzone */
input[type="file"] {
  padding: 18px 14px;
  border: 1.5px dashed #c4cce0;
  background: #f7f9fd;
  cursor: pointer;
  text-align: center;
  font-size: .9em;
  color: #4b5b7a;
}
input[type="file"]:hover {
  border-color: #2d6cdf;
  background: #eef4ff;
}

button[type="submit"] {
  display: block;
  width: 100%;
  background: #2d6cdf;
  color: #fff;
  border: 0;
  padding: 13px 20px;
  border-radius: 11px;
  font: inherit;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(45,108,223,.28);
  transition: transform .12s, box-shadow .15s, opacity .15s, background .15s;
  margin-top: 4px;
}
button[type="submit"]:hover {
  background: #2761c8;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(45,108,223,.34);
}
button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(45,108,223,.24);
}
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.submit-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: .82em;
  font-weight: 400;
  color: #7a8aa5;
}

code {
  background: #f0f0f3;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
  word-break: break-all;
}

/* ---------- Feature tabs --------------------------------------------- */
.feature-label {
  margin: 0 0 6px;
}
.feature-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.feature-stage:last-of-type {
  margin-bottom: 16px;
}
.feature-stage-tag {
  flex: none;
  min-width: 70px;
  padding: 6px 12px;
  background: #8fc9a3;
  color: #fff;
  font-size: .68em;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  border-radius: 999px;
  white-space: nowrap;
  user-select: none;
  box-shadow: 0 2px 6px rgba(143,201,163,.22);
}
/* Three stages share a green palette, light → dark, signalling progression
   through the research workflow. Same hue (~145°), increasing depth.
   NOTE on selectors: nth-of-type counts by tag among siblings, and the form
   has a leading <div class="field-label"> before the three .feature-stage
   divs — so the three stages are the 2nd/3rd/4th divs in the form. */
.feature-stage:nth-of-type(3) .feature-stage-tag {
  background: #4a9b6e;
  box-shadow: 0 2px 6px rgba(74,155,110,.22);
}
.feature-stage:nth-of-type(4) .feature-stage-tag {
  background: #1d6b41;
  box-shadow: 0 2px 6px rgba(29,107,65,.25);
}
.feature-stage .feature-tabs {
  flex: 1;
  margin: 0;
}
.feature-tabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0 0 16px;
  background: #f0f2f7;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid #e3e8f3;
}
.feature-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 6px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: .82em;
  color: #5a6a8a;
  margin: 0;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s, transform .1s;
}
.feature-tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.feature-tab:hover {
  background: rgba(255,255,255,.85);
  color: #1f2a44;
}
.feature-tab.selected {
  background: #fff;
  color: #1f3d7a;
  box-shadow:
    0 2px 6px rgba(45,108,223,.18),
    inset 0 0 0 1px rgba(45,108,223,.18);
}
.feature-tab.disabled,
.feature-tab.disabled:hover {
  background: transparent;
  color: #a0aac0;
  cursor: not-allowed;
  opacity: .65;
  box-shadow: none;
  transform: none;
}
@media (max-width: 600px) {
  .feature-tabs { flex-wrap: wrap; }
  .feature-tab { flex: none; width: 100%; }
}

/* ---------- Method dropdown ------------------------------------------ */
.field-label { display: block; margin: 0 0 16px; font-weight: 600; font-size: .92em; color: #333; }
.select-input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 36px 10px 12px;
  font: inherit;
  font-size: .95em;
  color: #1f2a44;
  background: #fafbfd
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234b5b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='4 6 8 10 12 6'/></svg>")
    no-repeat right 12px center / 14px;
  border: 1px solid #d4d9e4;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.select-input:hover { border-color: #b6c2db; }
.select-input:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 3px rgba(45,108,223,.12);
  background-color: #fff;
}

/* ---------- Submitted result panel (index page only) ----------------- */
section#result {
  background: #fff;
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow:
    0 1px 3px rgba(31,42,68,.04),
    0 10px 30px rgba(31,42,68,.06);
  border: 1px solid #eef1f7;
  border-left: 4px solid #2d6cdf;
  animation: slide-up .35s ease;
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
section#result h2 {
  margin: 0 0 16px;
  font-size: 1.05em;
  color: #1f3d7a;
  display: flex;
  align-items: center;
  gap: 8px;
}
section#result h2::before {
  content: "";
  display: inline-block;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #2d6cdf url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M6.5 10.6 3.9 8l-1 1L6.5 12.6 13.1 6 12.1 5z'/></svg>") center/12px no-repeat;
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 12px;
  margin: 0;
}
.kv dt {
  font-weight: 600;
  color: #4b5b7a;
  font-size: .85em;
  letter-spacing: 0;
  text-transform: uppercase;
  align-self: center;
}
.kv dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.kv-value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: #f7f8fc;
  border: 1px solid #e3e8f3;
  border-radius: 6px;
  padding: 7px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1f3d7a;
}
#meta-novelty {
  white-space: normal;
  max-height: 4.2em;          /* ~3 lines at line-height ~1.4 */
  overflow-y: auto;
  line-height: 1.6;
}
#meta-problem {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
}
a.kv-value { text-decoration: none; }
a.kv-value:hover { text-decoration: underline; }

.copy-btn {
  flex: none;
  background: #fff;
  color: #2d6cdf;
  border: 1px solid #d4d9e4;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .82em;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { background: #2d6cdf; color: #fff; border-color: #2d6cdf; }
.copy-btn.copied {
  background: #1f8a4c;
  border-color: #1f8a4c;
  color: #fff;
}

#result .hint {
  margin: 16px 0 0;
  font-size: .82em;
  color: #7a8aa5;
}

@media (max-width: 600px) {
  .container { margin: 16px; }
  .kv { grid-template-columns: 1fr; row-gap: 4px; }
  .kv dt { margin-top: 8px; }
  .brand { gap: 8px; }
  .brand-logo { width: 36px; height: 36px; }
  .promo-banner h1 { font-size: 2em; }
}

/* ---------- Result page: meta + report cards ------------------------- */
.meta-card {
  margin-top: 8px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid #eef1f7;
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(31,42,68,.04),
    0 10px 30px rgba(31,42,68,.06);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .82em;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  background: #e9edf6;
  color: #4b5b7a;
  border: 1px solid #d6dcea;
}
.status-pill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
/* Animate the dot while we're waiting on the job. */
.status-pill.status-loading::before,
.status-pill.status-pending::before,
.status-pill.status-running::before {
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}
.status-pill.status-loading,
.status-pill.status-pending  { background: #fff7e6; color: #a0660a; border-color: #f3dba6; }
.status-pill.status-running  { background: #e6f0ff; color: #1f55b8; border-color: #b9d0ef; }
.status-pill.status-done     { background: #e6f7ec; color: #15743a; border-color: #b3e0c5; }
.status-pill.status-error    { background: #fde2e2; color: #8a1f1f; border-color: #f4b4b4; }

.report-card {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #eef1f7;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(31,42,68,.04),
    0 10px 30px rgba(31,42,68,.06);
}
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid #eef0f6;
  background: #f5f8fc;
}
.report-header h2 {
  margin: 0;
  font-size: 1em;
  color: #1f3d7a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-header h2::before {
  content: "";
  width: 18px; height: 18px;
  border-radius: 4px;
  background: #2d6cdf url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M3 2h7l3 3v9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 0v3h3'/></svg>") center/12px no-repeat;
}
.report-body {
  background: #fff;
  padding: 24px 28px;
  font-size: .96em;
  line-height: 1.7;
  color: #1f2a44;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  word-wrap: break-word;
}
.report-body > *:first-child { margin-top: 0; }
.report-body > *:last-child  { margin-bottom: 0; }
.report-body p { margin: 0.6em 0; }

/* Headings — a clean hierarchy w/ subtle separators on h1/h2. */
.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4,
.report-body h5,
.report-body h6 {
  margin: 1.4em 0 0.5em;
  line-height: 1.3;
  color: #1f3d7a;
  font-weight: 700;
  letter-spacing: 0;
}
.report-body h1 {
  font-size: 1.7em;
  padding-bottom: .3em;
  border-bottom: 1px solid #e3e8f3;
}
.report-body h2 {
  font-size: 1.35em;
  padding-bottom: .25em;
  border-bottom: 1px solid #eef0f6;
}
.report-body h3 { font-size: 1.15em; }
.report-body h4 { font-size: 1.02em; }
.report-body h5 { font-size: .95em; color: #2d4878; }
.report-body h6 { font-size: .9em;  color: #4b5b7a; text-transform: uppercase; letter-spacing: 0; }

/* Lists */
.report-body ul,
.report-body ol {
  margin: 0.6em 0;
  padding-left: 1.6em;
}
.report-body li { margin: 0.25em 0; }
.report-body li > p { margin: 0.25em 0; }
.report-body li > ul,
.report-body li > ol { margin: 0.25em 0; }

/* GFM task lists */
.report-body li.task-list-item,
.report-body input[type="checkbox"][disabled] + * {
  list-style: none;
}
.report-body li.task-list-item { margin-left: -1.2em; }
.report-body input[type="checkbox"] {
  margin: 0 .4em 0 0;
  vertical-align: middle;
}

/* Inline code (NOT inside pre) */
.report-body :not(pre) > code {
  background: #f3f5fb;
  border: 1px solid #e3e8f3;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  color: #b3306a;
  white-space: nowrap;
}

/* Fenced code blocks */
.report-body pre {
  margin: 0.9em 0;
  padding: 14px 16px;
  background: #f7f8fc;
  border: 1px solid #e3e8f3;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .88em;
  line-height: 1.55;
}
.report-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #1f2a44;
  white-space: pre;
}

/* Blockquotes */
.report-body blockquote {
  margin: 0.9em 0;
  padding: 8px 16px;
  border-left: 4px solid #2d6cdf;
  background: #f5f8ff;
  color: #2d4878;
  border-radius: 0 8px 8px 0;
}
.report-body blockquote > *:first-child { margin-top: 0; }
.report-body blockquote > *:last-child  { margin-bottom: 0; }

/* Links */
.report-body a {
  color: #2d6cdf;
  text-decoration: none;
  border-bottom: 1px solid rgba(45,108,223,.25);
  transition: color .15s, border-color .15s;
}
.report-body a:hover {
  color: #1949b3;
  border-bottom-color: #1949b3;
}

/* Tables (GFM) */
.report-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: .92em;
  border: 1px solid #e3e8f3;
  border-radius: 8px;
}
.report-body table thead {
  background: #f5f8ff;
}
.report-body table th,
.report-body table td {
  border: 1px solid #e8ecf4;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.report-body table th {
  font-weight: 700;
  color: #1f3d7a;
}
.report-body table tr:nth-child(even) td {
  background: #fafbfd;
}

/* Horizontal rule */
.report-body hr {
  border: 0;
  border-top: 1px solid #e3e8f3;
  margin: 1.6em 0;
}

/* Keep linebreaks off by default — markdown handles paragraph spacing. */
.report-body br { display: initial; }

/* Math (KaTeX) — make display equations breathe and scroll if too wide. */
.report-body .katex-display {
  margin: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
}
.report-body .katex { font-size: 1.05em; }
.report-body .katex-display > .katex { display: inline-block; white-space: nowrap; }

/* Figure captions (when an <img> is followed by an em-italic line) */
.report-body figure { margin: 1em auto; text-align: center; }
.report-body figure figcaption {
  font-size: .85em;
  color: #5a6a8a;
  margin-top: .4em;
}

/* Remove the legacy override that forced pre-wrap whitespace on rendered
   markdown — it caused stray newlines from the source to break the layout. */
#result-wrap article {
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 24px 28px;
  white-space: normal;
}
.error {
  background: #fde2e2;
  color: #8a1f1f;
  border: 1px solid #f4b4b4;
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: .92em;
}
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 8px;
  border: 2px solid #ddd;
  border-top-color: #2d6cdf;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
}
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Follow-up Q&A panel ------------------------------------- */
.qa-card { margin-top: 20px; }
.qa-body {
  padding: 18px 22px 22px;
  background: #fff;
}
.qa-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}
.qa-thread:empty { display: none; }
.qa-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e3e8f3;
}
.qa-turn:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.qa-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qa-msg-body {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .94em;
  line-height: 1.6;
  word-wrap: break-word;
  max-width: 85%;
}
.qa-q .qa-msg-body {
  background: #f0f4ff;
  border: 1px solid #d8e2f5;
  color: #1f3d7a;
  align-self: flex-start;
  white-space: pre-wrap;
}
.qa-a .qa-msg-body {
  background: #fafbfd;
  border: 1px solid #eef1f7;
  color: #1f2a44;
  align-self: flex-end;
}
.qa-a .qa-msg-body > *:first-child { margin-top: 0; }
.qa-a .qa-msg-body > *:last-child  { margin-bottom: 0; }

/* Animated "…" placeholder shown while the assistant is composing a reply.
   Three dots that fade in/out in sequence — mirrors common chat affordances. */
.qa-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 2px;
  min-height: 1em;
}
.qa-typing > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a8aa5;
  opacity: .35;
  animation: qa-typing-bounce 1.2s ease-in-out infinite;
}
.qa-typing > span:nth-child(2) { animation-delay: .15s; }
.qa-typing > span:nth-child(3) { animation-delay: .30s; }
@keyframes qa-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40%           { transform: translateY(-3px); opacity: 1; }
}

.qa-form {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
}
.qa-form textarea {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  padding: 11px 13px;
  font: inherit;
  font-size: .95em;
  border: 1px solid #d4d9e4;
  border-radius: 9px;
  background: #fafbfd;
  transition: border-color .15s, box-shadow .15s, background .15s;
  resize: vertical;
}
.qa-form textarea:focus {
  outline: none;
  border-color: #2d6cdf;
  box-shadow: 0 0 0 4px rgba(45,108,223,.15);
  background: #fff;
}
.qa-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  flex: none;
}
#qa-submit {
  flex: 1;
  min-height: 100%;
  background: #2d6cdf;
  color: #fff;
  border: 0;
  padding: 9px 22px;
  border-radius: 8px;
  font: inherit;
  font-size: .92em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(45,108,223,.22);
  transition: background .15s, transform .12s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
#qa-submit:hover { background: #2761c8; transform: translateY(-1px); }
#qa-submit:active { transform: translateY(0); }
#qa-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
#qa-spinner { align-self: center; margin-left: 0; }
.qa-error {
  color: #8a1f1f;
  font-size: .88em;
}
@media (max-width: 600px) {
  .qa-form { flex-direction: column; }
  .qa-actions { flex-direction: row; align-items: center; }
}


/* ---------- Visualization refresh ----------------------------------- */
body {
  background:
    linear-gradient(180deg, #f7f9fb 0%, #eef5f1 48%, #f9f6ef 100%);
  color: #17202f;
}
.container {
  max-width: 1040px;
  margin: 24px auto;
  padding: 0 18px;
}
.promo-banner,
.form-section,
.meta-card,
.report-card,
section#result {
  border-radius: 8px;
}
.promo-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  align-items: center;
  gap: 26px;
  min-height: 230px;
  padding: 30px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,0) 44%),
    linear-gradient(135deg, #123f43 0%, #1f3650 58%, #51384d 100%);
  box-shadow:
    0 18px 42px rgba(22,44,65,.20),
    0 2px 8px rgba(22,44,65,.12);
}
.promo-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .35;
  pointer-events: none;
}
.promo-banner::after {
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.12);
}
.promo-copy,
.workflow-visual {
  position: relative;
  z-index: 1;
}
.brand {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #fff;
  padding: 5px;
  box-shadow:
    0 8px 22px rgba(0,0,0,.18),
    inset 0 0 0 1px rgba(255,255,255,.55);
}
.promo-banner h1 {
  font-size: 2.75rem;
  letter-spacing: 0;
}
.promo-sub {
  max-width: 560px;
  margin-top: 8px;
  color: rgba(255,255,255,.88);
}
.banner-links {
  margin-top: 18px;
}
.gh-link {
  border-radius: 8px;
  background: rgba(255,255,255,.13);
}
.workflow-visual {
  min-height: 176px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08)),
    rgba(8,18,31,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.visual-grid {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  opacity: .5;
}
.visual-grid span {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  background: rgba(255,255,255,.05);
}
.visual-pipeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 4px;
}
.visual-pipeline::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, #78d2b3, #76a9ff 48%, #ffc35b);
  transform: translateY(-50%);
  opacity: .9;
}
.visual-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(11,24,39,.74);
  color: rgba(255,255,255,.88);
  font-size: .78em;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
}
.visual-node-active {
  background: #e9fff8;
  color: #0d4d40;
  border-color: #90e1c4;
}
.visual-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 72px;
  margin-top: 26px;
  padding: 0 6px;
}
.visual-chart span {
  flex: 1;
  min-width: 0;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #ffd166, #e97451);
  box-shadow: 0 -1px 0 rgba(255,255,255,.28) inset;
}
.visual-chart .bar-a { height: 38%; background: linear-gradient(180deg, #78d2b3, #2d8f73); }
.visual-chart .bar-b { height: 72%; }
.visual-chart .bar-c { height: 48%; background: linear-gradient(180deg, #8cc2ff, #3d75d6); }
.visual-chart .bar-d { height: 86%; background: linear-gradient(180deg, #f5b0cb, #b85e86); }
.visual-chart .bar-e { height: 62%; background: linear-gradient(180deg, #ffe08a, #d18b22); }
.form-section,
.meta-card,
.report-card,
section#result {
  border-color: #dfe6f1;
  box-shadow:
    0 1px 2px rgba(23,32,47,.04),
    0 14px 34px rgba(23,32,47,.07);
}
.form-section {
  position: relative;
  overflow: hidden;
  padding: 30px;
}
.form-section::before,
.meta-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #2d8f73, #2d6cdf 48%, #e97451);
}
.meta-card {
  position: relative;
  overflow: hidden;
}
.feature-stage {
  align-items: stretch;
}
.feature-stage-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.feature-tabs {
  border-radius: 8px;
  background: #eef2f7;
}
.feature-tab {
  min-height: 40px;
  border-radius: 6px;
  text-align: center;
}
.feature-tab.selected {
  color: #0f3f7a;
  box-shadow:
    0 4px 12px rgba(45,108,223,.14),
    inset 0 0 0 1px rgba(45,108,223,.14);
}
input,
textarea,
.select-input,
button[type="submit"],
.copy-btn,
#qa-submit {
  border-radius: 8px;
}
button[type="submit"] {
  background: linear-gradient(135deg, #235fc9, #1c8661);
  box-shadow: 0 9px 22px rgba(35,95,201,.24);
}
button[type="submit"]:hover {
  background: linear-gradient(135deg, #1d55b8, #177353);
}

/* ---------- Result visualization ------------------------------------ */
.job-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 8px 24px rgba(23,32,47,.05);
}
.job-timeline::before {
  content: "";
  position: absolute;
  left: 11%;
  right: 11%;
  top: 26px;
  height: 2px;
  background: #d7dfec;
}
.timeline-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: #6b7890;
  font-size: .78em;
  font-weight: 700;
  text-align: center;
}
.timeline-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid #c6cfdd;
  border-radius: 50%;
  background: #fff;
}
.timeline-step.is-complete,
.timeline-step.is-ready {
  color: #176a48;
}
.timeline-step.is-complete .timeline-dot,
.timeline-step.is-ready .timeline-dot {
  border-color: #2d8f73;
  background: #2d8f73;
  box-shadow: 0 0 0 4px rgba(45,143,115,.14);
}
.timeline-step.is-active {
  color: #1f55b8;
}
.timeline-step.is-active .timeline-dot {
  border-color: #2d6cdf;
  box-shadow: 0 0 0 4px rgba(45,108,223,.14);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.timeline-step.is-error {
  color: #8a1f1f;
}
.timeline-step.is-error .timeline-dot {
  border-color: #d94c4c;
  background: #d94c4c;
  box-shadow: 0 0 0 4px rgba(217,76,76,.14);
}
.report-header {
  background:
    linear-gradient(90deg, #f6faf8, #f6f8fc 55%, #fff8f2);
}
.report-body {
  color: #1b2637;
}
.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4,
.report-body h5,
.report-body h6 {
  letter-spacing: 0;
}
.media-frame {
  display: block;
  margin: 18px auto;
  padding: 14px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 10px 26px rgba(23,32,47,.08);
  text-align: center;
}
.media-frame a {
  border-bottom: 0;
}
.media-frame img,
.report-body img,
.media-frame video,
.report-body video,
.media-frame iframe,
.report-body iframe {
  display: block;
  max-width: 100% !important;
  margin: 0 auto;
  border: 0 !important;
  border-radius: 6px !important;
  background: #fff;
}
.media-frame img,
.report-body img {
  width: auto !important;
  height: auto !important;
  max-height: 82vh !important;
  object-fit: contain;
}
.media-frame-hero img,
.report-body[data-mode="poster_generate"] img,
.report-body[data-mode="reel_generate"] img {
  width: 100% !important;
  max-height: 88vh !important;
}
.media-frame video,
.report-body video {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  background: #0d1320;
}
.media-frame iframe,
.report-body iframe {
  width: 100% !important;
  min-height: 560px;
  max-height: 88vh;
}
.media-caption,
.media-frame figcaption {
  display: block;
  margin-top: 10px;
  color: #60708a;
  font-size: .84em;
  line-height: 1.45;
}
.download-strip {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 4px !important;
  text-align: center !important;
}
.result-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px !important;
  margin: 0 !important;
  border: 1px solid #b8c8df !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #174f9f !important;
  font-size: .88em !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(23,32,47,.06);
}
.result-action:hover {
  border-color: #2d6cdf !important;
  background: #eef5ff !important;
  color: #123f80 !important;
}
.report-body article {
  max-width: 760px;
  margin: 0 auto;
}
.qa-a .media-frame {
  box-shadow: none;
}

@media (max-width: 760px) {
  .container {
    margin: 14px auto;
    padding: 0 14px;
  }
  .promo-banner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 24px 18px;
    gap: 18px;
  }
  .workflow-visual {
    min-height: 150px;
  }
  .visual-node {
    min-height: 38px;
    padding: 0 5px;
    font-size: .7em;
  }
  .visual-chart {
    height: 58px;
    margin-top: 18px;
  }
  .form-section,
  .meta-card,
  .report-body,
  #result-wrap article,
  .qa-body {
    padding: 18px;
  }
  .feature-stage {
    display: block;
  }
  .feature-stage-tag {
    margin-bottom: 8px;
  }
  .job-timeline {
    gap: 4px;
    padding: 12px 8px;
  }
  .timeline-label {
    font-size: .86em;
  }
  .media-frame {
    padding: 8px;
  }
  .media-frame iframe,
  .report-body iframe {
    min-height: 360px;
  }
  .qa-msg-body {
    max-width: 100%;
  }
}

@media (max-width: 460px) {
  .promo-banner h1 {
    font-size: 1.85rem;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  .workflow-visual {
    display: none;
  }
  .job-timeline {
    grid-template-columns: 1fr 1fr;
  }
  .job-timeline::before {
    display: none;
  }
  .download-strip {
    justify-content: stretch;
  }
  .result-action {
    flex: 1 1 100%;
  }
}


/* ---------- Shared page region alignment ----------------------------- */
.index-page .container,
.result-page .container {
  max-width: 1040px;
  margin: 24px auto;
  padding: 0 18px;
}
.index-page .promo-banner,
.result-page .promo-banner {
  width: 100%;
  min-height: 230px;
  margin: 0 0 24px;
}
.index-page .primary-region,
.result-page .primary-region {
  width: 100%;
  margin: 0 0 20px;
  padding: 30px;
}
.result-page .meta-card.primary-region {
  padding-bottom: 18px;
}
.result-page .meta-card.primary-region .kv {
  margin-bottom: 18px;
}
.result-page .job-timeline {
  margin: 0;
}
.result-page #error,
.result-page #result-wrap,
.result-page #qa-wrap {
  width: 100%;
}

@media (max-width: 760px) {
  .index-page .container,
  .result-page .container {
    margin: 14px auto;
    padding: 0 14px;
  }
  .index-page .promo-banner,
  .result-page .promo-banner {
    min-height: 0;
    margin-bottom: 18px;
  }
  .index-page .primary-region,
  .result-page .primary-region {
    padding: 18px;
  }
}
/* ==========================================================================
   ResearchStudio — Studio UI v2
   A focused research-workspace layer shared by submission and result pages.
   ========================================================================== */
:root {
  --ink: #14213d;
  --ink-2: #243452;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #f4f6f3;
  --line: #dfe4df;
  --muted: #667085;
  --blue: #3157d5;
  --blue-dark: #2442a8;
  --mint: #b7f5d8;
  --mint-strong: #44c997;
  --coral: #ff8f70;
  --amber: #f4c95d;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .05), 0 8px 24px rgba(20, 33, 61, .06);
  --shadow-lg: 0 24px 70px rgba(20, 33, 61, .13);
}

html { scroll-behavior: smooth; }
body[data-ui="studio"] {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(183, 245, 216, .38), transparent 30rem),
    radial-gradient(circle at 94% 22%, rgba(49, 87, 213, .10), transparent 32rem),
    var(--paper);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body[data-ui="studio"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(rgba(20, 33, 61, .22) .55px, transparent .55px);
  background-size: 6px 6px;
}
body[data-ui="studio"] .container {
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 0;
}

/* Homepage hero */
.index-page .promo-banner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  align-items: center;
  gap: 54px;
  min-height: 510px;
  margin: 0 0 24px;
  padding: 58px 56px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  color: #fff;
  text-align: left;
  background:
    radial-gradient(circle at 78% 14%, rgba(68, 201, 151, .24), transparent 28%),
    linear-gradient(145deg, #101a31 0%, #17294b 58%, #263a59 100%);
  box-shadow: var(--shadow-lg);
}
.index-page .promo-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .14;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, transparent, #000 52%);
}
.index-page .promo-banner::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 320px;
  height: 320px;
  right: -110px;
  bottom: -150px;
  border: 68px solid rgba(255, 143, 112, .14);
  border-radius: 50%;
  box-shadow: none;
}
.index-page .promo-copy,
.index-page .workflow-visual { position: relative; z-index: 1; }

.promo-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: rgba(255,255,255,.68);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.promo-kicker span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-strong);
  box-shadow: 0 0 0 5px rgba(68, 201, 151, .13);
}
.index-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 24px;
}
.index-page .brand-logo {
  width: 36px;
  height: 36px;
  padding: 3px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0,0,0,.18);
}
.index-page .promo-banner .brand h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -.02em;
  text-shadow: none;
}
.index-page .promo-banner h2 {
  max-width: 610px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.7rem, 5.2vw, 4.35rem);
  font-weight: 650;
  line-height: .98;
  letter-spacing: -.055em;
}
.index-page .promo-banner h2 em {
  color: var(--mint);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -.035em;
}
.index-page .promo-sub {
  max-width: 600px;
  margin: 25px 0 0;
  color: rgba(255,255,255,.73);
  font-size: 1.02rem;
  line-height: 1.68;
}
.index-page .banner-links {
  display: flex;
  gap: 9px;
  margin-top: 28px;
}
.gh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(8px);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.gh-link:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.13);
}

/* Abstract workflow monitor */
.index-page .workflow-visual {
  min-height: 330px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(6, 14, 29, .42);
  box-shadow: 0 30px 60px rgba(0,0,0,.23), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  transform: perspective(900px) rotateY(-3deg) rotateX(1deg);
}
.index-page .visual-header,
.index-page .visual-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,.52);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .14em;
}
.index-page .visual-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mint);
}
.index-page .visual-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(68,201,151,.12);
  animation: pulse-dot 1.8s ease infinite;
}
.index-page .visual-grid {
  position: absolute;
  inset: 55px 18px 52px;
  opacity: .32;
}
.index-page .visual-pipeline {
  position: relative;
  z-index: 2;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 34px;
}
.index-page .visual-pipeline::before {
  left: 7%;
  right: 7%;
  height: 1px;
  background: linear-gradient(90deg, var(--mint), #7290f0 58%, var(--coral));
}
.index-page .visual-node {
  min-height: 72px;
  padding: 10px 5px;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  color: rgba(255,255,255,.76);
  background: rgba(13,26,48,.92);
  font-size: .7rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.index-page .visual-node small {
  color: rgba(255,255,255,.36);
  font-size: .57rem;
  letter-spacing: .12em;
}
.index-page .visual-node-active {
  border-color: rgba(183,245,216,.66);
  color: #10253a;
  background: var(--mint);
  transform: translateY(-5px);
}
.index-page .visual-node-active small { color: #34745d; }
.index-page .visual-chart {
  z-index: 2;
  height: 113px;
  margin: 28px 8px 18px;
  gap: 11px;
}
.index-page .visual-chart span {
  border-radius: 5px 5px 2px 2px;
  opacity: .88;
}
.index-page .visual-footer {
  padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,.1);
  letter-spacing: .08em;
}
.index-page .visual-footer strong {
  color: var(--mint);
  font-size: .72rem;
}

/* Main research form */
.index-page .form-section {
  margin: 0 0 20px;
  padding: 40px 44px 42px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.93);
  box-shadow: var(--shadow-sm);
}
.index-page .form-section::before { display: none; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin: 0 0 34px;
  padding: 0 0 25px;
  border-bottom: 1px solid var(--line);
}
.section-heading p {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.section-heading > span {
  max-width: 430px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}
.index-page label,
.index-page .field-label {
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: .01em;
}
.field-note {
  float: right;
  margin-top: 2px;
  color: #8992a3;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: 0;
}
.index-page input,
.index-page textarea {
  margin-top: 9px;
  padding: 14px 15px;
  border: 1px solid #d5ddd8;
  border-radius: 10px;
  color: var(--ink);
  background: #fbfcfa;
  font-size: .92rem;
}
.index-page input::placeholder,
.index-page textarea::placeholder { color: #9ca5b5; }
.index-page input:focus,
.index-page textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(49,87,213,.1);
}
.feature-label {
  margin: 26px 0 11px;
  color: #8992a3 !important;
  font-size: .68rem !important;
  letter-spacing: .14em !important;
  text-transform: uppercase;
}
.index-page .feature-stage {
  position: relative;
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  margin: 0 0 10px;
}
.index-page .feature-stage-tag {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft) !important;
  box-shadow: none !important;
  text-align: left;
  text-transform: none;
}
.index-page .feature-stage-tag b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 7px;
  color: var(--blue);
  background: #e9edff;
  font-size: .67rem;
  letter-spacing: .03em;
}
.index-page .feature-stage:nth-of-type(4) .feature-stage-tag b {
  color: #187552;
  background: #ddf7e9;
}
.index-page .feature-stage-tag > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: .76rem;
  font-weight: 800;
}
.index-page .feature-stage-tag small {
  color: #8a94a5;
  font-size: .6rem;
  font-weight: 500;
}
.index-page .feature-tabs {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f0f2ef;
}
.index-page .feature-tab {
  min-height: 43px;
  margin: 0;
  padding: 9px 10px;
  border-radius: 7px;
  color: #687386;
  font-size: .76rem;
  font-weight: 700;
}
.index-page .feature-tab:hover {
  color: var(--ink);
  background: rgba(255,255,255,.72);
}
.index-page .feature-tab.selected {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 5px 14px rgba(20,33,61,.16);
}
.index-page .feature-tab.selected::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(68,201,151,.15);
}
.index-page .feature-tab.disabled {
  color: #a8aeb9;
  background: transparent;
  opacity: .65;
}
.index-page .feature-stage:nth-of-type(3)::after {
  content: "SOON";
  position: absolute;
  top: -6px;
  right: -7px;
  z-index: 2;
  padding: 3px 6px;
  border: 1px solid #e0d7b6;
  border-radius: 5px;
  color: #8b6d13;
  background: #fff6d8;
  font-size: .52rem;
  font-weight: 850;
  letter-spacing: .09em;
}
#query-label,
#novelty-label,
#pdf-label {
  margin-top: 26px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}
.index-page textarea { min-height: 92px; resize: vertical; }
.index-page #novelty-input { min-height: 130px; }
.index-page input[type="file"] {
  position: relative;
  padding: 28px 18px;
  border: 1.5px dashed #b9c4bd;
  border-radius: 12px;
  color: #6e7888;
  background: #f6f8f5;
}
.index-page input[type="file"]:hover {
  border-color: var(--blue);
  background: #f2f5ff;
}
.index-page button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 52px;
  margin-top: 26px;
  border-radius: 10px;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(49,87,213,.22);
  font-size: .9rem;
  letter-spacing: .01em;
}
.index-page button[type="submit"] span { font-size: 1.05rem; }
.index-page button[type="submit"]:hover {
  background: var(--blue-dark);
  box-shadow: 0 14px 28px rgba(49,87,213,.27);
}
.index-page .submit-hint {
  margin-top: 13px;
  color: #7c8798;
}
.index-page .submit-hint i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--mint-strong);
}

/* Submission confirmation */
.index-page section#result {
  margin: 0 0 20px;
  padding: 27px 30px;
  border: 1px solid #cde9d9;
  border-left: 1px solid #cde9d9;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5fff9, #fff);
  box-shadow: var(--shadow-sm);
}
.index-page section#result h2 {
  color: #176747;
  font-size: 1.1rem;
}
.index-page section#result h2::before { background-color: #25a875; }
.index-page section#result .hint { text-align: left; }
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 4px 34px;
  color: #7a8494;
  font-size: .72rem;
}
.site-footer span { color: var(--ink); font-weight: 800; }
.site-footer p { margin: 0; }

/* Result workspace header */
.result-page .result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 0;
  margin: 0 0 18px;
  padding: 22px 25px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  color: #fff;
  text-align: left;
  background:
    radial-gradient(circle at 80% -20%, rgba(68,201,151,.2), transparent 42%),
    var(--ink);
  box-shadow: 0 14px 36px rgba(20,33,61,.14);
}
.result-page .result-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  background-image: linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.16) 50%, transparent 50.5%);
  background-size: 42px 100%;
  pointer-events: none;
}
.result-page .result-banner::after { display: none; }
.result-page .result-banner .promo-copy {
  display: flex;
  align-items: center;
  gap: 26px;
  z-index: 1;
}
.result-page .result-banner .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding-right: 26px;
  border-right: 1px solid rgba(255,255,255,.16);
  color: #fff;
  text-decoration: none;
}
.result-page .result-banner .brand-logo {
  width: 29px;
  height: 29px;
  padding: 3px;
  border-radius: 6px;
  background: #fff;
}
.result-page .result-banner .brand h1 {
  margin: 0;
  font-size: .94rem;
  text-shadow: none;
}
.result-intro p {
  margin: 0 0 3px;
  color: var(--mint);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .14em;
}
.result-intro h2 {
  margin: 0;
  color: #fff;
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.result-intro span {
  color: rgba(255,255,255,.55);
  font-size: .7rem;
}
.result-page .result-banner .banner-links {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin: 0;
}

/* Result metadata and progress */
.result-page .meta-card {
  position: relative;
  margin: 0 0 18px;
  padding: 27px 30px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}
.result-page .meta-card::before {
  height: 3px;
  background: linear-gradient(90deg, var(--mint-strong), var(--blue) 55%, var(--coral));
}
.result-page .kv {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px 18px;
}
.result-page .kv dt {
  color: #7b8595;
  font-size: .67rem;
  letter-spacing: .1em;
}
.result-page .kv-value {
  padding: 8px 11px;
  border-color: #e3e7e3;
  border-radius: 8px;
  color: var(--ink-2);
  background: #f7f8f6;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: .8rem;
}
.result-page .status-pill {
  padding: 5px 11px;
  font-size: .68rem;
  letter-spacing: .06em;
}
.result-page .job-timeline {
  margin: 20px 0 0;
  padding: 17px 18px 14px;
  border-color: var(--line);
  border-radius: 11px;
  background: #f7f8f6;
  box-shadow: none;
}
.result-page .job-timeline::before { top: 29px; }
.result-page .timeline-step { gap: 8px; font-size: .69rem; }
.result-page .timeline-dot { width: 13px; height: 13px; }

/* Reports */
.result-page .report-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.result-page .report-header {
  padding: 18px 24px;
  border-bottom-color: var(--line);
  background: #f7f8f6;
}
.result-page .report-header h2 {
  color: var(--ink);
  font-size: .92rem;
}
.result-page .report-header h2::before {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background-color: var(--blue);
}
.result-page .copy-btn {
  border-color: #d7ddd8;
  border-radius: 8px;
  color: var(--ink-2);
  background: #fff;
}
.result-page .copy-btn:hover {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}
.result-page .report-body,
.result-page #result-wrap article {
  padding: 34px 38px;
  color: #27344b;
  font-size: .94rem;
  line-height: 1.78;
}
.result-page .report-body h1,
.result-page .report-body h2,
.result-page .report-body h3,
.result-page .report-body h4,
.result-page .report-body h5,
.result-page .report-body h6 { color: var(--ink); }
.result-page .report-body h1 { letter-spacing: -.035em; }
.result-page .report-body a { color: var(--blue); }
.result-page .report-body blockquote {
  border-left-color: var(--mint-strong);
  color: #355746;
  background: #f1fbf6;
}
.result-page .report-body pre {
  border-color: #dfe4df;
  background: #f5f7f5;
}
.result-page .media-frame {
  border-color: var(--line);
  border-radius: 12px;
  background: #f7f8f6;
  box-shadow: 0 14px 34px rgba(20,33,61,.08);
}
.result-page .result-action {
  border-color: #ccd4e5 !important;
  border-radius: 9px !important;
  color: var(--blue) !important;
}
.result-page .result-action:hover {
  border-color: var(--blue) !important;
  color: var(--blue-dark) !important;
  background: #f2f5ff !important;
}

/* Follow-up conversation */
.result-page .qa-body { padding: 24px; }
.result-page .qa-thread { gap: 18px; }
.result-page .qa-turn {
  gap: 10px;
  padding-bottom: 18px;
  border-bottom-color: var(--line);
}
.result-page .qa-msg-body {
  max-width: min(86%, 760px);
  padding: 12px 15px;
  border-radius: 12px;
}
.result-page .qa-q .qa-msg-body {
  align-self: flex-end;
  border-color: #d6def4;
  color: #263e7c;
  background: #eef2ff;
}
.result-page .qa-a .qa-msg-body {
  align-self: flex-start;
  border-color: #dfe7e1;
  background: #f6faf7;
}
.result-page .qa-form {
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8f6;
}
.result-page .qa-form textarea {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.result-page #qa-submit {
  border-radius: 9px;
  background: var(--blue);
  box-shadow: none;
}
.result-page #qa-submit:hover { background: var(--blue-dark); }
.result-page .error {
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

:focus-visible {
  outline: 3px solid rgba(49,87,213,.32);
  outline-offset: 2px;
}

/* Responsive refinements */
@media (max-width: 900px) {
  .index-page .promo-banner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 46px 40px;
  }
  .index-page .workflow-visual {
    width: 100%;
    max-width: 620px;
    min-height: 300px;
    transform: none;
  }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .index-page .feature-stage { grid-template-columns: 160px minmax(0, 1fr); }
  .result-page .result-banner { align-items: flex-start; gap: 18px; }
  .result-page .result-banner .promo-copy { align-items: flex-start; }
}

@media (max-width: 700px) {
  body[data-ui="studio"] .container {
    width: min(100% - 24px, 1120px);
    padding-top: 12px;
  }
  .index-page .promo-banner {
    gap: 34px;
    margin-bottom: 12px;
    padding: 36px 24px;
    border-radius: 18px;
  }
  .index-page .promo-banner h2 { font-size: clamp(2.35rem, 12vw, 3.2rem); }
  .index-page .promo-sub { font-size: .91rem; }
  .index-page .workflow-visual { min-height: 260px; padding: 14px; }
  .index-page .visual-pipeline { margin-top: 27px; }
  .index-page .visual-node { min-height: 60px; font-size: .62rem; }
  .index-page .visual-chart { height: 83px; margin-top: 20px; }
  .index-page .form-section { padding: 28px 20px; border-radius: 16px; }
  .section-heading { margin-bottom: 26px; padding-bottom: 20px; }
  .section-heading h2 { font-size: 1.55rem; }
  .section-heading > span { font-size: .82rem; }
  .field-note {
    display: block;
    float: none;
    margin-top: 4px;
  }
  .index-page .feature-stage { display: block; margin-bottom: 14px; }
  .index-page .feature-stage-tag { margin-bottom: 6px; }
  .index-page .feature-tabs { flex-wrap: wrap; }
  .index-page .feature-tab { flex: 1 1 calc(50% - 4px); width: auto; }
  .site-footer { flex-direction: column; gap: 5px; }
  .result-page .result-banner {
    flex-direction: column;
    padding: 20px;
  }
  .result-page .result-banner .promo-copy { flex-direction: column; gap: 14px; }
  .result-page .result-banner .brand {
    width: 100%;
    padding: 0 0 13px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
  }
  .result-page .meta-card { padding: 22px 18px 18px; }
  .result-page .kv { grid-template-columns: 1fr; row-gap: 5px; }
  .result-page .kv dt { margin-top: 8px; }
  .result-page .report-body,
  .result-page #result-wrap article { padding: 25px 20px; }
  .result-page .qa-body { padding: 16px; }
  .result-page .qa-msg-body { max-width: 96%; }
}

@media (max-width: 460px) {
  .index-page .workflow-visual { display: block; }
  .index-page .visual-header,
  .index-page .visual-footer { font-size: .53rem; }
  .index-page .visual-node { min-height: 54px; padding: 7px 2px; }
  .index-page .visual-chart { height: 70px; }
  .index-page .banner-links { flex-direction: column; align-items: stretch; }
  .index-page .feature-tab { flex-basis: 100%; }
  .result-page .job-timeline { grid-template-columns: repeat(4, 1fr); }
  .result-page .timeline-label { font-size: .58rem; }
  .result-page .result-banner .banner-links { width: 100%; }
  .result-page .result-banner .gh-link { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* Explore arXiv paper menu */
.arxiv-menu {
  position: relative;
  margin: 0;
}
.arxiv-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.arxiv-menu > summary::-webkit-details-marker { display: none; }
.arxiv-menu > summary span {
  display: inline-block;
  transition: transform .18s ease;
}
.arxiv-menu[open] > summary {
  border-color: rgba(255,255,255,.34);
  background: rgba(255,255,255,.13);
}
.arxiv-menu[open] > summary span { transform: rotate(180deg); }
.arxiv-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 9px);
  right: 0;
  width: 270px;
  padding: 7px;
  border: 1px solid rgba(20,33,61,.12);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 42px rgba(8,16,32,.25);
  backdrop-filter: blur(12px);
}
.arxiv-menu-panel::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 24px;
  width: 9px;
  height: 9px;
  border-top: 1px solid rgba(20,33,61,.12);
  border-left: 1px solid rgba(20,33,61,.12);
  background: #fff;
  transform: rotate(45deg);
}
.arxiv-menu-panel a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.arxiv-menu-panel a:hover {
  color: var(--blue);
  background: #f0f3ff;
}
.arxiv-menu-panel a span {
  font-size: .78rem;
  font-weight: 750;
}
.arxiv-menu-panel a small {
  flex: none;
  color: #7f8999;
  font-size: .64rem;
}
@media (max-width: 460px) {
  .arxiv-menu,
  .arxiv-menu > summary { width: 100%; }
  .arxiv-menu-panel {
    right: auto;
    left: 0;
    width: min(270px, calc(100vw - 72px));
  }
  .arxiv-menu-panel::before { right: auto; left: 24px; }
}
/* Keep the complete paper menu inside the clipped hero artwork. */
.arxiv-menu-panel {
  top: auto;
  bottom: calc(100% + 9px);
}
.arxiv-menu-panel::before {
  top: auto;
  bottom: -5px;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid rgba(20,33,61,.12);
  border-bottom: 1px solid rgba(20,33,61,.12);
}
/* ==========================================================================
   ResearchStudio — Technology Research Theme
   Dark scientific workspace, cyan data signals, and paper-first reports.
   ========================================================================== */
:root {
  --tech-bg: #050b16;
  --tech-bg-2: #081323;
  --tech-panel: #0c1829;
  --tech-panel-2: #101f34;
  --tech-line: rgba(126, 169, 219, .18);
  --tech-line-strong: rgba(79, 218, 236, .42);
  --tech-cyan: #49e1ea;
  --tech-cyan-2: #18bfcf;
  --tech-blue: #5c7cff;
  --tech-violet: #8c73ff;
  --tech-text: #e8f2ff;
  --tech-muted: #8da2bb;
  --tech-paper: #f7faff;
  --ink: #e8f2ff;
  --ink-2: #bed0e4;
  --paper: #050b16;
  --surface: #0c1829;
  --surface-soft: #101f34;
  --line: rgba(126, 169, 219, .18);
  --muted: #8da2bb;
  --blue: #5c7cff;
  --blue-dark: #405ee0;
  --mint: #9af8f2;
  --mint-strong: #49e1ea;
  --shadow-sm: 0 14px 34px rgba(0,0,0,.24);
  --shadow-lg: 0 32px 80px rgba(0,0,0,.38);
}

body[data-ui="studio"] {
  color: var(--tech-text);
  background:
    radial-gradient(circle at 13% -8%, rgba(24,191,207,.16), transparent 34rem),
    radial-gradient(circle at 92% 14%, rgba(92,124,255,.15), transparent 36rem),
    linear-gradient(180deg, #060d19 0%, #040914 100%);
}
body[data-ui="studio"]::before {
  opacity: .38;
  background-image:
    linear-gradient(rgba(91,135,181,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,135,181,.07) 1px, transparent 1px),
    radial-gradient(rgba(73,225,234,.22) .55px, transparent .55px);
  background-size: 48px 48px, 48px 48px, 8px 8px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.76) 70%, transparent 100%);
}
body[data-ui="studio"] .container { padding-top: 22px; }

/* Scientific hero */
.index-page .promo-banner {
  min-height: 500px;
  border-color: rgba(73,225,234,.18);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(73,225,234,.055) 1px, transparent 1px),
    linear-gradient(rgba(73,225,234,.055) 1px, transparent 1px),
    radial-gradient(circle at 76% 32%, rgba(24,191,207,.17), transparent 25%),
    linear-gradient(135deg, #071221 0%, #0b1a2f 56%, #111b35 100%);
  background-size: 36px 36px, 36px 36px, auto, auto;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.025) inset,
    0 34px 90px rgba(0,0,0,.4);
}
.index-page .promo-banner::before {
  opacity: .55;
  background-image:
    linear-gradient(90deg, transparent 49.7%, rgba(73,225,234,.12) 50%, transparent 50.3%),
    linear-gradient(transparent 49.7%, rgba(73,225,234,.1) 50%, transparent 50.3%);
  background-size: 120px 120px;
  mask-image: linear-gradient(90deg, transparent 25%, #000 68%);
}
.index-page .promo-banner::after {
  top: -136px;
  right: -96px;
  bottom: auto;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(73,225,234,.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(73,225,234,.025),
    0 0 0 76px rgba(92,124,255,.025),
    inset 0 0 70px rgba(73,225,234,.04);
}
.promo-kicker {
  color: #93a9c3;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.promo-kicker span {
  border-radius: 1px;
  background: var(--tech-cyan);
  box-shadow: 0 0 12px rgba(73,225,234,.8);
  transform: rotate(45deg);
}
.index-page .brand-logo,
.result-page .result-banner .brand-logo {
  border: 1px solid rgba(73,225,234,.24);
  border-radius: 3px;
  box-shadow: 0 0 22px rgba(73,225,234,.12);
}
.index-page .promo-banner .brand h1,
.result-page .result-banner .brand h1 {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: -.035em;
}
.index-page .promo-banner h2 {
  max-width: 650px;
  font-weight: 620;
  letter-spacing: -.06em;
  text-shadow: 0 0 38px rgba(92,124,255,.12);
}
.index-page .promo-banner h2 em {
  color: var(--tech-cyan);
  font-family: inherit;
  font-style: normal;
  font-weight: 620;
  text-shadow: 0 0 26px rgba(73,225,234,.28);
}
.index-page .promo-sub { color: #9db0c7; }
.gh-link {
  border-color: rgba(117,164,211,.25);
  border-radius: 5px;
  color: #cce1f7;
  background: rgba(9,24,42,.72);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: .01em;
}
.gh-link:hover,
.arxiv-menu[open] > summary {
  border-color: rgba(73,225,234,.65);
  color: #fff;
  background: rgba(30,103,122,.25);
  box-shadow: 0 0 22px rgba(73,225,234,.1);
}

/* Research pipeline monitor */
.index-page .workflow-visual {
  border-color: rgba(73,225,234,.25);
  border-radius: 8px;
  background:
    linear-gradient(rgba(73,225,234,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(73,225,234,.035) 1px, transparent 1px),
    rgba(2,10,20,.78);
  background-size: 24px 24px;
  box-shadow:
    0 0 0 1px rgba(73,225,234,.045) inset,
    0 22px 65px rgba(0,0,0,.42),
    0 0 45px rgba(24,191,207,.07);
}
.index-page .visual-header,
.index-page .visual-footer {
  color: #6f8ba8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.index-page .visual-live { color: var(--tech-cyan); }
.index-page .visual-live i {
  border-radius: 1px;
  background: var(--tech-cyan);
  box-shadow: 0 0 12px var(--tech-cyan);
}
.index-page .visual-grid { opacity: .16; }
.index-page .visual-grid span {
  border-color: rgba(73,225,234,.2);
  border-radius: 2px;
  background: rgba(73,225,234,.025);
}
.index-page .visual-pipeline::before {
  height: 1px;
  background: linear-gradient(90deg, var(--tech-cyan), var(--tech-blue), var(--tech-violet));
  box-shadow: 0 0 10px rgba(73,225,234,.3);
}
.index-page .visual-node {
  border-color: rgba(108,151,196,.2);
  border-radius: 5px;
  color: #8fa8c1;
  background: rgba(8,20,36,.94);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.index-page .visual-node small { color: #506b86; }
.index-page .visual-node-active {
  border-color: var(--tech-cyan);
  color: #eaffff;
  background: linear-gradient(145deg, rgba(28,151,168,.46), rgba(24,70,114,.72));
  box-shadow:
    0 0 0 1px rgba(73,225,234,.16) inset,
    0 0 24px rgba(73,225,234,.14);
}
.index-page .visual-node-active small { color: #8df3f1; }
.index-page .visual-chart span {
  border-radius: 2px 2px 0 0;
  filter: saturate(.9);
  box-shadow: 0 0 12px currentColor;
}
.index-page .visual-chart .bar-a { background: linear-gradient(#66f5ed, #1596aa); }
.index-page .visual-chart .bar-b { background: linear-gradient(#718dff, #354fc2); }
.index-page .visual-chart .bar-c { background: linear-gradient(#4de1ea, #167d9e); }
.index-page .visual-chart .bar-d { background: linear-gradient(#a58bff, #5a48c6); }
.index-page .visual-chart .bar-e { background: linear-gradient(#56cfff, #2462bf); }
.index-page .visual-footer {
  border-top-color: rgba(73,225,234,.16);
}
.index-page .visual-footer strong {
  color: var(--tech-cyan);
  text-shadow: 0 0 14px rgba(73,225,234,.32);
}

/* Dark research console form */
.index-page .form-section {
  border-color: var(--tech-line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(73,225,234,.025), transparent 38%),
    rgba(9,20,36,.93);
  box-shadow: 0 22px 60px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
}
.section-heading { border-bottom-color: var(--tech-line); }
.section-heading p {
  color: var(--tech-cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.section-heading h2 { color: var(--tech-text); }
.section-heading > span { color: var(--tech-muted); }
.index-page label,
.index-page .field-label { color: #cbdced; }
.field-note { color: #69829d; }
.feature-label { color: #66809b !important; }
.index-page input,
.index-page textarea {
  border-color: rgba(119,158,198,.24);
  border-radius: 6px;
  color: var(--tech-text);
  background: rgba(3,11,22,.68);
  caret-color: var(--tech-cyan);
}
.index-page input::placeholder,
.index-page textarea::placeholder { color: #526981; }
.index-page input:focus,
.index-page textarea:focus {
  border-color: var(--tech-cyan);
  background: rgba(4,14,27,.9);
  box-shadow:
    0 0 0 3px rgba(73,225,234,.09),
    0 0 24px rgba(73,225,234,.05);
}
.index-page .feature-stage-tag {
  border-color: var(--tech-line);
  border-radius: 6px;
  color: #d6e6f5;
  background: rgba(12,28,48,.9) !important;
}
.index-page .feature-stage-tag b {
  border: 1px solid rgba(73,225,234,.24);
  border-radius: 3px;
  color: var(--tech-cyan);
  background: rgba(73,225,234,.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.index-page .feature-stage:nth-of-type(4) .feature-stage-tag b {
  border-color: rgba(140,115,255,.3);
  color: #b8a8ff;
  background: rgba(140,115,255,.1);
}
.index-page .feature-stage-tag small { color: #607a94; }
.index-page .feature-tabs {
  border-color: var(--tech-line);
  border-radius: 6px;
  background: rgba(3,11,22,.66);
}
.index-page .feature-tab {
  border-radius: 3px;
  color: #758da5;
}
.index-page .feature-tab:hover {
  color: #dcecff;
  background: rgba(73,225,234,.06);
}
.index-page .feature-tab.selected {
  color: #f5ffff;
  background: linear-gradient(135deg, #154c68, #303d8b);
  box-shadow:
    0 0 0 1px rgba(73,225,234,.28) inset,
    0 0 22px rgba(73,225,234,.08);
}
.index-page .feature-tab.selected::before {
  border-radius: 1px;
  background: var(--tech-cyan);
  box-shadow: 0 0 9px var(--tech-cyan);
  transform: rotate(45deg);
}
.index-page .feature-tab.disabled {
  color: #455a70;
  background: rgba(255,255,255,.008);
}
.index-page .feature-stage:nth-of-type(3)::after {
  border-color: rgba(92,124,255,.32);
  border-radius: 2px;
  color: #91a4ff;
  background: #111b38;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
#query-label,
#novelty-label,
#pdf-label { border-top-color: var(--tech-line); }
.index-page input[type="file"] {
  border-color: rgba(73,225,234,.27);
  border-radius: 6px;
  color: #8199b2;
  background:
    linear-gradient(90deg, rgba(73,225,234,.035) 1px, transparent 1px),
    rgba(3,11,22,.62);
  background-size: 18px 100%;
}
.index-page input[type="file"]:hover {
  border-color: var(--tech-cyan);
  background-color: rgba(8,30,46,.82);
}
.index-page button[type="submit"] {
  border: 1px solid rgba(99,246,239,.5);
  border-radius: 5px;
  color: #031219;
  background: linear-gradient(100deg, #42e7e1, #5aa7ff);
  box-shadow:
    0 12px 30px rgba(24,191,207,.2),
    0 0 0 1px rgba(255,255,255,.18) inset;
}
.index-page button[type="submit"]:hover {
  background: linear-gradient(100deg, #66f5ed, #7abaff);
  box-shadow:
    0 16px 36px rgba(24,191,207,.27),
    0 0 28px rgba(73,225,234,.12);
}
.index-page .submit-hint { color: #687f98; }
.index-page .submit-hint i {
  border-radius: 1px;
  background: var(--tech-cyan);
  box-shadow: 0 0 8px var(--tech-cyan);
}

/* Submitted state and footer */
.index-page section#result {
  border-color: rgba(73,225,234,.24);
  border-left-color: rgba(73,225,234,.24);
  border-radius: 8px;
  color: var(--tech-text);
  background:
    linear-gradient(90deg, rgba(73,225,234,.07), transparent 55%),
    rgba(8,22,36,.95);
  box-shadow: 0 18px 46px rgba(0,0,0,.27);
}
.index-page section#result h2 { color: #81f5ed; }
.index-page section#result h2::before {
  border-radius: 2px;
  background-color: var(--tech-cyan);
}
.index-page .kv dt { color: #7890a9; }
.index-page .kv-value {
  border-color: var(--tech-line);
  color: #cde0f2;
  background: rgba(2,10,20,.7);
}
.index-page .copy-btn {
  border-color: var(--tech-line);
  color: var(--tech-cyan);
  background: #0b1b2d;
}
.index-page .copy-btn:hover {
  border-color: var(--tech-cyan);
  color: #031219;
  background: var(--tech-cyan);
}
.site-footer {
  color: #516982;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.site-footer span { color: #8da8c3; }

/* arXiv data menu */
.arxiv-menu-panel {
  border-color: rgba(73,225,234,.28);
  border-radius: 6px;
  color: var(--tech-text);
  background:
    linear-gradient(135deg, rgba(73,225,234,.045), transparent),
    rgba(5,16,29,.98);
  box-shadow:
    0 22px 50px rgba(0,0,0,.48),
    0 0 0 1px rgba(73,225,234,.04) inset;
}
.arxiv-menu-panel::before {
  border-color: rgba(73,225,234,.28);
  background: #071526;
}
.arxiv-menu-panel a {
  border-radius: 3px;
  color: #cbdff2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.arxiv-menu-panel a:hover {
  color: var(--tech-cyan);
  background: rgba(73,225,234,.08);
}
.arxiv-menu-panel a small { color: #667f99; }

/* Result page: dark console chrome */
.result-page .result-banner {
  border-color: rgba(73,225,234,.2);
  border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(73,225,234,.05) 1px, transparent 1px),
    radial-gradient(circle at 82% 10%, rgba(92,124,255,.18), transparent 30%),
    #081526;
  background-size: 38px 100%, auto, auto;
  box-shadow: 0 18px 48px rgba(0,0,0,.3);
}
.result-page .result-banner::before {
  opacity: .24;
  background-image: linear-gradient(90deg, transparent 49.7%, rgba(73,225,234,.22) 50%, transparent 50.3%);
}
.result-page .result-banner .brand { border-right-color: rgba(73,225,234,.18); }
.result-intro p {
  color: var(--tech-cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.result-intro span { color: #7f96ae; }

.result-page .meta-card {
  border-color: var(--tech-line);
  border-radius: 9px;
  color: var(--tech-text);
  background:
    linear-gradient(135deg, rgba(73,225,234,.025), transparent 32%),
    rgba(9,20,36,.95);
  box-shadow: 0 18px 44px rgba(0,0,0,.25);
}
.result-page .meta-card::before {
  height: 2px;
  background: linear-gradient(90deg, var(--tech-cyan), var(--tech-blue), var(--tech-violet));
  box-shadow: 0 0 14px rgba(73,225,234,.2);
}
.result-page .kv dt {
  color: #6d86a0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.result-page .kv-value {
  border-color: rgba(110,150,191,.18);
  border-radius: 4px;
  color: #c9dbec;
  background: rgba(2,10,20,.58);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.result-page .status-pill {
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.result-page .status-pill.status-loading,
.result-page .status-pill.status-pending {
  border-color: rgba(244,201,93,.34);
  color: #f7d97d;
  background: rgba(244,201,93,.09);
}
.result-page .status-pill.status-running {
  border-color: rgba(73,225,234,.36);
  color: var(--tech-cyan);
  background: rgba(73,225,234,.08);
}
.result-page .status-pill.status-done {
  border-color: rgba(69,213,156,.36);
  color: #79edba;
  background: rgba(69,213,156,.08);
}
.result-page .status-pill.status-error {
  border-color: rgba(255,106,123,.36);
  color: #ff9baa;
  background: rgba(255,106,123,.08);
}
.result-page .spinner { border-color: #263e58; border-top-color: var(--tech-cyan); }
.result-page .job-timeline {
  border-color: var(--tech-line);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(73,225,234,.025) 1px, transparent 1px),
    rgba(2,10,20,.48);
  background-size: 32px 100%;
}
.result-page .job-timeline::before { background: #273d54; }
.result-page .timeline-step { color: #607992; }
.result-page .timeline-dot {
  border-radius: 2px;
  border-color: #38516a;
  background: #091625;
  transform: rotate(45deg);
}
.result-page .timeline-step.is-complete .timeline-dot,
.result-page .timeline-step.is-ready .timeline-dot {
  border-color: var(--tech-cyan-2);
  background: var(--tech-cyan-2);
  box-shadow: 0 0 0 4px rgba(24,191,207,.08), 0 0 12px rgba(24,191,207,.28);
}
.result-page .timeline-step.is-active .timeline-dot {
  border-color: var(--tech-cyan);
  box-shadow: 0 0 0 4px rgba(73,225,234,.08), 0 0 12px rgba(73,225,234,.25);
}
.result-page .timeline-step.is-complete,
.result-page .timeline-step.is-ready { color: #72d9d7; }
.result-page .timeline-step.is-active { color: var(--tech-cyan); }

/* Paper-first report surface */
.result-page .report-card {
  border-color: var(--tech-line);
  border-radius: 9px;
  background: #091525;
  box-shadow: 0 20px 52px rgba(0,0,0,.28);
}
.result-page .report-header {
  border-bottom-color: rgba(120,160,201,.18);
  background:
    linear-gradient(90deg, rgba(73,225,234,.045), transparent 38%),
    #0b1a2c;
}
.result-page .report-header h2 {
  color: #ddecfb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.result-page .report-header h2::before {
  border-radius: 2px;
  background-color: var(--tech-blue);
  box-shadow: 0 0 13px rgba(92,124,255,.28);
}
.result-page .copy-btn {
  border-color: rgba(117,159,201,.25);
  border-radius: 4px;
  color: #9cb3ca;
  background: #0b192a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.result-page .copy-btn:hover {
  border-color: var(--tech-cyan);
  color: #031219;
  background: var(--tech-cyan);
}
.result-page .report-body,
.result-page #result-wrap article {
  color: #243550;
  background:
    linear-gradient(rgba(72,104,143,.035) 1px, transparent 1px),
    var(--tech-paper);
  background-size: 100% 32px;
}
.result-page .report-body h1,
.result-page .report-body h2,
.result-page .report-body h3,
.result-page .report-body h4,
.result-page .report-body h5,
.result-page .report-body h6 { color: #10213e; }
.result-page .report-body h1,
.result-page .report-body h2 {
  border-bottom-color: #d9e2ef;
}
.result-page .report-body a { color: #315bd8; }
.result-page .report-body blockquote {
  border-left-color: #1dbbc8;
  color: #244e5d;
  background: #e9f8f8;
}
.result-page .report-body pre {
  border-color: #d2ddea;
  color: #ddecfb;
  background: #0c1829;
}
.result-page .report-body pre code { color: #ddecfb; }
.result-page .report-body :not(pre) > code {
  border-color: #d4ddeb;
  color: #9d2b62;
  background: #edf2f9;
}
.result-page .report-body table { border-color: #d6e0eb; }
.result-page .report-body table thead { background: #eaf0f8; }
.result-page .report-body table th { color: #17315b; }
.result-page .report-body table tr:nth-child(even) td { background: #f0f5fa; }
.result-page .media-frame {
  border-color: #cedae7;
  border-radius: 5px;
  background: #eef3f8;
  box-shadow: 0 16px 36px rgba(14,36,67,.13);
}
.result-page .result-action {
  border-radius: 4px !important;
  color: #244fd1 !important;
}

/* Technical Q&A console */
.result-page .qa-card { background: #091525; }
.result-page .qa-body { background: #071321; }
.result-page .qa-turn { border-bottom-color: rgba(109,150,192,.17); }
.result-page .qa-msg-body { border-radius: 5px; }
.result-page .qa-q .qa-msg-body {
  border-color: rgba(92,124,255,.35);
  color: #cfdbff;
  background: rgba(50,67,137,.34);
}
.result-page .qa-a .qa-msg-body {
  border-color: rgba(73,225,234,.2);
  color: #c8deee;
  background: rgba(10,35,48,.74);
}
.result-page .qa-a .report-body {
  color: #c8deee;
  background: rgba(10,35,48,.74);
}
.result-page .qa-a .report-body h1,
.result-page .qa-a .report-body h2,
.result-page .qa-a .report-body h3,
.result-page .qa-a .report-body h4 { color: #ecf7ff; }
.result-page .qa-a .report-body a { color: var(--tech-cyan); }
.result-page .qa-form {
  border-color: rgba(73,225,234,.18);
  border-radius: 6px;
  background: rgba(2,10,20,.7);
}
.result-page .qa-form textarea {
  color: #d8e8f6;
  background: transparent;
  caret-color: var(--tech-cyan);
}
.result-page .qa-form textarea::placeholder { color: #567089; }
.result-page #qa-submit {
  border: 1px solid rgba(73,225,234,.4);
  border-radius: 4px;
  color: #031219;
  background: var(--tech-cyan-2);
}
.result-page #qa-submit:hover { background: var(--tech-cyan); }
.result-page .qa-typing > span {
  border-radius: 1px;
  background: var(--tech-cyan);
}
.result-page .error {
  border-color: rgba(255,106,123,.32);
  border-radius: 5px;
  color: #ffb4bf;
  background: rgba(116,25,44,.34);
}

/* Tech focus and scrollbars */
body[data-ui="studio"] :focus-visible {
  outline-color: rgba(73,225,234,.7);
}
body[data-ui="studio"] ::selection {
  color: #031219;
  background: rgba(73,225,234,.82);
}
body[data-ui="studio"] * {
  scrollbar-color: #31516a #071321;
  scrollbar-width: thin;
}
body[data-ui="studio"] *::-webkit-scrollbar { width: 9px; height: 9px; }
body[data-ui="studio"] *::-webkit-scrollbar-track { background: #071321; }
body[data-ui="studio"] *::-webkit-scrollbar-thumb {
  border: 2px solid #071321;
  border-radius: 0;
  background: #31516a;
}

/* Theme-specific responsive tuning */
@media (max-width: 900px) {
  .index-page .promo-banner { border-radius: 11px; }
  .index-page .workflow-visual { transform: none; }
}
@media (max-width: 700px) {
  .index-page .promo-banner,
  .index-page .form-section { border-radius: 8px; }
  .index-page .feature-stage-tag,
  .index-page .feature-tabs { border-radius: 5px; }
  .result-page .result-banner,
  .result-page .meta-card,
  .result-page .report-card { border-radius: 7px; }
}
/* Per-stage job timing */
.result-page .timeline-duration {
  min-height: 1.25em;
  color: #4f6a84;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1.25;
  white-space: nowrap;
}
.result-page .timeline-step.is-complete .timeline-duration {
  color: #579e9e;
}
.result-page .timeline-step.is-active .timeline-duration {
  color: var(--tech-cyan);
  text-shadow: 0 0 10px rgba(73,225,234,.18);
}
.result-page .timeline-step.is-ready .timeline-duration {
  color: #79edba;
}
.result-page .timeline-step.is-error .timeline-duration {
  color: #ff9baa;
}
@media (max-width: 460px) {
  .result-page .timeline-duration {
    font-size: .5rem;
    letter-spacing: -.01em;
  }
}

/* Expanded project footer */
.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand links" "notice notice" "meta meta";
  align-items: center;
  gap: 18px 28px;
  padding: 26px 4px 34px;
  border-top: 1px solid rgba(126,169,219,.14);
}
.footer-brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.footer-brand span {
  color: #b9cde1;
  font-size: .78rem;
  font-weight: 800;
}
.footer-brand p { color: #5f7891; }
.footer-links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
}
.footer-links a {
  color: #7895b0;
  font-size: .66rem;
  font-weight: 700;
  text-decoration: none;
  transition: color .15s ease;
}
.footer-links a:hover { color: var(--tech-cyan); }
.footer-notice {
  grid-area: notice;
  padding-top: 16px;
  border-top: 1px solid rgba(126,169,219,.1);
  color: #6f8499 !important;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: .7rem !important;
  line-height: 1.55;
}
.footer-notice span {
  margin-right: 6px;
  color: var(--tech-cyan);
}
@media (max-width: 700px) {
  .site-footer {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "links" "notice" "meta";
    align-items: flex-start;
  }
  .footer-links { justify-content: flex-start; }
}

.footer-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  color: #536a81;
  font-size: .65rem;
}
.footer-meta a {
  color: #7895b0;
  text-decoration: none;
  transition: color .15s ease;
}
.footer-meta a:hover { color: var(--tech-cyan); }
@media (max-width: 700px) {
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Align hero workflow with the three product stages. */
.index-page .visual-pipeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Per-report Q&A quota */
.qa-quota {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(73,225,234,.22);
  border-radius: 3px;
  color: #82a7bf;
  background: rgba(73,225,234,.05);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .58rem;
  font-weight: 700;
  white-space: nowrap;
}
.qa-form:has(textarea:disabled) { opacity: .62; }
.qa-form textarea:disabled { cursor: not-allowed; }

/* Result feedback and mobile sharing */
.report-header-actions {
  position: relative;
  flex: none;
}
.report-content > *:first-child { margin-top: 0; }
.report-content > *:last-child { margin-bottom: 0; }
.engagement-count {
  min-width: 1ch;
  color: #718ca7;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .61rem;
}
.engagement-actions { display: flex; gap: 7px; }
.engagement-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(117,159,201,.24);
  border-radius: 4px;
  color: #9db2c7;
  background: #0b192a;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.engagement-btn:hover {
  border-color: var(--tech-cyan);
  color: #eaffff;
  transform: translateY(-1px);
}
.engagement-btn.is-active {
  border-color: rgba(73,225,234,.48);
  color: var(--tech-cyan);
  background: rgba(73,225,234,.1);
}
.engagement-share {
  border-color: rgba(92,124,255,.42);
  color: #c4ceff;
  background: rgba(92,124,255,.12);
}
.engagement-icon { font-size: .9rem; line-height: 1; }
svg.engagement-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: filter .15s, stroke-width .15s;
}
.engagement-icon-down { transform: rotate(180deg); }
.engagement-btn.is-active .engagement-icon {
  stroke-width: 2.15;
  filter: drop-shadow(0 0 4px rgba(73,225,234,.5));
}
.engagement-toast {
  position: absolute;
  right: 12px;
  z-index: 5;
  top: calc(100% + 8px);
  bottom: auto;
  padding: 7px 10px;
  border: 1px solid rgba(73,225,234,.2);
  border-radius: 4px;
  color: #bcd1e3;
  background: #081625;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  font-size: .62rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity .15s, transform .15s;
}
.engagement-toast.is-visible { opacity: 1; transform: translateY(0); }
.wechat-share-guide {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: 76px 18px 18px;
  background: rgba(1,7,14,.8);
  backdrop-filter: blur(8px);
}
.wechat-share-guide[hidden] { display: none; }
.wechat-guide-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(73,225,234,.3);
  border-radius: 8px;
  color: #dcecff;
  background: #09192b;
  box-shadow: 0 28px 80px rgba(0,0,0,.5);
}
.wechat-guide-card > p {
  margin: 0 0 8px;
  color: var(--tech-cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .14em;
}
.wechat-guide-card h2 { margin: 0 0 12px; font-size: 1.25rem; }
.wechat-guide-card > span:not(.wechat-guide-arrow) {
  display: block;
  color: #91a8bf;
  font-size: .84rem;
  line-height: 1.65;
}
.wechat-guide-arrow {
  position: absolute;
  top: -54px;
  right: 8px;
  color: var(--tech-cyan);
  font-size: 2.2rem;
  text-shadow: 0 0 18px rgba(73,225,234,.35);
}
#wechat-guide-close {
  width: 100%;
  margin-top: 22px;
  padding: 10px 14px;
  border: 1px solid rgba(73,225,234,.4);
  border-radius: 4px;
  color: #031219;
  background: var(--tech-cyan);
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 600px) {
  .engagement-actions { width: 100%; }
  .engagement-btn { flex: 1; min-height: 40px; }
  .engagement-toast { right: 8px; }
}

@media (max-width: 600px) {
  .result-page #result-wrap .report-header { align-items: stretch; flex-direction: column; }
  .result-page #result-wrap .report-header-actions { width: 100%; }
}

/* Live GitHub stars beside the homepage title */
.github-stars-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 3px;
  padding: 4px 7px;
  border: 1px solid rgba(73,225,234,.25);
  border-radius: 4px;
  color: #b9cee1;
  background: rgba(7,21,36,.72);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .62rem;
  line-height: 1;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.github-stars-badge[hidden] { display: none; }
.github-stars-badge svg {
  width: 13px;
  height: 13px;
  fill: rgba(73,225,234,.14);
  stroke: var(--tech-cyan);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.github-stars-badge strong { display: inline-block; color: #e4f3ff; font-weight: 750; }
.github-stars-label { color: #a9bed2; font-weight: 700; }
.github-stars-badge strong.is-updated { animation: github-star-update .5s ease-out; }
@keyframes github-star-update {
  0% { color: #fff; text-shadow: 0 0 10px rgba(73,225,234,.9); transform: translateY(-1px); }
  100% { color: #e4f3ff; text-shadow: none; transform: translateY(0); }
}
.github-stars-badge:hover {
  border-color: var(--tech-cyan);
  color: #fff;
  background: rgba(73,225,234,.1);
  transform: translateY(-1px);
}
@media (max-width: 460px) {
  .github-stars-badge { margin-left: 0; padding: 4px 6px; }
}

/* Clearly labeled simulated activity indicator */
.github-stars-badge,
.mock-active-users {
  box-sizing: border-box;
  height: 23px;
}
.mock-active-users {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(73,225,234,.18);
  border-radius: 4px;
  color: #8fa8be;
  background: rgba(7,21,36,.58);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .55rem;
  line-height: 1;
  white-space: nowrap;
}
.mock-active-users i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #47e6a1;
  box-shadow: 0 0 7px rgba(71,230,161,.75);
}
.mock-active-users strong { color: #dff5ea; font-size: .62rem; }

@media (max-width: 460px) {
  .index-page .brand-logo { width: 31px; height: 31px; }
  .index-page .promo-banner .brand h1 { font-size: 1.08rem; }
}

/* Keep brand identity and status signals grouped on small screens. */
.index-page .brand-identity,
.index-page .brand-signals {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
@media (max-width: 460px) {
  .index-page .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Report header: global actions with Copy anchored at the top-right. */
.result-page #result-wrap .report-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}
.result-page #result-wrap .report-header-actions { justify-self: end; }
@media (max-width: 600px) {
  .result-page #result-wrap .report-header {
    grid-template-columns: 1fr auto;
  }
  .result-page #result-wrap .report-header-actions {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    margin-top: 4px;
  }
  .result-page #result-wrap .copy-btn {
    grid-row: 1;
    grid-column: 2;
  }
}

/* ResearchStudio-Reel author affiliations */
.collaborator-strip {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--tech-line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(73,225,234,.035), transparent 42%), #081626;
  box-shadow: 0 16px 42px rgba(0,0,0,.18);
}
.collaborator-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}
.collaborator-heading h2 {
  margin: 0;
  color: #e4f1ff;
  font-size: 1rem;
  letter-spacing: -.02em;
}
.collaborator-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.collaborator-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 122px;
  padding: 10px 11px;
  border: 1px solid rgba(117,159,201,.15);
  border-radius: 4px;
  color: #b7cadc;
  background: rgba(11,27,45,.72);
}
.institution-logo {
  box-sizing: border-box;
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  max-width: 100%;
  height: 64px;
  padding: 6px;
  border: 1px solid rgba(117,159,201,.2);
  border-radius: 5px;
  color: #54718d;
  background: #fff;
  overflow: hidden;
}
.institution-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.institution-logo.institution-monogram {
  color: var(--tech-cyan);
  background: rgba(73,225,234,.07);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.collaborator-grid li strong {
  text-align: center;
  font-size: .69rem;
  font-weight: 650;
  line-height: 1.35;
}
@media (max-width: 760px) {
  .collaborator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .collaborator-strip { padding: 17px; }
  .collaborator-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .collaborator-grid { grid-template-columns: 1fr; }
}

/* Mobile workflow stage disclosure */
.index-page button.feature-stage-tag {
  width: 100%;
  border-style: solid;
  font: inherit;
  cursor: default;
}
.index-page button.feature-stage-tag::after {
  content: "";
  display: none;
  width: 7px;
  height: 7px;
  margin-left: auto;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
@media (max-width: 700px) {
  .index-page button.feature-stage-tag { cursor: pointer; }
  .index-page button.feature-stage-tag::after { display: block; }
  .index-page .feature-stage.is-collapsed-mobile button.feature-stage-tag::after { transform: rotate(-45deg); }
  .index-page .feature-stage.is-collapsed-mobile .feature-tabs { display: none; }
}

/* Keep the eight institution marks on one continuous row. */
.collaborator-grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(104px, 1fr);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(73,225,234,.24) transparent;
}

@media (max-width: 700px) {
  .collaborator-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 6px;
    overflow-x: visible;
  }
  .collaborator-grid li {
    min-height: 96px;
    gap: 6px;
    padding: 7px 3px;
  }
  .institution-logo {
    width: 52px;
    height: 52px;
    padding: 5px;
  }
  .collaborator-grid li strong { font-size: .6rem; }
}


.language-menu {
  position: relative;
  flex: none;
  margin: 0;
}
.language-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.language-menu > summary::-webkit-details-marker { display: none; }
.language-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.language-menu-chevron {
  display: inline-block;
  transition: transform .18s ease;
}
.language-menu[open] .language-menu-chevron { transform: rotate(180deg); }
.language-menu-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 7px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border: 1px solid rgba(73,225,234,.28);
  border-radius: 6px;
  background: rgba(5,16,29,.98);
  box-shadow: 0 18px 42px rgba(0,0,0,.42);
}
.language-menu-panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 3px;
  color: #b9cee1;
  background: transparent;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .7rem;
  text-align: left;
  cursor: pointer;
}
.language-menu-panel button:hover,
.language-menu-panel button.is-active {
  color: var(--tech-cyan);
  background: rgba(73,225,234,.09);
}
.language-menu-panel button.is-active::after { content: "✓"; }
.index-page .brand-signals > .language-menu-compact {
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 23px;
  line-height: 1;
  vertical-align: top;
}

.language-menu-compact > summary {
  width: 100%;
  line-height: 1;
  box-sizing: border-box;
  height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(73,225,234,.22);
  border-radius: 4px;
  color: #b9cee1;
  background: rgba(7,21,36,.65);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .58rem;
  font-weight: 750;
}
.language-menu-compact[open] > summary,
.language-menu-compact > summary:hover {
  border-color: var(--tech-cyan);
  color: #fff;
  background: rgba(73,225,234,.1);
}
.result-page .language-menu[open] > summary {
  border-color: rgba(73,225,234,.65);
  color: #fff;
  background: rgba(30,103,122,.25);
}

/* Preserve component geometry when switching between English and Chinese. */
.index-page .brand-signals > .github-stars-badge {
  width: 98px;
  justify-content: center;
}
.index-page .brand-signals > .mock-active-users {
  width: 75px;
  justify-content: center;
}
.index-page .brand-signals > .language-menu-compact { width: 78px; }
.index-page .promo-sub { min-height: 3.36em; }
.index-page .feature-stage-tag > span,
.index-page .feature-tab,
.index-page .banner-links .gh-link,
.index-page .arxiv-menu > summary { line-height: 1.3; }
.index-page .promo-banner .banner-links > .gh-link,
.index-page .promo-banner .arxiv-menu > summary {
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  white-space: nowrap;
}
.index-page .promo-banner .banner-links > .arxiv-menu { height: 40px; }

@media (min-width: 461px) {
  .index-page .promo-banner .banner-links > .gh-link,
  .index-page .promo-banner .banner-links > .arxiv-menu {
    box-sizing: border-box;
    flex: 0 0 174px;
    width: 174px;
  }
  .index-page .promo-banner .arxiv-menu > summary {
    box-sizing: border-box;
    width: 100%;
  }
}
.result-page .result-banner .banner-links > .gh-link,
.result-page .result-banner .banner-links > .language-menu {
  box-sizing: border-box;
  width: 104px;
}
.result-page .result-banner .language-menu-trigger {
  box-sizing: border-box;
  width: 100%;
}
@media (max-width: 700px) {
  .index-page .promo-sub { min-height: 5.04em; }
  .result-page .result-intro span {
    display: block;
    min-height: 2.8em;
  }
}
@media (max-width: 460px) {
  .index-page .brand-signals > .github-stars-badge { width: 96px; }
  .index-page .promo-banner .banner-links > .gh-link,
  .index-page .promo-banner .banner-links > .arxiv-menu { width: 100%; }
  .result-page .result-banner .banner-links > .gh-link,
  .result-page .result-banner .banner-links > .language-menu {
    flex: 1 1 0;
    width: auto;
  }
}

/* Global language control shared by the homepage and result page. */
.global-language-menu {
  position: fixed;
  z-index: 200;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  display: inline-flex;
  width: 88px;
  height: 34px;
  line-height: 1;
}
.global-language-menu > summary {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  backdrop-filter: blur(12px);
}
body[data-ui="studio"] .container { padding-top: 62px; }
@media (max-width: 700px) {
  .global-language-menu {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
  }
  body[data-ui="studio"] .container { padding-top: 56px; }
}

/* Larger, still-aligned live status typography. */
.index-page .github-stars-badge,
.index-page .mock-active-users { height: 26px; }
.index-page .github-stars-badge {
  width: 106px;
  font-size: .68rem;
}
.index-page .github-stars-badge strong { font-size: .72rem; }
.index-page .mock-active-users {
  width: 82px;
  font-size: .62rem;
}
.index-page .mock-active-users strong { font-size: .7rem; }

/* Keep translated report actions identical in size. */
.result-page #copy-report {
  box-sizing: border-box;
  width: 112px;
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}
.result-page #share-report {
  box-sizing: border-box;
  flex: 0 0 92px;
  width: 92px;
  height: 36px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .result-page #share-report {
    flex: 1 1 0;
    width: auto;
    height: 40px;
  }
}

/* Frameless global language trigger. */
.global-language-menu > summary,
.global-language-menu[open] > summary,
.global-language-menu > summary:hover {
  border: 0;
  color: #9fb6cc;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.global-language-menu > summary:hover,
.global-language-menu[open] > summary { color: var(--tech-cyan); }

/* Stable box geometry across English and Chinese labels. */
.index-page #result .copy-btn {
  box-sizing: border-box;
  width: 72px;
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}
.index-page .feature-tab {
  box-sizing: border-box;
  height: 43px;
  min-height: 43px;
  white-space: nowrap;
}
.arxiv-menu-panel a {
  box-sizing: border-box;
  min-height: 44px;
}
.result-page .qa-actions { width: 92px; }
.result-page #qa-submit {
  box-sizing: border-box;
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
}
@media (max-width: 600px) {
  .result-page .qa-actions { width: 100%; }
  .result-page #qa-submit { min-height: 42px; }
}

/* Daily usage and repository recommendation dialog. */
.usage-prompt {
  position: fixed;
  z-index: 190;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1,8,17,.76);
  backdrop-filter: blur(8px);
}
.usage-prompt[hidden] { display: none; }
body.has-usage-prompt { overflow: hidden; }
.usage-prompt-card {
  position: relative;
  box-sizing: border-box;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(73,225,234,.3);
  border-radius: 8px;
  color: #d9e9f7;
  background:
    linear-gradient(135deg, rgba(73,225,234,.055), transparent 42%),
    #081626;
  box-shadow: 0 28px 80px rgba(0,0,0,.58);
}
.usage-prompt-x {
  position: absolute;
  top: 10px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  color: #7891aa;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}
.usage-prompt-x:hover { color: var(--tech-cyan); }
.usage-prompt-kicker {
  margin: 0 0 12px;
  color: var(--tech-cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.usage-prompt-card h2 {
  margin: 0 36px 12px 0;
  color: #f0f8ff;
  font-size: 1.38rem;
  line-height: 1.25;
}
.usage-prompt-message {
  min-height: 3.3em;
  margin: 0;
  color: #9db2c7;
  font-size: .86rem;
  line-height: 1.65;
}
.usage-prompt-meta {
  margin: 14px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(117,159,201,.18);
  border-radius: 4px;
  color: #7f9ab4;
  background: rgba(3,12,23,.5);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .66rem;
}
.usage-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}
.usage-prompt-actions a,
.usage-prompt-actions button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 40px;
  padding: 0 14px;
  border-radius: 4px;
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.usage-prompt-actions a {
  border: 1px solid rgba(73,225,234,.5);
  color: #031219;
  background: var(--tech-cyan);
}
.usage-prompt-actions button {
  border: 1px solid rgba(117,159,201,.28);
  color: #a9bed2;
  background: rgba(9,24,42,.8);
}
.usage-prompt-actions a:hover { background: #7efaff; }
.usage-prompt-actions button:hover {
  border-color: rgba(73,225,234,.5);
  color: #eaffff;
}
@media (max-width: 520px) {
  .usage-prompt-card { padding: 26px 20px 20px; }
  .usage-prompt-actions { flex-direction: column; }
  .usage-prompt-actions a,
  .usage-prompt-actions button { width: 100%; }
}

/* Match the initial Research Problem and Paper PDF control heights. */
.index-page .research-input-area {
  display: flow-root;
  margin: 0;
}
.index-page .research-input-area > label {
  box-sizing: border-box;
  margin-bottom: 0;
  padding-bottom: 26px;
}
.index-page #query-input,
.index-page #pdf-input {
  box-sizing: border-box;
  height: 76px;
  min-height: 76px;
}
.index-page #query-input { line-height: 1.4; }
.index-page #query-label,
.index-page #pdf-label { margin-bottom: 0; }
.index-page #query-input,
.index-page #pdf-input { margin-bottom: 0; }
.index-page #submit-btn { margin-top: 0; }
.index-page #pdf-input {
  padding: 15px 12px;
  line-height: 44px;
  text-align: left;
}
.index-page #pdf-input::-webkit-file-upload-button,
.index-page #pdf-input::file-selector-button {
  height: 44px;
  margin: 0 12px 0 0;
  padding: 0 14px;
  border: 1px solid rgba(73,225,234,.28);
  border-radius: 4px;
  color: #bfd4e7;
  background: rgba(12,32,51,.9);
  font: inherit;
  cursor: pointer;
}
.index-page #pdf-input::-webkit-file-upload-button:hover,
.index-page #pdf-input::file-selector-button:hover {
  border-color: var(--tech-cyan);
  color: var(--tech-cyan);
}

html[lang="zh-CN"] .index-page .feature-stage:nth-of-type(3)::after { content: "即将推出"; }
