:root{
  --bg:#041225;
  --bg-deep:#020b17;
  --surface:#071d38;
  --surface-2:#0b294e;
  --surface-light:#f7fbff;
  --primary:#1464d2;
  --primary-hover:#2d8cff;
  --accent:#63d8ff;
  --text:#f7fbff;
  --text-dark:#0a1b2f;
  --muted:#9fb6cf;
  --muted-dark:#5d7188;
  --border:rgba(220,230,242,.18);
  --border-light:#dce6f2;
  --success:#2bb673;
  --warning:#e1a93b;
  --error:#d84f56;
  --focus:#63d8ff;
  --radius:18px;
  --radius-sm:12px;
  --shadow:0 24px 70px rgba(0,0,0,.28);
  --shadow-soft:0 12px 35px rgba(3,23,47,.12);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html{background:var(--bg-deep)}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(45,140,255,.16), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(99,216,255,.11), transparent 28%),
    linear-gradient(180deg,#061a33 0%,#041225 42%,#020b17 100%);
  overflow-x:hidden;
}
button,input,textarea{font:inherit}
button{cursor:pointer}
.ambient{position:fixed;pointer-events:none;filter:blur(80px);opacity:.28;border-radius:50%}
.ambient-one{width:420px;height:420px;background:#1464d2;right:-160px;top:160px}
.ambient-two{width:320px;height:320px;background:#63d8ff;left:-170px;bottom:90px;opacity:.12}
.shell{max-width:1180px;margin:0 auto;padding:34px 24px 54px;position:relative;z-index:1}
.app-header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:26px}
.brand-lockup{display:flex;align-items:center;gap:16px}
.brand-mark{
  width:70px;height:70px;border-radius:18px;
  background:linear-gradient(145deg,rgba(45,140,255,.18),rgba(99,216,255,.06));
  border:1px solid rgba(99,216,255,.26);
  display:grid;place-items:center;box-shadow:inset 0 0 28px rgba(45,140,255,.10)
}
.brand-mark img{width:54px;height:54px;object-fit:contain}
.brand-copy h1{font-size:2.25rem;letter-spacing:-.045em;margin:1px 0 2px}
.brand-copy p{margin:0;color:var(--muted);font-size:.98rem}
.eyebrow,.section-kicker,.hero-kicker,.status-label{
  font-size:.72rem;letter-spacing:.17em;font-weight:800;text-transform:uppercase;color:var(--accent)
}
.status-wrap{display:flex;align-items:center;gap:10px}
.status-label{color:#7f9cba}
.badge{
  display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border-radius:999px;
  font-size:.78rem;font-weight:800;letter-spacing:.08em;border:1px solid var(--border)
}
.badge-dot{width:7px;height:7px;border-radius:50%;background:currentColor;box-shadow:0 0 12px currentColor}
.neutral{background:rgba(220,230,242,.08);color:#dce6f2}
.pass{background:rgba(43,182,115,.14);border-color:rgba(43,182,115,.36);color:#72dfa7}
.stop{background:rgba(216,79,86,.14);border-color:rgba(216,79,86,.4);color:#ff8b91}
.hero-card{
  position:relative;overflow:hidden;display:flex;justify-content:space-between;align-items:center;
  min-height:240px;padding:36px 38px;margin-bottom:22px;border-radius:26px;
  border:1px solid rgba(99,216,255,.17);
  background:linear-gradient(135deg,rgba(11,47,102,.88),rgba(6,26,51,.92) 56%,rgba(4,18,37,.98));
  box-shadow:var(--shadow)
}
.hero-card:after{
  content:"";position:absolute;right:-90px;top:-110px;width:430px;height:430px;border-radius:50%;
  background:radial-gradient(circle,rgba(99,216,255,.16),rgba(45,140,255,.06) 42%,transparent 68%)
}
.hero-copy{position:relative;z-index:2;max-width:680px}
.hero-copy h2{font-size:clamp(2rem,4vw,3.6rem);line-height:1.02;letter-spacing:-.055em;margin:11px 0 16px}
.hero-copy p{max-width:650px;color:#b8cbe0;font-size:1.06rem;line-height:1.65;margin:0}
.hero-radiance{position:relative;width:220px;height:160px;z-index:2}
.hero-radiance span{
  position:absolute;width:2px;height:105px;background:linear-gradient(180deg,var(--accent),transparent);
  left:50%;bottom:0;transform-origin:bottom;border-radius:99px;opacity:.55
}
.hero-radiance span:nth-child(1){transform:rotate(-52deg)}
.hero-radiance span:nth-child(2){transform:rotate(-27deg)}
.hero-radiance span:nth-child(3){transform:rotate(0)}
.hero-radiance span:nth-child(4){transform:rotate(27deg)}
.hero-radiance span:nth-child(5){transform:rotate(52deg)}
.mode-nav{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}
.mode{
  display:flex;text-align:left;align-items:center;gap:13px;padding:15px 17px;border-radius:15px;
  border:1px solid var(--border);background:rgba(7,29,56,.64);color:var(--text);
  transition:.18s ease
}
.mode:hover{border-color:rgba(99,216,255,.38);transform:translateY(-1px)}
.mode.active{
  background:linear-gradient(135deg,rgba(20,100,210,.34),rgba(11,47,102,.68));
  border-color:rgba(99,216,255,.52);box-shadow:inset 0 0 26px rgba(45,140,255,.07)
}
.mode-icon{
  width:42px;height:42px;border-radius:12px;display:grid;place-items:center;
  color:var(--accent);font-size:1.5rem;background:rgba(99,216,255,.07);border:1px solid rgba(99,216,255,.15)
}
.mode strong{display:block;font-size:.96rem}
.mode small{display:block;color:var(--muted);font-size:.78rem;margin-top:3px}
.panel{
  border:1px solid var(--border);border-radius:var(--radius);padding:30px;margin-bottom:18px;
  background:rgba(7,29,56,.78);box-shadow:var(--shadow-soft);backdrop-filter:blur(12px)
}
.section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:25px}
.section-heading h2{font-size:1.65rem;letter-spacing:-.03em;margin:5px 0 7px}
.section-heading p{margin:0;color:var(--muted);line-height:1.55;max-width:690px}
.mini-pill{white-space:nowrap;border:1px solid rgba(99,216,255,.20);background:rgba(99,216,255,.06);color:#bceeff;border-radius:999px;padding:8px 11px;font-size:.76rem}
.field-grid{max-width:520px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.field{display:block;font-weight:700;color:#eef7ff;margin-bottom:17px}
.field>span{display:block;margin-bottom:8px;font-size:.9rem}
.field small{display:block;color:#7f9cba;font-weight:500;font-size:.77rem;margin-top:7px}
input,textarea{
  display:block;width:100%;border-radius:12px;border:1px solid rgba(220,230,242,.20);
  background:rgba(3,15,30,.58);color:var(--text);padding:13px 14px;outline:none;
  transition:border-color .15s,box-shadow .15s,background .15s
}
input::placeholder,textarea::placeholder{color:#667f99}
input:focus,textarea:focus{
  border-color:var(--focus);box-shadow:0 0 0 3px rgba(99,216,255,.12);background:rgba(3,15,30,.78)
}
textarea{resize:vertical;min-height:145px;line-height:1.55}
.query-field{margin-bottom:20px}
.actions{display:flex;gap:10px;align-items:center}
.actions button{
  min-height:44px;border-radius:11px;padding:0 17px;font-weight:800;border:1px solid transparent;
  transition:.16s ease
}
.actions button:hover{transform:translateY(-1px)}
.primary-action{
  display:inline-flex;align-items:center;justify-content:center;gap:15px;
  color:white;background:linear-gradient(135deg,var(--primary),#1e78e8);border-color:#2d8cff!important;
  box-shadow:0 10px 22px rgba(20,100,210,.24)
}
.primary-action:hover{background:linear-gradient(135deg,#1d72e3,var(--primary-hover))}
.action-arrow{font-size:1.15rem}
.secondary{background:rgba(247,251,255,.05);color:#dce6f2;border-color:rgba(220,230,242,.20)!important}
.secondary:hover{border-color:rgba(99,216,255,.35)!important;background:rgba(99,216,255,.07)}
.secondary.emphasis{border-color:rgba(45,140,255,.42)!important;color:#b9dbff}
.secondary.quiet{opacity:.8}
.danger{background:rgba(216,79,86,.12);color:#ff969b;border-color:rgba(216,79,86,.38)!important}
.danger:hover{background:rgba(216,79,86,.20)}
.wrap{flex-wrap:wrap}
.manage-actions{margin-top:6px}
.upload-card{
  display:flex;align-items:center;gap:16px;padding:16px 17px;margin-bottom:17px;
  border:1px dashed rgba(99,216,255,.27);border-radius:14px;background:rgba(99,216,255,.035)
}
.upload-icon{
  flex:0 0 auto;width:54px;height:54px;border-radius:13px;display:grid;place-items:center;
  font-size:.72rem;font-weight:900;letter-spacing:.05em;color:var(--accent);
  border:1px solid rgba(99,216,255,.22);background:rgba(20,100,210,.12)
}
.upload-field{margin:0;flex:1}
input[type=file]{padding:10px}
.result{
  margin-top:25px;padding:24px;border-radius:16px;background:var(--surface-light);color:var(--text-dark);
  border:1px solid var(--border-light);box-shadow:0 18px 45px rgba(0,0,0,.17)
}
.result-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:17px}
.result-heading h2{margin:4px 0 0;font-size:1.35rem;letter-spacing:-.025em}
.result-heading .section-kicker{color:#1464d2}
.result-state{
  border-radius:999px;padding:7px 10px;font-size:.73rem;font-weight:900;letter-spacing:.09em;
  background:#e6f7ee;color:#178653;border:1px solid #bce9d1
}
.source-strip{
  display:grid;grid-template-columns:1.4fr .6fr 1fr 1fr;gap:1px;background:#dce6f2;
  border:1px solid #dce6f2;border-radius:12px;overflow:hidden;margin-bottom:17px
}
.source-strip>div{background:white;padding:12px 13px;min-width:0}
.source-strip span{display:block;color:#667b91;font-size:.67rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:4px}
.source-strip strong{font-size:.85rem;word-break:break-word;color:#0b2f66}
.passage-card{
  padding:18px 20px;background:linear-gradient(135deg,#f1f7ff,#f9fcff);
  border-left:4px solid var(--primary);border-radius:10px;margin-bottom:15px
}
.passage-label{font-size:.7rem;font-weight:900;text-transform:uppercase;letter-spacing:.1em;color:#1464d2}
.passage-card p{font-size:1rem;line-height:1.68;color:#18324d;margin:10px 0 0}
.technical-details{border-top:1px solid #dce6f2;padding-top:13px}
.technical-details summary{cursor:pointer;color:#37526d;font-size:.82rem;font-weight:800}
pre{
  white-space:pre-wrap;word-break:break-word;background:#061a33;color:#d9eaff;padding:16px;border-radius:11px;
  max-height:520px;overflow:auto;font-size:.78rem;line-height:1.55;margin:13px 0 0;border:1px solid #113b6f
}
.error{
  display:flex;gap:14px;align-items:flex-start;padding:20px 22px;margin-bottom:18px;border-radius:15px;
  background:rgba(216,79,86,.11);border:1px solid rgba(216,79,86,.34)
}
.error-icon{
  width:38px;height:38px;flex:0 0 auto;border-radius:50%;display:grid;place-items:center;
  background:rgba(216,79,86,.18);color:#ff9da2;font-weight:900
}
.error-kicker{color:#ff9da2}
.error strong{display:block;margin:4px 0 5px;font-size:1rem;color:#ffd4d6}
.error div{color:#f7c1c4}
.error small{display:block;color:#cf9ca0;margin-top:5px}
footer{
  display:flex;justify-content:space-between;align-items:center;gap:20px;color:#718ba5;
  padding:18px 3px 0;font-size:.78rem
}
.footer-brand{display:flex;align-items:center;gap:8px;color:#a9c0d7;font-weight:800}
.footer-brand img{width:25px;height:25px;object-fit:contain}
footer p{margin:0;text-align:right}
.hidden{display:none!important}
@media(max-width:800px){
  .shell{padding:22px 15px 38px}
  .app-header,.section-heading,footer{align-items:flex-start;flex-direction:column}
  .status-wrap{align-self:flex-start}
  .hero-card{padding:28px 24px;min-height:0}
  .hero-radiance{display:none}
  .mode-nav,.grid{grid-template-columns:1fr}
  .source-strip{grid-template-columns:1fr 1fr}
  .panel{padding:23px 18px}
  .mini-pill{white-space:normal}
  footer p{text-align:left}
}
@media(max-width:520px){
  .brand-mark{width:58px;height:58px}
  .brand-mark img{width:45px;height:45px}
  .brand-copy h1{font-size:1.9rem}
  .hero-copy h2{font-size:2rem}
  .source-strip{grid-template-columns:1fr}
  .actions{align-items:stretch;flex-direction:column}
  .actions button{width:100%}
  .upload-card{align-items:flex-start}
}
