/* AI₄₅, the assistant (assets/assistant.js): launcher, panel (float / side / full), the ways-to-use gallery and the
   inline chat on ai.html. Colours are app.css tokens only, so every scheme and dark mode work. Open, close and size
   changes are Web Animations driven by assistant.js (one spring); CSS only holds the resting states.
   Stacking: Lock in dock 150 < launcher 160 < float/side panel 190 < bar 200 < site map 250 < full panel 260 < Lock in focus mode 400. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the AI glow: one turning gradient (ai45 orange → amber → lavender → sky) wherever the AI is ---------- */
@property --as-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root {
  /* g1 / g2 follow a non-orange theme's accent (app.css --ha-glow1/2); classic keeps orange → amber */
  --as-g1: var(--ha-glow1, #F08A4E); --as-g2: var(--ha-glow2, #FFC56B); --as-g3: #B79CE8; --as-g4: #7FB0E8;
  --as-spring: linear(0, 0.033, 0.115, 0.226, 0.349, 0.474, 0.592, 0.698, 0.789, 0.865, 0.925, 0.971, 1.004, 1.027, 1.041, 1.048, 1.049, 1.048, 1.044, 1.038, 1.032, 1.026, 1.02, 1.015, 1.01, 1.007, 1.004, 1.001, 1, 0.999, 0.998, 0.998, 0.998, 0.998, 0.998, 0.998, 0.998, 0.999, 0.999, 0.999, 1);
  --as-soft: cubic-bezier(0.32, 0.72, 0, 1);
}
@supports not (transition-timing-function: linear(0, 1)) { :root { --as-spring: cubic-bezier(0.32, 0.72, 0, 1); } }
@keyframes as-turn { to { --as-a: 360deg; } }
@keyframes as-breathe { 50% { opacity: 1; transform: scale(1.08); } }
.as-head__ic::after, .as-empty__ic::before, .as-empty__ic::after, .as-av.is-think::before, .as-av.is-think::after, .as-ring, .as-comp::before, .as-plus::before, .as-plusb {
  --as-a: 0deg; /* a still gradient where @property isn't supported */
  --as-grad: conic-gradient(from var(--as-a), var(--as-g1), var(--as-g2), var(--as-g3), var(--as-g4), var(--as-g1));
}

/* ---------- launcher: a glowing spark that opens into "Ask AI₄₅" on hover ---------- */
.as-launch { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 160; isolation: isolate;
  height: 56px; min-width: 56px; padding: 0 16px; border: 0; border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 0;
  cursor: pointer; color: #fff; background: transparent; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
  transition: transform .5s var(--as-spring), border-radius .4s var(--as-soft), gap .45s var(--as-spring); }
.as-launch .as-glow { position: absolute; inset: -8px; z-index: -2; border-radius: 26px; overflow: hidden; filter: blur(13px) saturate(1.3); opacity: .8; pointer-events: none; animation: as-breathe 3.2s ease-in-out infinite; transition: opacity .3s, border-radius .4s; }
/* The launcher sits on every page, so nothing in it may redraw the page: a large gradient square spins behind a clip (the graphics card does that alone). */
.as-launch .as-glow::before, .as-edge::before { content: ""; position: absolute; left: 50%; top: 50%; width: 480px; height: 480px; margin: -240px 0 0 -240px; background: conic-gradient(var(--as-g1), var(--as-g2), var(--as-g3), var(--as-g4), var(--as-g1)); animation: as-spin 6s linear infinite; }
@keyframes as-spin { to { rotate: 360deg; } }
.as-edge { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none; }
.as-launch::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; border: 1.5px solid transparent; background: var(--ink, #0E0E10) padding-box; }
.as-launch svg { width: 24px; height: 24px; flex: none; transition: opacity .2s, transform .45s var(--as-spring); }
.as-launch__on path:last-child { stroke: var(--as-g2); }
.as-launch__off { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.as-launch__lbl { display: inline-flex; align-items: center; gap: 8px; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; transition: max-width .5s var(--as-spring), opacity .25s; }
.as-launch__lbl sub, .as-brand sub, .as-more sub, .as-rail__h sub, .as-ideas__h sub, .as-plus__mark sub, .as-empty p sub { font-size: .62em; vertical-align: -0.28em; line-height: 0; font-weight: 800; }
.as-launch__lbl kbd { font: inherit; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .8); }
@media (hover: hover) and (pointer: fine) {
  .as-launch:not(.is-open):hover { gap: 10px; transform: translateY(-3px); }
  .as-launch:not(.is-open):hover .as-launch__lbl { max-width: 170px; opacity: 1; }
  .as-launch:hover .as-glow { opacity: 1; }
}
.as-launch:focus-visible { outline: 3px solid var(--orange); outline-offset: 5px; }
.as-launch.is-open { width: 56px; padding: 0; border-radius: 50%; }
.as-launch.is-open .as-glow { opacity: .3; border-radius: 50%; }
.as-launch.is-open .as-launch__on { opacity: 0; transform: rotate(90deg) scale(.6); }
.as-launch.is-open .as-launch__off { opacity: 1; transform: none; }
html.as-side-on .as-launch, html.as-full-on .as-launch { display: none; }
body.is-locked .as-launch, body.li-solo-on .as-launch, body.li-fx-on .as-launch,
body.is-locked .as:not(.as--page), body.li-solo-on .as:not(.as--page), body.li-fx-on .as:not(.as--page) { display: none; }

/* ---------- panel ---------- */
.as { color: var(--paper); font-family: inherit; }
.as:not(.as--page) { position: fixed; z-index: 190; display: flex; flex-direction: column; overflow: hidden; background: var(--card); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45), 0 0 0 1px var(--line); will-change: transform; }
.as[hidden] { display: none !important; }
.as[data-mode="float"] { right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(88px + env(safe-area-inset-bottom, 0px)); width: min(420px, calc(100vw - 40px)); height: min(660px, calc(100vh - 186px)); border-radius: 26px; transform-origin: 100% 100%; }
.as[data-mode="side"] { top: 76px; right: 0; bottom: 0; width: var(--as-w, min(48vw, 720px)); border-radius: 26px 0 0 0; }
html.as-side-on { --as-w: min(48vw, 720px); }
@media (min-width: 1100px) {
  html.as-side-on body { margin-right: var(--as-w); transition: margin-right .6s var(--as-spring); }
  html:not(.as-side-on) body { transition: margin-right .45s var(--as-soft); }
  html.as-side-on .ld { left: calc((100vw - var(--as-w)) / 2); }
}
.as[data-mode="full"] { inset: 0; z-index: 260; border-radius: 0; box-shadow: none; }
html.as-full-on { overflow: hidden; }
.as[data-mode="full"] .as-head { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }

/* a gradient edge round the panel (and the inline chat): faint at rest, bright and fast while it thinks, plus a halo */
.as--page { position: relative; }
.as-ring { position: absolute; inset: 0; z-index: 5; border-radius: inherit; padding: 1.5px; background: var(--as-grad); pointer-events: none; opacity: .4;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: as-turn 7s steps(105) infinite; transition: opacity .4s; }
.as.is-plus .as-ring { opacity: .7; }
.as.is-thinking .as-ring { opacity: 1; animation-duration: 2.2s; }
.as:not(.as--page).is-thinking, .as--page.is-thinking { animation: as-halo 2.4s ease-in-out infinite; }
@keyframes as-halo {
  0%, 100% { box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45), 0 0 0 1px var(--line), 0 0 46px -12px color-mix(in srgb, var(--as-g1) 55%, transparent); }
  50% { box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45), 0 0 0 1px var(--line), 0 0 56px -10px rgba(183, 156, 232, .6); }
}

/* header */
.as-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 12px 11px 14px; border-bottom: 1px solid var(--line); }
.as-head__ic, .as-av, .as-empty__ic { flex: none; display: grid; place-items: center; color: #fff; background: var(--ink, #0E0E10); }
.as-head__ic { position: relative; isolation: isolate; width: 34px; height: 34px; border-radius: 12px; background: transparent; }
.as-head__ic::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; border: 1.5px solid transparent; background: linear-gradient(var(--ink, #0E0E10), var(--ink, #0E0E10)) padding-box, var(--as-grad) border-box; animation: as-turn 6s steps(90) infinite; }
.as.is-thinking .as-head__ic::after { animation-duration: 1.6s; }
.as-head__ic svg, .as-av svg { width: 18px; height: 18px; }
.as-head__ic svg path:last-child, .as-av svg path:last-child, .as-empty__ic svg path:last-child { stroke: var(--as-g2); }
.as-head__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.as-brand { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.as-plusb { display: inline-block; margin-left: 2px; padding: 0 5px; border-radius: 6px; font-size: .78em; font-weight: 900; line-height: 1.35; color: #fff; background: var(--as-grad); animation: as-turn 6s steps(90) infinite; vertical-align: .08em; }
.as-head__t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-head__acts { display: flex; align-items: center; gap: 2px; }
.as-modes { position: relative; display: flex; gap: 0; padding: 3px; margin: 0 4px; border-radius: 12px; background: var(--navy); }
.as-modes__pill { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); transition: transform .5s var(--as-spring), width .5s var(--as-spring); }
.as-modes button { position: relative; z-index: 1; width: 30px; height: 28px; border: 0; border-radius: 9px; display: grid; place-items: center; background: none; color: var(--muted); cursor: pointer; transition: color .2s; }
.as-modes button[aria-pressed="true"] { color: var(--paper); }
.as-ib { width: 32px; height: 32px; border: 0; border-radius: 10px; display: grid; place-items: center; background: none; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.as-modes button svg, .as-ib svg { width: 16px; height: 16px; }
.as-modes button:hover, .as-ib:hover { color: var(--paper); }
.as-ib:hover { background: var(--navy); }
.as-ib--ideas[aria-pressed="true"] { color: var(--paper); background: var(--navy); }
.as-modes button:focus-visible, .as-ib:focus-visible, .as-q:focus-visible, .as-route:focus-visible, .as-send:focus-visible, .as-more:focus-visible, .as-plus__item:focus-visible, .as-choice:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* body: rail (full screen only) + main */
.as-wrap { flex: 1; min-height: 0; display: flex; }
.as-rail { display: none; }
.as-main { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.as[data-mode="full"] .as-rail { display: block; flex: none; width: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 24px; border-right: 1px solid var(--line); background: var(--navy); }
.as[data-mode="full"] .as-thread, .as[data-mode="full"] .as-comp, .as[data-mode="full"] .as-ideas > * { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; }
.as[data-mode="full"] .as-ib--ideas { display: none; }
.as-rail__h { margin: 2px 4px 12px; font-size: 13px; font-weight: 800; color: var(--muted); }
.as-rail .as-gallery { grid-template-columns: 1fr; }

/* ---------- thread ---------- */
.as-thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.as-msg { display: flex; gap: 10px; align-items: flex-start; }
.as-msg--me { justify-content: flex-end; }
.as-bub { max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--ink, #0E0E10); color: #fff; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.as-av { position: relative; isolation: isolate; width: 28px; height: 28px; border-radius: 10px; margin-top: 1px; }
.as-av svg { width: 15px; height: 15px; }
.as-body { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.55; }
.as-body p { margin: 0 0 6px; }
.as-body p:last-child { margin-bottom: 0; }
.as-body ul { margin: 4px 0 6px; padding-left: 18px; }
.as-body li + li { margin-top: 4px; }
.as-body b { font-weight: 700; }
.as-body code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .9em; padding: 1px 5px; border-radius: 6px; background: var(--navy); }
.as-msg.is-err .as-body { color: #C2364F; }

/* new messages rise in; replies appear word by word; cards follow one by one; the best match gets a sheen */
@keyframes as-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes as-word { from { opacity: 0; filter: blur(4px); transform: translateY(3px); } }
.as-msg.is-new { animation: as-in .55s var(--as-spring) both; }
.as-msg--me.is-new { transform-origin: 100% 100%; }
.as-w { display: inline-block; animation: as-word .45s var(--as-soft) both; animation-delay: calc(var(--w, 0) * 22ms); }
.as-msg.is-new .as-route { animation: as-in .55s var(--as-spring) both; animation-delay: calc(var(--after, 0) * 22ms + 120ms + var(--i, 0) * 80ms); }
.as-msg.is-new .as-routes { --after: inherit; }
@keyframes as-sweep { from { transform: translateX(-110%); } to { transform: translateX(110%); } }
.as-msg.is-new .as-route.is-top::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%); transform: translateX(-110%); animation: as-sweep .9s .7s cubic-bezier(.4, 0, .2, 1) both; }
html[data-theme="dark"] .as-msg.is-new .as-route.is-top::after { background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%); }

/* thinking */
.as-av.is-think { background: transparent; }
.as-av.is-think::before { content: ""; position: absolute; inset: -6px; z-index: -2; border-radius: 14px; background: var(--as-grad); filter: blur(8px); opacity: .85; animation: as-turn 1.6s linear infinite, as-breathe 1.6s ease-in-out infinite; }
.as-av.is-think::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; border: 1.5px solid transparent; background: linear-gradient(var(--ink, #0E0E10), var(--ink, #0E0E10)) padding-box, var(--as-grad) border-box; animation: as-turn 1.6s linear infinite; }
.as-av.is-think svg { animation: as-spark 1.6s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes as-spark { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(.82); } 100% { transform: rotate(180deg) scale(1); } }
.as-think .as-body { padding-top: 3px; }
.as-shimmer { display: inline-block; font-weight: 700; letter-spacing: -0.01em; color: transparent; background: linear-gradient(100deg, var(--muted) 20%, var(--paper) 38%, var(--as-g1) 48%, var(--as-g3) 56%, var(--paper) 64%, var(--muted) 80%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; animation: as-shimmer 1.8s linear infinite; }
@keyframes as-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.as-phase { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.as-phase.is-swap { animation: as-in .4s var(--as-spring) both; }

/* a question with boxes to click, like multiple choice */
.as-choices { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.as-choice { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 14px; background: var(--navy); color: var(--paper); font: inherit; text-align: left; cursor: pointer; transition: background .2s ease, transform .2s var(--as-spring); }
.as-choice:hover { background: var(--navy-2, var(--line)); transform: translateX(3px); }
.as-choice__l { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--mint); color: var(--paper); }
.as-choice__t { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.as-choice__t b { font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.as-choice__t small { font-size: 12px; color: var(--muted); }

/* destination cards */
.as-routes { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.as-route { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 9px 44px 9px 12px; border-radius: 14px; background: var(--navy); color: var(--paper); text-decoration: none; transition: background-color .15s, transform .35s var(--as-spring); }
.as-route:hover { background: var(--navy-2, var(--line)); transform: translateX(3px); }
.as-route b { font-size: 14px; font-weight: 700; line-height: 1.3; }
.as-route__k { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.as-route__s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-route__go { position: absolute; right: 10px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); transition: transform .35s var(--as-spring); }
.as-route:hover .as-route__go { transform: translateX(2px); }
.as-route__go svg { width: 14px; height: 14px; }
.as-route.is-top { background: var(--mint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 6%, transparent); }
html[data-theme="dark"] .as-route.is-top { box-shadow: inset 3px 0 0 var(--e-mint, #6FCF97); }
.as-route.is-top .as-route__go { background: var(--ink, #0E0E10); color: #fff; }
.as-route.is-plus { background: #0E0E10; color: #fff; }
.as-route.is-plus .as-route__k, .as-route.is-plus .as-route__s { color: rgba(255, 255, 255, .6); }
.as-route.is-plus .as-route__go { background: linear-gradient(120deg, var(--as-g1), var(--as-g3)); color: #fff; }
.as-route--alt { padding-top: 7px; padding-bottom: 7px; }
.as-route--alt b { font-size: 13px; font-weight: 600; }

/* ---------- empty state + the ways to use it ---------- */
.as-empty { margin: auto 0; padding: 10px 2px 4px; text-align: center; }
.as-empty.is-roomy { margin: 0; padding-top: 18px; }
.as-empty__ic { position: relative; isolation: isolate; width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 16px; background: transparent; }
.as-empty__ic::before { content: ""; position: absolute; inset: -8px; z-index: -2; border-radius: 22px; background: var(--as-grad); filter: blur(12px); opacity: .55; animation: as-turn 6s steps(90) infinite, as-breathe 3.2s ease-in-out infinite; }
.as-empty__ic::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; border: 1.5px solid transparent; background: linear-gradient(var(--ink, #0E0E10), var(--ink, #0E0E10)) padding-box, var(--as-grad) border-box; animation: as-turn 6s steps(90) infinite; }
.as-empty__ic svg { width: 22px; height: 22px; }
.as-empty h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.as-empty > p { margin: 6px auto 0; max-width: 36ch; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.as-here { margin-top: 16px; }
.as-here > span { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.as-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.as-chips--start { margin-top: 14px; }
.as-q { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 10px 6px 12px; border: 0; border-radius: 12px; background: var(--navy); color: var(--paper); font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer; transition: background-color .15s, color .15s, transform .35s var(--as-spring); }
.as-q svg { width: 13px; height: 13px; flex: none; opacity: 0; margin-left: -4px; transition: opacity .2s, transform .35s var(--as-spring), margin .35s var(--as-spring); }
.as-q:hover { background: var(--ink, #0E0E10); color: #fff; transform: translateY(-1px); }
.as-q:hover svg { opacity: 1; margin-left: 0; transform: translateX(1px); }
.as-more { margin-top: 14px; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 0; border-radius: 12px; background: none; color: var(--paper); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .15s; }
.as-more:hover { background: var(--navy); }
.as-more svg { width: 15px; height: 15px; }

.as-gallery { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; text-align: left; }
.as-way { padding: 12px 12px 10px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); animation: as-in .55s var(--as-spring) both; animation-delay: calc(var(--i, 0) * 55ms + 60ms); }
.as-rail .as-way, .as-ideas .as-way { background: var(--card); }
.as-way__h { display: flex; align-items: center; gap: 8px; }
.as-way__h b { flex: 1; min-width: 0; font-size: 14px; letter-spacing: -0.01em; }
.as-way__ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--navy); color: var(--paper); }
.as-way--mint .as-way__ic { background: var(--mint); } .as-way--sky .as-way__ic { background: var(--sky); } .as-way--sun .as-way__ic { background: var(--sun); } .as-way--lav .as-way__ic { background: var(--lav); } .as-way--rose .as-way__ic { background: var(--rose); }
html[data-theme="dark"] .as-way--mint .as-way__ic { color: var(--e-mint); } html[data-theme="dark"] .as-way--sky .as-way__ic { color: var(--e-sky); } html[data-theme="dark"] .as-way--sun .as-way__ic { color: var(--e-sun); } html[data-theme="dark"] .as-way--lav .as-way__ic { color: var(--e-lav); } html[data-theme="dark"] .as-way--rose .as-way__ic { color: var(--e-rose); }
.as-way__ic svg { width: 15px; height: 15px; }
.as-pill { flex: none; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--navy); color: var(--muted); }
.as-pill.is-live { background: color-mix(in srgb, #2E8B57 16%, transparent); color: #1E7A4C; }
html[data-theme="dark"] .as-pill.is-live { color: #8BE3AE; }
.as-way p { margin: 6px 0 8px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.as-way__qs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.as-way__qs .as-q { width: 100%; justify-content: space-between; background: var(--navy); }

/* AI₄₅+ (Full plan): the deep-work tools, dark with the glow */
.as-plus { position: relative; isolation: isolate; grid-column: 1 / -1; margin-top: 4px; padding: 14px; border-radius: 20px; background: #0E0E10; color: #fff; animation: as-in .6s var(--as-spring) both; animation-delay: calc(var(--i, 0) * 55ms + 80ms); overflow: hidden; }
.as-plus::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: 1.5px; background: var(--as-grad); pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: as-turn 6s steps(90) infinite; }
.as-plus::after { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 90%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--as-g1) 28%, transparent), transparent); pointer-events: none; }
.as-plus__h { display: flex; align-items: center; gap: 10px; }
.as-plus__h > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.as-plus__h b { font-size: 14.5px; } .as-plus__h span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.as-plus__mark { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.as-plus__go { flex: none; padding: 6px 11px; border-radius: 10px; background: #fff; color: #0E0E10; font-size: 12.5px; font-weight: 800; text-decoration: none; transition: transform .35s var(--as-spring); }
.as-plus__go:hover { transform: translateY(-1px); }
.as-plus__grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.as-rail .as-plus__grid { grid-template-columns: 1fr; }
.as-plus__item { display: flex; flex-direction: column; gap: 3px; padding: 10px 11px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .06); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: background-color .2s, transform .35s var(--as-spring); animation: as-in .5s var(--as-spring) both; animation-delay: calc(var(--k, 0) * 35ms + 200ms); }
.as-plus__item:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }
.as-plus__item b { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.as-plus__item b svg { width: 13px; height: 13px; color: rgba(255, 255, 255, .5); }
.as-plus__item span { font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, .6); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* the ideas sheet over the thread */
.as-ideas { position: absolute; inset: 0 0 64px 0; z-index: 4; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 18px; background: var(--card); }
.as-ideas[hidden] { display: none; }
.as-ideas__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.as-ideas__h b { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.as-ideas .as-gallery { margin-top: 12px; }
.as[data-mode="float"] .as-gallery, .as[data-mode="float"] .as-plus__grid { grid-template-columns: 1fr; }

/* composer */
.as-comp { position: relative; flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 8px 12px 12px; padding: 6px 6px 6px 14px; border-radius: 18px; background: var(--navy); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s; }
.as-comp::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--as-grad); pointer-events: none; opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: as-turn 4s steps(60) infinite paused; transition: opacity .25s; }
.as-comp:focus-within::before, .as.is-thinking .as-comp::before { opacity: 1; animation-play-state: running; }
.as-comp:focus-within { box-shadow: inset 0 0 0 1px transparent, 0 0 26px -8px color-mix(in srgb, var(--as-g1) 50%, transparent); }
.as-comp textarea { flex: 1; min-width: 0; min-height: 22px; max-height: 180px; margin: 7px 0; padding: 0; border: 0; resize: none; background: none; color: var(--paper); font: inherit; font-size: 14.5px; line-height: 1.45; outline: 0; }
.as-comp textarea::placeholder { color: var(--muted); }
.as-send { flex: none; width: 36px; height: 36px; border: 0; border-radius: 12px; display: grid; place-items: center; cursor: pointer; background: var(--ink, #0E0E10); color: #fff; transition: transform .35s var(--as-spring); }
.as-send:hover { transform: scale(1.06); }
.as-send:active { transform: scale(.94); }
.as-send svg { width: 16px; height: 16px; }

/* ---------- inline on ai.html ---------- */
.as--page { display: flex; flex-direction: column; height: min(680px, calc(100vh - 200px)); min-height: 460px; border-radius: 26px; background: var(--card); box-shadow: 0 1px 0 var(--line); overflow: hidden; }
.as--page .as-main { flex: 1; }

/* ---------- phones: float and side become a sheet; the launcher clears the Lock in dock ---------- */
@media (max-width: 640px) {
  .as-launch { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); height: 52px; min-width: 52px; padding: 0 14px; border-radius: 18px; }
  .as-launch.is-open { width: 52px; }
  .as[data-mode="float"], .as[data-mode="side"] { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: calc(100% - 64px - env(safe-area-inset-top, 0px)); border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .as-modes button[data-mode="side"] { display: none; }
  .as-gallery, .as-plus__grid { grid-template-columns: 1fr !important; }
  .as--page { height: calc(100vh - 190px); border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .as, .as-launch, .as-launch *, .as-route, .as-choice, .as-q, .as-modes__pill, html.as-side-on body, html body { transition: none !important; }
  .as *, .as::before, .as::after, .as *::before, .as *::after, .as-launch .as-glow, .as-launch .as-glow::before, .as-edge::before, .as.is-thinking { animation: none !important; }
  .as-shimmer { color: var(--paper); background: none; }
}
@media print { .as-launch, .as:not(.as--page) { display: none !important; } }
