/* ============================================================
   JakeOS assistant — scoped styles. Layered AFTER app.css and
   inherits its design tokens (--brand, --surface, --txt, --line …)
   so it is fully theme-safe (light + dark). app.css is NOT modified.
   ============================================================ */

/* ---- floating button ---- */
.jake-fab{
  position:fixed; z-index:100;
  inset-inline-end:16px; bottom:calc(84px + env(safe-area-inset-bottom));
  display:inline-flex; align-items:center; gap:8px;
  height:50px; padding:0 16px 0 14px; border:none; border-radius:26px;
  background:linear-gradient(150deg,var(--brand),var(--brand-2));
  color:var(--on-brand); font-family:inherit; font-weight:800; font-size:.92rem;
  box-shadow:0 14px 30px -10px color-mix(in srgb,var(--brand) 60%,transparent);
  cursor:pointer; transition:transform .15s ease, box-shadow .2s ease;
}
.jake-fab:active{transform:scale(.95)}
.jake-fab svg{width:22px;height:22px;flex:none}
.jake-fab-label{white-space:nowrap}

@media (min-width:900px){
  .jake-fab{bottom:22px; inset-inline-end:22px; height:52px}
}

/* ---- overlay + panel ---- */
.jake-ov{
  position:fixed; inset:0; z-index:130;
  display:flex; align-items:flex-end; justify-content:center;
  background:rgba(8,15,32,.5); backdrop-filter:blur(2px);
  opacity:0; transition:opacity .22s;
}
.jake-ov.open{opacity:1}
.jake-ov[hidden]{display:none}

.jake-panel{
  display:flex; flex-direction:column;
  width:100%; max-width:560px; height:min(86vh,720px);
  background:var(--surface); color:var(--txt);
  border:1px solid var(--line);
  border-radius:var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow:var(--shadow-lg);
  transform:translateY(100%); transition:transform .26s cubic-bezier(.22,.61,.36,1);
  overflow:hidden;
}
.jake-ov.open .jake-panel{transform:none}

@media (min-width:900px){
  .jake-ov{align-items:flex-end; justify-content:flex-start; padding:22px}
  .jake-panel{max-width:420px; height:min(80vh,680px); border-radius:var(--radius-lg)}
}

/* ---- header ---- */
.jake-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; border-bottom:1px solid var(--line); flex:none;
  background:linear-gradient(180deg,color-mix(in srgb,var(--brand) 10%,transparent),transparent);
}
.jake-head-main{display:flex; align-items:center; gap:10px}
.jake-dot{width:10px;height:10px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 22%,transparent)}
.jake-title{font-weight:800;font-size:1rem}
.jake-sub{font-size:.74rem;color:var(--txt-3);margin-top:1px}
.jake-head-actions{display:flex;gap:6px}
.jake-icon{width:34px;height:34px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2);color:var(--txt-2);cursor:pointer;font-size:1rem;line-height:1}
.jake-icon:active{transform:scale(.94)}

/* ---- body / messages ---- */
.jake-body{flex:1 1 auto; min-height:0; overflow-y:auto; padding:14px 14px 6px; display:flex; flex-direction:column; gap:12px}
.jake-msg{font-size:.92rem; line-height:1.55; max-width:92%}
.jake-msg.jake{align-self:flex-start; background:var(--surface-2); color:var(--txt); border:1px solid var(--line); border-radius:14px 14px 14px 4px; padding:11px 13px}
.jake-msg.user{align-self:flex-end; background:var(--brand); color:var(--on-brand); border-radius:14px 14px 4px 14px; padding:9px 13px; font-weight:600}

.jake-answer-title{font-weight:800; font-size:.96rem; margin-bottom:3px}
.jake-answer-summary{color:var(--txt-2); font-size:.88rem}

.jake-cards{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.jake-card{display:block; width:100%; text-align:start; background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:10px 12px; cursor:pointer; font-family:inherit; color:var(--txt); transition:border-color .15s ease, transform .12s ease}
.jake-card:active{transform:scale(.99)}
.jake-card:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line))}
.jake-card-top{display:flex; align-items:center; justify-content:space-between; gap:8px}
.jake-card-title{font-weight:700; font-size:.9rem}
.jake-card-sub{font-size:.78rem; color:var(--txt-3); margin-top:2px}
.jake-card-line{font-size:.82rem; color:var(--txt-2); margin-top:4px}
.jake-card-line .jl-label{color:var(--txt-3)}
.jake-card-line.warn{color:var(--amber)}
.jake-card-line.balance{color:var(--orange); font-weight:700}
.jake-badge{font-size:.7rem; font-weight:700; padding:3px 9px; border-radius:99px; white-space:nowrap; color:var(--c); background:color-mix(in srgb,var(--c) 16%,transparent)}

.jake-note{margin-top:10px; font-size:.78rem; color:var(--txt-3); background:var(--surface-2); border:1px solid var(--line); border-radius:11px; padding:8px 10px}

/* ---- confirmation card (confirmation-only, non-executable) ---- */
.jake-confirm{margin-top:12px; border:1px solid color-mix(in srgb,var(--amber) 45%,var(--line)); background:color-mix(in srgb,var(--amber) 8%,var(--surface)); border-radius:13px; padding:12px}
.jake-confirm-text{font-weight:700; font-size:.88rem}
.jake-confirm-actions{display:flex; gap:8px; margin-top:10px}
.jake-btn{flex:1; height:38px; border-radius:10px; border:1px solid var(--line); font-family:inherit; font-weight:700; font-size:.85rem; cursor:pointer}
.jake-btn.primary{background:var(--brand); color:var(--on-brand); border-color:transparent}
.jake-btn.ghost{background:var(--surface-2); color:var(--txt-2)}
.jake-btn:active{transform:scale(.97)}
.jake-confirm-note{margin-top:8px; font-size:.72rem; color:var(--txt-3)}

/* ---- quick prompts ---- */
.jake-quick{display:flex; gap:8px; overflow-x:auto; padding:10px 14px; border-top:1px solid var(--line); flex:none; scrollbar-width:none}
.jake-quick::-webkit-scrollbar{display:none}
.jake-chip{white-space:nowrap; padding:8px 13px; border-radius:99px; border:1px solid var(--line); background:var(--surface-2); color:var(--txt); font-family:inherit; font-size:.82rem; font-weight:600; cursor:pointer}
.jake-chip:active{transform:scale(.96)}
.jake-chip:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line))}

/* ---- input ---- */
.jake-input{display:flex; gap:8px; padding:12px 14px calc(12px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); flex:none}
.jake-input input{flex:1; height:42px; border-radius:12px; border:1px solid var(--line); background:var(--surface-2); color:var(--txt); padding:0 13px; font-family:inherit; font-size:.92rem}
.jake-input input:focus{outline:none; border-color:var(--brand)}
.jake-send{height:42px; padding:0 16px; border:none; border-radius:12px; background:var(--brand); color:var(--on-brand); font-family:inherit; font-weight:800; font-size:.88rem; cursor:pointer}
.jake-send:active{transform:scale(.96)}

/* ---- typing indicator + own toast ---- */
.jake-typing{display:inline-flex; gap:3px; vertical-align:middle}
.jake-typing i{width:6px;height:6px;border-radius:50%;background:var(--txt-3);animation:jakeBlink 1s infinite}
.jake-typing i:nth-child(2){animation-delay:.15s}
.jake-typing i:nth-child(3){animation-delay:.3s}
@keyframes jakeBlink{0%,80%,100%{opacity:.25}40%{opacity:1}}

.jake-toast{position:fixed; z-index:140; inset-inline:0; bottom:96px; margin-inline:auto; width:max-content; max-width:88%; background:var(--txt); color:var(--surface); padding:10px 16px; border-radius:12px; font-size:.85rem; font-weight:600; opacity:0; transform:translateY(8px); transition:opacity .22s, transform .22s; box-shadow:var(--shadow-lg)}
.jake-toast.show{opacity:1; transform:none}

@media (prefers-reduced-motion:reduce){.jake-fab,.jake-panel,.jake-card,.jake-toast,.jake-typing i{transition:none;animation:none}}
