/* ALIENS — own chat app styles. Standalone (chat.html loads ONLY this
   file, never the shared style.css), so the homepage cannot regress
   from anything here. Every selector is prefixed .achat- / #chat /
   .msg- (classes that exist only on the chat page). */
:root{
  --achat-bg:#030507;
  --achat-ink:#eafff5;
  --achat-muted:#9db8ad;
  --achat-dim:#5f7a6e;
  --achat-emerald:#35f2a2;
  --achat-teal:#2dd4bf;
  --achat-line:rgba(53,242,162,.18);
  --achat-line-soft:rgba(255,255,255,.09);
  --achat-panel:rgba(10,22,18,.72);
  --achat-warn:#ffd166;
  --achat-ease:cubic-bezier(.16,1,.3,1);
  --achat-font-body:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --achat-font-display:"Silkscreen",var(--achat-font-body);
  --achat-col:760px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body.achat-body{
  height:100dvh;overflow:hidden;
  background:
    radial-gradient(120% 70% at 50% -10%,rgba(20,120,90,.14),transparent 60%),
    radial-gradient(90% 60% at 85% 110%,rgba(16,90,110,.10),transparent 60%),
    var(--achat-bg);
  color:var(--achat-ink);
  font-family:var(--achat-font-body);font-size:16px;line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
::selection{background:var(--achat-emerald);color:#02120b}
a{color:var(--achat-emerald);text-decoration:none}
button{font-family:inherit;cursor:pointer}
#stars{position:fixed;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;opacity:.5}

/* ---------------- app shell ---------------- */
.achat-shell{position:relative;z-index:2;display:flex;flex-direction:column;height:100dvh;max-width:100%}

/* ---------------- top bar ---------------- */
.achat-top{
  flex:none;height:54px;display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:0 16px;border-bottom:1px solid rgba(255,255,255,.05);
  background:rgba(3,5,7,.55);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
}
.achat-mark{display:flex;align-items:center;gap:10px;color:var(--achat-ink)}
.achat-mark:hover{text-decoration:none}
.achat-mark img{width:29px;height:29px;border-radius:9px;border:1px solid var(--achat-line);display:block;background:#04120c}
.achat-mark-name{font-family:var(--achat-font-display);font-weight:700;font-size:1.02rem;letter-spacing:.16em}
.achat-mark-name .dot{color:var(--achat-emerald)}
.achat-mark-tag{font-size:.6rem;letter-spacing:.24em;color:var(--achat-dim);text-transform:uppercase;margin-top:1px}
.achat-actions{display:flex;align-items:center;gap:8px}
.achat-home{font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;color:var(--achat-muted);padding:8px 10px;border-radius:999px}
.achat-home:hover{color:var(--achat-emerald);text-decoration:none}
.achat-new{
  font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--achat-ink);background:rgba(53,242,162,.07);
  border:1px solid var(--achat-line);border-radius:999px;padding:8px 15px;
  transition:border-color .25s,background .25s,transform .25s var(--achat-ease);
}
.achat-new:hover{border-color:rgba(53,242,162,.55);background:rgba(53,242,162,.13)}
.achat-new:active{transform:scale(.96)}
.achat-new[disabled]{opacity:.4;cursor:not-allowed}

/* ---------------- main region ---------------- */
.achat-main{flex:1;min-height:0;display:flex;flex-direction:column;position:relative}

/* landing hero */
.achat-hero{
  flex:1;min-height:0;overflow-y:auto;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  width:100%;max-width:var(--achat-col);margin:0 auto;
  padding:24px 22px 9vh;text-align:center;
}
body.in-convo .achat-hero{display:none}
.achat-eyebrow{font-size:.68rem;letter-spacing:.34em;text-transform:uppercase;color:var(--achat-emerald);margin-bottom:20px}
.achat-title{
  font-family:var(--achat-font-display);font-weight:700;
  font-size:clamp(2.1rem,7.2vw,4.3rem);line-height:1.02;color:#f4fff9;
  text-shadow:0 0 30px rgba(53,242,162,.25),0 0 110px rgba(45,212,191,.15);
  margin-bottom:18px;min-height:1.02em;
}
.achat-title .accent{color:var(--achat-emerald)}
.achat-sub{color:var(--achat-muted);font-size:.94rem;line-height:1.75;max-width:560px;margin-bottom:34px}
.achat-sub strong{color:var(--achat-ink)}
.achat-facts{margin-top:30px;color:var(--achat-dim);font-size:.7rem;line-height:1.9;letter-spacing:.04em}
.achat-ca{color:var(--achat-muted);overflow-wrap:anywhere;font-size:.68rem}

/* suggestion chips (landing only) */
.achat-chips{
  display:flex;gap:9px;flex-wrap:wrap;justify-content:center;
  margin-top:18px;max-width:640px;
}
.prompt-chip{
  font-family:var(--achat-font-display);font-size:.76rem;letter-spacing:.03em;
  color:var(--achat-emerald);border:1px solid var(--achat-line);border-radius:999px;
  padding:9px 16px;background:rgba(53,242,162,.05);white-space:nowrap;
  transition:transform .3s var(--achat-ease),border-color .3s,box-shadow .3s,background .3s;
}
.prompt-chip:hover{transform:translateY(-2px);border-color:rgba(53,242,162,.6);box-shadow:0 8px 26px rgba(53,242,162,.16);background:rgba(53,242,162,.09)}
.prompt-chip:active{transform:scale(.97)}

/* ---------------- message list ---------------- */
.achat-log{
  display:none;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  width:100%;scrollbar-width:thin;scrollbar-color:rgba(53,242,162,.25) transparent;
}
body.in-convo .achat-log{display:block}
.achat-log-inner{
  max-width:var(--achat-col);margin:0 auto;padding:28px 22px 18px;
  display:flex;flex-direction:column;gap:22px;
}
.msg{max-width:100%;animation:msg-in .45s var(--achat-ease) both}
@keyframes msg-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.msg-body{white-space:pre-wrap;overflow-wrap:break-word;font-size:.95rem;line-height:1.75}

/* user — right-aligned bubble */
.msg-user{
  align-self:flex-end;max-width:80%;
  background:linear-gradient(120deg,rgba(53,242,162,.20),rgba(45,212,191,.13));
  border:1px solid rgba(53,242,162,.32);color:#f4fff9;
  border-radius:19px 19px 5px 19px;padding:11px 16px;
}
/* assistant — full-width plain text with an avatar mark */
.msg-ai{position:relative;align-self:stretch;padding:2px 0 2px 46px;color:var(--achat-ink)}
.msg-ai::before{
  content:"";position:absolute;left:0;top:0;width:30px;height:30px;border-radius:10px;
  border:1px solid var(--achat-line);
  background:#04120c url("https://pub-d7e830dfd23d49b7a5d71b6f8c191f82.r2.dev/images/1.svg") center/cover no-repeat;
}
/* assistant tool-result card (a card label is present) */
.msg-ai:has(.msg-card-label){
  background:rgba(10,22,18,.5);border:1px solid var(--achat-line-soft);
  border-radius:16px;padding:14px 16px 14px 58px;
}
.msg-ai:has(.msg-card-label)::before{left:12px;top:12px}
.msg-card-label{
  display:inline-block;font-family:var(--achat-font-display);font-size:.6rem;
  letter-spacing:.22em;text-transform:uppercase;color:var(--achat-emerald);
  border:1px solid var(--achat-line);border-radius:999px;padding:4px 10px;margin-bottom:10px;
  background:rgba(53,242,162,.06);
}
.msg-card-label.tone-warn{color:var(--achat-warn);border-color:rgba(255,209,102,.35);background:rgba(255,209,102,.06)}
.msg-card-label.tone-ok{color:var(--achat-emerald)}

/* copy + retry affordances */
.msg-copy{
  display:block;margin-top:8px;font-size:.64rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--achat-dim);background:none;border:1px solid transparent;border-radius:7px;padding:4px 8px 4px 0;
  opacity:0;transition:opacity .25s,color .25s;
}
.msg-ai:hover .msg-copy,.msg-copy:focus-visible{opacity:.85}
.msg-copy:hover{color:var(--achat-emerald)}
@media (hover:none){.msg-copy{opacity:.45}}
.msg-retry{
  margin-top:10px;font-size:.7rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:#02120b;background:linear-gradient(120deg,var(--achat-emerald),var(--achat-teal));
  border:none;border-radius:999px;padding:8px 16px;transition:transform .25s var(--achat-ease),box-shadow .25s;
}
.msg-retry:hover{box-shadow:0 8px 24px rgba(53,242,162,.3)}
.msg-retry:active{transform:scale(.96)}

/* typing indicator */
.typing{display:inline-flex;gap:5px;padding:6px 0}
.typing i{width:7px;height:7px;border-radius:50%;background:var(--achat-emerald);opacity:.35;animation:typing-pulse 1.1s ease-in-out infinite}
.typing i:nth-child(2){animation-delay:.18s}
.typing i:nth-child(3){animation-delay:.36s}
@keyframes typing-pulse{0%,100%{opacity:.25;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}

/* ---------------- composer ---------------- */
.achat-composer{width:100%;max-width:var(--achat-col);margin:0 auto}
.achat-form{
  display:flex;align-items:flex-end;gap:10px;
  background:var(--achat-panel);border:1px solid var(--achat-line-soft);border-radius:20px;
  padding:10px 10px 10px 18px;
  box-shadow:0 18px 50px rgba(0,0,0,.45),0 0 0 0 rgba(53,242,162,0);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  transition:border-color .25s,box-shadow .25s;
}
.achat-form:focus-within{border-color:rgba(53,242,162,.5);box-shadow:0 18px 50px rgba(0,0,0,.45),0 0 0 3px rgba(53,242,162,.13)}
.achat-form textarea{
  flex:1;min-width:0;resize:none;border:none;background:transparent;color:var(--achat-ink);
  font-family:inherit;font-size:16px;line-height:1.55;max-height:156px;
  padding:7px 0;outline:none;
}
.achat-form textarea::placeholder{color:var(--achat-dim)}
.achat-form textarea[disabled]{opacity:.55}
.achat-send{
  flex:none;width:40px;height:40px;border-radius:50%;border:none;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(120deg,var(--achat-emerald),var(--achat-teal));color:#02120b;
  transition:transform .25s var(--achat-ease),box-shadow .25s,opacity .25s,background .25s;
}
.achat-send svg{width:18px;height:18px;display:block}
.achat-send:hover:not([disabled]){box-shadow:0 8px 26px rgba(53,242,162,.35)}
.achat-send:active:not([disabled]){transform:scale(.93)}
.achat-send[disabled]{background:rgba(255,255,255,.09);color:var(--achat-dim);cursor:not-allowed;box-shadow:none}
.achat-hint{color:var(--achat-dim);font-size:.66rem;letter-spacing:.1em;margin-top:9px;text-align:center}
.achat-disclaimer{color:var(--achat-dim);font-size:.64rem;line-height:1.6;margin-top:4px;text-align:center;padding:0 8px}

/* landing: composer sits in the hero flow */
.achat-hero .achat-composer{text-align:left}

/* ---------------- quick-action bar (v3.11) ----------------
   Travels with the composer: under it on the landing, docked
   directly above it in conversation. Pure guidance — every
   button just sends the message the engine already knows. */
.achat-actionbar{
  display:flex;flex-wrap:wrap;gap:8px;justify-content:center;
  width:100%;max-width:var(--achat-col);margin:16px auto 0;
}
.achat-dock .achat-actionbar{margin:0 auto 10px}
.abar-btn{
  font-family:var(--achat-font-display);font-size:.74rem;letter-spacing:.03em;
  color:var(--achat-ink);background:rgba(10,22,18,.72);
  border:1px solid var(--achat-line);border-radius:999px;
  padding:8px 14px;white-space:nowrap;
  transition:transform .25s var(--achat-ease),border-color .25s,opacity .3s,background .25s;
}
.abar-btn:hover{border-color:rgba(53,242,162,.55);background:rgba(53,242,162,.09)}
.abar-btn:active{transform:scale(.96)}
.abar-btn .step-num{color:var(--achat-emerald);margin-right:2px}
.abar-btn.done{opacity:.5}
.abar-btn.done .step-num{color:var(--achat-emerald);font-weight:700}
.abar-btn.muted{opacity:.32}

/* ---------------- one-time secret card (v3.11) ----------------
   Deliberately unlike every other bubble: warm amber on the
   dark theme. The secret lives here (and only here) until the
   user confirms they saved it; then the card collapses and the
   value leaves the DOM. */
.secret-card{
  margin-top:14px;border:1px solid rgba(255,209,102,.6);border-radius:14px;
  background:linear-gradient(160deg,rgba(255,209,102,.10),rgba(255,209,102,.03));
  box-shadow:0 0 0 1px rgba(255,209,102,.12),0 10px 34px rgba(255,209,102,.10);
  padding:15px 16px;
}
.secret-warn{color:var(--achat-warn);font-size:.83rem;line-height:1.65;font-weight:600}
.secret-value{
  font-family:var(--achat-font-body);font-weight:800;font-size:1.12rem;
  letter-spacing:.03em;color:#fff3d1;overflow-wrap:anywhere;
  margin:12px 0 4px;user-select:all;-webkit-user-select:all;
}
.secret-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}
.secret-copy{
  font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--achat-warn);background:rgba(255,209,102,.07);
  border:1px solid rgba(255,209,102,.5);border-radius:999px;padding:9px 16px;
  transition:background .25s,transform .25s var(--achat-ease);
}
.secret-copy:hover{background:rgba(255,209,102,.15)}
.secret-copy:active{transform:scale(.96)}
.secret-confirm{
  font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:#241a02;background:linear-gradient(120deg,var(--achat-warn),#ffb84d);
  border:none;border-radius:999px;padding:9px 16px;
  transition:box-shadow .25s,transform .25s var(--achat-ease);
}
.secret-confirm:hover{box-shadow:0 8px 24px rgba(255,209,102,.35)}
.secret-confirm:active{transform:scale(.96)}
.secret-card.collapsed{
  color:var(--achat-muted);font-size:.85rem;font-weight:600;
  background:rgba(255,209,102,.03);box-shadow:none;
  border-color:rgba(255,209,102,.25);padding:11px 16px;
}

/* conversation: composer docks at the bottom */
.achat-dock{display:none;flex:none;position:relative;padding:26px 22px calc(12px + env(safe-area-inset-bottom))}
body.in-convo .achat-dock{display:block}
.achat-dock::before{
  content:"";position:absolute;left:0;right:0;top:-32px;height:58px;pointer-events:none;
  background:linear-gradient(180deg,transparent,rgba(3,5,7,.88) 78%);
}

/* ---------------- phone ---------------- */
@media (max-width:640px){
  .achat-mark-tag{display:none}
  .achat-hero{padding:18px 18px 6vh;justify-content:center}
  .achat-title{font-size:clamp(1.9rem,10.5vw,2.6rem)}
  .achat-sub{font-size:.88rem;margin-bottom:28px}
  .achat-chips{
    flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;width:100%;
    padding:4px 2px 8px;scrollbar-width:none;
    -webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent);
  }
  .achat-chips::-webkit-scrollbar{display:none}
  .achat-log-inner{padding:22px 16px 14px;gap:19px}
  .msg-user{max-width:88%}
  .msg-ai{padding-left:42px}
  .msg-ai:has(.msg-card-label){padding:12px 13px 12px 52px}
  .achat-dock{padding:22px 14px calc(10px + env(safe-area-inset-bottom))}
  .abar-btn{font-size:.7rem;padding:7px 11px}
  .secret-value{font-size:1rem}
}
@media (prefers-reduced-motion:reduce){
  .msg{animation:none}
  .typing i{animation:none;opacity:.7}
}
