/* Pinpoint's look, Atelier's: a neutral graphite surround, as in photo editors, so the chrome casts
   no colour on the page images beside the texts. One typeface, Instrument Sans (bundled, SIL Open
   Font License: fonts/OFL.txt). The file has Atelier's general parts (the font, the colours, the
   columns, the sidebar, the page heads, the empty state), then the chat page's workspace (step
   18: Atelier's chat, composer, live lines, buttons, dialogs and avatars, and the new parts built
   from the same pieces: the activity line, the answers and their citations, the thinking block,
   the viewer and the side panel); each later page brings its own section from Atelier's
   stylesheet when it is built. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  src: url(fonts/instrument-sans-latin-ext-standard-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  src: url(fonts/instrument-sans-latin-standard-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The dark look, the desktop app's and the web edition's Dark: the colours every rule below
   takes (a theme's preview on Your account shows them too, on a page of any look). */
:root,
.theme-preview[data-theme="dark"] {
  --side: #1e1f21;        /* the side panels */
  --stage: #242527;       /* the chat */
  --raised: #2e2f32;      /* the composer, your messages, a chosen item */
  --hover: #34353a;
  --line: #38393d;        /* hairlines */
  --text: #ecebe8;
  --muted: #a3a4a7;
  --faint: #76787c;
  --paper: #efeee9;       /* the main action: light paper on graphite */
  --paper-text: #1c1d1f;
  --viewer: #151617;      /* behind a page image in the viewer */
  --working: #8fbf9a;
  --asking: #d9b46b;
  --failed: #d27b6f;
  --idle: #7a7c80;
  --done: #c4c6c9;
  --cited: #9db7d6;       /* a citation's mark: the one cool tone, as DocQA's cited quote */
  /* Step 1.18 (2026-11-12): the colours that were written out in the rules below, as variables
     of the same values, so the light look (below) can give each its own. */
  --surface: #2e2f32;     /* a sheet over the page: a dialog, a menu, the composer */
  --card: #1e1f21;        /* a card or a table on the page; a text shown as on paper */
  --line-strong: #55575c; /* a line that stands out: the composer in use, a chosen switch */
  --line-hover: #5a5c61;  /* a line under the mouse; a scrollbar's thumb */
  --line-dashed: #4a4c51; /* a drop zone's dashed edge */
  --focus: rgba(239, 238, 233, 0.6);  /* the keyboard's focus ring */
  --shadow-deep: rgba(0, 0, 0, 0.45); /* under a drawer, a dialog, a page image */
  --shadow-soft: rgba(0, 0, 0, 0.35); /* under the sign-in card, a help card */
  --shadow-bar: rgba(0, 0, 0, 0.3);   /* above the save bar */
  /* A colour's red, green and blue, for a tint of it: rgba(var(--working-rgb), 0.16). */
  --working-rgb: 143, 191, 154;
  --asking-rgb: 217, 180, 107;
  --cited-rgb: 157, 183, 214;
  --line-rgb: 56, 57, 61;
  --side-rgb: 30, 31, 33;
  --lift-rgb: 255, 255, 255;  /* a shade lighter than what is under it (the light look: darker) */
  /* The bands across the top (.page-band): each one's background, and its line and icon. */
  --view-band: #3a3322;
  --worker-band: #1c3346;
  --worker-line: #6fa8d6;
  --admin-band: #3d2121;
  --admin-line: #d27b6f;
  --gpu-band: #2e2544;
  --gpu-line: #a68ce0;
  --notice-band: #1d362c;
  --notice-line: #6cc9a1;
  /* Step 1.19 (2026-11-12): the accent, a dusty violet as strong as the status colours and
     used in three small places only (the open project's mark in the sidebar, the
     first steps' numbers, the look chosen on Your account), and the colour of the notes that
     are always on the page, between --faint and --muted. */
  --accent: #b3a6d9;
  --accent-rgb: 179, 166, 217;
  --note: #8d8f93;
  --font: "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

:root {
  --text-scale: 1;  /* the text's size: the web edition's choice (below) */
}

html, body, #app, .q-page-container, .nicegui-content {
  height: 100%;
}

/* The scheme the browser draws its own parts in (scrollbars, a field's controls): dark, as the
   pages; a light page's light (steps 1.18 and 1.19, below: <html>'s class light-start, on a
   page of any light look). Said here, not only by NiceGUI's meta line, which says "normal"
   while a page follows the device. */
:root, body.body--dark {
  color-scheme: dark;
}

html.light-start {
  color-scheme: light;
}

body, body.body--dark {
  margin: 0;
  background: var(--stage);
  color: var(--text);
  font-family: var(--font);
  font-size: calc(14px * var(--text-scale));
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* The light look (Phase 1 step 1.18, 2026-11-12: the web edition's, as the account chooses on
   Your account: web/appearance.py): the same parts in warm paper tones, its lines and tints a
   shade darker than what is under them, the main action in graphite ink, the status colours
   deep enough to read on paper. The page's head marks <html> with the theme shown (data-theme:
   pinpoint.js) before the page's first paint, so a light page never shows dark first; while
   the account's choice is the device's, the mark follows the device. The desktop app is dark,
   as ever: its pages have no mark. */
html[data-theme="light"] body,
.theme-preview[data-theme="light"] {
  color-scheme: light;
  --side: #f4f2ee;
  --stage: #fbfaf7;
  --raised: #ebe9e4;
  --hover: #e4e2dd;
  --line: #e0ddd7;
  --text: #1f2023;
  --muted: #5a5c61;
  --faint: #7d7f84;
  --paper: #25272b;
  --paper-text: #faf9f6;
  --viewer: #e4e2dd;
  --working: #2f7a4a;
  --asking: #8f6012;
  --failed: #b0443a;
  --idle: #a3a5a9;
  --done: #6e7075;
  --cited: #2f62a0;
  --surface: #ffffff;
  --card: #ffffff;
  --line-strong: #c9c6c0;
  --line-hover: #bdbab4;
  --line-dashed: #cbc8c2;
  --focus: rgba(37, 39, 43, 0.45);
  --shadow-deep: rgba(40, 34, 24, 0.16);
  --shadow-soft: rgba(40, 34, 24, 0.12);
  --shadow-bar: rgba(40, 34, 24, 0.07);
  --working-rgb: 47, 122, 74;
  --asking-rgb: 143, 96, 18;
  --cited-rgb: 47, 98, 160;
  --line-rgb: 224, 221, 215;
  --side-rgb: 244, 242, 238;
  --lift-rgb: 0, 0, 0;
  --view-band: #f6eedc;
  --worker-band: #e3edf7;
  --worker-line: #3c75aa;
  --admin-band: #f7e4e0;
  --admin-line: #b0443a;
  --gpu-band: #ece7f7;
  --gpu-line: #6b52b3;
  --notice-band: #e0f0e7;
  --notice-line: #2a8a5e;
  --accent: #5f4b9c;
  --accent-rgb: 95, 75, 156;
  --note: #696b70;
  /* Quasar's brand colours, which Quasar writes on the body itself: a field's focus, a chosen
     box, an error (the dark look's: ui/window.py add_look). */
  --q-primary: #25272b !important;
  --q-negative: #b0443a !important;
}

/* The other looks (Phase 1 step 1.19, 2026-11-12: the web edition's, as the account chooses on
   Your account), each the same parts in its own tones, on a scale from the lightest to the
   darkest: High contrast, Classic, Light (above), Sepia, Dark (:root) and Deep dark. The mark
   is <html>'s data-theme (pinpoint.js), there from the page's first paint; a theme's preview on
   Your account (.theme-preview) carries the same colours. Every look gives every colour. */

/* High contrast: black on white, every text at least 7 to 1 against its background, the lines
   and the edges dark enough to see. */
html[data-theme="contrast"] body,
.theme-preview[data-theme="contrast"] {
  color-scheme: light;
  --side: #ffffff;
  --stage: #ffffff;
  --raised: #e3e3e3;
  --hover: #d4d4d4;
  --line: #6e6e6e;
  --text: #000000;
  --muted: #262626;
  --faint: #454545;
  --paper: #000000;
  --paper-text: #ffffff;
  --viewer: #d4d4d4;
  --working: #0b5c2e;
  --asking: #734600;
  --failed: #a11212;
  --idle: #6e6e6e;
  --done: #454545;
  --cited: #0b3d91;
  --surface: #ffffff;
  --card: #ffffff;
  --line-strong: #000000;
  --line-hover: #000000;
  --line-dashed: #454545;
  --focus: rgba(0, 0, 0, 0.9);
  --shadow-deep: rgba(0, 0, 0, 0.32);
  --shadow-soft: rgba(0, 0, 0, 0.24);
  --shadow-bar: rgba(0, 0, 0, 0.14);
  --working-rgb: 11, 92, 46;
  --asking-rgb: 115, 70, 0;
  --cited-rgb: 11, 61, 145;
  --line-rgb: 110, 110, 110;
  --side-rgb: 255, 255, 255;
  --lift-rgb: 0, 0, 0;
  --view-band: #fff0b8;
  --worker-band: #d9e8ff;
  --worker-line: #0b3d91;
  --admin-band: #ffdcd6;
  --admin-line: #a11212;
  --gpu-band: #e6dcff;
  --gpu-line: #4a22b5;
  --notice-band: #d2f4e0;
  --notice-line: #0b5c2e;
  --accent: #45239f;
  --accent-rgb: 69, 35, 159;
  --note: #454545;
  --q-primary: #000000 !important;
  --q-negative: #a11212 !important;
}

/* Classic: cool white and slate, the main action in navy ink. */
html[data-theme="classic"] body,
.theme-preview[data-theme="classic"] {
  color-scheme: light;
  --side: #eef1f5;
  --stage: #fbfcfd;
  --raised: #e2e7ee;
  --hover: #d8dee7;
  --line: #d6dbe3;
  --text: #17202b;
  --muted: #4c5766;
  --faint: #73808f;
  --paper: #1f3a60;
  --paper-text: #ffffff;
  --viewer: #dde3ea;
  --working: #277150;
  --asking: #8a5a12;
  --failed: #b23b33;
  --idle: #9aa5b1;
  --done: #65717e;
  --cited: #2458a6;
  --surface: #ffffff;
  --card: #ffffff;
  --line-strong: #b8c1cd;
  --line-hover: #a9b3c0;
  --line-dashed: #bcc5d0;
  --focus: rgba(31, 58, 96, 0.5);
  --shadow-deep: rgba(23, 32, 43, 0.16);
  --shadow-soft: rgba(23, 32, 43, 0.12);
  --shadow-bar: rgba(23, 32, 43, 0.07);
  --working-rgb: 39, 113, 80;
  --asking-rgb: 138, 90, 18;
  --cited-rgb: 36, 88, 166;
  --line-rgb: 214, 219, 227;
  --side-rgb: 238, 241, 245;
  --lift-rgb: 0, 0, 0;
  --view-band: #f6eedc;
  --worker-band: #e0ebf8;
  --worker-line: #2f6fb0;
  --admin-band: #f7e3e0;
  --admin-line: #b23b33;
  --gpu-band: #e9e6f7;
  --gpu-line: #5d4bb0;
  --notice-band: #dcefe6;
  --notice-line: #27835a;
  --accent: #4a56a8;
  --accent-rgb: 74, 86, 168;
  --note: #5e6978;
  --q-primary: #1f3a60 !important;
  --q-negative: #b23b33 !important;
}

/* Sepia: parchment, the texts and the main action in brown ink. */
html[data-theme="sepia"] body,
.theme-preview[data-theme="sepia"] {
  color-scheme: light;
  --side: #ebe0c9;
  --stage: #f5edda;
  --raised: #e2d6bc;
  --hover: #d9ccb0;
  --line: #d9cbac;
  --text: #37291c;
  --muted: #65543f;
  --faint: #857259;
  --paper: #4a3524;
  --paper-text: #faf3e3;
  --viewer: #ddd0b4;
  --working: #4a6a2c;
  --asking: #8a5710;
  --failed: #a5412d;
  --idle: #a8997e;
  --done: #776751;
  --cited: #2f5d8a;
  --surface: #fcf6e8;
  --card: #fbf4e4;
  --line-strong: #bfad88;
  --line-hover: #b2a07a;
  --line-dashed: #c3b28e;
  --focus: rgba(74, 53, 36, 0.5);
  --shadow-deep: rgba(55, 41, 28, 0.2);
  --shadow-soft: rgba(55, 41, 28, 0.14);
  --shadow-bar: rgba(55, 41, 28, 0.08);
  --working-rgb: 74, 106, 44;
  --asking-rgb: 138, 87, 16;
  --cited-rgb: 47, 93, 138;
  --line-rgb: 217, 203, 172;
  --side-rgb: 235, 224, 201;
  --lift-rgb: 0, 0, 0;
  --view-band: #f0e0b4;
  --worker-band: #dbe3e6;
  --worker-line: #2f5d8a;
  --admin-band: #f0d7c8;
  --admin-line: #a5412d;
  --gpu-band: #e6dad9;
  --gpu-line: #73508f;
  --notice-band: #dde5c6;
  --notice-line: #4a6a2c;
  --accent: #73446b;
  --accent-rgb: 115, 68, 107;
  --note: #6e5d46;
  --q-primary: #4a3524 !important;
  --q-negative: #a5412d !important;
}

/* Deep dark: near black, for a dark room and a screen whose black is unlit; Quasar's own dark
   surfaces with it. */
html[data-theme="deep"] body,
.theme-preview[data-theme="deep"] {
  color-scheme: dark;
  --side: #09090a;
  --stage: #0f0f10;
  --raised: #1d1d20;
  --hover: #26262a;
  --line: #27272b;
  --text: #e4e3df;
  --muted: #9c9da0;
  --faint: #6d6f73;
  --paper: #e9e8e3;
  --paper-text: #101011;
  --viewer: #000000;
  --working: #86b892;
  --asking: #d1ad66;
  --failed: #cf786c;
  --idle: #6a6c70;
  --done: #b9bbbe;
  --cited: #94b0d1;
  --surface: #1a1a1d;
  --card: #09090a;
  --line-strong: #45474b;
  --line-hover: #4d4f54;
  --line-dashed: #3d3f43;
  --focus: rgba(233, 232, 227, 0.6);
  --shadow-deep: rgba(0, 0, 0, 0.7);
  --shadow-soft: rgba(0, 0, 0, 0.6);
  --shadow-bar: rgba(0, 0, 0, 0.5);
  --working-rgb: 134, 184, 146;
  --asking-rgb: 209, 173, 102;
  --cited-rgb: 148, 176, 209;
  --line-rgb: 39, 39, 43;
  --side-rgb: 9, 9, 10;
  --lift-rgb: 255, 255, 255;
  --view-band: #2a2414;
  --worker-band: #0f2336;
  --worker-line: #6fa8d6;
  --admin-band: #2c1414;
  --admin-line: #d27b6f;
  --gpu-band: #1f1733;
  --gpu-line: #a68ce0;
  --notice-band: #10271e;
  --notice-line: #6cc9a1;
  --accent: #b3a6d9;
  --accent-rgb: 179, 166, 217;
  --note: #838589;
  --q-primary: #e9e8e3 !important;
  --q-negative: #cf786c !important;
  --q-dark: #1a1a1d !important;
  --q-dark-page: #0f0f10 !important;
}

/* The text's size (step 1.19: the account's choice on Your account, <html>'s data-text): every
   size in this file is its own times --text-scale; the desktop's pages have none: 1. */
html[data-text="very-small"] { --text-scale: 0.86; }
html[data-text="small"] { --text-scale: 0.93; }
html[data-text="large"] { --text-scale: 1.1; }
html[data-text="very-large"] { --text-scale: 1.22; }

/* Quasar's own sizes, for the parts whose size this file leaves to it (a button's label, a
   field's text, its label and hint, a tooltip, a table): the same times the scale on the web's
   pages. :where() gives the mark on <html> no weight, so each rule of this file that sets a
   size of its own still wins. */
:where(html.web) .q-btn { font-size: calc(14px * var(--text-scale)); }
:where(html.web) .q-field { font-size: calc(14px * var(--text-scale)); }
:where(html.web) .q-field__marginal { font-size: calc(24px * var(--text-scale)); }
:where(html.web) .q-field__label { font-size: calc(16px * var(--text-scale)); }
:where(html.web) .q-field--dense .q-field__label { font-size: calc(14px * var(--text-scale)); }
:where(html.web) .q-field__bottom { font-size: calc(12px * var(--text-scale)); }
:where(html.web) .q-chip { font-size: calc(14px * var(--text-scale)); }
:where(html.web) .q-badge { font-size: calc(12px * var(--text-scale)); }
:where(html.web) .q-table th { font-size: calc(12px * var(--text-scale)); }
:where(html.web) .q-table tbody td { font-size: calc(13px * var(--text-scale)); }
:where(html.web) .q-table__bottom { font-size: calc(12px * var(--text-scale)); }
:where(html.web) .q-uploader__title { font-size: calc(14px * var(--text-scale)); }
:where(html.web) .q-uploader__subtitle { font-size: calc(12px * var(--text-scale)); }
:where(html.web) .q-tooltip { font-size: calc(14px * var(--text-scale)); }
:where(html.web) body.desktop .q-tooltip { font-size: calc(10px * var(--text-scale)); }

/* The light looks' own few rules (Quasar marks the body body--light on a page of any of them):
   a dialog's shade over the page lighter; a switch or a box that is on in the main action's
   ink (its grey-4 colour is light grey, made for the dark look). */
.body--light .q-dialog__backdrop {
  background: rgba(31, 32, 35, 0.28);
}

.body--light .text-grey-4 > * {
  color: var(--paper);
}

/* A ticked box's tick in the main action's text colour: dark on the dark looks' light box,
   light on the light looks' ink box (2026-11-12, Peter's find: Quasar's tick is white, so on
   the dark look's light box it didn't show). */
.q-checkbox__svg {
  color: var(--paper-text);
}

.nicegui-content {
  padding: 0;
  gap: 0;
}

.q-btn, .q-field, .q-menu, .q-tab, .q-dialog, .q-notification {
  font-family: var(--font);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- the columns ------------------------------------------------------------------------- */

.app {
  display: grid;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* The widths the user drags (2026-10-31, the user's wish; the column handles, below, and
   pinpoint.js): --sidebar-width (on every page), --chat-width and --side-width (the chat
   page), --folders-width and --library-main-width (the Library page), set on the page's root
   when dragged and kept by the browser; without them, the defaults below. Each column's width
   (--*-column) is the user's, capped so that the column taking the rest keeps its room when the
   window is made narrower later: the chat 360 px, the viewer 400 px, the Library page's sources
   400 px. */

/* A page of the sidebar and one column (the Monitor's, the Settings', the Instructions'). */
.app.monitor-app {
  --sidebar-column: clamp(180px, var(--sidebar-width, 256px), min(480px, 30vw));
  grid-template-columns: var(--sidebar-column) minmax(0, 1fr);
}

.monitor-app > .sidebar { grid-column: 1; grid-row: 1; }
.monitor-app > main { grid-column: 2; grid-row: 1; }

@media (max-width: 1100px) {
  .app.monitor-app {
    --sidebar-column: clamp(180px, var(--sidebar-width, 220px), 30vw);
  }
}

/* The chat page's workspace, designed for 2560x1440: the activity line across, then the
   sidebar, the chat, the viewer (when something is open in it) and the side panel. With the
   viewer closed the chat takes its room, its messages kept to a reading width. */
.app.workspace {
  --sidebar-column: clamp(180px, var(--sidebar-width, 240px), 480px);
  --side-column: min(var(--side-width, 520px), calc(100vw - var(--sidebar-column) - 360px));
  grid-template-columns: var(--sidebar-column) minmax(0, 1fr) var(--side-column);
  grid-template-rows: auto minmax(0, 1fr);
}

.app.workspace.viewer-open {
  --side-column: min(var(--side-width, 520px), calc(100vw - var(--sidebar-column) - 760px));
  --chat-column: max(
    360px,
    min(
      var(--chat-width, 760px),
      calc(100vw - var(--sidebar-column) - var(--side-column) - 400px)
    )
  );
  grid-template-columns:
    var(--sidebar-column) var(--chat-column) minmax(0, 1fr) var(--side-column);
}

.app.workspace.no-project {
  grid-template-columns: var(--sidebar-column) minmax(0, 1fr);
}

/* The Library page (library_page.py): the activity line across, then the sidebar, the folders,
   the sources of the folder shown and the viewer (when a source is open in it). */
.app.library-app {
  --sidebar-column: clamp(180px, var(--sidebar-width, 240px), 480px);
  --folders-column: min(var(--folders-width, 300px), calc(100vw - var(--sidebar-column) - 400px));
  grid-template-columns: var(--sidebar-column) var(--folders-column) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.app.library-app.viewer-open {
  --library-main-column: max(
    400px,
    min(
      var(--library-main-width, 820px),
      calc(100vw - var(--sidebar-column) - var(--folders-column) - 400px)
    )
  );
  grid-template-columns:
    var(--sidebar-column) var(--folders-column) var(--library-main-column) minmax(0, 1fr);
}

.library-app > .activity { grid-column: 1 / -1; grid-row: 1; }
.library-app > .sidebar { grid-column: 1; grid-row: 2; }
.library-app > .library-folders { grid-column: 2; grid-row: 2; }
.library-app > .library-main { grid-column: 3; grid-row: 2; }
.library-app > .viewer { display: none; }
.library-app.viewer-open > .viewer { display: flex; grid-column: 4; grid-row: 2; }

.workspace > .activity { grid-column: 1 / -1; grid-row: 1; }
.workspace > .sidebar { grid-column: 1; grid-row: 2; }
.workspace > .stage { grid-column: 2; grid-row: 2; }
.workspace > .viewer { display: none; }
.workspace > .side { grid-column: -2 / -1; grid-row: 2; }
.workspace.viewer-open > .viewer { display: flex; grid-column: 3; grid-row: 2; }

.shared-only, .drawer-only {
  display: none !important;
}

/* Below about 2,200 px the viewer and the side panel share one column, with tabs: the viewer
   in front while something is open in it, the side panel when one of its tabs is chosen. */
@media (max-width: 2199px) {
  .app.workspace, .app.workspace.viewer-open {
    --side-column: min(var(--side-width, 600px), calc(100vw - var(--sidebar-column) - 360px));
    grid-template-columns: var(--sidebar-column) minmax(0, 1fr) var(--side-column);
  }
  .workspace.viewer-open > .viewer { grid-column: 3; }
  .workspace.viewer-open:not(.side-first) > .side { display: none; }
  .workspace.viewer-open.side-first > .viewer { display: none; }
  .workspace .shared-only { display: flex !important; }
  .workspace.viewer-open:not(.side-first) .side-tab.current {
    color: var(--muted);
    border-bottom-color: transparent;
  }
}

/* Below about 1,800 px the sidebar shows as icons; the mouse over it opens it over the page, as
   wide as the user made it (the web edition's top bar's button too, for a touch screen: the
   page's class sidebar-open, step 1.19). The Library page's sources and viewer share their
   room as before. */
@media (max-width: 1799px) {
  .app.workspace, .app.workspace.viewer-open, .app.library-app {
    --sidebar-column: 64px;
  }
  .app.workspace, .app.workspace.viewer-open {
    --side-column: min(var(--side-width, 520px), calc(100vw - 64px - 360px));
  }
  .app.library-app {
    --folders-column: min(var(--folders-width, 280px), calc(100vw - 64px - 400px));
  }
  .app.library-app.viewer-open {
    --folders-column: min(var(--folders-width, 260px), calc(100vw - 64px - 800px));
    grid-template-columns: 64px var(--folders-column) minmax(400px, 0.8fr) minmax(0, 1.2fr);
  }
  :is(.workspace, .library-app) > .sidebar {
    position: relative;
    z-index: 30;
    width: 64px;
    overflow: hidden;
    transition: width 0.15s ease, box-shadow 0.15s ease;
  }
  :is(.workspace, .library-app) > .sidebar:hover,
  :is(.workspace, .library-app) > .sidebar:focus-within,
  :is(.workspace, .library-app).sidebar-open > .sidebar {
    width: clamp(180px, var(--sidebar-width, 240px), 480px);
    box-shadow: 16px 0 48px var(--shadow-deep);
  }
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .wordmark,
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .page-link > div,
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .project-item .name,
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .project-item .meta,
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .sidebar-foot,
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .pages-part {
    display: none;
  }
  /* Quasar keeps a button's label shown (display: block, important, in its layer): it gets no
     width instead. */
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .new-project .block {
    max-width: 0;
    overflow: hidden;
  }
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .new-project .q-icon {
    margin: 0;
  }
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .wordmark-short {
    display: block;
  }
  :is(.workspace, .library-app):not(.sidebar-open) > .sidebar:not(:hover):not(:focus-within) .new-project {
    width: 40px;
    min-width: 0;
    padding: 0;
    margin: 0 12px 14px;
  }
}

/* Below about 1,500 px the side panel is a drawer (its button in the chat's head), and the
   viewer opens over the chat. */
@media (max-width: 1499px) {
  .app.workspace, .app.workspace.viewer-open {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .workspace > .side {
    display: flex !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: 480px;
    max-width: 92vw;
    transform: translateX(105%);
    transition: transform 0.2s ease;
    box-shadow: -16px 0 48px var(--shadow-deep);
  }
  .workspace.side-open > .side { transform: none; }
  .workspace.viewer-open > .viewer,
  .workspace.viewer-open.side-first > .viewer {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    width: min(900px, 92vw);
    box-shadow: -16px 0 48px var(--shadow-deep);
  }
  .app.library-app, .app.library-app.viewer-open {
    --folders-column: min(var(--folders-width, 260px), calc(100vw - 64px - 400px));
    grid-template-columns: 64px var(--folders-column) minmax(0, 1fr);
  }
  .library-app.viewer-open > .viewer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    width: min(900px, 92vw);
    box-shadow: -16px 0 48px var(--shadow-deep);
  }
  .workspace .shared-only { display: none !important; }
  .workspace .drawer-only { display: inline-flex !important; }
  .workspace .viewer .side-switch { display: flex !important; }  /* the drawer, over the viewer */
}

/* The column handles (2026-10-31, the user's wish; controls.column_handle, pinpoint.js): thin
   lines at the start of a column, dragged to resize the column before them (the sidebar, the
   chat, the folders, the sources) or after them (the side panel, the shared column below about
   2,200 px); a double click gives the default back. None where a column has no width of its
   own: the sidebar as icons, the side panel as a drawer, the sources and the viewer sharing
   their room on a narrower Library page. */
.app > .column-handle {
  display: none;
  justify-self: start;
  position: relative;
  z-index: 20;
  width: 7px;
  margin-left: -3px;
  cursor: col-resize;
  touch-action: none;
}

.app > .column-handle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: transparent;
  transition: background 0.15s ease;
}

.app > .column-handle:hover::after,
.app > .column-handle.dragging::after {
  background: var(--muted);
}

.monitor-app > .sidebar-handle { display: block; grid-column: 2; grid-row: 1; }
:is(.workspace, .library-app) > .sidebar-handle { display: block; grid-column: 2; grid-row: 2; }
.workspace > .side-handle { display: block; grid-column: -2 / -1; grid-row: 2; }
.workspace.viewer-open > .chat-handle { display: block; grid-column: 3; grid-row: 2; }
.workspace.no-project > .column-handle { display: none; }
.library-app > .folders-handle { display: block; grid-column: 3; grid-row: 2; }
.library-app.viewer-open > .library-main-handle { display: block; grid-column: 4; grid-row: 2; }

.app.resizing {
  cursor: col-resize;
  user-select: none;
}

@media (max-width: 2199px) {
  .workspace.viewer-open > .chat-handle { display: none; }
}

@media (max-width: 1799px) {
  :is(.workspace, .library-app) > .sidebar-handle { display: none; }
  .library-app.viewer-open > .library-main-handle { display: none; }
}

@media (max-width: 1499px) {
  .workspace > .column-handle { display: none !important; }
}

/* --- the activity line ------------------------------------------------------------------- */

.activity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 32px;
  padding: 0 20px;
  background: var(--side);
  border-bottom: 1px solid var(--line);
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.activity .what {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
}

.activity .what:hover {
  color: var(--text);
}

.activity .extra {
  margin-left: auto;
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.activity .q-btn.stop-reading {
  min-height: 24px;
  padding: 0 8px;
  font-size: calc(12.5px * var(--text-scale));
}

.activity .q-btn.stop-reading .q-icon {
  font-size: calc(16px * var(--text-scale));
}

/* --- the sidebar ------------------------------------------------------------------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.wordmark-row {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.wordmark {
  padding: 18px 20px 14px;
  font-size: calc(24px * var(--text-scale));
  font-weight: 620;
  font-stretch: 75%;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
}

.wordmark-short {
  display: none;
  width: 64px;
  font-size: calc(24px * var(--text-scale));
  font-weight: 620;
  font-stretch: 75%;
  text-align: center;
}

.sidebar .pages {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 14px;
}

.page-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 540;
  text-decoration: none;
  white-space: nowrap;
}

.page-link .q-icon {
  font-size: calc(18px * var(--text-scale));
  color: var(--faint);
}

.page-link:hover {
  background: var(--hover);
  color: var(--text);
}

.page-link.current {
  background: var(--raised);
  color: var(--text);
}

.page-link.current .q-icon {
  color: var(--text);
}

.sidebar .new-project {
  margin: 0 14px 14px;
  white-space: nowrap;
}

.project-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 12px;
}

.project-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  column-gap: 10px;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.project-item:hover {
  background: var(--hover);
}

.project-item.current {
  background: var(--raised);
}

.project-item .name {
  font-weight: 540;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item .meta {
  grid-column: 2;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
  transform: translateY(-1px);
  flex: none;
}

.dot.working { background: var(--working); box-shadow: 0 0 0 3px rgba(var(--working-rgb), 0.16); }
.dot.asking { background: var(--asking); box-shadow: 0 0 0 3px rgba(var(--asking-rgb), 0.16); }
.dot.failed { background: var(--failed); }
.dot.finished { background: var(--done); }

.sidebar-foot {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The web admin's pages under the sidebar's pages (W4). */
.sidebar .pages-part {
  padding: 10px 12px 2px;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --- a page's head and its empty state --------------------------------------------------- */

.monitor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--stage);
}

.monitor-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 16px;
  background: var(--stage);
  border-bottom: 1px solid var(--line);
}

.stage-head .title, .monitor-head .title {
  font-size: calc(20px * var(--text-scale));
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-head .facts, .monitor-head .facts {
  margin-top: 3px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.empty {
  max-width: 460px;
  margin: 18vh auto 0;
  padding: 0 28px;
  text-align: center;
}

.empty .headline {
  font-size: calc(26px * var(--text-scale));
  font-weight: 600;
  font-stretch: 87%;
  line-height: 1.25;
}

.empty .lead {
  margin-top: 10px;
  font-size: calc(15px * var(--text-scale));
  line-height: 1.6;
  color: var(--muted);
}

.empty .q-btn {
  margin-top: 22px;
}

/* --- the chat ---------------------------------------------------------------------------- */

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--stage);
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 16px;
  border-bottom: 1px solid var(--line);
}

.stage-head .actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex: none;
}

.stage-head .origin {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.stage-head .origin .q-icon {
  font-size: calc(15px * var(--text-scale));
}

.stage-head .origin a {
  color: var(--muted);
  text-decoration: none;
}

.stage-head .origin a:hover {
  color: var(--text);
  text-decoration: underline;
}

.transcript {
  flex: 1;
  min-height: 0;
}

.transcript .q-scrollarea__content {
  width: 100%;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 28px 0;
}

.messages.after {
  padding: 22px 28px 36px;
}

.messages.after:empty {
  padding: 0 28px 36px;
}

.day {
  align-self: center;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
  border-radius: 12px;
}

.message .who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.message .who .time {
  color: var(--faint);
}

.message .who .q-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.message:hover .who .q-btn, .message .who .q-btn:focus-visible {
  opacity: 1;
}

.message .who .q-btn .q-icon {
  font-size: calc(18px * var(--text-scale));
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
  max-width: 82%;
}

.message.user .body {
  background: var(--raised);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 15px;
  white-space: pre-wrap;
}

.message .body {
  font-size: calc(15px * var(--text-scale));
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.message .body p, .viewer-page .body p {
  margin: 0 0 0.6em;
}

.message .body p:last-child {
  margin-bottom: 0;
}

.message .body ul, .message .body ol, .viewer-page .body ul, .viewer-page .body ol {
  margin: 0 0 0.6em;
  padding-left: 22px;
}

.message .body code {
  font-size: calc(13px * var(--text-scale));
  background: var(--raised);
  padding: 1px 5px;
  border-radius: 4px;
}

.message .mark {
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
  white-space: nowrap;
}

.message.queued .body {
  opacity: 0.7;
  border: 1px dashed var(--line);
}

/* The news: short, plain messages while the work goes on, lighter than the answers. */
.message.news {
  padding-left: 14px;
  border-left: 2px solid var(--line);
  border-radius: 0;
}

.message.news .body {
  font-size: calc(14px * var(--text-scale));
  color: var(--muted);
}

.message.question .body {
  padding: 12px 16px;
  background: rgba(var(--asking-rgb), 0.07);
  border: 1px solid rgba(var(--asking-rgb), 0.28);
  border-radius: 12px;
}

/* A citation of a message scrolled to: it lights up for a moment (pinpoint.js). */
.message.flash {
  animation: flash 1.6s ease;
}

@keyframes flash {
  0%, 30% { box-shadow: 0 0 0 6px rgba(var(--cited-rgb), 0.22); }
  100% { box-shadow: 0 0 0 6px rgba(var(--cited-rgb), 0); }
}

.options, .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chat-empty {
  margin-top: 14vh;
}

/* --- an answer and a written document ---------------------------------------------------- */

.answer-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: calc(12.5px * var(--text-scale));
  font-weight: 560;
  color: var(--muted);
}

.status.answered { color: var(--working); border-color: rgba(var(--working-rgb), 0.4); }
.status.partly { color: var(--asking); border-color: rgba(var(--asking-rgb), 0.4); }
.status.not_answered { color: var(--done); }

.answer-top .when {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

/* The model that wrote the answer: its program and file on hover. */
.answer-top .model {
  margin-left: auto;
  min-width: 0; /* a long name shortens with its ellipsis, inside the flex row */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.question-quote {
  margin: 4px 0 2px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: calc(14px * var(--text-scale));
  line-height: 1.55;
}

.written-text h1, .written-text h2, .written-text h3 {
  margin: 0.8em 0 0.4em;
  font-weight: 600;
  line-height: 1.3;
}

.written-text h1 { font-size: calc(19px * var(--text-scale)); }
.written-text h2 { font-size: calc(17px * var(--text-scale)); }
.written-text h3 { font-size: calc(15px * var(--text-scale)); color: var(--muted); }

.written-text table {
  border-collapse: collapse;
  margin: 6px 0 10px;
  font-size: calc(13.5px * var(--text-scale));
}

.written-text th, .written-text td {
  padding: 5px 12px 5px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* The numbered citations: [1, 2], each its place and quote on hover. */
.cites {
  color: var(--faint);
  white-space: nowrap;
}

.cite {
  color: var(--cited);
  font-size: 0.86em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;  /* it opens its place in the viewer */
  border-bottom: 1px dotted rgba(var(--cited-rgb), 0.5);
}

.cite:hover {
  color: var(--text);
}

.missing {
  padding: 10px 14px;
  background: rgba(var(--asking-rgb), 0.06);
  border-left: 2px solid rgba(var(--asking-rgb), 0.5);
  border-radius: 0 8px 8px 0;
  font-size: calc(14px * var(--text-scale));
  line-height: 1.55;
}

.missing .missing-title {
  margin-bottom: 2px;
  font-size: calc(12.5px * var(--text-scale));
  font-weight: 600;
  color: var(--asking);
}

/* What the material lacks, as Markdown: often a list (2026-11-17). */
.missing .missing-text p,
.missing .missing-text ul,
.missing .missing-text ol {
  margin: 0 0 0.4em;
}

.missing .missing-text ul,
.missing .missing-text ol {
  padding-left: 22px;
}

.missing .missing-text > :last-child {
  margin-bottom: 0;
}

.written-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--faint);
}

/* The citations and, under them, the Verifier's check (2026-11-17), each closed to its head. */
.citations-head,
.checks-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  cursor: pointer;
}

.citations-head:hover,
.checks-head:hover {
  color: var(--text);
}

.citations-head .chevron,
.checks-head .chevron {
  flex: none;
  font-size: calc(18px * var(--text-scale));
  transition: transform 0.15s ease;
}

.citations.opened .citations-head .chevron,
.checks.opened .checks-head .chevron {
  transform: rotate(90deg);
}

.checks-head {
  min-width: 0;
  text-align: left;  /* its line of counts may run onto a second line */
}

/* The check's line and, the web's, its (?) (help.CHECK, 2026-11-17) beside it. */
.checks-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* The points the Verifier marked (◐, ⚠), each with its reason; a line alone, as a note. */
.check-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 2px;
  padding-left: 22px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
}

.checks-line {
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--faint);
}

.citation-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 2px;
  padding-left: 22px;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
}

.citation-row .where {
  color: var(--text);
  font-weight: 540;
}

.citation-row.opens {
  margin: 0 -8px;
  padding: 3px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.citation-row.opens:hover {
  background: var(--hover);
}

.citation-row .quote {
  color: var(--muted);
}

.answer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: -8px;
}

.writing-report {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

/* --- the thinking of a deep turn (thinking_block.py) -------------------------------------- */

.thinking {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--side-rgb), 0.6);
  color: var(--muted);
}

.thinking-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 4px 8px 4px 12px;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  text-align: left;
}

button.thinking-head {
  cursor: pointer;
}

button.thinking-head:hover {
  color: var(--text);
}

.thinking-head .title {
  color: var(--text);
  font-weight: 560;
  white-space: nowrap;
}

.thinking-head .facts {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.thinking-head .q-btn:first-of-type {
  margin-left: auto;
}

.thinking-head .chevron {
  flex: none;
  font-size: calc(18px * var(--text-scale));
  color: var(--faint);
  transition: transform 0.15s ease;
}

.saved-thinking.opened .thinking-head .chevron {
  transform: rotate(90deg);
}

.thinking-body {
  padding: 0 14px 12px;
}

.thinking-note {
  margin-bottom: 6px;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.thinking-text {
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.thinking-text .chunk {
  display: inline;
}

/* --- the composer ------------------------------------------------------------------------ */

.composer {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px 18px;
}

/* The run's line and the live line under it share their columns: the dot over the chevron (both
   16px wide), the texts starting at the same place. */
.run-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 4px 6px 8px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.run-line > .dot {
  margin: 0 4.5px;
}

.run-line .what {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-line .extra {
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.run-line .q-btn {
  margin-left: auto;
}

.box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.box:focus-within {
  border-color: var(--line-strong);
}

.box .q-field {
  flex: 1;
}

.box .q-field__control, .box .q-field__native {
  color: var(--text);
  font-size: calc(15px * var(--text-scale));
  line-height: 1.55;
}

.box .q-field__native {
  padding: 7px 0;
  max-height: 220px;
}

.box .q-field__control:before, .box .q-field__control:after {
  display: none;
}

.composer .hint {
  margin-top: 6px;
  padding: 0 4px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

/* Why no run can start (the credits used up, ...): Send is off, so it says why in red
   (2026-11-20, Peter's wish). */
.composer .hint.refused {
  color: var(--failed);
}

/* What says an AI answers, and that its answers aren't advice (the web edition's, Phase 1 step
   1.13): the fixed note under the chat's box with its link (chat_page.py), and the line under
   each answer and quick answer (written_view.py ai_line), both small and quiet. */
.composer .ai-note {
  margin-top: 8px;
  padding: 0 4px;
  font-size: calc(12px * var(--text-scale));
  line-height: 1.45;
  color: var(--faint);
}

.composer .ai-note > * {
  display: inline;  /* the link goes on in the note's line */
}

/* The question box's offer (step 2.6): a long text or a picture pasted there, offered as a
   document; one quiet line under the box, gone once it is taken or let go (chat_page.py). */
.composer .paste-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin-top: 6px;
  padding: 0 4px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.composer .ai-note a {
  margin-left: 6px;
  color: inherit;
  text-decoration: underline;
}

.ai-line {
  margin-top: 8px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--faint);
}

.panel-note.adding-note {
  margin-top: 10px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

/* The run menu, a row under the box (chat_page.py settings_line): the level for the next run
   and Deep thinking at follow-ups, small and quiet. */
.next-run {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 4px;
  padding: 0 4px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.next-run .level-select .q-field__control,
.next-run .level-select .q-field__native {
  min-height: 28px;
  padding: 0;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.next-run .level-select .q-field__append {
  height: 28px;
  color: var(--faint);
}

.next-run .q-toggle__label {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

/* The web edition's kind of model beside the level (chat_page.py, 2026-11-05). */
.next-run .kind-note {
  color: var(--muted);
}

/* --- the run's live lines, under the run's line ----------------------------------------- */

/* The Director's row on the web admin's levels: Deep turns, and Also at follow-ups under it
   (ui/settings_page.py team_rows, Phase 1 step 1.11). */
.deep-switches {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The progress card (ui/progress_card.py, Phase 1 step 1.11): the users' plain steps in the
   live lines' place, in their look: its head, then every step in a box that scrolls. */
.progress-card {
  margin: 0 0 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
  overflow: hidden;
}

.progress-card.kept {
  margin: 2px 0 14px; /* a run's steps kept in the chat, under its answer */
}

/* A quick answer's time and what it cost, under it: the kept card's head's words alone (no
   step is kept, so there is nothing to open). Drawn up to the answer it belongs to: the
   messages' gap is 22px. */
.kept-line {
  display: block;
  margin: -12px 0 14px;
  font-size: calc(13px * var(--text-scale));
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  padding: 7px 12px 7px 8px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.progress-head:hover .progress-time {
  color: var(--text);
}

.progress-head .chevron {
  font-size: calc(18px * var(--text-scale));
  color: var(--faint);
}

/* The head and, the web's, its (?) (help.STEPS, 2026-11-17) in a row: the head opens the steps,
   the (?) its card. */
.progress-head-row {
  display: flex;
  align-items: center;
}

.progress-head-row .progress-head {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.progress-head-row .help-tip {
  margin: 0 10px 0 0;
}

.progress-card.opened .progress-head-row {
  border-bottom: 1px solid var(--line);
}

.progress-card:not(.opened) .progress-steps {
  display: none;
}

.progress-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress-card.opened .progress-time {
  color: var(--text);
}

.progress-steps {
  max-height: 220px;
  padding: 6px 12px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.progress-step {
  display: grid;
  grid-template-columns: 40px 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  min-height: 22px;
}

.progress-step .at {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.progress-step .mark {
  font-size: calc(15px * var(--text-scale));
  color: var(--faint);
}

.progress-step.now {
  color: var(--text);
}

.progress-step.now .mark {
  color: var(--working);
}

/* Under the latest step while it scans: the share of the scan done, in the live lines' bar's
   look (.live-bar). It starts under the step's words: the step's grid, 40 + 6 + 18 + 6. */
.progress-scan {
  display: none;
  height: 2px;
  margin: 4px 0 3px 70px;
  background: var(--line);
  border-radius: 1px;
}

.progress-scan.shown {
  display: block;
}

.progress-scan .fill {
  width: 0;
  height: 100%;
  background: var(--working);
  border-radius: 1px;
  transition: width 0.25s linear;
}

.live {
  margin: 0 0 10px;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.live-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 12px 5px 7px; /* with the border, the chevron sits under the run line's dot */
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  text-align: left;
  cursor: pointer;
}

.live-head:hover {
  color: var(--text);
}

.live-head .chevron {
  flex: none;
  font-size: calc(16px * var(--text-scale));
  color: var(--faint);
  transition: transform 0.15s ease;
}

.live.opened .live-head .chevron {
  transform: rotate(180deg);
}

.live-head .avatar-box {
  display: inline-flex;
  flex: none;
}

.live-head .who {
  flex: none;
  color: var(--text);
  font-weight: 600;
}

.live-head .tag, .live-row .tag {
  flex: none;
  color: var(--faint);
}

/* The end of the line shows (a thinking that streams in): right to left, the text cut at its
   start, the text itself left to right. */
.live-head .text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: left;
}

.live-head .text > div {
  display: inline;
  direction: ltr;
  unicode-bidi: isolate;
}

.live-head .seconds {
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.live-bar {
  height: 2px;
  margin: 0 12px 0 31px; /* under the text, not the chevron */
  background: var(--line);
  border-radius: 1px;
  opacity: 0;
}

.live-bar.shown {
  opacity: 1;
  margin-bottom: 6px;
}

.live-bar .fill {
  width: 0;
  height: 100%;
  background: var(--working);
  border-radius: 1px;
  transition: width 0.25s linear;
}

/* About fifteen lines; pinpoint.js keeps it at its bottom while you are there. */
.live-lines {
  display: none;
  height: 296px;
  padding: 8px 12px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: 1px solid var(--line);
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.live.opened .live-lines {
  display: block;
}

.live-row {
  display: grid;
  grid-template-columns: 58px 112px minmax(0, 1fr);
  column-gap: 10px;
  padding: 1px 0;
}

.live-row .at {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.live-row .who {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-weight: 600;
}

.live-row .who > .q-label, .live-row .who > div:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-row .who .avatar {
  margin-top: 1px;
}

.live-row .body > * {
  display: inline;
}

.live-row .tag {
  margin-right: 6px;
}

.live-row .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.live-row.thinking .text {
  color: var(--muted);
  font-style: italic;
}

.live-row.result .text, .live-row.note .text, .live-row.program .text {
  color: var(--muted);
}

.live-row.progress .who {
  color: var(--working);
}

/* --- buttons ----------------------------------------------------------------------------- */

.q-btn.paper {
  background: var(--paper);
  color: var(--paper-text);
  font-weight: 600;
  border-radius: 10px;
  padding: 0 16px;
  min-height: 38px;
  text-transform: none;
  letter-spacing: 0;
}

.q-btn.paper.q-btn--disabled {
  opacity: 0.35;
}

.q-btn.danger {
  background: var(--failed);
  color: var(--paper-text);
  font-weight: 600;
  border-radius: 10px;
  padding: 0 16px;
  min-height: 38px;
  text-transform: none;
  letter-spacing: 0;
}

.q-btn.quiet {
  color: var(--muted);
  border-radius: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 520;
}

.q-btn.quiet:hover {
  color: var(--text);
}

.q-btn.quiet .q-icon, .q-btn.outline .q-icon {
  font-size: calc(20px * var(--text-scale));
}

.q-btn.quiet.q-btn--round {
  width: 38px;
  height: 38px;
}

.q-btn.outline {
  color: var(--text);
  border-radius: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 540;
}

.q-btn.outline:before {
  border-color: var(--line);
}

.q-btn.outline:hover:before {
  border-color: var(--line-hover);
}

/* --- dialogs and menus ------------------------------------------------------------------- */

.q-dialog .q-card.sheet-card {
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px var(--shadow-deep);
}

.sheet-card .card-title {
  font-size: calc(18px * var(--text-scale));
  font-weight: 600;
}

.sheet-card .card-lead {
  margin-top: 6px;
  color: var(--muted);
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.55;
}

.sheet-card .error {
  min-height: 20px;
  margin-top: 6px;
  color: var(--failed);
  font-size: calc(13px * var(--text-scale));
}

.q-dialog .q-card.sheet-card.wide-card {
  width: 560px;
}

/* The Cloud levels' models and contexts (users_settings_page.py): three to a row. */
.form-row .cloud-field {
  width: 274px;
  max-width: 100%;
}

/* An account's Settings panel (users_page.py): its numbers' labels are long. */
.sheet-card .panel-field {
  width: 280px;
  max-width: 100%;
}

.sheet-card .card-lead + .card-lead {
  margin-top: 8px;
}

.sheet-card .edit-text .q-field__native {
  max-height: 260px;
}

.sheet-card .buttons {
  display: flex;
  align-self: stretch;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* A row of three (the Library's Replace, step 2.6): on a phone the buttons go onto two lines
   whole, rather than squeezing their words. */
.sheet-card .buttons.wrap-buttons {
  flex-wrap: wrap;
}

.sheet-card .buttons.wrap-buttons .q-btn {
  flex: none;
}

/* The paste window (paste_window.py, Phase 2 step 2.5): its box is the browser's own text area
   (a long text never goes through the page's connection), drawn as the window's outlined fields
   are: the look's strong line in a light look (as Quasar's hairline there), its line in a dark
   one (as pinpoint.css draws the dark fields' outline), the text's colour when it has the
   focus. While a paste is made into text, the box waits, a little faded. */
.sheet-card .paste-box {
  display: block;
  width: 100%;
  height: 240px;
  min-height: 120px;
  margin-top: 12px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.5;
}

.body--dark .sheet-card .paste-box {
  border-color: var(--line);
}

.sheet-card .paste-box:hover {
  border-color: var(--muted);
}

.sheet-card .paste-box:focus {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.sheet-card .paste-box::placeholder {
  color: var(--faint);
}

.sheet-card .paste-box.pasting {
  opacity: 0.6;
  cursor: progress;
}

.sheet-card .paste-size {
  min-height: 18px;
  margin: 4px 2px 10px;
  color: var(--faint);
  font-size: calc(12px * var(--text-scale));
  text-align: right;
}

/* A picture pasted into the window (step 2.6): shown in place of the box and its size line, from
   the browser's own copy, at most as tall as the box, with a quiet line and Remove the picture. */
.paste-card .paste-picture {
  display: none;
  margin-top: 12px;
}

.paste-card.with-picture .paste-picture {
  display: block;
}

.paste-card.with-picture .paste-box,
.paste-card.with-picture .paste-size {
  display: none;
}

.paste-card .paste-picture-image {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  object-fit: contain;
}

.paste-card .paste-picture-line {
  display: flex;
  flex-wrap: wrap;  /* on a phone the button goes under the line, whole */
  align-items: center;
  justify-content: space-between;
  gap: 2px 8px;
  margin: 4px 2px 10px;
  color: var(--faint);
  font-size: calc(12px * var(--text-scale));
}

.paste-card .paste-picture-line .q-btn {
  flex: none;
}

.sheet-card .paste-note {
  margin-top: 10px;
}

/* A new version's choice (Peter, 2026-11-14): the pasted text beside the version in use, or in
   its place; the two under each other, a long one wrapping under its own words. */
.paste-card .version-choice {
  margin-top: 10px;
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.5;
}

.paste-card .version-choice .q-radio {
  align-items: flex-start;
  margin-bottom: 4px;
}

.paste-card .version-choice .q-radio__label {
  white-space: normal;
}

.report {
  width: 100%;
  font-size: calc(15px * var(--text-scale));
  line-height: 1.65;
}

.report h1 {
  margin: 24px 0 4px;
  font-size: calc(28px * var(--text-scale));
  font-weight: 620;
  font-stretch: 87%;
  line-height: 1.2;
}

.report h2 {
  margin: 34px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: calc(19px * var(--text-scale));
  font-weight: 600;
}

.report h3 {
  margin: 26px 0 8px;
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
  color: var(--muted);
}

.report p, .report ul {
  margin: 0 0 10px;
}

.report ul {
  padding-left: 20px;
}

.report img {
  display: block;
  max-width: 100%;
  margin: 10px 0 12px;
  border-radius: 6px;
}

.report blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

.report pre {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  font-family: var(--font);
  font-size: calc(14px * var(--text-scale));
}

.report table {
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: calc(13.5px * var(--text-scale));
}

.report th, .report td {
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.report th {
  color: var(--muted);
  font-weight: 540;
}

.q-scrollarea__thumb {
  width: 5px;
  background: var(--line-hover);
  opacity: 0.6;
}

.card-note {
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.q-menu.message-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
}

.q-menu.message-menu .q-item {
  min-height: 34px;
  font-size: calc(13.5px * var(--text-scale));
}

.q-field--dark .q-field__control {
  color: var(--text);
}

.q-field--dark.q-field--outlined .q-field__control:before {
  border-color: var(--line);
}

.q-notification {
  border-radius: 10px;
}

/* --- the team's avatars (avatars.py) ----------------------------------------------------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  background: var(--raised);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-xs { width: 18px; height: 18px; }
.avatar-xs .q-icon { font-size: calc(11px * var(--text-scale)); }
.avatar-xs .initial { font-size: calc(10px * var(--text-scale)); }
.avatar-sm { width: 22px; height: 22px; }
.avatar-sm .q-icon { font-size: calc(13px * var(--text-scale)); }
.avatar-sm .initial { font-size: calc(11px * var(--text-scale)); }
.avatar-lg { width: 48px; height: 48px; }
.avatar-lg .q-icon { font-size: calc(24px * var(--text-scale)); }
.avatar-lg .initial { font-size: calc(19px * var(--text-scale)); }

.avatar .initial {
  font-weight: 640;
  line-height: 1;
}

.avatar.active {
  background: var(--paper);
  color: var(--paper-text);
  box-shadow: 0 0 0 3px rgba(var(--working-rgb), 0.28);
}

.avatar-lg.active {
  animation: avatar-breathe 2.4s ease-in-out infinite;
}

@keyframes avatar-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(var(--working-rgb), 0.30); }
  50% { box-shadow: 0 0 0 7px rgba(var(--working-rgb), 0.10); }
}

/* --- the viewer (viewer.py) -------------------------------------------------------------- */

.viewer {
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--stage);
  border-left: 1px solid var(--line);
}

.viewer-head {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--side);
}

.viewer-head > .q-btn {
  margin: 0 0 6px;
}

.viewer-tabs-box {
  flex: 1;
  min-width: 0;
}

.viewer-tabs {
  display: flex;
  min-width: 0;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.viewer-tab {
  display: flex;
  align-items: center;
  flex: none;
  max-width: 240px;
  padding: 0 2px 0 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  color: var(--muted);
}

.viewer-tab.current {
  background: var(--stage);
  border-color: var(--line);
  color: var(--text);
  margin-bottom: -1px;
}

.viewer-tab-name {
  min-width: 0;
  padding: 9px 4px 9px 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 540;
  cursor: pointer;
}

.viewer-tab-name .q-label, .viewer-tab-name div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-tab .tab-close.q-btn {
  width: 26px;
  height: 26px;
  min-height: 26px;
}

.viewer-tab .tab-close .q-icon {
  font-size: calc(16px * var(--text-scale));
}

.side-switch {
  gap: 2px;
  margin: 0 0 6px;
}

.viewer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  container-type: inline-size;  /* a narrow viewer stacks the review's and a source's sides */
}

.viewer-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
  padding: 26px 36px 48px;
}

.viewer-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.viewer-title {
  font-size: calc(24px * var(--text-scale));
  font-weight: 620;
  font-stretch: 87%;
  line-height: 1.2;
}

.viewer-page-head .q-btn {
  margin-left: auto;
}

.viewer-page .body {
  font-size: calc(15px * var(--text-scale));
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.viewer-note {
  padding: 26px 36px;
  color: var(--muted);
}

.viewer-page .viewer-note {
  padding: 0;
}

.outdated {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(var(--asking-rgb), 0.07);
  border: 1px solid rgba(var(--asking-rgb), 0.3);
  border-radius: 8px;
  color: var(--asking);
  font-size: calc(13.5px * var(--text-scale));
}

.report h1 {
  margin: 4px 0 4px;
  font-size: calc(28px * var(--text-scale));
  font-weight: 620;
  font-stretch: 87%;
  line-height: 1.2;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: -6px 0 0 -8px;
}

/* A page's or a unit's text (marked_text.py): the page reader's marks in the warm tone, its
   descriptions shaded (the model's words), a cited quote in the cool one, as DocQA's. */
.page-text {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: calc(14.5px * var(--text-scale));
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.page-mark {
  padding: 0 2px;
  background: rgba(var(--asking-rgb), 0.2);
  border-radius: 3px;
  color: var(--asking);
}

.description {
  background: rgba(var(--lift-rgb), 0.05);
  color: var(--muted);
  font-style: italic;
}

.quoted {
  background: rgba(var(--cited-rgb), 0.22);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(var(--cited-rgb), 0.32);
  color: var(--text);
}

.quote-line {
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
  color: var(--asking);
}

/* The review view (review_view.py), DocQA's: the page image beside its text, each side scrolling
   on its own; a narrow viewer puts the image over the text. */
.viewer-body > .review, .viewer-body > .source-view {
  height: 100%;
}

.review {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 12px 22px;
  border-bottom: 1px solid var(--line);
}

.review-title-box {
  flex: 1;
  min-width: 0;
}

.review-title {
  font-size: calc(17px * var(--text-scale));
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-facts {
  margin-top: 1px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

/* Where a pasted text is from (review_view.py, Phase 2 step 2.5): one quiet line, a long web
   address cut at the line's end. */
.review-origin {
  display: flex;
  gap: 4px;
  min-width: 0;
  margin-top: 1px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.review-origin .origin-link,
.review-origin .origin-words {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-origin .origin-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.review-head .q-btn.guided {
  color: var(--cited);
}

.page-arrows {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-number {
  min-width: 96px;
  font-size: calc(13px * var(--text-scale));
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--muted);
}

.review-sides {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
}

.review-sides.text-alone {
  grid-template-columns: minmax(0, 1fr);
}

.review-image {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--viewer);
  border-right: 1px solid var(--line);
}

.review-image .segmented {
  align-self: flex-start;
  margin: 10px 14px;
}

.image-box {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.page-image {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 10px 36px var(--shadow-deep);
}

.page-image.full {
  width: auto;
  max-width: none;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment {
  padding: 3px 11px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  font-size: calc(12.5px * var(--text-scale));
  font-weight: 540;
  cursor: pointer;
}

.segment:hover {
  color: var(--text);
}

.segment.current {
  background: var(--raised);
  color: var(--text);
}

.review-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.review-sides.text-alone .review-text {
  padding: 20px 36px 56px;
}

.review-sides.text-alone .review-text > * {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.review-status {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
}

.model-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.failed-line {
  color: var(--failed);
}

.locked-line {
  color: var(--faint);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-left: -8px;
}

.review-actions .q-checkbox {
  margin-left: 10px;
  font-size: calc(13.5px * var(--text-scale));
  color: var(--muted);
}

.page-editor {
  width: 100%;
}

.page-editor .q-field__native {
  min-height: 280px;
  font-size: calc(14.5px * var(--text-scale));
  line-height: 1.6;
}

.versions-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  cursor: pointer;
}

.versions-head:hover {
  color: var(--text);
}

.versions-head .chevron {
  font-size: calc(18px * var(--text-scale));
  transition: transform 0.15s ease;
}

.versions.opened .versions-head .chevron {
  transform: rotate(90deg);
}

.version-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
  padding-left: 22px;
}

.version-row {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.version-name {
  flex: 1;
  min-width: 0;
}

.version-buttons {
  display: flex;
  align-items: center;
  flex: none;
  width: 196px;  /* Show in one column, whether Use this and Delete follow or not */
}

.version-buttons .q-btn.delete:hover, .document-row .q-btn.delete:hover {
  color: var(--failed);
}

.q-dialog .q-card.sheet-card.version-card {
  display: flex;
  flex-direction: column;
  width: 780px;
  max-height: 86vh;
}

.version-card .version-text {
  min-height: 0;
  margin-top: 12px;
  overflow-y: auto;
}

@container (max-width: 760px) {
  .review-sides {
    display: block;
    overflow-y: auto;
  }

  .review-image {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .image-box {
    max-height: 70vh;
  }

  .review-text {
    overflow: visible;
  }
}

/* A library source (source_view.py): its outline as a tree beside the unit's text. */
.source-view {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 0;
}

.source-outline {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.outline-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 16px 8px;
}

.outline-title {
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
}

.outline-count {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.outline-find {
  margin: 0 12px 8px;
}

.outline-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 28px;
  font-size: calc(13px * var(--text-scale));
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.outline-tree .q-tree__node-header {
  margin-top: 1px;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--muted);
}

.outline-tree .q-tree__node-header:hover {
  color: var(--text);
}

.outline-tree .q-tree__node--selected {
  background: var(--raised);
  color: var(--text);
}

.outline-tree .q-tree__node-header:before, .outline-tree .q-tree__node:after {
  display: none;  /* Quasar's connecting lines */
}

.source-unit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 30px 56px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.unit-head {
  position: sticky;
  top: -20px;  /* the unit's padding: it stays in sight while its text scrolls */
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -20px -30px 0;
  padding: 20px 30px 10px;
  background: var(--stage);
  border-bottom: 1px solid var(--line);
}

.unit-title-box {
  flex: 1;
  min-width: 0;
}

.unit-title {
  font-size: calc(19px * var(--text-scale));
  font-weight: 600;
  line-height: 1.3;
}

.unit-facts {
  margin-top: 3px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
}

.unit-id {
  margin-top: 1px;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

@container (max-width: 680px) {
  .source-view {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 38%) minmax(0, 1fr);
  }

  .source-outline {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* The outline's tabs (Outline, Find in the text) and the places found. */
.outline-tabs {
  display: flex;
  gap: 16px;
  padding: 0 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.outline-tab {
  padding: 4px 0 7px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  cursor: pointer;
}

.outline-tab:hover {
  color: var(--text);
}

.outline-tab.current {
  color: var(--text);
  border-bottom-color: var(--paper);
}

.outline-part, .find-part {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.places {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.places-count {
  padding: 2px 8px 8px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.place {
  display: block;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.place:hover {
  background: var(--raised);
  color: var(--text);
}

.place-name {
  font-size: calc(13px * var(--text-scale));
  font-weight: 560;
  color: var(--text);
}

.place-line {
  margin-top: 2px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.place-line .hit {
  color: var(--cited);
  background: rgba(var(--cited-rgb), 0.14);
  border-radius: 3px;
}

/* --- the Library page -------------------------------------------------------------------- */

.library-folders {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.folders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 10px 20px;
}

.folders-head .title {
  font-size: calc(17px * var(--text-scale));
  font-weight: 600;
}

.library-find {
  margin: 0 12px 10px;
}

.folder-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.folder-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding-right: 8px;
  border: 1px dashed transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: calc(13.5px * var(--text-scale));
  cursor: pointer;
  user-select: none;
}

.folder-row:hover {
  color: var(--text);
}

.folder-row.current {
  background: var(--raised);
  color: var(--text);
}

.folder-row.drop-here {
  border-color: var(--paper);
  background: var(--hover);
}

.folder-row .chevron, .folder-row .chevron-room {
  flex: none;
  width: 18px;
  font-size: calc(18px * var(--text-scale));
  color: var(--faint);
}

.folder-row .folder-icon {
  flex: none;
  font-size: calc(17px * var(--text-scale));
  color: var(--faint);
}

.folder-row .folder-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-row .folder-count {
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.library-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--stage);
}

.library-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 12px;
}

.library-head .title {
  font-size: calc(20px * var(--text-scale));
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-head .facts {
  margin-top: 3px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.library-head .actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.library-head .actions .q-btn.delete {
  color: var(--faint);
}

.library-lines {
  padding: 0 28px 8px;
}

.library-lines .reading-line, .library-lines .panel-note {
  margin: 0 0 4px;
}

.library-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 28px 56px;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.library-empty {
  margin-top: 12vh;
}

.source-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.6);
}

.source-row[draggable="true"] {
  cursor: grab;
}

.source-text {
  flex: 1;
  min-width: 0;
}

.source-text .name.opens {
  display: block;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: calc(14.5px * var(--text-scale));
  font-weight: 560;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.source-text .name.opens:hover {
  text-decoration: underline;
  text-decoration-color: var(--faint);
}

.source-text .facts {
  margin-top: 2px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.45;
  color: var(--muted);
}

.source-state {
  margin-top: 3px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.45;
  color: var(--faint);
}

.source-state.working { color: var(--working); }
.source-state.waiting { color: var(--asking); }
.source-state.failed { color: var(--failed); }

.row-actions {
  display: flex;
  flex: none;
  gap: 0;
  opacity: 0.55;
  transition: opacity 0.12s ease;
}

.source-row:hover .row-actions, .row-actions:focus-within {
  opacity: 1;
}

.row-actions .q-btn .q-icon {
  font-size: calc(18px * var(--text-scale));
}

.sheet-card .card-subtitle {
  margin-top: 18px;
  font-size: calc(14px * var(--text-scale));
  font-weight: 600;
}

.sheet-card .buttons.start {
  justify-content: flex-start;
}

.sheet-card .reading-choice {
  margin-top: 12px;
  font-size: calc(13.5px * var(--text-scale));
}

.sheet-card .edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
}

.sheet-card .result-line {
  margin-top: 6px;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
}

/* --- the side panel ---------------------------------------------------------------------- */

.side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--side);
  border-left: 1px solid var(--line);
}

.side-tabs {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--line);
}

.side-tabs > .q-btn {
  margin: 0 -8px 6px auto;
}

.side-tab {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 540;
  cursor: pointer;
}

.side-tab:hover {
  color: var(--text);
}

.side-tab.current {
  color: var(--text);
  border-bottom-color: var(--paper);
}

.side-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.panel {
  display: flex;
  flex-direction: column;
}

.panel-part {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-part:last-child {
  border-bottom: 0;
}

.part-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 6px;
}

.part-title {
  font-size: calc(12px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.part-head .count {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.part-head .q-btn {
  margin-left: auto;
}

.part-head .part-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.part-head .part-actions .q-btn {
  margin-left: 0;
}

.reading-line {
  margin: -4px 0 10px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--working);
}

.size-line {
  margin-bottom: 10px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--faint);
}

.panel-note {
  margin: 4px 0 8px;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
}

.panel-link {
  margin: 14px 20px 20px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.document-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(var(--line-rgb), 0.6);
}

.document-row:first-of-type {
  border-top: 0;
}

.document-row.unused .name {
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: var(--line);
}

.document-text {
  flex: 1;
  min-width: 0;
}

.document-text .name {
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-text .name.opens {
  display: block;
  max-width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.document-text .name.opens:hover {
  text-decoration: underline;
  text-decoration-color: var(--faint);
}

.document-text .facts {
  margin-top: 1px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.45;
  color: var(--muted);
}

.document-text .facts.holding {
  color: var(--faint);
}

/* The files being added, as jobs (ui/adds_view.py, 2026-11-18): a tray of their own above the
   documents (Peter, after the step's test: the rows looked like the documents'). A box with a
   faint lift, no hairlines between the files; a file's name smaller and lighter than a
   document's; a mark in its state's colour before it; the one being added with a thin bar. */
.add-tray {
  margin: 4px 0 12px;
  padding: 8px 12px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--lift-rgb), 0.025);
}

.add-tray-head {
  margin: 0 0 6px;
  font-size: calc(12px * var(--text-scale));
  color: var(--muted);
}

.add-job {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
}

.add-job-mark {
  flex: none;
  margin-top: 1px;
  font-size: calc(16px * var(--text-scale));
  color: var(--faint);
}

.add-job.adding .add-job-mark { color: var(--working); animation: turning 1.6s linear infinite; }
.add-job.added .add-job-mark { color: var(--working); }
.add-job.not-added .add-job-mark { color: var(--failed); }
.add-job.uploading .add-job-mark { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .add-job.adding .add-job-mark { animation: none; }
  .add-job-bar > div { transition: none; }
}

.add-job-text {
  flex: 1;
  min-width: 0;
}

.add-job-name {
  font-size: calc(13px * var(--text-scale));
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-job.uploading .add-job-name {
  color: var(--muted);
}

.add-job-state {
  margin-top: 1px;
  font-size: calc(12px * var(--text-scale));
  line-height: 1.4;
  color: var(--note);
}

.add-job.adding .add-job-state { color: var(--working); }
.add-job.not-added .add-job-state { color: var(--muted); }  /* the mark says it failed */

.add-job-bar {
  height: 3px;
  margin: 6px 0 2px;
  border-radius: 2px;
  background: rgba(var(--working-rgb), 0.16);
  overflow: hidden;
}

.add-job-bar > div {
  height: 100%;
  border-radius: 2px;
  background: var(--working);
  transition: width 0.4s ease;
}

.add-job .q-btn.add-job-cancel {
  flex: none;
  margin: -6px -8px 0 0;
  color: var(--faint);
}

.add-job .q-btn.add-job-cancel:hover {
  color: var(--text);
}

.library-main .add-rows {
  padding: 0 28px;
}

.toggles {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding-top: 1px;
}

.toggles .q-btn.delete {
  margin: -4px -6px 0 0;
  color: var(--faint);
}

.toggles .q-btn.delete .q-icon {
  font-size: calc(17px * var(--text-scale));
}

.toggle {
  padding: 2px 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font: inherit;
  font-size: calc(12px * var(--text-scale));
  font-weight: 540;
  cursor: pointer;
}

.toggle:hover {
  color: var(--text);
  border-color: var(--line-hover);
}

.toggle.on {
  background: var(--raised);
  border-color: var(--line-strong);
  color: var(--text);
}

.notes-box {
  width: 100%;
}

/* Saved, or kept until the run has ended: the notes save themselves (2026-11-03). */
.part-head .notes-state {
  margin-left: auto;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
  text-align: right;
}

.notes-box .q-field__native {
  min-height: 72px;
  max-height: 320px;
  font-size: calc(14px * var(--text-scale));
  line-height: 1.55;
}

.library-actions {
  display: flex;
  gap: 2px;
  margin: 0 0 6px -8px;
}

.library-folder .q-checkbox__label {
  font-weight: 600;
  color: var(--text);
}

.library-source {
  display: flex;
  align-items: center;
}

.library-source .source-size {
  margin-left: auto;
  padding-left: 8px;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.library-source .source-open.q-btn {
  color: var(--faint);
}

.library-source .source-open .q-icon {
  font-size: calc(17px * var(--text-scale));
}

.library-source .q-checkbox__label {
  color: var(--muted);
  font-size: calc(13.5px * var(--text-scale));
  overflow-wrap: anywhere;  /* a source's name, which may be long (2026-11-03) */
}

.library-source .q-checkbox {
  min-width: 0;
}

/* The library's find box in the Sources (2026-11-03). */
.sources-find {
  margin: 0 0 8px;
}

.answer-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  border-top: 1px solid rgba(var(--line-rgb), 0.6);
}

.answer-row:first-of-type {
  border-top: 0;
}

.answer-open {
  flex: 1;
  min-width: 0;
  padding: 9px 8px 9px 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.answer-open:hover .name {
  text-decoration: underline;
  text-decoration-color: var(--faint);
}

.answer-open .name {
  font-weight: 560;
}

.answer-open .facts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.answer-open .question {
  margin-top: 3px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outdated-line {
  margin-top: 3px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--asking);
}

.answer-row > .q-btn {
  margin-top: 6px;
}

/* --- the side panel's Monitor (monitor_panel.py) ----------------------------------------- */

.now-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.now-top .phase {
  font-size: calc(16px * var(--text-scale));
  font-weight: 600;
}

.meter {
  min-width: 0;
  margin-top: 10px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: calc(12.5px * var(--text-scale));
}

.meter-title {
  color: var(--faint);
}

.meter-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.meter-bar {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  background: var(--raised);
  border-radius: 2px;
}

.meter-bar .fill {
  width: 0;
  height: 100%;
  background: var(--done);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.member-row {
  display: grid;
  grid-template-columns: 22px 78px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  padding: 5px 0;
}

.member-row .name {
  font-size: calc(13.5px * var(--text-scale));
  font-weight: 600;
  color: var(--muted);
}

.member-row.active .name {
  color: var(--text);
}

.member-row .doing {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row.active .doing {
  color: var(--text);
}

.program-row {
  display: grid;
  grid-template-columns: 10px auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
  padding: 4px 0;
}

.program-row .name {
  font-weight: 600;
  font-size: calc(13.5px * var(--text-scale));
}

.program-row .detail, .call-row .detail {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-row {
  display: grid;
  grid-template-columns: 62px 120px minmax(0, 1fr);
  column-gap: 10px;
  padding: 3px 0;
  font-size: calc(12.5px * var(--text-scale));
}

.call-row .at {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.call-row .name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-note.memory {
  margin-top: 8px;
}

/* --- the Monitor tab (monitor_panel.py: the Monitor page of step 21, from Atelier's, in the
   side panel since 2026-10-31) --------------------------------------------------------------- */

/* Its cards in two columns when the tab is wide enough (the side panel dragged wider: a query on
   the tab's own width, as the Monitor page's was on the window's), else in one. */
.monitor-panel {
  container: monitor / inline-size;
}

.monitor-panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--side);
  border-bottom: 1px solid var(--line);
}

.monitor-panel-head .run-select {
  width: min(380px, 100%);
}

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1680px;
  padding: 16px 20px 40px;
}

@container monitor (min-width: 1200px) {
  .monitor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.monitor-panel .card {
  background: var(--stage);
}

.card {
  min-width: 0;
  padding: 16px 18px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.card.wide {
  grid-column: 1 / -1;
}

.card-head {
  margin-bottom: 12px;
  font-size: calc(12px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.card .card-part {
  margin: 16px 0 6px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-top .q-btn-toggle {
  margin-left: auto;
}

.monitor-grid .now-top {
  flex-wrap: wrap;
  margin-bottom: 0;
}

.monitor-grid .now-top .phase {
  font-size: calc(18px * var(--text-scale));
}

.now-top .budget {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.now-top .budget .meter {
  width: 220px;
  margin-top: 0;
}

.now-line {
  min-height: 1.45em;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 12px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.member.active {
  background: var(--raised);
  border-color: var(--line);
}

.member .name {
  font-size: calc(13.5px * var(--text-scale));
  font-weight: 600;
}

.member .status {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  font-size: calc(12px * var(--text-scale));
  line-height: 1.3;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.member.active .status {
  color: var(--text);
}

.monitor-grid .meter {
  margin-top: 4px;
}

.meter-bar.empty {
  visibility: hidden;
}

.card .chart {
  width: 100%;
  height: 120px;
  margin: 4px 0 12px;
}

.span-toggle {
  border: 1px solid var(--line);
}

/* A choice of two or three (ui.toggle): the one chosen in light paper, as a kind chip. Quasar
   gives it text-white, an !important in NiceGUI's layers that an unlayered rule can't beat: the
   text's own colour is set instead. */
.q-btn-toggle .q-btn .q-btn__content {
  color: var(--muted);
}

.q-btn-toggle .q-btn.bg-primary .q-btn__content {
  color: var(--paper-text);
  font-weight: 600;
}

.span-toggle .q-btn {
  font-size: calc(12px * var(--text-scale));
}

.span-note {
  margin: 4px 0 6px;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.monitor-grid .program-row {
  padding: 5px 0;
}

.monitor-grid .program-row .detail {
  white-space: normal;
}

.program-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 8px 20px;
}

.program-actions .q-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: calc(12.5px * var(--text-scale));
}

.handover {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 2px 0;
  font-size: calc(12.5px * var(--text-scale));
}

.handover .text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.handover .at, .event .at, .call-line .at, .live-line .at {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.handovers-all {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.handovers-all .q-item {
  min-height: 36px;
  padding: 4px 0;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.handovers-all .handovers {
  max-height: 260px;
  overflow-y: auto;
}

/* A list of a run's rows, newest first, a page at a time (Rows): it scrolls, and loads older
   rows near its end. */
.rows {
  max-height: 460px;
  overflow-y: auto;
  font-size: calc(12.5px * var(--text-scale));
}

.rows.handovers {
  max-height: 200px;
}

.rows.live-rows, .rows.new-files {
  max-height: 520px;
}

.rows-more.q-btn {
  margin: 6px 0 2px;
  min-height: 28px;
  font-size: calc(12.5px * var(--text-scale));
}

.rows-empty {
  padding: 4px 0;
}

.speed-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.figure-title {
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.figure-value {
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.call-line {
  display: grid;
  grid-template-columns: 64px 150px minmax(0, 1fr) 120px 72px 64px 84px 64px;
  align-items: center;
  column-gap: 14px;
  padding: 3px 0;
  font-size: calc(12.5px * var(--text-scale));
}

/* The web edition's: Took holds a Cloud call's cost too ("1.2 min · $0.004" is 83px). */
.call-line.costs {
  grid-template-columns: 64px 150px minmax(0, 1fr) 120px 72px 92px 84px 64px;
}

.call-line > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.call-line.call-head {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: calc(11.5px * var(--text-scale));
  color: var(--faint);
}

.call-line .who {
  display: flex;
  align-items: center;
  gap: 6px;
}

.call-line .calls-made {
  color: var(--muted);
}

.kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.kind-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 11px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: calc(12.5px * var(--text-scale));
  cursor: pointer;
}

.kind-chip .count {
  font-size: calc(11.5px * var(--text-scale));
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.kind-chip.none {
  opacity: 0.5;
}

.kind-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.kind-chip.current {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--paper-text);
  font-weight: 600;
}

.kind-chip.current .count {
  color: var(--paper-text);
}

.event {
  display: grid;
  grid-template-columns: 64px 64px minmax(0, 1fr);
  column-gap: 10px;
  padding: 4px 0;
  border-top: 1px solid rgba(var(--line-rgb), 0.6);
}

.event .kind {
  color: var(--faint);
}

.event .text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event.kind-error .kind, .event.kind-error .text {
  color: var(--failed);
}

.event.kind-budget .kind {
  color: var(--asking);
}

.live-line {
  display: grid;
  grid-template-columns: 58px 112px minmax(0, 1fr);
  column-gap: 10px;
  padding: 3px 0;
  border-top: 1px solid rgba(var(--line-rgb), 0.6);
}

.live-line .who {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-weight: 600;
}

.live-line .who > .q-label, .live-line .who > div:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-line .body {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.live-line .body > * {
  display: inline;
}

.live-line .tag {
  margin-right: 6px;
  color: var(--faint);
}

.live-line .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.live-line.kind-thinking .text {
  color: var(--muted);
  font-style: italic;
}

.live-line.kind-result .text, .live-line.kind-note .text, .live-line.kind-program .text {
  color: var(--muted);
}

.live-line.kind-progress .who {
  color: var(--working);
}

.new-file {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 2px 0;
  border-top: 1px solid rgba(var(--line-rgb), 0.6);
}

.new-file .kind {
  font-size: calc(16px * var(--text-scale));
  color: var(--faint);
}

.new-file .path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(13px * var(--text-scale));
}

.new-file .meta {
  white-space: nowrap;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.new-file .q-btn.quiet.q-btn--round {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.new-file .q-btn .q-icon {
  font-size: calc(16px * var(--text-scale));
}

@container monitor (max-width: 840px) {
  .now-top .budget {
    margin-left: 0;
    width: 100%;
  }
}

/* --- the Settings page (settings_page.py, step 21, from Atelier's) ------------------------ */

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 960px;
  padding: 22px 28px 120px;
}

.settings-card .card-head {
  margin-bottom: 2px;
}

.settings-card .card-lead {
  margin-bottom: 16px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.settings-card .card-note {
  margin-top: 6px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--faint);
}

.settings-part {
  margin: 18px 0 8px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-row .field {
  width: 200px;
}

.form-row .field-large {
  width: 300px;
}

.field-wide {
  flex: 1;
  min-width: 240px;
}

.field-label {
  font-size: calc(13.5px * var(--text-scale));
  color: var(--muted);
}

.choice-toggle {
  border: 1px solid var(--line);
}

.path-field {
  margin-bottom: 10px;
}

.path-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.path-input {
  flex: 1;
  min-width: 0;
}

.field-note {
  min-height: 1.3em;
  margin: 3px 2px 0;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.field-note.missing {
  color: var(--asking);
}

.profile {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.profile.opened {
  background: var(--stage);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-head .chevron {
  font-size: calc(18px * var(--text-scale));
  color: var(--faint);
}

.profile-head .name {
  font-weight: 600;
}

.profile-head .summary {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.chip {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: calc(11.5px * var(--text-scale));
  color: var(--muted);
}

.chip.in-use {
  border-color: rgba(var(--working-rgb), 0.5);
  color: var(--working);
}

.profile-body {
  padding: 6px 14px 14px 40px;
}

.profile-body .field-wide {
  width: 100%;
  margin-bottom: 8px;
}

.profile-fact {
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.6;
  color: var(--muted);
}

.sampling-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.problem-text {
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
  color: var(--failed);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.file-view {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-view .q-item {
  min-height: 36px;
  padding: 4px 12px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.file-view .q-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-code {
  width: calc(100% - 16px);
  max-height: 360px;
  margin: 0 8px 8px;
  overflow: auto;
  font-size: calc(12px * var(--text-scale));
}

.profile-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.test-page {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.test-page .q-btn {
  align-self: flex-start;
}

.upload.q-uploader {
  width: 100%;
  max-height: 160px;
  background: var(--side);
  border: 1px dashed var(--line-dashed);
  border-radius: 8px;
  box-shadow: none;
  color: var(--text);
}

.upload .q-uploader__header {
  background: var(--raised);
  color: var(--text);
}

.upload .q-uploader__subtitle {
  color: var(--faint);
}

.upload .q-uploader__list {
  display: none;  /* the page says what it took */
}

.test-log {
  max-height: 260px;
  margin-top: 12px;
  padding: 10px 12px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
}

.test-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.test-line.passed { color: var(--working); }
.test-line.failed { color: var(--failed); }

/* The effort levels on the Settings page (settings_page.py: team): the levels in tabs, as the
   side panel's, the one a new project starts with marked default. */
.level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px 0 6px;
  border-bottom: 1px solid var(--line);
}

.level-tab {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 540;
  cursor: pointer;
}

.level-tab:hover {
  color: var(--text);
}

.level-tab.current {
  color: var(--text);
  border-bottom-color: var(--paper);
}

.level-tab .default {
  font-size: calc(11px * var(--text-scale));
  font-weight: 400;
  color: var(--faint);
}

.team-rows {
  display: flex;
  flex-direction: column;
}

.role-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 160px 190px;
  align-items: center;
  column-gap: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(var(--line-rgb), 0.6);
}

.role-row:first-child {
  border-top: 0;
}

.role-text .name {
  font-weight: 600;
}

.role-text .work {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.role-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.role-row.off .role-text, .role-row.off .avatar {
  opacity: 0.45;
}

.role-row .always {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px 28px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 32px var(--shadow-bar);
}

.save-bar .what {
  margin-right: auto;
  color: var(--text);
}

@media (max-width: 900px) {
  .role-row {
    grid-template-columns: 22px minmax(0, 1fr);
    row-gap: 6px;
  }
}

/* --- the Instructions page (instructions_page.py, context_view.py, step 21) --------------- */

.instructions-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  width: 100%;
  max-width: 1280px;
  padding: 22px 28px 80px;
}

.instr-list {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  padding-right: 4px;
  overflow-y: auto;
}

.instr-section {
  margin: 14px 8px 4px;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.instr-section:first-child {
  margin-top: 0;
}

.instr-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  text-align: left;
  cursor: pointer;
}

.instr-item:hover {
  background: var(--hover);
  color: var(--text);
}

.instr-item.current {
  background: var(--raised);
  color: var(--text);
}

.instr-item .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instr-icon {
  font-size: calc(17px * var(--text-scale));
  color: var(--faint);
}

.instr-icon.big {
  font-size: calc(22px * var(--text-scale));
}

.instr-state {
  margin-left: auto;
  font-size: calc(11px * var(--text-scale));
  color: var(--faint);
}

.instr-state.unsaved {
  color: var(--asking);
}

.instr-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.instr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.instr-title {
  font-size: calc(18px * var(--text-scale));
  font-weight: 600;
}

.instr-part {
  margin: 24px 0 4px;
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
}

.instr-lead {
  margin-bottom: 4px;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.instr-lead.faint {
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.instr-editor {
  height: auto;  /* as tall as its text, up to max-height */
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.instr-editor .cm-editor {
  height: auto;
  min-height: 140px;
  max-height: 62vh;
  background: var(--card);
  font-size: calc(13px * var(--text-scale));
}

.instr-editor .cm-scroller {
  overflow: auto;
}

.instr-editor.read-only .cm-editor {
  max-height: 46vh;
}

.instr-editor .cm-gutters {
  background: var(--card);
  border-right: 1px solid var(--line);
  color: var(--faint);
}

.instr-editor .cm-activeLine, .instr-editor .cm-activeLineGutter {
  background: rgba(var(--lift-rgb), 0.035);
}

.instr-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.instr-actions .what {
  margin-right: auto;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.instr-actions .what.unsaved {
  color: var(--asking);
}

.diff {
  max-height: 320px;
  margin-top: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: calc(12px * var(--text-scale));
  line-height: 1.5;
}

.diff-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--faint);
}

.diff-line.added { color: var(--working); }
.diff-line.removed { color: var(--failed); }
.diff-line.hunk { margin-top: 6px; color: var(--muted); }

.context-box {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.msg.q-expansion-item {
  align-self: stretch;
  width: 100%;
  margin-top: 6px;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.msg .q-item {
  min-height: 40px;
  padding: 6px 12px;
}

.msg .q-item__label {
  font-size: calc(13px * var(--text-scale));
  color: var(--text);
}

.msg .q-item__label--caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.msg .q-expansion-item__content {
  padding: 0 12px 10px;
}

.msg.system .q-item__label:first-child,
.msg.answer .q-item__label:first-child {
  font-weight: 600;
}

.msg.note .q-item__label:first-child {
  color: var(--asking);
}

.msg.helper {
  margin-top: 8px;
}

.msg-part {
  margin: 10px 0 6px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.msg-text {
  max-height: 520px;
  padding: 8px 10px;
  overflow-y: auto;
  background: var(--stage);
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: calc(12px * var(--text-scale));
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.msg-text.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .instructions-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .instr-list {
    position: static;
    max-height: none;
  }
}

/* --- choosing a folder or a file (path_picker.py, from Atelier) --------------------------- */

.q-dialog .q-card.picker-card {
  width: 620px;
}

.picker-drives {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 10px;
}

.picker-card .picker-bar, .picker-card .picker-list {
  align-self: stretch;
}

.picker-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.picker-where {
  flex: 1;
}

.picker-list {
  display: flex;
  flex-direction: column;
  height: 340px;
  margin-top: 10px;
  padding: 4px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.picker-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: calc(13px * var(--text-scale));
  text-align: left;
  cursor: pointer;
}

.picker-entry .q-icon {
  font-size: calc(18px * var(--text-scale));
  color: var(--faint);
}

.picker-entry:hover {
  background: var(--hover);
}

.picker-entry.chosen {
  background: var(--paper);
  color: var(--paper-text);
}

.picker-entry.chosen .q-icon {
  color: var(--paper-text);
}

/* --- the web edition: the pages before a login and Your account (web/, W3) --------------- */

.sign-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  padding: 32px 16px;
  background: var(--stage);
}

.sign-in-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 400px;
  max-width: 100%;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px var(--shadow-soft);
}

.sign-in-card .wordmark {
  padding: 0;
}

.sign-in-card .card-title {
  font-size: calc(18px * var(--text-scale));
  font-weight: 600;
}

.sign-in-card .card-lead {
  color: var(--muted);
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.55;
}

.sign-in-card .card-note {
  margin: 0;
}

.sign-in-card .error {
  min-height: 20px;
  color: var(--failed);
  font-size: calc(13px * var(--text-scale));
}

.sign-in-card .q-btn {
  align-self: flex-start;
}

/* Log in's second step (the authenticator app's code) has a look of its own, so nobody takes
   it for the email's code asked again: a line that the first step is done, then a framed
   panel with its icon and heading (web/sign_in.py _second_step). */
.second-done {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: calc(13.5px * var(--text-scale));
}

.second-done .q-icon {
  color: var(--done);
  font-size: calc(18px * var(--text-scale));
}

.second-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--stage); /* set into the card: the page's own ground, in every look */
}

.second-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.second-head .second-icon {
  flex: none;
  width: calc(38px * var(--text-scale));
  height: calc(38px * var(--text-scale));
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: calc(20px * var(--text-scale));
  color: var(--text);
}

.second-title {
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
  line-height: 1.3;
}

.second-app {
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
  line-height: 1.3;
}

.sign-in-link {
  color: var(--text);
}

/* How the user uses DokuLumen (web/audience_page.py, Phase 1 step 1.13): the two choices, on
   its page and on Your account's card. */
.use-choice {
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.5;
}

.use-choice .q-radio {
  align-items: flex-start;
  margin-bottom: 6px;
}

.use-choice .q-radio__label {
  white-space: normal;
}

/* The legal pages (web/legal.py, Phase 1 step 1.9): their links under a card and on Your account,
   the links to read before accepting, and the pages themselves (a column to read). */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-size: calc(12.5px * var(--text-scale));
}

.legal-links a,
.legal-languages a {
  color: var(--muted);
  text-decoration: none;
}

.legal-read a {
  color: var(--muted);
}

.legal-links a:hover,
.legal-read a:hover,
.legal-languages a:hover {
  color: var(--text);
  text-decoration: underline;
}

.settings-card .legal-links {
  justify-content: flex-start;
  margin-top: 6px;
  font-size: calc(13.5px * var(--text-scale));
}

.sign-in-row.legal-read {
  gap: 4px 12px;
  margin: -4px 0 0 0;
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
}

.legal {
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  padding: 32px 16px 48px;
  background: var(--stage);
}

.legal-head,
.legal-text,
.legal > .legal-links {
  max-width: 760px;
  margin: 0 auto;
}

.legal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.legal-home {
  padding: 0;
  color: var(--text);
  text-decoration: none;
}

.legal-languages {
  display: flex;
  gap: 14px;
  font-size: calc(13.5px * var(--text-scale));
}

.legal-languages a.chosen {
  color: var(--text);
  font-weight: 600;
}

/* Log in's and an invitation's language switch, at the top right of the card (step 1.15) */
.sign-in-languages {
  justify-content: flex-end;
  margin-bottom: -8px;
}

/* the admin's Texts page: a text's English as the code writes it (web/texts_page.py) */
.text-key {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: calc(12.5px * var(--text-scale));
  white-space: pre-wrap;
}

.legal-text {
  color: var(--text);
  font-size: calc(15px * var(--text-scale));
  line-height: 1.6;
}

.legal-text h1 {
  margin: 0 0 4px;
  font-size: calc(26px * var(--text-scale));
  font-weight: 600;
  line-height: 1.25;
}

.legal-text h2 {
  margin: 28px 0 8px;
  font-size: calc(18px * var(--text-scale));
  font-weight: 600;
}

.legal-text h3 {
  margin: 20px 0 6px;
  font-size: calc(15.5px * var(--text-scale));
  font-weight: 600;
}

.legal-text p,
.legal-text ul,
.legal-text ol {
  margin: 8px 0;
}

.legal-text ul,
.legal-text ol {
  padding-left: 22px;
}

.legal-text li + li {
  margin-top: 4px;
}

.legal-text a {
  color: var(--text);
}

.legal > .legal-links {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* The login's steps (Phase 1, step 1.4): the email, the code, the second step. */
.sign-in-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sign-in-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: -8px;
}

/* The Site page's second step: the key to type, the recovery codes shown once. */
.second-key,
.recovery-codes {
  width: max-content;
  max-width: 100%;
  margin: 6px 0;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: calc(15px * var(--text-scale));
  letter-spacing: 0.04em;
  user-select: all;
}

.second-key {
  overflow-wrap: anywhere;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 6px 28px;
}

/* The key as a QR code (web/second_step.py, step 1.17): black on white with its own margin, so
   an authenticator app scans it on the dark page too; square on a narrow screen too (a QR
   code squeezed one way doesn't scan). */
.second-qr {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 10px 0 8px;
  border-radius: 8px;
  background: #fff;
}

.settings-card .card-note.warning-note {
  color: var(--asking);
}

/* Your account's Terms card, a new version to accept (2026-11-19, Peter: the boxes ran on in a
   line): each box, the note under them and the texts' links on a line of their own, as on
   /accept. */
.settings-card .terms-boxes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 6px;
}

.account-value {
  font-size: calc(20px * var(--text-scale));
  font-weight: 600;
}

/* Your account's credits (2026-11-20): below zero, the word on why beside them, under them on a
   narrow screen. */
.credits-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 14px;
}

.settings-card .credits-line .card-note {
  margin-top: 0;
}

/* Your account's credits, once a notice that a task uses credits is off (2026-11-23): the word,
   and the button that shows them again, under it on a narrow screen. */
.notices-again {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  margin-top: 8px;
}

.settings-card .notices-again .card-note {
  margin-top: 0;
}

/* Your account's Your data (Download my data, Phase 1 step 1.8): the zip being made. */
.making-zip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

/* --- the web admin's Activity page (web/activity_page.py, Phase 1 step 1.2) ------------- */

.settings-body.activity-body {
  max-width: 1280px;
}

.activity-glance {
  display: grid;
  grid-template-columns: minmax(180px, 260px) repeat(2, 110px);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  width: max-content;
  max-width: 100%;
}

.activity-glance > * {
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  font-size: calc(13px * var(--text-scale));
}

.activity-glance > .glance-head {
  border-top: 0;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.activity-glance > .glance-what {
  color: var(--muted);
}

.activity-glance > .glance-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* A credit history (Your account, the Users page; Phase 1 step 1.5): when, what, credits; the
   admin's the dollars too, the user's the balance after each line (2026-11-20). */
.credit-history {
  display: grid;
  grid-template-columns: max-content minmax(160px, 1fr) max-content;
  gap: 6px 24px;
  max-height: 360px;
  overflow-y: auto;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.credit-history.with-dollars,
.credit-history.with-balance {
  grid-template-columns: max-content minmax(160px, 1fr) max-content max-content;
}

.credit-history .credit-number {
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Its columns' names (Your account's), in sight while the lines scroll. */
.credit-history .credit-head {
  position: sticky;
  top: 0;
  overflow: hidden;
  padding-bottom: 4px;
  background: var(--card);
  color: var(--faint);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Your account's invitations (Invite someone, Phase 1 step 1.6): whom, and their state. */
.invitation-list {
  display: grid;
  grid-template-columns: minmax(160px, max-content) minmax(160px, 1fr);
  gap: 6px 24px;
  max-height: 360px;
  overflow-y: auto;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* The Credits page's months (web/credits_page.py, Phase 1 step 1.5). */
.activity-glance.credit-months {
  grid-template-columns: minmax(180px, 240px) repeat(2, 150px);
}

/* The Credits page's levels (2026-11-23): a row a Cloud level, its rate, what a question costs
   as the users see it (from, to) and its recent questions, the admin's only. */
.credit-levels {
  display: grid;
  grid-template-columns: max-content 140px 120px 120px minmax(240px, 1fr);
  gap: 8px 14px;
  align-items: center;
  max-width: 100%;
  overflow-x: auto;
}

.credit-levels > .levels-head {
  font-size: calc(12px * var(--text-scale));
  font-weight: 600;
  color: var(--faint);
}

.credit-levels > .levels-name {
  font-size: calc(13.5px * var(--text-scale));
}

.credit-levels > .levels-recent {
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.credit-levels .levels-dollars {
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

.needs-look-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: calc(13px * var(--text-scale));
  color: var(--asking);
}

.found-count {
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.activity-table {
  display: grid;
  grid-template-columns: 170px minmax(160px, 1fr) 170px minmax(240px, 2fr);
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}

.activity-table > * {
  min-width: 0;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  font-size: calc(12.5px * var(--text-scale));
  overflow-wrap: anywhere;
}

.activity-table > .activity-head {
  border-top: 0;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.activity-table > .activity-cell {
  color: var(--muted);
}

.activity-table > .activity-cell.what {
  color: var(--text);
}

.activity-table > .activity-cell.time {
  font-variant-numeric: tabular-nums;
}

/* The Activity page's line to the Statistics page, under what needs a look. */
.settings-card a.card-note.to-statistics {
  display: block;
  width: fit-content;
  margin-top: 10px;
  text-decoration: none;
}

.settings-card a.card-note.to-statistics:hover {
  color: var(--text);
  text-decoration: underline;
}

/* --- the web admin's Statistics page (web/statistics_page.py, Phase 2 step 2.3a) --------- */

/* A period's numbers, group by group: each group a small table, side by side as they fit. */
.stat-groups {
  width: 100%; /* in a dialog too, whose card doesn't stretch its parts */
  columns: 3 290px;
  column-gap: 20px;
  margin-top: 12px;
}

.stat-group {
  break-inside: avoid;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.stat-head {
  padding: 7px 14px;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  font-size: calc(13px * var(--text-scale));
}

.stat-what {
  color: var(--muted);
}

.stat-number {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The days' and the months' tables: a period's name, then its main numbers. */
/* The Statistics page's views (the site, run by run, user by user), chosen at its top. */
.choice-toggle.stat-views {
  align-self: flex-start;
}

/* The page takes the window's width: its lists are wide. */
.settings-body.activity-body.stat-body {
  max-width: 1720px;
}

/* Its two lists, a row a run and a row a user (the page sets as many columns as the list
   has): a cell is never broken in two, a head of several words may stand in two lines, so
   the list fits a wide window; in a narrower one it is scrolled sideways in its card. */
.activity-table.list-table > * {
  min-width: auto; /* a column is never narrower than its cells */
  padding: 7px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.activity-table.list-table > .activity-head {
  white-space: normal;
  line-height: 1.35;
}

/* ... but a log line's own words (the server's view): they may be long, so they wrap. */
.activity-table.list-table > .words {
  white-space: normal;
  color: var(--muted);
}

.list-table > .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.list-table > .activity-cell.number {
  color: var(--text);
}

.activity-table.stat-table {
  /* its columns: web/statistics_page.py STAT_GRID, a column for each number it shows */
  margin-top: 12px;
}

.stat-table > * {
  white-space: nowrap;
  overflow-wrap: normal;
}

.stat-table > .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stat-table > .activity-cell.number {
  color: var(--text);
}

/* a period's name: a button that opens all its numbers */
.stat-table > button.stat-period {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: calc(12.5px * var(--text-scale));
  text-align: left;
  cursor: pointer;
}

.stat-table > button.stat-period:hover {
  text-decoration: underline;
}

.stat-table > button.stat-period:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* a year's row, over its months */
.stat-table > .year,
.stat-table > button.stat-period.year {
  background: var(--raised);
  font-weight: 600;
}

/* the dialog with all the numbers of a period */
.q-dialog .q-card.sheet-card.stat-sheet {
  width: 1040px;
}

/* --- the web admin's Feedback page (web/feedback_page.py, Phase 2 step 2.4) -------------- */
/* The shares of thumbs up side by side, as the window allows; then the opinions, one under the
   other: a head line (the thumb, its time, the account), the run's and the answer's facts in the
   notes' colour, the user's comment as a quote, the question and answer they sent folded. */

.settings-body.activity-body.feedback-body {
  max-width: 1280px;
}

.feedback-shares {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 12px;
}

.feedback-share {
  flex: 1 1 300px;
  min-width: 0;
}

.feedback-share.wide {
  flex-basis: 100%;  /* the instructions: their days too, a row of their own */
}

.feedback-share .stat-head {
  padding-left: 0;
}

.feedback-share .activity-table {
  overflow-x: auto;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.feedback-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.feedback-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.feedback-thumb {
  font-size: calc(17px * var(--text-scale));
}

.feedback-thumb.up {
  color: var(--working);
}

.feedback-thumb.down {
  color: var(--failed);
}

.feedback-kind {
  font-size: calc(14px * var(--text-scale));
  font-weight: 600;
  color: var(--text);
}

.feedback-when,
.feedback-who {
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.feedback-facts {
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--note);
}

.feedback-comment {
  margin-top: 6px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-strong);
  font-size: calc(14px * var(--text-scale));
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.feedback-sent {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feedback-sent .q-item {
  min-height: 0;
  padding: 7px 12px;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

.feedback-sent .q-expansion-item__content {
  padding: 0 12px 12px;
}

.feedback-sent-head {
  margin-top: 8px;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.feedback-sent-text {
  margin-top: 4px;
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

/* --- the web admin's Duties page (web/duties_page.py, Phase 2 step 2.3) ------------------ */

.duty-steps {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.55;
  color: var(--muted);
}

.duty-steps > li + li {
  margin-top: 5px;
}

.duties-table {
  /* Account, a day, a day, What to do */
  grid-template-columns: minmax(200px, 1.2fr) 150px 150px minmax(260px, 2fr);
  margin: 0;
}

.duties-table > a.activity-cell {
  text-decoration: none;
}

.duties-table > a.activity-cell:hover {
  text-decoration: underline;
}

/* What to do about an unused account: its words, then the button that notes the warning. */
.duties-table > .duty-todo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.duties-table > .duty-todo .q-btn {
  min-height: 30px; /* in a table's row: smaller than a card's own buttons */
  padding: 0 10px;
  font-size: calc(13px * var(--text-scale));
}

/* the Users page's line on what is due (a link to the Duties page) */
.monitor-head a.facts.due {
  display: block;
  width: fit-content;
  color: var(--asking);
  text-decoration: none;
}

.monitor-head a.facts.due:hover {
  text-decoration: underline;
}

/* --- the web admin's Users page (web/users_page.py, W4) --------------------------------- */

.users-body {
  width: 100%;
  padding: 22px 28px 80px;
  overflow-x: auto;
}

.users-table {
  display: grid;
  /* User, Now, Last active, Projects and documents, GPU time, Credits, Storage, Account
     ends, Last login, the menu */
  grid-template-columns:
    minmax(220px, 2fr) minmax(150px, 1.3fr) minmax(120px, 1fr)
    repeat(4, minmax(150px, 1.2fr)) repeat(2, minmax(120px, 1fr)) 52px;
  min-width: 1500px;
  max-width: 1920px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.users-table > * {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.users-table > .users-head {
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 0;
  font-size: calc(12px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.users-table .users-cell {
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
}

.user-cell .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 560;
}

.user-cell .state {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--faint);
}

.user-cell .invited-by {
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
  overflow-wrap: anywhere;
}

/* Anthropic's word on the account (Phase 1 step 1.7): its profile restricted, many refusals. */
.user-cell .anthropic-status {
  font-size: calc(12px * var(--text-scale));
  font-weight: 560;
  color: var(--failed);
}

.user-cell .refusals {
  font-size: calc(12px * var(--text-scale));
  font-weight: 560;
  color: var(--asking);
}

.user-cell .state::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--idle);
  vertical-align: 1px;
}

/* Who has the GPU (2026-11-03): its call goes on, it holds the GPU, it waits for it. */
.users-table .now.working { color: var(--working); }
.users-table .now.holding { color: var(--text); }
.users-table .now.waiting { color: var(--asking); }

/* A usage's share used, as a bar under its words (2026-11-03). */
.users-table .usage .usage-bar {
  height: 5px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.users-table .usage .usage-fill {
  height: 100%;
  border-radius: 3px;
}

/* Under a user's storage bar: what their whole folder takes on the server, against the
   server's own limit (2026-11-05). */
.users-table .usage .usage-note {
  margin-top: 4px;
  font-size: calc(11.5px * var(--text-scale));
  color: var(--faint);
}

.usage-bar.green .usage-fill { background: var(--working); }
.usage-bar.amber .usage-fill { background: var(--asking); }
.usage-bar.red .usage-fill { background: var(--failed); }

.user-cell .state.active::before { background: var(--working); }
.user-cell .state.invited::before { background: var(--asking); }
.user-cell .state.suspended::before, .user-cell .state.ended::before { background: var(--failed); }

.example-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

/* --- a band across the top of the page: the admin's read-only view of an account (W6b;
   web/view.py, ui/viewing.py), the GPU worker's pages (W7; worker/pages.py), the web admin's
   pages and the GPU not available (2026-11-03; ui/sidebar.py) ------------------------------ */
/* The band says where the page is; the page sits under it (body.with-band). Its colours are its
   kind's: the view's amber, the worker's blue, the admin's red, the GPU's violet, the admin's
   banner green, the Terms to accept the view's amber (2026-11-19: a user never sees the view).
   The banner, the Terms' band and the GPU's band may show together: they stack in that order
   (body.two-bands, body.three-bands; ui/sidebar.py update_band). */

body.with-band {
  --page-band: 34px;
}

body.with-band.two-bands {
  --page-band: 68px;
}

body.with-band.three-bands {
  --page-band: 102px;
}

.page-band {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 16px;
  background: var(--band-background);
  border-bottom: 1px solid var(--band-line);
  color: var(--text);
  font-size: calc(13px * var(--text-scale));
}

.view-band { --band-background: var(--view-band); --band-line: var(--asking); }
.worker-band { --band-background: var(--worker-band); --band-line: var(--worker-line); }
/* The web edition's (2026-11-03): the admin's pages, and the GPU not available to the user. */
.admin-band { --band-background: var(--admin-band); --band-line: var(--admin-line); }
.gpu-band { --band-background: var(--gpu-band); --band-line: var(--gpu-line); }
.notice-band { --band-background: var(--notice-band); --band-line: var(--notice-line); }
.terms-band { --band-background: var(--view-band); --band-line: var(--asking); }
.page-band.second { top: 34px; }
.page-band.third { top: 68px; }

.page-band .q-icon {
  color: var(--band-line);
  font-size: calc(18px * var(--text-scale));
}

.page-band .band-what {
  min-width: 0;  /* a long line ends in "…" before a link after it, on a phone too */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-band .band-link {
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
  color: var(--text);
  font-weight: 560;
  text-underline-offset: 3px;
}

.page-band a.band-link {
  text-decoration: underline;
}

body.with-band .app {
  height: calc(100vh - var(--page-band));
  margin-top: var(--page-band);
}

@media (max-width: 1499px) {
  body.with-band :is(.workspace > .side, .app > .viewer) {
    top: var(--page-band);  /* the narrow window's drawer and viewer, under the band */
  }
  /* ... and the viewer with the drawer opened over it: the rule that places it then names one
     class more than the rule above, and put it at the top again, its head under the band
     (found on 2026-11-14, with the admin's banner shown). */
  body.with-band .workspace.viewer-open.side-first > .viewer {
    top: var(--page-band);
  }
}

/* The read-only view: the controls that would change something are dimmed and take no click
   (the server lets their events through neither); those marked .viewing (the tabs, the viewer,
   the thinking, the find boxes) work. */

body.read-only-view :is(.q-btn, .q-checkbox, .q-toggle, .q-chip, button):not(.viewing) {
  opacity: 0.4;
  pointer-events: none;
}

body.read-only-view .q-field:not(.viewing) {
  opacity: 0.75;  /* the user's text in it is read */
  pointer-events: none;
}

/* --- the GPU worker's pages (worker/pages.py, W7) --------------------------------------- */

.worker-state {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: calc(18px * var(--text-scale));
  font-weight: 600;
}

.worker-state .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--idle);
  flex: none;
}

.worker-state .dot.working { background: var(--working); }
.worker-state .dot.finished { background: var(--done); }
.worker-state .dot.asking { background: var(--asking); }

.program-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.program-row:first-of-type {
  border-top: 0;
}

.program-row .name {
  min-width: 220px;
  font-weight: 560;
}

.program-row .facts {
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
}

.calls-table {
  display: grid;
  /* When, Whose, The model, Time, Prompt, Output, Cost, How it ended (2026-11-03: the tokens;
     2026-11-05: the Cloud's cost) */
  grid-template-columns:
    auto minmax(0, 1.4fr) minmax(0, 1fr) auto minmax(0, 1.1fr) minmax(0, 1fr) auto auto;
  overflow-x: auto;
}

/* The worker's page is wider than a settings page: its calls have eight columns. */
.settings-body.worker-body {
  max-width: 1440px;
}

.calls-table > * {
  min-width: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calls-table > .users-head {
  border-top: 0;
  font-size: calc(12px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.calls-table > .users-cell {
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}

/* The Site page's Backups card: the copies of the last 30 days, in a list that opens (Phase 1
   step 1.12b): When, How it went, Sent, restore --at. */
.copies-view .q-expansion-item__content {
  padding: 0 8px 8px;
}

.copies-table {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  overflow-x: auto;
}

.copies-table > * {
  min-width: 0;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copies-table > .users-head {
  border-top: 0;
  font-size: calc(11.5px * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.copies-table > .users-cell {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--muted);
}

.copies-table > .users-cell.failed {
  color: var(--failed);
}

.copies-table > .users-cell.at {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  user-select: all;
}

.settings-card .card-note.copies-note {
  margin: 8px 10px 0;
}

/* --- the help (ui/help.py, Phase 1 step 1.16): a quiet (?) beside an area or a control, its
   card, and the Help page (web/help_page.py) ------------------------------------------------- */

.help-tip {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0 0 0 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.help-tip .q-icon {
  font-size: calc(16px * var(--text-scale));
}

.help-tip:hover,
.help-tip:focus-visible,
.help-tip[aria-expanded="true"] {
  color: var(--text);
  background: var(--hover);
  outline: none;
}

.part-head .help-tip {
  margin-left: -2px;
}

/* a title with its (?) (help.title_row): the review view's, the Library's, a card's */
.help-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.help-title-row > :first-child {
  min-width: 0;
}

.settings-card .help-title-row {
  margin-bottom: 2px;
}

.settings-card .help-title-row .card-head {
  margin-bottom: 0;
}

.sheet-card .reading-head {
  margin-top: 18px;
}

.sheet-card .reading-head .card-subtitle {
  margin-top: 0;
}

.sheet-card .reading-head + .reading-choice {
  margin-top: 4px;
}

.q-menu.help-menu {
  max-width: min(380px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px var(--shadow-soft);
  color: var(--text);
}

.help-card {
  padding: 14px 16px 12px;
}

.help-title {
  margin-bottom: 6px;
  font-size: calc(13.5px * var(--text-scale));
  font-weight: 600;
  color: var(--text);
}

.help-body {
  font-size: calc(13px * var(--text-scale));
  line-height: 1.55;
  color: var(--muted);
}

.help-body p {
  margin: 0 0 8px;
}

.help-body p:last-child,
.help-body ul:last-child {
  margin-bottom: 0;
}

.help-body ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.help-body li {
  margin: 2px 0;
}

.help-body strong {
  font-weight: 600;
  color: var(--text);
}

.help-more {
  display: inline-block;
  margin-top: 10px;
  font-size: calc(12.5px * var(--text-scale));
  color: var(--cited);
  text-decoration: none;
}

.help-more:hover {
  text-decoration: underline;
}

/* a link to another section before the card's More (the Effort levels card's, 2026-11-23): a
   line each */
.help-more.help-also {
  display: block;
  width: fit-content;
}

.help-more.help-also + .help-more {
  margin-top: 4px;
}

/* the levels, in the run menu's card and on the Help page */
.help-levels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
}

.help-level {
  padding: 8px 10px;
  border-radius: 8px;
}

.help-level.chosen {
  background: var(--hover);
}

.help-level-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.help-level-name {
  font-size: calc(13px * var(--text-scale));
  font-weight: 600;
  color: var(--text);
}

.help-level-cost {
  font-size: calc(12.5px * var(--text-scale));
  color: var(--asking);
}

.help-level-words {
  margin-top: 2px;
  font-size: calc(12.5px * var(--text-scale));
  line-height: 1.45;
  color: var(--muted);
}

/* the run menu's estimate of a question's credits, beside the level, and the pages the next run
   reads first (chat_page.py; step E, 2026-11-18) */
.next-run .cost-note,
.next-run .pages-note {
  color: var(--asking);
  opacity: 0.85;
}

/* the Help page */
.help-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  max-width: 960px;
  padding: 14px 28px 0;
  font-size: calc(13px * var(--text-scale));
}

.help-contents a {
  color: var(--muted);
  text-decoration: none;
}

.help-contents a:hover {
  color: var(--text);
  text-decoration: underline;
}

.help-section {
  scroll-margin-top: 100px;  /* below the page's sticky head */
}

.help-section .card-head {
  margin-bottom: 10px;
}

.help-section .help-body {
  max-width: 720px;
  font-size: calc(14px * var(--text-scale));
  line-height: 1.6;
}

.help-section .help-levels {
  max-width: 720px;
}

/* an empty chat's link to the Help page, on a line of its own under the button or the lead */
.empty-help {
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  font-size: calc(13px * var(--text-scale));
  color: var(--cited);
  text-decoration: none;
}

.empty-help:hover {
  text-decoration: underline;
}

.help-foot {
  margin-top: 10px;
  font-size: calc(12px * var(--text-scale));
  color: var(--faint);
}

/* === the web edition's layout (Phase 1 step 1.19, 2026-11-12) ============================= */
/* Everything from here on is the web edition's: the rules that change a part the desktop app
   has too hang on html.web (the class the web's pages get before they are drawn: pinpoint.js
   pinpointStart), so the desktop app's pages stay as they are; the others style parts only
   the web's pages have. The accent (--accent) is used in three places only: the open project's
   mark, the first steps' numbers, the chosen tile's ring. */

/* --- Your account's Appearance: the looks and the text sizes as tiles (step 1.19) --------- */
/* (account_page.py choice_tiles.) A look's tile is a small page drawn in the theme's own
   colours: its preview carries the theme's variables (.theme-preview[data-theme], above), so
   it shows them on a page of any look. The chosen tile's ring is one of the accent's three
   places. */

.choice-title {
  margin: 16px 0 8px;
  font-size: calc(12.5px * var(--text-scale));
  font-weight: 600;
  color: var(--muted);
}

.choice-title:first-of-type {
  margin-top: 2px;
}

.choice-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-left: -6px;
}

.choice-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 5px;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font: inherit;
  font-size: calc(12.5px * var(--text-scale));
  cursor: pointer;
}

.choice-tile:hover {
  color: var(--text);
}

.choice-tile.chosen {
  border-color: var(--accent);
  color: var(--text);
}

.theme-preview {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  width: 100px;
  height: 66px;
  overflow: hidden;
  background: var(--stage);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.theme-split {  /* as the device: half Light, half Dark */
  position: relative;
  width: 100px;
  height: 66px;
}

.theme-split .theme-preview {
  position: absolute;
  inset: 0;
}

.theme-split .theme-preview + .theme-preview {
  clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%);
}

.tp-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 5px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.tp-side i {
  height: 4px;
  border-radius: 2px;
  background: var(--faint);
  opacity: 0.55;
}

.tp-side i.current {
  background: var(--accent);
  opacity: 1;
}

.tp-stage {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px 7px;
}

.tp-stage b {
  width: 58%;
  height: 5px;
  margin-bottom: 2px;
  border-radius: 2px;
  background: var(--text);
}

.tp-stage i {
  height: 4px;
  border-radius: 2px;
  background: var(--muted);
  opacity: 0.6;
}

.tp-stage i + i {
  width: 72%;
}

.tp-stage u {
  align-self: flex-end;
  width: 24px;
  height: 10px;
  margin-top: auto;
  border-radius: 4px;
  background: var(--paper);
}

/* A text size's sample: at the size itself, whatever the page's own (not times --text-scale). */
.size-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 48px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 560;
  line-height: 1;
}

.choice-tile[data-size="very-small"] .size-sample { font-size: calc(17px * 0.86); }
.choice-tile[data-size="small"] .size-sample { font-size: calc(17px * 0.93); }
.choice-tile[data-size="medium"] .size-sample { font-size: 17px; }
.choice-tile[data-size="large"] .size-sample { font-size: calc(17px * 1.1); }
.choice-tile[data-size="very-large"] .size-sample { font-size: calc(17px * 1.22); }

/* --- the top bar: the activity line on every page, the account at its right end ----------- */
/* (ui/sidebar.py _top_bar, ui/activity_line.py.) */

html.web {
  --top-bar: 40px;
}

html.web .app {
  height: 100dvh;  /* a phone's own bars come and go: the page keeps to what is seen */
}

html.web body.with-band .app {
  height: calc(100dvh - var(--page-band));
}

html.web .activity {
  height: var(--top-bar);
  padding: 0 10px 0 20px;
}

/* The users' Credits page (Payments P3, 2026-11-26: web/buying_page.py): a tile a pack, its
   credits, its bonus, its price and Buy; the purchases' table with a state under the unused. */
html.web .pack-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 6px;
}

html.web .pack-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

html.web .pack-size {
  color: var(--text);
  font-size: calc(18px * var(--text-scale));
  font-weight: 600;
}

html.web .pack-bonus {
  color: var(--text); /* the accent stays in its three places (Peter, 2026-11-12) */
  font-weight: 600;
  font-size: calc(13px * var(--text-scale));
}

html.web .pack-price {
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
}

html.web .pack-tile > .q-btn {
  margin-top: auto; /* the tiles' Buy in one line, with a bonus line or without */
}

html.web .credit-history.with-state {
  grid-template-columns: max-content minmax(120px, 1fr) max-content max-content;
}

html.web .purchase-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* The admin's Credits page's purchases (Payments P7: web/credits_page.py PURCHASES_HEADS): the
   day, the account with Paddle's transaction under it, the pack, what was paid, the unused
   credits and their value, the refund; scrolled sideways in a narrow window. */
html.web .activity-table.purchases-table {
  grid-template-columns:
    max-content minmax(170px, 1.3fr) max-content max-content minmax(150px, 1.2fr)
    minmax(120px, 1fr);
}

html.web .purchases-table .purchase-id {
  color: var(--faint);
  font-size: calc(11.5px * var(--text-scale));
}

html.web .activity .extra {
  margin-left: 0;  /* the account takes the right end */
}

.activity .menu-button {
  display: none;  /* shown where the sidebar is a drawer (below) */
  margin-left: -10px;
}

.top-account {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  min-width: 0;
  margin-left: auto;
}

.top-fact {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The credits left below zero (a run went past them by the overdraft): in red, with why beside
   them (2026-11-20, Peter's wish); a narrow window has no room for the why (below). */
.top-fact.below-zero {
  color: var(--failed);
}

.account-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 300px;
  padding: 5px 10px 5px 8px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 540;
  text-decoration: none;
}

.account-link .q-icon {
  flex: none;
  font-size: calc(18px * var(--text-scale));
  color: var(--muted);
}

.account-link .account-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-link:hover {
  background: var(--hover);
}

.account-link.current {
  background: var(--raised);
}

/* A page of the sidebar and one column (Your account, Help, the admin's pages): the top bar
   across, as the chat page and the Library page have it. */
html.web .app.monitor-app {
  grid-template-rows: auto minmax(0, 1fr);
}

html.web .monitor-app > .activity { grid-column: 1 / -1; grid-row: 1; }
html.web .monitor-app > .sidebar { grid-row: 2; }
html.web .monitor-app > main { grid-row: 2; }
html.web .monitor-app > .sidebar-handle { grid-row: 2; }

/* --- the sidebar: the app's name opens the latest project; the open project's mark -------- */

html.web a.wordmark, html.web a.wordmark-short {
  color: var(--text);
  text-decoration: none;
}

html.web .project-item {
  position: relative;
}

html.web .project-item.current::before {
  content: "";
  position: absolute;
  top: 24%;
  bottom: 24%;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.sidebar-scrim {
  display: none;  /* beside the sidebar open as a drawer (below): a click on it closes it */
}

/* --- the page without a project: three plain steps and one button ------------------------- */
/* (chat_page.py _no_project.) */

.empty.first-steps {
  max-width: 560px;
  margin-top: 13vh;
  text-align: left;
}

.first-steps .steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.first-steps .steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 16px;
}

.first-steps .step-number {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: calc(13px * var(--text-scale));
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.first-steps .step-title {
  padding-top: 3px;
  font-size: calc(16px * var(--text-scale));
  font-weight: 600;
  line-height: 1.35;
}

.first-steps .step-text {
  grid-column: 2;
  margin-top: 2px;
  font-size: calc(14px * var(--text-scale));
  line-height: 1.55;
  color: var(--muted);
}

.empty.first-steps .q-btn {
  margin: 28px 0 0 44px;
}

.first-steps .empty-help {
  margin: 16px 0 0 44px;
}

/* --- Sources: a document's state at a glance; the notes folded until used ----------------- */
/* (sources_panel.py DOCUMENT_STATES.) Read in the working green; not read yet, and being read
   (its arrows turn), in the asking ochre; could not be added, or its file gone, in the failure
   red. */

.document-state {
  flex: none;
  margin-top: 1px;
  font-size: calc(18px * var(--text-scale));
}

.document-state.read { color: var(--working); }
.document-state.waiting, .document-state.reading { color: var(--asking); }
.document-state.failed, .document-state.gone { color: var(--failed); }

.document-row.unused .document-state {
  opacity: 0.5;
}

.document-state.reading {
  animation: turning 1.6s linear infinite;
}

@keyframes turning {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .document-state.reading { animation: none; }
}

/* --- an answer: its status and citations calmer --------------------------------------------- */
/* An answer is as wide as the chat's column, its right edge at the user's messages' and the
   box's (Peter, 2026-11-12, after the step's test: its lines kept to about 80 characters made
   a long answer very long, beside an empty strip). */

/* The status: a dot in its colour and the word, no pill. */
html.web :is(.answer-top, .answer-row) .status {
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-weight: 540;
}

html.web :is(.answer-top, .answer-row) .status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
}

html.web :is(.answer-top, .answer-row) .status.answered::before { background: var(--working); }
html.web :is(.answer-top, .answer-row) .status.partly::before { background: var(--asking); }
html.web :is(.answer-top, .answer-row) .status.not_answered::before { background: var(--done); }

/* A citation's number: its colour, not bold, underlined under the mouse only. */
html.web .cite {
  font-weight: 540;
  border-bottom-color: transparent;
}

html.web .cite:hover {
  border-bottom-color: rgba(var(--cited-rgb), 0.6);
}

/* Under the text: what was read, the citations, the Verifier's check and the line saying an AI
   made it, one quiet block under a hairline; then the actions in one row, the menu at its end. */
html.web .message .written-notes {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: calc(12px * var(--text-scale));
  color: var(--note);
}

html.web .message .citations-head,
html.web .message .checks-head {
  font-size: calc(12.5px * var(--text-scale));
}

html.web .message .check-rows,
html.web .message .checks-line {
  font-size: calc(12px * var(--text-scale));
  color: var(--note);
}

html.web .answer-actions {
  flex-wrap: wrap;  /* too narrow for the thumbs beside the actions: they go under, at the right */
  margin-top: 2px;
}

html.web .answer-actions .q-btn .q-btn__content {
  flex-wrap: nowrap;  /* a label stays beside its icon, never squeezed under it */
  white-space: nowrap;
}

html.web .answer-actions > .q-btn.quiet:last-of-type {
  margin-left: 2px;  /* the menu, after the row's named actions (the thumbs come after it) */
}

/* --- the user's opinion of an answer (Phase 2 step 2.4: ui/answer_opinion.py) -------------- */
/* Two quiet thumbs at the end of the answer's actions, fainter than its named actions until the
   mouse is on them; a marked one filled, in the text's colour. Under the answer, opened by a
   thumb in the admin's Full mode, a small framed box (never a dialog): its title, the comment,
   the notes in the notes' form, the tick box and its actions. No accent. */

html.web .answer-opinion {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-left: 12px;
}

html.web .answer-opinion .q-btn.quiet {
  color: var(--faint);
}

html.web .answer-opinion .q-btn.quiet:hover,
html.web .answer-opinion .q-btn.quiet.marked {
  color: var(--text);
}

html.web .answer-opinion .q-btn.quiet .q-icon {
  font-size: calc(18px * var(--text-scale));
}

html.web .opinion-place:empty {
  display: none;  /* no box: the answer's spacing stays as it was (the message's gap) */
}

html.web .opinion-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 600px;
  margin-top: 10px;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

html.web .opinion-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

html.web .opinion-head .opinion-icon {
  font-size: calc(17px * var(--text-scale));
  color: var(--text);
}

html.web .opinion-title {
  font-size: calc(14px * var(--text-scale));
  font-weight: 600;
  color: var(--text);
}

html.web .opinion-comment {
  width: 100%;
}

html.web .opinion-send {
  margin-top: 2px;
  margin-left: -4px;  /* the box's edge in line with the texts above */
  font-size: calc(13.5px * var(--text-scale));
  color: var(--text);
}

html.web .opinion-note,
html.web .opinion-warning {
  position: relative;
  padding-left: calc(20px * var(--text-scale));
  font-size: calc(12px * var(--text-scale));
  line-height: 1.5;
  color: var(--note);
}

html.web .opinion-warning {
  margin-top: -4px;  /* it belongs to the tick box above it */
  color: var(--asking);
}

html.web .opinion-note::before,
html.web .opinion-warning::before {
  content: "lock_outline";
  position: absolute;
  top: 0.14em;
  left: 0;
  font-family: "Material Icons";
  font-size: calc(14px * var(--text-scale));
  font-feature-settings: "liga";
  line-height: 1;
  color: var(--faint);
}

html.web .opinion-warning::before {
  content: "visibility";
  color: var(--asking);
}

html.web .opinion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

html.web .opinion-actions .opinion-take-back {
  margin-left: auto;
}

/* --- the notes that are always on the page: one quiet, tidy form --------------------------- */
/* The note under the chat's box, the line under an answer, the line where documents are added
   (the web's, step 1.13; their words as they were): small, in the notes' colour (--note: easy
   to read, lighter than the texts), a small mark before them, their lines hanging beside it.
   The note that a new topic deserves a new project (Phase 2 step 2.1, under the run menu, where
   the chosen level's description stood until then): the same form, its mark a lamp, its link
   a button in the note's line. */

html.web .composer .ai-note,
html.web .composer .topic-note,
html.web .ai-line,
html.web .panel-note.adding-note {
  position: relative;
  padding-left: calc(20px * var(--text-scale));
  font-size: calc(12px * var(--text-scale));
  line-height: 1.5;
  color: var(--note);
}

html.web .composer .ai-note,
html.web .composer .topic-note {
  margin-top: 6px;
  padding-left: calc(4px + 20px * var(--text-scale));  /* the composer's texts start 4px in */
}

html.web .composer .ai-note::before,
html.web .composer .topic-note::before,
html.web .ai-line::before,
html.web .panel-note.adding-note::before {
  content: "info_outline";
  position: absolute;
  top: 0.14em;
  left: 0;
  font-family: "Material Icons";
  font-size: calc(14px * var(--text-scale));
  font-feature-settings: "liga";
  line-height: 1;
  color: var(--faint);
}

html.web .composer .ai-note::before,
html.web .composer .topic-note::before {
  left: 4px;
}

html.web .composer .topic-note {
  margin-top: 4px;  /* as the level's description stood: the chat above it doesn't move */
}

html.web .composer .topic-note::before {
  content: "lightbulb_outline";
}

html.web .composer .topic-note > *,
html.web .composer .topic-note .ask > * {
  display: inline;  /* the question and its link go on in the note's line */
}

html.web .composer .topic-note .ask {
  white-space: nowrap;  /* ... and stay together */
}

html.web .composer .topic-note > * + *,
html.web .composer .topic-note .ask > * + * {
  margin-left: 0.35em;
}

html.web .composer .topic-note .note-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

html.web .composer .topic-note .note-link:hover {
  color: var(--text);
}

html.web .ai-line {
  margin-top: 4px;
}

html.web .panel-note.adding-note {
  margin-top: 12px;
}

/* The notice that a task uses credits (ui/credit_notice.py, 2026-11-23): its box under the
   words, in their size. */
html.web .sheet-card .credit-notice-never {
  margin-top: 12px;
  font-size: calc(13.5px * var(--text-scale));
}

/* --- narrower windows: a laptop, a tablet, a phone ----------------------------------------- */
/* The widths above 900 px are as they were (the sidebar as icons below 1,800 px, the side
   panel a drawer below 1,500 px); on a touch screen, where no mouse opens the icons, the top
   bar's button does. Below 900 px the sidebar is a drawer on every page, under the top bar. */

@media (hover: none) and (max-width: 1799px) {
  html.web :is(.workspace, .library-app) > .activity .menu-button {
    display: inline-flex;
  }
  /* a message's menu: there is no mouse to show it */
  html.web .message .who .q-btn {
    opacity: 1;
  }
}

@media (max-width: 899px) {
  html.web .activity .menu-button {
    display: inline-flex;
  }
  html.web .top-account .top-why {  /* no room for why the credits are below zero: red only */
    display: none;
  }
  html.web .app > .sidebar,
  html.web :is(.workspace, .library-app).sidebar-open > .sidebar {
    position: fixed;
    top: calc(var(--page-band, 0px) + var(--top-bar));
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(320px, 88vw);
    overflow: hidden;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  html.web .app.sidebar-open > .sidebar {
    transform: none;
    box-shadow: 16px 0 48px var(--shadow-deep);
  }
  html.web .app.sidebar-open > .sidebar-scrim {
    display: block;
    position: fixed;
    top: calc(var(--page-band, 0px) + var(--top-bar));
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 65;
    background: var(--shadow-deep);
  }
  /* the page's columns without the sidebar's */
  html.web .app.monitor-app,
  html.web .app.workspace,
  html.web .app.workspace.viewer-open,
  html.web .app.workspace.no-project {
    grid-template-columns: minmax(0, 1fr);
  }
  html.web .monitor-app > main,
  html.web .workspace > .stage {
    grid-column: 1;
  }
  html.web .app > .column-handle {
    display: none;
  }
  html.web .app.library-app,
  html.web .app.library-app.viewer-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(120px, 34%) minmax(0, 1fr);
  }
  html.web .library-app > .library-folders { grid-column: 1; grid-row: 2; }
  html.web .library-app > .library-main { grid-column: 1; grid-row: 3; }
}

/* A phone: the side panel and the viewer take the whole width, the pages' edges are narrower,
   the account is its icon. */
@media (max-width: 599px) {
  html.web .activity {
    gap: 8px;
    padding: 0 6px 0 16px;
  }
  html.web .top-account {
    gap: 8px;
  }
  html.web .credit-history.with-balance {  /* Your account's fits: its descriptions wrap */
    grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
    column-gap: 12px;
  }
  html.web .account-link .account-name {
    display: none;
  }
  html.web .account-link {
    padding: 5px 6px;
  }
  html.web .workspace > .side,
  html.web .app > .viewer,
  html.web .workspace.viewer-open > .viewer,
  html.web .workspace.viewer-open.side-first > .viewer {
    width: 100vw;
    max-width: 100vw;
  }
  html.web .stage-head,
  html.web .monitor-head {
    gap: 8px;
    padding: 12px 16px 11px;
  }
  html.web .messages {
    padding: 20px 16px 0;
  }
  html.web .messages.after {
    padding: 18px 16px 24px;
  }
  html.web .messages.after:empty {
    padding: 0 16px 24px;
  }
  html.web .composer {
    padding: 0 12px 12px;
  }
  html.web .message.user {
    max-width: 92%;
  }
  html.web .empty {
    margin-top: 8vh;
    padding: 0 20px;
  }
  html.web .empty.first-steps .q-btn,
  html.web .first-steps .empty-help {
    margin-left: 0;
  }
  /* the new-topic note: its question and its link only; the note under it stays */
  html.web .composer .topic-note .why {
    display: none;
  }
  html.web .composer .topic-note .why + * {
    margin-left: 0;
  }
  /* a part's actions keep to a line each, under its title when they don't fit beside it */
  html.web .part-head {
    flex-wrap: wrap;
  }
  html.web .part-head .q-btn .q-btn__content {
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  /* the thumbs nearer the answer's actions, so a phone of 390 pixels keeps them on its line */
  html.web .answer-opinion {
    padding-left: 4px;
  }
}
