
/* ================= tokens: the design basics, written once ================= */
:root {
  /* type: SF on Apple, Inter elsewhere; one scale */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --fs-caption: 11px; --fs-footnote: 12px; --fs-subhead: 13px; --fs-body: 15px; --fs-title: 17px;
  /* text in three strengths; lines; fills */
  --label: rgb(22 26 40); --label-2: rgb(22 26 40 / .62); --label-3: rgb(22 26 40 / .42);
  --sep: rgb(22 26 40 / .08); --fill: rgb(22 26 40 / .05); --fill-2: rgb(22 26 40 / .09);
  /* surfaces: the page, solid things (bubbles, buttons), fields on glass, glass itself */
  --bg: #f3f4f8; --surface: #fff; --surface-hover: #f6f7fa; --field: rgb(255 255 255 / .8); --card: rgb(255 255 255 / .78);
  --glass-bg: rgb(255 255 255 / .56); --glass-edge: rgb(255 255 255 / .75); --ring: #fff;
  --warn: #9a5b00; --ok: #1f8a4c; --flash: #fff3c4; --blob: .75;
  color-scheme: light;
  /* colour, used sparingly */
  --accent: #2f6bff; --agent: #7c4ddb; --attention: #f5a524; --danger: #e5484d; --online: #30c46c;
  /* spacing: a 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  /* corners: inner = outer − padding */
  --r-panel: 28px; --r-card: 18px; --r-bubble: 18px; --r-tail: 6px;
  /* depth */
  --e1: 0 1px 2px rgb(20 30 60 / .05), 0 2px 8px rgb(20 30 60 / .05);
  --e2: inset 0 1px 0 rgb(255 255 255 / .7), 0 8px 28px rgb(20 30 60 / .10);
  --e3: 0 12px 36px rgb(20 30 60 / .18);
  /* motion */
  --fast: 150ms; --med: 260ms; --slow: 560ms;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.22, .64, 1);
  /* layout: the panels' widths; the chat sits between them */
  --edge: 20px; --left-open: 300px; --left-shut: 62px; --right-open: 300px; --right-shut: 70px;
  --lw: calc(var(--edge) * 2 + var(--left-open)); --rw: calc(var(--edge) * 2 + var(--right-open));
}

/* ================= base ================= */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 400 var(--fs-body)/1.47 var(--font); letter-spacing: -.01em; color: var(--label); background: var(--bg); overflow: hidden; isolation: isolate;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
button { font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--label-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--med) var(--spring); }
.icon-btn:hover { background: var(--fill); color: var(--label); }
.icon-btn:active { transform: scale(.92); }

/* background: the first page's blobs, calmer */
.blob { position: fixed; z-index: -1; border-radius: 50%; pointer-events: none; opacity: var(--blob); }
.b1 { width: 80vmax; height: 66vmax; left: -26vmax; top: -26vmax; background: radial-gradient(closest-side, rgb(47 107 255 / .40), transparent); animation: a 44s ease-in-out infinite alternate; }
.b2 { width: 70vmax; height: 60vmax; right: -24vmax; top: -10vmax; background: radial-gradient(closest-side, rgb(124 77 219 / .32), transparent); animation: b 50s ease-in-out infinite alternate; }
.b3 { width: 90vmax; height: 60vmax; left: 10vmax; bottom: -40vmax; background: radial-gradient(closest-side, rgb(224 164 106 / .30), transparent); animation: c 40s ease-in-out infinite alternate; }
@keyframes a { to { transform: translate(10vmax, 8vmax) scale(1.08); } }
@keyframes b { to { transform: translate(-8vmax, 10vmax) scale(.92); } }
@keyframes c { to { transform: translate(-10vmax, -6vmax) scale(1.06); } }
.glass { background: var(--glass-bg); border: 1px solid var(--glass-edge); box-shadow: var(--e2);
  backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%); }

/* avatars */
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  font-weight: 600; font-size: var(--fs-subhead); letter-spacing: 0; color: #fff; border: 2px solid var(--ring); box-shadow: 0 2px 8px rgb(20 30 60 / .12); }
.av.you { background: linear-gradient(140deg, #5b8cff, #6d5cf6); }
.av.k { background: linear-gradient(140deg, #f0a35e, #e0688a); }
.av.n { background: linear-gradient(140deg, #2bc48a, #16a37f); }
.av.bot { background: #fff; }
.av.bot.codex { color: #0d0d0d; } /* the OpenAI mark is drawn in currentColor */
.av.bot svg { width: 56%; height: 56%; }
.av .owner { position: absolute; left: -5px; bottom: -4px; width: 48%; height: 48%; min-width: 16px; min-height: 16px; border-radius: 50%; font-size: 9px; font-weight: 700; display: grid; place-items: center;
  color: #fff; background: linear-gradient(140deg, #5b8cff, #6d5cf6); border: 1.5px solid var(--ring); box-shadow: 0 2px 6px rgb(20 30 60 / .18);
  transition: transform var(--med) var(--spring); }
.av.bot { transition: transform var(--med) var(--spring); }
.chat .av.bot:has(.owner):hover { transform: translateX(6px); }
.chat .av.bot:hover .owner { transform: translate(-130%, -55%) scale(1.7); }
.av .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--online); border: 2px solid var(--ring); }

/* ================= header: one capsule over the chat ================= */
.head { position: fixed; top: 16px; left: var(--lw); right: var(--rw); margin-inline: auto; width: max-content; z-index: 5; height: 52px; padding: 0 var(--s2) 0 var(--s4);
  border-radius: 999px; display: flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.head .mark { width: 26px; height: 21px; margin-right: var(--s1); }
.head .room { display: flex; align-items: center; gap: 6px; font-size: var(--fs-title); font-weight: 600; letter-spacing: -.02em; }
.head .room .ico { color: var(--label-3); width: 16px; }
.head .sep { width: 1px; height: 22px; background: var(--sep); margin: 0 var(--s1); }
.stack { display: flex; padding: 0 var(--s1); }
.stack .av { width: 28px; height: 28px; font-size: var(--fs-caption); margin-left: -8px; }
.stack .av:first-child { margin-left: 0; }

/* ================= panels: the rail and your agent stretch open into them ================= */
.panel { position: fixed; z-index: 6; overflow: hidden; border-radius: var(--r-panel);
  transition: top var(--slow) var(--spring), height var(--slow) var(--spring), width var(--slow) var(--spring), border-radius var(--slow) var(--spring); }
.fade { transition: opacity var(--med) var(--ease) 80ms, transform var(--slow) var(--spring); }
/* left: people and agents */
#people { left: var(--edge); top: 84px; height: calc(100% - 176px); width: var(--left-open); }
body.left-shut #people { top: calc(50% - 94px); height: 188px; width: var(--left-shut); border-radius: 31px; cursor: pointer; }
.ptop { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 var(--s2) 0 var(--s5); }
.ptitle { font-size: var(--fs-caption); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--label-3); }
.plist { display: flex; flex-direction: column; gap: var(--s3); padding: 0 9px; }
.prow { display: flex; align-items: center; gap: var(--s3); height: 42px; border-radius: 21px; white-space: nowrap; }
.prow .av { width: 42px; height: 42px; }
.plabel { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.plabel b { font-weight: 500; }
.plabel small { font-size: var(--fs-footnote); color: var(--label-2); }
.psec { height: 24px; display: flex; align-items: flex-end; padding-left: 11px; }
body.left-shut #people .ptop { height: 9px; }
body.left-shut #people .ptop > *, body.left-shut #people .plabel, body.left-shut #people .psec { opacity: 0; transform: translateX(-8px); pointer-events: none; }
body.left-shut #people .psec { height: 0; }
#people .ptop, #people .psec { transition: height var(--slow) var(--spring); }
/* right: your agent */
#agent { right: var(--edge); top: 84px; height: calc(100% - 176px); width: var(--right-open); display: flex; flex-direction: column; }
body.right-shut #agent { top: calc(50% - 35px); height: 70px; width: var(--right-shut); border-radius: 35px; cursor: pointer; }
.atop { display: flex; align-items: flex-start; gap: var(--s3); padding: 9px 9px 0; }
.atop > .av { width: 52px; height: 52px; }
.alabel { flex: 1; min-width: 0; padding-top: 5px; white-space: nowrap; }
.alabel b { display: block; font-size: var(--fs-body); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.state { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: var(--fs-footnote); color: var(--warn); }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--attention); }
.state.idle { color: var(--label-2); }
.state.idle::before { background: var(--online); }
.badge { position: absolute; top: 3px; right: 3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--attention); color: #fff; font-size: var(--fs-caption); font-weight: 700; border: 2px solid var(--ring); opacity: 0; transform: scale(.6); transition: opacity var(--med), transform var(--med) var(--spring); }
body.right-shut #agent .badge { opacity: 1; transform: none; }
.abody { flex: 1; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s3) var(--s3); min-height: 0; overflow-y: auto; scrollbar-width: none; }
body.right-shut #agent .alabel, body.right-shut #agent .atop .icon-btn, body.right-shut #agent .abody { opacity: 0; transform: translateX(8px); pointer-events: none; }
body.right-shut #agent.waiting { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: var(--e2), 0 0 0 0 rgb(245 165 36 / .35); } 50% { box-shadow: var(--e2), 0 0 0 10px rgb(245 165 36 / 0); } }
.sec { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) var(--s1) 0; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: var(--fs-caption); font-weight: 700; color: #fff; background: var(--attention); }
.sec .hint { margin-left: auto; font-size: var(--fs-caption); color: var(--label-3); }
.queue { display: flex; flex-direction: column; gap: var(--s2); }
.gcard { background: var(--card); border-radius: var(--r-card); padding: var(--s3); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--e1);
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease), max-height var(--slow) var(--ease), padding var(--slow) var(--ease), margin var(--slow) var(--ease); }
.gcard.gone { opacity: 0; transform: translateX(24px) scale(.97); max-height: 0; padding-block: 0; margin-top: calc(var(--s2) * -1); }
.ghead { display: flex; align-items: center; gap: 10px; }
.ghead .av { width: 30px; height: 30px; font-size: var(--fs-footnote); }
.gwho { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.gwho b { font-size: var(--fs-subhead); font-weight: 600; }
.gwho small { font-size: var(--fs-caption); color: var(--label-3); }
.gkind { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: var(--fs-caption); font-weight: 600; color: var(--warn); background: rgb(245 165 36 / .14); }
.gkind .ico { width: 12px; height: 12px; }
.gkind.out { color: var(--agent); background: rgb(124 77 219 / .1); }
.gtext { margin: 0; font-size: var(--fs-body); line-height: 1.45; }
.draft { padding: 8px 12px; border-radius: 14px 14px 14px 6px; background: color-mix(in srgb, var(--agent) 8%, var(--surface)); border: 1px solid rgb(124 77 219 / .12); font-size: var(--fs-body); }
.draft[contenteditable="true"] { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); }
.gacts { display: grid; gap: 6px; }
.gacts.two { grid-template-columns: 1fr 1fr; }
.gacts.three { grid-template-columns: auto 1fr 1fr; }
.gacts .cap { width: 100%; }
.cap { height: 34px; padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--sep); background: var(--surface); font-size: var(--fs-subhead); font-weight: 500; white-space: nowrap; color: var(--label);
  transition: background var(--fast), transform var(--med) var(--spring), box-shadow var(--fast); }
.cap:hover { background: var(--surface-hover); }
.cap:active { transform: scale(.95); }
.cap.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgb(47 107 255 / .28); }
.cap.primary:hover { background: #2560f0; }
.count[hidden], .badge[hidden] { display: none; }
.cap.ghost { border-color: transparent; background: transparent; color: var(--label-2); }
.cap.ghost:hover { background: var(--fill); }
.empty { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: var(--s4) 0; font-size: var(--fs-subhead); color: var(--label-3); }
.empty[hidden] { display: none; }
.empty .ico { width: 16px; height: 16px; color: var(--online); }
.log { list-style: none; margin: 0; padding: 0 var(--s1); display: flex; flex-direction: column; }
.log li { display: flex; align-items: center; gap: var(--s2); padding: 6px 0; font-size: var(--fs-footnote); color: var(--label-2); border-bottom: 1px solid var(--sep); }
.log li:last-child { border-bottom: 0; }
.log li.new { animation: enter var(--med) var(--spring) both; }
.log time { margin-left: auto; font-size: var(--fs-caption); color: var(--label-3); font-variant-numeric: tabular-nums; }
.lic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--label-2); }
.lic .ico { width: 12px; height: 12px; }
.lic.ok { background: rgb(48 196 108 / .14); color: var(--ok); }
.lic.no { background: rgb(229 72 77 / .1); color: var(--danger); }
.thread { display: flex; flex-direction: column; gap: 6px; padding: 0 var(--s1); }
.tb { align-self: flex-start; max-width: 88%; padding: 6px 10px; border-radius: 14px 14px 14px 5px; font-size: var(--fs-subhead); line-height: 1.4; background: color-mix(in srgb, var(--agent) 8%, var(--surface)); }
.tb.me { align-self: flex-end; border-radius: 14px 14px 5px 14px; background: var(--accent); color: #fff; }
.tb.new { animation: enter var(--med) var(--spring) both; }
.tinput { margin-top: auto; position: sticky; bottom: 0; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 5px 0 var(--s4); border-radius: 22px;
  background: var(--field); box-shadow: var(--e1); }
.tinput input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: var(--fs-subhead); color: var(--label); }
.tinput input::placeholder { color: var(--label-3); }
.tsend { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; transition: transform var(--med) var(--spring); }
.tsend:active { transform: scale(.9); }
.tsend .ico { width: 16px; height: 16px; }

/* ================= the chat: between the panels, straight on the background ================= */
.chat { position: fixed; top: 0; bottom: 0; left: var(--lw); right: var(--rw); overflow-y: auto; padding: 84px 0 132px; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: rgb(20 30 60 / .16) transparent;
  -webkit-mask-image: linear-gradient(transparent 0, #000 76px, #000 calc(100% - 112px), transparent 100%); mask-image: linear-gradient(transparent 0, #000 76px, #000 calc(100% - 112px), transparent 100%); }
.col, .dayblock { display: flex; flex-direction: column; }
.col { max-width: 800px; margin: 0 auto; padding: 0 var(--s4); }
.loading { align-self: center; width: 20px; height: 20px; margin: var(--s2) 0 var(--s3); border-radius: 50%; border: 2px solid var(--fill-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.day { position: sticky; top: 4px; z-index: 3; align-self: center; margin: var(--s5) 0 var(--s2); padding: 3px var(--s3); border-radius: 999px;
  font-size: var(--fs-footnote); font-weight: 600; color: var(--label-2); background: var(--field); box-shadow: var(--e1);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sys { align-self: center; margin: var(--s2) 0; font-size: var(--fs-footnote); color: var(--label-3); }
.newline { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0 var(--s1); color: var(--danger); font-size: var(--fs-caption); font-weight: 700; letter-spacing: .06em; }
.newline::before, .newline::after { content: ""; flex: 1; height: 1px; background: rgb(229 72 77 / .3); }
.group { display: grid; grid-template-columns: 36px 1fr; column-gap: var(--s3); margin-top: var(--s5); }
.group.me { grid-template-columns: 1fr; justify-items: end; }
.gname { grid-column: 2; display: flex; align-items: baseline; gap: 6px; margin: 0 0 var(--s1) var(--s3); font-size: var(--fs-subhead); font-weight: 600; letter-spacing: -.005em; }
.gname .t { font-weight: 400; color: var(--label-3); font-size: var(--fs-footnote); }
.tag { font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0; padding: 1px 7px; border-radius: 999px; color: var(--agent); background: rgb(124 77 219 / .1); }
.gav { grid-column: 1; grid-row: 2 / span 99; align-self: end; }
.group.me .gname, .group.me .gav { display: none; }
.rows { grid-column: 2; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.group.me .rows { grid-column: 1; align-items: flex-end; }
.mrow { position: relative; display: flex; align-items: center; gap: var(--s2); max-width: min(620px, 82%); }
.group.me .mrow { flex-direction: row-reverse; }
.mrow.enter { animation: enter var(--med) var(--spring) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.bubble { position: relative; min-width: 0; max-width: 100%; padding: 8px 13px; border-radius: var(--r-bubble); background: var(--surface); box-shadow: var(--e1); overflow-wrap: anywhere;
  transition: box-shadow var(--med) var(--ease), background .6s var(--ease); }
.group:not(.me) .mrow:not(:last-child) .bubble { border-bottom-left-radius: 8px; }
.group:not(.me) .mrow:not(:first-child) .bubble { border-top-left-radius: 8px; }
.group:not(.me) .mrow:last-child .bubble { border-bottom-left-radius: var(--r-tail); }
.group.me .mrow:not(:last-child) .bubble { border-bottom-right-radius: 8px; }
.group.me .mrow:not(:first-child) .bubble { border-top-right-radius: 8px; }
.group.me .mrow:last-child .bubble { border-bottom-right-radius: var(--r-tail); }
.group.agent .bubble { background: color-mix(in srgb, var(--agent) 7%, var(--surface)); }
.group.me .bubble { background: var(--accent); color: #fff; }
.bubble.toyou { box-shadow: 0 0 0 1.5px var(--attention), 0 2px 12px rgb(245 165 36 / .16); }
.bubble.flash { background: var(--flash) !important; }
.bubble p { margin: 0; }
.bubble p + p, .bubble ul, .bubble pre { margin-top: 6px; }
.bubble ul { margin-bottom: 0; padding-left: 18px; }
.bubble li + li { margin-top: 2px; }
.bubble b { font-weight: 600; }
.bubble code { font: .86em var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--fill); letter-spacing: 0; }
.group.me .bubble code { background: rgb(255 255 255 / .2); }
.bubble pre { position: relative; margin-bottom: 0; padding: 10px 12px; border-radius: 12px; background: #1c2030; color: #e6e9f2; font: 12.5px/1.55 var(--mono); letter-spacing: 0; overflow-x: auto; }
.bubble pre code { background: none; padding: 0; font: inherit; }
.copycode { position: absolute; top: 6px; right: 6px; height: 24px; padding: 0 var(--s2); border-radius: 999px; border: 0; font-size: var(--fs-caption); font-weight: 600; color: #e6e9f2; background: rgb(255 255 255 / .12);
  transition: background var(--fast); }
.copycode:hover { background: rgb(255 255 255 / .2); }
.fold { max-height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.more { margin-top: var(--s1); border: 0; background: none; padding: 0; color: var(--accent); font-size: var(--fs-subhead); font-weight: 600; }
.mention { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px 0 2px; border-radius: 999px; font-weight: 600; font-size: .93em; color: var(--accent); background: rgb(47 107 255 / .1); cursor: default;
  transition: background var(--fast); }
.mention:hover { background: rgb(47 107 255 / .16); }
.mention .mini { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9px; color: #fff; border: 0; box-shadow: none; }
.mention .mini svg { width: 11px; height: 11px; }
.mention.you { color: var(--warn); background: rgb(245 165 36 / .16); }
.group.me .mention { color: #fff; background: rgb(255 255 255 / .2); }
.quote { display: block; margin: 0 0 6px; padding: 4px var(--s2) 4px 10px; border-radius: 10px; border-left: 3px solid var(--qc, var(--accent)); background: var(--fill); font-size: var(--fs-subhead); cursor: pointer;
  transition: background var(--fast); }
.quote:hover { background: var(--fill-2); }
.quote b { display: block; font-size: var(--fs-footnote); font-weight: 600; color: var(--qc, var(--accent)); }
.quote span { display: block; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group.me .quote { background: rgb(255 255 255 / .16); border-left-color: #fff; }
.group.me .quote b, .group.me .quote span { color: rgb(255 255 255 / .9); }
.time { font-size: var(--fs-caption); color: var(--label-3); opacity: 0; transition: opacity var(--fast); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mrow:hover .time { opacity: 1; }
.actions { position: absolute; top: -16px; right: -6px; z-index: 2; display: flex; gap: 2px; padding: 3px; border-radius: 999px; opacity: 0; transform: translateY(4px) scale(.96);
  pointer-events: none; transition: opacity var(--fast) var(--ease), transform var(--med) var(--spring); }
.group.me .actions { right: auto; left: -6px; }
.mrow:hover .actions { opacity: 1; transform: none; pointer-events: auto; }
.actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--label-2); transition: background var(--fast); }
.actions button:hover { background: var(--fill-2); color: var(--label); }
.actions .ico { width: 16px; height: 16px; }
.mstatus { margin: 3px var(--s1) 0 0; font-size: var(--fs-caption); color: var(--label-3); }
.mrow.sending .bubble { opacity: .55; }
.mstatus.failed { color: var(--danger); font-weight: 600; }
.mstatus.failed button { border: 0; background: none; padding: 0 0 0 var(--s1); color: inherit; font: inherit; text-decoration: underline; }

/* message box, jump pill and reply line: centred over the chat */
.over { position: fixed; left: var(--lw); right: var(--rw); margin-inline: auto; z-index: 5; transition: opacity var(--med), transform var(--med) var(--spring); }
.compose { bottom: 20px; width: min(760px, calc(100vw - var(--lw) - var(--rw) - 8px)); height: 56px; padding: 0 var(--s2) 0 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.compose input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; color: var(--label); }
.compose input::placeholder { color: var(--label-3); }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; transition: transform var(--med) var(--spring), background var(--fast); }
.send:hover { background: #2560f0; }
.send:active { transform: scale(.9); }
.jump { bottom: 92px; width: max-content; height: 34px; padding: 0 var(--s4); border-radius: 999px; border: 0; display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-subhead); font-weight: 600; color: var(--accent); opacity: 0; transform: translateY(10px); pointer-events: none; }
.jump.show { opacity: 1; transform: none; pointer-events: auto; }
.replybar { bottom: 82px; width: min(720px, calc(100vw - var(--lw) - var(--rw) - 48px)); padding: 6px var(--s2) 6px var(--s4); border-radius: 16px 16px 6px 6px;
  display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-subhead); opacity: 0; transform: translateY(12px); pointer-events: none; }
.replybar.show { opacity: 1; transform: none; pointer-events: auto; }
.replybar .what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--label-2); }
.replybar .what b { color: var(--label); font-weight: 600; }
.note { bottom: 2px; width: max-content; font-size: var(--fs-caption); color: var(--label-3); }
.note a { color: var(--accent); }


/* the message box holds mention pills; @ opens a member list right above it */
.compose .field { flex: 1; min-width: 0; max-height: 44px; overflow: hidden; white-space: nowrap; outline: none; line-height: 24px; color: var(--label); }
.compose .field:empty::before { content: attr(data-placeholder); color: var(--label-3); pointer-events: none; }
.field .mention { margin: 0 1px; }
.mlist { position: fixed; z-index: 15; width: 300px; padding: 6px; border-radius: 20px; display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(8px) scale(.97); transform-origin: bottom left; pointer-events: none; transition: opacity var(--fast) var(--ease), transform var(--med) var(--spring); }
.mlist.show { opacity: 1; transform: none; pointer-events: auto; }
.mlist .msec { padding: 6px 10px 2px; font-size: var(--fs-caption); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--label-3); }
.mitem { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; cursor: pointer; }
.mitem .av { width: 30px; height: 30px; font-size: var(--fs-footnote); }
.mitem .av .owner { font-size: 8px; }
.mitem b { display: block; font-size: var(--fs-subhead); font-weight: 600; }
.mitem small { display: block; font-size: var(--fs-caption); color: var(--label-2); line-height: 1.3; }
.mitem mark { background: none; color: var(--accent); }
.mitem.on { background: rgb(47 107 255 / .1); }
.mlist .none { padding: 10px; font-size: var(--fs-subhead); color: var(--label-3); }
.mlist .keys { padding: 4px 10px 2px; font-size: var(--fs-caption); color: var(--label-3); border-top: 1px solid var(--sep); margin-top: 4px; }


/* ================= the first page, and the way into the room ================= */
body.joining .head, body.joining .panel, body.joining .chat, body.joining .over, body.joining #mlist, #agent[hidden] { display: none !important; }
body:not(.joining) .jscreen { display: none; }
.jscreen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 4; }
.jcard { width: 470px; padding: 28px 30px 30px; border-radius: 36px; display: flex; flex-direction: column; gap: 15px; }
.jbrand { display: flex; align-items: center; justify-content: center; gap: 8px; }
.jbrand .mark { width: 38px; height: 30px; }
.jbrand b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.jbrand span { font-size: var(--fs-body); color: var(--label-3); }
.jbrand span::before { content: "·"; margin-right: 8px; }
.jduo { position: relative; height: 188px; margin-top: 6px; transition: height var(--slow) var(--spring); }
.jduo.open { height: 188px; }
.jcol { position: absolute; top: 0; left: 50%; width: 186px; display: flex; flex-direction: column; align-items: center; gap: 11px; transition: transform var(--slow) var(--spring), opacity var(--med); }
.jyou { z-index: 2; transform: translateX(-50%); }
.jagent { z-index: 1; transform: translateX(-50%) scale(.55); opacity: 0; pointer-events: none; }
.jduo.open .jyou { transform: translateX(calc(-50% - 100px)); }
.jduo.open .jagent { transform: translateX(calc(-50% + 100px)); opacity: 1; pointer-events: auto; }
.jcol .av { width: 96px; height: 96px; font-size: 35px; }
.jname { width: 186px; height: 44px; border-radius: 999px; text-align: center; font: inherit; font-size: var(--fs-body); border: 1px solid var(--sep); background: var(--field); color: var(--label); outline: none; }
.jadd { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: var(--fs-subhead); color: var(--label-3); }
.jchip { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--sep); background: var(--field); padding: 0; transition: transform var(--med) var(--spring), box-shadow var(--fast); }
.jchip svg { width: 27px; height: 27px; }
.jchip[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(47 107 255 / .3); }
.jchip:disabled { opacity: .45; }
.jchip:active { transform: scale(.92); }
.jpill { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 8px 0 20px; border-radius: 999px; border: 1px solid var(--sep); background: var(--field); color: var(--label-3); }
.jpill .jroom { flex: 1; font-size: var(--fs-title); color: var(--label); }
.jbtn { height: 60px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-size: 18px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 18px rgb(47 107 255 / .3); transition: transform var(--med) var(--spring); }
.jbtn:active { transform: scale(.96); }
.jbtn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.jnote { position: fixed; bottom: 10px; left: 0; right: 0; text-align: center; font-size: var(--fs-caption); color: var(--label-3); }

/* the shared pieces: the browser animates each from where it was to where it lands */
.jcard, .head { view-transition-name: shell; }
.jbrand .mark, .head .mark { view-transition-name: mark; }
.jroom, .head .room { view-transition-name: room; }
.jyou .av, #people .prow:first-child .av { view-transition-name: you; }
.jagent .av, #agent .atop > .av { view-transition-name: agentav; }
.jbtn, .compose { view-transition-name: compose; }
::view-transition-group(*) { animation-duration: 560ms; animation-timing-function: cubic-bezier(.34, 1.14, .64, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; }
/* the card and the Join button change shape; their old contents fade out fast so nothing looks squashed */
::view-transition-group(shell), ::view-transition-group(compose) { overflow: clip; border-radius: 30px; }
::view-transition-old(shell), ::view-transition-old(compose) { animation: vt-out 160ms ease both; }
::view-transition-new(shell), ::view-transition-new(compose) { animation: vt-in 300ms 160ms ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* the room fills in after the move */
.col.stagger .mrow, .col.stagger .sys, .col.stagger .day, .col.stagger .gname, .col.stagger .mstatus { animation: enter 380ms var(--spring) both; animation-delay: calc(var(--i, 0) * 28ms); }

/* your agent before it connects: a dashed turning ring, and how to bring it in */
#agent.connecting .atop > .av::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px dashed rgb(124 77 219 / .55); animation: spin 8s linear infinite; }
#agent.connecting .state { color: var(--agent); }
#agent.connecting .state::before { background: var(--agent); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
#agent.connecting .badge { display: none; }
/* no agent yet: a faded avatar, no ring, an invitation */
#agent.invite .atop > .av { opacity: .5; filter: grayscale(.6); }
#agent.invite .atop > .av::after { border-style: solid; border-color: transparent; animation: none; }
#agent.invite .state { color: var(--label-3); }
#agent.invite .state::before { background: var(--label-3); animation: none; }
#agent.connecting .abody > :not(.connect) { display: none; }
#agent:not(.connecting) .connect { display: none; }
.connect { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s2) var(--s1); }
.cstep { display: flex; gap: var(--s3); align-items: flex-start; }
.cstep .num { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: var(--fs-footnote); font-weight: 700; color: var(--agent); background: rgb(124 77 219 / .1); }
.cstep b { display: block; font-size: var(--fs-subhead); font-weight: 600; }
.cstep small { display: block; font-size: var(--fs-footnote); color: var(--label-2); line-height: 1.35; }
.cap.wide { width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cap.wide .ico { width: 16px; height: 16px; }

/* ================= tooltips: a short name, one line on what it does, the key ================= */
#tip { position: fixed; z-index: 20; max-width: 260px; padding: 7px 10px; border-radius: 12px; pointer-events: none; opacity: 0; transform: translateY(4px) scale(.97);
  transition: opacity var(--fast) var(--ease), transform var(--med) var(--spring); background: rgb(28 32 46 / .92); color: #fff; box-shadow: var(--e3);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#tip.show { opacity: 1; transform: none; }
#tip b { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-subhead); font-weight: 600; }
#tip span { display: block; margin-top: 2px; font-size: var(--fs-footnote); line-height: 1.35; color: rgb(255 255 255 / .72); }
#tip kbd { margin-left: auto; padding: 0 5px; border-radius: 5px; font: 600 var(--fs-caption)/18px var(--font); background: rgb(255 255 255 / .16); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; } .chat { scroll-behavior: auto; } }
