/* Portfolio assistant: compact sky-glass chat, scoped to #gachat. */
#gachat{
  --gc-glass:rgba(244,249,255,.82);
  --gc-glass-strong:rgba(255,255,255,.9);
  --gc-ink:#16202b;
  --gc-soft:#4e5f74;
  --gc-muted:#718096;
  --gc-line:rgba(255,255,255,.78);
  --gc-hair:rgba(22,32,43,.1);
  --gc-accent:#2f6cb8;
  --gc-accent-strong:#1f72c9;
  --gc-accent-soft:rgba(47,108,184,.13);
  position:fixed;
  right:max(16px,4vw);
  bottom:15px;
  z-index:2147483000;
  color:var(--gc-ink);
  font-family:"PP Neue Montreal",system-ui,sans-serif;
}
#gachat *{box-sizing:border-box}
#gachat button,#gachat textarea{font:inherit}
#gachat button:focus-visible,#gachat textarea:focus-visible{
  outline:2px solid var(--gc-accent);
  outline-offset:2px;
}

/* Launcher */
.gachat-launch{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 17px;
  border:1px solid rgba(255,255,255,.6);
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,.62),rgba(255,255,255,.44));
  color:var(--gc-ink);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.85),0 14px 36px -16px rgba(18,22,28,.55);
  cursor:pointer;
  font-family:var(--font-mono,"PP Neue Montreal",system-ui,sans-serif);
  font-size:12px;
  letter-spacing:.04em;
  -webkit-backdrop-filter:blur(16px) saturate(1.5);
  backdrop-filter:blur(16px) saturate(1.5);
  transition:transform .2s,box-shadow .2s,gap .3s cubic-bezier(.22,1,.36,1),opacity .2s;
}
.gachat-launch:hover{transform:translateY(-2px);gap:8px;box-shadow:inset 0 1px 1px rgba(255,255,255,.85),0 18px 42px -18px rgba(18,22,28,.6)}
.gachat-launch .spark{display:flex;width:15px;height:15px;color:var(--gc-accent);animation:gc-twinkle 3s ease-in-out infinite}
.gachat-launch .ai-label{white-space:nowrap}
@keyframes gc-twinkle{0%,100%{opacity:.7;transform:scale(.9) rotate(0)}50%{opacity:1;transform:scale(1.08) rotate(22deg)}}
#gachat.open .gachat-launch{opacity:0;pointer-events:none;transform:scale(.94)}

/* Glass panel */
.gachat-panel{
  position:absolute;
  right:0;
  bottom:0;
  display:flex;
  width:366px;
  max-width:calc(100vw - 28px);
  height:min(536px,calc(100dvh - 36px));
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--gc-line);
  border-radius:26px;
  background:
    radial-gradient(90% 70% at 10% 0%,rgba(255,255,255,.72),transparent 58%),
    radial-gradient(75% 60% at 100% 100%,rgba(197,222,248,.38),transparent 64%),
    linear-gradient(160deg,rgba(249,252,255,.9),rgba(228,240,253,.82));
  box-shadow:inset 0 1px 1px rgba(255,255,255,.86),0 38px 90px -34px rgba(18,40,72,.55);
  opacity:0;
  pointer-events:none;
  transform:translateY(14px) scale(.985);
  -webkit-backdrop-filter:blur(30px) saturate(1.35);
  backdrop-filter:blur(30px) saturate(1.35);
  transition:opacity .28s ease,transform .32s cubic-bezier(.16,1,.3,1);
}
#gachat.open .gachat-panel{opacity:1;pointer-events:auto;transform:none}

/* Header */
.gachat-head{
  position:relative;
  display:flex;
  min-height:72px;
  align-items:center;
  gap:10px;
  padding:13px 12px 13px 14px;
  border-bottom:1px solid var(--gc-hair);
}
.gachat-av{
  display:grid;
  width:38px;
  height:38px;
  flex:0 0 38px;
  place-items:center;
  border-radius:50%;
  background:radial-gradient(120% 120% at 28% 22%,#78afe5,var(--gc-accent-strong));
  color:#fff;
  box-shadow:inset 0 1px 1px rgba(255,255,255,.55),0 8px 20px -10px rgba(31,114,201,.7);
}
.gachat-av svg{width:20px;height:20px}
.gachat-head .gc-htxt{min-width:0;flex:1 1 auto}
.gachat-head .ttl{font-size:17px;font-weight:500;line-height:1.08;letter-spacing:-.022em;white-space:nowrap}
.gachat-head .ttl .a{color:var(--gc-accent-strong)}
.gachat-head .sub{margin-top:4px;color:var(--gc-muted);font-size:10.5px;font-weight:500;line-height:1.2;letter-spacing:.05em}
.gachat-iconbtn{
  display:grid;
  width:40px;
  height:40px;
  flex:0 0 40px;
  place-items:center;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--gc-soft);
  cursor:pointer;
  transition:background .18s,color .18s,transform .18s;
}
.gachat-iconbtn:hover{background:rgba(255,255,255,.58);color:var(--gc-ink);transform:translateY(-1px)}
.gachat-iconbtn svg{width:18px;height:18px}
.gachat-menu-wrap{position:relative;display:flex}
.gachat-menu[hidden]{display:none!important}
.gachat-menu{
  position:absolute;
  top:46px;
  right:0;
  z-index:3;
  width:224px;
  padding:6px;
  border:1px solid rgba(255,255,255,.9);
  border-radius:16px;
  background:rgba(248,251,255,.985);
  box-shadow:0 22px 52px -24px rgba(18,40,72,.55),inset 0 1px 1px rgba(255,255,255,.95);
  -webkit-backdrop-filter:blur(24px) saturate(1.25);
  backdrop-filter:blur(24px) saturate(1.25);
  animation:gc-menu-in .18s cubic-bezier(.16,1,.3,1) both;
}
.gachat-menuitem{
  display:grid;
  width:100%;
  min-height:44px;
  grid-template-columns:22px 1fr auto;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border:0;
  border-radius:11px;
  background:transparent;
  color:var(--gc-ink);
  cursor:pointer;
  text-align:left;
  font-size:13px;
}
.gachat-menuitem:hover{background:var(--gc-accent-soft)}
.gachat-menuitem svg{width:18px;height:18px;color:var(--gc-soft)}
.gachat-menuitem small{color:var(--gc-muted);font-size:10px;font-weight:500;text-transform:uppercase;letter-spacing:.06em}
.gachat-menuitem.on small,.gachat-menuitem.listening{color:var(--gc-accent-strong)}
@keyframes gc-menu-in{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}

/* Conversation */
.gachat-log{
  display:flex;
  min-height:0;
  flex:1;
  flex-direction:column;
  gap:14px;
  overflow-y:auto;
  padding:18px 16px 12px;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:rgba(78,95,116,.25) transparent;
}
.gachat-intro{margin:auto 0;padding:2px 0 8px}
.gachat-intro p{max-width:290px;margin:0 0 16px;color:var(--gc-soft);font-size:15px;line-height:1.5}
.gachat-chips{display:flex;flex-direction:column;gap:8px}
.gachat-chip{
  position:relative;
  display:flex;
  width:100%;
  min-height:44px;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 13px;
  border:1px solid rgba(255,255,255,.88);
  border-radius:14px;
  background:rgba(255,255,255,.62);
  color:var(--gc-ink);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.72);
  cursor:pointer;
  text-align:left;
  font-size:13.5px;
  line-height:1.3;
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  transition:background .18s,border-color .18s,transform .18s;
}
.gachat-chip::after{content:'→';flex:0 0 auto;color:var(--gc-accent);font-size:15px}
.gachat-chip:hover{border-color:rgba(47,108,184,.3);background:rgba(255,255,255,.82);transform:translateX(2px)}
.gachat-row{display:flex;max-width:90%;align-items:flex-end}
.gachat-row.user{align-self:flex-end}
.gachat-row.bot{align-self:flex-start}
.gachat-msg{max-width:100%;font-size:14px;line-height:1.52;white-space:pre-wrap;overflow-wrap:anywhere}
.gachat-msg.user{padding:9px 13px;border-radius:15px 15px 4px 15px;background:linear-gradient(180deg,#3d82cb,var(--gc-accent));color:#fff;box-shadow:0 10px 22px -15px rgba(31,114,201,.72)}
.gachat-msg.bot{padding:2px 1px;color:var(--gc-ink)}
.gachat-msg.bot.err{padding:10px 12px;border:1px solid rgba(192,57,43,.2);border-radius:13px;background:rgba(255,247,246,.72);color:#9d2f24}
.gachat-msg a{color:var(--gc-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.gachat-msg strong{color:var(--gc-ink);font-weight:600}
.gachat-typing{display:inline-flex;align-self:flex-start;gap:4px;padding:7px 2px}
.gachat-typing i{width:5px;height:5px;border-radius:50%;background:var(--gc-accent);opacity:.55;animation:gc-bounce 1.2s ease-in-out infinite}
.gachat-typing i:nth-child(2){animation-delay:.14s}.gachat-typing i:nth-child(3){animation-delay:.28s}
@keyframes gc-bounce{0%,80%,100%{transform:translateY(0);opacity:.35}40%{transform:translateY(-4px);opacity:1}}

/* Integrated composer */
.gachat-form{padding:10px 14px 7px;border-top:1px solid var(--gc-hair)}
.gachat-inwrap{
  display:flex;
  min-height:50px;
  align-items:flex-end;
  gap:8px;
  padding:4px 4px 4px 14px;
  border:1px solid rgba(36,60,98,.16);
  border-radius:18px;
  background:rgba(255,255,255,.76);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.82),0 10px 26px -20px rgba(18,40,72,.4);
  transition:border-color .18s,box-shadow .2s,background .18s;
}
.gachat-inwrap:focus-within{border-color:rgba(47,108,184,.72);background:rgba(255,255,255,.9);box-shadow:0 0 0 3px var(--gc-accent-soft),0 12px 28px -20px rgba(18,40,72,.45)}
.gachat-form textarea{min-width:0;max-height:110px;flex:1;resize:none;border:0;background:transparent;padding:10px 0;color:var(--gc-ink);font-size:14px;line-height:1.4}
.gachat-form textarea::placeholder{color:var(--gc-muted)}
#gachat .gachat-form textarea:focus-visible{outline:none;box-shadow:none}
.gachat-send{
  display:grid;
  width:40px;
  height:40px;
  flex:0 0 40px;
  place-items:center;
  border:0;
  border-radius:14px;
  background:linear-gradient(180deg,#4288d1,var(--gc-accent));
  color:#fff;
  box-shadow:0 10px 20px -12px rgba(31,114,201,.75);
  cursor:pointer;
  transition:transform .16s,opacity .18s,box-shadow .18s;
}
.gachat-send:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 14px 24px -12px rgba(31,114,201,.78)}
.gachat-send:disabled{opacity:.32;cursor:not-allowed;box-shadow:none}
.gachat-send svg{width:18px;height:18px}
.gachat-foot{padding:2px 14px 11px;color:var(--gc-muted);text-align:center;font-size:9.5px;line-height:1.3;letter-spacing:.055em}

/* Context cards and follow-up prompts */
.gachat-card{display:flex;max-width:90%;align-self:flex-start;flex-direction:column;gap:3px;padding:11px 12px;border:1px solid rgba(255,255,255,.84);border-radius:14px;background:rgba(255,255,255,.58);color:inherit;text-decoration:none;box-shadow:inset 0 1px 1px rgba(255,255,255,.72);transition:background .18s,border-color .18s,transform .18s}
.gachat-card:hover{border-color:rgba(47,108,184,.28);background:rgba(255,255,255,.8);transform:translateY(-1px)}
.gachat-card-ttl{color:var(--gc-ink);font-size:13.5px;font-weight:600;line-height:1.2;letter-spacing:-.01em}
.gachat-card-meta{color:var(--gc-muted);font-size:10px;line-height:1.35;letter-spacing:.04em;text-transform:uppercase}
.gachat-card-go{margin-top:3px;color:var(--gc-accent);font-size:10.5px;font-weight:500;letter-spacing:.05em;text-transform:uppercase}
.gachat-follow{display:flex;max-width:94%;align-self:flex-start;flex-wrap:wrap;gap:7px}
.gachat-chip.sm{width:auto;min-height:38px;padding:8px 11px;border-radius:999px;font-size:12px}
.gachat-chip.sm::after{display:none}

@keyframes gc-rise{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.gachat-row,.gachat-card,.gachat-follow{animation:gc-rise .3s cubic-bezier(.16,1,.3,1) both}

@media(max-width:480px){
  #gachat{right:10px;bottom:max(10px,env(safe-area-inset-bottom))}
  .gachat-panel{width:calc(100vw - 20px);max-width:none;height:min(536px,calc(100dvh - 20px));border-radius:24px}
  .gachat-head{padding-inline:12px 10px}
  .gachat-log{padding-inline:14px}
}
@media(max-width:760px){
  .gachat-launch{width:46px;height:46px;min-height:46px;justify-content:center;padding:0;gap:0;border-radius:50%}
  .gachat-launch .ai-label{display:none}
}
@media(prefers-reduced-motion:reduce){
  #gachat *,#gachat *::before,#gachat *::after{animation:none!important;transition:none!important}
  .gachat-panel{transform:none}
}
