/* Branch ai-drawer (22 October 2026): the AI assistant as a drawer docked at the right, after a mail client's AI side panel.
   Janne: "some kind of AI agent widget in the right-hand corner, and it should say, 'Your personal AI assistant.' When you open
   it, it should open kind of like a drawer where you can have the conversation ... quite visual and engaging".
   Loaded after the system's CSS in this branch only. Built on the v8 tokens (system/v8/base.css): white, Fennia Sans, the five
   type sizes (16 for everything read, 20 and 28 for the greeting), 8 corners on controls and 12 on the composer and her bubbles,
   no circles (README 70), the AI ring only round the small sparkle tile. One id in every selector (#v8), like the system's other
   overlays on <body>; sizes and weights !important, as the system requires (README 2). */

:root { --aid-w: clamp(380px, 30vw, 440px); --aid-ease: cubic-bezier(.2, .7, .2, 1); }

/* ---------- The AI mark: a 32 tile, the ring 2 px, the sparkle in the ring's colours ---------- */
#v8 .aid-mk { --ai-a: 200deg; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; box-sizing: border-box;
  border: 2px solid transparent; border-radius: var(--v8-r-sm); background-color: transparent; background-image: linear-gradient(#fff, #fff), var(--v8-ring); background-clip: padding-box, border-box; background-origin: border-box; }
#v8 .aid-mk > span { font-size: var(--v8-fs-16) !important; line-height: 1 !important; font-weight: 400 !important;
  background: linear-gradient(135deg, #FF9F1C, #FFD43B 30%, #5BC24E 55%, #3D7BF5 80%, #9B5DE5); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- The launcher ---------- */
/* From 1024: a white widget 48 high, 8 corners, the floating shadow, 24 from the window's right and bottom edges; the mark, then
   "Your personal AI assistant" in 16 ink. Hover the light green wash, and the ring turns once (not with reduced motion) */
#v8 body .aid-launch { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px 0 8px; box-sizing: border-box; border: 1px solid var(--v8-line); border-radius: var(--v8-r-sm); background: var(--v8-white);
  box-shadow: var(--v8-shadow-pop); color: var(--v8-ink); font: inherit; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important;
  font-weight: 400 !important; white-space: nowrap; cursor: pointer; transition: background-color .16s ease-out, border-color .16s ease-out, transform .16s ease-out; }
#v8 body .aid-launch[hidden] { display: none; }
#v8 body .aid-launch .aid-mk > span { font-size: var(--v8-fs-16) !important; }
@media (hover: hover) {
  #v8 body .aid-launch:hover { background: var(--v8-hover); border-color: var(--fennia-primary-40); }
  #v8 body .aid-launch:hover .aid-mk { animation: ai-turn 2.4s linear infinite; }
}
#v8 body .aid-launch:active { background: var(--v8-pressed); }
#v8 body .aid-launch:focus-visible { outline: var(--v8-focus); outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
/* Below 1024: the tile and "AI assistant" (the sparkle never alone: research/ai-assistant-adoption.md), 12 above the tab bar's
   right end; the button's name stays "Your personal AI assistant", which holds the visible words (WCAG 2.5.3) */
#v8 body .aid-launch .aid-ls { display: none; }
@media (max-width: 1023px) {
  #v8 body .aid-launch { right: 16px; bottom: calc(var(--tabbar-h, 64px) + 12px + env(safe-area-inset-bottom)); padding: 0 14px 0 6px; gap: 8px; }
  #v8 body .aid-launch .aid-ll { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #v8 body .aid-launch .aid-ls { display: inline; }
}
/* In the task flows: the tile alone (the flows' actions sit at the foot; the flow keeps its own ways to ask), above the dock */
#v8.v8-in-flow body .aid-launch { width: 48px; padding: 0; justify-content: center; }
#v8.v8-in-flow body .aid-launch .aid-ll { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#v8.v8-in-flow body .aid-launch .aid-ls { display: none; }
@media (max-width: 1023px) { #v8.v8-in-flow body .aid-launch { bottom: calc(var(--v8-dock, 0px) + 12px + env(safe-area-inset-bottom)); } }
/* Where the main prototype hides its bubble, the launcher waits too: another dialog open, the offer page, a phone's message dock */
#v8 body:has(.v8-dlgw, .cov-drawer, .dv-wrap) .aid-launch { visibility: hidden; }
#v8:has(#app .v8-ofx:not(.v8-ofx-own)) body .aid-launch { display: none; }
@media (max-width: 639px) { #v8 body:has(#app .shell.has-dock) .aid-launch { display: none; } }
/* The side menu open under 1024 (README 142: the tablet drawer, the phone's full-screen menu) keeps the launcher out of its way;
   the page behind is inert then, so the launcher couldn't be reached anyway */
#v8.drawer-open body .aid-launch { visibility: hidden; }
/* The old bubble never shows in this branch */
#v8 body .aiw-launch { display: none !important; }
/* Toasts clear the launcher */
@media (min-width: 1024px) { #v8 body:has(.aid-launch:not([hidden])) .toast { bottom: calc(24px + 48px + 16px) !important; } }

/* ---------- The drawer ---------- */
/* Full height at the right, white, a 1 px line on its left edge. From 640 it floats over the page's right edge with the shadow and
   nothing dims; below 640 it is the whole screen; docked beside a narrowed page only behind ?aid=dock (assistant.js aiMode) */
#v8 body .aid { position: fixed; top: 0; right: 0; bottom: 0; z-index: 85; display: flex; flex-direction: column; width: var(--aid-w);
  box-sizing: border-box; border-left: 1px solid var(--v8-line); background: var(--v8-white); color: var(--v8-ink); font-family: var(--font);
  font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important;
  transform: translateX(0); transition: transform .28s var(--aid-ease), opacity .2s ease-out; }
#v8 body .aid[data-mode="over"] { box-shadow: var(--v8-shadow-pop); }
#v8 body .aid[data-mode="sheet"] { left: 0; width: auto; border-left: 0; z-index: 200; }
#v8 body .aid.aid-in { transform: translateX(32px); opacity: 0; transition: none; }
#v8 body .aid.aid-ghost { pointer-events: none; animation: aid-leave .2s ease-in forwards; }
#v8 body .aid[data-mode="sheet"].aid-ghost { animation-name: aid-leave-down; }
@keyframes aid-leave { to { transform: translateX(32px); opacity: 0; } }
@keyframes aid-leave-down { to { transform: translateY(24px); opacity: 0; } }
#v8 body .aid[data-mode="sheet"].aid-in { transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) { #v8 body .aid { transition: none; } #v8 body .aid.aid-ghost { display: none; } }
/* The push layout (round two, from 1280): docked, #app gives the drawer its width, so the page area narrows instead of being covered;
   the pages reflow through @container app (base.css). The width eases with the drawer's slide; no motion with reduced motion. Docked,
   the drawer is part of the layout: its hairline, no shadow */
#v8 body #app { transition: margin-right .28s var(--aid-ease); }
#v8.aid-docked body #app { margin-right: var(--aid-w) !important; }
#v8 body .aid[data-mode="dock"] { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { #v8 body #app { transition: none; } }
/* The phone sheet: the page behind doesn't scroll */
#v8.aid-sheet body { overflow: hidden; }
#v8 body .aid :focus-visible { outline: var(--v8-focus) !important; outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
#v8 body .aid .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
#v8 body .aid button { font: inherit; color: inherit; }
#v8 body .aid svg.i { width: 20px; height: 20px; flex: none; }

/* The head: the mark, the title, three icon buttons */
#v8 body .aid.aid-scrolled .aid-head { box-shadow: 0 1px 0 var(--v8-line); }
#v8 body .aid-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; flex: none; min-height: 56px; padding: 8px 8px 8px 16px; box-sizing: border-box; }   /* round two: 56 high, 16 in, the mark 28 */
#v8 body .aid-head .aid-mk { width: 28px; height: 28px; }
#v8 body .aid-head h2 { flex: 1; min-width: 0; margin: 0; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 body .aid-head h2:focus { outline: none; }
#v8 body .aid-head h2:focus-visible { outline: var(--v8-focus) !important; outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
#v8 body .aid-tools { display: flex; gap: 0; }
#v8 body .aid-ib { position: relative; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--v8-r-pill); background: none; color: var(--v8-ink-2); cursor: pointer; transition: background-color .16s ease-out; }
@media (hover: hover) { #v8 body .aid-ib:hover { background: var(--v8-gray); color: var(--v8-ink); } }
#v8 body .aid-ib[aria-pressed="true"] { background: var(--v8-mint); color: var(--v8-green-t); }
@media (pointer: coarse) { #v8 body .aid-ib { width: 44px; height: 44px; } }

/* The body scrolls; the empty state sits at its foot, near the composer */
#v8 body .aid-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 24px; box-sizing: border-box; display: flex; flex-direction: column; }
#v8 body .aid-body:focus { outline: none; }
#v8 body .aid-body-empty { justify-content: flex-end; }

/* ---------- The empty state ---------- */
#v8 body .aid-empty { display: grid; gap: 8px; padding-bottom: 0; }
#v8 body .aid-hello { margin: 0; font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-20) !important; font-weight: 700 !important; color: var(--v8-ink); letter-spacing: -0.01em; }   /* round two: 20, a side panel's greeting, not a page title */
#v8 body .aid-what { margin: 0 0 16px; color: var(--v8-ink); }
#v8 body .aid-qs { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* A ready-written question: a small object, white, 1 px Primary-30, 8 corners, its icon on a 32 mint tile, the words in link green */
#v8 body .aid-q { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 5px 12px 5px 5px; box-sizing: border-box; border: 1px solid var(--fennia-primary-30);
  border-radius: var(--v8-r-sm); background: var(--v8-white); color: var(--v8-green-t); text-align: left; cursor: pointer; transition: background-color .16s ease-out, border-color .16s ease-out, transform .16s var(--aid-ease); }
#v8 body .aid-q span:last-child { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
#v8 body .aid-qi, #v8 body .aid-ri { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--v8-r-tag); background: var(--v8-mint); color: var(--v8-green-t); }
#v8 body .aid-qi svg.i, #v8 body .aid-ri svg.i { width: 18px; height: 18px; }
@media (hover: hover) { #v8 body .aid-q:hover { background: var(--v8-hover); border-color: var(--fennia-primary-40); } #v8 body .aid-q:hover .aid-qi { background: var(--v8-white); } }
#v8 body .aid-q:active { background: var(--v8-pressed); }
/* The questions arrive one after another (not with reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  #v8 body .aid-empty > * { animation: aid-rise .36s var(--aid-ease) both; }
  #v8 body .aid-empty > .aid-what { animation-delay: .04s; }
  #v8 body .aid-qs li { animation: aid-rise .36s var(--aid-ease) both; }
  #v8 body .aid-qs li:nth-child(1) { animation-delay: .08s; } #v8 body .aid-qs li:nth-child(2) { animation-delay: .13s; } #v8 body .aid-qs li:nth-child(3) { animation-delay: .18s; }
}
@keyframes aid-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- The conversation ---------- */
#v8 body .aid-log { display: grid; gap: 24px; margin: 0; padding: 8px 0 0; list-style: none; }
#v8 body .aid-note { color: var(--v8-ink); text-align: center; padding: 0 8px; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
/* Hers: right, mint, 12 corners; the context she asked about as a small card above it */
#v8 body .aid-me { display: grid; justify-items: end; gap: 6px; }
#v8 body .aid-me p { max-width: 85%; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--v8-mint); color: var(--v8-ink); overflow-wrap: anywhere; }
/* The assistant's: plain text on white, no bubble (the reference's calm), lists with a little air */
#v8 body .aid-ai { display: grid; gap: 12px; max-width: 38em; }   /* the measure: about 60 characters at the widest drawer */
#v8 body .aid-a { display: grid; gap: 8px; }
#v8 body .aid-a p { margin: 0; }
#v8 body .aid-a ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }   /* 4 px square bullets (no circles, README 70), drawn with the sources' */
#v8 body .aid-a b { font-weight: 700 !important; }
@media (prefers-reduced-motion: no-preference) { #v8 body .aid-ai:last-child, #v8 body .aid-me:last-child, #v8 body .aid-person:last-child { animation: aid-rise .3s var(--aid-ease) both; } }
/* Sources (round two): a heading row and a bulleted list of named links, 14/20 both, so the heading is never small words over larger
   ones. 12 under the answer, 4 between the heading and the list and between the items. The bullets are 4 px squares, as the answer's */
#v8 body .aid-src { margin: 4px 0 0; color: var(--v8-ink); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }   /* one plain line, "Source: <link>" (README 200) */
#v8 body .aid-a li { position: relative; padding-left: 16px; }
#v8 body .aid-a li::before { content: ""; position: absolute; left: 2px; top: calc(0.5lh - 2px); width: 4px; height: 4px; border-radius: 1px; background: var(--v8-green-t); }
#v8 body .aid-sc { color: var(--v8-green-t); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--v8-green-t) 45%, transparent); }
@media (hover: hover) { #v8 body a.aid-sc:hover { text-decoration-color: currentColor; } }
#v8 body .aid-sc-here { color: var(--v8-ink); }
/* An answer's one action (Make changes, Talk to a person): the system's chip button */
#v8 body .aid-acts { display: flex; }
#v8 body .aid-act { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--fennia-primary-30); border-radius: var(--v8-r-sm);
  background: var(--v8-white); color: var(--v8-green-t) !important; text-decoration: none; cursor: pointer; }
@media (hover: hover) { #v8 body .aid-act:hover { background: var(--v8-hover); border-color: var(--fennia-primary-40); } }
@media (pointer: coarse) { #v8 body .aid-act { height: 44px; } }
/* Was this helpful? */
#v8 body .aid-fb { display: grid; gap: 8px; }
#v8 body .aid-fbl { display: flex; align-items: center; gap: 2px; color: var(--v8-ink); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
#v8 body .aid-fbq { margin-right: 6px; }
#v8 body .aid-fbb { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--v8-r-sm); background: none; color: var(--v8-ink-2); cursor: pointer; }
#v8 body .aid-fbb svg.i { width: 18px; height: 18px; }
@media (hover: hover) { #v8 body .aid-fbb:hover { background: var(--v8-gray); color: var(--v8-ink); } }
#v8 body .aid-fbb[aria-pressed="true"] { background: var(--v8-mint); color: var(--v8-green-t); }
@media (pointer: coarse) { #v8 body .aid-fbb { width: 44px; height: 44px; } }
#v8 body .aid-fbs { margin: 0; color: var(--v8-ink); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
#v8 body .aid-fbs:empty { display: none; }
#v8 body .aid-why { display: flex; flex-wrap: wrap; gap: 8px; }
#v8 body .aid-why button { min-height: 36px; padding: 0 12px; border: 1px solid var(--fennia-primary-30); border-radius: var(--v8-r-pill); background: var(--v8-white); color: var(--v8-green-t); cursor: pointer; }
@media (hover: hover) { #v8 body .aid-why button:hover { background: var(--v8-hover); } }
@media (pointer: coarse) { #v8 body .aid-why button { min-height: 44px; } }
/* The typing line: what it is checking, with three small squares that pulse in turn */
#v8 body .aid-typing { display: flex; align-items: center; gap: 12px; color: var(--v8-ink); }
#v8 body .aid-dots { display: inline-flex; gap: 4px; }
#v8 body .aid-dots i { width: 6px; height: 6px; border-radius: 2px; background: var(--fennia-primary-40); }
@media (prefers-reduced-motion: no-preference) {
  #v8 body .aid-dots i { animation: aid-pulse 1s ease-in-out infinite; }
  #v8 body .aid-dots i:nth-child(2) { animation-delay: .15s; } #v8 body .aid-dots i:nth-child(3) { animation-delay: .3s; }
}
@keyframes aid-pulse { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* Talk to a person: a white box with the 1 px line, its two ways as link rows (the boxed list's look) */
#v8 body .aid-person { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--v8-line); border-radius: 12px; }
#v8 body .aid-ph { margin: 0; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; }
#v8 body .aid-ph:focus { outline: none; }
#v8 body .aid-person > p { margin: 0; color: var(--v8-ink); }
#v8 body .aid-pl, #v8 body .aid-hl { display: grid; margin: 4px 0 0; padding: 0; list-style: none; border: 1px solid var(--v8-line); border-radius: var(--v8-r-sm); overflow: hidden; }
#v8 body .aid-pl li + li, #v8 body .aid-hl li + li { border-top: 1px solid var(--v8-line); }
#v8 body .aid-pr, #v8 body .aid-hr { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; box-sizing: border-box; border: 0; background: var(--v8-white); color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
#v8 body .aid-pr > span:last-child, #v8 body .aid-hr > span:last-child { display: grid; min-width: 0; }
#v8 body .aid-pr b, #v8 body .aid-hr b { color: var(--v8-green-t); font-weight: 400 !important; }
#v8 body .aid-pr span span, #v8 body .aid-hr span span { color: var(--v8-ink); }
@media (hover: hover) { #v8 body .aid-pr:hover, #v8 body .aid-hr:hover { background: var(--v8-hover); } #v8 body .aid-pr:hover .aid-ri, #v8 body .aid-hr:hover .aid-ri { background: var(--v8-white); } }
#v8 body .aid-pr:focus-visible, #v8 body .aid-hr:focus-visible { outline-offset: -2px !important; }

/* Earlier chats */
#v8 body .aid-hist { display: grid; gap: 16px; align-content: start; }
#v8 body .aid-hh { margin: 0; font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-20) !important; font-weight: 700 !important; }
#v8 body .aid-hh:focus { outline: none; }
#v8 body .aid-back { justify-self: start; height: 36px; padding: 0 12px; border: 1px solid var(--fennia-primary-30); border-radius: var(--v8-r-sm); background: var(--v8-white); color: var(--v8-green-t); cursor: pointer; }
@media (hover: hover) { #v8 body .aid-back:hover { background: var(--v8-hover); } }

/* ---------- The composer ---------- */
#v8 body .aid-foot { flex: none; padding: 0 16px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
#v8 body .aid-comp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px; border: 1px solid var(--v8-field); border-radius: 12px; background: var(--v8-white); transition: border-color .16s ease-out, box-shadow .16s ease-out; }
#v8 body .aid-comp:focus-within { border-color: var(--v8-green); box-shadow: inset 0 0 0 1px var(--v8-green); }
/* The page as a small card: its icon on a mint tile, the name on one line, a remove button */
#v8 body .aid-ctxw { min-width: 0; }
#v8 body .aid-ctxw:empty { display: none; }
#v8 body .aid-ctx { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 3px 3px 3px 3px; box-sizing: border-box; border-radius: var(--v8-r-sm); background: var(--v8-gray); color: var(--v8-ink); }
#v8 body .aid-ctx-i { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--v8-r-tag); background: var(--v8-white); color: var(--v8-green-t); }
#v8 body .aid-ctx-i svg.i { width: 16px; height: 16px; }
#v8 body .aid-ctx-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#v8 body .aid-ctx-x { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--v8-r-tag); background: none; color: var(--v8-ink-2); cursor: pointer; }
#v8 body .aid-ctx-x svg.i { width: 16px; height: 16px; }
@media (hover: hover) { #v8 body .aid-ctx-x:hover { background: var(--v8-white); color: var(--v8-ink); } }
@media (pointer: coarse) { #v8 body .aid-ctx-x { width: 36px; height: 36px; } }
#v8 body .aid-ctx-s { padding-right: 10px; }
/* The field: no box of its own (the composer is the box), grows to five lines */
#v8 body .aid-comp textarea { display: block; width: 100%; min-height: 40px; max-height: 128px; margin: 0; padding: 8px 4px; box-sizing: border-box; border: 0; outline: 0; resize: none;
  background: transparent; color: var(--v8-ink); font: inherit; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
#v8 body .aid-comp textarea::placeholder { color: var(--v8-ink-2); opacity: 1; }
#v8 body .aid-comp textarea:focus-visible { outline: 0 !important; }
#v8 body .aid-row { display: flex; align-items: center; gap: 8px; }
/* More options (round two, the "+" gone): a 32 rounded square, white, 1 px Primary-30, 8 corners, three small squares in link green;
   hover and open the light green wash. 44 on touch */
#v8 body .aid .aid-more { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; box-sizing: border-box; border: 1px solid var(--fennia-primary-30); border-radius: var(--v8-r-pill); background: var(--v8-white); color: var(--v8-green-t); cursor: pointer; transition: background-color .16s ease-out, border-color .16s ease-out; }
#v8 body .aid .aid-more svg.i { width: 20px; height: 20px; fill: currentColor; color: var(--v8-green-t); }
@media (hover: hover) { #v8 body .aid-more:hover { background: var(--v8-hover); border-color: var(--fennia-primary-40); } }
#v8 body .aid-more[aria-expanded="true"] { background: var(--v8-hover); border-color: var(--fennia-primary-40); }
@media (pointer: coarse) { #v8 body .aid-more { width: 44px; height: 44px; } }
/* Its menu: above the field's left edge, white, 1 px line, 12 corners, the floating shadow, 4 inside; items 40 high (44 on touch),
   a 20 line icon in link green and 16 ink words; hover and keyboard focus the light green wash; a hairline before Talk to a person */
#v8 body .aid-menu { position: absolute; left: 8px; bottom: calc(100% + 8px); z-index: 3; display: grid; min-width: 248px; padding: 4px; box-sizing: border-box; border: 1px solid var(--v8-line); border-radius: 12px; background: var(--v8-white); box-shadow: var(--v8-shadow-pop); }
#v8 body .aid-menu[hidden] { display: none; }
#v8 body .aid-mi { display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px 0 10px; box-sizing: border-box; border: 0; border-radius: var(--v8-r-sm); background: none; color: var(--v8-ink); text-align: left; white-space: nowrap; cursor: pointer; }
#v8 body .aid-mi svg.i { color: var(--v8-green-t); }
@media (hover: hover) { #v8 body .aid-mi:hover { background: var(--v8-hover); } }
#v8 body .aid-mi:focus-visible { background: var(--v8-hover); outline-offset: -2px !important; }
#v8 body .aid-menu-sep { height: 1px; margin: 4px 8px; background: var(--v8-line); }
@media (pointer: coarse) { #v8 body .aid-mi { height: 44px; } }
@media (prefers-reduced-motion: no-preference) { #v8 body .aid-menu:not([hidden]) { animation: aid-pop .14s var(--aid-ease) both; } }
@keyframes aid-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Send: a 32 square (round two, the more button's size) with 8 corners in Fennia green; gray until there's a question */
#v8 body .aid-send { display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; padding: 0; border: 0; border-radius: var(--v8-r-pill); background: var(--v8-green); color: var(--v8-white); cursor: pointer; transition: background-color .16s ease-out; }
#v8 body .aid-send svg.i { width: 20px; height: 20px; color: var(--v8-white); }
@media (hover: hover) { #v8 body .aid-send:not(:disabled):hover { background: var(--v8-green-t); } }
#v8 body .aid-send:disabled { background: var(--fennia-neutral-20); cursor: default; }
#v8 body .aid-send:disabled svg.i { color: var(--fennia-neutral-70); }
@media (pointer: coarse) { #v8 body .aid-send { width: 44px; height: 44px; } }
/* Under the composer, very small print (Janne, round two: "very small print at the bottom: AI can make mistakes. Your policy terms
   apply."): 12/16, secondary, centred, one line; Talk to a person moved into the actions menu */
#v8 body .aid-fine { margin: 0; padding: 8px 4px 0; color: var(--v8-ink); text-align: center; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
@media (forced-colors: active) {
  #v8 body .aid, #v8 body .aid-launch, #v8 body .aid-q, #v8 body .aid-comp, #v8 body .aid-act, #v8 body .aid-person, #v8 body .aid-menu, #v8 body .aid-more { border: 1px solid CanvasText; }
  #v8 body .aid-a li::before { background: CanvasText; }
  #v8 body .aid-send { border: 1px solid ButtonText; }
}

/* The launcher says "Your AI assistant" at every width (Janne, 22 October 2026): the short form is retired, the name never hides */
#v8 body .aid-launch .aid-ls { display: none !important; }
#v8 body .aid-launch .aid-ll { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; clip: auto !important; }
/* The rainbow ring round the whole launcher too (Janne, 22 October 2026: "can u make the rainbow stroke around the container too in
   ai assistant widget"): a 2 px ring of the AI gradient (--v8-ring) round the white widget, as the old pill had; hover keeps the
   ring and washes the inside light green, and the ring turns (not with reduced motion) */
#v8 body .aid-launch { border: 2px solid transparent !important; background-color: transparent !important; background-image: linear-gradient(var(--v8-white), var(--v8-white)), var(--v8-ring) !important; background-clip: padding-box, border-box !important; background-origin: border-box !important; }
@media (hover: hover) {
  #v8 body .aid-launch:hover { background-color: transparent !important; background-image: linear-gradient(var(--v8-hover), var(--v8-hover)), var(--v8-ring) !important; background-clip: padding-box, border-box !important; background-origin: border-box !important; animation: ai-turn 2.4s linear infinite; }
}
#v8 body .aid-launch:active { background-color: transparent !important; background-image: linear-gradient(var(--v8-pressed), var(--v8-pressed)), var(--v8-ring) !important; background-clip: padding-box, border-box !important; background-origin: border-box !important; }
@media (prefers-reduced-motion: reduce) { #v8 body .aid-launch:hover { animation: none; } }
@media (forced-colors: active) { #v8 body .aid-launch { border-color: ButtonText !important; } }

/* The greeting softer (Janne, 22 October 2026: "How can I help somehow looks a bit too dark and too aggressive"): 20 Regular in
   secondary ink (#5E5E5E, 6.5:1), not 20 Bold ink; it invites rather than headlines */
#v8 body .aid-hello { font-weight: 400 !important; color: var(--v8-ink) !important; letter-spacing: 0; }
/* the disclosure under the greeting in secondary ink, so the greeting leads */
#v8 body .aid-hello + p, #v8 body .aid-hello ~ .aid-what { color: var(--v8-ink) !important; }
/* The composer calm, like the side menu's Search (Janne, 22 October 2026: "the same way as in the navigation ... the place where
   you're writing, like the search thing, the same styling could be applied to the AI chat text box"): a 1 px light grey line
   (--v8-line) on white at rest; focused, the line a step darker in green (Primary-40, 1 px), no doubled green ring */
#v8 body .aid-comp { border: 1px solid var(--v8-line) !important; box-shadow: none !important; }
#v8 body .aid-comp:focus-within { border-color: var(--fennia-primary-40) !important; box-shadow: none !important; }
/* ---------- Round five: simpler, after the mail client's side panel (Janne, 22 October 2026) ----------
   The head carries only its three icon buttons (the title stays for screen readers); the empty state: the mark (40) and the name
   (20 Bold) at the top, white space, then the greeting and plain white question chips (1 px line, 12 corners, a small sparkle,
   16 ink, no icon tile); the page in the composer as a small card */
#v8 body .aid-head > .aid-mk { display: none; }
#v8 body .aid-head > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#v8 body .aid-head { justify-content: flex-end; }
#v8 body .aid-empty5 { display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; gap: 24px; }
#v8 body .aid-brand { display: grid; gap: 12px; padding-top: 24px; }
#v8 body .aid-mk.aid-mk-l { width: 40px; height: 40px; }
#v8 body .aid-mk.aid-mk-l > span { font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-20) !important; }
#v8 body .aid-bname { margin: 0; color: var(--v8-ink); font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-20) !important; font-weight: 700 !important; }
#v8 body .aid-low { display: grid; gap: 12px; }
#v8 body .aid-empty5 .aid-hello { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink) !important; }
#v8 body .aid-empty5 .aid-qs { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#v8 body .aid-empty5 .aid-q { display: inline-flex; align-items: center; gap: 10px; width: auto; max-width: 100%; min-height: 44px; padding: 8px 14px; border: 1px solid var(--v8-line) !important; border-radius: 12px !important;
  background: var(--v8-white) !important; color: var(--v8-ink); text-align: left; box-shadow: none !important; }
#v8 body .aid-empty5 .aid-qs-mk { flex: none; color: var(--fennia-primary-100); font-size: 14px; line-height: 1; }
@media (hover: hover) { #v8 body .aid-empty5 .aid-q:hover { background: var(--v8-hover) !important; border-color: var(--fennia-primary-40) !important; } }
/* The add button (Janne, 22 October 2026: "instead of a plus sign, the plus could be inside again, like a little round container,
   so it's like a button"): the plus inside the 32 rounded square (8 corners, not a circle: README 70), white with the light
   stroke, the plus 18 in link green; it opens the same menu (Attach a document, Talk to a person) */
#v8 body .aid-more svg.i { width: 18px; height: 18px; color: var(--v8-green-t); }

/* ---------- Never clipped, never covering (README 142, the audit's D2; Janne, 22 October 2026: "Yep, sure, fix them") ----------
   The rule above ("the name never hides") had outranked the flows' tile-only launcher, so in the claim flow, the needs assessment,
   Make changes and Buy a policy the 48 box showed "Your AI assis" cut off at its edge. Where space is short, the launcher is the
   tile alone: in every flow at every width, and on phones (under 640) on every page. Its name stays "Your AI assistant" for screen
   readers (the words are visually hidden, not removed), and the ring and the sparkle say what it is */
#v8.v8-in-flow body .aid-launch { width: 48px; padding: 0; justify-content: center; }
#v8.v8-in-flow body .aid-launch .aid-ll { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap; }
@media (max-width: 639px) {
  #v8 body .aid-launch { width: 48px; padding: 0; justify-content: center; }
  #v8 body .aid-launch .aid-ll { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap; }
}
/* The page ends clear of it: under 1024 the footer keeps 80 under its last link (base.css keeps 80 from 1024), so the tile never sits
   on the last thing she can read or press */
@media (max-width: 1023px) { #v8 #app .qfoot { padding-bottom: 80px !important; } }
/* An answer's actions side by side, 8 apart, wrapping on a narrow drawer (README 142: an answer can carry its action and Talk to a person) */
#v8 body .aid-acts { flex-wrap: wrap; gap: 8px; }

/* The risk review (README 144): a question's answers as the answer's own chip buttons (.aid-act), wrapping, 8 apart; the line under
   them in the small print's gray; Stop the review a quiet text button under them (44 tall to tap). Low fidelity: no new look */
#v8 body .aid-rr-ch { display: flex; flex-wrap: wrap; gap: 8px; }
#v8 body .aid-rr-c { font: inherit; text-align: left; }
#v8 body .aid-rr-c:focus-visible, #v8 body .aid-rr-stop:focus-visible { outline: var(--v8-focus); outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
#v8 body .aid-rr-hint { margin: 0; color: var(--v8-ink); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; }
#v8 body .aid-rr-stop { justify-self: start; min-height: 44px; margin: -8px 0 -8px -4px; padding: 0 4px; border: 0; background: none; color: var(--v8-green-t); font: inherit;
  color: var(--v8-green-t) !important; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) { #v8 body .aid-rr-stop:hover { text-decoration-thickness: 2px; } }
@media (forced-colors: active) { #v8 body .aid-rr-c { border: 1px solid ButtonText; } }

/* The review's summary, second pass (22 October 2026, README 144; Janne: "they should be able to change the answers in the
   summary"): each row its words, then Change at the row's end, a quiet text button in Stop the review's link green (not a chip: seven
   chips would outweigh Save my details). The row's words wrap beside it; Change sits on the first line. 32 tall to click, so the rows go 8
   apart instead of 4 (44 on touch, the rows then 20 apart so no two targets overlap); the bullets stay the answer's 4 px squares */
#v8 body .aid-a ul.aid-rr-sum { gap: 8px; }
#v8 body .aid-a .aid-rr-sum li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#v8 body .aid-rr-sum li > span { min-width: 0; }
#v8 body .aid-rr-chg { flex: none; display: inline-flex; align-items: center; min-height: 32px; margin: -4px -4px -4px 0; padding: 0 4px; border: 0; border-radius: var(--v8-r-tag); background: none; font: inherit;
  color: var(--v8-green-t) !important; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (hover: hover) { #v8 body .aid-rr-chg:hover { text-decoration-thickness: 2px; } }
@media (pointer: coarse) { #v8 body .aid-rr-chg { min-height: 44px; margin: -10px -4px -10px 0; } #v8 body .aid-a ul.aid-rr-sum { gap: 20px; } }
#v8 body .aid-rr-chg:focus-visible { outline: var(--v8-focus); outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
@media (forced-colors: active) { #v8 body .aid-rr-chg { color: LinkText !important; } }
/* The launcher floats above everything, even with its focus ring (Janne, 22 October 2026: "the X in the background overlaps with
   your AI assistant, even though your AI assistant should be floating above everything"): the ring's 3 px gap was see-through, so a
   card's Hide showed in it. The gap is filled with white under the focus ring. Its layer (80) already sits above every page layer and
   below the dialogs (90) */
#v8 body .aid-launch:focus-visible { box-shadow: var(--v8-shadow-pop), 0 0 0 3px var(--v8-white); }
/* Follow-up questions inside an answer (README 146) are buttons, not a bulleted list: no bullet, no list indent, the empty state's
   spacing */
#v8 body .aid-a ul.aid-qs-in { margin: calc(var(--v8-3) - var(--v8-2)) 0 0; padding: 0; list-style: none; }   /* 12 under the text: the answer's grid gives 8 (9 November 2026) */
#v8 body .aid-a ul.aid-qs-in > li { padding-left: 0; }
#v8 body .aid-a ul.aid-qs-in > li::before { content: none; display: none; }
/* The suggested questions take the light green stroke (Janne, 22 October 2026: "in the prompts, you could have light green stroke"),
   as the follow-ups already have: Primary-30 */
#v8 body .aid-empty5 .aid-q { border-color: var(--fennia-primary-30) !important; }
/* The launcher is one container (Janne, 22 October 2026: "just a big sparkle next to it, but the sparkle itself shouldn't be in another
   container. There should be just one container, which is the outer stroke"): the rainbow ring is the launcher's own edge; inside,
   the sparkle at 24 with no tile round it, then "Your AI assistant". The drawer's head keeps its small mark */
#v8 body .aid-launch .aid-mk { width: auto; height: auto; border: 0; border-radius: 0; background: none; }
#v8 body .aid-launch .aid-mk > span { font-size: calc(var(--v8-fs-20) * 1.2) !important; line-height: 1 !important; }
#v8 body .aid-launch { gap: 8px; padding-left: 12px; }
/* The conversation sits at the bottom, just above the writing field, and grows upward (Janne, 22 October 2026: "when the mouse clicks
   onto the question, it should appear at the bottom edge, and they should go upwards. They shouldn't appear all the way at the top").
   The log takes the space above it with an auto top margin, so a short chat rests on the field and a long one still scrolls from
   the top; the drawer keeps scrolling to the newest message */
#v8 body .aid-body > .aid-log { margin-top: auto; }

/* Talk to a person, second pass (README 178): the system's buttons under the line, side by side, wrapping on a narrow drawer; the
   reply-time or hours line under them in ink-2 */
#v8 body .aid-person .aid-pbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#v8 body .aid-person .aid-pfoot { margin: 0; color: var(--v8-ink); }
/* The hand-over reply's line is a plain answer paragraph (README 178): focus lands on it, no ring for a programmatic focus */
#v8 body .aid-hp:focus { outline: none; }
