/* Quiet canvas: the approved neutral conversation surface after the pill scene. */
.portfolio-chat {
  position:relative;
  min-height:100svh;
  padding:144px 24px 64px;
  background:var(--paper);
  scroll-margin-top:0;
  --chat-line:light-dark(#e5e3eb,#3d3c47);
  --chat-surface:light-dark(#fbfbfc,var(--dark-surface));
  --chat-top-space:144px;
  --chat-bottom-space:max(24px,env(safe-area-inset-bottom));
}
.portfolio-chat[hidden],.pill-editing .portfolio-chat {display:none;}
.chat-canvas {max-width:630px;margin:0 auto;}
.portfolio-chat.has-conversation {padding-bottom:var(--chat-bottom-space);min-height:100dvh;overflow-anchor:none;}
.has-conversation .chat-canvas {
  display:flex;flex-direction:column;
  height:max(360px,calc(100dvh - var(--chat-top-space) - var(--chat-bottom-space)));
}
.has-conversation :where(.chat-heading,.chat-prompts,.chat-composer,.chat-disclaimer) {flex-shrink:0;}
.has-conversation .chat-log {flex:1;min-height:64px;max-height:none;}
.chat-return {
  position:absolute;left:calc((100% - var(--nav-content-width)) / 2);top:112px;display:flex;gap:7px;align-items:center;
  padding:8px 0;border:0;background:none;font-size:12px;color:var(--muted);
}
.chat-heading {text-align:center;margin:18px 0 46px;}
.chat-heading h2 {font-size:clamp(30px,4vw,43px);line-height:1.18;font-weight:500;letter-spacing:-.045em;margin:0 0 12px;}
.chat-heading p {font-size:14px;line-height:1.6;color:var(--muted);margin:0;}
.chat-log {
  display:flex;flex-direction:column;gap:24px;min-height:260px;max-height:46svh;
  overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--chat-line) transparent;
  padding:2px 8px 28px 4px;outline-offset:4px;
}
.chat-log:focus-visible {outline:1px solid var(--muted);}
.chat-user {
  align-self:flex-end;max-width:87%;padding:12px 18px;border-radius:20px 20px 4px 20px;
  background:var(--surface-hover);white-space:pre-wrap;overflow-wrap:anywhere;
  font-size:15px;font-weight:400;line-height:1.7;
}
.chat-answer {display:grid;grid-template-columns:25px minmax(0,1fr);gap:12px;width:100%;align-self:flex-start;overflow-wrap:anywhere;}
.chat-answer-body {min-width:0;}
.chat-reply {margin:0;color:var(--muted);font-size:15px;font-weight:400;line-height:1.7;}
.chat-reply strong {font-weight:500;color:var(--ink);}
.chat-mark {
  display:block;position:relative;isolation:isolate;container-type:inline-size;
  width:25px;height:25px;flex-shrink:0;color:var(--on-ink);background:var(--ink);border-radius:50%;
}
.chat-mark .monogram-mark {padding:2px;}
.chat-mark .monogram-ring {animation:none;}
.chat-avatar {margin-top:4px;}
.chat-prompts {position:relative;isolation:isolate;display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px;}
.chat-entrance-effects {position:absolute;inset:-48px -16px;z-index:0;overflow:clip;pointer-events:none;}
.chat-entrance-particle {position:absolute;display:block;background:var(--accent);pointer-events:none;}
.chat-entrance-particle--star {width:12px;height:12px;clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);}
.chat-entrance-particle--spark {width:3px;height:9px;border-radius:3px;background:var(--muted);}
.chat-prompts button {
  border:1px solid var(--chat-line);border-radius:30px;background:transparent;
  padding:8px 12px;font-size:12px;line-height:1.5;color:var(--muted);
  transition:background .18s,color .18s;
}
.chat-prompts button:hover {color:var(--ink);background:var(--surface-hover);}
.chat-prompts button:disabled {opacity:.45;cursor:default;}
.chat-composer {
  padding:18px 20px 14px;border:1px solid var(--chat-line);border-radius:24px;
  background:var(--chat-surface);box-shadow:0 6px 24px light-dark(rgb(11 11 15 / .04),rgb(0 0 0 / .12));
}
.chat-composer:focus-within {border-color:var(--muted);}
.chat-composer textarea {
  display:block;width:100%;height:52px;max-height:150px;min-height:52px;resize:none;
  border:0;padding:0;background:transparent;outline:none;box-shadow:none;color:var(--ink);
  font:400 15px/1.7 Geist,Arial,sans-serif;cursor:text;
  -webkit-user-select:text;user-select:text;
}
.chat-composer textarea::placeholder {color:var(--muted);opacity:1;}
.chat-composer-bottom {display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:6px;}
.chat-caption,.chat-disclaimer,.chat-stopped {font-size:11px;line-height:1.6;color:var(--muted);}
.chat-disclaimer {text-align:center;margin:10px 0 0;}
.chat-send {
  display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;padding:0;
  border:0;border-radius:50%;background:var(--ink);color:var(--on-ink);
}
.chat-send:disabled {opacity:.35;cursor:default;}
.chat-send svg {width:18px;height:18px;}
.chat-stop {display:block;width:12px;height:12px;border-radius:2px;background:currentColor;}
.portfolio-chat :where(button,a):focus-visible {outline:2px solid var(--muted);outline-offset:4px;}
.chat-thinking {display:flex;gap:9px;align-items:center;min-height:26px;}
.chat-thinking::before {content:'';width:8px;height:8px;flex-shrink:0;border-radius:50%;background:var(--ink);animation:chat-pulse 1s ease-in-out infinite;}
.chat-word {animation:chat-word-in .16s ease-out both;}
.chat-details-enter,.chat-prompt-enter {animation:chat-rise .24s cubic-bezier(.16,1,.3,1) both;}
.chat-stopped {display:block;margin-top:10px;}
.chat-skills {display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 14px;}
.chat-skill {display:inline-flex;gap:7px;align-items:center;padding:6px 10px;border:1px solid var(--chat-line);border-radius:30px;font-size:12px;}
.chat-skill img {width:19px;height:19px;object-fit:contain;}
.chat-source {display:inline-flex;gap:5px;align-items:center;margin-top:16px;font-size:11px;color:var(--muted);}
.chat-source svg {width:12px;height:12px;}
.chat-projects {
  position:relative;isolation:isolate;display:flex;gap:14px;
  overflow-x:auto;overscroll-behavior-x:contain;scroll-padding-inline:6px;
  scrollbar-width:thin;scrollbar-color:var(--chat-line) transparent;
  margin:0 -6px;padding:24px 6px 26px;
}
.chat-projects .chat-entrance-effects {inset:0;}
.chat-project {
  position:relative;z-index:1;flex:0 0 auto;
  display:block;width:min(360px,calc(100% - 24px));margin:0;padding:0;text-align:left;
  border:1px solid var(--chat-line);border-radius:16px;overflow:hidden;background:var(--chat-surface);
  box-shadow:0 5px 18px light-dark(rgb(11 11 15 / .035),rgb(0 0 0 / .12));
}
.chat-project:only-child {width:min(100%,360px);}
.chat-project>img {display:block;width:100%;aspect-ratio:1.9;object-fit:cover;}
.chat-project-meta {display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 15px;}
.chat-project-meta strong {display:block;font-size:15px;font-weight:500;line-height:1.7;}
.chat-project-meta small {display:block;font-size:12px;color:var(--muted);line-height:1.6;}
.chat-project-meta svg {width:18px;height:18px;flex-shrink:0;color:var(--accent);}
.chat-project:hover {border-color:var(--muted);}
.chat-table {width:100%;border-collapse:collapse;margin:18px 0 6px;font-size:12px;line-height:1.7;text-align:left;}
.chat-table caption {text-align:left;margin-bottom:8px;font-size:11px;color:var(--muted);}
.chat-table :where(th,td) {padding:11px 10px 11px 0;border-bottom:1px solid var(--chat-line);vertical-align:top;overflow-wrap:anywhere;}
.chat-table th {font-weight:500;}
.chat-table td {color:var(--muted);}
.chat-table :where(th,td):last-child {padding-right:0;}
.chat-actions {display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 4px;}
.chat-action {display:inline-flex;gap:8px;align-items:center;padding:9px 13px;border:1px solid var(--chat-line);border-radius:12px;font-size:12px;}
.chat-action:hover {background:var(--surface-hover);}
.chat-action svg {width:14px;height:14px;color:var(--muted);}
.chat-action:disabled {opacity:.5;cursor:default;}
.chat-follow-up {
  width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 48px);overflow:auto;
  padding:28px;border:1px solid var(--chat-line);border-radius:24px;
  color:var(--ink);background:var(--chat-surface);box-shadow:0 20px 80px rgb(0 0 0 / .15);
}
.chat-follow-up::backdrop {background:rgb(0 0 0 / .25);}
.chat-follow-up [hidden] {display:none;}
.chat-follow-up h3 {font-size:22px;font-weight:500;line-height:1.3;margin:16px 0 10px;}
.chat-follow-up>p,.chat-follow-up-status {font-size:13px;line-height:1.7;color:var(--muted);}
.chat-follow-up-close {display:block;margin-left:auto;padding:4px 0;background:none;border:0;color:var(--muted);font-size:12px;}
.chat-follow-up-form {display:grid;gap:14px;margin-top:20px;}
.chat-follow-up-form label {display:grid;gap:6px;font-size:12px;color:var(--muted);}
.chat-follow-up-form :where(input,textarea) {
  width:100%;padding:10px 12px;border:1px solid var(--chat-line);border-radius:12px;
  font:400 15px/1.7 Geist,Arial,sans-serif;background:transparent;color:var(--ink);
  cursor:text;-webkit-user-select:text;user-select:text;
}
.chat-follow-up-form textarea {resize:vertical;min-height:90px;}
.chat-follow-up-form :where(input,textarea):focus-visible {outline:1px solid var(--muted);outline-offset:2px;}
.chat-follow-up-status {margin:0;}
.chat-follow-up-status:empty {display:none;}
.chat-follow-up-form>.chat-action {justify-self:start;background:transparent;color:var(--ink);}
.chat-emoji {display:block;font-size:32px;line-height:1.3;padding:18px 0 5px;}
.is-empty .chat-heading {margin-bottom:26px;}
.is-empty .chat-log {min-height:150px;max-height:none;padding:0 0 28px;justify-content:center;overflow:visible;}
.chat-welcome {display:flex;flex-direction:column;align-items:center;gap:12px;margin:0;text-align:center;}
.chat-welcome-mark {width:38px;height:38px;opacity:.9;}
.chat-welcome-title {font-size:15px;line-height:1.7;font-weight:500;margin:0;}
.chat-welcome-hint {font-size:13px;line-height:1.7;color:var(--muted);margin:-6px 0 0;}
.is-empty .chat-prompts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:20px;}
.is-empty .chat-prompts button {
  position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;gap:18px;
  min-width:0;text-align:left;border-radius:16px;padding:16px;background:var(--chat-surface);color:var(--ink);
  transition:background .18s,border-color .18s,transform .18s;
}
.is-empty .chat-prompts button:hover {background:var(--surface-hover);border-color:var(--muted);transform:translateY(-2px);}
.chat-start-icon {display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--surface-hover);color:var(--muted);}
.chat-start-icon svg {width:15px;height:15px;}
.chat-start-label {display:flex;flex-direction:column;gap:3px;min-width:0;}
.chat-start-label strong {font-weight:500;font-size:15px;line-height:1.7;overflow-wrap:anywhere;}
.chat-start-label small {font-size:12px;line-height:1.5;font-weight:400;color:var(--muted);}
.chat-start-arrow {position:absolute;right:15px;top:20px;width:13px;height:13px;color:var(--muted);}
.chat-visible .chat-canvas {animation:chat-rise .5s cubic-bezier(.16,1,.3,1) both;}
@keyframes chat-pulse {50% {opacity:.35;transform:scale(.8);}}
@keyframes chat-word-in {from {opacity:.3;}to {opacity:1;}}
@keyframes chat-rise {from {opacity:0;transform:translateY(8px);}to {opacity:1;transform:translateY(0);}}
@media(max-width:650px) {
  .portfolio-chat {padding:108px 20px 40px;--chat-top-space:108px;}
  .chat-return {top:68px;min-height:40px;}
  .chat-heading {margin:12px 0 34px;}
  .chat-heading p {font-size:13px;}
  .has-conversation .chat-heading {margin:0 0 20px;}
  .chat-log {max-height:44svh;min-height:240px;padding-inline:0 4px;}
  .is-empty .chat-prompts {grid-template-columns:1fr;gap:8px;margin-bottom:18px;}
  .is-empty .chat-prompts button {flex-direction:row;align-items:center;gap:12px;padding:13px 16px;}
  .chat-start-icon {width:32px;height:32px;flex-shrink:0;}
  .chat-start-arrow {position:static;margin-left:auto;flex-shrink:0;}
  .chat-composer {padding:16px;}
  .chat-composer textarea {font-size:16px;}
  .chat-answer {gap:10px;}
}
@media(pointer:coarse) {
  .chat-send {width:44px;height:44px;}
  .chat-prompts button,.chat-action,.chat-source {min-height:44px;}
}
@media(max-height:700px) {
  .has-conversation .chat-heading p {display:none;}
  .has-conversation .chat-heading h2 {margin-bottom:0;}
}
.oa-reduced-motion .portfolio-chat *,.oa-reduced-motion .chat-thinking::before {animation:none;transition:none;}
.oa-reduced-motion .chat-prompts button:hover {transform:none;}
@media(prefers-reduced-motion:reduce) {
  .portfolio-chat *,.chat-thinking::before {animation:none!important;transition:none!important;}
  .chat-prompts button:hover {transform:none!important;}
}
