/* Saffron web interface. Synq AI's colours: ink on a pale canvas, white
   panels, grey hairlines, one red for anything live. */
@font-face { font-family: "Synq Sans"; src: url("/static/fonts/SynqSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Synq Sans"; src: url("/static/fonts/SynqSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Synq Sans"; src: url("/static/fonts/SynqSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --canvas: #F7F7F8; --surface: #FFFFFF; --sunken: #EDEDEF;
  --ink: #0A0A0A; --text-2: #52525B; --text-3: #9CA3AF; --line: #D4D4D8;
  --red: #FF3B30; --red-deep: #D92B21;
  --display: "Synq Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 272px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
/* The closed answer panel keeps its padding and slide offset past the right edge; clip, so nothing can scroll the page sideways to it. */
html { overflow: clip; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr) 0px;
  transition: grid-template-columns .3s var(--ease);
  /* clip, not hidden: a hidden box can still be scrolled by focus or script, which slid the sidebar off the left edge. */
  overflow: clip;
}
body.open { grid-template-columns: var(--side) minmax(0, 1fr) min(500px, 40vw); }
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- sidebar ---- */
.side { display: flex; flex-direction: column; min-height: 0; padding: 22px 16px 16px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; }
.brand .client-logo { height: 34px; width: auto; display: block; }
.wordmark { font: 500 24px/1 var(--display); letter-spacing: -.035em; white-space: nowrap; user-select: none; }
.wordmark .ai { color: var(--red); }
.name { font: 500 14px/1 var(--body); color: var(--text-2); padding-left: 10px; border-left: 1px solid var(--line); align-self: center; line-height: 18px; }
.brand { min-width: 0; }
.brand .client-logo { max-width: 150px; object-fit: contain; object-position: left center; }
/* The live state is a dot beside the name; the words stay for screen readers. */
.brand .live { flex: none; width: 7px; height: 7px; margin-left: -4px; border-radius: 50%; background: var(--red);
  overflow: hidden; text-indent: 100%; white-space: nowrap; animation: pulse 1.2s ease-in-out infinite; }
.brand .live[hidden] { display: none; }
@keyframes pulse { 50% { opacity: .25; } }

.new { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 40px;
  border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 500;
  transition: transform .15s var(--ease), background .2s; }
.new:hover { background: #2A2A2D; }
.new:active { transform: scale(.98); }

.topics { flex: 1; min-height: 0; overflow-y: auto; margin: 18px -6px 0; padding: 0 6px; }
.topics:empty::before { content: "Your questions will be listed here."; display: block; padding: 10px 6px; color: var(--text-3); font-size: 13px; }
.topic { display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 2px;
  background: none; border: 1px solid transparent; border-radius: 10px;
  transition: background .2s, border-color .2s; animation: rise .25s var(--ease) both; }
.topic:hover { background: var(--sunken); }
.topic.on { background: var(--surface); border-color: var(--line); }
.topic b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; font-size: 14px; line-height: 1.35; }
.topic span { display: block; margin-top: 3px; font-size: 12px; color: var(--text-3); }

.foot { padding: 16px 6px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.foot label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border: solid var(--text-2); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
.select select { width: 100%; height: 38px; padding: 0 32px 0 12px; appearance: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
#viewas { margin-bottom: 12px; }
.sees { margin: 6px 2px 0; font-size: 12px; color: var(--text-3); }
.sees:empty { display: none; }
.me { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.me p { margin: 0; min-width: 0; }
.me b { display: block; font-weight: 500; font-size: 14px; }
.me span { display: block; font-size: 12px; color: var(--text-3); }
.me .clear { margin: 1px 0 0; flex: none; font-size: 12px; text-decoration: none; color: var(--text-3); }
.me .clear:hover { color: var(--ink); }
.plain { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; margin-bottom: 12px; padding: 0 12px;
  background: none; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; transition: border-color .2s, background .2s; }
.plain:hover { border-color: var(--ink); background: var(--surface); }
.plain[hidden], #viewas[hidden] { display: none; }
.sees.blocked { color: var(--red-deep); }
/* The history switch and its Clear share one row. */
.keep { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.keep .clear { margin: 0; font-size: 12px; }
.foot .switch { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); cursor: pointer; margin: 0; }
.switch input { position: absolute; opacity: 0; }
.track { width: 30px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(12px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.clear { margin-top: 10px; padding: 0; border: 0; background: none; font-size: 13px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.clear:hover { color: var(--ink); }
.fine { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-3); }

/* The public demo copy has no people, history, files or local-only note. */
html[data-demo-only] .foot, html[data-demo-only] #clip { display: none; }

/* ---- the sidebar folded to a rail: the open button and a new-topic "+" ---- */
.fold { flex: none; margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: none; color: var(--text-2); transition: background .15s, color .15s; }
.fold:hover { background: var(--sunken); color: var(--ink); }
.side { transition: padding .3s var(--ease); }
/* Folding is for wide screens only, and only touches the sidebar's own parts. */
@media (min-width: 901px) {
  body.folded { --side: 64px; }
  body.folded .side { padding: 22px 12px 16px; overflow: hidden; }
  body.folded .brand { padding: 0 0 20px; justify-content: center; }
  body.folded .side .brand > :not(.fold), body.folded .side > :not(.brand):not(.new) { display: none; }
  body.folded .side .fold { margin: 0; }
  body.folded .side .new { width: 40px; margin: 0 auto; padding: 0; }
  body.folded .side .new .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* Signing in: no rail at all, so the page is not pushed off centre. */
  body.locked.folded { --side: 0px; }
  body.locked.folded .side { padding: 0; border: 0; }
}

/* ---- signing in: the orb turns behind a small card ---- */
/* While a card is open the page behind it goes soft; the orb keeps turning under the blur. */
.stage:has(> .door:not([hidden]))::after { content: ""; position: absolute; inset: 0; z-index: 2;
  background: rgba(247,247,248,.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
body.locked .side > :not(.brand), body.locked .dock, body.locked .hello { visibility: hidden; }
body.locked .fold { visibility: hidden; }
.door { position: absolute; z-index: 3; left: 50%; top: 50%; width: min(360px, calc(100% - 48px)); padding: 30px 28px 24px;
  transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 12px; text-align: center;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 2px 4px rgba(10,10,10,.04), 0 40px 90px -40px rgba(10,10,10,.45); animation: door-in .3s var(--ease) both; }
.door[hidden] { display: none; }
@keyframes door-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)); } }
.door h1 { margin: 0; font: 500 24px/1.2 var(--display); letter-spacing: -.015em; }
.door p { margin: 0 0 4px; color: var(--text-2); font-size: 14px; }
.door .select select { text-align: left; height: 44px; }
.door input { height: 52px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: var(--surface);
  font: 500 24px/1 var(--display); letter-spacing: .3em; text-indent: .3em; font-variant-numeric: tabular-nums; }
.door input:focus { outline: 0; border-color: var(--ink); }
.door input[hidden], .door .select[hidden], .door .clear[hidden] { display: none; }
.door .new { height: 44px; }
.door .clear { margin: 0 auto; }
.door .door-err { min-height: 20px; margin: 0; font-size: 13px; color: var(--red-deep); }
/* The meeting copy's settings: the same card, with ordinary text boxes. */
.setup { text-align: left; gap: 8px; width: min(400px, calc(100% - 48px)); }
.setup h1, .setup > p { text-align: center; }
.setup label { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.setup input { height: 44px; padding: 0 14px; text-align: left; font: 400 14px/1 var(--body); letter-spacing: 0; text-indent: 0; }
.setup .plain { margin: 12px 0 0; height: 44px; justify-content: center; }
.setup .plain img { height: 16px; }
.setup .plain:disabled { color: var(--text-3); cursor: default; }
.setup .plain:disabled img { filter: grayscale(1); opacity: .5; }
.setup .door-err { min-height: 18px; text-align: center; }

/* ---- stage ---- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#orb { position: absolute; inset: 48px 0 132px 0; width: 100%; height: calc(100% - 180px); display: block; }
.hello { position: relative; text-align: center; padding: 5vh 24px 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.hello h1 { margin: 0; font: 500 clamp(30px, 3.4vw, 46px)/1.08 var(--display); letter-spacing: -.02em; }
.hello h1 em { font-style: normal; color: var(--text-3); }
.hello p { margin: 10px auto 0; max-width: 400px; color: var(--text-2); }
body.asked .hello { opacity: 0; transform: translateY(-10px); pointer-events: none; }

.feeds { list-style: none; margin: 0; padding: 0; }
.feeds[hidden] { display: none; }
.feeds li { position: absolute; transform: translate(-50%, -50%); padding: 8px 15px 8px 12px; white-space: nowrap;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px -16px rgba(10,10,10,.25);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--ink);
  transition: opacity .5s var(--ease), filter .5s var(--ease); animation: float 6.4s ease-in-out infinite; }
/* Always there, drifting a little, each on its own beat. `translate` is its
   own property, so the drift does not fight the centring transform. */
@keyframes float { 50% { translate: 0 -7px; } }
.feeds li:nth-child(3n) { animation-duration: 7.6s; animation-delay: -2.1s; }
.feeds li:nth-child(3n + 1) { animation-duration: 5.8s; animation-delay: -3.4s; }
.feeds li:nth-child(4n) { animation-delay: -4.6s; }
/* Every logo is in full colour at rest (the user's call, 21 Nov 2026). Only
   while a question runs do the ones not being read step back, so the streams
   have a clear source. */
body.thinking:not(.demo) .feeds li:not([data-on]),
body.demo .feeds li:not([data-demo]) { filter: grayscale(1); opacity: .4; }
.feeds img { height: 18px; width: auto; display: block; }
.feeds img.wordmark { height: 20px; margin-left: 3px; }

.dock { position: relative; margin-top: auto; padding: 0 24px 26px; display: flex; flex-direction: column; align-items: center; }
.status { height: 22px; margin: 0 0 10px; font-size: 13px; color: var(--text-2); opacity: 0; transition: opacity .3s; font-variant-numeric: tabular-nums; }
.status.on { opacity: 1; }
.ask { display: flex; align-items: flex-end; gap: 8px; width: min(640px, 100%); padding: 8px 8px 8px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(10,10,10,.04), 0 12px 32px -18px rgba(10,10,10,.18);
  transition: border-color .2s, box-shadow .3s; }
.ask:focus-within { border-color: var(--ink); box-shadow: 0 1px 2px rgba(10,10,10,.05), 0 16px 40px -18px rgba(10,10,10,.28); }
/* A real starting width, so the box never squeezes onto the row of file chips above it. */
.ask textarea { flex: 1 1 200px; min-width: 0; border: 0; outline: 0; resize: none; background: none; padding: 9px 0; max-height: 132px; line-height: 1.45; font-size: 16px; }
.ask textarea::placeholder { color: var(--text-3); }
.ask button { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--ink); color: #fff;
  display: grid; place-items: center; transition: transform .15s var(--ease), opacity .2s; }
.ask button:active { transform: scale(.94); }
.ask button:disabled { opacity: .3; cursor: default; }
.ask #clip { background: none; color: var(--text-2); margin-left: -10px; transition: color .2s, background .2s, transform .15s var(--ease); }
.ask #clip:hover { color: var(--ink); background: var(--sunken); }
/* Files waiting to go with the next question, and the ones a question went with. */
.files { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.ask { flex-wrap: wrap; }   /* files waiting to go sit on their own row inside the box */
.ask .files { flex: 0 0 100%; margin-left: -8px; padding: 4px 0 2px; }
.ask .files:empty { display: none; }
.ask .files li { background: var(--canvas); }
.files li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px 5px 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px; animation: rise .35s var(--ease) both; }
.files li svg { width: 14px; height: 14px; flex: none; color: var(--text-2); }
.files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); line-height: 1; font-size: 15px; }
.files li button:hover { color: var(--ink); background: var(--sunken); }
.qa .files { margin: 8px 0 0; }
.qa .files li { background: var(--canvas); animation: none; }
.stage.drop::after { content: "Drop the file to ask about it"; position: absolute; inset: 14px; z-index: 4; display: grid; place-items: center;
  border: 1.5px dashed var(--ink); border-radius: 22px; background: rgba(247,247,248,.86); font: 500 18px var(--display); pointer-events: none; }
.ask #mic { background: none; color: var(--text-2); transition: color .2s, background .2s, transform .15s var(--ease); }
.ask #mic:hover { color: var(--ink); background: var(--sunken); }
.ask #mic.on { color: #fff; background: var(--red); }
.tries { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; max-width: 760px;
  transition: opacity .35s, max-height .45s var(--ease), margin .45s var(--ease); max-height: 240px; overflow: hidden; }
.tries button { padding: 6px 12px; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text-2);
  transition: border-color .2s, color .2s, background .2s; }
.tries button:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
body.asked .tries { opacity: 0; max-height: 0; margin-top: 0; pointer-events: none; }


/* ---- the meeting brief: a sheet of paper over the orb ---- */
#orb, .feeds { transition: opacity .6s var(--ease); }
body.reading #orb { opacity: .18; }
body.reading .feeds { opacity: 0; }
.sheet { position: absolute; z-index: 2; left: 50%; top: 28px; bottom: 150px; width: min(600px, calc(100% - 48px));
  overflow-y: auto; padding: 36px 46px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 2px 4px rgba(10,10,10,.04), 0 40px 90px -40px rgba(10,10,10,.45);
  transform: translateX(-50%); animation: sheet-in .8s var(--ease) both;
  transition: opacity .5s var(--ease), transform .6s var(--ease); }
.sheet[hidden] { display: none; }
.sheet .shut { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none;
  color: var(--text-3); font-size: 20px; line-height: 1; animation: none; }
.sheet .shut:hover { color: var(--ink); background: var(--sunken); }
.sheet.out { opacity: 0; transform: translateX(-50%) translateY(46px) scale(.95); }
@keyframes sheet-in { from { opacity: 0; transform: translateX(-50%) translateY(70px) scale(.9) rotate(-1.2deg); } }
/* Each line of the brief arrives a beat after the one above it. */
.sheet > * { animation: rise .55s var(--ease) both; animation-delay: calc(.45s + var(--n, 0) * .14s); }
.sheet .kicker { margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--red-deep); }
.sheet h2 { margin: 0 0 4px; font: 500 26px/1.2 var(--display); letter-spacing: -.015em; }
.sheet .size { margin: 0 0 14px; color: var(--text-2); }
.sheet .facts { margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.sheet .facts b { color: var(--ink); font-weight: 600; }
.sheet h3 { margin: 0 0 6px; font: 600 12px/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sheet ul { margin: 0 0 13px; padding-left: 18px; }
.sheet li { margin-bottom: 3px; }
.sheet li::marker { color: var(--text-3); }
.sheet .from { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.stamp { position: absolute; top: 34px; right: 56px; padding: 6px 14px; border: 2.5px solid var(--red); border-radius: 6px;
  color: var(--red); font: 700 18px/1 var(--display); letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(-9deg); animation: stamp .45s cubic-bezier(.2, 1.4, .4, 1) both !important; animation-delay: 0s !important; }
@keyframes stamp { from { opacity: 0; transform: rotate(-9deg) scale(2.4); } }

/* ---- answers ---- */
.thread { min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line);
  padding: 28px 28px 40px; opacity: 0; transform: translateX(16px); transition: opacity .25s var(--ease) .05s, transform .3s var(--ease); scroll-behavior: smooth; }
body.open .thread { opacity: 1; transform: none; }
.qa { animation: rise .3s var(--ease) both; }
.qa + .qa { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.qa h2 { margin: 0; font: 500 20px/1.25 var(--display); letter-spacing: -.01em; }
.meta { margin: 6px 0 16px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.answer p { margin: 0 0 12px; }
.answer ul { margin: 0 0 12px; padding-left: 18px; }
.answer li { margin-bottom: 6px; }
.answer li::marker { color: var(--text-3); }
.answer a { color: inherit; text-underline-offset: 3px; }
.answer.streaming > :last-child::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--red); animation: pulse 1s steps(2) infinite; }
.wait { color: var(--text-3); }
.cite { display: inline-block; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px; border-radius: 6px; vertical-align: 1px;
  background: var(--sunken); color: var(--text-2); font-size: 11px; line-height: 17px; text-align: center; cursor: default; transition: background .15s, color .15s; }
.cite:hover, .cite.hit { background: var(--ink); color: #fff; }
.note { margin: 0 0 14px; padding: 10px 14px; border-left: 2px solid var(--red); background: #FFF5F4; border-radius: 0 10px 10px 0; font-size: 14px; }
/* A fact Saffron was taught, and the two rating buttons under an answer. */
.taught { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.taught::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.3 7 10.7l4.6-5.2'/%3E%3C/svg%3E") center/14px no-repeat; }
.taught p:last-child { margin: 0; }
.rate { display: flex; gap: 8px; margin-top: 16px; }
.rate button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 10px; background: none; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; color: var(--text-2); transition: border-color .2s, color .2s, background .2s, transform .15s var(--ease); }
.rate button:hover { border-color: var(--ink); color: var(--ink); }
.rate button:active { transform: scale(.96); }
.rate svg { width: 14px; height: 14px; }
.draft { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--canvas); }
.draft-head { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.draft-head b { color: var(--ink); font-weight: 500; }
.draft-body { display: block; width: 100%; min-height: 170px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font: 14px/1.5 var(--body); color: var(--ink); resize: vertical; }
.draft-body:focus { outline: 0; border-color: var(--ink); }
.draft-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.draft-act button { padding: 7px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px;
  transition: border-color .2s, background .2s, transform .15s var(--ease); }
.draft-act button:hover { border-color: var(--ink); }
.draft-act button:active { transform: scale(.97); }
.draft-act button:disabled { opacity: .5; cursor: default; }
.draft-act .send { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500; }
.draft-act span { font-size: 12px; color: var(--text-3); }
.draft-sent { padding: 10px 12px; border-radius: 8px; background: var(--surface); font-size: 14px; }
.draft-err { margin: 8px 0 0; font-size: 13px; color: var(--red-deep); }
.thanks { margin: 16px 0 0; font-size: 13px; color: var(--text-2); animation: rise .4s var(--ease) both; }
.thanks b { font-weight: 500; color: var(--ink); }
.denied { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); color: var(--text-2); }
.sources { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; }
.sources::before { content: "Sources"; display: block; margin-bottom: 8px; font-size: 12px; color: var(--text-3); }
.sources li { counter-increment: s; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
  padding: 8px 10px; margin: 0 -10px; border-radius: 10px; font-size: 13px; transition: background .15s; }
.sources li::before { content: counter(s); color: var(--text-3); font-variant-numeric: tabular-nums; }
.sources li.hit, .sources li:hover { background: var(--canvas); }
.sources a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.sources a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sources span { overflow-wrap: anywhere; }
.kind { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.sources .part { font-style: normal; color: var(--text-3); }
/* Where each source came from: a logo or a small mark before its name. */
.sources .src { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.sources .ico { flex: none; width: 16px; height: 16px; margin-top: 2px; object-fit: contain; display: grid; place-items: center; color: var(--text-2); }
.sources .ico svg { width: 16px; height: 16px; }
.sources a::after { content: " \2197"; color: var(--text-3); }

/* A button waiting on the server: the words give way to a spinner, the size stays. */
button.busy { position: relative; color: transparent !important; pointer-events: none; }
button.busy > * { visibility: hidden; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(10,10,10,.2); border-top-color: var(--ink); animation: spin .7s linear infinite; }
.new.busy::after, .draft-act .send.busy::after, .ask button.busy::after { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 900px) {
  /* A phone: a slim top bar with a menu button, the page in the middle, the
     question box at the bottom. The sidebar opens over the page as a menu. */
  body, body.open { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
  .side { order: 0; flex: none; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--canvas); z-index: 5; }
  .brand { padding: 0; }
  .brand .client-logo { height: 28px; }
  body:not(.menu) .side > :not(.brand) { display: none; }
  body.menu .side { position: fixed; inset: 0; overflow-y: auto; padding: 10px 16px 24px; }
  body.menu .brand { padding-bottom: 16px; }
  .topics { max-height: none; }
  .thread { order: 1; }
  .stage { order: 2; flex: 1; min-height: 0; }
  body:not(.open) .thread { display: none; }
  /* With an answer open, it fills the screen above the question box. */
  body.open .thread { flex: 1; min-height: 0; border-left: 0; opacity: 1; transform: none; padding: 20px 16px 24px; }
  body.open .stage { flex: none; }
  body.open #orb, body.open .hello, body.open .tries { display: none; }
  body.open .dock { padding-top: 10px; border-top: 1px solid var(--line); background: var(--canvas); }
  .feeds { display: none; }
  /* The orb sits between the heading and the question box, not under them. */
  #orb { inset: 150px 0 160px 0; height: calc(100% - 310px); }
}
@media (max-width: 600px) {
  /* Room for the clip, mic and send buttons on one row beside the text. */
  .ask textarea { flex-basis: 0; }
  .dock { padding: 0 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  button.busy::after { animation: spin 1.6s linear infinite !important; }
}
