/* #668: the landing's typeface, served by the panel itself (CSP: fonts from 'self' only). */
@font-face {
  font-family: Geist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Geist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist-latin.woff2) format("woff2");
  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;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist-mono-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/geist-mono-latin.woff2) format("woff2");
  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;
}

/* #668: the palette of the landing's drawn panel — near-white, ink, one orange accent.
   t88 (Артём 16.10, вариант 3): neutral zinc greys instead of the warm stone ones — no cream.
   Light by default; dark only by the switch (theme.js sets data-theme). */
:root {
  color-scheme: light;
  --bg: #fafafa;
  --panel: #ffffff;
  --s2: #f4f4f5;
  --text: #09090b;
  --muted: #71717a;
  --line: #e4e4e7;
  --acc: #ff5b24;
  --accs: #fff1eb;
  --btn: #18181b;
  --btnink: #ffffff;
  --face: #fff3e2;
  --accent: var(--acc);
  --accent-soft: var(--accs);
  --danger: #dc2626;
  --warn-soft: #fff7ec;
  --user: #e9f1ff;
  --assistant: var(--s2);
  --mark: #fde68a;
  --chart-bar: #ffb199;
  --header: var(--bg);
  --header-text: var(--muted);
  --hero: var(--s2);
  --bad: #dc2626;
  --bad-soft: color-mix(in srgb, var(--bad) 12%, transparent);
  --warn: #b45309;
  --warn-strong: #f59e0b;
  --warn-tint: color-mix(in srgb, var(--warn-strong) 16%, transparent);
  --good: #16a34a;
  --good-soft: color-mix(in srgb, var(--good) 12%, transparent);
  --info: #0ea5e9;
  --on-status: #fff;
  --radius: 14px;
  --shadow: none;
  --chart-line: var(--acc);
  --body: Geist, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0b;
  --panel: #131316;
  --s2: #1b1b1f;
  --text: #f4f4f5;
  --muted: #9a9ca3;
  --line: #26262b;
  --accs: #2a160e;
  --btn: #f4f4f5;
  --btnink: #0a0a0b;
  --face: #2a1f16;
  --danger: #f87171;
  --warn-soft: #1d1610;
  --user: #1d2a40;
  --mark: #6b5516;
  --chart-bar: #9a3a17;
  --bad: #f87171;
  --warn: #fbbf24;
  --good: #34d399;
  --on-status: #140d0d;
}

* {
  box-sizing: border-box;
}

/* The attribute wins over any display a class sets, so the script hides a part by `hidden` alone. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
}

.top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 600;
}

.nav-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
}

.tabs,
.nav-groups {
  align-items: center;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem clamp(1rem, 3vw, 2rem) 0;
}

.tabs a,
.nav-groups a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
}

.tabs a[aria-current="page"],
.nav-groups a[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.attention {
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
}

.attention > h2 {
  margin-top: 0;
}

.next-action,
.empty-state {
  padding: 0.75rem;
  border-radius: 6px;
  background: var(--accent-soft);
}

.related-views,
.gap-head,
.facts dd {
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .top {
    position: static;
    gap: 0.75rem;
  }
  .nav-groups {
    order: 3;
    flex-basis: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-groups a,
  .tabs a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .who {
    margin-left: auto;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }
  .attention {
    padding: 0.75rem;
  }
  .filters > *,
  .actions > input {
    max-width: 100%;
  }
}

.who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.who form {
  margin: 0;
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 3rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.75rem;
}

h3 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

/* A folded table's title reads as its heading would. */
summary {
  cursor: pointer;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

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

.small {
  font-size: 0.85rem;
}

.error {
  color: var(--danger);
}

.notice:empty,
.error:empty {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

th.num,
td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: none;
}

.tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.45rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--text);
}

.progress {
  white-space: nowrap;
}

meter {
  width: 6rem;
  vertical-align: middle;
}

.status {
  white-space: nowrap;
}

.status.completed,
.status.live {
  color: var(--accent);
}

.status.revoked {
  color: var(--danger);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0 2rem;
}

/* Tables of four columns need more room than a list of facts before they sit side by side. */
.columns.wide {
  grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message {
  max-width: 44rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.message.user {
  align-self: flex-start;
  background: var(--user);
}

.message.assistant {
  align-self: flex-end;
  background: var(--assistant);
}

.message .meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.message .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The dialog screen (#228): turns, days, screenshots, the hand the answer saw. */

.messages.dialog {
  max-height: 75vh;
}

.messages > button {
  align-self: center;
}

.turn {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.day {
  align-self: center;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.shot {
  margin: 0.25rem 0;
}

.shot img {
  display: block;
  max-width: min(22rem, 100%);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* The table scene (#246) is drawn for a phone; the panel shows it a little wider than a screenshot. */
.scene img {
  max-width: min(32rem, 100%);
}

.message .file {
  margin: 0.25rem 0;
  font-weight: 600;
}

.hand {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}

.hand summary {
  color: var(--muted);
  cursor: pointer;
}

.hand pre {
  margin: 0.4rem 0 0;
  padding: 0.5rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Sticks to the bottom of the dialog while the reader is further up. */
.messages .fresh {
  position: sticky;
  bottom: 0.25rem;
  box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
}

/* The bot's card markup (#347): a card reads as a card, not as letters in brackets. */
.playing-card {
  display: inline-block;
  padding: 0 0.3em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  font-weight: 600;
  white-space: nowrap;
}

.playing-card.red {
  color: var(--danger);
}

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 2px;
}

.hits ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.hits li {
  margin-bottom: 0.5rem;
}

.hits .text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

td.preview {
  max-width: 32rem;
  overflow-wrap: anywhere;
}

.gaps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gap-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.gap-head a {
  margin-left: auto;
}

.gap p {
  margin: 0;
}

.examples {
  margin: 0;
  padding-left: 1.2rem;
  overflow-wrap: anywhere;
}

.examples li + li {
  margin-top: 0.25rem;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.filters a {
  align-self: center;
}

/* The two dates of a span of one's own sit in the filter row like any other control. */
.filters .dates {
  display: contents;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inline-form input {
  flex: 1 1 12rem;
  min-width: 0;
}

.inline-form > a {
  align-self: center;
}

/* «Об ученике» (#779) in the student's card. */
.student-about textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

.student-name-editor {
  margin-top: 0.25rem;
}

.student-name-form {
  max-width: 24rem;
}

.student-name-form .form-control {
  margin-bottom: 0.5rem;
}

input,
select,
textarea {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

textarea {
  width: 100%;
  resize: vertical;
}

button {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--panel);
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

button.secondary {
  background: transparent;
  color: var(--accent);
}

.bot-text-toolbar,
.bot-text-heading,
.bot-text-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.bot-text-status {
  margin: 0;
  flex: 1 1 20rem;
}

.bot-text-card {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.bot-text-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.bot-text-actions .small {
  margin-left: auto;
}

.bot-text-default {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  color: var(--muted);
}

button.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

button.link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.placeholder {
  padding: 1rem 1.25rem;
  background: var(--warn-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

body.notice main {
  max-width: 34rem;
  padding-top: 4rem;
}

@media (max-width: 40rem) {
  th,
  td {
    padding: 0.45rem 0.5rem;
  }

  .who {
    width: 100%;
    justify-content: space-between;
  }
}

/* The team's groups of chats (#259): the same columns in every group, so the tables read as one list. */
.chat-groups table {
  table-layout: fixed;
}

.chat-groups th:first-child {
  width: 32%;
}

.chat-groups th:last-child {
  width: 11rem;
}

/* «Расход» (#258): four figures first, then the subscription's limit and the chart. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.tile,
.limits,
.chart {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.tile-label,
.limits-title {
  color: var(--muted);
  font-size: 0.85rem;
}

.tile-value {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0.15rem 0;
}

.delta {
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.limits {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.limit-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.limit-window progress {
  width: min(16rem, 100%);
  accent-color: var(--accent);
}

.chart {
  margin: 0 0 1rem;
  overflow-x: auto;
}

.chart svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.chart figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.chart .grid {
  stroke: var(--line);
}

.chart .axis {
  fill: var(--muted);
  font-size: 11px;
}

.chart .bar,
.legend-bar {
  fill: var(--chart-bar);
  background: var(--chart-bar);
}

.chart .line {
  stroke: var(--chart-line);
  stroke-width: 2;
}

.chart .dot {
  fill: var(--chart-line);
}

.chart .missing-cost {
  fill: var(--chart-line);
  font-size: 18px;
  font-weight: 700;
}

.legend-missing {
  color: var(--chart-line);
}

.legend-bar,
.legend-line {
  display: inline-block;
  width: 0.9rem;
  vertical-align: middle;
}

.legend-bar {
  height: 0.7rem;
}

.legend-line {
  height: 2px;
  background: var(--chart-line);
}

.usage-filters summary {
  font-weight: 400;
  margin: 0.25rem 0;
}

.usage-form {
  display: grid;
  gap: 0.5rem;
}

.usage-details {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

tr.muted td {
  color: var(--muted);
}

/* Operator drafts stay in their form while the conversation and lease refresh. */
.operator-panel,
.operator-notices {
  padding: 1rem;
  margin: 0.75rem 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.operator-panel h2,
.operator-notices h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.operator-composer {
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.operator-composer label {
  display: grid;
  gap: 0.3rem;
}

.operator-composer p {
  margin: 0;
}

.operator-composer button {
  justify-self: start;
}

.operator-returns,
.operator-farewells {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.operator-farewells button {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.operator-phrases,
.operator-journal {
  margin-top: 0.75rem;
}

.operator-events {
  max-height: 15rem;
  overflow-y: auto;
  padding-left: 1.5rem;
  font-size: 0.9rem;
}

.operator-events li + li {
  margin-top: 0.4rem;
}

.operator-tag,
.message.operator-message {
  background: var(--accent-soft);
}

.operator-tag {
  white-space: normal;
  overflow-wrap: anywhere;
}

.operator-notices {
  background: var(--warn-soft);
}

.operator-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.operator-notice p {
  flex: 1 1 15rem;
  margin: 0.25rem 0;
}

.knowledge-panel { margin-top: 1.25rem; }
.knowledge-layout { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 3fr); gap: 1.25rem; margin-top: 1rem; }
.knowledge-list { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.knowledge-list button { text-align: left; overflow-wrap: anywhere; }
.knowledge-list .selected { outline: 2px solid var(--accent, #287c65); outline-offset: 1px; }
.knowledge-detail { min-width: 0; overflow-wrap: anywhere; }
.knowledge-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; color: inherit; }
.knowledge-comment { white-space: pre-wrap; }
.knowledge-detail textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 700px) { .knowledge-layout { grid-template-columns: minmax(0, 1fr); } }

.knowledge-evaluation-form { display: grid; gap: .75rem; margin: 1rem 0; }
.knowledge-evaluation-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.knowledge-evaluation-form label { display: grid; grid-template-rows: 1fr auto; gap: .3rem; min-width: 0; }
.knowledge-evaluation-form select { width: 100%; min-width: 0; }
.knowledge-evaluation-form button { justify-self: start; }
@media (max-width: 700px) { .knowledge-evaluation-choices { grid-template-columns: minmax(0, 1fr); } }

.knowledge-preview { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel); min-width: 0; }
.knowledge-preview h3 { margin: 0 0 .75rem; }
.knowledge-preview-status { margin: .75rem 0; }
.knowledge-preview-conversation { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; max-height: 32rem; overflow-y: auto; overscroll-behavior: contain; }
.knowledge-preview-turn { border-radius: .65rem; padding: .85rem 1rem; background: var(--assistant); }
.knowledge-preview-turn.user { background: var(--user); }
.knowledge-preview-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 0; }
.knowledge-preview-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.knowledge-preview-model { margin: .75rem 0; }
.knowledge-preview-model summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.knowledge-preview form { margin: .75rem 0; }
.knowledge-preview textarea { resize: vertical; margin-top: .5rem; }
@media (max-width: 450px) { .knowledge-preview { padding: .85rem; } .knowledge-preview-conversation { max-height: 26rem; } .knowledge-preview-controls button { width: 100%; } }
/* Settings (#266): labels stay readable on narrow screens without inline style. */
.bot-settings fieldset { margin: 1rem 0; border: 1px solid var(--line); border-radius: .5rem; padding: 1rem; }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: .75rem 0; }
.settings-confirm { margin: 1rem 0; }
.bot-settings button { margin: .25rem; }
/* Settings rows (#698): what the student gets on the left, what is on now and the choice on the right. */
.bot-settings .settings-feature { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 13rem; align-items: start; gap: .5rem 1rem; margin: 0; padding: .7rem 0; border-top: 1px solid var(--line); }
.bot-settings .settings-group h3 + .settings-feature { border-top: 0; }
.settings-what { display: grid; gap: .15rem; }
.settings-now { justify-self: start; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; white-space: nowrap; background: var(--s2, #f1f1f1); color: var(--muted); }
.settings-now.on { color: var(--text); }
.settings-now.off { color: var(--muted); text-decoration: none; }
.settings-feature select, .settings-control > select { width: 100%; }
.settings-control { display: grid; gap: .4rem; }
.settings-numbers { display: grid; gap: .3rem; }
.settings-numbers label { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.bot-settings fieldset:is([data-area="features"], [data-area="access"]), .bot-settings fieldset[data-area="subject"]:not(.settings-fold fieldset) { border: 1px solid var(--line); box-shadow: none; }
.settings-changed { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; }
.settings-numbers input { width: 6rem; }
.settings-group { margin: .5rem 0 1rem; }
.settings-group h3 { margin: .75rem 0 .1rem; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.bot-settings .settings-more { margin: 1.5rem 0 .5rem; color: var(--muted); font-size: .9rem; font-weight: 500; }
.bot-settings .settings-fold > fieldset, .bot-settings .settings-fold > div { margin: .5rem 0 0; padding: 0; border: 0; box-shadow: none; background: none; }
.bot-settings .settings-subfold { margin: .25rem 0 0; padding: .4rem 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.settings-people { list-style: none; padding: 0; }
.settings-people li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }
.settings-people li button { margin-left: auto; }
.settings-people details > summary { color: var(--muted); font-size: .8rem; font-weight: 400; }
.settings-journal { padding-left: 1.1rem; }
.settings-journal > li { margin: 0 0 .9rem; }
.settings-effort-host { padding: 0 0 .7rem; }
.settings-effort summary { cursor: pointer; color: var(--muted); }
.settings-notice:empty { display: none; }
@media (max-width: 700px) { .bot-settings .settings-feature { grid-template-columns: 1fr; } }

/* Узкие карточки остаются читаемыми после основных правил сетки. */
@media (max-width: 700px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
  .facts dd {
    margin-bottom: 0.5rem;
  }
}

/* Role homes keep the groups above and the current group's screens on the left. */
.workspace {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  max-width: 94rem;
  margin: 0 auto;
  min-height: calc(100vh - 4rem);
}
.workspace-content { min-width: 0; }
.single-screen .workspace { grid-template-columns: minmax(0, 1fr); }
.single-screen .workspace > .tabs,
.single-screen .menu-toggle { display: none; }
.workspace > .tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 1.5rem 0.75rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.tabs a { border-radius: 6px; }
.workspace main { max-width: none; padding-top: 0.5rem; }
.menu-toggle { display: none; }
.identity-details summary { font-size: 0.85rem; font-weight: 400; margin: 0.25rem 0; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); gap: 1rem; }
.home-card { padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow-wrap: anywhere; }
.home-card h2, .home-card h3 { margin-top: 0; }
.home-card blockquote { margin: 0.75rem 0; border-left: 3px solid var(--accent); padding-left: 0.75rem; }
.home-card.urgent { border-left: 4px solid var(--danger); }
.today-metrics { min-width: 0; overflow-wrap: anywhere; }
.today-takeaway { font-weight: 600; }
.home-summary { font-size: 1.1rem; }
.home-more { margin-top: 1.5rem; }
.home-more a { display: inline-block; margin: 0.25rem 1rem 0.25rem 0; }
.help-reason { display: block; color: var(--danger); font-size: 0.9rem; }
@media (max-width: 700px) {
  .workspace { display: block; }
  .menu-toggle { display: inline-block; min-height: 44px; }
  .workspace > .tabs { display: none; position: fixed; inset: 0 auto 0 0; width: min(80vw, 20rem); z-index: 8; padding-top: 1rem; box-shadow: 0 0 0 100vmax #0006; overflow-y: auto; }
  .workspace > .tabs.is-open { display: flex; }
  .top { position: relative; z-index: 6; padding: 0.5rem 0.75rem; gap: 0.35rem; }
  .brand { font-size: 0.9rem; }
  .who { font-size: 0.75rem; gap: 0.35rem; }
  .who #who { max-width: 9rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  .nav-groups { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0; }
  .nav-groups a { flex-shrink: 0; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
}
.class-grid, .today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }
.class-student, .class-ai, .class-topics, .today-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 1rem; overflow-wrap: anywhere; }
.class-student h3, .class-ai h2, .today-card h3 { margin-top: 0; }
.class-home textarea, .class-home input { width: 100%; max-width: 40rem; }

/* Проверка общей пары ответов: длинные prompt/JSON остаются внутри карточки. */
.evaluation-review pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.evaluation-review-case { min-width: 0; padding: 1rem 0; border-top: 1px solid var(--border, #ddd); }
.evaluation-review-case label { display: block; margin: .75rem 0; }
.evaluation-review-case textarea { width: 100%; box-sizing: border-box; }

.metric-help summary { width: fit-content; font-weight: 400; color: var(--muted); cursor: pointer; }

/* #629: shared layer. Dark header, one card, one number tile, one status pill, one table on every screen. */
.top {
  background: var(--header);
  border-bottom: 0;
  color: #fff;
}
.top .brand {
  color: #fff;
  letter-spacing: 0.02em;
}
.top .nav-groups a {
  color: var(--header-text);
}
.top .nav-groups a[aria-current="true"] {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}
.top .who,
.top .who button.link {
  color: var(--header-text);
}
.top .menu-toggle {
  color: #fff;
  border-color: rgb(255 255 255 / 0.4);
}
.ui-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ui-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.25rem 0 1rem;
}
.ui-head h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}
.ui-head p[role="status"] {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.ui-icon-btn {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.15rem;
}
.ui-card {
  border: 0;
  min-width: 0;
  margin: 0 0 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.ui-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ui-card .class-topics {
  padding: 0;
  border: 0;
  background: none;
}
.ui-card section + section h2 {
  margin-top: 1.25rem;
}
.ui-sub {
  margin-left: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}
.ui-empty {
  margin: 0;
  color: var(--muted);
}
.ui-count {
  min-width: 1.5rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--line);
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-align: center;
}
.ui-count.bad {
  background: var(--bad);
  color: var(--on-status);
}
.ui-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 0 1rem;
  align-items: start;
}
/* Number tiles: the figure first, the explanation behind «?». */
.ui-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.ui-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.ui-kpi > b {
  font-size: 1.9rem;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ui-kpi > span {
  color: var(--muted);
  font-size: 0.85rem;
}
.ui-kpi:nth-child(2) {
  border-top-color: var(--info);
}
.ui-kpi.bad {
  border-top-color: var(--bad);
}
.ui-kpi.bad > b {
  color: var(--bad);
}
.ui-kpi.good,
.ui-kpi.ok {
  border-top-color: var(--good);
}
.ui-help {
  position: relative;
  display: inline-block;
  letter-spacing: 0;
  text-transform: none;
}
.ui-help summary {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
  line-height: 1.1rem;
  text-align: center;
  list-style: none;
  opacity: 0.7;
}
.ui-help summary::-webkit-details-marker {
  display: none;
}
.ui-help-pop {
  position: absolute;
  top: 1.6rem;
  left: 0;
  z-index: 2;
  width: min(20rem, 80vw);
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.14);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 400;
}
/* Statuses: red — needs help or bot error, amber — silent or gap, green — fine. */
.ui-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ui-pill {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--line);
  color: var(--text);
  font-size: 0.78rem;
  text-decoration: none;
}
.ui-pill.bad {
  background: var(--bad);
  color: var(--on-status);
}
.ui-pill.warn {
  background: var(--warn-strong);
  color: var(--on-status);
}
.ui-pill.good {
  background: var(--good);
  color: var(--on-status);
}
.ui-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: 0.4rem;
  border-radius: 50%;
  vertical-align: middle;
}
.ui-dot.bad {
  background: var(--bad);
}
.ui-warn-text {
  color: var(--warn);
}
.ui-rows,
.ui-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-rows li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}
.ui-rows li:first-child {
  padding-top: 0;
  border-top: 0;
}
.ui-row-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.ui-row-main a:not(.ui-pill),
.ui-table td a {
  font-weight: 600;
  text-decoration: none;
}
.ui-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}
.ui-btn {
  flex: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--panel);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}
.ui-list li {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}
.ui-list li:first-child {
  border-top: 0;
}
.ui-list-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.ui-list-row a {
  text-decoration: none;
}
.ui-more-inline summary {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}
.ui-table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  background: none;
  font-size: 0.92rem;
}
.ui-table th {
  padding: 0 0.5rem 0.45rem;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
}
.ui-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 0;
  vertical-align: middle;
}
.ui-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
}
.ui-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ui-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.ui-bar {
  display: inline-block;
  width: 5.5rem;
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
  vertical-align: middle;
}
.ui-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.class-progress-chart {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.class-progress-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr 3.5rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.class-progress-row .ui-bar {
  width: 100%;
  height: 0.6rem;
}
.class-progress-count {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* The main entry for the coach: one bright block with the question line. */
.ui-hero {
  background: var(--hero);
  color: #fff;
}
.ui-hero h2 {
  color: #e0e0ff;
}
.ui-hero form {
  display: flex;
  gap: 0.5rem;
}
.ui-hero textarea {
  flex: 1;
  max-width: none;
  min-height: 2.6rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 8px;
  font: inherit;
  resize: none;
}
.ui-hero button[type="submit"] {
  border-color: var(--header);
  background: var(--header);
  color: #fff;
}
.ui-hero p[role="status"]:empty {
  display: none;
}
.ui-hero .class-ai-answer:not(:empty) {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
.ui-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.ui-chips button {
  padding: 0.3rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-size: 0.85rem;
}
@media (max-width: 700px) {
  .ui-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .ui-kpi > b {
    font-size: 1.4rem;
  }
  .ui-card {
    padding: 0.9rem 1rem;
  }
  .ui-rows li {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .ui-row-main {
    flex: 1 1 calc(100% - 3rem);
  }
  .ui-rows .ui-btn {
    margin-left: 2.85rem;
  }
  .ui-hero form {
    flex-direction: column;
  }
  .ui-hero textarea {
    min-height: 4rem;
  }
  .ui-table thead {
    display: none;
  }
  .ui-table,
  .ui-table tbody,
  .ui-table td {
    display: block;
  }
  .ui-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
  }
  .ui-table tr:last-child {
    border-bottom: 0;
  }
  .ui-table tbody tr:nth-child(even) td {
    background: none;
  }
  .ui-table td {
    padding: 0;
    font-size: 0.85rem;
  }
  .ui-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    color: var(--muted);
  }
  .ui-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }
  .ui-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    font-weight: 600;
  }
  .ui-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
    color: var(--muted);
    text-align: right;
  }
  .class-progress-row {
    grid-template-columns: 7.5rem 1fr 3rem;
  }
}

/* #629 «Сегодня»: срочное и операторы рядом, плитки недели, предложения строками. */
.today-takeaway {
  margin: 0 0 1rem;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 500;
}
.today-metrics > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0.5rem 0 0.75rem;
  font-size: 1.05rem;
}
.ui-kpis.tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
}
.ui-kpi.tile {
  position: relative;
  padding-right: 2.4rem;
  overflow-wrap: anywhere;
}
.ui-kpi.tile h3 {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.ui-kpi.tile p,
.ui-kpi.tile li {
  margin: 0;
  font-size: 0.85rem;
}
.ui-kpi.tile ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-kpi.tile.big > p:first-of-type {
  font-size: 1.9rem;
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ui-kpi.tile > .ui-help {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
}
.ui-kpi.tile .ui-help-pop {
  right: 0;
  left: auto;
}
.ui-kpi:nth-child(n + 5) {
  border-top-color: var(--line);
}
.ui-fold {
  padding: 0.8rem 1.25rem;
}
.ui-fold > summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.ui-item {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.ui-card h2 + .ui-item,
.ui-card h2 + p + .ui-item {
  padding-top: 0;
  border-top: 0;
}
.ui-item h3 {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.98rem;
}
.ui-item.urgent h3 {
  margin-top: 0;
}
.ui-item p {
  margin: 0.2rem 0;
}
.ui-item-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.ui-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}
.ui-quote summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.ui-actions .ui-quote[open] {
  flex-basis: 100%;
}
.today-proposal > button,
.today-proposal > .today-decision {
  margin-top: 0.4rem;
}
.today-proposal > .today-decision {
  display: inline-block;
  margin-left: 0.75rem;
}
.ui-inline-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0 0 0.4rem;
  color: var(--muted);
}
.ui-inline-kpis b {
  color: var(--text);
  font-size: 1.25rem;
}
.today-operators > p.small,
.today-more {
  color: var(--muted);
  font-size: 0.85rem;
}
@media (max-width: 700px) {
  .ui-kpis.tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ui-kpi.tile.big > p:first-of-type {
    font-size: 1.4rem;
  }
}
.ui-kpi.tile .ui-figure {
  font-size: 1.6rem;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ui-kpi.tile .muted li,
.ui-kpi.tile .limits-line,
.ui-kpi.tile div p {
  font-size: 0.8rem;
}
.ui-card h2 .ui-sub,
.today-metrics h2 .ui-sub {
  letter-spacing: 0;
  text-transform: none;
}
@media (max-width: 700px) {
  .ui-kpi.tile .ui-figure {
    font-size: 1.3rem;
  }
}
.ui-kpi.tile > div:not(.ui-help-pop) :is(p, li, span, div) {
  font-size: 0.8rem;
}
.ui-kpi.tile > div > p.ui-figure {
  font-size: 1.6rem;
}
@media (max-width: 700px) {
  .ui-kpi.tile > div > p.ui-figure {
    font-size: 1.3rem;
  }
}

/* #629 «Ученики» и карточка ученика: те же карточки, метки и таблица, что в «Моём классе». */
.tag {
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.students-list .filters {
  margin: 0 0 0.75rem;
}
.students-table .help-reason {
  display: inline-block;
  font-size: 0.78rem;
}
.students-table td:first-child a {
  margin-right: 0.15rem;
}
.coach-cell {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.coach-cell button.link.muted {
  color: var(--muted);
}
meter {
  height: 0.55rem;
  accent-color: var(--accent);
}
.back-link {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}
.ui-head > .ui-help,
.ui-head > .ui-btn {
  margin-top: 0.35rem;
}
.ui-head > .ui-help .ui-help-pop {
  right: 0;
  left: auto;
}
.student-profile .facts {
  font-size: 0.92rem;
}
.ui-fold > *:not(summary) {
  margin-top: 0.75rem;
}
/* The observations block inside the card reads as cards too. */
.class-home h2 {
  margin: 0;
  font-size: 1.05rem;
}
.class-student {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.class-student h3:first-child {
  margin-top: 0;
}
@media (max-width: 700px) {
  .students-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .students-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    color: var(--muted);
  }
  .students-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    font-weight: 400;
  }
  .students-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 2 / span 2;
  }
  .students-table td.students-coach {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .students-table td.students-coach::before {
    content: "Тренер: ";
    color: var(--muted);
  }
  /* «Нужна помощь» stays the last row of the card, with or without the team's «Тренер» column (Д5). */
  .students-table td:last-child {
    grid-column: 1 / -1;
    grid-row: 5;
  }
  .ui-head > .ui-btn {
    margin-top: 0.1rem;
  }
}
.class-student .ui-pills {
  margin-bottom: 0.75rem;
}
@media (max-width: 700px) {
  .students-table td.ui-none {
    display: none;
  }
  .top .nav-groups {
    display: flex;
    flex-wrap: wrap;
  }
}

/* #629 «Диалоги»: список в карточке, группы команды — карточками со счётчиком, диалог — карточки оператора и переписки. */
.chat-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chat-group > summary .ui-sub {
  margin-left: 0;
  letter-spacing: 0;
  text-transform: none;
}
.chat-group[open] > summary {
  margin-bottom: 0.75rem;
}
.dialogs-table {
  table-layout: fixed;
}
.dialogs-table th:first-child {
  width: 32%;
}
.dialogs-table th:last-child {
  width: 10.5rem;
}
.dialogs-table td {
  vertical-align: top;
}
.dialogs-table td:first-child .tag {
  margin: 0.15rem 0.25rem 0 0;
}
.dialogs-table td:last-child {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.dialog-tags {
  margin: 0.35rem 0 0;
}
.operator-panel,
.messages.dialog {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.operator-panel {
  margin: 0 0 1rem;
  padding: 1.1rem 1.25rem;
}
.messages.dialog + .operator-panel {
  margin-top: 1rem;
}
.operator-enter-confirm {
  margin: 0.5rem 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--warn-soft);
}
.operator-enter-confirm p {
  margin: 0 0 0.6rem;
}
.leave-dialog {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 10px 40px rgb(17 19 39 / 0.25);
}
.leave-dialog::backdrop {
  background: rgb(17 19 39 / 0.45);
}
.leave-dialog h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}
.leave-dialog .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.operator-panel h2 {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.workspace-content .inline-form {
  margin: 0 0 1rem;
}
@media (max-width: 700px) {
  .dialogs-table {
    table-layout: auto;
  }
  .dialogs-table td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    color: var(--text);
  }
  .dialogs-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    font-size: 0.8rem;
  }
  .dialogs-table td:first-child .tag {
    font-size: 0.72rem;
  }
  .operator-panel {
    padding: 0.9rem 1rem;
  }
}
.chat-group > summary::before {
  content: "▸";
  letter-spacing: 0;
}
.chat-group[open] > summary::before {
  content: "▾";
}

/* #629 «Материалы»: шапка с обновлением и «?», список материалов и материал — карточками, статусы — метками. */
.ui-head-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.75rem;
}
.ui-head-side .ui-help .ui-help-pop {
  right: 0;
  left: auto;
}
.knowledge-panel {
  margin-top: 0;
}
.knowledge-layout {
  align-items: start;
  margin-top: 0;
}
.knowledge-layout > .ui-card {
  margin: 0;
}
.knowledge-index > p {
  margin: 0 0 0.5rem;
}
.knowledge-index select {
  width: 100%;
  margin-bottom: 0.75rem;
}
.knowledge-list {
  gap: 0;
}
.knowledge-list button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-weight: 600;
}
.knowledge-list button:hover {
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
}
.knowledge-list .selected {
  outline: 0;
  background: var(--accent-soft);
  color: var(--accent);
}
.knowledge-list button > span {
  font-weight: 400;
}
.knowledge-list button[data-status="verified"] > span {
  color: var(--good);
}
.knowledge-list button[data-status="review"] > span {
  color: var(--warn);
}
.knowledge-detail > h2 {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 1.2rem;
  letter-spacing: 0;
  text-transform: none;
}
.knowledge-detail > .ui-pill {
  margin: 0 0.5rem 0.4rem 0;
}
.knowledge-detail > h3 {
  margin: 1.1rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.knowledge-detail .knowledge-text {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
}
.knowledge-materials,
.knowledge-inbox {
  border: 0;
}
@media (max-width: 700px) {
  .knowledge-layout {
    gap: 1rem;
  }
  .ui-head-side .secondary {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
}
@media (max-width: 700px) {
  .ui-head:has(> .ui-head-side) {
    flex-wrap: wrap;
  }
  .ui-head:has(> .ui-head-side) > div:first-child {
    flex: 1 1 100%;
  }
}

/* #629 «Пробелы в материалах» и «Проверка ответов»: фильтр и находки — карточками. */
.outside-filters {
  padding: 0.9rem 1.25rem;
}
.outside-filters .filters {
  margin: 0;
}
.gaps {
  gap: 1rem;
}
.gap {
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.gap-head a {
  font-size: 0.9rem;
}
.gap details summary {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.evaluation-runs > p[role="status"] {
  margin: 0;
}
.evaluation-runs > div:not(:empty) {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
@media (max-width: 700px) {
  .gap,
  .outside-filters {
    padding: 0.9rem 1rem;
  }
}
.outside-filters .filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .outside-filters .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .outside-filters .filters select {
    grid-column: 1 / -1;
  }
  .outside-filters .filters label input {
    flex: 1;
    min-width: 0;
  }
  .outside-filters .filters a {
    align-self: center;
  }
}
@media (max-width: 700px) {
  .outside-filters .filters > * {
    min-width: 0;
    max-width: none;
  }
  .outside-filters .filters select,
  .outside-filters .filters label input {
    width: 100%;
    max-width: none;
  }
}

/* #629 «Аналитика» и «Настройки»: те же карточки, таблицы, плитки и «?», что на главных экранах.
   Экраны большие и общие с другими задачами, поэтому вид задан по разделу, а разметка почти не меняется. */
:is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) {
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
:is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) th {
  padding: 0.35rem 0.5rem 0.45rem;
  background: none;
  font-size: 0.8rem;
  font-weight: 500;
}
:is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) td {
  padding: 0.45rem 0.5rem;
  border-bottom: 0;
}
:is(body[data-group="analytics"], body[data-group="settings"])
  main
  :is(.table-wrap, .table-scroll)
  tbody
  tr:nth-child(even)
  td {
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
}
:is(body[data-group="analytics"], body[data-group="settings"]) main h2 {
  font-size: 1.05rem;
}
/* Old «?» blocks: a round button with the explanation in a bubble, as everywhere. */
main .metric-help {
  position: relative;
  display: inline-block;
  margin: 0 0.5rem 0.5rem 0;
}
main .metric-help > summary {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
  line-height: 1.1rem;
  text-align: center;
  list-style: none;
  opacity: 0.7;
}
main .metric-help > summary::-webkit-details-marker {
  display: none;
}
main .metric-help[open] > :not(summary) {
  position: absolute;
  top: 1.6rem;
  left: 0;
  z-index: 2;
  width: min(22rem, 80vw);
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.14);
  color: var(--text);
}
/* «Темы ошибок»: очередь — карточка, темы — строки. */
body[data-group="analytics"] .attention {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* «Запуск»: плитки-цифры. */
.launch-screen .launch-card {
  border: 0;
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.launch-screen .launch-rates .launch-card {
  border-top-color: var(--info);
}
.launch-screen .launch-card dd {
  font-size: 1.6rem;
}
/* «Расход»: карточки без рамок. */
main .usage-v2-card,
main .limits {
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
main .usage-v2-headline {
  border-top: 3px solid var(--accent);
}
/* «Настройки бота»: группы — карточки, подпись группы — как заголовок карточки. */
.bot-settings fieldset {
  margin: 0 0 1rem;
  padding: 1.1rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.bot-settings legend {
  float: left;
  width: 100%;
  margin: 0 0 0.6rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bot-settings legend + * {
  clear: both;
}
@media (max-width: 700px) {
  :is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) {
    overflow-x: auto;
    padding: 0.5rem;
  }
  .bot-settings fieldset {
    padding: 0.9rem 1rem;
  }
}
/* «Вход и потребности»: новые входы — плитками, подпись сверху, цифра крупно. */
.entry-kpis {
  margin: 0 0 0.75rem;
}
.entry-kpis dt {
  color: var(--muted);
  font-size: 0.85rem;
}
.entry-kpis dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
body[data-group="analytics"] .attention > h2 {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@media (max-width: 700px) {
  .entry-kpis dd {
    font-size: 1.3rem;
  }
}
/* «Тексты бота»: карточки без рамок, как остальные. */
main .bot-text-card {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* «Стабильность» (#t41): дата дня не переносится на телефоне. */
.stability-screen td:first-child,
.stability-screen th {
  white-space: nowrap;
}

/* t51: fewer words — a sub line under a tile, programme as six steps, «Что не получается» as one block. */
.ui-kpi > small {
  color: var(--muted);
  font-size: 0.78rem;
}
.class-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.35rem;
  margin: 1rem 0 1.25rem;
  padding: 0;
  list-style: none;
}
.class-step {
  border-top: 0.35rem solid var(--line);
  padding-top: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}
.class-step.completed {
  border-top-color: var(--good);
}
.class-step.in_progress,
.class-step.paused {
  border-top-color: var(--warn-strong);
  color: var(--text);
  font-weight: 600;
}
.class-step.skipped {
  border-top-style: dashed;
}
.class-trouble {
  display: grid;
  gap: 0.6rem;
}
.class-trouble > ul {
  margin: 0;
}

/* #668: the look of the panel drawn on the landing (block «Тренерам и школам»).
   Sections in a light menu on the left, screens of a section as tabs above the page,
   bordered cards without shadows, mono figures, soft status pills, one black button per screen. */
body {
  background: var(--panel);
  font-family: var(--body);
}
a {
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent);
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-color: currentColor;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline-color: var(--acc);
  border-radius: 6px;
}
h1,
h2,
h3 {
  letter-spacing: -0.015em;
}
code,
pre {
  font-family: var(--mono);
}

/* The menu: logo with the pup, sections, who is signed in and the theme switch at the bottom. */
.top,
.top .brand,
.top .who,
.top .who button.link,
.top .menu-toggle {
  color: var(--text);
}
.top {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.top .brand::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--face) url(/pup.svg) center / 100% no-repeat;
}
.top .nav-groups a {
  color: var(--muted);
}
.top .nav-groups a[aria-current="true"] {
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  box-shadow:
    0 1px 0 var(--line),
    0 0 0 1px var(--line);
}
.top .who {
  color: var(--muted);
}
.top .menu-toggle {
  border-color: var(--line);
}
.theme-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}
.theme-toggle:hover {
  border-color: var(--muted);
}
.theme-toggle .i-sun,
[data-theme="dark"] .theme-toggle .i-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle .i-sun {
  display: block;
}
@media (min-width: 701px) {
  body {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    min-height: 100vh;
  }
  .top {
    position: sticky;
    top: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    height: 100vh;
    padding: 1.25rem 0.75rem;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .top .brand {
    padding: 0 0.75rem 1rem;
    font-size: 1rem;
  }
  .top .nav-groups {
    flex: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
  }
  .top .nav-groups a {
    padding: 0.5rem 0.75rem;
    border-radius: 9px;
  }
  .top .who {
    flex-wrap: wrap;
    margin-top: auto;
    padding: 0 0.75rem;
    font-size: 0.82rem;
  }
  .top .who #who {
    flex-basis: 100%;
    order: -1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .workspace {
    display: block;
    max-width: none;
    min-height: 0;
    margin: 0;
  }
  /* The screens of a section: tabs over the page, the open one underlined. */
  .workspace > .tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    max-width: 82rem;
    padding: 1rem 2rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: none;
  }
  .workspace > .tabs a {
    margin-bottom: -1px;
    padding: 0.5rem 0 0.6rem;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--muted);
  }
  .workspace > .tabs a[aria-current="page"] {
    border-bottom-color: var(--text);
    background: none;
    color: var(--text);
    font-weight: 500;
  }
  .workspace main {
    max-width: 82rem;
    margin: 0;
    padding: 1.5rem 2rem 3rem;
  }
}

/* Controls: black pill for the main action, white with a line for the rest. */
button {
  padding: 0.45rem 1rem;
  border: 1px solid var(--btn);
  border-radius: 999px;
  background: var(--btn);
  color: var(--btnink);
  font-weight: 500;
}
button.secondary {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}
button.danger {
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  background: transparent;
  color: var(--bad);
}
button.link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-weight: 400;
}
input,
select,
textarea {
  border-radius: 10px;
}

/* Page head. */
.ui-head h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.back-link a {
  color: var(--muted);
  text-decoration: none;
}
.back-link a:hover {
  color: var(--text);
}

/* Cards: a thin line, no shadow, a plain heading. */
.ui-card,
.class-student,
.home-card,
.operator-panel,
.messages.dialog,
.messages,
.table-wrap,
.gap,
.bot-text-card,
.knowledge-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}
.ui-card {
  padding: 1rem 1.125rem;
}
.ui-card h2,
.operator-panel h2,
.chat-group > summary {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
}
.class-home h2 {
  font-size: 1rem;
}
.ui-count {
  background: var(--s2);
  font-family: var(--mono);
}
.ui-count.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

/* Number tiles: a mono figure; the one that calls for action is tinted with the accent. */
.ui-kpi,
.ui-kpi:nth-child(2),
.ui-kpi:nth-child(n + 5),
.ui-kpi.good,
.ui-kpi.ok {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}
.ui-kpi > b,
.ui-kpi.tile.big > p:first-of-type,
.ui-kpi.tile .ui-figure,
.ui-kpi.tile > div > p.ui-figure,
.ui-inline-kpis b {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.ui-kpi > span {
  font-size: 0.82rem;
}
.ui-kpi.bad,
.ui-kpi.bad:nth-child(2) {
  border-color: transparent;
  background: var(--accs);
}
.ui-kpi.bad > b {
  color: var(--acc);
}

/* Status pills: soft colour, coloured text — as «шансы банка» in the drawing. */
.ui-pill,
.tag {
  background: var(--s2);
  color: var(--text);
}
.ui-pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.ui-pill.warn,
.tag.warn {
  background: var(--warn-tint);
  color: var(--warn);
}
.ui-pill.good {
  background: var(--good-soft);
  color: var(--good);
}
.ui-avatar {
  border-radius: 10px;
  background: var(--face);
  color: var(--text);
}
.ui-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btnink);
  font-size: 0.85rem;
  font-weight: 500;
}
/* A button on every row of a list is the quiet one; the page keeps one black button. */
.ui-rows .ui-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.ui-rows .ui-btn:hover {
  border-color: var(--muted);
}
/* Names open the student: underlined so they read as links, the accent on hover (Артём, 12.10). */
.ui-row-main a:not(.ui-pill),
.ui-table td a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text) 28%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}
.ui-row-main a:not(.ui-pill):hover,
.ui-table td a:hover {
  color: var(--acc);
  text-decoration-color: currentColor;
}

/* Table: lines between rows, no stripes. */
.ui-table th {
  border-bottom: 0;
  color: color-mix(in srgb, var(--text) 72%, var(--panel));
  font-size: 0.82rem;
  font-weight: 500;
}
.ui-table td {
  border-top: 1px solid var(--line);
  padding-block: 0.6rem;
}
.ui-table tbody tr:nth-child(even) td {
  background: none;
}
.ui-table .num {
  font-family: var(--mono);
  font-size: 0.85rem;
}
.ui-bar {
  height: 0.375rem;
  background: var(--s2);
}
.ui-bar-fill {
  background: var(--acc);
}
meter {
  accent-color: var(--acc);
}

/* «Спросить ИИ»: a grey card with a white question line, as «Спросить Тузика» in the drawing. */
.ui-hero {
  border-color: transparent;
  background: var(--s2);
  color: var(--text);
}
.ui-hero h2 {
  color: var(--text);
}
.ui-hero textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}
.ui-hero button[type="submit"] {
  border-color: var(--btn);
  background: var(--btn);
  color: var(--btnink);
}
.ui-chips button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.ui-chips button:hover {
  border-color: var(--muted);
}
.ui-hero .class-ai-answer:not(:empty) {
  border-radius: 16px;
  border-bottom-left-radius: 5px;
}

/* The programme as six steps: done — the accent, the current one — its tint. */
.class-step.completed {
  border-top-color: var(--acc);
}
.class-step.in_progress,
.class-step.paused {
  border-top-color: color-mix(in srgb, var(--acc) 40%, var(--s2));
}
.help-reason {
  color: var(--bad);
}

/* #668: the rest of the screens — the same line, heading and figure on the analytics and settings sections. */
.status.completed,
.status.live {
  color: var(--good);
}
meter {
  appearance: none;
  height: 0.375rem;
  border: 0;
  border-radius: 999px;
  background: var(--s2);
}
meter::-webkit-meter-bar {
  height: 0.375rem;
  border: 0;
  border-radius: 999px;
  background: var(--s2);
}
meter::-webkit-meter-optimum-value,
meter::-webkit-meter-suboptimum-value,
meter::-webkit-meter-even-less-good-value {
  border-radius: 999px;
  background: var(--acc);
}
meter::-moz-meter-bar {
  border-radius: 999px;
  background: var(--acc);
}
/* Dialog bubbles: rounded as the chat in the drawing, the tail at the speaker's side. */
.message {
  border-radius: 16px;
}
.message.user {
  border-bottom-left-radius: 5px;
}
.message.assistant {
  border-bottom-right-radius: 5px;
}
.knowledge-detail > h3,
body[data-group="analytics"] .attention > h2 {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  text-transform: none;
}
body[data-group="analytics"] .attention,
.attention {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
:is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) {
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  box-shadow: none;
}
:is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) th {
  border-bottom: 0;
  color: color-mix(in srgb, var(--text) 72%, var(--panel));
  font-size: 0.82rem;
}
:is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) td {
  border-top: 1px solid var(--line);
  padding-block: 0.55rem;
}
:is(body[data-group="analytics"], body[data-group="settings"])
  main
  :is(.table-wrap, .table-scroll)
  tbody
  tr:nth-child(even)
  td {
  background: none;
}
td.num,
th.num {
  font-family: var(--mono);
  font-size: 0.88em;
}
.launch-screen .launch-card,
.launch-screen .launch-rates .launch-card,
main .usage-v2-card,
main .limits,
main .usage-v2-headline,
main .bot-text-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.launch-screen .launch-card dd,
.entry-kpis dd,
.usage-v2-amounts dd,
.tile-value {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.usage-v2-partial {
  border-left-color: var(--warn-strong);
}

/* #668 Настройки бота: only the look of the groups; fields, texts and order belong to t67. */
.bot-settings fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.bot-settings legend {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
}
@media (max-width: 700px) {
  /* On a phone a table row is a card of its own: a line between rows, none between cells. */
  .ui-table td,
  :is(body[data-group="analytics"], body[data-group="settings"]) main :is(.table-wrap, .table-scroll) .ui-table td {
    border-top: 0;
  }
  .ui-table td {
    padding-block: 0;
  }
}

/* t69 «Смотреть как»: the switch under the logo — whose panel this is; a coach's view says so on every screen. */
.top .view-as {
  display: grid;
  gap: 0.25rem;
  margin: 0.25rem 0 0.5rem;
  padding-inline: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.top .view-as select {
  width: 100%;
  font-size: 0.875rem;
  color: var(--text);
}
.view-as-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem clamp(1rem, 3vw, 2rem) 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--acc);
  border-radius: var(--radius);
  background: var(--accs);
  color: var(--text);
}
.view-as-banner p {
  margin: 0;
}

/* t69 «Обзор компании»: rows of tiles with a link to the detailed screen. */
.overview-row {
  margin-bottom: 1.75rem;
}
.overview-row h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.overview-more {
  font-size: 0.875rem;
  font-weight: 400;
}
@media (max-width: 700px) {
  /* On a phone a coach is a card: name, figures with their labels, the button. */
  .overview-coaches thead {
    display: none;
  }
  .overview-coaches :is(table, tbody, tr, td) {
    display: block;
  }
  .overview-coaches tr {
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
  }
  .overview-coaches tr:first-child {
    border-top: 0;
  }
  body[data-group="analytics"] main .overview-coaches .table-wrap td {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
    border: 0;
  }
  .overview-coaches td:first-child {
    font-weight: 600;
  }
  .overview-coaches td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
  }
}

/* t77: the team's home «Что происходит» — six areas, a colour on the left edge, one figure each. */
.summary-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}
.summary-when {
  color: var(--muted);
  font-size: 0.85rem;
}
.summary-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  background: var(--good-soft);
}
.summary-strip.bad {
  background: var(--bad-soft);
}
.summary-strip::before {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--good);
}
.summary-strip.bad::before {
  background: var(--bad);
}
.summary-strip b {
  flex: 1;
  font-weight: 600;
}
.summary-go {
  flex: none;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}
.summary-area {
  display: block;
  min-height: 9.5rem;
  padding: 1.1rem 1.2rem 1rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}
.summary-area:hover {
  border-color: var(--muted);
}
.summary-area.good {
  border-left-color: var(--good);
}
.summary-area.warn {
  border-left-color: var(--warn-strong);
}
.summary-area.bad {
  border-left-color: var(--bad);
}
.summary-area.unknown {
  border-left-style: dashed;
}
.summary-area h2 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.summary-area h2 span {
  color: var(--muted);
  font-weight: 400;
}
.summary-area b {
  display: block;
  margin: 0.35rem 0 0.1rem;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}
.summary-area p {
  margin: 0.1rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.summary-area p.bad {
  color: var(--bad);
}
.summary-area p.warn {
  color: var(--warn);
}
/* t77: the team's role is named over «Смотреть как». */
.role-badge {
  align-self: flex-start;
  justify-self: start;
  width: fit-content;
  margin: 0 0 0.35rem 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 600;
}
body[data-view-as="coach"] .role-badge {
  background: var(--accs);
  color: var(--acc);
}
/* t77: in «Ученики» the analytic screens stand apart from the daily ones. */
.tabs a.tab-gap {
  position: relative;
  margin-left: 1.25rem;
}
.tabs a.tab-gap::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 0.55rem;
  left: -1.25rem;
  border-left: 1px solid var(--line);
}
@media (max-width: 700px) {
  .tabs a.tab-gap {
    margin-left: 0;
    margin-top: 0.5rem;
    border-top: 1px solid var(--line);
  }
  .tabs a.tab-gap::before {
    content: none;
  }
}

/* t88 (Артём 15.10): the coach's panel — one menu on the left that stands out in the light theme,
   no «?» hints, one short form to invite. */
.coach-menu .ui-help {
  display: none;
}
:is(.coach-menu, .team-menu) .top .nav-groups a {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}
:is(.coach-menu, .team-menu) .top .nav-groups a:hover {
  background: var(--s2);
}
:is(.coach-menu, .team-menu) .top .nav-groups a[aria-current="true"] {
  background: var(--s2);
  box-shadow: inset 3px 0 0 var(--acc);
  font-weight: 600;
}
@media (max-width: 700px) {
  :is(.coach-menu, .team-menu) .top .nav-groups a[aria-current="true"] {
    box-shadow: inset 0 -2px 0 var(--acc);
  }
}
.invite-form,
.invite-ready {
  max-width: 40rem;
}
.invite-link {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.invite-message {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--acc);
  border-radius: 0 10px 10px 0;
  background: var(--s2);
  overflow-wrap: anywhere;
}
.invite-list {
  margin-top: 1rem;
}
.invite-list h2,
.class-empty h2 {
  margin-top: 0;
}
.class-empty {
  max-width: 44rem;
}
.class-empty-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.class-empty-steps li {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--s2);
  counter-increment: step;
}
.class-empty-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--acc);
  color: #fff;
  font-weight: 600;
}
.coach-menu .top .nav-groups a.nav-sub {
  margin-top: -2px;
  padding-left: 1.75rem;
  font-size: 0.92rem;
  font-weight: 400;
}
@media (max-width: 700px) {
  .coach-menu .top .nav-groups a.nav-sub {
    margin-top: 0;
    padding-left: 0.6rem;
  }
}

/* t88 (аудит t92): the coach's «Мой класс» and card on Tabler — only what Tabler has no class for. */
.coach-headline {
  margin: 0.15rem 0 0;
}
.coach-now-who a {
  text-decoration: none;
}
.coach-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.5rem;
}
.coach-block {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.coach-step {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
.coach-step.completed {
  background: var(--good);
}
.coach-step.in_progress,
.coach-step.paused {
  background: var(--acc);
}
.coach-card-tools:empty {
  display: none;
}

/* t88: the page waits for the role, so a coach never sees the look without Tabler. */
body.role-pending {
  visibility: hidden;
}
/* Tabler's variables take the panel's own tokens, so the light and dark themes stay the panel's. */
:root {
  --tblr-font-sans-serif: var(--body);
  --tblr-body-font-size: 1rem;
  --tblr-body-bg: var(--bg);
  --tblr-body-color: var(--text);
  --tblr-bg-surface: var(--panel);
  --tblr-bg-surface-secondary: var(--s2);
  --tblr-border-color: var(--line);
  --tblr-secondary: var(--muted);
  --tblr-secondary-color: var(--muted);
  --tblr-primary: #0b0b0c;
  --tblr-primary-rgb: 11, 11, 12;
  --tblr-border-radius: 10px;
}
:root[data-theme="dark"] {
  --tblr-primary: #f4f4f5;
  --tblr-primary-rgb: 244, 244, 245;
}
:is(.coach-menu, .team-menu) .btn-primary {
  --tblr-btn-bg: var(--btn);
  --tblr-btn-color: var(--btnink);
  --tblr-btn-border-color: var(--btn);
  --tblr-btn-hover-bg: var(--btn);
  --tblr-btn-hover-color: var(--btnink);
  --tblr-btn-hover-border-color: var(--btn);
}
:is(.coach-menu, .team-menu) .btn-orange {
  --tblr-btn-bg: var(--acc);
  --tblr-btn-color: #fff;
  --tblr-btn-border-color: var(--acc);
  --tblr-btn-hover-bg: #e94e1a;
  --tblr-btn-hover-color: #fff;
  --tblr-btn-hover-border-color: #e94e1a;
}
:is(.coach-menu, .team-menu) .card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* t88: «Документация» top right for the coach. */
.docs-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 82rem;
  padding: 0.75rem 2rem 0;
}
.docs-bar[hidden] {
  display: none;
}
/* t95: a quiet grey word was easy to miss — a bordered button with the book. */
.docs-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.docs-link:hover {
  border-color: var(--muted);
}
@media (max-width: 700px) {
  .docs-bar {
    padding: 0.5rem 1rem 0;
  }
}
/* t95: «⋯» next to an awaited invitation opens «Удалить приглашение» in the row itself — a details element,
   no Tabler JS; a dropdown would be cut by the table's scroll box. */
.invite-list .btn-list {
  align-items: center;
}
.invite-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.invite-more > summary {
  list-style: none;
}
.invite-more > summary::-webkit-details-marker {
  display: none;
}
.invite-more-menu {
  display: inline-flex;
}
details.invite-list > summary {
  cursor: pointer;
  list-style: none;
}
details.invite-list > summary::-webkit-details-marker {
  display: none;
}
details.invite-list:not([open]) > summary {
  border-bottom: 0;
}
details.invite-list > summary .card-title {
  margin: 0;
}
/* t95: the coach's materials are grouped by the programme's blocks. */
.knowledge-group {
  margin: 0.75rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.knowledge-group:first-child {
  margin-top: 0;
}
