:root {
  /* near-black with no panels: regions are split by space and hairlines, one orange for what's on.
     Every warm colour is a step on the same hue, so the page stays one voice however much of it lights up. */
  color-scheme: dark;
  --bg: #171717;
  --bg-sunk: #212121;
  --selected: #262626;
  --surface: #1f1f1f;
  --ink: #ededed;
  --ink-2: #b5b5b5;
  --muted: #8e8e8e;
  --faint: #666666;
  --line: #2b2b2b;
  --line-2: #262626;
  --line-strong: #3a3a3a;
  /* The one orange: primary buttons, the rail's actions, the current tab and what's on.
     It's too bright for white text, so what sits on it is dark. */
  --accent: #ff7a1a;
  --accent-hover: #ff8c3a;
  --primary: var(--accent);
  --primary-hover: var(--accent-hover);
  --primary-ink: #1c0e04;
  --primary-line: var(--accent);
  --danger: #e8776d;
  --bad-bg: #3a1f1d;
  --bad-ink: #e8a29b;
  --accent-soft: #3a2415;
  --accent-ink: #ffb47e;
  /* Links and focus rings lean amber, so they read as links rather than as more accent */
  --focus: #ffa04d;
  /* What's on, in a list: its title, and the line under it */
  --on-ink: #f4c7a1;
  --on-ink-2: #9c7a5e;
  /* What's working now, in blue to stand apart from the orange */
  --busy: #5aa9e6;
  --busy-ink: #9ccbf2;
  --busy-ink-2: #6688a3;
  /* The user's own messages: a warm, barely-tinted fill inside a dim orange outline */
  --user-bg: #221c17;
  --user-line: #66401f;
  --user-ink: #ff8a3d;
  --nav-width: 220px;
  --page-width: 1300px;
  --shadow-pop: 0 16px 40px -12px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .4);
  --font-head: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  /* Markdown, after markdown.style's Ember: warm off-white text, amber links, a rule under the title */
  --md-font: "Figtree", "Inter", system-ui, sans-serif;
  --md-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --md-ink: #e7e0d8;
  --md-head: #fff4ea;
  --md-h2: var(--md-head);
  --md-head-weight: 700;
  --md-muted: #aaa196;
  --md-link: #f5a55a;
  --md-accent: #f59e4b;
  --md-line: #3a332e;
  --md-code-bg: #272220;
  --md-code-ink: #f1e9df;
  --md-th-bg: #2e2824;
  --md-h1-rule: 2px solid #f59e4b;
  --md-h1-pad: .3em;
  --md-h1-tracking: normal;
  --md-table-edge: none;
  --md-tok-keyword: #f59e4b;
  --md-tok-string: #a3d9a5;
  --md-tok-comment: #8e857d;
  --md-tok-number: #f2c27f;
  --md-tok-title: #ffd27f;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --bg-sunk: #f0f0f0;
  --selected: #ebebeb;
  --surface: #ffffff;
  --ink: #171717;
  --ink-2: #4a4a4a;
  --muted: #6e6e6e;
  --faint: #a0a0a0;
  --line: #e6e6e6;
  --line-2: #eeeeee;
  --line-strong: #d0d0d0;
  --accent: #1e6824;
  --accent-hover: #24782b;
  --primary-ink: #ffffff;
  --accent-soft: #e3f3ea;
  --accent-ink: #23704d;
  --focus: #23704d;
  --on-ink: #1e6824;
  --on-ink-2: #5b765b;
  --busy: #dc7a26;
  --busy-ink: #a8550f;
  --busy-ink-2: #8a6a4c;
  --user-bg: #e4f2e4;
  --user-line: #b6dbb6;
  --user-ink: #1e6824;
  --danger: #b3261e;
  --bad-bg: #fbe4e2;
  --bad-ink: #9b2c22;
  --shadow-pop: 0 16px 40px -12px rgba(23, 23, 23, .2), 0 2px 6px rgba(23, 23, 23, .06);
  /* Markdown, after markdown.style's Meridian: deep green headings, a tight title, boxed tables */
  --md-font: "Manrope", "Inter", system-ui, sans-serif;
  --md-ink: #2a2a2a;
  --md-head: #163a2f;
  --md-h2: #1d6b4f;
  --md-head-weight: 800;
  --md-muted: #66665f;
  --md-link: #1d6b4f;
  --md-accent: #1d6b4f;
  --md-line: #e1ddd4;
  --md-code-bg: #f2f0ea;
  --md-code-ink: #2a2a2a;
  --md-th-bg: #e9f2ed;
  --md-h1-rule: 0;
  --md-h1-pad: 0;
  --md-h1-tracking: -.02em;
  --md-table-edge: 1px solid #e1ddd4;
  --md-tok-keyword: #7c3aed;
  --md-tok-string: #15803d;
  --md-tok-comment: #6b7280;
  --md-tok-number: #b45309;
  --md-tok-title: #1d4ed8;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); font-size: .875rem; line-height: 1.45;
       -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.25; fill: none;
        stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 16px; height: 16px; }

/* The shell: a plain text top bar over the page, with nothing floating. */
.app { height: 100vh; display: flex; flex-direction: column; }
.appbar { flex: none; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 48px; border-bottom: 1px solid var(--line); }
.appbar .spacer { flex: 1; }
.mark { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ink-2); background: linear-gradient(90deg, var(--ink-2) 50%, transparent 50%); }
.slash { color: var(--line-strong); font-size: 1.25rem; font-weight: 300; }
.appbar > .anchor { flex: none; }
.appbar .pop { top: 42px; right: 0; left: auto; width: 200px; z-index: 13; }
/* The workspace switcher, between the wordmark and the apps: the one worked in, and a menu of the rest */
.ws-switch { display: flex; align-items: center; gap: 8px; max-width: 240px; height: 32px; padding: 0 8px 0 4px; border: 1px solid transparent;
             border-radius: 8px; background: transparent; color: var(--ink); font-weight: 600; font-size: .875rem; }
.ws-switch[hidden] { display: none; }
.ws-switch:hover, .ws-anchor:has(.pop.open) .ws-switch { background: var(--bg-sunk); border-color: var(--line); }
.ws-switch .icon { color: var(--faint); }
.ws-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-badge { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft);
            color: var(--accent-ink); font-size: .625rem; font-weight: 700; letter-spacing: .02em; }
.ws-badge.personal { background: var(--line-strong); color: var(--ink); }
.appbar .ws-pop { left: 0; right: auto; width: 280px; }
.ws-item .ws-text { flex: 1; min-width: 0; }
.ws-item .ws-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item .tick { margin-left: 0; }
/* An organisation's workspace someone else owns: said, not offered */
.ws-elsewhere { cursor: default; align-items: flex-start; }
.ws-elsewhere:hover { background: transparent; }
.ws-elsewhere .ws-badge { opacity: .6; }
.ws-elsewhere small { white-space: normal; }
.pop-sep { height: 1px; margin: 6px 4px; background: var(--line); }
/* The current app is underlined in green along the bar's bottom edge */
.topnav { align-self: stretch; display: flex; align-items: stretch; gap: 4px; font-weight: 500; }
.topnav a, .topnav span { display: flex; align-items: center; padding: 0 10px; margin-bottom: -1px; color: var(--muted); text-decoration: none; }
.topnav a.active { box-shadow: inset 0 -2px 0 var(--accent); }
.topnav a[hidden] { display: none; }
/* Threads the agent answered in since the person last looked: a count on In Progress, a pill on each inside it */
.nav-count { min-width: 16px; height: 16px; margin-left: 6px; padding: 0 5px; border-radius: 8px; background: var(--accent);
             color: var(--primary-ink); font-size: .625rem; font-weight: 700; line-height: 16px; text-align: center; }
.nav-count[hidden] { display: none; }
.topnav a .nav-count { display: block; padding: 0 5px; color: var(--primary-ink); cursor: inherit; }
/* Something waits on them: the count gives way to a bell that rings every couple of seconds. */
.nav-count.ring, .topnav a .nav-count.ring { display: inline-flex; align-items: center; justify-content: center;
                                             min-width: 20px; height: 20px; padding: 0; border-radius: 10px; }
.nav-count.ring[hidden] { display: none; }
.nav-count.ring .icon { width: 14px; height: 14px; stroke-width: 2; transform-origin: 50% 15%; animation: ring 2s ease-in-out infinite; }
@keyframes ring {
  0%, 32%, 100% { transform: rotate(0); }
  4% { transform: rotate(18deg); } 8% { transform: rotate(-16deg); } 12% { transform: rotate(12deg); }
  16% { transform: rotate(-9deg); } 20% { transform: rotate(6deg); } 24% { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) { .nav-count.ring .icon { animation: none; } }
.topnav span { color: var(--faint); cursor: not-allowed; }
.topnav a:hover, .topnav a.active { color: var(--ink); }
/* Only the settings keep a left column, which is their navigation. Every page takes the whole width. */
.shell { position: relative; display: flex; flex: 1; min-height: 0; padding: 0 48px; gap: 36px; width: 100%; }
.shell:not(.with-nav) .nav { display: none; }
.contextual { gap: 0; padding-right: 20px; }
/* In Progress names whole threads in its column, so it gets more room */
.wide-nav { --nav-width: 300px; }
.page { flex: 1; min-width: 0; height: 100%; overflow: hidden; display: flex; }
.page > .main { flex: 1; }
.layout { flex: 1; display: flex; min-width: 0; min-height: 0; justify-content: flex-start; }
.column { flex: 1 1 0; max-width: none; }

/* The left column */
.nav { flex: none; position: relative; width: var(--size, var(--nav-width)); max-width: 45vw; display: flex; flex-direction: column; }
/* Its divider sits in the middle of the gap beside it */
.nav > .splitter { right: -23px; }
.nav-content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden auto; padding: 12px 0 16px; }
.nav-title { padding: 0 0 12px; color: var(--ink); font-size: .8125rem; font-weight: 500; }
.wordmark { flex: none; font-family: var(--font-head); line-height: 1.2; text-decoration: none; display: flex; align-items: center; gap: 8px;
            padding: 0; font-size: .9375rem; font-weight: 600; color: var(--ink); }
.profile { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; text-align: left; font-weight: 600;
           width: auto; font-size: .875rem; color: var(--ink); }
.profile .icon { color: var(--faint); }
.avatar { flex: none; display: grid; place-items: center; font-weight: 700; width: 24px; height: 24px; border-radius: 6px;
          background: var(--line-strong); color: var(--ink); font-size: .625rem; }
.profile:hover .avatar { background: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; font-weight: 500; text-align: left; white-space: nowrap;
            min-height: 34px; padding: 0 12px; border-left: 1px solid var(--line); color: var(--muted); }
.nav-item:hover:not(:disabled) { color: var(--ink); }
.nav-item.active { color: var(--accent); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent); border-left-color: transparent; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.page-head { display: flex; align-items: center; gap: 10px; padding: 12px 0 18px; }
.page-head .spacer { flex: 1; }
.page-title { margin: 0; font-family: var(--font-head); font-size: 1.125rem; font-weight: 500; }

/* A page's heading: a way back, then what it is */
.post-head { display: flex; align-items: flex-start; gap: 12px; }
.back { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-sunk); color: var(--ink); }
.back:hover { background: var(--selected); }
.post-title { flex: 1; min-width: 0; }
.post-title small { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-title small a { color: var(--accent); text-decoration: none; }
.post-title small a:hover { text-decoration: underline; }
.thread-title { display: flex; align-items: center; gap: 4px; min-width: 0; }
.thread-title h1 { flex: 0 1 auto; min-width: 0; }
.thread-rename { flex: 1; min-width: 0; }
.thread-rename .input { padding: 2px 8px; font-size: 1.25rem; line-height: 1.25; }
.post-title h1 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; line-height: 1.25; }
.search { width: 360px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line);
          border-radius: 999px; background: var(--surface); color: var(--faint); }
.search:focus-within { border-color: var(--line-strong); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.page-head .search { flex: 0 1 280px; width: auto; min-width: 0; border-radius: 8px; background: var(--bg-sunk); border-color: var(--line); }
.kbd { flex: none; font-size: .6875rem; color: var(--faint); font-weight: 600; }
.btn { padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
       color: var(--ink-2); font-size: .8125rem; height: 36px; border-radius: 8px; font-weight: 500; }
.btn:hover { border-color: var(--line-strong); color: var(--ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg-sunk); color: var(--ink); }
.btn.icon-only { width: 34px; padding: 0; justify-content: center; }
.btn.primary { background: var(--primary); border-color: var(--primary-line); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-line); color: var(--primary-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line); color: var(--ink-2); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; }
/* A destructive button that can't be pressed yet loses its red, so it can't be mistaken for one that can */
.btn.danger:disabled, .btn.danger:disabled:hover { opacity: 1; color: var(--faint) !important; background: var(--bg-sunk); border-color: var(--line);
                                                   border-style: dashed; }
.btn.wide { width: 100%; justify-content: center; height: 38px; }

/* Popovers */
.anchor { position: relative; }
.pop { position: absolute; right: 0; top: 42px; z-index: 10; width: 260px; display: none; padding: 6px; background: var(--surface);
       border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); border-color: var(--line-strong); }
.pop.open { display: block; }
.pop-label { padding: 8px 10px 4px; color: var(--faint); font-size: .7188rem; font-weight: 600; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
            background: transparent; text-align: left; color: var(--ink); }
.pop-item:hover { background: var(--bg-sunk); }
.pop-item .icon { color: var(--muted); }
.pop-item b { display: block; font-weight: 600; }
.pop-item small { color: var(--muted); font-size: .75rem; }
.pop-item .tick { margin-left: auto; color: var(--ink); visibility: hidden; }
.pop-item.on .tick { visibility: visible; }
.filter-pop { width: 280px; max-height: min(480px, 70vh); overflow: auto; }
.filter-pop .pop-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-pop .n { color: var(--faint); font-size: .75rem; }
.filter-pop .tick { margin-left: 0; }
.pop-none { color: var(--faint); cursor: default; }
.pop-none:hover { background: transparent; }
.pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 4px; }

/* Grouped list, rows in the two-line style of the first draft */
.list { flex: 1; overflow: auto; padding: 0 0 32px; }
.group-head { display: flex; align-items: center; gap: 8px; height: 38px; border-radius: 7px; cursor: pointer; user-select: none;
              color: var(--ink-2); padding: 0; margin-top: 2em; }
.group:first-child .group-head { margin-top: 1em; }
.group-head .chev { color: var(--muted); display: grid; transition: transform .15s ease; }
.group.collapsed .chev { transform: rotate(-90deg); }
.group.collapsed .rows { display: none; }
.group-head .name { font-family: var(--font-head); color: var(--ink); font-size: .8125rem; font-weight: 500; }
.count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: .7188rem; font-weight: 700; display: inline-grid;
         place-items: center; background: transparent; color: var(--faint); }
.group-head .hint { color: var(--faint); font-size: .7812rem; }
.rows { border-top: 1px solid var(--line); }
.task { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; cursor: pointer; padding: 1.1em 1.5em 1.2em;
        border-bottom: 1px solid var(--line); }
.task:hover { background: var(--bg-sunk); }
.task-title { display: flex; gap: 10px; align-items: baseline; min-width: 0; font-size: .875rem; font-weight: 600; color: var(--on-ink); }
.task:hover .task-title { color: var(--ink); }
.task-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key { font-weight: 700; color: var(--muted); font-size: .8125rem; letter-spacing: .01em; font-variant-numeric: tabular-nums; flex: none; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 5px; color: var(--muted); font-size: .7812rem; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .open { color: var(--ink-2); font-weight: 600; }
.meta .none { color: var(--faint); }
.task-side { display: flex; align-items: center; gap: 8px; }
.chip { height: 22px; padding: 0 8px; border-radius: 6px; font-size: .7188rem; display: inline-flex; align-items: center; gap: 5px;
        border: 1px solid var(--line); background: transparent; border-color: var(--line-strong); color: var(--muted); font-weight: 500; }
.chip.hot { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.when { min-width: 74px; text-align: right; color: var(--muted); font-size: .7812rem; }

/* Import modal: white, in front, with a soft lift */
.scrim { position: fixed; inset: 0; z-index: 20; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
         background: rgba(29, 29, 27, .18); }
.scrim.open { display: flex; }
.modal { width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
         display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.modal-head .eyebrow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.modal-head h3 { font-family: var(--font-head); font-weight: 600; font-size: 1.375rem; margin: 2px 0 0; }
.modal-head .spacer { flex: 1; }
.modal .search { width: auto; margin: 0 22px 6px; border-radius: 9px; }
.results-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px 6px; color: var(--muted);
                font-size: .75rem; font-weight: 600; }
.link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 600; font-size: .75rem; text-decoration: underline;
        text-underline-offset: 3px; text-decoration-color: var(--faint); }
.results { list-style: none; margin: 0; padding: 0 10px 10px; max-height: 340px; overflow: auto; }
.result { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 9px; cursor: pointer; }
.result:hover { background: var(--bg); }
.result.checked { background: var(--bg-sunk); }
.result input { position: absolute; opacity: 0; pointer-events: none; }
.box { width: 18px; height: 18px; margin-top: 2px; border: 1px solid var(--line-strong); border-radius: 5px; display: grid; place-items: center;
       background: var(--surface); flex: none; }
.box .icon { width: 13px; height: 13px; stroke-width: 2; opacity: 0; }
.result.checked .box { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.result.checked .box .icon { opacity: 1; }
.result .meta { margin-top: 3px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); }
.modal-foot .note { flex: 1; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.modal.narrow { width: min(500px, 94vw); }
.modal .lede { margin: 0; color: var(--ink-2); font-size: .875rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .875rem; }
.plain-list li { display: flex; align-items: center; gap: 8px; }
.choices { display: flex; flex-direction: column; gap: 2px; margin: 0 -12px; }
.box.radio { border-radius: 50%; }

/* A divider that resizes the column beside it: a thin strip over the hairline, lit while it's held */
.splitter { position: absolute; top: 0; bottom: 0; z-index: 1; width: 9px; cursor: col-resize; touch-action: none; outline: 0; }
.splitter.left { left: -5px; }
.splitter.right { right: -5px; }
/* Between two columns that keep apart from it, it takes no room of its own */
.splitter.apart { position: relative; flex: none; margin: 0 -5px 0 -4px; }
.splitter[hidden] { display: none; }
.splitter::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background .15s; }
.splitter:hover::after, .splitter:focus-visible::after, .splitter:active::after { background: var(--accent); }
.resizing { cursor: col-resize; user-select: none; }
.resizing iframe { pointer-events: none; }

/* Beyond the wireframes: empty and error states, forms, the task drawer */
[hidden] { display: none !important; }
.empty { padding: 48px 8px; color: var(--muted); text-align: center; }
.empty b { display: block; font-family: var(--font-head); font-size: 1rem; color: var(--ink-2); margin-bottom: 4px; }
.banner { margin: 0 24px 8px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .8125rem; }
.result .meta a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.result .meta a:hover { color: var(--ink); }
.result.done { cursor: default; }
.result.done .box { border: 0; color: var(--muted); }
.result.done .box .icon { opacity: 1; }
.main > .results { margin: 0 24px; }
.job-view > .results { max-height: none; overflow: visible; }
.job-view > .modal-foot[hidden] { display: none; }
.main > .modal-foot { position: sticky; bottom: 0; margin: 8px 24px 24px; background: var(--surface); }
.main > .settings-lede { margin: 0 24px 12px; }
.result.loading, .result.error { cursor: default; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; padding: 4px 22px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--muted); font-size: .75rem; font-weight: 600; }
.field small { color: var(--faint); font-size: .75rem; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px 10px;
         font: inherit; font-size: 1rem; color: var(--ink); outline: 0; }
.input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(45, 91, 227, .12); }
textarea.input { resize: vertical; min-height: 96px; }
input.input.title { font-family: var(--font-head); font-size: 1.125rem; font-weight: 600; }
.drawer-scrim { position: fixed; inset: 0; z-index: 15; background: rgba(29, 29, 27, .10); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 16; width: min(var(--size, 560px), 100vw); display: flex; flex-direction: column;
          background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .eyebrow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.drawer-head .spacer { flex: 1; }
.drawer-body { flex: 1; overflow: auto; padding-top: 16px; }
.drawer .section-title { display: flex; align-items: center; justify-content: space-between; padding: 6px 22px; margin-top: 6px;
                         font-family: var(--font-head); font-weight: 600; font-size: .875rem; }
.links { display: flex; flex-direction: column; gap: 4px; }
.links a { color: var(--ink-2); font-weight: 600; font-size: .8125rem; display: inline-flex; gap: 6px; align-items: center; }
.danger { color: var(--danger) !important; }
.section-title label.btn { height: 30px; font-family: var(--font-body); }
.signin { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--bg); }
.signin-card { width: 360px; padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
               box-shadow: var(--shadow-pop); text-align: center; }
.signin-card .brand { margin: 0 auto 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
                      font-family: var(--font-head); font-weight: 700; font-size: 1rem; background: var(--line-strong); color: var(--ink); }
.signin-card h1 { font-family: var(--font-head); font-weight: 600; font-size: 1.5rem; margin: 0; }
.signin-card p { color: var(--muted); margin: 6px 0 18px; }
.signin-card .banner { margin: 0 0 14px; text-align: left; }
.signin-providers { display: flex; flex-direction: column; gap: 8px; }
.signin-providers .btn { justify-content: center; height: 40px; text-decoration: none; }
.new-thread-row { display: flex; gap: 8px; }
.new-thread-row .input { flex: 1; }
@keyframes pulse { 50% { opacity: .35; } }
.code { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg-sunk); font-size: .75rem; white-space: pre-wrap; word-break: break-all; }
.note-text { margin: 4px 0; color: var(--muted); font-size: .8125rem; }

/* Shared rows */
.rows-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t small { color: var(--muted); font-size: .75rem; }
.rows-list .row:hover { background: var(--bg-sunk); }
/* A row with a status dot is quiet until it's on, and blue while it works */
.dot + .t b { color: var(--muted); }
.dot + .t small { color: var(--faint); }
.dot.on + .t b { color: var(--on-ink); }
.dot.on + .t small { color: var(--on-ink-2); }
.dot.busy + .t b { color: var(--busy-ink); }
.dot.busy + .t small { color: var(--busy-ink-2); }
.row-icon { color: var(--muted); display: grid; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--accent); }
.dot.busy { background: var(--busy); animation: pulse 1.2s ease-in-out infinite; }
.turn-right { transform: rotate(-90deg); color: var(--faint); }
.empty.small { padding: 8px 10px; text-align: left; font-size: .8125rem; margin: 0; }

/* Empty states: an illustration, what is missing, what to do about it, and at most a couple of actions */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 16px 40px; text-align: center; }
.empty-state img { width: 128px; height: 128px; margin-bottom: 14px; }
:root:not([data-theme="light"]) .empty-state img { filter: invert(.86) hue-rotate(180deg) brightness(.9); }
.empty-state b { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.empty-state p { max-width: 360px; margin: 6px 0 0; color: var(--muted); font-size: .8438rem; line-height: 1.55; }
.empty-state .actions { display: flex; gap: 8px; margin-top: 18px; }
.empty-state.small { padding: 28px 8px 20px; }
.empty-state.small img { width: 96px; height: 96px; margin-bottom: 10px; }
.empty-state.small b { font-size: .875rem; }
.empty-state.small p { font-size: .8125rem; }
.dropzone.empty-state { flex-direction: column; gap: 0; margin-top: 0; border-radius: 12px; }
.transcript .start { margin: auto 0; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.suggestions button { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-2); font-size: .7812rem; }
.suggestions button:hover { border-color: var(--faint); color: var(--ink); }
.muted { color: var(--muted); font-size: .8125rem; }
.task-side .anchor .pop { right: 0; }
.task-side .btn.icon-only { width: 28px; height: 28px; }
.pop a.pop-item { text-decoration: none; }

/* Task details */
.detail { flex: 1; overflow: auto; padding: 12px 0 48px; }
.detail-title { flex: 0 1 auto; min-width: 0; font-family: var(--font-head); line-height: 1.25; margin: 0; font-size: 1.25rem; font-weight: 500; }
.detail-title .key { font-size: 1rem; margin-right: 10px; }
/* Editing is there when wanted, beside the title, but stays out of the way */
.edit-inline { flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px;
               background: transparent; color: var(--faint); }
.post-head .edit-inline { margin-left: -6px; }
.edit-inline:hover { background: var(--bg-sunk); color: var(--ink); }
.meta.big { font-size: .8438rem; gap: 6px 18px; margin: 10px 0 18px 44px; }
.detail > .prose, .detail > .links, .detail > .status-line, .detail > .detail-section { margin-left: 44px; }
.prose { font-size: 1rem; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }
.prose code { background: var(--bg-sunk); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.prose .code { white-space: pre-wrap; }
.prose a { color: var(--focus); overflow-wrap: anywhere; }
.detail .prose { margin-bottom: 14px; color: var(--ink-2); }
.detail .links { margin-bottom: 8px; }
.detail-section { margin-top: 26px; }
.detail-section h2 { display: flex; align-items: center; font-family: var(--font-head); margin: 0 0 8px; font-size: .8125rem; font-weight: 500; }
.detail-section .rows-list { border-top: 1px solid var(--line); }

/* Thread */

/* The chat sits in the centre, with what the session made to its right; a document opened from it
   takes that panel's place. */
.thread-body { overflow-x: auto; }
.chat { flex: 1 1 0; min-width: 420px; display: flex; flex-direction: column; min-height: 0; max-width: var(--page-width); margin: 0 auto; }
.thread-body.viewing .chat { flex: 0 1 var(--size, 520px); margin: 0 24px 0 0; }
.thread-body:not(.viewing) > .splitter { display: none; }
.thread-body.viewing .panel { display: none; }
.chat .post-head { border-bottom: 1px solid var(--line); padding: 12px 0 18px; }
/* A sliver of room each side, taken back by the margin, so the edges of a full-width bubble aren't
   clipped when the width rounds */
.transcript { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 0; padding: 24px 2px; margin: 0 -2px; }
.entry { display: flex; flex-direction: column; }
.msg { max-width: 88%; font-size: 1rem; padding: 10px 14px; border-radius: 12px; word-wrap: break-word; line-height: 1.55; }
/* The user's messages span the chat, each a little apart from what came before */
.msg.user small { color: var(--user-ink); opacity: 1; letter-spacing: .04em; }
.msg.user { width: 100%; max-width: 100%; margin-top: 2em; padding: .8em 1em; border-radius: 5px; background: var(--user-bg);
            border: 1px solid var(--user-line); }
.entry:first-child .msg.user { margin-top: 0; }
.msg.assistant { align-self: flex-start; background: transparent; padding-left: 0; max-width: 100%; }
/* When a message was sent, under its bubble on the right */
.sent-at { align-self: flex-end; display: inline-flex; align-items: center; gap: 5px; margin: 6px 2px 0; color: var(--faint); font-size: .75rem;
           font-variant-numeric: tabular-nums; }
.msg small { display: block; margin-bottom: 4px; opacity: .7; font-family: var(--font-body); font-size: .7188rem; font-weight: 600; }
.follow-ups { display: flex; gap: 6px; font-size: .7812rem; color: var(--muted); }
.follow-ups.open { flex-direction: column; gap: 8px; }
.follow-ups.open small { display: flex; align-items: center; gap: 6px; }
.follow-ups:not(.open) { align-items: center; }
.follow-ups.chosen b { color: var(--ink-2); font-weight: 600; }
.follow-up-options { display: flex; flex-wrap: wrap; gap: 8px; }
.follow-up { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-2); font-size: .7812rem; }
.follow-up:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.follow-up:disabled { opacity: .55; cursor: default; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.card.asking { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card-head { display: flex; align-items: center; gap: 8px; font-size: .8438rem; }
.card-head .icon { color: var(--muted); }
.card-head .pill { margin-left: auto; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-foot { color: var(--muted); font-size: .7812rem; }
.card .remember { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .7812rem; }
.rule-list code, .card-foot code { font-size: .75rem; overflow-wrap: anywhere; }
.card-error { color: var(--danger); font-size: .7812rem; font-weight: 600; }
.card .code { margin: 0; max-height: 240px; overflow: auto; }
.pill { font-size: .7188rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-sunk); color: var(--muted); white-space: nowrap; }
.pill.awaiting_approval { background: var(--accent-soft); color: var(--accent-ink); }
.pill.completed { background: var(--accent-soft); color: var(--accent-ink); }
.pill.denied, .pill.failed, .pill.timed_out { background: var(--bad-bg); color: var(--bad-ink); }
.card.tool:not(.asking) { padding: 8px 12px; }
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-head { font-size: .8438rem; }
.q-options { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.q-option { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.q-option:hover { background: var(--bg-sunk); }
.q-option small { display: block; color: var(--muted); font-size: .75rem; }
.q-answers { list-style: none; margin: 4px 0 0; padding: 0; color: var(--ink-2); font-size: .8125rem; }
.q-answers li { display: flex; gap: 6px; align-items: center; }
.sign-in { display: flex; align-items: center; gap: 8px; font-size: .8438rem; padding: 8px 12px; border-radius: 10px; background: var(--bg-sunk); }
.sign-in .icon { color: var(--muted); }
.sign-in.success { background: var(--accent-soft); color: var(--accent-ink); }
.sign-in.success .icon { color: #23704d; }
.sign-in.failed, .sign-in.timed_out, .sign-in.cancelled, .sign-in.denied { background: var(--bad-bg); color: var(--bad-ink); }
.sign-in .link { margin-left: auto; }
.sign-in .link + .link { margin-left: 8px; }
.sign-in .card-error:empty { display: none; }
.notice { display: flex; gap: 8px; align-items: flex-start; font-size: .8125rem; color: var(--muted); white-space: pre-wrap; }
.err { font-size: .8125rem; color: var(--danger); }
.ended { text-align: center; font-size: .75rem; color: var(--faint); }
.status-line { padding: 0 24px 4px; min-height: 18px; color: var(--danger); font-size: .7812rem; padding-left: 0; padding-right: 0; }
.status-line:empty { display: none; }
/* The composer: the node and the attached files in a strip above the box, so the box is all text */
.composer { margin: 0 0 24px; }
.composer-bar { position: relative; display: flex; gap: 8px; align-items: center; padding: 0 4px 6px; }
.composer-bar[hidden] { display: none; }
.composer-bar select { flex: none; width: auto; max-width: 240px; font-size: .7812rem; padding: 4px 8px; background: transparent; }
.composer-bar select.moving { border-color: var(--accent); }
.composer-bar select:disabled { opacity: .7; cursor: default; }
.composer-box { display: flex; gap: 10px; align-items: flex-end; padding: 12px 10px 10px 14px; border: 1px solid var(--line);
                background: var(--surface); border-radius: 12px; }
/* Grows with what's typed, from its two rows up to a quarter of the window, then scrolls */
.composer-box > .input { flex: 1; align-self: flex-start; min-height: 0; max-height: 25vh; overflow-y: auto; }
.composer .input { resize: none; border: 0; padding: 4px 0; box-shadow: none; }
.composer .send { border-radius: 8px; }
.composer-note { margin: 0 auto 20px; color: var(--muted); font-size: .8125rem; }

/* The right rail: the page's actions, filled, then one quiet circle per section. A section opens in
   the panel beside it, one at a time, so the page keeps its width until something is wanted. */
.rail { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; gap: 9px; padding-top: 18px; margin-left: 12px; }
.rail-sep { width: 14px; border-top: 1px solid var(--line-strong); margin: 3px 0; }
.rail-btn { position: relative; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong);
            border-radius: 50%; background: transparent; color: var(--ink-2); }
.rail-btn .icon { width: 12px; height: 12px; stroke-width: 1.5; }
.rail-btn:hover { border-color: var(--faint); color: var(--ink); }
.rail-btn.action { background: var(--primary); border-color: var(--primary-line); color: var(--primary-ink); }
.rail-btn.action:hover { background: var(--primary-hover); }
.rail-btn.on { background: var(--selected); border-color: var(--ink-2); color: var(--ink); }
.rail-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%); z-index: 5;
                                   padding: 8px 12px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: .8125rem; font-weight: 500;
                                   white-space: nowrap; pointer-events: none; }
.rail-btn[data-tip]:hover::before { content: ""; position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); z-index: 5;
                                    border: 6px solid transparent; border-right: 0; border-left-color: var(--ink); }
/* What arrived while its section was closed */
.badge { position: absolute; top: -5px; right: -6px; min-width: 15px; height: 15px; padding: 0 4px; display: grid; place-items: center;
         border: 2px solid var(--bg); border-radius: 8px; background: var(--accent); color: var(--primary-ink); font-size: .5625rem; font-weight: 700; line-height: 1; }
.panel { flex: none; position: relative; display: flex; align-self: stretch; width: var(--size, 340px); max-width: 60vw; margin-left: 24px; border-left: 1px solid var(--line); }
.panel-body { flex: 1; min-width: 0; overflow: auto; padding: 14px 0 24px 22px; }
.panel-close { position: absolute; top: 14px; left: -14px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; padding: 0;
               border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); color: var(--muted); }
.panel-close:hover { color: var(--ink); }
.panel-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px 6px; }
.panel-head h3 { margin: 0; font-size: .9375rem; font-weight: 600; }
.panel-head small { color: var(--faint); font-size: .7812rem; }
.panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.panel .rows-list { gap: 2px; margin: 0 -8px; }
.panel .row { padding: 8px; border-bottom: 0; border-radius: 8px; }
.panel .row .btn.icon-only { width: 26px; height: 26px; }
.new-tag { flex: none; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .6562rem; font-weight: 700; }
.artifact-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; margin: -6px -8px; border: 0; border-radius: 7px;
                background: transparent; text-align: left; font-size: .8125rem; text-decoration: none; color: var(--muted); }
.artifact-row:hover { background: var(--bg-sunk); color: var(--ink); }
.artifact-row.on { background: var(--selected); color: var(--ink); font-weight: 600; }
.artifact-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-row .icon { color: var(--muted); }

/* What the agent is doing now, and how long a finished turn took */
.activity { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; padding: 2px 24px 10px; padding-left: 0;
            padding-right: 0; }
.activity .spin { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; flex: none; }
.thinking::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
.worked { color: var(--faint); font-size: .7812rem; }
.steps { color: var(--muted); font-size: .7812rem; }
.steps summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::after { content: "›"; transition: transform .15s ease; }
.steps[open] summary::after { transform: rotate(90deg); }
.steps ul { list-style: none; margin: 6px 0 0; padding: 0 0 0 2px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.steps li { display: flex; gap: 6px; align-items: center; }
.steps li.failed, .steps li.denied, .steps li.timed_out { color: var(--bad-ink); }

/* Markdown in the conversation, the agent's and the person's, in the theme's Markdown palette */
.md { font-family: var(--md-font); color: var(--md-ink); line-height: 1.65; word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--md-font); font-weight: var(--md-head-weight); color: var(--md-head); line-height: 1.25;
                                 margin: 1.3em 0 .5em; }
.md h1 { font-size: 1.5em; padding-bottom: var(--md-h1-pad); border-bottom: var(--md-h1-rule); letter-spacing: var(--md-h1-tracking); }
.md h2 { font-size: 1.3em; color: var(--md-h2); }
.md h3 { font-size: 1.12em; }
.md h4 { font-size: 1em; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table, .md hr { margin: 0 0 .85em; }
.md ul, .md ol { padding-left: 1.5em; }
.md li + li { margin-top: .3em; }
.md li > ul, .md li > ol { margin: .3em 0 0; }
.md li.task-item { list-style: none; margin-left: -1.3em; }
.md li.task-item input { margin: 0 .45em 0 0; vertical-align: middle; accent-color: var(--md-accent); }
.md strong { font-weight: 700; color: var(--md-head); }
.md del { color: var(--md-muted); }
.md a { color: var(--md-link); text-underline-offset: .15em; }
.md blockquote { padding: .2em 1em; border-left: 4px solid var(--md-accent); color: var(--md-muted); }
.md blockquote > :last-child { margin-bottom: 0; }
.md code { font-family: var(--md-mono); font-size: .88em; background: var(--md-code-bg); color: var(--md-code-ink); padding: .12em .4em; border-radius: 6px; }
.md pre { background: var(--md-code-bg); color: var(--md-code-ink); padding: .9em 1.1em; border-radius: 6px; overflow: auto; line-height: 1.5; }
.md pre code { background: none; padding: 0; color: inherit; }
.md .diagram { margin: 0 0 .85em; }
.md .diagram img { display: block; max-width: 100%; height: auto; }
.md table { border-collapse: collapse; border: var(--md-table-edge); font-size: .94em; line-height: 1.4; }
.md th, .md td { border: 1px solid var(--md-line); padding: .5em .75em; text-align: left; vertical-align: top; }
.md th { background: var(--md-th-bg); font-weight: 700; color: var(--md-head); }
.md hr { border: 0; border-top: 1px solid var(--md-line); margin: 1.2em 0; }
.md .hljs-keyword, .md .hljs-selector-tag, .md .hljs-built_in, .md .hljs-type, .md .hljs-bullet { color: var(--md-tok-keyword); }
.md .hljs-string, .md .hljs-attr, .md .hljs-regexp, .md .hljs-addition { color: var(--md-tok-string); }
.md .hljs-comment, .md .hljs-quote { color: var(--md-tok-comment); font-style: italic; }
.md .hljs-number, .md .hljs-literal, .md .hljs-symbol { color: var(--md-tok-number); }
.md .hljs-title, .md .hljs-function, .md .hljs-name, .md .hljs-tag, .md .hljs-section { color: var(--md-tok-title); }
.md .hljs-meta, .md .hljs-doctag { color: var(--md-muted); }
.md .hljs-deletion { color: var(--danger); }
.msg a, .queued a, .notice a, .err a { overflow-wrap: anywhere; }
.queued a, .err a { color: inherit; }
.entry:empty { display: none; }

/* Messages waiting for the agent, above the composer */
.queue { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; }
.queued { align-self: flex-end; max-width: 75%; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--ink-2);
          white-space: pre-wrap; word-wrap: break-word; font-size: .8438rem; }
.queued small { display: block; color: var(--faint); font-size: .7188rem; font-weight: 600; margin-bottom: 2px; }
.msg.user.unsent { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.composer .stop { background: #c4321f; border-color: #c4321f; color: #fff; }
.composer .stop:hover { background: #a82a1a; }
.stop-square { width: 11px; height: 11px; border-radius: 2px; background: currentColor; }

/* An image the agent made, in a dialog */
.image-scrim { align-items: center; padding: 4vh 4vw; z-index: 30; background: rgba(29, 29, 27, .55); }
/* The dialog takes most of the window whatever the image's size, so a screenshot is readable; the
   image fits inside it without being blown up past its own size. */
.image-modal { margin: 0; width: 92vw; height: 92vh; display: flex; flex-direction: column; background: var(--surface);
               border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-pop); }
.image-modal figcaption { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.image-modal figcaption b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.image-count { flex: none; margin-right: 6px; color: var(--muted); font-size: .7812rem; font-variant-numeric: tabular-nums; }
.image-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px;
               background: var(--bg-sunk); }
.image-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 40px; height: 40px; display: grid; place-items: center;
             padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
.image-nav:hover { border-color: var(--faint); }
.image-nav.prev { left: 16px; }
.image-nav.next { right: 16px; }

/* A knowledge document, opened beside the chat */
.viewer { flex: 1 1 0; min-width: 420px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); }
.viewer-head { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.viewer-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-head); font-weight: 600; }
.viewer iframe { flex: 1; width: 100%; border: 0; }
.viewer-body { flex: 1; display: flex; min-height: 0; }
.viewer-tree { flex: none; width: var(--size, 200px); overflow: auto; padding: 14px 12px; border-right: 1px solid var(--line);
               display: flex; flex-direction: column; gap: 4px; }
.viewer-tree .artifact-row { margin: 0; }
.viewer-tree[hidden] + .splitter { display: none; }

/* Comments on a document, waiting beside it to go to the agent */
.viewer-body { position: relative; }
.review-float { position: absolute; z-index: 5; height: 30px; padding: 0 10px; box-shadow: var(--shadow-pop); }
.review { flex: none; width: 300px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--bg); }
.review-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 10px; }
.review-head b { font-family: var(--font-head); font-weight: 600; }
.review-head small { color: var(--muted); font-weight: 600; }
.review-list { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0 12px 12px; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.review-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.review-card.on { border-color: var(--accent); }
.review-where { display: block; margin-bottom: 4px; color: var(--muted); font-size: .7188rem; font-weight: 600;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-card blockquote { margin: 0 0 8px; padding: 0 0 0 8px; border-left: 3px solid var(--accent); color: var(--muted); font-size: .8125rem;
                          display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.review-card p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-card textarea.input { min-height: 72px; cursor: text; }
.review-card-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.review-card-actions .btn { height: 30px; }
.review-card-tools { display: flex; justify-content: flex-end; gap: 2px; margin-top: 4px; }
.review-foot { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.review-foot small { color: var(--faint); font-size: .7188rem; text-align: center; }
.review-foot .review-discard { align-self: center; height: 28px; }
.review-error { margin: 0; color: var(--danger); font-size: .7812rem; font-weight: 600; }

/* A document opened over the task page */
.doc-scrim { align-items: center; padding: 4vh 4vw; z-index: 30; background: rgba(29, 29, 27, .55); }
.doc-modal { width: min(1100px, 92vw); height: 88vh; min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
             flex: none; box-shadow: var(--shadow-pop); }

/* Files on the task page and in a thread */
.file-row[data-open], .file-row[data-image] { cursor: pointer; }
.file-row .t small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .t small.sub { color: var(--faint); }
.file-item { display: flex; align-items: center; gap: 6px; }
.file-item .artifact-row { flex: 1; min-width: 0; }
.btn.icon-only.xs { width: 24px; height: 24px; flex: none; }
.on-task { flex: none; color: var(--faint); font-size: .6875rem; }
/* Making a document knowledge, and pinning knowledge to the task: lit once done */
.btn.ghost.done { color: var(--accent); }
.composer-buttons { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.composer.drop .composer-box { border-color: var(--focus); background: var(--bg-sunk); }
/* The files waiting to go: a count in the strip, opening upwards over the conversation */
.attach-pill { height: 26px; padding: 0 10px; border-radius: 999px; font-size: .7812rem; color: var(--ink-2); }
.attach-pill[hidden] { display: none; }
.attach-pill[aria-expanded="true"] { border-color: var(--focus); }
.attach-pill[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.attach-pill .spin { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.attach-pill.added { animation: added .9s ease-out; }
@keyframes added { 0% { border-color: var(--focus); background: var(--accent-soft); } }
.composer-files { position: absolute; left: 4px; bottom: 100%; z-index: 5; display: flex; flex-direction: column; gap: 6px; width: 300px;
                  max-height: 50vh; overflow-y: auto; list-style: none; margin: 0; padding: 8px; border: 1px solid var(--line-strong);
                  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.composer-files[hidden] { display: none; }
.chip-file { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line);
             border-radius: 12px; background: var(--surface); }
.chip-tile { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; overflow: hidden;
             border-radius: 8px; background: var(--ink); color: var(--bg); }
.chip-tile img { width: 100%; height: 100%; object-fit: cover; }
.chip-file.uploading .chip-tile { background: var(--bg-sunk); }
.chip-text { flex: 1; min-width: 0; line-height: 1.3; }
.chip-text b, .chip-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-text b { font-weight: 600; font-size: .8438rem; }
.chip-text small { color: var(--muted); font-size: .75rem; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 14px 10px;
            border: 1px dashed var(--line-strong); border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: .7812rem;
            text-align: center; cursor: pointer; }
.dropzone[hidden] { display: none; }
.dropzone:hover, .drop > .dropzone { border-color: var(--focus); background: var(--bg-sunk); color: var(--ink); }
/* Files in the conversation, as in the composer: a count above the message, or where the agent
   handed them over, which opens them below it */
.msg-files { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 4px 0; }
.msg-files:has(+ .msg.user) { margin: 2em 0 6px; }
.entry:first-child .msg-files { margin-top: 0; }
.msg-files + .msg.user { margin-top: 0; }
.msg-files-list { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.msg-files-list[hidden] { display: none; }
.msg-files .chip-file { width: 100%; font: inherit; text-align: left; color: inherit; text-decoration: none; }
.msg-files .chip-file:hover { border-color: var(--line-strong); }
.msg-files-list li.with-actions { position: relative; }
.msg-files-list li.with-actions .chip-file { padding-right: 68px; }
.chip-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.queued-file { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: .7812rem; }
.step { display: flex; gap: 8px; align-items: flex-start; font-size: .8125rem; color: var(--ink-2); }
.step .icon { flex: none; color: var(--faint); margin-top: 1px; }
.step.completed { color: var(--muted); }
.step.completed .icon { color: var(--accent); }
.step.in_progress { font-weight: 600; }
.step.in_progress .icon { color: var(--accent); }
.step.cancelled { color: var(--faint); text-decoration: line-through; }
a.btn { text-decoration: none; }
#authBody a.btn.primary { justify-content: center; height: 40px; }

/* Settings: sections on the left; each setting a row with its words on the left and its control on the right */
a.nav-item { text-decoration: none; }

/* In Progress: the person's open threads on the left, each with its task under it */
.progress-item { min-height: 50px; padding-top: 6px; padding-bottom: 6px; }
.progress-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.progress-text b, .progress-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-text b { font-weight: 500; }
.progress-text small { color: var(--faint); font-size: .75rem; }
.nav .settings-search { flex: none; width: auto; height: 32px; margin: 0 0 14px; border-radius: 8px; }
/* The settings menu in two groups, General and Workspace, each under its heading */
.settings-menu-group { display: contents; }
.settings-menu-group > .facet-title { padding: 0 0 8px; color: var(--faint); font-size: .75rem; }
.settings-menu-group:not([hidden]) ~ .settings-menu-group > .facet-title { padding-top: 20px; }
.settings { flex: 1; overflow: auto; padding: 12px 0 48px; }
.settings-body { }
.settings-title { font-family: var(--font-head); margin: 0 0 4px; font-size: 1.125rem; font-weight: 500; }
.settings-lede { margin: 0 0 8px; color: var(--muted); max-width: 600px; }
.settings-group { margin-top: 26px; }
.settings-group h2 { margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .8125rem; font-weight: 500; }
.setting { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); padding: 18px 0; }
.setting-text { flex: 1; min-width: 0; }
.setting-text b { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink-2); }
.setting-text small { display: block; margin-top: 2px; color: var(--muted); font-size: .7812rem; }
.setting-control { display: flex; align-items: center; gap: 8px; flex: none; }
.setting-control .input { width: 220px; height: 34px; padding: 6px 10px; }
.token-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.segmented { gap: 0; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-sunk); }
.segmented button { min-height: 30px; padding: 4px 14px; line-height: 1.2; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 500; }
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.setting.minted { display: block; }
.settings-body .banner { margin: 0 0 12px; }
.settings-group h2.with-action { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); }
.drawer-foot .err { flex: 1; margin: 0; }
.drawer .statuses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.drawer .segmented { display: inline-flex; align-self: flex-start; }
.drawer .form-group { display: flex; flex-direction: column; gap: 14px; }
.drawer .form-group[hidden] { display: none; }
.drawer textarea.prompt { min-height: 150px; }
.drawer .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer button.chip { cursor: pointer; font-family: var(--font-mono, monospace); }
.setting.block { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.setting-text .pill { font-weight: 700; }
.setting-text code { background: var(--bg-sunk); padding: 1px 5px; border-radius: 5px; font-size: .75rem; }
.prompt-input { min-height: 200px; font-size: .8438rem; line-height: 1.55; }
.prompt-input.short { min-height: 90px; }
.setting-actions { display: flex; align-items: center; gap: 8px; }
/* Settings, Agent prompt: which one is in effect, and a word when the default changed under one's own */
.prompt-effect { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 400; font-size: .75rem; }
.pill.in-effect, .pill.source.yours { background: var(--accent-soft); color: var(--accent-ink); }
.pill.source.workspace { background: var(--selected); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.prompt-changed { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; font-size: .8125rem;
                  background: var(--accent-soft); color: var(--accent-ink); }
.prompt-changed > span { flex: 1; }
.prompt-changed[hidden] { display: none; }
.prompt-input[readonly] { background: var(--bg-sunk); color: var(--ink-2); }
.settings-group .empty.small { padding: 14px 0; }
.settings-group .err { margin: 8px 0 0; }
.settings-group .err:empty { display: none; }
/* A settings-like page of its own, without the settings' left column */
.page-narrow { max-width: 760px; width: 100%; margin: 0 auto; padding: 20px 24px 0; }
.settings-foot { margin: 14px 0 0; color: var(--muted); font-size: .8125rem; }
.settings-foot a { color: var(--ink); }
.setting-text small + small { margin-top: 4px; }
.setting-text .ws-domain { color: var(--ink-2); }

/* Settings, Workspace: its people, a row each, with only the actions the person may take */
.settings-group h2 .count { margin-left: 6px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.group-note { margin: 10px 0 0; color: var(--muted); font-size: .7812rem; max-width: 640px; }
.setting.member, .setting.invitation { gap: 14px; padding: 14px 0; }
.member-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-sunk); color: var(--ink-2); font-size: .6875rem;
                 border: 1px solid var(--line); }
.invite-avatar { color: var(--muted); }
.setting.member .setting-text b, .setting.invitation .setting-text b { color: var(--ink); font-weight: 500; flex-wrap: wrap; }
.setting.member .you { color: var(--muted); font-weight: 400; }
.setting.member.inactive .setting-text b { color: var(--muted); }
.setting.member.inactive .member-avatar { opacity: .55; }
.setting.invitation.expired .setting-text b { color: var(--muted); }
.pill.role { font-weight: 600; }
.pill.role.owner { background: var(--accent-soft); color: var(--accent-ink); }
.pill.role.admin { background: var(--selected); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pill.expired { background: var(--bad-bg); color: var(--bad-ink); }
.setting-control small.muted { color: var(--faint); font-size: .75rem; }
.setting-control .role-select { width: 110px; }
@media (min-width: 901px) { #inviteForm .input, #renameForm .input { font-size: .875rem; } }
.setting-control .token-form .input[type=email] { width: 240px; }
.invite-result { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: .8125rem;
                 background: var(--bg-sunk); color: var(--ink-2); }
.invite-result[hidden] { display: none; }
.invite-result > span { flex: 1; }
.invite-result.done { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.invite-result.error { background: var(--bad-bg); color: var(--bad-ink); font-weight: 600; }
.invite-result .btn { height: 30px; flex: none; }
.modal .bullets { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .8438rem; display: flex; flex-direction: column; gap: 6px; }

/* Invitations to the person: in the switcher, and in the dialog shown when they sign in */
.ws-switch.invited { position: relative; }
.ws-switch.invited::after { content: ""; position: absolute; top: 3px; left: 21px; width: 8px; height: 8px; border-radius: 50%;
                            background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.ws-invite { cursor: default; align-items: flex-start; }
.ws-invite:hover { background: transparent; }
.ws-invite small { white-space: normal; }
.ws-invite-actions { display: flex; gap: 6px; margin-top: 8px; }
.ws-invite-actions .btn { height: 28px; padding: 0 10px; }
.invite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.invite-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.invite-card .ws-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.invite-card .ws-text b { font-weight: 600; }
.invite-card .ws-text small { color: var(--muted); font-size: .7812rem; }
.invite-card .ws-invite-actions { margin: 0; }

/* The knowledge library */
.nav-item.facet { background: transparent; font: inherit; font-weight: 500; }
.nav-item.facet .facet-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item.facet .count { color: var(--faint); font-size: .75rem; font-variant-numeric: tabular-nums; }
.nav-title.facet-title { padding-top: 20px; }
.knowledge-list { flex: 1; min-height: 0; overflow: auto; padding-bottom: 48px; }
.knowledge-row .t small.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.knowledge-row .meta .chip, .knowledge-page .meta .chip { height: 20px; }
.tags { color: var(--muted); }
.knowledge-page { overflow: hidden; padding-top: 12px; }
.knowledge-page .post-head { align-items: center; }
.knowledge-page .post-head .spacer { flex: 1; }
.knowledge-page .lede { margin: 8px 0 0 44px; color: var(--ink-2); max-width: 72ch; }
.knowledge-page .meta.big { margin-bottom: 10px; }
.shared-with { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px 44px; font-size: .8125rem; }
.shared-with .label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; }
.shared-with #sharedChips { display: contents; }
.shared-with .none { color: var(--faint); }
.share-chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 2px 0 10px; border: 1px solid var(--line);
              border-radius: 7px; background: var(--surface); }
.share-chip a { color: var(--ink); text-decoration: none; font-weight: 600; }
.share-chip a:hover { text-decoration: underline; }
.knowledge-viewer { flex: 1; min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.add-knowledge { margin: 8px 0 0; align-self: flex-start; }

/* Notifications: the bell beside the profile, and the panel it opens from the right */
.bell { position: relative; color: var(--muted); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
              background: var(--accent); color: var(--primary-ink); font-size: .625rem; font-weight: 700; line-height: 16px; text-align: center; }
.drawer.inbox { width: min(420px, 100vw); }
.inbox-title { margin: 0; font-family: var(--font-head); font-size: 1rem; font-weight: 600; }
.inbox-list { list-style: none; margin: 0; padding: 0; }
.note-card { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.note-card.fresh { background: var(--bg-sunk); box-shadow: inset 2px 0 0 var(--accent); }
.note-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
             background: var(--bg-sunk); color: var(--muted); }
.note-card.success .note-icon { background: var(--accent-soft); color: var(--accent-ink); }
.note-card.warning .note-icon { color: var(--busy); }
.note-card.error .note-icon { color: var(--danger); }
.note-main { flex: 1; min-width: 0; }
.note-top { display: flex; align-items: flex-start; gap: 8px; }
.note-top b { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; padding-top: 4px; }
.note-top time { flex: none; padding-top: 5px; color: var(--faint); font-size: .75rem; }
.note-top .btn.icon-only { width: 28px; height: 28px; margin: 0 -6px 0 -2px; }
.note-main p { margin: 2px 0 0; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.note-main p a { color: var(--ink-2); }
.note-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.note-actions .btn { height: 30px; text-decoration: none; font-size: .8125rem; }

/* Phones, and tablets held upright: one column. The bar keeps the profile and the bell in reach and
   scrolls the apps under them; a left column turns into a strip across the top; the rail sits above
   the page and its panel, or a document, opens over it. */
@media (max-width: 900px) {
  .app { height: 100dvh; }
  /* Below 16px, iOS zooms the page in when a field takes focus */
  .input, .search input, .composer-bar select { font-size: max(16px, 1rem); }
  input.input.title { font-size: max(16px, 1.125rem); }
  .appbar { flex-wrap: wrap; height: auto; gap: 0 10px; padding: 0 16px; }
  .wordmark { height: 48px; }
  .slash, #profileLabel, .profile > .icon { display: none; }
  .topnav { order: 1; flex: 1 0 100%; height: 40px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; }
  .topnav a { white-space: nowrap; }
  .shell, .contextual { padding: 0 16px; gap: 0; }
  .shell.with-nav { flex-direction: column; }
  .nav { width: auto; max-width: none; }
  .splitter { display: none; }
  .nav-content { flex-direction: row; align-items: center; gap: 4px; padding: 8px 0; overflow: auto hidden; scrollbar-width: none;
                 border-bottom: 1px solid var(--line); }
  .nav-title, .nav .settings-search { display: none; }
  .nav-title.facet-title { display: block; flex: none; padding: 0 2px 0 12px; color: var(--faint); font-size: .75rem; }
  .nav-title.facet-title:first-child { padding-left: 0; }
  .settings-menu-group:not([hidden]) ~ .settings-menu-group > .facet-title { padding: 0 2px 0 12px; }
  .nav-item { width: auto; flex: none; min-height: 32px; border: 1px solid var(--line); border-radius: 999px; }
  .nav-item.active { box-shadow: none; border-color: var(--line-strong); background: var(--selected); }
  .progress-item { max-width: 220px; min-height: 40px; padding-top: 2px; padding-bottom: 2px; border-radius: 10px; }

  /* The task list */
  .page-head { flex-wrap: wrap; padding: 12px 0 6px; gap: 6px; }
  .page-head .page-title { flex: 1 0 100%; }
  .page-head .search { flex: 1 0 100%; order: 1; }
  .task { padding: .9em .25em; gap: 8px; }
  .when { min-width: 0; }
  .group-head { margin-top: 1.2em; }

  /* A job's page: the list takes the width the shell leaves it */
  .job-view > .settings-lede, .job-view .banner { margin-left: 0; margin-right: 0; }
  .job-view > .results { margin: 0 -4px; padding: 0 0 8px; }
  .job-view .result { padding: 10px 4px; gap: 10px; }
  .job-view .page-head .page-title { flex: 1 1 auto; }
  .job-view > .modal-foot { flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; padding: 10px 0; }
  .job-view > .modal-foot .note { order: -1; flex: 1 0 100%; }
  .job-view > .modal-foot #pickAll { margin-right: auto; padding-left: 0; }

  /* A task, a thread, a knowledge document */
  .layout { flex-direction: column; }
  .rail { order: -1; width: auto; flex-direction: row; justify-content: flex-end; padding: 8px 0 0; margin: 0; }
  .rail-sep { width: 0; height: 14px; border-top: 0; border-left: 1px solid var(--line-strong); margin: 0 3px; }
  .panel { position: fixed; inset: 0; z-index: 18; width: auto; max-width: none; margin: 0; border: 0; background: var(--bg); }
  .panel-body { padding: 16px 16px 24px; }
  .panel-head { margin: 4px 48px 14px 6px; }
  .panel-close { left: auto; right: 16px; top: 12px; width: 36px; height: 36px; }
  .detail { padding-top: 4px; }
  .meta.big { margin-left: 0; }
  .detail > .prose, .detail > .links, .detail > .status-line, .detail > .detail-section { margin-left: 0; }
  .thread-body { overflow: hidden; }
  .chat { min-width: 0; width: 100%; }
  .thread-body.viewing .chat { flex: 0 1 520px; }
  .chat .post-head { padding: 4px 0 12px; }
  .post-title h1 { font-size: 1.0625rem; }
  .transcript { padding: 16px 2px; }
  .md table { display: block; max-width: 100%; overflow-x: auto; }
  .composer { margin-bottom: 12px; }
  .composer-files { width: min(300px, calc(100vw - 40px)); }
  .queued { max-width: 90%; }
  .thread-body.viewing .viewer, .viewer.doc-modal { position: fixed; inset: 0; z-index: 30; width: auto; height: auto; min-width: 0;
                                                    border: 0; border-radius: 0; }
  .doc-scrim, .image-scrim { padding: 0; }
  .image-modal { width: 100vw; height: 100dvh; border-radius: 0; }
  .viewer-body { flex-direction: column; }
  .viewer-tree { width: auto; max-height: 30%; border-right: 0; border-bottom: 1px solid var(--line); }
  .review { width: auto; max-height: 45%; border-left: 0; border-top: 1px solid var(--line); }
  .knowledge-page .lede, .shared-with { margin-left: 0; }
  .knowledge-viewer { min-height: 60vh; }
  .knowledge-page { overflow: auto; }

  /* A thread has the screen to itself: no app bar, no In Progress strip. Its head is one line of
     where it is, with the rail's buttons beside it, over a one-line title; the composer is one row. */
  body.focus .appbar { display: none; }
  body.focus .shell.with-nav .nav { display: none; }
  .thread-body { position: relative; }
  .thread-body > .rail { position: absolute; top: 6px; right: 0; z-index: 2; gap: 6px; padding: 0; }
  .thread-body > .rail .rail-btn { width: 30px; height: 30px; }
  .thread-page .chat .post-head { gap: 8px; align-items: center; padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
  .thread-page .post-head .back { flex: none; width: 30px; height: 30px; }
  .thread-page .post-title small { min-height: 30px; line-height: 30px; padding-right: 172px; }
  .thread-page .post-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thread-page .thread-title .edit-inline { flex: none; }
  .thread-page .post-head { margin-left: 0; }
  .thread-page .post-title { margin-top: 0; }
  .thread-page .transcript { padding-top: 10px; }
  .composer { margin-bottom: 8px; }
  .composer-bar { padding: 0 2px 4px; }
  .composer-bar select { height: 30px; padding: 2px 8px; }
  .composer-box { align-items: flex-end; padding: 6px 6px 6px 12px; }
  .composer-box > .input { align-self: center; max-height: 35dvh; }
  .composer-buttons { flex-direction: row; gap: 4px; }
  .composer-buttons .btn { width: 36px; height: 36px; }

  /* In Progress opened on a phone: the threads, one under another, before picking one */
  .shell.listing .nav { flex: 1; min-height: 0; }
  .shell.listing .page { display: none; }
  .shell.listing .nav-content { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0; overflow: hidden auto; border-bottom: 0; }
  .shell.listing .progress-item { max-width: none; min-height: 60px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }

  /* Dialogs fill the width */
  .scrim { padding: 12px; }
  .modal, .modal.narrow { width: 100%; max-height: calc(100dvh - 24px); }
  .modal .form { overflow-y: auto; }
  .results { max-height: none; flex: 1; min-height: 0; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot { flex-wrap: wrap; }
  .signin-card { width: calc(100vw - 32px); }

  /* Settings put each control under its words */
  .setting { flex-wrap: wrap; gap: 10px; }
  .setting-control { flex: 1 0 100%; flex-wrap: wrap; }
  .setting-control .input { width: 100%; }
  .token-form { flex: 1 0 100%; }
}
/* A tap leaves a touch screen hovering, which would pin the rail's tooltips open */
@media (hover: none) {
  .rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:hover::before { display: none; }
}

/* Moving a task to another workspace: the workspaces to pick from, then what the move does */
#moveTaskForm { display: flex; flex-direction: column; max-height: 90vh; }
#moveTaskForm > .form { overflow: auto; }
.move-choice { align-items: center; }
.move-choice .box { margin-top: 0; }
.move-choice .ws-text { display: flex; flex-direction: column; min-width: 0; }
.move-consequences { display: flex; flex-direction: column; gap: 14px; }
.move-consequences:empty { display: none; }
.move-part h4 { margin: 0 0 8px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.move-list li { align-items: flex-start; color: var(--ink-2); font-weight: 500; }
.move-list li .icon { flex: none; margin-top: 2px; color: var(--muted); }
.move-list b { color: var(--ink); font-weight: 600; }
.move-blocked { margin: 0; align-items: flex-start; }
.move-blocked .icon { flex: none; margin-top: 1px; }
.modal .lede.muted { color: var(--muted); }
.detail .moved-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 14px 44px; }
@media (max-width: 900px) { .detail .moved-banner { margin-left: 0; } }
#moveTaskModal { padding-top: 6vh; }

/* Job templates, and the jobs copied from them */
.drawer-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 22px 14px; padding: 10px 12px; border-radius: 8px;
               background: var(--bg-sunk); color: var(--muted); font-size: .7812rem; }
.drawer-note .icon { flex: none; margin-top: 1px; }
.field-note { color: var(--faint); font-size: .75rem; }
.settings-group h2 .actions-inline { display: inline-flex; gap: 8px; margin-left: auto; }
.settings-group h2.with-action .count { margin-right: auto; }
.row.template { gap: 8px; }
.row .t small.template-yours, .row .t small.paused-because { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.row .t small.template-yours { color: var(--faint); }
.row .t small.paused-because { color: var(--bad-ink); white-space: normal; }
.pill.from-template { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: 1px;
                      background: var(--selected); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.pill.from-template .icon { width: 12px; height: 12px; }
.page-head .pill.from-template { margin-left: 4px; }
.banner.paused-because { background: var(--bad-bg); color: var(--bad-ink); }
