:root {
  color-scheme: dark;
  --ink: #f8f5fb;
  --muted: #aaa1b3;
  --dim: #736a7d;
  --bg: #0d0711;
  --surface: #17101c;
  --surface-2: #201627;
  --line: rgba(255,255,255,.1);
  --purple: #7d45d4;
  --purple-soft: #b58ce9;
  --gold: #eaba4a;
  --success: #4bd69b;
  --danger: #ff6b80;
  --warning: #f8bc5d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 78% 0%, rgba(88,38,128,.22), transparent 34rem), var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { height: 74px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(13,7,17,.86); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.brand-mark img { width: 38px; height: 30px; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .02em; }
.brand small { color: var(--muted); margin-top: 1px; font-size: 11px; }
.system-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status-dot.online { background: var(--success); box-shadow: 0 0 12px rgba(75,214,155,.8); }
.shell { width: min(1240px, 100%); margin: 0 auto; display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 74px); }
.rail { border-right: 1px solid var(--line); padding: 52px 34px; }
.eyebrow { color: var(--purple-soft); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 13px; }
.steps { list-style: none; padding: 0; margin: 29px 0 0; }
.steps li { display: flex; gap: 14px; position: relative; min-height: 84px; color: var(--dim); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 8px; width: 1px; background: var(--line); }
.steps li > span { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-size: 12px; font-weight: 700; background: var(--bg); z-index: 1; }
.steps strong, .steps small { display: block; }
.steps strong { color: inherit; font-size: 14px; margin-top: 4px; }
.steps small { margin-top: 4px; color: var(--dim); font-size: 11px; }
.steps li.active { color: var(--ink); }
.steps li.active > span { background: var(--purple); border-color: var(--purple); box-shadow: 0 0 0 5px rgba(125,69,212,.15); }
.steps li.complete > span { background: var(--success); color: #08261a; border-color: var(--success); }
.rail-note { margin-top: 34px; border: 1px solid rgba(234,186,74,.2); background: rgba(234,186,74,.05); padding: 17px; border-radius: 14px; }
.rail-note span { color: var(--gold); font-weight: 800; font-size: 13px; }
.rail-note p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 7px 0 0; }
.workspace { padding: 68px clamp(28px, 7vw, 92px); min-width: 0; }
.view { animation: enter .32s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.intro { max-width: 720px; }
h1, h2 { letter-spacing: -.035em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(38px, 5vw, 64px); max-width: 760px; }
h2 { font-size: clamp(30px, 4vw, 43px); }
.intro > p:last-child, .section-heading p { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 600px; }
.upload-card { margin-top: 39px; }
.drop-zone { width: 100%; min-height: 270px; border: 1px dashed rgba(181,140,233,.42); border-radius: 22px; color: inherit; background: linear-gradient(145deg, rgba(125,69,212,.08), rgba(255,255,255,.018)); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--gold); background: rgba(234,186,74,.055); transform: translateY(-2px); }
.drop-zone.busy { pointer-events: none; opacity: .65; }
.upload-glyph { width: 57px; height: 57px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 8px; background: rgba(125,69,212,.17); color: var(--purple-soft); }
.upload-glyph svg, .complete-icon svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { font-size: 17px; }
.drop-zone > span:not(.upload-glyph) { color: var(--purple-soft); font-size: 13px; }
.drop-zone small { color: var(--dim); margin-top: 12px; }
.file-schema { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; color: var(--dim); font-size: 11px; }
.file-schema span:not(:first-child) { margin-left: 12px; }
.file-schema code { color: var(--muted); border: 1px solid var(--line); background: var(--surface); padding: 5px 8px; border-radius: 7px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.muted { color: var(--muted); }
.text-button { border: 0; background: none; color: var(--purple-soft); cursor: pointer; padding: 7px 0; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 34px 0; }
.metrics article { border: 1px solid var(--line); background: var(--surface); padding: 18px 20px; border-radius: 14px; }
.metrics span, .metrics strong { display: block; }
.metrics span { color: var(--muted); font-size: 11px; }
.metrics strong { font-size: 29px; margin-top: 8px; letter-spacing: -.03em; }
.metrics .success strong { color: var(--success); }
.metrics .danger strong { color: var(--danger); }
.metrics .warning strong { color: var(--warning); }
.issues-panel { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow: hidden; }
.issues-panel summary { padding: 17px 20px; display: flex; justify-content: space-between; cursor: pointer; font-size: 13px; font-weight: 700; }
.issues-panel summary::marker { color: var(--purple-soft); }
.issues-panel summary span:last-child { color: var(--danger); font-weight: 500; }
.table-scroll { overflow: auto; max-height: 340px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; position: sticky; top: 0; background: var(--surface-2); }
td { color: var(--muted); }
.tag { color: var(--ink); }
.generation-options { margin-top: 20px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; padding: 18px 20px; }
.generation-options > div { margin-right: auto; }
.generation-options strong { font-size: 13px; }
.generation-options p { color: var(--dim); font-size: 11px; margin: 5px 0 0; }
.generation-options label { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 12px; cursor: pointer; }
.generation-options input { accent-color: var(--purple); }
.primary-action { margin-top: 29px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 13px 20px; font-weight: 750; font-size: 13px; text-decoration: none; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; }
.primary-button { color: white; background: linear-gradient(135deg, #8b4ee3, #6331a7); box-shadow: 0 12px 30px rgba(92,42,151,.3); }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { opacity: .42; pointer-events: none; }
.secondary-button { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
.primary-action p { font-size: 11px; max-width: 340px; }
.processing-card, .complete-card { max-width: 690px; margin: 20px auto; text-align: center; padding: 56px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.spinner { width: 48px; height: 48px; border: 3px solid rgba(181,140,233,.16); border-top-color: var(--purple-soft); border-radius: 50%; margin: 0 auto 28px; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-card > .muted, .complete-card > .muted { line-height: 1.65; }
.progress-row { display: flex; justify-content: space-between; margin-top: 34px; color: var(--muted); font-size: 12px; }
.progress-row strong { color: var(--ink); }
.progress-track { height: 9px; background: #2a2030; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--gold)); transition: width .35s ease; }
.metrics.compact { grid-template-columns: repeat(3, 1fr); margin: 27px 0 0; }
.complete-card .metrics.compact { grid-template-columns: repeat(2, 1fr); }
.complete-icon { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 27px; color: #08261a; background: var(--success); box-shadow: 0 0 0 10px rgba(75,214,155,.08); }
.complete-actions { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.retention-note { color: var(--dim); font-size: 10px; margin: 18px 0 0; }
.alert { margin-bottom: 22px; padding: 13px 16px; border: 1px solid rgba(255,107,128,.35); background: rgba(255,107,128,.09); color: #ff9aaa; border-radius: 11px; font-size: 13px; }
@media (max-width: 840px) {
  .shell { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px; }
  .rail > .eyebrow, .rail-note, .steps small { display: none; }
  .steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
  .steps li { min-height: 38px; align-items: center; }
  .steps li:not(:last-child)::after { left: 38px; right: 8px; top: 16px; bottom: auto; width: auto; height: 1px; }
  .steps li div { display: none; }
  .workspace { padding: 44px 24px; }
}
@media (max-width: 620px) {
  .topbar { padding: 0 18px; }
  .system-status { font-size: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .section-heading { display: block; }
  .generation-options { align-items: flex-start; flex-wrap: wrap; }
  .generation-options > div { width: 100%; }
  .processing-card, .complete-card { padding: 34px 20px; }
  .complete-actions { flex-direction: column; }
  h1 { font-size: 42px; }
  .drop-zone { min-height: 240px; }
}
