/* 🛂 ENVOY on /desk (Window H4b · feat(H4-envoy-desk)): the medallion, its 4-state Aura (opacity + transform only,
 * GPU-composited) and the Command Bay. Still under prefers-reduced-motion.
 * GSP-4b: the floating box is 70 × 76 — the 52 px ring (its disc is ::before) and *Ask ENVOY* under it, outside the
 * ring; every drawn edge stays inside the box (the breath's widest is 29.7 of the ring's 30); --sa-* hand envoy.js the
 * safe area, which it takes off the layout box it plans in. */
.envoy-medallion { --sa-r: env(safe-area-inset-right, 0px); --sa-b: env(safe-area-inset-bottom, 0px); --sa-l: env(safe-area-inset-left, 0px); position: fixed; left: 0; top: 0; z-index: 25; width: 70px; height: 76px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); cursor: pointer; transform: translate(-200px, -200px); transition: transform .42s var(--spring, cubic-bezier(0.22, 1, 0.36, 1)); will-change: transform; }
.envoy-medallion::before { content: ""; position: absolute; left: 9px; top: 2px; width: 50px; height: 50px; border-radius: 50%; border: 1px solid #2a3740; background: radial-gradient(circle at 50% 40%, #1d2a31, #0c1114 72%); box-shadow: 0 8px 26px rgba(0, 0, 0, .45); }
.envoy-medallion:focus-visible { outline: 2px solid #2dd4bf; outline-offset: 3px; border-radius: 14px; }
.envoy-face { position: absolute; left: 19px; top: 12px; width: 32px; height: 32px; }
.envoy-name { display: block; position: absolute; left: 0; right: 0; top: 56px; height: 18px; border: 1px solid #1f6f63; border-radius: 9px; background: #0c1114; font: 600 12px/16px var(--font); letter-spacing: 0; white-space: nowrap; text-align: center; color: #2dd4bf; }
.envoy-aura { position: absolute; left: 9px; top: 2px; width: 52px; height: 52px; overflow: visible; pointer-events: none; }
.aura-breath { fill: none; stroke: #2dd4bf; stroke-width: 2; opacity: .4; transform-box: fill-box; transform-origin: center; }
.aura-arc { fill: none; stroke: #2dd4bf; stroke-width: 2.5; stroke-linecap: round; opacity: 0; transform-box: view-box; transform-origin: 30px 30px; transition: opacity .3s ease; }
.envoy-medallion[data-state="idle"] .aura-breath { animation: aura-breath 7.5s ease-in-out infinite; }
.envoy-medallion[data-state="listening"] .aura-breath { opacity: .95; transform: scale(1.03); }
.envoy-medallion[data-state="thinking"] .aura-breath { opacity: .25; }
.envoy-medallion[data-state="thinking"] .aura-arc { opacity: .95; }
.envoy-medallion[data-state="thinking"] .aura-arc-a { animation: aura-spin 2.4s linear infinite; }
.envoy-medallion[data-state="thinking"] .aura-arc-b { animation: aura-spin 3.2s linear infinite reverse; }
.envoy-medallion[data-state="speaking"] .aura-breath { animation: aura-settle .6s ease-out 1 both; }
.envoy-medallion[data-state="boundary"] .aura-breath { stroke: #f59e0b; animation: aura-settle .6s ease-out 1 both; }
@keyframes aura-breath { 0%, 100% { transform: scale(.94); opacity: .3; } 50% { transform: scale(1.04); opacity: .72; } }
@keyframes aura-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes aura-settle { from { transform: scale(1.1); opacity: 1; } to { transform: scale(1); opacity: .6; } }
/* the edge tab: no clear slot on screen — a 44 px teal tab on the layout box's right edge, the medallion one tap away */
.envoy-medallion[data-dock="tab"] { width: 44px; border: 1px solid #2dd4bf; border-right: 0; border-radius: 12px 0 0 12px; background: #0f766e; }
.envoy-medallion[data-dock="tab"]::before, .envoy-medallion[data-dock="tab"] .envoy-face, .envoy-medallion[data-dock="tab"] .envoy-aura { display: none; }
.envoy-medallion[data-dock="tab"] .envoy-name { top: 0; bottom: 0; height: auto; border: 0; border-radius: 0; background: none; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); color: #eafffb; }
/* GSP-1a round 3 · a phone: the disc's declared slot in the header — in the flow, so it never sits on a control or a line
 * of the pane; GSP-4c: the tools row's last cell (desk-ux.css), the medallion at its 48 px — *Ask ENVOY* is its name and title */
.envoy-slot { display: none; }
@media (max-width: 640px) { .envoy-slot { display: block; flex: none; width: 48px; height: 48px; } }
.envoy-medallion[data-dock="inline"] { position: relative; width: 48px; height: 48px; transform: none; transition: none; }
.envoy-medallion[data-dock="inline"]::before { left: 1px; top: 1px; width: 46px; height: 46px; box-shadow: none; }
.envoy-medallion[data-dock="inline"] .envoy-aura { left: 0; top: 0px; width: 48px; height: 48px; }
.envoy-medallion[data-dock="inline"] .envoy-face { left: 12px; top: 12px; width: 24px; height: 24px; }
.envoy-medallion[data-dock="inline"] .envoy-name { display: none; top: 32px; height: 16px; } /* the shape is the medallion; the words ride its label */
body.sheet-open .envoy-medallion { opacity: 0; pointer-events: none; }
/* GSP-4a judge r2 #1: from 641 px until the page's own side margin can hold it (1280 px), the desk keeps a right lane the
 * floating disc's footprint wide (8 + 70 + the dodge's 6 = 84 since GSP-4b), so its bottom-right slot never sits on a switch or a key */
@media (min-width: 641px) and (max-width: 1279px) { body.desk:has(> .envoy-medallion) .hud { padding-right: 84px; } }
@media (prefers-reduced-motion: reduce) { .envoy-medallion { transition: none; } .aura-breath, .aura-arc { animation: none !important; transition: none; } }
@media print { .envoy-medallion { display: none; } }

/* the Command Bay */
.bay { display: grid; gap: 10px; }
.sync-rail { display: flex; flex-wrap: wrap; gap: 6px; }
.sync-node { font-size: 12px; border-radius: 999px; padding: 3px 10px; border: 1px solid #1f6f63; color: #a7f3d0; background: rgba(45, 212, 191, .08); }
.bay-meter { margin: 0; }
.bay-blotter { display: grid; gap: 10px; }
.bay-blotter:empty { display: none; }
.bay-thread { display: grid; gap: 8px; max-height: 46vh; overflow: auto; padding: 2px; }
.bay-inline .bay-thread { max-height: none; }
.bay-msg { border-radius: 14px; padding: 10px 12px; background: #0c1114; border: 1px solid var(--line); max-width: 92%; display: grid; gap: 6px; }
.bay-msg p { margin: 0; }
.bay-you { justify-self: end; background: rgba(45, 212, 191, .14); border-color: #1f6f63; }
.bay-rail { border-color: #a16207; background: #2a2108; }
.bay-unverified { border-style: dashed; }
.bay-cites { font-size: 12px; color: var(--ink-2); }
.bay-composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; position: sticky; bottom: 0; background: var(--card); padding-top: 6px; }
.bay-composer input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #0c1114; color: var(--ink); padding: 8px 12px; font-size: 16px; min-width: 0; }
.bay-seg button { min-height: 38px; }
/* the right drawer: the thread is the ONE scrolling region, the composer always under it (never over a reply) */
.sheet-right { display: flex; flex-direction: column; }
.sheet-right .sheet-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 12px; }
.sheet-right .bay { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet-right .bay-thread { flex: 1 1 auto; min-height: 120px; max-height: none; }
.sheet-right .bay-composer { position: static; }
.sheet-right .bay > :not(.bay-thread) { flex: none; }
