/*
 * Round 8, Ask Kyte as a chat (17 Oct 2026). Hand-written, linked just before r8.css (which
 * web/scripts/lift-r8-css.mjs generates from the approved mockup and must not be
 * edited). The live chat meets a few things the mockup's invented answers never
 * had: the API's [n] citation markers, a reading kept from view (a paper the
 * viewer cannot open), a call offered from an answer, an answer that did not
 * arrive. Each rule is written in the mockup's own tokens and scoped exactly as
 * r8.css is (the Ask surface .r8.ak, its layer .r8.ak-ov, the Cmd-K panel
 * #askwrap .r8.kq), so no other screen can see it. Light only.
 */

/* A citation marker in an answer: the chip's number, quiet, beside the claim it backs. */
:is(#page,body) .r8:where(.ak,.kq) sup.mk{font-size:11px;line-height:0;font-weight:500;color:var(--t3);margin-left:2px;vertical-align:super;font-variant-numeric:tabular-nums}

/* The source chip carries the same number. */
:is(#page,body) .r8:where(.ak,.kq) .pchip .n{flex:none;font-weight:500;font-size:12px;color:var(--t3);font-variant-numeric:tabular-nums}
:is(#page,body) .r8:where(.ak,.kq) .pchip.plain{cursor:default}
:is(#page,body) .r8:where(.ak,.kq) .pchip.plain:hover{background:#fff;color:var(--t2)}

/* Readings from papers this viewer cannot open: counted, never named. */
:is(#page,body) .r8:where(.ak,.kq) .rd-ch.rd-hid{padding:12px 0 0}

/* A call offered from an answer (the tap is the confirmation, as today). */
:is(#page,body) .r8:where(.ak,.kq) .a-call{margin-top:12px}
:is(#page,body) .r8:where(.ak,.kq) .a-call:empty{display:none}
:is(#page,body) .r8:where(.ak,.kq) .a-call .a-p{font-size:13px;line-height:18px;color:var(--t2)}

/* An answer that did not arrive: said as such, never mistakable for one. */
:is(#page,body) .r8:where(.ak,.kq) .a-err b{font-weight:600;color:var(--neg)}

/* The Talk control where the browser cannot stream the microphone. */
:is(#page,body) .r8.ak .tk-ctl:disabled{opacity:.45;cursor:default}

/* Edit on a proposal is the instruction, as words: the box takes the row's width. */
:is(#page,body) .r8:where(.ak,.kq) .pp-rows input.pp-edit{max-width:none}

/* ---- Files attached in Ask (2 Nov 2026, v99; askfiles.js). The chip is the mockup's own .atc, which r8.css already
   carries for exactly this (its composer's .cmp-att row and a bubble's .matt); these rules add only what a live file
   needs: a thumbnail, the quiet uploading state, a chip that opens in a bubble or under an answer, and the drop state. */
:is(#page,body) .r8.ak .atc{max-width:260px}
:is(#page,body) .r8.ak .atc.sent{padding-right:8px;cursor:pointer}
:is(#page,body) .r8.ak .atc.sent:hover{background:var(--hov)}
:is(#page,body) .r8.ak .atc .fth{width:20px;height:20px;border-radius:4px;object-fit:cover;flex:none;margin-left:-4px}
:is(#page,body) .r8.ak .atc .fth-none{width:20px;height:20px;border-radius:4px;flex:none;background:var(--line);margin-left:-4px}
:is(#page,body) .r8.ak .atc.up{color:var(--t2);animation:r8-blink 1.2s ease-in-out infinite}
:is(#page,body) .r8.ak .m-me:has(.matt:only-child){padding:8px}
:is(#page,body) .r8.ak .m-me .matt:last-child{margin-bottom:0}
:is(#page,body) .r8.ak.dropping{position:relative}
:is(#page,body) .r8.ak.dropping::after{content:'Drop files to attach them';position:absolute;inset:12px;z-index:30;display:grid;place-items:center;border-radius:16px;background:rgba(255,255,255,.88);box-shadow:inset 0 0 0 1.5px var(--navy);color:var(--ink);font-size:14px;line-height:20px;font-weight:500;pointer-events:none}
@media (prefers-reduced-motion:reduce){:is(#page,body) .r8.ak .atc.up{animation:none;opacity:.6}}

/* 9 Nov 2026 (the last walk): Ask's panel over a page says Close on a touch screen, which has no Escape key, 40px tall, as
   the sheets' and the search box's close do (hub-d.css .askhead .esc, r14-quicksearch.css). More specific than r8.css. */
@media (pointer:coarse){
  body #askwrap .r8.kq .kq-esc{font-size:0;height:auto;min-height:40px;min-width:56px;display:inline-flex;align-items:center;justify-content:center}
  body #askwrap .r8.kq .kq-esc::after{content:"Close";font-size:12px}
}
