/* attashah.dev v6: the interview widget (js/chat.js). Ported from public/chat.css and restyled to the tokens: the raised sheet colours for
   surfaces, the one accent for the visitor's own words and the send action, and no other hue. Keep the phone query in step with chat.js. */
.iv{--av:44px;position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:40;font-family:var(--body);color:var(--line);line-height:1.5}
.iv[hidden]{display:none}
.iv-av{flex:none;width:var(--av);height:var(--av);border-radius:50%;background:var(--sheet-3) var(--iv-avatar) 55% 90%/125% no-repeat;box-shadow:0 0 0 2px color-mix(in srgb,var(--tan) 62%,transparent)}

/* launcher pill */
.iv-pill{--av:40px;position:relative;display:flex;align-items:center;gap:10px;padding:6px 18px 6px 6px;border-radius:999px;border:1px solid var(--rule);
  background:color-mix(in srgb,var(--sheet-2) 92%,transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);color:var(--line);font:600 .95rem var(--body);cursor:pointer;box-shadow:0 10px 30px rgb(0 0 0 / .45)}
.iv-pill:hover{border-color:var(--tan)}
.iv-pill i{position:absolute;left:36px;top:34px;width:10px;height:10px;border-radius:50%;background:var(--tan);border:2px solid var(--sheet-2)}

/* panel */
.iv-panel{display:flex;flex-direction:column;width:380px;height:min(560px,calc(100dvh - 32px));border-radius:18px;border:1px solid var(--rule);background:var(--sheet-2);box-shadow:0 24px 60px rgb(0 0 0 / .55);overflow:hidden;transform-origin:100% 100%;animation:iv-in .22s ease-out}
.iv:not(.open) .iv-panel,.iv.open .iv-pill{display:none}
@keyframes iv-in{from{opacity:0;transform:translateY(10px) scale(.97)}}
.iv-head{display:flex;align-items:center;gap:12px;padding:14px 12px 12px 16px;border-bottom:1px solid var(--rule)}
.iv-ti{flex:1;min-width:0}
.iv-ti b{display:block;font:600 1.34rem/1.05 var(--display);letter-spacing:.005em}
.iv-ti span{display:block;margin-top:3px;font-size:.78rem;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.iv-ib{flex:none;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;border:0;background:transparent;color:var(--dim);cursor:pointer}
.iv-ib:hover{background:var(--sheet-3);color:var(--line)}
.iv-ib svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.iv-note{padding:8px 16px;font-size:.76rem;color:var(--dim);background:color-mix(in srgb,var(--sheet) 55%,transparent);border-bottom:1px solid var(--rule)}
.iv-note a{color:var(--line);text-decoration-color:var(--tan);text-underline-offset:3px}

/* messages */
.iv-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.iv-m{display:flex;gap:8px;align-items:flex-end;max-width:100%}
.iv-m .iv-av{--av:28px;box-shadow:none}
.iv-b{padding:10px 14px;border-radius:16px;font-size:.95rem;white-space:pre-wrap;overflow-wrap:anywhere;max-width:calc(100% - 36px)}
.iv-m.bot .iv-b{background:var(--sheet-3);border:1px solid var(--rule);border-bottom-left-radius:5px}
.iv-m.me{justify-content:flex-end}
.iv-m.me .iv-b{background:var(--tan);color:var(--sheet);border-bottom-right-radius:5px;max-width:88%;font-weight:500}
.iv-m.me .iv-b.long{max-height:7.5em;overflow:hidden;-webkit-mask-image:linear-gradient(#000 70%,transparent);mask-image:linear-gradient(#000 70%,transparent)}
.iv-m.err .iv-b{border-color:color-mix(in srgb,var(--tan) 55%,transparent);color:var(--tan)}
.iv-b a{color:var(--line);text-decoration-color:var(--tan)}
.iv-m.me .iv-b a{color:var(--sheet)}
.iv-b.typing::after{content:"";display:inline-block;width:.45em;height:1em;margin-left:2px;vertical-align:-.15em;background:var(--tan);animation:iv-blink 1s steps(1) infinite}
.iv-b.wait{display:flex;gap:4px;padding:14px}
.iv-b.wait i{width:6px;height:6px;border-radius:50%;background:var(--dim);animation:iv-dot 1.2s ease-in-out infinite}
.iv-b.wait i:nth-child(2){animation-delay:.15s}.iv-b.wait i:nth-child(3){animation-delay:.3s}
@keyframes iv-blink{50%{opacity:0}}
@keyframes iv-dot{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-3px)}}

/* suggestion chips */
.iv-chips{display:flex;flex-wrap:wrap;gap:6px 8px}
.iv-chips button{padding:6px 12px;border-radius:999px;border:1px solid var(--rule);background:color-mix(in srgb,var(--sheet) 55%,transparent);color:var(--line);font:inherit;font-size:.82rem;cursor:pointer;text-align:left}
.iv-chips button:hover{border-color:var(--tan);color:var(--tan)}

/* composer */
.iv-form{position:relative;display:flex;align-items:flex-end;gap:8px;padding:10px 12px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--rule);background:color-mix(in srgb,var(--sheet) 40%,transparent)}
.iv-form textarea{flex:1;min-width:0;resize:none;max-height:160px;min-height:44px;padding:11px 14px;border-radius:14px;border:1.5px solid var(--rule);background:var(--sheet);color:var(--line);font:inherit;font-size:16px;line-height:1.4}
.iv-form textarea::placeholder{color:var(--dim);opacity:.75}
.iv-form textarea:focus{outline:none;border-color:var(--tan)}
.iv-send{flex:none;width:44px;height:44px;border-radius:14px;border:0;background:var(--tan);color:var(--sheet);display:grid;place-items:center;cursor:pointer}
.iv-send svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.iv-send:disabled{opacity:.45;cursor:default}
.iv-count{position:absolute;right:68px;top:-18px;font-size:.72rem;color:var(--dim)}
.iv-rest{padding:14px 16px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--rule);text-align:center;font-size:.9rem}
.iv-rest a{display:inline-block;margin-top:8px;padding:10px 18px;border-radius:12px;background:var(--tan);color:var(--sheet);font-weight:600;text-decoration:none}

.iv button:focus-visible,.iv a:focus-visible,.iv textarea:focus-visible{outline:2px solid var(--tan);outline-offset:2px}
.iv-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.iv [hidden]{display:none!important}

/* phones and small tablets: the chat opens as a full-height sheet (js/chat.js makes it modal) */
@media (max-width:820px),(max-height:520px){
  .iv.open{inset:0;right:0;bottom:0}
  .iv.open .iv-panel{width:100%;height:var(--iv-h,100dvh);border-radius:0;border:0;animation:iv-sheet .25s ease-out}
  .iv-head{padding-top:max(14px,env(safe-area-inset-top))}
  @keyframes iv-sheet{from{transform:translateY(24px);opacity:0}}
}
/* anything under about 1000 px wide, and every touch screen: the launcher is just his face, a round 56 px button, so it covers as little as
   it can of what it floats over. Its name stays for assistive technology. Keep this query in step with `compact` in js/page.js. */
@media (max-width:999px),(max-height:520px),(pointer:coarse){
  .iv:not(.open) .iv-pill{padding:5px;font-size:0;gap:0;--av:46px}
  .iv:not(.open) .iv-pill i{left:38px;top:38px}
}
/* touch: every control in the panel is at least 44 px */
@media (pointer:coarse){
  .iv-ib{width:44px;height:44px}
  .iv-head{gap:8px;padding-right:8px}
  .iv-chips button{min-height:44px;padding:8px 14px}
  .iv-note a{display:inline-block;padding-block:8px;margin-block:-8px}
}
@media (max-width:820px) and (orientation:landscape),(max-height:520px){.iv-note{display:none}.iv-head{padding-block:8px}.iv-ti b{font-size:1.15rem}.iv-ti span{display:none}}
@media (prefers-reduced-motion:reduce){.iv *,.iv-panel{animation:none!important;transition:none!important;scroll-behavior:auto}}
