/* The studio page: Yu Yue and her machine on the left, the conversation on the
   right. The look is the "书页" design: ink on paper, hatching for emphasis,
   outline buttons. Colors live in tokens only; dark is the default.
   studio.css is the page and the right column, machine.css the screen and its
   three pages, companion.css Yu Yue's room and the tour. */

/* Type is served from this folder (fonts/, SIL Open Font License), so the page
   reads the same where a font CDN does not answer. */
@font-face { font-family: "Alegreya"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/alegreya-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Alegreya"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/alegreya-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Alegreya"; font-weight: 500 600; font-style: normal; font-display: swap; src: url(fonts/alegreya-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Alegreya"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/alegreya-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Alegreya SC"; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sc-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Alegreya SC"; font-weight: 500 600; font-display: swap; src: url(fonts/alegreya-sc-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Alegreya SC"; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sc-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500 700; font-style: normal; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Noto Serif SC"; font-weight: 400 500; font-display: swap; src: url(fonts/noto-serif-sc-chinese-simplified-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-weight: 600 700; font-display: swap; src: url(fonts/noto-serif-sc-chinese-simplified-600-normal.woff2) format("woff2"); }

:root {
  --bg: #1a1918; --ink: #e8e3d8; --ink2: #aaa498; --ink3: #77715f; --rule: #383631; --wash: rgba(232, 227, 216, .07);
  --serif: "Alegreya", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sc: "Alegreya SC", "Noto Serif SC", "Songti SC", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Chinese numerals standing alone: the order of a demo's steps, the tour's count. */
  --han: "Noto Serif SC", serif;
  /* What a previewed page or picture lies on: they are made for white, in either light. */
  --sheet: #fff;
  --pet-ink: sepia(.19) brightness(.77); --pet-blend: normal;
  /* A settle with one small overshoot, for things that arrive. */
  --spring: linear(0, .26 9%, .72 22%, 1.02 36%, 1.06 44%, 1.03 56%, 1 72%, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2ede2; --ink: #1f1d1a; --ink2: #5a554b; --ink3: #9a9282; --rule: #d3cbb9; --wash: rgba(31, 29, 26, .055);
  color-scheme: light;
  --pet-ink: none; --pet-blend: multiply;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2ede2; --ink: #1f1d1a; --ink2: #5a554b; --ink3: #9a9282; --rule: #d3cbb9; --wash: rgba(31, 29, 26, .055);
    color-scheme: light;
    --pet-ink: none; --pet-blend: multiply;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
.sc { font-family: var(--sc); letter-spacing: .08em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; color: var(--ink); }
:focus-visible { outline: 1px dashed var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

.app { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); overflow: hidden; }
.left { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: clamp(22px, 4.6vh, 60px) clamp(18px, 2.2vw, 42px) 0; }
.right { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--rule); }

/* ── The top bar: the four views, then new, past, sound and light ── */
.topbar { position: relative; z-index: 30; flex: none; display: flex; align-items: stretch; gap: 12px; min-height: 54px; padding: 0 18px 0 28px; border-bottom: 1px solid var(--rule); }
.tabs { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: none; border: 0; padding: 0 0 13px; margin-bottom: -1px; font-family: var(--sc); font-size: 15.5px; letter-spacing: .1em; color: var(--ink2); border-bottom: 1px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab .n { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; margin-left: 5px; color: var(--ink2); }
.tab .n:empty { display: none; }
.tools { flex: none; display: flex; align-items: center; gap: 2px; }
.iconbtn { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--wash); }
.pair { display: flex; gap: 8px; margin-left: 12px; }
.roundbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ink); background: none; display: grid; place-items: center; padding: 0; }
.roundbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.roundbtn:hover { background: var(--wash); }
:root[data-theme="light"] .ic-sun, :root:not([data-theme="light"]) .ic-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .ic-sun { display: none; }
  :root:not([data-theme]) .ic-moon { display: inline; }
}
#sound .waves, #sound[aria-pressed="true"] .mute { display: none; }
#sound[aria-pressed="true"] .waves { display: inline; }
#sound.speaking .waves { animation: waves 1.1s ease-in-out infinite; }
@keyframes waves { 50% { opacity: .35; } }

/* The contents page: past conversations, and the few things that used to sit in the header. */
.drawer { position: absolute; left: 0; right: 0; top: 100%; max-height: min(72vh, 620px); overflow: auto; margin-top: 1px; padding: 14px 28px 16px; background: var(--bg); border-bottom: 1px solid var(--ink); box-shadow: 0 3px var(--bg), 0 4px var(--ink2); }
.drawer h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; font-family: var(--sc); font-weight: 500; font-size: 13px; letter-spacing: .3em; color: var(--ink2); }
.toc { list-style: none; margin: 0 0 12px; padding: 0; }
.toc button { display: flex; align-items: baseline; width: 100%; padding: 4px 0 4px 14px; background: none; border: 0; text-align: left; font-size: 15px; }
.toc button:hover .t { text-decoration: underline; text-decoration-color: var(--ink3); text-underline-offset: 4px; }
.toc .t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc .lead { flex: 1; min-width: 24px; margin: 0 8px; border-bottom: 1px dotted var(--ink3); transform: translateY(-4px); }
.toc .r { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.toc .on { box-shadow: inset 2px 0 var(--ink); }
.toc .on .t { font-weight: 600; }
.toc .none { padding: 4px 0; font-size: 14px; color: var(--ink2); }
.drawer .foot { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 18px; margin: 0; padding-top: 11px; border-top: 1px dotted var(--ink3); }
.drawer .foot dt { font-family: var(--sc); font-size: 12.5px; letter-spacing: .14em; color: var(--ink2); padding-top: 1px; }
.drawer .foot dd { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
.drawer .note { margin: 8px 0 0; font-size: 13px; color: var(--ink2); }

.panel { flex: 1; min-height: 0; display: none; flex-direction: column; }
.panel.on { display: flex; }
.body { flex: 1; min-height: 0; overflow: auto; padding: 18px 28px 10px; }

.linkbtn { background: none; border: 0; padding: 0; font-family: var(--sc); letter-spacing: .1em; font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--ink3); text-underline-offset: 4px; }
.linkbtn:hover { text-decoration-color: var(--ink); }
.btn { border: 1px solid var(--ink); background: none; border-radius: 999px; padding: 4px 15px; font-family: var(--sc); letter-spacing: .1em; font-size: 13.5px; white-space: nowrap; }
.btn:hover { background: var(--wash); }
.btn:disabled { opacity: .45; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.menu { position: absolute; z-index: 20; max-height: 50vh; overflow: auto; background: var(--bg); border: 1px solid var(--ink); padding: 6px 0; }
.menu button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; text-align: left; background: none; border: 0; padding: 5px 14px; }
.menu button.on { background: var(--wash); }
@media (hover: hover) { .menu button:hover { background: var(--wash); } }
.menu .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.menu .r { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.menu .grp { padding: 6px 14px 2px; font-family: var(--sc); font-size: 12.5px; letter-spacing: .14em; color: var(--ink2); }
.menu .grp.off { color: var(--ink3); }
.menu button:disabled { color: var(--ink3); cursor: default; }
/* Under the models: a row for effort and one for speed. A row's choices open in a column beside the menu. */
.menu .sep { margin: 5px 14px 4px; border-top: 1px dotted var(--ink3); }
.menu .more .r, .menu .back .t { font-family: var(--sc); font-size: 12.5px; letter-spacing: .1em; color: var(--ink2); }
.menu .more.on .r { color: var(--ink); }
.menu .back { margin-bottom: 2px; }

/* Transcript */
.head { margin: 0 0 20px; text-align: center; font-family: var(--sc); font-size: 13px; letter-spacing: .22em; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head::before, .head::after { content: "—"; margin: 0 .9em; color: var(--rule); }
.say { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; margin: 0 0 18px; }
.say .who { font-family: var(--sc); letter-spacing: .1em; font-size: 13px; color: var(--ink2); text-align: right; padding-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.say .txt { min-width: 0; font-size: 15px; line-height: 1.68; }
.txt p { margin: 0 0 8px; }
.txt ul, .txt ol:not(.calls) { margin: 0 0 8px; padding-left: 1.4em; }
.txt li { margin: 1px 0; }
.txt code { overflow-wrap: anywhere; }
.txt pre { margin: 6px 0 10px; padding: 8px 10px; border-left: 1px solid var(--rule); background: var(--wash); overflow-x: auto; line-height: 1.55; white-space: pre; }
.txt a { color: inherit; text-decoration-color: var(--ink3); text-underline-offset: 3px; }
/* A file in the workspace, named in an answer or a document: it opens on the machine's third page. */
.ref { display: inline; padding: 0; background: none; border: 0; font: inherit; color: inherit; text-align: inherit; text-decoration: underline; text-decoration-color: var(--ink3); text-underline-offset: 3px; overflow-wrap: anywhere; }
.ref:hover { text-decoration-color: var(--ink); }
.txt table { border-collapse: collapse; margin: 4px 0 10px; font-size: 13.5px; }
.txt th, .txt td { border-bottom: 1px dotted var(--ink3); padding: 3px 12px 3px 0; text-align: left; vertical-align: top; }
.txt th { font-family: var(--sc); font-weight: 500; letter-spacing: .06em; color: var(--ink2); }
.txt h4 { font-family: var(--sc); font-size: 14.5px; letter-spacing: .08em; margin: 10px 0 4px; }
.mark { margin: 0 0 18px; text-align: center; font-family: var(--sc); font-size: 12.5px; letter-spacing: .18em; color: var(--ink3); }
.mark::before, .mark::after { content: "—"; margin: 0 .9em; color: var(--rule); }
.say.shell .who { font-family: var(--sc); }
.txt pre.term { max-height: 360px; overflow: auto; margin: 2px 0 4px; white-space: pre-wrap; word-break: break-word; color: var(--ink2); }
.term .cmd { color: var(--ink); }
.words.folded { max-height: 13.4em; overflow: hidden; }
.fold { display: block; margin: 2px 0 4px; font-size: 12.5px; }
.att { margin-top: 4px; font-size: 13px; color: var(--ink2); }
.att .sc { font-size: 12.5px; margin-right: 8px; }
.meta-line { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.err { margin: 4px 0 8px; padding-left: 10px; border-left: 2px solid var(--ink); font-size: 14px; }
.think { margin: 0 0 8px; font-size: 13.5px; color: var(--ink2); }
.think summary { cursor: pointer; font-family: var(--sc); letter-spacing: .12em; font-size: 12.5px; list-style: none; }
.think summary::-webkit-details-marker { display: none; }
.think summary::before { content: "▸ "; }
.think[open] summary::before { content: "▾ "; }
.think div { margin-top: 4px; white-space: pre-wrap; font-style: italic; line-height: 1.6; }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--ink); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Tool calls: verb, dotted leader, argument, state. */
.calls { list-style: none; margin: 4px 0 10px; padding: 0; font-size: 14px; }
.calls li > .line { display: flex; align-items: baseline; }
.calls .row { flex: 1; min-width: 0; display: flex; align-items: baseline; padding: 1px 0; background: none; border: 0; text-align: left; }
.calls .v { flex: none; font-family: var(--sc); letter-spacing: .1em; color: var(--ink2); }
.calls .lead { flex: 1; min-width: 18px; margin: 0 8px; border-bottom: 1px dotted var(--ink3); transform: translateY(-4px); }
.calls code { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calls .n { flex: none; margin-left: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); }
.calls .failed .n { color: var(--ink); text-decoration: underline; }
.calls .running .n::after { content: "…"; }
.calls .open { flex: none; margin-left: 8px; padding: 0 2px; background: none; border: 0; color: var(--ink2); font-size: 13px; line-height: 1; }
.calls .open:hover { color: var(--ink); }
.calls pre { margin: 4px 0 8px; padding: 8px 10px; max-height: 320px; overflow: auto; border-left: 1px solid var(--rule); background: var(--wash); white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.55; }

/* A diagram demo told in steps; the map plays it. */
.demo { margin: 6px 0 12px; padding: 8px 12px 10px; border: 1px solid var(--rule); }
.demo .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.demo .hd .sc { font-size: 13px; letter-spacing: .14em; }
.demo ol { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: step; }
.demo li button { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; width: 100%; padding: 2px 0; background: none; border: 0; text-align: left; color: var(--ink2); font-size: 13.5px; line-height: 1.55; }
.demo li button::before { content: attr(data-n); font-family: var(--han); text-align: right; }
.demo li.now button { color: var(--ink); }
.demo li.now button span { text-decoration: underline; text-decoration-color: var(--ink3); text-underline-offset: 4px; }
.demo .sel { font-size: 13.5px; color: var(--ink2); margin-top: 4px; }

.perm { margin: 0 0 16px 66px; padding: 10px 14px 12px; border: 1px solid var(--ink); }
.perm .sc { font-size: 13px; letter-spacing: .14em; color: var(--ink2); }
.perm p { margin: 4px 0 0; font-size: 14.5px; }
.empty { color: var(--ink2); font-size: 14.5px; line-height: 1.7; }
.empty .sc { display: block; font-size: 13px; letter-spacing: .18em; margin-bottom: 4px; }
/* A page with nothing on it yet carries 「落定」 (settle.js): outlined squares, loose at the top, that settle
   into ruled rows. Its sheet is the whole of this pane under the bar, and that is as far as a square that is
   picked up can be thrown; only the squares answer the pointer. Under the drawing only the backend's trouble
   is written. The first words take the page and it fades. */
.body.bare { position: relative; overflow: hidden; }
.blank { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 28px 8vh; color: var(--ink3); font-size: 13px; text-align: center; }
.blank p { flex: none; min-height: 1.5em; margin: 0; overflow-wrap: anywhere; }
.blank.leaving { animation: fade-out .32s ease-in both; }
@keyframes fade-out { to { opacity: 0; } }
.settled { flex: none; color: var(--ink); }
/* touch-action is the sheet's because a shape inside an svg has none of its own; the sheet itself is never the thing touched. */
.settled svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; touch-action: none; }
.settled rect { fill: none; stroke: currentColor; stroke-width: 1; transform-box: fill-box; transform-origin: center; transform: var(--to); pointer-events: all; cursor: grab; }
.settled.held rect { cursor: grabbing; }
.settled.settling rect { animation: settle .56s var(--wait, 0s) cubic-bezier(.3, .7, .2, 1) backwards; }
@keyframes settle { from { transform: var(--from); opacity: 0; } }

/* Composer: what rides along, one box, and nothing else. */
.composer { flex: none; padding: 10px 28px 18px; }
.chips { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; color: var(--ink2); }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 1px 3px 1px 10px; border: 1px solid var(--ink3); border-radius: 999px; color: var(--ink); font-size: 13px; animation: arrive .42s var(--spring) both; }
.chip .k { flex: none; font-family: var(--sc); font-size: 11.5px; letter-spacing: .14em; color: var(--ink2); }
.chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { flex: none; background: none; border: 0; padding: 0 5px; color: var(--ink2); font-size: 14px; line-height: 1.3; }
.chip button:hover { color: var(--ink); }
@keyframes arrive { from { opacity: 0; transform: translateY(5px) scale(.96); } }
.box { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 10px; padding: 10px 9px 8px 14px; border: 1px solid var(--ink3); transition: border-color .2s; }
.box:focus-within { border-color: var(--ink); }
.box textarea { grid-column: 1 / -1; display: block; width: 100%; min-height: 25px; max-height: 40vh; padding: 0; border: 0; background: transparent; font-size: 15.5px; line-height: 25px; resize: none; outline: none; }
.box textarea::placeholder { color: var(--ink3); }
/* The plus and the model on the left, the model may shorten; the buttons on the right never wrap. */
.under { min-width: 0; align-self: center; display: flex; align-items: center; gap: 10px; }
.plusbtn { width: 24px; height: 24px; flex: none; padding: 0; border: 1px solid var(--ink3); border-radius: 50%; background: none; display: grid; place-items: center; color: var(--ink2); }
.plusbtn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; }
.plusbtn:hover, .plusbtn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink); }
.mode { flex: none; font-family: var(--sc); font-size: 12.5px; letter-spacing: .14em; color: var(--ink); }
.box.shell textarea { font-family: var(--mono); font-size: 14px; }
.pickmodel { min-width: 0; max-width: 100%; padding: 0; border: 0; background: none; font-family: var(--sc); font-size: 12.5px; letter-spacing: .08em; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.pickmodel:hover, .pickmodel[aria-expanded="true"] { color: var(--ink); }
.acts { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.sendbtn { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--ink); background: none; display: grid; place-items: center; padding: 0; }
.sendbtn svg, .micbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.sendbtn:hover { background: var(--wash); }
.sendbtn:disabled { opacity: .4; cursor: default; }
.sendbtn .stop { fill: currentColor; stroke: none; }
.micbtn { width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; color: var(--ink2); }
.micbtn:hover { color: var(--ink); background: var(--wash); }
.micbtn.on { color: var(--ink); background: var(--wash); animation: waves 1.1s ease-in-out infinite; }
.box .menu { left: -1px; bottom: calc(100% + 6px); min-width: 250px; max-width: calc(100% + 2px); }
.box .menu.sub { min-width: 150px; max-width: 200px; }
/* What a `/` or an `@` offers: the name to type, and what it does. */
.box .menu.pick { right: -1px; max-width: none; max-height: min(46vh, 340px); }
.pick button { grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 2px 14px; }
.pick .t { min-width: 7.5em; max-width: 26em; font-family: var(--mono); font-size: 13px; }
.pick .r { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 13px; }
.pick .hint { margin: 0; padding: 5px 14px; font-size: 13.5px; color: var(--ink2); }
.chip.loading .nm { color: var(--ink2); }

/* The board and the records behind it: errors, timings, tests. */
.toolbar { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--ink2); }
.toolbar .grow { flex: 1; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.toolbar select { background: var(--bg); border: 0; border-bottom: 1px solid var(--ink3); padding: 0 2px; font-size: 13px; }
.seg { display: inline-flex; gap: 14px; }
.seg button { background: none; border: 0; padding: 1px 0; font-family: var(--sc); letter-spacing: .1em; font-size: 14px; color: var(--ink2); border-bottom: 1px solid transparent; }
.seg button.on { color: var(--ink); border-bottom-color: var(--ink); }
.group-h { font-family: var(--sc); font-size: 12.5px; letter-spacing: .18em; color: var(--ink2); margin: 14px 0 4px; }
.item { border-bottom: 1px dotted var(--ink3); }
.item > .row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; width: 100%; padding: 7px 0; background: none; border: 0; text-align: left; }
.item > .row:hover { background: var(--wash); }
.item .lv { font-family: var(--sc); font-size: 12.5px; letter-spacing: .1em; color: var(--ink2); min-width: 2.6em; }
.item .lv.critical, .item .lv.error { color: var(--ink); font-weight: 700; }
.item .sum { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.item .when { font-family: var(--mono); font-size: 11.5px; color: var(--ink2); white-space: nowrap; }
.item .sub { grid-column: 2 / -1; font-size: 12.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.dismissed .sum { color: var(--ink2); text-decoration: line-through; text-decoration-color: var(--ink3); }
.more { padding: 2px 0 12px; font-size: 13.5px; line-height: 1.65; }
.more dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 14px; margin: 0; }
.more dt { font-family: var(--sc); letter-spacing: .1em; font-size: 12.5px; color: var(--ink2); }
.more dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { font-family: var(--sc); font-weight: 500; letter-spacing: .08em; font-size: 12.5px; color: var(--ink2); text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.data td { padding: 4px 10px 4px 0; border-bottom: 1px dotted var(--rule); vertical-align: top; }
table.data td.num { font-family: var(--mono); font-size: 12px; text-align: right; white-space: nowrap; }
table.data th.num { text-align: right; }
table.data td.mono { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
table.data tr.error td, table.data tr.warn td { color: var(--ink); }
table.data tr.info td, table.data tr.debug td { color: var(--ink2); }
table.data tr.error td:first-child { box-shadow: inset 2px 0 var(--ink); padding-left: 6px; }
.report-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.report-h .big { font-family: var(--sc); font-size: 22px; font-weight: 700; letter-spacing: .1em; }
.report-h .meta { color: var(--ink2); font-size: 13px; }

/* 设置: rows of a name, what it is, and what can be done with it; a small form under each part. */
.set-status { margin: 0; font-size: 13px; color: var(--ink2); }
.set-status:empty { display: none; }
.settings section { margin-bottom: 26px; }
.set { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) auto; align-items: baseline; gap: 2px 14px; padding: 7px 0; border-bottom: 1px dotted var(--ink3); }
.set .nm { min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.set .dt { min-width: 0; font-size: 13px; color: var(--ink2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.set .ct { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.set .fixed { font-family: var(--sc); font-size: 13px; letter-spacing: .1em; color: var(--ink2); }
.set .seg { gap: 12px; }
.set .seg button { font-size: 13.5px; }
.linkbtn:disabled, .seg button:disabled { color: var(--ink3); cursor: default; }
.sub-h { margin: 14px 0 2px; font-size: 12.5px; color: var(--ink2); }
.newform { display: grid; gap: 8px; margin: 12px 0 4px; padding: 10px 14px 12px; border: 1px solid var(--rule); }
.newform > .sc { font-size: 12.5px; letter-spacing: .14em; color: var(--ink2); }
.newform .empty { margin: 0; font-size: 12.5px; }
.newform .actions { display: flex; justify-content: flex-end; }
.field { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); align-items: baseline; gap: 10px; }
.field > span { font-family: var(--sc); font-size: 12.5px; letter-spacing: .08em; color: var(--ink2); }
.field input, .field textarea, .field select { width: 100%; min-width: 0; padding: 3px 0; border: 0; border-bottom: 1px solid var(--ink3); background: transparent; font-size: 14px; outline: none; }
.field select { background: var(--bg); }
.field textarea { resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--ink); }

/* 提案 (proposals.js), laid out as GitHub lays a pull request out: a header with the state and the tabs, then the
   conversation beside a sidebar of reviewers, labels and checks; the files tab takes the whole width. The tab takes
   the whole page: the machine and the room step aside while code is reviewed. */
@media (min-width: 901px) {
  .app[data-tab="proposals"] { grid-template-columns: 0 minmax(0, 1fr); }
  .app[data-tab="proposals"] .left { visibility: hidden; padding: 0; }
  .app[data-tab="proposals"] .right { border-left: 0; }
}
#proposals { padding-left: max(28px, calc((100% - 1280px) / 2)); padding-right: max(28px, calc((100% - 1280px) / 2)); }
.pr-title-sm { font-family: var(--sc); font-size: 18px; letter-spacing: .1em; color: var(--ink); }
.pr-filter { display: flex; gap: 18px; padding: 8px 12px; border-bottom: 1px solid var(--rule); background: var(--wash); }
.pr-filter button { background: none; border: 0; padding: 0; font-size: 13.5px; color: var(--ink2); }
.pr-filter button.on { color: var(--ink); font-weight: 600; }
.pr-list { border: 1px solid var(--rule); }
.pr-list .item:last-child { border-bottom: 0; }
.pr-list .item > .row { padding: 9px 12px; }
.pr-list .empty { padding: 14px 12px; margin: 0; }
.pr-state { display: inline-block; padding: 1px 10px; border: 1px solid var(--ink); border-radius: 999px; font-family: var(--sc); font-size: 12px; letter-spacing: .08em; white-space: nowrap; }
.pr-state.s-open { background: var(--ink); color: var(--bg); }
.pr-state.s-closed { border-color: var(--ink3); color: var(--ink2); }
.pr-mark { margin-left: 8px; font-size: 12px; }
.ck-mark { display: inline-block; width: 1.2em; text-align: center; font-weight: 700; }
.ck-mark.c-success { color: var(--ink); }
.ck-mark.c-failure, .ck-mark.c-error { color: var(--ink); font-weight: 900; }
.ck-mark.c-pending, .ck-mark.c-neutral { color: var(--ink3); }
.pr-head { padding-bottom: 0; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
/* A member's title in the face it was typed in: the small-caps face would change the case of what they wrote. */
.pr-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.pr-n { color: var(--ink3); font-weight: 400; }
.pr-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink2); }
.pr-meta code { padding: 0 5px; background: var(--wash); font-size: 12px; overflow-wrap: anywhere; }
.pr-tabs { display: flex; gap: 4px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; }
.pr-tabs button { padding: 7px 14px; background: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; font-family: var(--sc); font-size: 14px; letter-spacing: .08em; color: var(--ink2); white-space: nowrap; }
.pr-tabs button.on { color: var(--ink); border-color: var(--rule); background: var(--bg); }
.pr-tabs .n { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--wash); font-family: var(--mono); font-size: 11px; letter-spacing: 0; }
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.pr-side section { padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); }
.pr-side h3 { margin: 0 0 8px; font-family: var(--sc); font-weight: 500; font-size: 12.5px; letter-spacing: .14em; color: var(--ink2); }
.side-row { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 2px 0; background: none; border: 0; text-align: left; font-size: 13.5px; }
.side-row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-check:hover .who { text-decoration: underline; text-decoration-color: var(--ink3); text-underline-offset: 3px; }
.side-note { font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere; }
.side-label { display: grid; gap: 3px; margin-bottom: 6px; }
.label { justify-self: start; display: inline-block; padding: 0 8px; border: 1px solid var(--ink2); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.rv { font-size: 12.5px; color: var(--ink2); }
.rv.rv-APPROVED, .rv.rv-REQUEST_CHANGES { color: var(--ink); font-weight: 600; }
/* The conversation: one rule down the left, entries hung on it. */
.timeline { position: relative; padding-left: 18px; border-left: 1px solid var(--rule); margin-left: 8px; }
.tl { position: relative; margin: 0 0 16px; }
.tl::before { content: ""; position: absolute; left: -23px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink2); }
.tl-box { border: 1px solid var(--rule); }
.tl-box > .tl-h { padding: 7px 12px; border-bottom: 1px solid var(--rule); background: var(--wash); }
.tl-box > .txt, .tl-box > .empty, .tl-box > .tl-line { padding: 4px 14px; font-size: 14.5px; line-height: 1.68; overflow-wrap: anywhere; }
.tl-box > .empty { margin: 8px 0; }
.tl-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink2); }
.tl-h b { color: var(--ink); font-weight: 600; }
.tl-h code { font-size: 11.5px; }
.tl-at { font-family: var(--mono); font-size: 11.5px; }
.tl-old { font-size: 12px; color: var(--ink3); }
.tl-small > .tl-h { padding: 4px 0; }
.tl-commits { list-style: none; margin: 2px 0 0; padding: 0; font-size: 13px; }
.tl-commits li { padding: 1px 0; overflow-wrap: anywhere; }
.tl-commits code { font-size: 11.5px; color: var(--ink2); }
.tl-review.rv-REQUEST_CHANGES::before, .tl-review.rv-APPROVED::before { background: var(--ink); border-color: var(--ink); }
.tl-folded > .tl-h { border-bottom: 0; }
.tl-line { border-top: 1px dotted var(--rule); }
.tl-line > code { font-size: 11.5px; color: var(--ink2); }
.mergebox { margin: 6px 0 18px 8px; border: 1px solid var(--ink2); }
.mb-row { display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.mb-row > div { flex: 1; min-width: 0; }
.mb-foot { padding: 12px 14px; }
.mb-foot .newform { margin: 0; }
.mb-actions { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--ink2); }
.comment-box { display: grid; gap: 8px; margin: 0 0 24px 8px; padding: 10px 14px 12px; border: 1px solid var(--rule); }
.cb-h { font-family: var(--sc); font-size: 12.5px; letter-spacing: .14em; color: var(--ink2); }
.comment-box textarea, .lineform textarea, .sheet textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--rule); background: transparent; font-family: var(--mono); font-size: 13px; line-height: 1.6; resize: vertical; }
.comment-box .actions, .lineform .actions { justify-content: flex-end; align-items: baseline; gap: 14px; margin-top: 0; }
.pr-commits { border: 1px solid var(--rule); }
.cm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.cm-row:last-child { border-bottom: 0; }
.cm-msg { font-size: 14px; overflow-wrap: anywhere; }
.cm-row > code { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 12px; color: var(--ink2); }
.checks { border: 1px solid var(--rule); }
.ck { border-bottom: 1px solid var(--rule); }
.ck:last-child { border-bottom: 0; }
.ck-h { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 12px; background: none; border: 0; text-align: left; font-size: 14px; }
.ck-h:hover { background: var(--wash); }
.ck-h .grow { flex: 1; }
.ck-out { padding: 2px 14px 10px 38px; font-size: 13.5px; line-height: 1.65; overflow-wrap: anywhere; }
.ck-proof { margin-top: 16px; font-size: 13.5px; line-height: 1.65; }
.fbar { position: sticky; top: -18px; z-index: 3; display: flex; align-items: baseline; gap: 14px; padding: 8px 0; margin-bottom: 10px; background: var(--bg); border-bottom: 1px solid var(--rule); }
.fbar .grow, .file-h .grow { flex: 1; }
.fgrid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.ftree { position: sticky; top: 30px; max-height: calc(100vh - 160px); overflow: auto; display: grid; font-size: 12.5px; font-family: var(--mono); }
.ftree button { display: flex; gap: 6px; padding: 3px 6px; background: none; border: 0; text-align: left; overflow-wrap: anywhere; color: var(--ink); }
.ftree button:hover { background: var(--wash); }
.ftree button.seen { color: var(--ink2); }
.sure { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0; font-size: 14px; }
.empty.error { color: var(--ink); }
.file { margin: 0 0 14px; border: 1px solid var(--rule); scroll-margin-top: 50px; }
.file-h { display: flex; align-items: baseline; gap: 10px; padding: 5px 10px; border-bottom: 1px solid var(--rule); background: var(--wash); font-family: var(--mono); font-size: 12px; }
.file-h .cut { color: var(--ink2); }
.file .scroll { overflow-x: auto; padding-top: 4px; }
.file-h .fold { width: 1.4em; padding: 0; background: none; border: 0; color: var(--ink2); }
.file-h .fname { overflow-wrap: anywhere; }
.viewed { display: inline-flex; align-items: center; gap: 5px; font-family: var(--serif); font-size: 12.5px; white-space: nowrap; }
.file.seen .file-h { color: var(--ink2); }
.file .code .no { cursor: pointer; }
.threads { position: sticky; left: 0; width: min(100%, 860px); padding: 6px 10px 6px calc(4.6ch + 10px); font-family: var(--serif); white-space: normal; }
.thread { margin: 0 0 6px; padding: 6px 12px; border: 1px solid var(--rule); background: var(--bg); font-size: 13.5px; line-height: 1.6; }
.thread.finding { border-left: 3px solid var(--ink2); }
.thread.pending { border-style: dashed; }
.th-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; font-size: 13px; color: var(--ink2); }
.th-h b { color: var(--ink); }
.sev { font-family: var(--mono); font-size: 11.5px; padding: 0 5px; border: 1px solid var(--ink3); }
.sev-high { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.lineform { display: grid; gap: 6px; }
.choice { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 8px; font-size: 14px; }
.choice.off { opacity: .45; }
@media (max-width: 900px) {
  .pr-grid, .fgrid { grid-template-columns: minmax(0, 1fr); }
  .ftree { position: static; max-height: 30vh; }
}
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: var(--wash); }
.sheet > .newform { width: min(40em, 100%); max-height: 90vh; overflow: auto; margin: 0; background: var(--bg); }
.newform .actions { gap: 14px; align-items: baseline; }

/* Narrow: one view at a time. The machine becomes the first view in the bar,
   and Yu Yue keeps a strip above the others (companion.css). */
.tab[data-tab="screen"] { display: none; }
@media (max-width: 900px) {
  .app { display: flex; flex-direction: column; }
  .left, .right { display: contents; }
  .tab[data-tab="screen"] { display: block; }
  .topbar { order: 0; padding: 0 10px 0 16px; }
  .app .machine { order: 1; align-self: stretch; width: auto; margin: 14px 12px 0; }
  .app .yard { order: 2; align-self: stretch; width: auto; margin: 0 12px; }
  .panel { order: 3; }
  .app:not([data-tab="screen"]) .machine { display: none; }
  .app:not([data-tab="screen"]) .yard { order: 1; }
  .body, .composer, .drawer { padding-left: 16px; padding-right: 16px; }
  .composer { padding-bottom: 14px; }
  .perm { margin-left: 0; }
}
@media (max-width: 560px) {
  .topbar { gap: 4px; padding: 0 8px 0 14px; }
  .tabs { gap: 12px; }
  .tab { font-size: 15px; letter-spacing: .06em; }
  .tab .n { margin-left: 3px; }
  .iconbtn { width: 30px; height: 30px; }
  .pair { margin-left: 4px; gap: 5px; }
  .roundbtn { width: 31px; height: 31px; }
  .say { grid-template-columns: minmax(0, 1fr); }
  .set { grid-template-columns: minmax(0, 1fr) auto; }
  .set .dt { grid-column: 1 / -1; grid-row: 2; }
  .field { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .say .who { text-align: left; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .caret, .chip, .micbtn.on, #sound.speaking .waves, .settled.settling rect, .blank.leaving { animation: none; }
  /* With no motion there is nothing to pick up: the drawing is a drawing. */
  .settled rect { pointer-events: none; }
}

.shared { max-width: 48rem; margin: 8vh auto; padding: 1.5rem; }
.shared p { white-space: pre-wrap; overflow-wrap: anywhere; }
