/* ═══════════════════════════════════════════════
   PAPERLINE — Research Console aesthetic
   Fraunces (display serif) + IBM Plex Sans/Mono
   Colors: deep slate + amber phosphor + steel
═══════════════════════════════════════════════ */

:root {
  --bg: #0c0d10;
  --bg-elev: #14161b;
  --bg-elev-2: #1a1d24;
  --bg-elev-3: #232830;
  --border: #232830;
  --border-bright: #2f3540;
  --text: #e8e9ed;
  --text-dim: #8a8f9b;
  --text-mute: #5a5f6b;
  --amber: #e8a247;
  --amber-bright: #f5b656;
  --amber-dim: #8a6028;
  --steel: #4d7fff;
  --green: #5eb88e;
  --red: #e85f5f;
  --grad: linear-gradient(135deg, var(--amber) 0%, #d8851f 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Grain texture ──────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(35, 40, 48, 0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 40, 48, 0.4) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center top, black 30%, transparent 70%);
}

/* ─── Top instrument bar ─────────────────── */
.instrument-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.instrument-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.readout-divider { color: var(--text-mute); }
.blink { color: var(--amber); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ─── Navigation ─────────────────────────── */
.nav {
  position: sticky;
  top: 28px;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 13, 16, 0.85);
  backdrop-filter: blur(20px);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 28px;
  font-style: italic;
  color: var(--amber);
  line-height: 1;
}

.brand-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 32px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--amber); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}

.nav-cta:hover { background: var(--amber); color: var(--bg); }
.nav-cta .arrow { transition: transform 0.2s; }
.nav-cta:hover .arrow { transform: translateX(4px); }

/* ─── Hero ──────────────────────────────── */
.hero {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 32px 140px;
  border-bottom: 1px solid var(--border);
}

.hero-corner-tl, .hero-corner-tr {
  position: absolute;
  top: 32px;
}
.hero-corner-tl { left: 32px; }
.hero-corner-tr { right: 32px; }

.corner-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-content { max-width: 900px; position: relative; z-index: 2; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 40px;
  padding: 6px 14px;
  border: 1px solid var(--amber-dim);
}

.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(232, 162, 71, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(232, 162, 71, 0); }
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(48px, 8vw, 110px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 32px;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5em;
  vertical-align: middle;
  font-variation-settings: normal;
  padding: 0 0.1em;
}

.hero-highlight {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

.hero-period { color: var(--amber); }

.hero-subtitle {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 48px;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 80px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: var(--amber);
  color: var(--bg);
  border: 1px solid var(--amber);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover { background: var(--amber-bright); transform: translateY(-1px); }
.btn-primary .btn-suffix { transition: transform 0.2s; }
.btn-primary:hover .btn-suffix { transform: translateX(4px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-large { padding: 20px 36px; font-size: 14px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-bright);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-value {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--amber);
  line-height: 1;
}
.meta-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.meta-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.hero-instrument {
  position: absolute;
  right: -100px;
  top: 80px;
  width: 500px;
  height: 500px;
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}

.hero-instrument svg { width: 100%; height: 100%; }
.rotor {
  transform-origin: 200px 200px;
  animation: rotate 30s linear infinite;
}
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mono-inline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.92em;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  color: var(--amber);
}

/* ─── Section heads ──────────────────────── */
.section-head {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 32px 60px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease;
}

.section-head.visible { opacity: 1; transform: translateY(0); }

.section-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.section-title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 680px;
  font-weight: 300;
}

/* ─── Process steps ──────────────────────── */
.process-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.step {
  background: var(--bg);
  padding: 36px 32px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  transition-delay: var(--delay, 0s);
}

.step.visible { opacity: 1; transform: translateY(0); }
.step:nth-child(1) { --delay: 0s; }
.step:nth-child(2) { --delay: 0.1s; }
.step:nth-child(3) { --delay: 0.2s; }
.step:nth-child(4) { --delay: 0.3s; }
.step:nth-child(5) { --delay: 0.4s; }
.step:nth-child(6) { --delay: 0.5s; }

.step-accent { background: linear-gradient(180deg, var(--bg) 0%, rgba(232, 162, 71, 0.05) 100%); }

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.step-num {
  color: var(--amber);
  font-weight: 600;
}

.step-stage { color: var(--text-mute); }

.step-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
}

.step-title em { font-style: italic; color: var(--amber); }

.step-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}

.step-tech { display: flex; flex-wrap: wrap; gap: 8px; }

.tech-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  border: 1px solid var(--border-bright);
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ─── Bento capability grid ──────────────── */
.bento {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bento-cell {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 36px 32px;
  position: relative;
  transition: border-color 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

.bento-cell.visible { opacity: 1; transform: translateY(0); transition: all 0.6s ease; }

.bento-cell:hover {
  border-color: var(--amber-dim);
  transform: translateY(-2px);
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-wide { grid-column: span 2; }

.cell-corner {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 24px;
  color: var(--text-mute);
}

.bento-cell h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 14px;
  max-width: 90%;
}

.bento-large h3 { font-size: 36px; }

.bento-cell p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

.separator { color: var(--amber); font-style: italic; }

.bento-illustration {
  margin-top: 32px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 24px;
}

.paper-preview { display: flex; flex-direction: column; gap: 12px; }
.paper-line {
  height: 4px;
  background: var(--border-bright);
}
.paper-line.w-full { width: 100%; }
.paper-line.w-3-4 { width: 75%; }
.paper-line.w-2-3 { width: 66%; }
.paper-line.w-1-2 { width: 50%; }

.paper-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .bento-large, .bento-wide { grid-column: span 1; grid-row: span 1; }
}

/* ─── Cost table ─────────────────────────── */
.cost-table {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 100px;
}

.cost-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease;
}

.cost-row.visible { opacity: 1; transform: translateY(0); }

.cost-header {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-mute);
  text-transform: uppercase;
}

.cost-label {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.cost-detail {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.cost-amount {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  color: var(--text);
  text-align: right;
}

.cost-total {
  border-top: 2px solid var(--amber);
  border-bottom: none;
  padding-top: 32px;
  margin-top: 16px;
}

.cost-total .cost-label { color: var(--amber); }

.cost-amount-large {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--amber);
  text-align: right;
}

/* ─── FAQ ────────────────────────────────── */
.faq-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px 100px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease;
}

.faq-item.visible { opacity: 1; transform: translateY(0); }

.faq-item summary {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 40px;
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  color: var(--amber);
  transition: transform 0.3s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--amber); }

.faq-item p {
  margin-top: 16px;
  color: var(--text-dim);
  line-height: 1.7;
  font-size: 15px;
  max-width: 80ch;
}

/* ─── Final CTA ──────────────────────────── */
.cta-final { padding: 80px 32px; }

.cta-panel {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  padding: 80px 60px;
  text-align: center;
  position: relative;
}

.cta-panel::before, .cta-panel::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--amber);
}

.cta-panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.cta-panel::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.cta-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--amber);
  margin-bottom: 24px;
}

.cta-panel h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.cta-panel h2 em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cta-panel p {
  color: var(--text-dim);
  font-size: 18px;
  margin-bottom: 40px;
}

/* ─── Footer ─────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 40px 32px; }

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════
   APPLICATION (app.html) STYLES
═══════════════════════════════════════════════ */

.app-body { display: flex; flex-direction: column; min-height: 100vh; }

.hidden { display: none !important; }

/* ─── Key Gate ───────────────────────────── */
.key-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100vh;
}

.gate-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  padding: 60px 48px;
  max-width: 520px;
  width: 100%;
  position: relative;
}

.gate-corner-tl, .gate-corner-tr {
  position: absolute;
  top: 16px;
}
.gate-corner-tl { left: 20px; }
.gate-corner-tr { right: 20px; }

.gate-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 16px;
  margin-top: 16px;
}

.gate-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.gate-title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gate-sub {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  padding: 16px 20px;
  outline: none;
  transition: border-color 0.2s;
}

.gate-form input:focus { border-color: var(--amber); }

.gate-hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-mute);
  font-family: 'IBM Plex Mono', monospace;
}

.gate-hint a { color: var(--amber); text-decoration: none; }
.gate-hint a:hover { text-decoration: underline; }

/* ─── Console ───────────────────────────── */
.console { flex: 1; display: flex; flex-direction: column; }

.console-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}

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

.header-divider { color: var(--text-mute); }

.header-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--amber);
  padding: 3px 8px;
  border: 1px solid var(--amber-dim);
}

.console-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px rgba(94, 184, 142, 0.6);
}

.header-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.header-btn:hover { color: var(--amber); }

/* ─── Tabs ─────────────────────────────── */
.console-tabs {
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 0;
  background: var(--bg);
  position: sticky;
  top: 50px;
  z-index: 20;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 18px 0;
  margin-right: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--amber); border-bottom-color: var(--amber); }
.tab-num { color: var(--text-mute); }
.tab.active .tab-num { color: var(--amber); }

.tab-badge {
  font-size: 10px;
  background: var(--bg-elev-3);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text);
}

.tab-content { display: none; padding: 40px 32px; max-width: 1200px; margin: 0 auto; width: 100%; }
.tab-content.active { display: block; }

/* ─── Upload form ──────────────────────── */
.upload-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 48px 40px;
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.upload-corner-tl {
  position: absolute;
  top: 16px;
  left: 20px;
}

.panel-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  margin-top: 16px;
}

.panel-title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.panel-sub {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.upload-form { display: flex; flex-direction: column; gap: 28px; }

.dropzone {
  border: 2px dashed var(--border-bright);
  background: var(--bg);
  padding: 48px 32px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--amber);
  background: rgba(232, 162, 71, 0.03);
}

.dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.dropzone-icon {
  width: 60px;
  height: 60px;
  color: var(--text-dim);
}

.dropzone-icon svg { width: 100%; height: 100%; }

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropzone-text strong {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
}

.dropzone-text span { color: var(--text-dim); font-size: 14px; }

.dropzone-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}

.link-btn {
  background: none;
  border: none;
  color: var(--amber);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

.link-btn:hover { color: var(--amber-bright); }

.dropzone-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elev-2);
  border: 1px solid var(--amber-dim);
  padding: 16px 20px;
  margin-top: 20px;
}

.file-info { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }

.file-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--amber);
}

.file-size {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

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

.field label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.field-num { color: var(--amber); }

.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus { border-color: var(--amber); }

.field-help {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ─── Dashboard ────────────────────────── */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 40px;
}

.jobs-list { display: flex; flex-direction: column; gap: 16px; }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--border-bright);
  background: var(--bg-elev);
}

.empty-mark {
  font-family: 'Fraunces', serif;
  font-size: 64px;
  color: var(--text-mute);
  margin-bottom: 12px;
}

.empty-state h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 24px;
  margin-bottom: 8px;
}

.empty-state p { color: var(--text-dim); font-size: 14px; }

.job-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  transition: border-color 0.2s;
}

.job-card:hover { border-color: var(--border-bright); }

.job-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.job-name {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 20px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.job-id { color: var(--text-mute); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-badge.queued { color: var(--text-dim); border-color: var(--border-bright); }
.status-badge.analyzing,
.status-badge.outlining,
.status-badge.writing,
.status-badge.paraphrasing {
  color: var(--amber);
  border-color: var(--amber-dim);
  background: rgba(232, 162, 71, 0.05);
}
.status-badge.paper_ready,
.status-badge.completed {
  color: var(--green);
  border-color: var(--green);
  background: rgba(94, 184, 142, 0.05);
}
.status-badge.failed {
  color: var(--red);
  border-color: var(--red);
  background: rgba(232, 95, 95, 0.05);
}

.status-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

.status-badge.analyzing .dot,
.status-badge.outlining .dot,
.status-badge.writing .dot,
.status-badge.paraphrasing .dot {
  animation: blink 1.2s infinite;
}

.job-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.action-btn {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.action-btn:hover { border-color: var(--amber); color: var(--amber); }

.action-btn.primary {
  background: var(--amber);
  color: var(--bg);
  border-color: var(--amber);
}
.action-btn.primary:hover { background: var(--amber-bright); border-color: var(--amber-bright); color: var(--bg); }

.action-btn.danger:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 700px) {
  .job-card { grid-template-columns: 1fr; }
  .job-actions { justify-content: flex-start; }
}

/* ─── Toasts ────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--amber); }

.toast strong { display: block; margin-bottom: 4px; font-family: 'Fraunces', serif; font-weight: 500; }
.toast span { color: var(--text-dim); font-size: 13px; }

/* ─── Responsive ────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 60px 20px 80px; }
  .hero-instrument { display: none; }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 16px; }
  .meta-divider { display: none; }
  .console-header, .console-tabs, .tab-content { padding-left: 20px; padding-right: 20px; }
  .upload-panel, .gate-panel { padding: 32px 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .toast-container { right: 16px; left: 16px; bottom: 16px; }
}
