:root {
  color-scheme: dark;
  --bg: #030606;
  --panel: rgba(7, 17, 17, 0.74);
  --panel-strong: rgba(10, 31, 30, 0.88);
  --line: rgba(177, 255, 233, 0.16);
  --text: #effff9;
  --muted: #9fc6bb;
  --green: #63f0a3;
  --cyan: #7de8ff;
  --danger: #ff8d8d;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  min-height: 100%;
  background-color: #071411;
  background-image: linear-gradient(180deg, #071411 0, #071411 180px, #020404 100%);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background-color: #071411;
  background-image: radial-gradient(circle at 18% -120px, rgba(99, 240, 163, 0.48), transparent 420px), radial-gradient(circle at 88% -80px, rgba(125, 232, 255, 0.26), transparent 360px), linear-gradient(135deg, #071411 0%, #071411 24%, #020404 66%, #030606 100%);
  color: var(--text);
}
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  top: -160px;
  left: 0;
  right: 0;
  height: calc(260px + env(safe-area-inset-top));
  pointer-events: none;
  background: radial-gradient(circle at 20% 0, rgba(99, 240, 163, 0.58), transparent 360px), linear-gradient(180deg, #071411, rgba(7, 20, 17, 0));
}
body::before {
  content: "";
  position: fixed;
  inset: -120px 0 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at top, black, transparent 72%);
}
button, input, select, textarea { font: inherit; }
.shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0; }
.hero { display: grid; gap: 18px; margin-bottom: 28px; }
.eyebrow, .section-kicker { color: var(--green); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(4rem, 10vw, 9rem); line-height: 0.9; letter-spacing: -0.09em; }
.hero p { max-width: 760px; margin: 10px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.65; }
.pipeline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.pipeline span, .pipeline strong { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: rgba(255, 255, 255, 0.055); color: #d8fff0; }
.pipeline strong { color: #06100c; background: linear-gradient(135deg, var(--green), var(--cyan)); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.96fr); gap: 22px; align-items: stretch; }
.panel { border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(180deg, var(--panel), rgba(4, 10, 10, 0.72)); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.stack-panel { margin-top: 22px; padding: 22px; display: grid; gap: 16px; overflow: hidden; position: relative; }
.stack-panel h2 { max-width: 620px; margin: 6px 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.24rem); font-weight: 600; line-height: 1.45; letter-spacing: -0.02em; }
.stack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; perspective: 1200px; }
.stack-grid div { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 16px; background: linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.026)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 42px rgba(0,0,0,.28), 0 0 0 1px rgba(99,240,163,.03); transform: translateZ(0); transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.stack-grid div::before { content: ""; position: absolute; inset: -1px; background: radial-gradient(circle at 18% 0%, rgba(99,240,163,.22), transparent 42%), radial-gradient(circle at 92% 100%, rgba(125,232,255,.16), transparent 38%); opacity: .72; pointer-events: none; }
.stack-grid div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.1) 45%, transparent 62%); transform: translateX(-120%); transition: transform 520ms ease; pointer-events: none; }
.stack-grid div:hover { transform: translateY(-4px) rotateX(2deg); border-color: rgba(125,232,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 24px 60px rgba(0,0,0,.38), 0 0 32px rgba(99,240,163,.1); }
.stack-grid div:hover::after { transform: translateX(120%); }
.stack-grid strong { position: relative; z-index: 1; display: block; color: #ffffff; margin-bottom: 5px; }
.stack-grid span { position: relative; z-index: 1; color: var(--muted); line-height: 1.45; font-size: .94rem; }
.controls { padding: 18px; display: grid; gap: 18px; }
.drop-zone { min-height: 330px; display: grid; place-items: center; border: 1px dashed rgba(125, 232, 255, 0.34); border-radius: 24px; cursor: pointer; overflow: hidden; background: radial-gradient(circle at center, rgba(125, 232, 255, 0.12), rgba(255, 255, 255, 0.035)); transition: border-color 180ms ease, transform 180ms ease, background 180ms ease; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone:focus-visible { border-color: var(--green); transform: translateY(-1px); outline: none; background: radial-gradient(circle at center, rgba(99, 240, 163, 0.16), rgba(255, 255, 255, 0.045)); }
.empty-upload { display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--muted); }
.empty-upload strong { display: block; color: var(--text); font-size: 1.15rem; }
.empty-upload span { display: block; margin-top: 4px; }
.upload-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 24px; background: linear-gradient(135deg, var(--green), var(--cyan)); color: #03100a; font-size: 2.4rem; font-weight: 300; }
.preview { width: 100%; height: 100%; max-height: 460px; object-fit: contain; background: rgba(0,0,0,.22); }
.field-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field span { color: #cbfff0; font-weight: 700; }
select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; background: rgba(2, 8, 8, 0.82); color: var(--text); padding: 14px 15px; outline: none; }
select:focus, textarea:focus { border-color: rgba(99, 240, 163, 0.72); }
textarea { resize: vertical; min-height: 112px; line-height: 1.55; }
option:disabled { color: #6f807b; }
.actions { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
button { border: 0; border-radius: 999px; padding: 14px 22px; color: #03100a; background: linear-gradient(135deg, var(--green), var(--cyan)); font-weight: 900; cursor: pointer; box-shadow: 0 16px 38px rgba(99, 240, 163, 0.18); }
button:disabled { opacity: .45; cursor: not-allowed; }
.actions p { margin: 0; color: var(--muted); font-size: .92rem; }
.result-panel { padding: 24px; min-height: 100%; display: grid; grid-template-rows: auto 1fr; gap: 20px; }
.result-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.result-head h2 { margin: 6px 0 0; font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.04em; }
.status-pill { border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; color: var(--muted); background: rgba(255,255,255,.045); font-size: .82rem; white-space: nowrap; }
.status-pill.loading { color: var(--cyan); }
.status-pill.success { color: var(--green); }
.status-pill.error { color: var(--danger); }
.result-body { min-height: 320px; border-radius: 22px; border: 1px solid rgba(255,255,255,.1); background: var(--panel-strong); padding: 20px; color: #d9fff2; line-height: 1.7; white-space: pre-wrap; }
.result-body.empty { color: var(--muted); }
.result-body.error { color: #ffd0d0; border-color: rgba(255, 141, 141, 0.38); }
.result-body p { margin: 0 0 1rem; }
.result-body p:last-child { margin-bottom: 0; }
.result-body ul { margin: 0 0 1rem 1.2rem; padding: 0; }
.result-body li { margin: .42rem 0; }
.result-body strong { color: #ffffff; font-weight: 850; }
.result-body code { color: var(--cyan); }
.result-bullet { display: grid; grid-template-columns: 1rem 1fr; gap: .55rem; margin: .45rem 0; }
.result-bullet-mark { color: var(--green); line-height: 1.7; }
.result-gap { height: .75rem; }
.result-heading { margin: 1.1rem 0 .45rem; color: #ffffff; font-size: 1.08rem; font-weight: 900; letter-spacing: -0.01em; }
.result-heading:first-child { margin-top: 0; }
.loading-state { display: grid; place-items: center; overflow: hidden; position: relative; white-space: normal; }
.loading-state::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 180deg, transparent, rgba(125,232,255,.14), transparent, rgba(99,240,163,.16), transparent); animation: loadingSweep 4.2s linear infinite; }
.ai-loader { position: relative; z-index: 1; display: grid; justify-items: center; gap: 20px; text-align: center; max-width: 420px; }
.ai-loader strong { display: block; font-size: 1.25rem; color: #ffffff; }
.ai-loader p { margin: .35rem 0 0; color: var(--muted); }
.ai-orb { width: 92px; height: 92px; border-radius: 999px; position: relative; display: grid; place-items: center; background: radial-gradient(circle, rgba(125,232,255,.34), rgba(99,240,163,.14) 42%, rgba(255,255,255,.04) 68%); box-shadow: 0 0 38px rgba(125,232,255,.28); animation: orbPulse 1.9s ease-in-out infinite; }
.ai-orb span { position: absolute; inset: 10px; border-radius: inherit; border: 1px solid rgba(255,255,255,.24); animation: ringSpin 2.4s linear infinite; }
.ai-orb span:nth-child(2) { inset: 20px; animation-duration: 1.7s; animation-direction: reverse; border-color: rgba(99,240,163,.34); }
.ai-orb span:nth-child(3) { inset: 32px; background: linear-gradient(135deg, var(--green), var(--cyan)); border: 0; animation: none; box-shadow: 0 0 22px rgba(99,240,163,.58); }
.loading-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.loading-dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--green); animation: dotBounce 1s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: .15s; background: var(--cyan); }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes loadingSweep { to { transform: rotate(360deg); } }
@keyframes orbPulse { 50% { transform: scale(1.06); box-shadow: 0 0 56px rgba(99,240,163,.34); } }
@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes dotBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-8px); opacity: 1; } }

@media (max-width: 900px) { .workspace, .stack-grid { grid-template-columns: 1fr; } .drop-zone { min-height: 260px; } .result-panel { min-height: auto; grid-template-rows: auto auto; } .result-body { min-height: 200px; } }
