/* The list pages. Colours come from the chosen skin (terminal/skins.js sets them on :root); these are the default skin's, for the first frame. */
:root { --bg: #fbfbfc; --panel: #f0f1f4; --raised: #e4e6eb; --line: #d5d8df; --ink: #2b2f3a; --muted: #666b78; --accent: #2f6fe4; --on-accent: #ffffff; --good: #3d8a3a; --busy: #a36a00; --bad: #c93c37; color-scheme: light; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { font-size: 15.5px; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
/* the list page ends above its tabs */
#home { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; border: 0; background: none; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: default; }
svg { display: block; }

/* ---- sign in */
#login { display: grid; min-height: 100vh; place-items: center; }
#login form { width: min(100%, 340px); display: grid; gap: 10px; }
#login h1 { font-size: 1.6rem; }
#login p { color: var(--muted); }
#login label { font-size: .85rem; color: var(--muted); margin-top: 10px; }
#login-error { color: var(--bad); min-height: 1.5em; }
.mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 6px; background: linear-gradient(135deg, var(--raised), var(--panel)); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
input:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: inherit; font: inherit; line-height: 1.5; resize: none; }
button.solid { min-height: 48px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
button.quiet { min-height: 44px; border-radius: 12px; color: var(--muted); }
button.quiet:active { background: var(--raised); color: var(--ink); }
button.wide { width: 100%; margin-top: 8px; border: 1px dashed var(--line); }

/* ---- top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; margin: 0 -16px; padding: 8px 10px 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top .who { flex: 1; min-width: 0; }
.top h1 { font-size: 1.35rem; font-weight: 700; line-height: 1.25; letter-spacing: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* the name of a tab stands large, as the first thing on its page */
.top.large { padding-top: 12px; }
.top.large h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.top.large #device { margin-top: 3px; }
#device { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .83rem; line-height: 1.4; }
#dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
#dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 24%, transparent); }
#dot.off { background: var(--bad); }
.icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon:active { background: var(--raised); color: var(--ink); }
#back { margin-left: -10px; }
#new-task { color: var(--accent); }

/* ---- loading, notices */
#loading { display: grid; gap: 10px; margin-top: 18px; }
#loading i { display: block; height: 68px; border-radius: 16px; background: linear-gradient(100deg, var(--panel) 40%, var(--raised) 50%, var(--panel) 60%); background-size: 200% 100%; animation: shine 1.3s linear infinite; }
#loading i:first-child { height: 96px; }
@keyframes shine { to { background-position: -200% 0; } }
.notice { margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 9%, var(--panel)); }
.notice b { display: block; margin-bottom: 2px; }
.notice span { color: var(--muted); font-size: .9rem; }

/* ---- sections and cards */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 10px; }
.section-head h2 { font-size: .95rem; font-weight: 700; }
.section-head p { color: var(--muted); font-size: .8rem; text-align: right; }
.section-head[data-fold] { cursor: pointer; user-select: none; }
.section-head[data-fold] h2 { margin-right: auto; }
.section-head[data-fold]::after { content: "⌄"; color: var(--muted); font-size: 1.1rem; line-height: 1; transition: transform .15s ease; }
.section-head[data-fold].folded::after { transform: rotate(-90deg); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
/* what lies on the page is lifted off it a little */
#home .card:not(.add), .tile, .panel, #home .group, .acts button, #launch button, #project-files { box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 6px 18px -10px rgb(0 0 0 / .12); }
.card > button.open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; text-align: left; min-height: 64px; }
.card > button.open:active { background: var(--raised); }
/* ending a terminal: a quiet disc beside the card's text, with room around it for a thumb */
.card > button.side { position: relative; flex: none; align-self: center; width: 36px; height: 36px; margin: 0 12px 0 0; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--muted); }
.card > button.side::after { content: ""; position: absolute; inset: -6px; }
.card > button.side:active { background: color-mix(in srgb, var(--bad) 20%, var(--raised)); color: var(--bad); }
.card > button.side.say { margin-right: 8px; }
.card > button.side.say:active { background: color-mix(in srgb, var(--accent) 20%, var(--raised)); color: var(--accent); }
.card .text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.card b { font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .8rem; line-height: 1.3; min-width: 0; }
.card .meta span { white-space: normal; overflow-wrap: anywhere; }
.card .meta .pill, .card .meta .chip { white-space: nowrap; }
.card .peek { color: var(--muted); font-size: .8rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.card .chev { color: var(--muted); opacity: .6; flex: none; }
.card.add { border-style: dashed; background: transparent; }
.card.add button.open { justify-content: center; color: var(--muted); min-height: 56px; }

/* the tool a terminal runs */
.tool { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--tint, var(--accent)) 16%, var(--bg)); color: var(--tint, var(--accent)); }
.tool.claude { --tint: #d98a5f; }
.tool.codex { --tint: var(--accent); }
.tool.shell { --tint: var(--good); }
.tool.folder, .tool.plain { --tint: var(--muted); }

/* what a task is doing: one colour each */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.pill.busy { --c: var(--busy); }
.pill.busy::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.confirm { --c: var(--bad); }
.pill.done, .pill.waiting { --c: var(--good); }
.pill.stopped { --c: var(--muted); }
.pill.idle { --c: var(--muted); }
.pill.starting, .pill.pc { --c: var(--accent); }
.pill.locked { --c: var(--muted); }
.pill.ended { --c: var(--muted); background: transparent; padding-left: 0; }
.pill.failed { --c: var(--bad); background: transparent; padding-left: 0; }
@keyframes pulse { 50% { opacity: .35; } }
.card.confirm { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.card.done { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.chip { padding: 2px 8px; border-radius: 7px; background: var(--raised); color: var(--ink); font-size: .76rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.count { display: inline-flex; align-items: center; gap: 4px; }
.count i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

/* ---- one project */
#project-files { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 8px; padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-align: left; }
#project-files:active { background: var(--raised); }
#project-files .tool { --tint: var(--accent); }
#project-files .text { flex: 1; min-width: 0; display: grid; gap: 1px; }
#project-files b { font-weight: 600; }
#project-files .chev { color: var(--muted); opacity: .6; }
#project-path { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
/* a new conversation in the project: the two kinds, and a button for each tool of the one that stands open */
#begin .section-head { margin-top: 20px; align-items: center; }
#begin .none { color: var(--muted); font-size: .9rem; }
#launch { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
#launch button, #sheet-form .tools button { display: grid; justify-items: center; gap: 8px; padding: 14px 6px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); font-size: .84rem; font-weight: 600; line-height: 1.25; text-align: center; }
#launch button:active { background: var(--raised); }
#launch button:disabled { opacity: .5; }
#search { margin-bottom: 8px; min-height: 44px; }

/* ---- finding: one search over everything, and a row of what to tell things apart by */
#find { margin-top: 14px; display: grid; gap: 10px; }
#query { min-height: 44px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 1px 1px 3px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: .84rem; white-space: nowrap; }
.filters button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.filters i { flex: none; width: 1px; margin: 7px 2px; background: var(--line); }
#nothing { color: var(--muted); margin-top: 26px; text-align: center; }
/* on 任务 the projects are listed only where a search names them */
#home[data-tab="tasks"][data-finding="no"] #projects { display: none; }
/* under its own tab the list of projects needs no second heading */
#home[data-tab="projects"] #projects .section-head { display: none; }
#home[data-tab="projects"] #projects { margin-top: 16px; }
.hint { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 22px; }
/* a held press on a card asks what to do with it: its text is not picked up as a selection instead */
.card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.card b .pin { display: inline-block; vertical-align: -1px; margin-right: 5px; color: var(--accent); }
.card b .pin svg { display: block; }
/* the folder of a conversation that is open outside every project */
.chip.apart { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
#empty { color: var(--muted); margin-top: 30px; text-align: center; }

/* ---- sheet from the bottom, toast */
dialog { width: 100%; max-width: 560px; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--panel); color: var(--ink); max-height: 86vh; }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog[open] { animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
#sheet-form { display: grid; gap: 10px; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto; }
#sheet-form::before { content: ""; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
#sheet-form h3 { font-size: 1.1rem; }
#sheet-form > p { color: var(--muted); font-size: .9rem; }
#sheet-form label { font-size: .82rem; color: var(--muted); margin-bottom: -4px; }
#sheet-form input, #sheet-form select { background: var(--bg); }
#sheet-form select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; }
#sheet-form select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* a message for a conversation that is open on the computer, written under what was said there */
#sheet-form .write { display: flex; gap: 8px; align-items: flex-end; }
#sheet-form .write textarea { flex: 1; min-width: 0; min-height: 46px; }
#sheet-form .write button { flex: none; min-height: 46px; padding: 0 18px; }
#sheet-form .below { display: grid; gap: 10px; }
#sheet-form .below:empty, #sheet-form > p:empty, #sheet-form > div:empty { display: none; }
/* the window of a conversation: it fills the screen; what was said takes all the room the heading and the box leave */
dialog.window { max-width: none; width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; background: var(--bg); animation: none; }
dialog.window #sheet-form { height: 100%; max-height: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-auto-rows: auto; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom)); }
dialog.window #sheet-form::before { display: none; }
dialog.window .bar { display: flex; align-items: center; gap: 6px; min-width: 0; }
dialog.window .bar .type, dialog.window .bar .files, dialog.window .bar .take, dialog.window .bar .hand { flex: none; min-width: 44px; min-height: 44px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: .95rem; }
dialog.window .bar .files[hidden], dialog.window .bar .take[hidden], dialog.window .bar .hand[hidden] { display: none; }
dialog.window .bar .files svg, dialog.window .bar .take svg, dialog.window .bar .hand svg { width: 21px; height: 21px; }
dialog.window .bar { gap: 2px; }
dialog.window .reading { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: .86rem; color: var(--muted); }
dialog.window .reading[hidden] { display: none; }
dialog.window .reading > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.window .reading button.solid { min-height: 42px; padding: 0 14px; }
dialog.window .reading .pick { display: flex; gap: 4px; padding: 3px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); }
dialog.window .reading .pick button { flex: 1; min-height: 34px; border-radius: 8px; color: var(--muted); font-size: .86rem; white-space: nowrap; }
dialog.window .reading .pick button[aria-pressed="true"] { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
dialog.window .bar .who { flex: 1; min-width: 0; }
dialog.window .bar h3 { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.window .bar .stands { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet-form .control-mode { margin: 2px 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--panel); font-size: .78rem; line-height: 1.35; }
#sheet-form .control-mode.shared { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
#sheet-form .control-mode.saved { border-style: dashed; }
dialog.window .phone-delivery { display: block; margin-top: 5px; color: var(--muted); font-size: .73rem; }
dialog.window #sheet-form .said { max-height: none; min-height: 0; height: 100%; border: 0; background: transparent; padding: 6px 2px; }
/* what was said fills what is left of the window; over its lower edge, the way back to what was said last */
dialog.window .reads { position: relative; min-height: 0; }
dialog.window .reads .latest { position: absolute; right: 6px; bottom: 8px; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: .84rem; font-weight: 600; box-shadow: 0 4px 14px rgb(0 0 0 / .14); }
dialog.window .reads .latest[hidden] { display: none; }
/* how it stands, in one line above the box: at work and for how long, asking, waiting, stopped */
dialog.window .state { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px 0 6px; font-size: .86rem; color: var(--muted); }
dialog.window .state .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: .55; }
dialog.window .state .standing { font-weight: 600; color: var(--ink); }
dialog.window .state .clock { font-variant-numeric: tabular-nums; }
dialog.window .state.busy .dot { background: var(--busy, #c98a1b); opacity: 1; animation: working 1.2s ease-in-out infinite; }
dialog.window .state.confirm .dot { background: var(--bad); opacity: 1; }
dialog.window .state.waiting .dot { background: var(--good); opacity: 1; }
dialog.window .state .end { margin-left: auto; flex: none; min-height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); color: var(--bad); font-size: .86rem; font-weight: 600; background: transparent; }
dialog.window .state .end[hidden] { display: none; }
/* the two stand together at the right: stopping what it is at, then ending it */
dialog.window .state .end.halt:not([hidden]) + .end { margin-left: 8px; }
@keyframes working { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.window .state.busy .dot { animation: none; } }
#sheet-form .said .earlier { margin: 0 0 4px; text-align: center; color: var(--muted); font-size: .8rem; }
dialog.window .write .go { flex: none; min-height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; }
dialog.window .write .go[hidden] { display: none; }
dialog.window .confirm { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); font-size: .9rem; }
dialog.window .confirm p { margin: 0; }
dialog.window .confirm .answers { display: flex; gap: 8px; }
dialog.window .confirm .answers button { flex: 1; min-height: 42px; border-radius: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--raised); }
dialog.window .confirm .answers .no { color: var(--bad); }
/* what was last said in a conversation that is open on the computer */
#sheet-form .said { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; padding: 14px 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); overscroll-behavior: contain; font-family: var(--read-font, inherit); font-size: var(--read-size, .93rem); line-height: var(--read-line, 1.65); }
#sheet-form .said .turn { display: grid; gap: 4px; min-width: 0; }
#sheet-form .said .turn > b { font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
#sheet-form .said .turn.user { align-self: flex-end; max-width: 88%; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
#sheet-form .said .plain { white-space: pre-wrap; overflow-wrap: anywhere; }
#sheet-form .said .turn.going { opacity: .55; }
/* what waits for the conversation can be taken back, row by row; what was held at a stop is sent after all by one press */
#sheet-form .said .turn.mine button { justify-self: end; min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: .78rem; }
#sheet-form .said .held { align-self: flex-end; }
#sheet-form .said .held button { min-height: 34px; padding: 0 14px; border-radius: 10px; font-size: .86rem; }
#sheet-form .said .turn.thought .plain { color: var(--muted); font-size: .92em; }
#sheet-form .said .md { overflow-wrap: anywhere; min-width: 0; }
#sheet-form .said .md > :first-child { margin-top: 0; }
#sheet-form .said .md > :last-child { margin-bottom: 0; }
#sheet-form .said .md p, #sheet-form .said .md ul, #sheet-form .said .md ol, #sheet-form .said .md pre, #sheet-form .said .md blockquote, #sheet-form .said .md .wide { margin: 0 0 .6em; }
#sheet-form .said .md h1, #sheet-form .said .md h2, #sheet-form .said .md h3, #sheet-form .said .md h4 { margin: .9em 0 .35em; font-size: 1em; font-weight: 700; line-height: 1.4; }
#sheet-form .said .md h1, #sheet-form .said .md h2 { font-size: 1.06em; }
#sheet-form .said .md ul, #sheet-form .said .md ol { padding-left: 1.35em; }
#sheet-form .said .md li { margin: .15em 0; }
#sheet-form .said .md li > p { margin: 0; }
#sheet-form .said .md code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; padding: .1em .35em; border-radius: 5px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
#sheet-form .said .md pre { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow-x: auto; line-height: 1.5; }
#sheet-form .said .md pre code { padding: 0; background: none; font-size: .82em; white-space: pre; }
#sheet-form .said .md blockquote { padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
#sheet-form .said .md hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
#sheet-form .said .md .wide { overflow-x: auto; }
#sheet-form .said .md table { border-collapse: collapse; font-size: .88em; white-space: nowrap; }
#sheet-form .said .md th, #sheet-form .said .md td { padding: 4px 10px; border: 1px solid var(--line); text-align: left; }
#sheet-form .said .md th { background: color-mix(in srgb, var(--ink) 6%, transparent); font-weight: 600; }
#sheet-form .said .md strong { font-weight: 700; }
/* nothing here is wider than the window: a command or a path without a space is broken where it must be */
#sheet-form .said details.did { min-width: 0; padding: 6px 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; }
#sheet-form .said details.did summary { cursor: pointer; font-weight: 600; list-style: none; }
#sheet-form .said details.did summary::-webkit-details-marker { display: none; }
#sheet-form .said details.did summary::after { content: " ›"; }
#sheet-form .said details.did[open] summary::after { content: ""; }
#sheet-form .said details.did ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
#sheet-form .said details.did ul { gap: 7px; }
#sheet-form .said details.did li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
#sheet-form .said details.did li .what { color: var(--ink); opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sheet-form .said details.did li .ran { font: inherit; padding: 0; background: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
#sheet-form .said details.did li .got { margin: 0; padding: 4px 8px; border-radius: 7px; background: color-mix(in srgb, var(--ink) 5%, transparent); font: inherit; font-size: .94em; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 11.4em; overflow: hidden; line-height: 1.5; }
#sheet-form p.quiet { color: var(--muted); font-size: .8rem; text-align: center; }
#sheet-form button.choice { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); text-align: left; line-height: 1.35; }
#sheet-form button.choice.solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; justify-content: center; }
#sheet-form button.choice.danger { color: var(--bad); justify-content: center; font-weight: 600; }
#sheet-form button.choice small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; overflow-wrap: anywhere; }
#sheet-form button.choice.solid small { color: inherit; opacity: .85; }
#sheet-form button.choice.solid span { text-align: center; }
#sheet-form button.cancel { min-height: 46px; color: var(--muted); border-radius: 14px; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatches button { display: grid; gap: 6px; padding: 8px; border: 2px solid transparent; border-radius: 14px; background: var(--raised); font-size: .8rem; }
.swatches button[aria-pressed="true"] { border-color: var(--accent); }
.swatches i { display: flex; align-items: flex-end; gap: 4px; height: 44px; padding: 7px; border-radius: 9px; border: 1px solid rgba(128, 128, 128, .3); }
.swatches i span { width: 10px; border-radius: 3px; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); }
.sizes button { min-height: 40px; border-radius: 10px; color: var(--muted); }
.sizes button[aria-pressed="true"] { background: var(--raised); color: var(--ink); font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: min(88vw, 480px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); text-align: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* a question answered from the list, and a terminal started without walking to its project */
.card .ask { flex: 0 0 100%; min-width: 0; display: grid; gap: 8px; padding: 0 12px 12px; }
.card .ask pre { margin: 0; padding: 10px 12px; max-height: 190px; overflow: auto; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font: 12px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; }
.card .ask .answers { display: flex; gap: 8px; }
.card .ask .answers button { flex: 1; min-height: 42px; border-radius: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--raised); }
.card .ask .answers .yes { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.card .ask .answers .no { color: var(--bad); }
.card .ask .answers .see { flex: 0 0 auto; padding: 0 14px; font-weight: 500; color: var(--muted); }
/* a request that only the computer can answer: said where the two buttons would be */
.card .ask .answers .there { flex: 1; align-self: center; color: var(--muted); font-size: .85rem; }
.card.asking { flex-wrap: wrap; }
.card.asking > .open { flex: 1 1 0; min-width: 0; }
.card .ask .answers button { white-space: nowrap; }
#sheet-form .anywhere { display: grid; gap: 6px; max-height: 56vh; overflow-y: auto; }
#sheet-form .anywhere.folders { max-height: 38vh; grid-auto-rows: max-content; }
#sheet-form .anywhere.folders button.choice { height: auto; }
/* the sheet of a new conversation: its title beside the two kinds, the tools of the kind (one stays chosen), the projects */
#sheet-form .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; }
#sheet-form .tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
#launch:has(> button:nth-child(4)), #sheet-form .tools:has(> button:nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#sheet-form .tools button { background: var(--raised); padding: 12px 6px 10px; }
#sheet-form .tools button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#sheet-form .anywhere button.choice > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#sheet-form .anywhere button.choice .tool { width: 34px; height: 34px; border-radius: 10px; }
#sheet-form .anywhere button.choice .chev { flex: none; display: grid; color: var(--muted); opacity: .6; }

/* ---- a group of rows under its title */
.group-title { margin: 26px 4px 8px; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.group { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.group > li + li { border-top: 1px solid var(--line); }
.group.pad { display: grid; gap: 10px; padding: 14px; }
.group.pad .label { margin: 4px 0 -4px; font-size: .82rem; color: var(--muted); }
.group.last { margin-top: 26px; }
.group-note { margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: .88rem; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; width: 100%; min-height: 58px; padding: 10px 14px; text-align: left; }
button.row:active { background: var(--raised); }
button.row:disabled { opacity: 1; cursor: default; }
.row .text { flex: 1 1 10rem; min-width: 0; display: grid; gap: 2px; }
.row .text b { font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .text small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.row .value { flex: none; color: var(--muted); font-size: .86rem; }
.row .act { flex: none; color: var(--accent); font-size: .9rem; font-weight: 600; }
.row.danger .text b { color: var(--bad); }
.row .tool { width: 36px; height: 36px; border-radius: 11px; }
.row .chev { flex: none; display: grid; color: var(--muted); opacity: .6; }
.row .chev svg { width: 18px; height: 18px; }

/* ---- the tabs at the foot: where one is, and the way to the other three */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 5px max(10px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px); }
#tabs .inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 560px; margin: 0 auto; }
#tabs button { position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 52px; border-radius: 14px; color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.3; }
#tabs button:active { background: var(--raised); }
#tabs button[aria-current="page"] { color: var(--accent); }
#tabs button[aria-current="page"] svg { stroke-width: 2.25; }
/* how many wait for an answer, on the tab they are on */
#tab-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .66rem; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; }
/* while something is typed the keyboard has the foot of the screen */
body.typing #tabs { display: none; }
/* what is said for a moment stands above the tabs, not on them */
#tabs:not([hidden]) ~ #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
body.typing #tabs ~ #toast { bottom: calc(26px + env(safe-area-inset-bottom)); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { #tabs { background: var(--bg); } }

/* ---- a page with nothing on it yet, and what to do first */
.blank { display: grid; justify-items: center; gap: 14px; margin-top: 56px; color: var(--muted); }
.blank .solid { padding: 0 22px; }
.notice.plain { border-color: var(--line); background: var(--panel); }
.skeleton { display: grid; gap: 10px; margin-top: 26px; }
.skeleton i { display: block; height: 84px; border-radius: 18px; background: linear-gradient(100deg, var(--panel) 40%, var(--raised) 50%, var(--panel) 60%); background-size: 200% 100%; animation: shine 1.3s linear infinite; }
.skeleton i:first-child { height: 176px; }

/* ---- 协作: the two things done at once, and the cards of what is kept */
.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.acts button { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); font-weight: 600; line-height: 1.3; text-align: left; }
.acts button:active { background: var(--raised); }
.acts .tool { --tint: var(--accent); }
.collaboration-actions button { align-items: flex-start; gap: 9px; }
.collaboration-actions .tool { width: 24px; height: 24px; flex: none; }
.collab-action { display: grid; gap: 5px; min-width: 0; }
.collab-action b { font-size: .94rem; }
.collab-action small { color: var(--muted); font-size: .76rem; font-weight: 400; line-height: 1.5; }
.collab-context { margin-block: 12px 22px; }
#together .hint { text-align: left; }
.collab-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.collab-presets button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-size: .86rem; }
.collab-help { color: var(--muted); font-size: .86rem; }
.collab-help summary { cursor: pointer; min-height: 44px; padding-block: 10px; }
#together .hint, #together .meta, #together .peek, #together .section-head p, .collab-action small, .collab-help, #sheet-form .collab-help .hint, #sheet-form .collab-intro { color: color-mix(in srgb, var(--muted) 85%, var(--ink)); }
#together .notice button { min-height: 44px; align-self: start; color: var(--accent); text-align: left; }
#sheet-form .field.text-field { flex-direction: column; align-items: stretch; padding: 8px 0 0; gap: 8px; }
#sheet-form .text-field textarea { width: 100%; margin: 0; }
.card .meta .failed, #sheet-form .failed { color: var(--bad); }
/* in a sheet: rows of what is chosen, a few choices side by side, a list to tick, and what the computer refused */
.fields { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; }
.field { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 6px 0 14px; }
.field + .field { border-top: 1px solid var(--line); }
.field.chain-instructions { flex-direction: column; align-items: stretch; padding: 8px 0 0; gap: 8px; }
.field.chain-instructions textarea { width: 100%; margin: 0; }
.field.chain-rounds { flex-wrap: wrap; padding-block: 8px; }
#sheet-form .field > span:first-child { flex: none; margin: 0; color: var(--ink); font-size: .92rem; }
#sheet-form .field select, #sheet-form .field input { flex: 1; min-width: 0; min-height: 48px; padding: 0 8px; border: 0; border-radius: 0; background: transparent; color: var(--muted); text-align: right; text-align-last: right; }
#sheet-form .field .seg, #sheet-form .field .flip { margin-left: auto; margin-right: 8px; }
.seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.seg button { min-width: 40px; min-height: 34px; padding: 0 11px; border-radius: 8px; color: var(--muted); font-size: .86rem; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.flip { flex: none; position: relative; width: 52px; height: 30px; border-radius: 15px; border: 1px solid var(--line); background: var(--raised); transition: background .15s; }
.flip::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.flip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.flip[aria-checked="true"]::after { transform: translateX(22px); background: var(--on-accent); }
.checks { display: grid; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
#sheet-form .check { display: flex; align-items: center; gap: 12px; min-height: 56px; margin: 0; padding: 8px 14px; color: var(--ink); font-size: 1rem; }
.check + .check { border-top: 1px solid var(--line); }
#sheet-form .check input { flex: none; width: 22px; min-height: 22px; height: 22px; padding: 0; accent-color: var(--accent); }
.check .text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.check b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check em { flex: none; max-width: 45%; color: var(--muted); font-size: .8rem; font-style: normal; text-align: right; }
.check em.ok { color: var(--good); font-weight: 600; }
#sheet-form .problem { color: var(--bad); font-size: .88rem; }

/* ---- 我的: figures in tiles, the days as bars, shares as lines */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { display: grid; gap: 2px; min-width: 0; padding: 14px 16px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.tile > span, .sums span { color: var(--muted); font-size: .8rem; }
.tile b { font-size: 1.75rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b small, .sums b small { font-size: .5em; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.tile b.none, .sums b.none { font-size: 1.15rem; line-height: 1.9; color: var(--muted); }
.tile > small { min-height: 1.4em; color: var(--muted); font-size: .76rem; }
.panel { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.panel + .panel { margin-top: 8px; }
.panel.none { color: var(--muted); text-align: center; }
.section-head .seg { margin: -6px 0; }
.sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
.sums div { display: grid; gap: 1px; min-width: 0; }
.sums b { font-size: 1.2rem; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sums b small { font-size: .62em; }
.chart-head { display: grid; gap: 12px; margin-bottom: 14px; }
.chart-head .seg { display: flex; }
.chart-head .seg button { flex: 1; }
.chart .at { font-weight: 600; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 132px; }
.bars.many { gap: 3px; }
.bars.hours { gap: 3px; height: 72px; }
.bars .day { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0; }
.bars .day i, .bars.hours i { display: block; flex: 1; min-height: 3px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 34%, var(--panel)); }
.bars.many .day i, .bars.hours i { border-radius: 3px 3px 1px 1px; }
.bars .day[aria-pressed="true"] i { background: var(--accent); }
.axis { display: flex; gap: 8px; margin-top: 7px; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.axis span { flex: 1; min-width: 0; text-align: center; }
.axis.few { justify-content: space-between; }
.axis.few span { flex: none; }
.shares { list-style: none; display: grid; gap: 14px; }
.shares .line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shares b { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shares span { flex: none; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.track { height: 6px; margin-top: 7px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
#me .hint { margin-top: 18px; }
#computer .row .text { flex: none; }
#computer .row .value { flex: 1; min-width: 0; text-align: right; }
.answers { flex-wrap: wrap; }
.answers .there { white-space: normal; }
.approval-rule { flex-basis: 100%; padding: 10px 0 0; border-top: 1px solid var(--line); }
.approval-rule p { overflow-wrap: anywhere; white-space: pre-wrap; margin: 0 0 10px; font-size: .85rem; }
.settings-intro { color: var(--muted); margin: -8px 0 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.settings-section { margin: 0 !important; min-width: 0; }
.settings-section .section-head { margin: 0 0 8px; }
.settings-section h2 { font-size: .82rem; color: var(--muted); font-weight: 600; }
.settings-group { background: var(--panel); border-radius: 16px; overflow: hidden; }
.setting-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 15px 17px; border: 0; border-radius: 0; background: none; text-align: start; color: var(--ink); }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row:hover { background: var(--raised); }
.setting-copy { flex: 1; min-width: 0; }
.setting-copy b { display: block; font-size: 1rem; font-weight: 550; }
.setting-copy small { display: block; color: var(--muted); font-size: .8rem; margin-top: 5px; line-height: 1.5; }
.setting-value { font-size: .82rem; color: var(--muted); }
.setting-chevron { font-size: 1.45rem; color: var(--muted); }
@media (min-width: 760px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
