/* Console in the look of GitVerse: a two-row header (the path, then tabs with icons and counts), the banner of what
   holds new tasks back, the board in the order a task goes (agent's plan, approval, agent's work, review) and the task card in a modal dialog.
   Colors come from app.css (light and dark); no inline styles — the CSP forbids them. */
:root {
  --c-queued: #8c959f; --c-planning: #8250df; --c-approval: #bf6a02; --c-working: var(--accent);
  --c-review: #1a7f8c; --c-done: var(--ok); --c-cancelled: var(--muted); --c-attention: var(--err);
  --t-planning: #fbefff; --t-approval: #fff1e5; --t-working: #eeeefd; --t-review: #e2f5f6;
  --att-line: #f2c2c4; --claude: #c96442;
  --mono: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --c-queued: #8b949e; --c-planning: #c297ff; --c-approval: #f0a04b; --c-review: #4fc3cf;
    --t-planning: #2a2140; --t-approval: #33270f; --t-working: #1f1f45; --t-review: #10302d;
    --att-line: #5c2522; --claude: #e0896a; }
}

.st-queued { --st: var(--c-queued); --st-bg: var(--code); }
.st-planning { --st: var(--c-planning); --st-bg: var(--t-planning); }
.st-approval { --st: var(--c-approval); --st-bg: var(--t-approval); }
.st-working { --st: var(--c-working); --st-bg: var(--t-working); }
.st-review { --st: var(--c-review); --st-bg: var(--t-review); }
.st-done { --st: var(--c-done); --st-bg: var(--ok-bg); }
.st-cancelled { --st: var(--c-cancelled); --st-bg: var(--code); }
.st-attention { --st: var(--c-attention); --st-bg: var(--err-bg); }

.mono { font-family: var(--mono); font-size: 12px; }
.small { font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.count { padding: 0 7px; border-radius: 9999px; background: var(--code); font-size: 12px; font-weight: 500; color: var(--ink); }

/* service state beside the title: plain text with a dot, as GitVerse shows repository facts */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 460px; min-width: 0; padding: 4px 10px;
  border-radius: 9999px; background: var(--code); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; }
.chip .ell { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.status .chip { padding: 0; background: transparent; color: var(--muted); font-size: 14px; }
.status .chip .dot { width: 8px; height: 8px; background: var(--muted); }
.status .chip.ok .dot { background: var(--ok); }
.status .chip.bad { color: var(--err); }
.status .chip.bad .dot { background: var(--err); }
.status .chip.warn { color: var(--warn); }
.status .chip.warn .dot { background: var(--warn); }

/* ------------------------------------------------------------------ toolbar */
.console { max-width: 1600px; margin: 0 auto; padding: 20px 40px 48px; display: flex; flex-direction: column; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.toolbar h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
#summary { font-size: 14px; }
#updated.stale { color: var(--warn); font-weight: 600; }
.select select { width: auto; height: 36px; padding: 0 10px; background: var(--panel); font-size: 14px; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { height: 34px; padding: 0 12px; border: 0; border-radius: 0; background: var(--panel); font-size: 14px;
  font-weight: 500; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--code); font-weight: 600; }
#notice:empty { display: none; }
#notice .msg { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 0; }
#notice .msg button { padding: 0 6px; border: 0; background: transparent; color: inherit; font-size: 16px; line-height: 1.2; }

/* ------------------------------------------------------------------ what holds new tasks back */
.blocked { display: flex; flex-direction: column; gap: 8px; }
.blk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; background: var(--err-bg);
  border: 1px solid var(--att-line); border-radius: 8px; color: var(--err); }
.blk > .ic { width: 18px; height: 18px; }
.blk-body { flex: 1 1 420px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.blk-body strong { color: var(--err); font-size: 15px; font-weight: 600; }
.blk button { height: 32px; padding: 0 12px; border-color: var(--att-line); color: var(--err); font-weight: 500; }
.blk button.primary { border-color: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ board: the path of a task, left to right */
.board-wrap { overflow-x: auto; padding-bottom: 4px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; min-width: 1140px; align-items: start; }
.board.c7 { grid-template-columns: repeat(7, minmax(168px, 1fr)); min-width: 1250px; }  /* with «Нужно внимание» */
.col { display: flex; flex-direction: column; min-width: 0; background: var(--subtle); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; }
/* the head: ring, title with its count, whose move (right); the hint below */
.col-head { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; align-items: center; gap: 2px 8px;
  padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.col-head .ring { flex: none; width: 14px; height: 14px; border: 2px solid var(--st); border-radius: 50%; }
.col-head h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.col-head h2 .count { white-space: nowrap; }
.hint { grid-column: 1 / -1; padding-left: 22px; font-size: 12px; color: var(--muted); }
.hint.human { color: var(--st); font-weight: 600; }
/* whose move it is: the agent's columns and the people's */
.who { padding: 0 7px; border-radius: 9999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.who-agent { background: var(--t-working); color: #4040b0; }
.who-you { background: var(--t-approval); color: #8a4b00; }
@media (prefers-color-scheme: dark) { .who-agent { color: var(--c-working); } .who-you { color: var(--c-approval); } }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 120px; padding: 10px; }
.empty { margin: 0; padding: 24px 6px; text-align: center; font-size: 13px; color: var(--muted); }
.att-bulk { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 8px 10px;
  background: var(--err-bg); border: 1px solid var(--att-line); border-radius: 8px; font-size: 13px; color: var(--err); }
.att-bulk button { padding: 4px 10px; font-size: 13px; }
.tcard { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.tcard:hover { border-color: var(--st); }
.tcard.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.repo { padding: 0 6px; border-radius: 4px; background: var(--code); font-size: 12px; color: var(--ink); }
.tc-num { font-size: 12px; color: var(--muted); }
.tc-title { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tc-key { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
/* the card's own status: an outlined pill in the color of its status */
.spill { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%; padding: 0 8px;
  border: 1px solid var(--st); border-radius: 9999px; color: var(--st); font-size: 12px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spill .ic { width: 12px; height: 12px; }
.tcard.st-attention .spill { white-space: normal; border-radius: 10px; }  /* the reason may take two lines */
.tc-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.tc-line.warn { color: var(--warn); font-weight: 600; }
.tc-line .ic { width: 13px; height: 13px; }
.tc-line.warn { flex-wrap: nowrap; align-items: flex-start; }
.tc-line.warn .ic { margin-top: 3px; }
.tc-foot { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--code); font-size: 12px;
  color: var(--muted); }
.tc-foot .when { margin-left: auto; white-space: nowrap; }
.tc-foot .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--code); color: var(--ink); font-size: 10px; font-weight: 600; }
code.approve { font-size: 12px; background: var(--t-approval); color: var(--c-approval); }
.pr { padding: 1px 8px; border-radius: 9999px; border: 1px solid var(--c-review); color: var(--c-review); font-size: 12px;
  font-weight: 500; }
.live { position: relative; display: block; height: 3px; border-radius: 2px; background: var(--code); overflow: hidden; }
.live::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 2px;
  background: var(--st); animation: live 1.8s ease-in-out infinite; }
@keyframes live { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .live::after { animation: none; left: 0; width: 100%; opacity: .45; } }
.col-foot { display: flex; flex-direction: column; gap: 4px; padding: 4px 4px 0; font-size: 12px; }

/* tasks no run has taken yet («Забрать»): dashed cards under the queued runs, a block above the list */
.q-refresh { width: 28px; height: 28px; border-color: transparent; background: transparent; color: var(--muted); }
.q-refresh:hover { color: var(--ink); border-color: var(--line); }
.q-refresh .ic { width: 14px; height: 14px; }
.q-refresh[aria-busy="true"] .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .q-refresh[aria-busy="true"] .ic { animation: none; } }
.col-head .q-refresh { justify-self: end; }
.qsec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col .tcard ~ .qsec { padding-top: 10px; border-top: 1px dashed var(--line); }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 0 4px; }
.q-title { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.q-sub { flex-basis: 100%; font-size: 12.5px; }
.q-note { margin: 0; padding: 6px 9px; border-radius: 8px; background: var(--panel); font-size: 12px; color: var(--muted);
  overflow-wrap: anywhere; }
.q-note.warn { background: var(--warn-bg); color: var(--warn); }
.q-note ul { margin: 4px 0 0; padding-left: 18px; }
.qcard { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--panel);
  border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 10px; }
.q-badge { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.q-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.qcard .q-actions { padding-top: 6px; border-top: 1px solid var(--line); }
.q-take { padding: 5px 14px; font-size: 13px; }
.q-take:disabled { cursor: progress; }
.q-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--accent); text-decoration: none; }
.q-link:hover { text-decoration: underline; }
.q-link .ic { width: 12px; height: 12px; }
.qlist { padding: 12px 14px; background: var(--panel); border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 12px; }
.qlist .q-title { font-size: 12px; }
.qlist .q-note { background: var(--code); }
.qlist .q-note.warn { background: var(--warn-bg); }
.qrow { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 8px 0 0;
  border-top: 1px solid var(--line); }
.qrow .lr-main .tc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-wrap > .qlist { margin-bottom: 12px; }
.mini { padding: 6px 8px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font-size: 12.5px; text-align: left; }
.mini.sel { border-style: solid; border-color: var(--accent); color: var(--ink); }

/* ------------------------------------------------------------------ list view */
.list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lrow { display: grid; grid-template-columns: 220px minmax(0, 2fr) minmax(0, 3fr) 110px; gap: 4px 16px; align-items: center;
  width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover, .lrow.sel { background: var(--code); }
.lrow.sel { box-shadow: inset 3px 0 0 var(--accent); }
.lr-status { display: inline-flex; align-items: center; gap: 6px; color: var(--st); font-size: 13px; font-weight: 600; }
.lr-main { display: flex; flex-direction: column; min-width: 0; }
.lr-main .tc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-line { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow.st-attention .lr-line { color: var(--err); }
.lr-time { font-size: 12px; color: var(--muted); text-align: right; }
.empty-all { margin: 0; padding: 24px; text-align: center; }

/* ------------------------------------------------------------------ task card: a modal dialog over the board */
dialog.detail-dlg { width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); margin: 24px auto;
  padding: 0; border: 0; border-radius: 16px; background: var(--panel); color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28); overflow: auto; overscroll-behavior: contain; }
dialog.detail-dlg::backdrop { background: rgba(17, 20, 24, .48); }
dialog.detail-dlg .detail { border: 0; border-radius: 0; box-shadow: none; }
dialog.detail-dlg .d-actions .icon-btn:disabled { opacity: .4; }
body.modal-open { overflow: hidden; }
@media (max-width: 760px) {
  dialog.detail-dlg { width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; }
}
.detail { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
  scroll-margin-top: 80px; }
.d-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; padding: 18px 22px 0; }
.d-title { flex: 1 1 420px; min-width: 0; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); }
.d-title h2 { margin: 8px 0 0; font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.d-num { font-weight: 400; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 9999px;
  background: var(--st); color: #ffffff; font-size: 13px; font-weight: 500; }
.pill .ic { width: 14px; height: 14px; }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.btn-link:hover { border-color: var(--accent); }
.btn-link .ic { width: 13px; height: 13px; color: var(--muted); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; }
button.with-ic { display: inline-flex; align-items: center; gap: 6px; }
.d-notes { padding: 0 22px; }
.d-notes > * { margin: 10px 0 0; }
.reason { padding: 8px 12px; border-radius: 8px; background: var(--err-bg); color: var(--err); }
.reason.warn { background: var(--warn-bg); color: var(--warn); }
.d-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.d-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-weight: 600; }
.d-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.d-body { padding: 18px 22px 22px; }
.d-grid { display: flex; flex-wrap: wrap; gap: 24px; }
.d-stages { flex: 1 1 240px; min-width: 0; }
.d-steps { flex: 2 1 440px; min-width: 0; }
.d-repos { flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.detail h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.h3row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.h3row h3 { margin: 0; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.live-badge .dot { box-shadow: 0 0 0 3px var(--t-working); }

.stages { margin: 0; padding: 0; list-style: none; }
.stage { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; padding: 5px 0; }
.stage:not(:last-child)::before { content: ""; position: absolute; left: 8px; top: 21px; bottom: -5px; width: 2px; background: var(--line); }
.stage.past::before { background: var(--ok); }
.sdot { position: relative; z-index: 1; width: 12px; height: 12px; margin: 4px 3px 0; border-radius: 50%;
  background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); }
.stage.past .sdot { background: var(--ok); box-shadow: none; }
.stage.now .sdot { background: var(--accent); box-shadow: 0 0 0 4px var(--t-working); }
.stage.stop .sdot { background: var(--err); box-shadow: 0 0 0 4px var(--err-bg); }
.sname { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; }
.stage.next .sname, .stage.skip .sname { color: var(--muted); font-weight: 500; }
.stage.now .sname { color: var(--accent); }
.stage.stop .sname { color: var(--err); }
.snote { font-size: 12px; font-weight: 400; color: var(--muted); }
.stime { padding-top: 2px; color: var(--muted); }

.steps { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.steps > p { margin: 0; padding: 12px; }
.step { display: grid; grid-template-columns: 52px 16px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 12px;
  border-bottom: 1px solid var(--code); font-size: 13px; }
.step:last-child { border-bottom: 0; }
.step .ph { padding-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.step .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.step .tx { white-space: pre-wrap; word-break: break-word; }
.step.tool .tx { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.step.tool .ic { color: var(--accent); }
.step.result .tx, .step.result .ic { color: var(--ok); font-weight: 600; }
.step.error .tx, .step.error .ic { color: var(--err); font-weight: 600; }

.repo-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.rc-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.rc-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: var(--code);
  font-size: 12px; color: var(--muted); }
.check .ic { width: 13px; height: 13px; }
.check.passed { background: var(--ok-bg); color: var(--ok); }
.check.failed { background: var(--err-bg); color: var(--err); }

.repo-block + .repo-block { margin-top: 22px; }
.check-row { display: grid; grid-template-columns: 16px 160px minmax(0, 1fr) 130px; gap: 10px; align-items: center; padding: 7px 0;
  border-top: 1px solid var(--line); font-size: 13px; }
.check-row .ic.passed { color: var(--ok); }
.check-row .ic.failed { color: var(--err); }
.check-row .ic.other { color: var(--muted); }
.check-row .cmd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.check-row .cst { color: var(--muted); font-size: 12.5px; text-align: right; }
.files { max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 8px 12px; list-style: none; background: var(--code);
  border-radius: 8px; font-family: var(--mono); font-size: 12px; }
.files li { padding: 1px 0; overflow-wrap: anywhere; }
.termbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 8px; font-size: 13px; }
.termbar button { padding: 4px 10px; font-size: 12.5px; }
.term-state { font-weight: 600; color: var(--accent); }
/* the agent's console looks like a terminal in both themes */
.term { max-height: 520px; overflow: auto; background: #0b0f14; color: #d7dde4; border-radius: 8px;
  padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; }
.term.full { max-height: 85vh; }
.term div { white-space: pre-wrap; word-break: break-word; }
.term .k-head { color: #7aa2f7; font-weight: 600; margin-top: 6px; }
.term .k-meta, .term .k-think { color: #8b949e; }
.term .k-think { font-style: italic; }
.term .k-text { color: #e6edf3; }
.term .k-tool { color: #79c0ff; }
.term .k-out { color: #a5b1be; }
.term .k-ok { color: #3fb950; }
.term .k-error { color: #f85149; font-weight: 600; }
.term .k-stderr { color: #d29922; }
pre.plan { margin: 0; padding: 12px 14px; max-height: 520px; overflow: auto; background: var(--code); border-radius: 8px;
  white-space: pre-wrap; font-size: 13px; }
.ev-wrap { overflow-x: auto; }
table.ev { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 12.5px; }
table.ev td { border-top: 1px solid var(--line); padding: 5px 8px; vertical-align: top; }
table.ev td.when { white-space: nowrap; color: var(--muted); }
table.ev td.act { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .lrow, .qrow { grid-template-columns: minmax(0, 1fr); }
  .qrow .q-actions { justify-content: flex-start; }
  .lr-time { text-align: left; }
  .check-row { grid-template-columns: 16px minmax(0, 1fr); }
  .check-row .cmd, .check-row .cst { grid-column: 2; text-align: left; }
}
@media (max-width: 760px) {
  .console { padding: 12px 16px 40px; }
  .search { order: 5; flex: 1 1 100%; max-width: none; }
  .d-head, .d-tabs, .d-notes, .d-body { padding-left: 16px; padding-right: 16px; }
}

/* drag and drop between statuses */
.tcard { cursor: pointer; }
.tcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[draggable="true"] { cursor: grab; }
[draggable="true"]:active { cursor: grabbing; }
.dragging .col { transition: opacity .12s, box-shadow .12s, background .12s; }
.col.drop-no { opacity: .45; }
.col.drop-ok { box-shadow: inset 0 0 0 2px var(--accent); }
.col.drop-ok::before { content: attr(data-drop); order: -1; padding: 6px 8px; border-radius: 8px; background: var(--accent);
  color: var(--accent-ink); font-size: 12px; font-weight: 600; text-align: center; }
.col.drop-hover { background: color-mix(in srgb, var(--accent) 14%, var(--subtle)); }
.dropzone { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); display: flex; align-items: center;
  gap: 10px; padding: 16px 28px; border: 2px dashed var(--err); border-radius: 12px; background: var(--panel); color: var(--err);
  font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.dropzone[hidden] { display: none; }
.dropzone.drop-hover { background: var(--err-bg); }

/* the web console (web.public_url): account bar and the sign-in page */
.account { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.account button { padding: 5px 10px; font-size: 13px; }
.signin { display: flex; justify-content: center; padding: 48px 16px; }
.signin-card { width: min(100%, 400px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.signin-card h1 { margin: 0; font-size: 20px; }
.signin-card p { margin: 0; }
dialog.ask { width: min(92vw, 420px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--ink); }
dialog.ask::backdrop { background: rgba(0, 0, 0, .45); }
dialog.ask form { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
dialog.ask p { margin: 0; white-space: pre-wrap; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.users-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.users-card h2 { margin: 0 0 12px; font-size: 16px; }
.users-add { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
table.users td { vertical-align: middle; }
table.users td.acts { display: flex; flex-wrap: wrap; gap: 6px; }
table.users td.acts button { padding: 4px 10px; font-size: 12.5px; }
table.users select { width: auto; }
.warn-text { color: var(--warn); font-weight: 600; }
#notice .pw { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
code.secret { font-size: 14px; user-select: all; }
@media (max-width: 860px) { .users-add { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ «Репозитории» (repos.html): as GitVerse lists */
.rs-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rs-head { padding: 12px 18px; background: var(--subtle); border-bottom: 1px solid var(--line); }
.rs-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.rs-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.rs-body > p, .rs-body .msg { margin: 0; }
.rs-mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.rs-value { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.rs-more { font-size: 14px; }
.rs-table { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table.rtable { margin: 0; min-width: 780px; table-layout: fixed; font-size: 14px; }  /* an open form never moves the columns */
table.rtable th:nth-child(1) { width: 28%; }
table.rtable th:nth-child(2) { width: 15%; }
table.rtable th:nth-child(3) { width: 22%; }
table.rtable th:nth-child(5) { width: 150px; }
table.rtable thead th { padding: 10px 16px; background: var(--subtle); border-bottom: 1px solid var(--line); font-size: 14px;
  font-weight: 500; color: var(--muted); }
table.rtable td { padding: 14px 16px; border-bottom: 1px solid var(--code); }
table.rtable tbody tr:last-child td { border-bottom: 0; }
table.rtable tr.r-open td { border-bottom-color: transparent; }
.r-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 16px; overflow-wrap: anywhere; }
.r-title > .ic { color: var(--muted); margin-right: 2px; }
.r-owner, .r-sep { color: var(--muted); }
.r-title strong, .r-link { font-weight: 600; }
.r-key { margin-top: 2px; padding-left: 24px; overflow-wrap: anywhere; }
.r-link { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); text-decoration: none; }
.r-link:hover { color: var(--accent); text-decoration: underline; }
.r-link .ic { width: 12px; height: 12px; color: var(--muted); }
.r-off .r-title, .r-off .r-link, .r-off .r-title strong { color: var(--muted); }
/* the source: a grey label as GitVerse's «Публичный» */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 4px; background: var(--code);
  color: var(--ink); font-size: 12px; font-weight: 400; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.b-auto { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.b-pending { align-items: flex-start; max-width: 260px; padding: 2px 8px; border-radius: 8px; background: var(--warn-bg); color: var(--warn);
  white-space: normal; }
.b-pending .ic { margin-top: 2px; }
.r-watch > * + *, .r-state > * + * { margin-top: 6px; }
.r-watch .b-pending { display: flex; width: fit-content; }
.r-hint { display: block; font-size: 12px; color: var(--muted); }
.r-err { display: block; font-size: 12px; font-weight: 600; color: var(--err); overflow-wrap: anywhere; }
.sw { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 36px; height: 20px; margin: 0;
  padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s; }
input.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(16px); }
input.switch:focus { outline: none; }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.switch:disabled { opacity: .5; cursor: not-allowed; }
input.switch:disabled + span { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::before { transition: none; } }
.r-poll { display: flex; flex-direction: column; gap: 2px; max-width: 380px; padding: 6px 10px; border: 1px solid var(--att-line);
  border-radius: 8px; background: var(--err-bg); color: var(--err); font-size: 13px; }
.r-poll-head { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.r-poll-head .ic { width: 13px; height: 13px; }
.r-poll-text { font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; }
/* tasks of a repository: outlined pills in the color of their status */
.r-runs { display: flex; flex-wrap: wrap; gap: 6px; }
.rc { padding: 0 8px; border: 1px solid var(--line); border-radius: 9999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.rc-working { border-color: var(--c-working); color: var(--c-working); }
.rc-waiting { border-color: var(--c-approval); color: var(--c-approval); }
.rc-attention { border-color: var(--c-attention); color: var(--c-attention); }
.r-acts { text-align: right; white-space: nowrap; }
.r-acts button { padding: 5px 12px; font-size: 14px; }
.r-acts button[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.r-form-row > td { padding: 0 16px 16px; }
.r-form { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); }
.r-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.r-legend { margin-bottom: 4px; padding: 0; font-size: 15px; font-weight: 600; }
.r-form p { margin: 0; }
.r-form .grid { margin-top: 12px; }
.r-form .row { margin-top: 14px; }
.r-form fieldset:disabled input, .r-form fieldset:disabled select, .r-form fieldset:disabled textarea { opacity: .8; cursor: not-allowed; }
label.field.inline { flex-direction: row; align-items: flex-start; gap: 8px; }
label.field.inline input { width: auto; margin: 3px 0 0; }
label.field.inline .help { display: block; }
@media (max-width: 760px) {
  .rs-table { overflow: visible; border: 0; background: transparent; }
  table.rtable { min-width: 0; }
  table.rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
  table.rtable tr { margin-top: 10px; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
  table.rtable tr.r-form-row { margin-top: 0; padding: 0; border: 0; background: transparent; }
  table.rtable tr.r-open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  table.rtable td { padding: 6px 0; border: 0; min-width: 0; }
  table.rtable td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px;
    font-weight: 500; color: var(--muted); }
  table.rtable td.r-name::before { content: none; }
  .r-acts { text-align: left; }
  .r-form-row > td { padding: 0; }
  .r-form { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
}

/* ------------------------------------------------------------------ «Права агента» (agent.html): boxes as «Репозитории» */
form.ag { display: flex; flex-direction: column; gap: 16px; }
form.ag[hidden] { display: none; }
#readonly { margin: 0; }
.ag-group { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-group legend { margin-bottom: 4px; padding: 0; font-size: 15px; font-weight: 600; }
.ag-group + .ag-group { margin-top: 10px; }
.ag-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; }
.ag-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.ag-opt:has(input:disabled) { cursor: not-allowed; opacity: .7; }
.ag-opt input { width: auto; margin: 4px 0 0; flex: none; }
.ag-opt-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ag-opt-text .muted { font-size: 13px; }
.ag-table-wrap { margin: 0 18px 18px; }
table.atable { margin: 0; min-width: 760px; table-layout: fixed; font-size: 14px; }
table.atable th:nth-child(1) { width: 26%; }
table.atable th:nth-child(2) { width: 36%; }
table.atable thead th { padding: 10px 16px; background: var(--subtle); border-bottom: 1px solid var(--line); font-size: 14px;
  font-weight: 500; color: var(--muted); }
table.atable td { padding: 14px 16px; border-bottom: 1px solid var(--code); vertical-align: top; }
table.atable tbody tr:last-child td { border-bottom: 0; }
table.atable td.r-name .badge { margin-top: 6px; }
.ag-cmds > * + *, .ag-rules > * + * { margin-top: 6px; }
.ag-cmds .field.inline { font-weight: 400; }
.ag-cmds textarea:disabled { opacity: .7; cursor: not-allowed; }
.ag-cmds .help, .ag-rules .help { display: block; font-size: 12.5px; color: var(--muted); }
.ag-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ag-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ag-list code { font-family: var(--mono); font-size: 12px; }
.ag-text li { display: list-item; margin-left: 18px; list-style: disc; font-size: 13.5px; }
.ag-list li.ag-off code { text-decoration: line-through; opacity: .55; }
.ag-group .ag-net { margin: 0; }
.b-full { background: var(--warn-bg); color: var(--warn); }
.b-exact { background: var(--t-approval); color: var(--c-approval); cursor: help; }
.ag-fixed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.ag-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ag-col h3 { margin: 0; font-size: 14px; font-weight: 600; }
.ag-col h3 + .ag-list { margin-top: 2px; }
.ag-col .ag-list + h3 { margin-top: 8px; }
.ag-col p { margin: 0; }
.ag-save { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 12px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.ag-save #save-note { flex: 1 1 360px; }
.ag-save .msg { flex: 1 1 100%; margin: 0; }
.ag-last { color: var(--ink); }
@media (max-width: 760px) {
  .ag-fixed { grid-template-columns: 1fr; }
  .ag-save { position: static; }
  .ag-table-wrap { margin: 0 12px 12px; overflow: visible; border: 0; background: transparent; }
  table.atable { min-width: 0; }
  table.atable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.atable, table.atable tbody, table.atable tr, table.atable td { display: block; width: 100%; }
  table.atable tr { margin-top: 10px; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
  table.atable td { padding: 6px 0; border: 0; min-width: 0; }
  table.atable td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px;
    font-weight: 500; color: var(--muted); }
  table.atable td.r-name::before { content: none; }
}

/* ------------------------------------------------------------------ «Расход токенов» (usage.html): as GitVerse «Аналитика» */
.u-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.u-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.u-label { font-size: 14px; color: var(--muted); }
.u-value { font-size: 30px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.u-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.u-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.u-chart { margin: 0; padding: 16px 18px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  min-width: 0; }
.u-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px;
  font-weight: 600; font-size: 15px; }
.u-chart figcaption .small { font-size: 13px; font-weight: 400; }
.u-svg { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.u-svg text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.u-grid line { stroke: var(--code); stroke-width: 1; }
.u-base { stroke: var(--line); stroke-width: 1; }
.u-mark { fill: var(--accent); }
.u-hit { fill: transparent; }
.u-bar { outline: none; cursor: default; }
.u-bar:hover .u-hit, .u-bar:focus-visible .u-hit { fill: var(--subtle); }
.u-bar:focus-visible .u-mark { stroke: var(--ink); stroke-width: 1.5; }
.u-tip { position: absolute; z-index: 60; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--panel); font-size: 12.5px; pointer-events: none; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.u-tip[hidden] { display: none; }
/* the authors: a box with a header strip, as GitVerse lists */
.u-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
/* «Качество работы агента»: tiles inside the card, the reasons table below */
.u-quality { padding: 16px 18px; }
.u-quality .u-tile { background: var(--subtle); }
table.u-table.u-stops { min-width: 0; }
table.u-table td:first-child { padding-left: 18px; }
.u-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 18px; background: var(--subtle);
  border-bottom: 1px solid var(--line); font-size: 13px; }
.u-card-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.u-table-wrap { overflow-x: auto; }
table.u-table { width: 100%; min-width: 760px; margin: 0; font-size: 14px; }
table.u-table th, table.u-table td { padding: 12px; vertical-align: middle; border-bottom: 0; border-top: 1px solid var(--code); }
table.u-table th:first-child { padding-left: 18px; }
table.u-table th:last-child, table.u-table td:last-child { padding-right: 18px; }
table.u-table thead th { border-top: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
table.u-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.u-table tbody th { font-weight: 500; text-align: left; }
.u-who { display: inline-flex; align-items: center; gap: 8px; }
.u-who .avatar { width: 24px; height: 24px; font-size: 11px; }
.u-plus { color: var(--ok); }
.u-minus { color: var(--err); }
.u-sort { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.u-sort:hover { color: var(--ink); }
.u-tokens { min-width: 150px; }
.u-tokens > span { display: block; }
.u-meter { display: block; width: 100%; height: 6px; margin-top: 4px; }
.u-track { fill: var(--code); }
.u-foot { margin: 0; padding: 10px 18px 14px; }

/* filled status pills: light statuses keep dark text; in the dark theme the text is dark on the bright colors */
.pill.st-queued, .pill.st-cancelled { background: var(--code); color: var(--ink); }
@media (prefers-color-scheme: dark) { .pill { color: var(--bg); } .pill.st-queued, .pill.st-cancelled { color: var(--ink); } }

/* «Репозитории»: rules of a repository (repo_rules.py) */
.r-acts button { display: block; width: 100%; }  /* one under the other: the column's width is fixed */
.r-acts button + button { margin-top: 6px; }
.r-acts .count { margin-left: 6px; }
@media (max-width: 760px) {
  .r-acts button { display: inline-block; width: auto; }
  .r-acts button + button { margin: 0 0 0 6px; }
}
.rl-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.rl-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; }
.rl-item .sw { flex: none; margin-top: 1px; }
.rl-body { flex: 1 1 auto; min-width: 0; }
.rl-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.rl-off .rl-text { color: var(--muted); }
.rl-acts { display: flex; flex: none; align-items: center; gap: 6px; }
.rl-acts button { padding: 3px 10px; font-size: 13px; }
.rl-editing { flex-direction: column; align-items: stretch; }
.rl-panel textarea { width: 100%; box-sizing: border-box; font-family: inherit; }
.r-form .rl-acts.row { margin-top: 8px; flex-wrap: wrap; }
.r-form .rl-empty { margin-top: 12px; }
.rl-add { margin-top: 12px; }
.rl-panel .r-msg:not(:empty) { margin-top: 10px; }
@media (max-width: 640px) {
  .rl-item { flex-wrap: wrap; }
  .rl-body { flex-basis: calc(100% - 60px); }
  .rl-item > .rl-acts { width: 100%; justify-content: flex-end; }
}

/* «Репозитории»: review lessons (lessons.py) */
.ls-repo { margin: 12px 0 16px; }
.ls-repo h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.ls-repo ol { margin: 0 0 10px; padding-left: 22px; }
.ls-repo li { margin: 4px 0; }
.ls-forget { margin-left: 8px; padding: 0 6px; font-size: 12px; }

/* ------------------------------------------------------------------ «Обратная связь» (feedback.html) */
/* the actions on the checked ones float at the bottom: checking a card never moves the list */
.fb-bulk { position: fixed; left: 50%; bottom: 20px; z-index: 6; transform: translateX(-50%); width: min(720px, calc(100vw - 32px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 8px 24px rgba(17, 20, 24, .18); font-weight: 600; }
.fb-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 64px; }
.fb-card { display: grid; grid-template-columns: 24px 200px minmax(0, 1fr); gap: 14px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.fb-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fb-side { padding-top: 2px; }
.fb-check { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.fb-check:disabled { cursor: not-allowed; opacity: .4; }
.fb-thumb { display: flex; align-items: center; justify-content: center; width: 200px; height: 130px; padding: 0;
  overflow: hidden; background: var(--code); border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; }
.fb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.fb-thumb.fb-noshot { cursor: default; }
.fb-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.fb-author { font-weight: 600; }
.fb-st { padding: 0 8px; border-radius: 9999px; font-size: 12px; font-weight: 600; background: var(--code); }
.fb-st-new { background: var(--t-working); color: var(--c-working); }
.fb-st-task { background: var(--ok-bg); color: var(--ok); }
.fb-st-dismissed { color: var(--muted); }
.fb-page { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; color: var(--accent);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-page:hover { text-decoration: underline; }
.fb-page .ic { flex: none; width: 12px; height: 12px; }
.fb-text { display: flex; flex-direction: column; gap: 8px; }
.fb-comment { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-sel { margin: 0; padding: 4px 12px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap;
  overflow-wrap: anywhere; font-size: 14px; }
.fb-el { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.fb-el code { overflow-wrap: anywhere; }
.fb-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-acts button { padding: 4px 12px; font-size: 13px; }
.fb-edit { display: flex; flex-direction: column; gap: 10px; }
.fb-edit textarea { font-family: inherit; font-size: 14px; }
.fb-edit select { width: auto; }
dialog.fb-dlg.fb-task { width: min(92vw, 640px); }
dialog.fb-dlg.fb-task textarea { font-family: inherit; font-size: 14px; }
dialog.fb-dlg.fb-wide { width: min(96vw, 1400px); max-height: 94vh; }
.fb-view { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; }
.fb-view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow-wrap: anywhere; }
.fb-view img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.fb-pick { max-height: 180px; margin: 0; padding: 8px 12px 8px 28px; overflow: auto; background: var(--subtle);
  border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.fb-pick li { overflow-wrap: anywhere; }
.fb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fb-steps { margin: 0; padding-left: 22px; }
.fb-steps li { margin: 4px 0; }
.fb-keyadd { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.fb-keyadd .field { flex: 0 1 320px; }
table.fb-keys { min-width: 640px; }
tr.fb-revoked td { color: var(--muted); }
td.fb-origins { display: flex; flex-direction: column; gap: 2px; }
td.fb-origins code { white-space: nowrap; }
table.fb-sites { min-width: 880px; }
td.fb-site-acts { white-space: nowrap; }
td.fb-site-acts button { margin-left: 4px; }
.fb-snippet { margin: 0; padding: 10px 12px; overflow-x: auto; background: var(--subtle); border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 760px) {
  .fb-card { grid-template-columns: 24px minmax(0, 1fr); }
  .fb-thumb { grid-column: 2; width: 100%; height: 160px; }
  .fb-main { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ «Чат с агентом», as Claude's own app: the chats on
   the left, the conversation in the middle (the person's messages as bubbles on the right, Claude's answers with its
   mark and what it did), the composer as one box below, the panel «Изменения» on the right (diff, commit, push, PR).
   The page's own tokens: the surfaces of the conversation and the colour of each mode. */
.chat-page {
  --ch-bg: var(--subtle); --ch-surface: var(--panel); --ch-bubble: #eef0fb; --ch-hover: rgba(102, 113, 133, .08);
  --ch-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --ch-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --m-plan: var(--c-planning); --m-manual: var(--c-approval); --m-auto: var(--accent);
  --ch-seg-on: var(--panel);
  --ch-radius: 14px;
  max-width: none; padding: 12px 20px 16px; gap: 10px;
}
@media (prefers-color-scheme: dark) {
  .chat-page { --ch-bubble: #23264a; --ch-hover: rgba(154, 163, 178, .1); --ch-seg-on: #363d4c;
    --ch-shadow: 0 1px 2px rgba(0, 0, 0, .3); --ch-shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); }
}
.chat-page .ic { width: 16px; height: 16px; flex: none; }
.ch-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 14px; align-items: stretch;
  height: calc(100vh - var(--head-h) - 28px); min-height: 520px; }
.ch-layout.with-panel { grid-template-columns: 220px minmax(0, 1fr) minmax(340px, 30%); }

/* buttons of the page: icon-only, chip-like, the pulse of «Claude works» */
.ch-ibtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; }
.ch-ibtn:hover { background: var(--ch-hover); color: var(--ink); border-color: transparent; }
.ch-ibtn.ch-danger:hover { background: var(--err-bg); color: var(--err); }
.ch-chipbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 9999px; background: var(--ch-surface); color: var(--muted); font-size: 12.5px; cursor: pointer;
  transition: color .15s, border-color .15s; }
.ch-chipbtn:hover, .ch-chipbtn[aria-expanded="true"] { color: var(--ink); border-color: var(--accent); }
.ch-chipbtn .ic { width: 14px; height: 14px; }
.ch-pulse { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); animation: ch-pulse 1.4s ease-in-out infinite; }
@keyframes ch-pulse { 50% { opacity: .35; } }
.ch-link { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12.5px; cursor: pointer; }
.ch-link:hover { text-decoration: underline; }

/* the chats */
.ch-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ch-newbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 40px;
  border-radius: 10px; background: var(--ch-surface); box-shadow: var(--ch-shadow); font-weight: 600; }
.ch-newbtn .ic { width: 16px; height: 16px; color: var(--accent); }
.ch-summary { margin: 2px 4px 0; }
.ch-summary.ch-warn { color: var(--warn); font-weight: 600; }
.ch-list { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.ch-group { margin: 12px 8px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); }
.ch-none { margin: 8px 4px; }
.ch-item { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; text-align: left;
  background: transparent; border: 0; border-radius: 8px; cursor: pointer; transition: background .15s; }
.ch-item:hover { background: var(--ch-hover); }
.ch-item.sel { background: var(--ch-surface); box-shadow: var(--ch-shadow); }
.ch-item-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-item.sel .ch-item-title { font-weight: 600; }
.ch-item-meta { display: flex; gap: 8px; justify-content: space-between; min-width: 0; font-size: 12px; color: var(--muted); }
.ch-item-repo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the conversation */
.ch-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: var(--ch-surface); border: 1px solid var(--line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow);
  overflow: hidden; }
.ch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--line); }
.ch-title { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ch-title input { margin-left: -7px; padding: 3px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent;
  font-family: inherit; font-size: 16px; font-weight: 600; }
.ch-title input:hover { background: var(--ch-hover); }
.ch-title input:focus { background: var(--bg); }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ch-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 280px; padding: 1px 8px; border-radius: 6px;
  background: var(--code); color: var(--ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-tag.mono { font-family: var(--mono); font-size: 11.5px; }
.ch-tag .ic { width: 12px; height: 12px; color: var(--muted); }
.ch-tag.pr { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
.ch-tag.pr .ic { color: var(--ok); }
.ch-actions { display: flex; align-items: center; gap: 4px; }
.ch-changes-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px;
  font-weight: 500; }
.ch-changes-btn .ic { color: var(--muted); }
.ch-changes-btn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent); }
.ch-changes-btn[aria-pressed="true"] .ic { color: var(--accent); }
.ch-changes-btn .count { background: var(--accent); color: var(--accent-ink); }

.ch-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px max(20px, calc((100% - 820px) / 2)) 12px;
  display: flex; flex-direction: column; gap: 22px; }
.ch-hint { margin: auto; text-align: center; }

/* the empty chat */
.ch-welcome { margin: auto 0; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 12px 0; }
.ch-welcome h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.ch-welcome > p { margin: 0; max-width: 620px; font-size: 15px; line-height: 1.55; }
.ch-repo { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--ch-surface); font-size: 13px; color: var(--muted); }
.ch-repo select { width: auto; height: 30px; border: 0; background: transparent; font-weight: 600; font-size: 14px; }
.ch-target { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-repo > span { display: inline-flex; align-items: center; gap: 5px; }
.ch-repo .ic { width: 14px; height: 14px; }
.ch-repo select#new-branch { max-width: 260px; font-family: var(--mono); font-size: 13px; }
.ch-base { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 2px 0 10px; border: 1px solid var(--line);
  border-radius: 9px; color: var(--muted); }
.ch-base:hover { background: var(--ch-hover); }
.ch-base .ic { width: 15px; height: 15px; }
.ch-base select { width: auto; max-width: 220px; height: 30px; padding: 0 24px 0 4px; border: 0; background-color: transparent;
  color: var(--ink); font-family: var(--mono); font-size: 12.5px; cursor: pointer; }
.ch-base select:disabled { cursor: default; color: var(--muted); }
.ch-starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ch-starter { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; text-align: left; border-radius: 12px;
  background: var(--ch-surface); box-shadow: var(--ch-shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.ch-starter:hover { border-color: var(--accent); transform: translateY(-1px); }
.ch-starter strong { font-size: 14px; }
.ch-starter span { font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; }
.ch-modes-help { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.ch-modes-help li { display: flex; align-items: center; gap: 8px; }
.ch-modes-help li span:last-child { color: var(--muted); }
.ch-mode-ic { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; }
.ch-mode-ic .ic { width: 14px; height: 14px; }
.ch-mode-ic.plan { background: var(--t-planning); color: var(--m-plan); }
.ch-mode-ic.manual { background: var(--t-approval); color: var(--m-manual); }
.ch-mode-ic.auto { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--m-auto); }

/* avatars */
.ch-ava { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px;
  border-radius: 9px; font-size: 13px; font-weight: 600; }
.ch-ava.claude { background: var(--claude); color: #fff; }
.ch-ava.codex { background: var(--ink); color: var(--bg); }
.ch-ava.claude .ic, .ch-ava.codex .ic { width: 16px; height: 16px; }
.ch-ava-lg { width: 44px; height: 44px; border-radius: 13px; }
.ch-ava-lg .ic { width: 24px !important; height: 24px !important; }

/* messages */
.ch-msg { display: flex; min-width: 0; }
.ch-msg.me { flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; max-width: min(640px, 86%); }
.ch-bubble { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; background: var(--ch-bubble);
  border-radius: 16px 16px 4px 16px; }
.ch-msg.ai { gap: 12px; align-items: flex-start; }
.ch-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ch-msg.ai.err .ch-ava.claude, .ch-msg.ai.err .ch-ava.codex { background: var(--err); color: #fff; }
.ch-msg.ai.err .ch-content > .ch-body { padding: 8px 12px; border-radius: 8px; background: var(--err-bg); color: var(--err); }
.ch-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 28px; font-size: 13px; }
.ch-msg.ai .ch-who strong { font-size: 14px; }
.ch-clock { font-variant-numeric: tabular-nums; }
.ch-mode { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9999px; font-size: 11px;
  font-weight: 600; }
.ch-mode-plan { color: var(--m-plan); background: var(--t-planning); }
.ch-mode-manual { color: var(--m-manual); background: var(--t-approval); }
.ch-mode-auto { color: var(--m-auto); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ch-msg-acts { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; min-height: 28px; opacity: 0;
  transition: opacity .15s; }
.ch-msg:hover .ch-msg-acts, .ch-msg-acts:focus-within, .ch-msg.is-last .ch-msg-acts,
.ch-msg.ai:has(.ch-chipbtn[aria-expanded="true"]) .ch-msg-acts { opacity: 1; }
@media (hover: none) { .ch-msg-acts { opacity: 1; } }
.ch-msg-acts .ch-ibtn { width: 28px; height: 28px; }
.ch-msg-acts .ch-ibtn .ic { width: 15px; height: 15px; }
.ch-msg-acts .ch-chipbtn { margin-left: 4px; }
.ch-meta-line { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; font-size: 12px; color: var(--muted); }
.ch-meta-line .ch-mode { margin-left: 4px; }
.ch-steps { flex-basis: 100%; margin-top: 4px; padding: 10px 12px; background: var(--ch-bg); border: 1px solid var(--line);
  border-radius: 10px; }

/* the text of answers */
.ch-body { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.ch-body > * { margin: 0 0 12px; }
.ch-body > :last-child { margin-bottom: 0; }
.ch-body ul, .ch-body ol { padding-left: 22px; }
.ch-body li + li { margin-top: 3px; }
.ch-body li.ch-task { list-style: none; margin-left: -20px; }
.ch-body li.ch-task input { width: auto; margin: 0 4px 0 0; }
.ch-body code { padding: 1px 5px; border-radius: 5px; background: var(--code); font-family: var(--mono); font-size: .86em; }
.ch-body .ch-h { margin: 18px 0 6px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.ch-body > .ch-h:first-child { margin-top: 0; }
.ch-body blockquote { padding: 2px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.ch-body hr { border: 0; border-top: 1px solid var(--line); }
.ch-body a { color: var(--accent); }
.ch-plain { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.ch-codewrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ch-codebar { display: flex; justify-content: space-between; align-items: center; padding: 5px 12px; background: var(--ch-bg);
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
pre.ch-code { margin: 0; padding: 12px 14px; overflow: auto; max-height: 520px; background: var(--code);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre; }
.ch-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ch-table th, .ch-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ch-table tr:last-child td { border-bottom: 0; }
.ch-table th { background: var(--ch-bg); font-weight: 600; }

/* what Claude did: its text, tool calls, thinking, its to-do list */
.ch-act { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-tool { border: 1px solid var(--line); border-radius: 10px; background: var(--ch-surface); font-size: 13px; }
.ch-tool summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; list-style: none;
  min-width: 0; border-radius: 10px; }
.ch-tool summary:hover { background: var(--ch-hover); }
.ch-tool summary::-webkit-details-marker { display: none; }
.ch-tool-name { flex: none; padding: 0 6px; border-radius: 5px; background: var(--code); font-family: var(--mono);
  font-size: 11px; font-weight: 600; color: var(--accent); }
.ch-tool-arg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono);
  font-size: 12px; color: var(--muted); }
.ch-tool-err { margin-left: auto; color: var(--err); font-size: 12px; font-weight: 600; }
.ch-tool.err { border-color: var(--att-line); }
.ch-tool.running summary .ch-tool-name { animation: ch-pulse 1.4s ease-in-out infinite; }
.ch-tool > p, .ch-tool-out { margin: 0; padding: 6px 10px 8px; border-top: 1px solid var(--line); }
pre.ch-tool-out { max-height: 260px; overflow: auto; background: #0b0f14; color: #d7dde4; font-family: var(--mono);
  font-size: 11.5px; white-space: pre-wrap; word-break: break-word; border-radius: 0 0 10px 10px; }
.ch-think { font-size: 13px; color: var(--muted); }
.ch-think summary { cursor: pointer; font-style: italic; }
.ch-think p { margin: 4px 0 0; font-style: italic; }
.ch-todo { margin: 0; padding: 10px 12px; list-style: none; background: var(--ch-bg); border: 1px solid var(--line);
  border-radius: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.ch-todo li { padding-left: 22px; position: relative; }
.ch-todo li::before { position: absolute; left: 0; content: "○"; color: var(--muted); }
.ch-todo-done { color: var(--muted); text-decoration: line-through; }
.ch-todo-done::before { content: "✓" !important; color: var(--ok) !important; }
.ch-todo-now { font-weight: 600; }
.ch-todo-now::before { content: "▸" !important; color: var(--accent) !important; }
.ch-act-err { margin: 0; color: var(--err); font-size: 13px; }
.ch-act-ok { margin: 0; }
.ch-typing { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ch-typing > span { width: 7px; height: 7px; border-radius: 50%; background: var(--claude); animation: ch-dot 1.2s infinite; }
.ch-typing > span:nth-child(2) { animation-delay: .15s; }
.ch-typing > span:nth-child(3) { animation-delay: .3s; }
.ch-typing p { flex-basis: 100%; margin: 6px 0 0; }
@keyframes ch-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* notes of the worker: the working copy, a commit, a push, a pull request */
.ch-event { align-self: center; display: flex; align-items: center; gap: 8px; max-width: min(720px, 100%); padding: 5px 12px 5px 6px;
  border: 1px solid var(--line); border-radius: 9999px; background: var(--ch-bg); font-size: 12.5px; color: var(--muted); }
.ch-event-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--ch-surface); color: var(--muted); }
.ch-event-ic .ic { width: 13px; height: 13px; }
.ch-event-text { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.ch-event-link { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--accent); font-weight: 500;
  text-decoration: none; }
.ch-event-link .ic { width: 12px; height: 12px; }
.ch-event-time { flex: none; font-size: 11.5px; }
.ev-commit .ch-event-ic, .ev-push .ch-event-ic { color: var(--accent); }
.ev-pr .ch-event-ic { color: var(--ok); background: var(--ok-bg); }
.ev-alert { border-color: var(--att-line); background: var(--err-bg); }
.ev-alert .ch-event-ic, .ev-alert .ch-event-text { color: var(--err); }

/* files of a message */
.ch-thumbs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ch-thumb { width: 104px; height: 104px; padding: 0; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* the files Claude made for the person, under its answer */
.ch-out { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ch-out .ch-thumbs { justify-content: flex-start; }
.ch-chip { display: inline-flex; align-items: center; max-width: 260px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--ch-surface); font-size: 12.5px; }
.ch-chip-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 9px; border: 0;
  background: transparent; font-size: 12.5px; }
.ch-chip-name img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.ch-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ch-ext { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--code); font-family: var(--mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.ch-chip-x { padding: 0 9px; border: 0; background: transparent; font-size: 16px; color: var(--muted); cursor: pointer; }
.ch-chip-x:hover { color: var(--err); }
dialog.ch-dlg { width: auto; max-width: min(96vw, 1200px); max-height: 94vh; }
.ch-view { padding: 12px; }
.ch-view-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.ch-view-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-view img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 8px; }

/* Claude asks for permission (manual mode), a plan to carry out */
.ch-reqs { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--t-approval);
  border: 1px solid color-mix(in srgb, var(--m-manual) 30%, transparent); border-radius: 12px; }
.ch-reqs-title { margin: 0; }
.ch-req { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ch-req input { width: auto; }
.ch-req code { padding: 2px 6px; border-radius: 5px; background: var(--ch-surface); font-family: var(--mono); font-size: 12px;
  overflow-wrap: anywhere; }
.ch-req.denied { color: var(--err); }
.ch-plan { align-items: center; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }

/* the composer */
.ch-tobottom { position: absolute; left: 50%; bottom: 150px; z-index: 2; width: 34px; height: 34px; padding: 0;
  transform: translateX(-50%); border-radius: 50%; background: var(--ch-surface); color: var(--ink); box-shadow: var(--ch-shadow-lg); }
.ch-compose { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 6px max(20px, calc((100% - 820px) / 2)) 12px; }
.ch-editing, .ch-queued { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 7px 12px;
  border-radius: 10px; background: var(--t-approval); font-size: 13px; }
.ch-queued { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ch-box { --mode: var(--m-plan); position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 8px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--ch-shadow-lg);
  transition: border-color .15s, box-shadow .15s; }
.ch-box[data-mode="manual"] { --mode: var(--m-manual); }
.ch-box[data-mode="auto"] { --mode: var(--m-auto); }
.ch-box:focus-within { border-color: var(--mode); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mode) 15%, transparent), var(--ch-shadow-lg); }
.ch-box textarea { min-height: 48px; max-height: 40vh; padding: 2px; border: 0; background: transparent; resize: none;
  font-family: inherit; font-size: 15px; line-height: 1.5; field-sizing: content; }
.ch-box textarea:focus { outline: none; }
.ch-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ch-attach { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px;
  cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.ch-attach:hover, .ch-attach:focus-within { background: var(--ch-hover); color: var(--ink); }
.ch-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ch-attach .ic { width: 18px; height: 18px; }
.ch-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--code); }
.ch-seg button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.ch-seg button .ic { width: 14px; height: 14px; }
.ch-seg button:hover { color: var(--ink); }
.ch-seg button[aria-pressed="true"] { background: var(--ch-seg-on); color: var(--ink); box-shadow: var(--ch-shadow); }
.ch-seg button[data-mode="plan"][aria-pressed="true"] .ic { color: var(--m-plan); }
.ch-seg button[data-mode="manual"][aria-pressed="true"] .ic { color: var(--m-manual); }
.ch-seg button[data-mode="auto"][aria-pressed="true"] .ic { color: var(--m-auto); }
.ch-sel select { width: auto; height: 32px; padding: 0 26px 0 10px; border: 1px solid transparent; border-radius: 9px;
  background-color: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.ch-sel select:hover { background-color: var(--ch-hover); color: var(--ink); }
.ch-send { width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; }
.ch-send .ic { width: 18px; height: 18px; }
.ch-send:disabled { opacity: .45; }
.ch-stop { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9999px;
  color: var(--err); font-weight: 500; }
.ch-stop .ic { width: 12px; height: 12px; fill: currentColor; }
.ch-hints { margin: 0 6px; text-align: center; }
.ch-suggest { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 3; max-height: 260px;
  margin: 0; padding: 4px; overflow-y: auto; list-style: none; background: var(--ch-surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--ch-shadow-lg); }
.ch-suggest li { padding: 6px 10px; border-radius: 8px; font-family: var(--mono); font-size: 12.5px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-suggest li.sel, .ch-suggest li:hover { background: var(--ch-hover); }
.ch-drop { position: absolute; inset: 8px; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 10%, var(--ch-surface)); border: 2px dashed var(--accent); border-radius: 12px;
  color: var(--accent); font-size: 18px; font-weight: 600; pointer-events: none; }

/* the panel «Изменения» */
.ch-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--ch-surface);
  border: 1px solid var(--line); border-radius: var(--ch-radius); box-shadow: var(--ch-shadow); overflow: hidden; }
.ch-panel-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.ch-panel-ic { display: inline-flex; color: var(--accent); }
.ch-panel-head h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; }
.ch-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.ch-panel-body > p { margin: 0; }
.ch-sec { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.ch-sec h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; font-weight: 600; }
.ch-sec p { margin: 0; }
.ch-sec textarea { font-family: inherit; font-size: 13.5px; }
.ch-cfiles { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.ch-cfile { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 6px; font-size: 12.5px; }
.ch-cfile:hover { background: var(--ch-hover); }
.ch-cfile input { width: auto; }
.ch-cfile code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.ch-fst { flex: none; min-width: 84px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ch-fst.st-new, .ch-fst.st-A { color: var(--ok); }
.ch-fst.st-D { color: var(--err); }
.ch-fst.st-M, .ch-fst.st-R { color: var(--c-approval); }
.ch-diff { display: flex; flex-direction: column; gap: 8px; }
.ch-dfile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ch-dfile summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--ch-bg); cursor: pointer;
  font-size: 12.5px; }
.ch-dfile summary code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.ch-plus { color: var(--ok); font-family: var(--mono); font-size: 12px; }
.ch-minus { color: var(--err); font-family: var(--mono); font-size: 12px; }
pre.ch-patch { margin: 0; max-height: 420px; overflow: auto; padding: 4px 0; background: var(--ch-surface); font-family: var(--mono);
  font-size: 11.5px; line-height: 1.55; }
pre.ch-patch div { padding: 0 10px; white-space: pre; }
.ch-patch .d-add { background: var(--ok-bg); color: var(--ok); }
.ch-patch .d-del { background: var(--err-bg); color: var(--err); }
.ch-patch .d-hunk { color: var(--c-planning); background: var(--ch-bg); }
.ch-commits { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ch-commits li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-size: 12.5px; }
.ch-commits li:hover { background: var(--ch-hover); }
.ch-commits code { font-family: var(--mono); color: var(--muted); }
.ch-csub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pushed { color: var(--ok); font-size: 12px; font-weight: 500; }
.ch-push { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.ch-push input { font-family: var(--mono); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .ch-pulse, .ch-tool.running summary .ch-tool-name, .ch-typing > span { animation: none; }
  .ch-starter:hover { transform: none; }
}
@media (max-width: 1100px) {
  .ch-layout, .ch-layout.with-panel { grid-template-columns: 220px minmax(0, 1fr); }
  .ch-panel { position: fixed; z-index: 20; top: calc(var(--head-h) + 8px); right: 8px; bottom: 8px;
    width: min(480px, calc(100vw - 16px)); box-shadow: var(--ch-shadow-lg); }
}
@media (max-width: 760px) {
  .chat-page { padding: 8px; }
  .ch-layout, .ch-layout.with-panel { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ch-side { max-height: 210px; }
  .ch-main { height: calc(100dvh - var(--head-h) - 24px); min-height: 480px; }
  .ch-log { padding: 16px 14px 8px; }
  .ch-compose { padding: 6px 10px 10px; }
  .ch-msg.me { max-width: 92%; }
  .ch-starters { grid-template-columns: minmax(0, 1fr); }
  .ch-sel select { max-width: 112px; }
  .ch-base select { max-width: 130px; }
  .ch-seg button { padding: 0 8px; }
  .ch-seg button .ic { display: none; }
  .ch-hints { display: none; }
  .ch-event-time { display: none; }
}

/* «Сборка»: the folding settings, the builds as CI/CD pipelines (the list, the chosen one: stages, progress, output) */
.bd-setup { margin-bottom: 16px; }
.bd-setup-head { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.bd-setup-head::-webkit-details-marker { display: none; }
.bd-setup:not([open]) .bd-setup-head { border-bottom: 0; }
.bd-setup-head:hover h2 { color: var(--accent); }
.bd-chev { display: inline-flex; color: var(--muted); transition: transform .15s; }
.bd-chev .ic { width: 16px; height: 16px; }
.bd-setup[open] .bd-chev { transform: rotate(90deg); }
.bd-setup-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); }
.bd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.bd-grid > .field { grid-column: span 2; }
.bd-grid > .bd-host { grid-column: span 3; }
.bd-grid > .bd-port { grid-column: span 1; }
.bd-grid > .bd-wide { grid-column: 1 / -1; }
.bd-grid input { width: 100%; }
.bd-keybox { border-top: 1px solid var(--line); }
.bd-key { display: flex; align-items: flex-start; gap: 10px; }
.bd-pub { flex: 1; min-width: 0; padding: 8px 10px; background: var(--code); border-radius: 6px; font-size: 12px;
  overflow-wrap: anywhere; user-select: all; }
.bd-setup-foot { flex-direction: row; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.bd-ci { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.bd-builds { list-style: none; margin: 0; padding: 6px; max-height: 75vh; overflow: auto; }
.bd-empty { padding: 10px 12px; }
.bd-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0;
  border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.bd-item:hover { background: var(--subtle); }
.bd-item[aria-current="true"] { background: var(--st-bg); box-shadow: inset 3px 0 0 var(--st); }
.bd-item-ic { color: var(--st); display: inline-flex; padding-top: 2px; }
.bd-item-ic .ic { width: 18px; height: 18px; }
.bd-item.st-working .bd-item-ic .ic { animation: spin 1.6s linear infinite; }
.bd-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd-item-top { display: flex; gap: 8px; min-width: 0; }
.bd-item-top .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; padding-top: 1px; }
.bd-dhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bd-stages { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; list-style: none; margin: 0; padding: 0; }
.bd-stage { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 180px; min-width: 0;
  padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--st); border-radius: 6px;
  background: var(--panel); }
.bd-stage-ic { color: var(--st); display: inline-flex; }
.bd-stage-ic .ic { width: 18px; height: 18px; }
.bd-stage.st-working .bd-stage-ic .ic { animation: spin 1.6s linear infinite; }
.bd-stage-text { display: flex; flex-direction: column; min-width: 0; }
.bd-stage-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.bd-progress { display: flex; flex-direction: column; gap: 4px; }
.bd-bar { width: 100%; height: 8px; border: 0; border-radius: 9999px; background: var(--code); overflow: hidden;
  appearance: none; accent-color: var(--st); }
.bd-bar::-webkit-progress-bar { background: var(--code); border-radius: 9999px; }
.bd-bar::-webkit-progress-value { background: var(--st); border-radius: 9999px; transition: width .4s; }
.bd-bar::-moz-progress-bar { background: var(--st); border-radius: 9999px; }
.bd-termbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 18px;
  border-top: 1px solid var(--line); }
.bd-termbar .field.inline { font-weight: 400; }
.bd-termbar button { padding: 4px 10px; font-size: 12.5px; }
.bd-term { max-height: 70vh; min-height: 280px; margin: 0; border-radius: 0; }
@media (prefers-reduced-motion: reduce) {
  .bd-item.st-working .bd-item-ic .ic, .bd-stage.st-working .bd-stage-ic .ic { animation: none; }
}
@media (max-width: 900px) {
  .bd-ci { grid-template-columns: 1fr; }
  .bd-builds { max-height: 260px; }
}
@media (max-width: 760px) {
  .bd-grid { grid-template-columns: 1fr; }
  .bd-grid > .field, .bd-grid > .bd-host, .bd-grid > .bd-port { grid-column: 1 / -1; }
  .bd-setup-sum { display: none; }
}
