:root {
  --bg: #020311;
  --panel: rgba(7, 8, 27, .72);
  --panel-strong: #0b0d2c;
  --line: rgba(146, 132, 255, .22);
  --text: #f5f4ff;
  --muted: #9898b6;
  --accent: #7c6cff;
  --accent-strong: #67d9ff;
  --danger: #ff9b9b;
  --shadow: 0 28px 80px rgba(0, 0, 0, .44);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; height: 100dvh; overflow: hidden; background: radial-gradient(circle at 50% 32%, #10134a 0, var(--bg) 52%); }
button, input, textarea { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; width: 25rem; height: 25rem; border-radius: 50%; filter: blur(90px); opacity: .14; pointer-events: none; }
.ambient-one { background: #4ce1a8; top: -13rem; right: -9rem; }
.ambient-two { background: #4479ff; bottom: -18rem; left: -15rem; }
.shell { width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)); display: grid; align-items: center; }
.auth-card, .app { position: relative; width: 100%; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.auth-card { max-width: 420px; margin: auto; padding: 36px 26px; border-radius: 28px; }
.auth-card h1 { margin: 8px 0 10px; font-size: clamp(1.9rem, 7vw, 2.6rem); letter-spacing: -.04em; }
.brand-mark { width: 56px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #d8fff1 0 5%, #6fe0b9 16%, rgba(70, 203, 161, .25) 42%, transparent 68%); box-shadow: 0 0 34px rgba(90, 232, 187, .35); }
.brand-mark span { width: 12px; aspect-ratio: 1; border-radius: 50%; background: #eafff8; box-shadow: 0 0 18px #aaffdf; }
.brand-mark.small { width: 42px; }
.brand-mark.small span { width: 9px; }
.eyebrow { margin: 20px 0 0; color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.muted, .file-hint { color: var(--muted); line-height: 1.55; }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { color: #bed2cb; font-size: .86rem; font-weight: 650; }
input:not([type=file]), textarea { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 14px; outline: none; color: var(--text); background: rgba(4, 12, 10, .55); transition: border-color .2s, box-shadow .2s; }
input:not([type=file]) { padding: 13px 14px; }
input:focus, textarea:focus { border-color: rgba(121, 225, 189, .7); box-shadow: 0 0 0 3px rgba(121, 225, 189, .1); }
.primary { min-height: 48px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--accent-strong), var(--accent)); color: #062019; font-weight: 800; cursor: pointer; }
.primary:disabled, .send:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 1.3em; margin: 0; color: var(--danger); font-size: .86rem; }
.app { position:relative; height: calc(100dvh - 28px); border-radius: 27px; display: flex; flex-direction: column; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 10px; }
.identity { display: flex; align-items: center; gap: 11px; }
.identity strong { display: block; letter-spacing: .18em; font-size: .88rem; }
.presence { display: block; margin-top: 3px; color: var(--muted); font-size: .7rem; }
.presence.online { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 5px; }
.icon-button, .text-button, .tab { border: 0; background: transparent; cursor: pointer; }
.icon-button { width: 40px; height: 40px; padding: 10px; border-radius: 50%; fill: var(--muted); }
.icon-button:disabled { cursor: not-allowed; opacity: .45; }
.text-button { padding: 9px; color: var(--muted); font-size: .76rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 13px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; height: 2px; left: 22%; right: 22%; bottom: -1px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.panel { flex: 1; min-height: 0; }
.chat-panel { position:relative; z-index:2; display: flex; flex-direction: column; background:linear-gradient(180deg,transparent,rgba(2,3,17,.58) 34%,rgba(2,3,17,.94) 78%); }
.messages { flex: 1; min-height: 260px; max-height: calc(100dvh - 245px); padding: 24px 16px 12px; overflow-y: auto; scrollbar-color: rgba(121,225,189,.3) transparent; }
.message { display: flex; align-items: flex-end; gap: 9px; margin: 0 0 17px; animation: arrive .25s ease-out; }
.message.user { justify-content: flex-end; }
.avatar { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #08251d; background: var(--accent); font-size: .7rem; font-weight: 850; box-shadow: 0 0 18px rgba(121, 225, 189, .2); }
.bubble { max-width: min(85%, 580px); padding: 11px 13px; border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; background: rgba(18, 39, 33, .9); line-height: 1.5; }
.user .bubble { border-color: rgba(121, 225, 189, .22); border-radius: 18px 18px 5px 18px; background: rgba(42, 91, 74, .64); }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble span { display: block; margin-top: 6px; color: var(--muted); font-size: .66rem; }
.message.pending .bubble p::after { content: ""; display: inline-block; width: 1em; height: .4em; margin-left: .4em; border-bottom: 2px dotted var(--accent); animation: pulse 1s infinite; }
.composer { display: flex; align-items: flex-end; gap: 9px; margin: 0 12px; padding: 8px 8px 8px 13px; border: 1px solid var(--line); border-radius: 19px; background: rgba(4, 13, 11, .72); }
.composer textarea { min-height: 42px; max-height: 140px; margin: 0; padding: 10px 2px; resize: none; border: 0; background: transparent; box-shadow: none; line-height: 1.4; }
.send { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--accent); fill: #062019; cursor: pointer; }
.send svg { width: 21px; }
.privacy-note { margin: 8px 14px 11px; text-align: center; color: #647d75; font-size: .63rem; }
.documents-panel { padding: 24px 16px; overflow-y: auto; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.section-heading .eyebrow { margin: 0 0 4px; }
.section-heading h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.03em; }
.upload-button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid rgba(121,225,189,.4); border-radius: 12px; color: var(--accent-strong); cursor: pointer; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.local-banner { display: flex; gap: 12px; margin: 24px 0 8px; padding: 14px; border: 1px solid rgba(121,225,189,.18); border-radius: 16px; background: rgba(34, 81, 65, .25); }
.local-banner p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.local-banner strong { color: var(--text); }
.shield { flex: 0 0 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: rgba(121,225,189,.16); color: var(--accent); }
.file-hint { margin: 10px 2px 18px; font-size: .7rem; }
.document-list { display: grid; gap: 10px; }
.document-card, .empty-card { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(7, 19, 16, .55); }
.document-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; }
.file-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: rgba(121,225,189,.09); font-size: .65rem; font-weight: 850; }
.file-name { overflow: hidden; margin: 0 0 3px; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.file-state { margin: 0; color: var(--muted); font-size: .7rem; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #eebd6f; box-shadow: 0 0 9px currentColor; }
.state-dot.complete { background: var(--accent); }
.state-dot.error { background: var(--danger); }
.empty-card { color: var(--muted); text-align: center; font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
noscript { display: block; padding: 20px; color: white; text-align: center; }
@keyframes arrive { from { opacity: 0; transform: translateY(7px); } }
@keyframes pulse { 50% { opacity: .25; } }
@media (min-width: 700px) {
  .shell { padding: 24px; }
  .app { min-height: min(820px, calc(100dvh - 48px)); }
  .messages { max-height: min(590px, calc(100dvh - 270px)); padding-inline: 28px; }
  .composer { margin-inline: 24px; }
  .privacy-note { margin-bottom: 17px; }
  .documents-panel { padding: 32px 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }

/* EVA presence — a true circular core with layered, stateful light */
.presence-stage { height: 122px; display: grid; place-items: center; align-content: center; gap: 6px; overflow: hidden; background: radial-gradient(circle at 50% 48%, rgba(121,225,189,.12), transparent 62%); }
.presence-stage p { margin: 0; color: var(--muted); font-size: .65rem; letter-spacing: .13em; text-transform: uppercase; }
.eva-orb { position: relative; width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle at 32% 25%, #fff 0 4%, #c4fff0 8%, #76e2c3 22%, #4b79d0 51%, #242852 72%, #090d1e 100%); box-shadow: 0 0 16px rgba(137,255,221,.75), 0 0 48px rgba(95,120,255,.42), inset -12px -16px 24px rgba(4,6,20,.58); animation: orbPulse 2.8s ease-in-out infinite; isolation: isolate; }
.eva-orb::before,.eva-orb::after,.eva-orb i,.eva-orb b,.eva-orb span { content:""; position:absolute; border-radius:50%; pointer-events:none; }
.eva-orb::before { inset:-13px; border:1px solid rgba(137,255,221,.24); animation: orbitRing 6s linear infinite; }
.eva-orb::after { inset:-25px; border:1px solid rgba(116,132,255,.12); box-shadow:0 0 28px rgba(121,225,189,.18); animation: orbitRing 9s linear infinite reverse; }
.eva-orb i { inset:11px 19px 35px 14px; background:rgba(255,255,255,.75); filter:blur(7px); }
.eva-orb b { width:5px;height:5px;top:-12px;left:10px;background:#baffec;box-shadow:45px 72px 0 #829dff,70px 22px 0 #baffec;animation:particleSpin 5s linear infinite; }
.eva-orb span { inset:5px;background:linear-gradient(145deg,rgba(255,255,255,.18),transparent 42%); }
.eva-orb.recording { animation: orbRecord .72s ease-in-out infinite; box-shadow:0 0 24px #ff8ca1,0 0 70px rgba(255,70,105,.48); }
.eva-orb.thinking { animation-duration:1.15s; filter:hue-rotate(34deg); }
.voice-button.recording { background:rgba(255,82,110,.18); fill:#ff9aad; box-shadow:0 0 0 5px rgba(255,82,110,.08); }
.primary { touch-action: manipulation; position:relative; z-index:2; }
@keyframes orbPulse { 0%,100%{transform:scale(.96);filter:saturate(.92)} 50%{transform:scale(1.05);filter:saturate(1.18)} }
@keyframes orbRecord { 0%,100%{transform:scale(.92)} 50%{transform:scale(1.1)} }
@keyframes orbitRing { to{transform:rotate(360deg)} }
@keyframes particleSpin { to{transform:rotate(360deg)} }
@media(max-width:520px){
  .shell{padding:0;height:100dvh;display:block}.app{height:100dvh;min-height:0;border:0;border-radius:0;background:rgba(2,3,17,.35)}
  .topbar{position:relative;z-index:4;padding:calc(12px + env(safe-area-inset-top)) 18px 10px;background:linear-gradient(#020311 35%,transparent)}
  .tabs{position:relative;z-index:4;background:rgba(2,3,17,.58);backdrop-filter:blur(14px)}
  .presence-stage{position:absolute;z-index:0;inset:32px -130px auto;height:520px;background:radial-gradient(circle,rgba(69,73,255,.22),transparent 62%);pointer-events:none}
  .eva-orb{width:390px;height:390px;opacity:.88;background:radial-gradient(circle at 35% 28%,#fff 0 1%,#6be3ff 6%,#147cff 24%,#543cff 47%,#d42cff 69%,#070a2d 86%);box-shadow:0 0 25px #178dff,0 0 90px rgba(111,48,255,.74),0 0 150px rgba(222,41,255,.35),inset -35px -50px 70px #050724}
  .eva-orb::before{inset:-25px;border-color:rgba(49,163,255,.55);box-shadow:0 0 35px #214dff}.eva-orb::after{inset:-58px;border-color:rgba(224,50,255,.4);box-shadow:0 0 60px rgba(208,39,255,.35)}
  .eva-orb i{inset:60px 105px 185px 78px}.eva-orb b{top:-25px;left:50px;box-shadow:250px 390px 0 #3a9dff,365px 110px 0 #e539ff}.presence-stage p{position:absolute;top:445px;color:#c2bfff}
  .panel{position:relative;z-index:2}.chat-panel{background:linear-gradient(180deg,transparent 0,rgba(2,3,17,.12) 25%,rgba(2,3,17,.86) 63%,#020311 88%)}
  .messages{min-height:0;max-height:none;padding:205px 16px 8px;overflow-y:auto}.message{margin-bottom:10px}.bubble{background:rgba(8,10,35,.76);border-color:rgba(126,116,255,.25);backdrop-filter:blur(16px)}.user .bubble{background:linear-gradient(135deg,rgba(34,83,164,.88),rgba(96,44,151,.88))}
  .composer{position:relative;z-index:5;margin:0 12px calc(6px + env(safe-area-inset-bottom));background:rgba(7,8,28,.88);border-color:rgba(121,110,255,.4);box-shadow:0 12px 40px #000;backdrop-filter:blur(20px)}
  .privacy-note{display:none}.documents-panel{background:rgba(2,3,17,.96)}
  .auth-card{margin:10vh 14px max(18px,env(safe-area-inset-bottom))}.stack .primary{min-height:56px;width:100%;touch-action:manipulation}
}

