.portfolio-chat-dialog {
  --ask-surface: #f2f0e9;
  --ask-ink: #181917;
  --ask-accent: #6f5cff;
  --ask-card: color-mix(in srgb, var(--ask-surface) 84%, #fff);
  --ask-line: color-mix(in srgb, var(--ask-ink) 15%, transparent);
  --ask-muted: color-mix(in srgb, var(--ask-ink) 58%, var(--ask-surface));
  position: fixed;
  inset: 0;
  z-index: 320;
  margin: auto;
  width: min(560px, calc(100% - 32px));
  max-height: min(78vh, 720px);
  padding: 0;
  border: 1px solid var(--ask-line);
  border-radius: 18px;
  background: var(--ask-surface);
  color: var(--ask-ink);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .45);
  font-family: "Instrument Sans", Arial, sans-serif;
}
.portfolio-chat-dialog::backdrop { background: rgba(20,21,18,.55); backdrop-filter: blur(5px); }
.portfolio-chat-dialog[open] { animation: ask-panel-in .55s cubic-bezier(.76,0,.24,1) both; }
@keyframes ask-panel-in { from { opacity:0; transform:translateY(26px) scale(.97); } to { opacity:1; transform:none; } }
.portfolio-chat-panel { display:flex; flex-direction:column; max-height:inherit; }
.portfolio-chat-dialog .sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0 0 0 0)!important; white-space:nowrap!important; border:0!important; }
.portfolio-chat-header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 18px; border-bottom:1px solid var(--ask-line); }
.portfolio-chat-identity { display:flex; align-items:center; gap:10px; min-width:0; }
.portfolio-chat-avatar { width:42px; height:42px; flex:none; display:grid; place-items:center; border-radius:50%; background:color-mix(in srgb,var(--ask-ink) 13%,var(--ask-surface)); font:500 10px "DM Mono",monospace; }
.portfolio-chat-header strong,.portfolio-chat-header small { display:block; }
.portfolio-chat-header strong { font-size:15px; font-weight:560; letter-spacing:-.01em; }
.portfolio-chat-header small { margin-top:3px; color:var(--ask-muted); font-size:11px; }
.portfolio-chat-close { width:44px; height:44px; flex:none; border:0; border-radius:50%; background:var(--ask-card); color:var(--ask-ink); cursor:pointer; font-size:22px; line-height:1; transition:transform .2s,background .2s,color .2s; }
.portfolio-chat-close:hover,.portfolio-chat-close:focus-visible { background:var(--ask-ink); color:var(--ask-surface); transform:rotate(4deg); }
.portfolio-chat-dialog :is(button,input):focus-visible { outline:2px solid color-mix(in srgb,var(--ask-ink) 45%,transparent); outline-offset:2px; }
.portfolio-chat-body { flex:1; min-height:300px; padding:22px; overflow-y:auto; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--ask-ink) 25%,transparent) transparent; }
.portfolio-chat-opening { animation:ask-message-in .45s cubic-bezier(.76,0,.24,1) both; }
.portfolio-chat-opening-copy { max-width:22ch; margin:4px 0 0; font-family:"Cormorant Garamond",Georgia,serif; font-style:italic; font-size:clamp(1.35rem,1.1rem + 1vw,1.7rem); line-height:1.22; letter-spacing:-.01em; text-wrap:balance; }
.portfolio-chat-suggestions { margin:20px 0 0; padding:0; list-style:none; display:grid; gap:8px; }
.portfolio-chat-suggestion { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; border:1px solid var(--ask-line); border-radius:16px; background:var(--ask-card); color:var(--ask-ink); text-align:left; font-size:14px; letter-spacing:-.008em; cursor:pointer; transition:transform .22s cubic-bezier(.76,0,.24,1),border-color .22s,box-shadow .22s; }
.portfolio-chat-suggestion i { flex:none; color:var(--ask-muted); font-style:normal; transition:transform .22s cubic-bezier(.76,0,.24,1),color .22s; }
.portfolio-chat-suggestion:hover,.portfolio-chat-suggestion:focus-visible { transform:translateY(-1px); border-color:color-mix(in srgb,var(--ask-ink) 40%,transparent); box-shadow:0 8px 22px rgba(54,50,40,.08); }
.portfolio-chat-suggestion:hover i { color:var(--ask-ink); transform:translate(2px,-2px); }
.portfolio-chat-turn { display:grid; gap:14px; }
.portfolio-chat-turn + .portfolio-chat-turn { margin-top:30px; }
.portfolio-chat-user { max-width:82%; margin-left:auto; padding:11px 16px; border-radius:16px; background:var(--ask-accent); color:var(--ask-surface); font-size:14px; line-height:1.5; box-shadow:0 8px 20px color-mix(in srgb,var(--ask-accent) 30%,transparent); animation:ask-message-in .4s cubic-bezier(.76,0,.24,1) both; }
.portfolio-chat-assistant { animation:ask-message-in .45s cubic-bezier(.76,0,.24,1) both; }
@keyframes ask-message-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
.portfolio-chat-answer { margin:0; color:var(--ask-ink); font-size:14.5px; line-height:1.62; letter-spacing:-.008em; text-wrap:pretty; }
.portfolio-chat-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:14px; }
.portfolio-chat-label { min-width:48px; color:var(--ask-muted); font:500 10px "DM Mono",monospace; letter-spacing:.1em; text-transform:uppercase; }
.portfolio-chat-source,.portfolio-chat-followup { display:inline-flex; align-items:center; gap:6px; border:0; border-radius:999px; color:var(--ask-ink); font-size:12.5px; letter-spacing:-.008em; text-decoration:none; cursor:pointer; transition:transform .2s cubic-bezier(.76,0,.24,1),background .2s,box-shadow .2s; }
.portfolio-chat-source { padding:7px 12px; background:var(--ask-card); box-shadow:inset 0 0 0 1px var(--ask-line); font-weight:560; }
.portfolio-chat-source:hover { transform:translateY(-1px); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ask-ink) 42%,transparent); }
.portfolio-chat-source i { color:var(--ask-muted); font-style:normal; }
.portfolio-chat-followup { padding:7px 12px 7px 10px; background:transparent; color:var(--ask-muted); }
.portfolio-chat-followup i { color:var(--ask-accent); font-style:normal; }
.portfolio-chat-followup:hover { color:var(--ask-ink); background:color-mix(in srgb,var(--ask-ink) 5%,transparent); }
.portfolio-chat-thinking { display:grid; gap:4px; padding:2px 0; animation:ask-message-in .35s cubic-bezier(.76,0,.24,1) both; }
.portfolio-chat-thinking-head { display:flex; align-items:center; gap:8px; }
.portfolio-chat-thinking-spark { color:var(--ask-accent); }
.portfolio-chat-thinking-label { font-size:13.5px; font-weight:560; }
.portfolio-chat-thinking-sub { color:var(--ask-muted); font:400 11px "DM Mono",monospace; letter-spacing:.03em; }
.portfolio-chat-dots { display:inline-flex; gap:4px; }
.portfolio-chat-dots i { width:4px; height:4px; border-radius:50%; background:var(--ask-muted); animation:ask-dot 1.1s ease-in-out infinite; }
.portfolio-chat-dots i:nth-child(2) { animation-delay:.18s; }.portfolio-chat-dots i:nth-child(3) { animation-delay:.36s; }
@keyframes ask-dot { 0%,100% { opacity:.25; transform:none; } 50% { opacity:1; transform:translateY(-2px); } }
.portfolio-chat-composer { margin:4px 18px 18px; display:flex; align-items:center; gap:8px; padding:6px 6px 6px 18px; border-radius:999px; background:var(--ask-card); box-shadow:inset 0 0 0 1px var(--ask-line),0 6px 20px rgba(54,50,40,.06); transition:box-shadow .2s; }
.portfolio-chat-composer:focus-within { box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ask-ink) 24%,transparent),0 8px 26px rgba(54,50,40,.1); }
.portfolio-chat-composer input { flex:1; min-width:0; padding:8px 0; border:0; outline:0; background:transparent; color:var(--ask-ink); font:14.5px "Instrument Sans",Arial,sans-serif; letter-spacing:-.01em; }
.portfolio-chat-dialog .portfolio-chat-composer input:focus,
.portfolio-chat-dialog .portfolio-chat-composer input:focus-visible { border:0!important; outline:0!important; outline-offset:0!important; box-shadow:none!important; }
.portfolio-chat-composer input::placeholder { color:var(--ask-muted); }
.portfolio-chat-send { width:38px; height:38px; flex:none; display:grid; place-items:center; border:0; border-radius:50%; background:var(--ask-ink); color:var(--ask-surface); cursor:pointer; transition:transform .2s cubic-bezier(.76,0,.24,1),opacity .2s; }
.portfolio-chat-send:hover,.portfolio-chat-send:focus-visible { transform:translateY(-1px) scale(1.04); opacity:.9; }
.portfolio-chat-send:disabled { opacity:.3; cursor:default; transform:none; }
@media(max-width:620px){.portfolio-chat-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:14px}.portfolio-chat-panel{height:100%}.portfolio-chat-body{min-height:0;padding:18px 16px}.portfolio-chat-header{padding:14px}.portfolio-chat-composer{margin:4px 14px 14px;padding-left:14px}}
@media(prefers-reduced-motion:reduce){.portfolio-chat-dialog[open],.portfolio-chat-opening,.portfolio-chat-user,.portfolio-chat-assistant,.portfolio-chat-thinking{animation-duration:.01ms!important}.portfolio-chat-dialog *{transition-duration:.01ms!important}}
