/* Ubuntu Sans variable (wght 100–800), self-hosted subsets; see fonts/README.md. */
@font-face {
  font-family: 'Ubuntu Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/fonts/ubuntu-sans-cyrillic-wght.ce76e305.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Ubuntu Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/fonts/ubuntu-sans-latin-wght.8f34f6ae.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;
}

:root {
  --bg: #f4f5f7; --surface: #fff; --side: #eceef2; --line: #dcdfe5;
  --text: #1d1f23; --muted: #6b7280; --accent: #2f6fde; --mine: #dbe8ff; --theirs: #fff;
  --code: #f1f3f6; --danger: #c0352b; --online: #1f9d55; --offline: #a3a9b4;
  --roman: #0a8a5c; --mars: #c35400; --mercury: #3a5bd9; --jupiter: #b0306f;
  --shadow: 0 1px 2px rgb(0 0 0 / 8%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191d; --surface: #1f2227; --side: #1b1e22; --line: #2e3238;
    --text: #e6e8eb; --muted: #9aa1ab; --accent: #6b9cff; --mine: #24385e; --theirs: #262a30;
    --code: #2c3037; --danger: #ff7a6e; --online: #3ccf7c; --offline: #5d636d;
    --roman: #3fcf95; --mars: #ff9a4d; --mercury: #8aa2ff; --jupiter: #f293c4;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
/* The whole interface at 125% (Roman's preferred size, #144); CSS zoom keeps px-based layout consistent. */
html { zoom: 1.25; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 'Ubuntu Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
code, pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; box-shadow: var(--shadow); display: grid; gap: 12px;
}
.login-card h1 { margin: 0; font-size: 20px; font-weight: 650; }
.login-card p { margin: 0; color: var(--muted); }
.login-card input {
  font: 13px ui-monospace, Menlo, monospace; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.primary { justify-self: start; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 18px; font-weight: 600; }

/* Layout */
/* Narrowest column that keeps «готовит ответ · 59:59» on one line (measured with Ubuntu Sans). */
.app { display: grid; grid-template-columns: 200px 1fr; height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 16px 16px 10px; font-weight: 700; font-size: 16px; }
.people { list-style: none; margin: 0; padding: 0 8px; flex: 1; overflow-y: auto; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.person .who { min-width: 0; }
.person:has(.agent-admission) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 3px; }
.person .agent-control { grid-column: 2 / -1; padding: 3px 0; }
.model-profiles { max-width: min(30rem, 92vw); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.session-dialog textarea {
  display: block; box-sizing: border-box; width: min(24rem, 75vw); margin-top: 6px;
  padding: 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical;
}
.session-dialog textarea:focus { border-color: var(--accent); }
.session-dialog button + button { margin-left: 12px; }

.model-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.model-profile h3, .profile-feedback { flex-basis: 100%; margin: 0; }
.model-profile select { max-width: 100%; }
.person .agent-admission { margin-inline-start: auto; accent-color: var(--accent); }
.person .name { font-weight: 600; }
.person .state { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person.busy .state { color: var(--accent); }
.person.state-limited .state { color: var(--danger); }
.link { background: none; border: 0; color: var(--muted); padding: 12px 16px; text-align: left; font-size: 13px; }
.link:hover { color: var(--text); }
.agent-panel { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.title { font-weight: 650; }
.sub { font-size: 12.5px; color: var(--muted); }
.conn { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--offline); }
.conn.ok::before { background: var(--online); }

/* Avatars */
.avatar {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 650; font-size: 15px;
  background: var(--muted);
}
.avatar.small { width: 24px; height: 24px; font-size: 11px; }
.who-roman .avatar, .avatar.who-roman { background: var(--roman); }
.who-mars .avatar, .avatar.who-mars { background: var(--mars); }
.who-mercury .avatar, .avatar.who-mercury { background: var(--mercury); }
.who-jupiter .avatar, .avatar.who-jupiter { background: var(--jupiter); }
.presence {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--offline); border: 2px solid var(--side);
}
.presence.online, .presence.busy { background: var(--online); }
.presence.limited { background: var(--danger); }
.presence.busy { animation: pulse 1.2s ease-in-out infinite; }

/* Messages */
.log { flex: 1; overflow-y: auto; padding: 12px 20px 8px; }
.day { display: flex; justify-content: center; margin: 14px 0 8px; }
.day span { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.msg { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; max-width: 760px; }
.msg.cont { margin-top: 3px; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg .avatar-slot { width: 34px; flex: none; }
.msg.mine .avatar-slot { display: none; }
.bubble {
  min-width: 0; max-width: 100%; background: var(--theirs); border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px; padding: 7px 12px 5px; box-shadow: var(--shadow);
}
.msg.cont .bubble { border-radius: 4px 14px 14px 4px; }
.msg.mine .bubble { background: var(--mine); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg.mine.cont .bubble { border-radius: 14px 4px 4px 14px; }
.bubble .author { font-weight: 650; font-size: 13.5px; margin-bottom: 1px; }
.who-roman .author { color: var(--roman); } .who-mars .author { color: var(--mars); } .who-mercury .author { color: var(--mercury); } .who-jupiter .author { color: var(--jupiter); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.text p { margin: 0; }
.text code { background: var(--code); border-radius: 4px; padding: 1px 4px; }
/* Long commands wrap instead of being cut at the bubble edge (#310 screenshot). */
.text pre { background: var(--code); border-radius: 8px; padding: 8px 10px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.text pre code { background: none; padding: 0; }
.text a { color: var(--accent); }
.mention { font-weight: 600; border-radius: 4px; padding: 0 2px; }
.mention.who-roman { color: var(--roman); } .mention.who-mars { color: var(--mars); } .mention.who-mercury { color: var(--mercury); } .mention.who-jupiter { color: var(--jupiter); }
.text::after { content: ''; display: block; clear: both; }
/* Appended after the text and floated: it sits on the last line when there is room, like in desktop messengers. */
.time { float: right; margin: 4px 0 0 10px; font-size: 11px; color: var(--muted); line-height: 1; white-space: nowrap; }
.time .seq { display: none; }
.msg:hover .time .seq { display: inline; }
.msg-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.file-ref { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9em; border-bottom: 1px dotted var(--muted); cursor: help; }
.msg-link:hover { text-decoration: underline; }
/* A message reached through a «#248» link flashes briefly. */
@keyframes flash { from { background: var(--mine); } to { background: transparent; } }
.msg.flash, .system.flash { animation: flash 2s ease-out; border-radius: 12px; }

/* Working strip above the composer */
.working-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 20px 6px; font-size: 13px; color: var(--muted); }
.working-strip .item { display: inline-flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgb(31 157 85 / 30%); } }
@media (prefers-reduced-motion: reduce) { .dots i, .presence.busy, .msg.flash, .system.flash { animation: none; } }

/* Rounds: system lines and review marks under the answer */
.system { text-align: center; margin: 12px 0 4px; font-size: 12.5px; color: var(--muted); }
.review-mark { margin: 3px 0 0 44px; font-size: 12px; color: var(--muted); }
.review-mark.checked { color: var(--online); }
.review-note { margin: 3px 0 0 44px; font-size: 12px; color: var(--danger); }
.review-note.quiet { color: var(--muted); }
.review-mark.unfinished, .review-mark.failed { color: var(--danger); }
.msg.mine + .review-mark { text-align: right; margin-left: 0; }

/* Attachments: images in messages, and pending ones above the field */
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.attachments a { display: block; line-height: 0; }
.attachments img { max-width: 320px; max-height: 240px; border-radius: 8px; border: 1px solid var(--line); background: var(--code); }
.attachments .gone { font-size: 12.5px; color: var(--muted); font-style: italic; }
.pending { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pending .item { position: relative; line-height: 0; }
.pending img { height: 64px; border-radius: 8px; border: 1px solid var(--line); }
.pending .item.uploading img { opacity: .5; }
.pending .remove {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0;
  background: var(--text); color: var(--bg); font-size: 13px; line-height: 20px; cursor: pointer;
}
.composer.dropping .field { border-color: var(--accent); border-style: dashed; }

/* Quotes (#303): a quote above the text in a bubble, the hover button, and the quote being written */
.quote { display: block; border-left: 3px solid var(--accent); padding: 2px 8px; margin: 2px 0 6px; font-size: 13px; color: var(--muted); cursor: pointer;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.quote b { color: var(--text); font-weight: 600; }
.md-quote { border-left: 3px solid var(--line); padding-left: 8px; color: var(--muted); display: block; }
.bubble { position: relative; }
/* Hidden only visually, so the actions stay in the tab order: keyboard focus shows them as hover does (review #1047).
   On a touch screen a tap on the message opens them (`actions-open`, page.js). */
.msg-actions { position: absolute; top: -10px; right: 8px; display: flex; gap: 6px; opacity: 0; pointer-events: none; }
.msg:hover .msg-actions, .msg.actions-open .msg-actions, .msg-actions:focus-within { opacity: 1; pointer-events: auto; }
/* Left-aligned messages grow their actions to the right, so a short message near the left edge keeps them on screen;
   the owner's right-aligned messages keep them anchored on the right. */
.msg:not(.mine) .msg-actions { left: 8px; right: auto; }
/* A phone fits three actions on one line with tighter spacing. */
@media (max-width: 480px) { .msg-actions { gap: 4px; } .msg-actions .quote-btn { padding: 1px 6px; } }
.quote-btn { border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); border-radius: 8px; font: inherit; font-size: 12px; padding: 1px 8px; cursor: pointer; white-space: nowrap; }
.quote-btn:hover { color: var(--text); }
.quoting { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.quoting .quote { flex: 1; margin: 0; cursor: default; }
.quoting .remove { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }

/* Meetings (#349, #351): the request and the result stand out; a card shows progress */
.msg.meeting-request .bubble { border: 1px solid #8b5cf6; box-shadow: 0 0 0 1px rgb(139 92 246 / 25%); }
.msg.meeting-request .bubble::before { content: 'Запрос на совещание'; display: block; font-size: 11.5px; font-weight: 600; color: #8b5cf6; margin-bottom: 2px; }
.msg.meeting-result-msg .bubble { border: 1px solid #8b5cf6; background: color-mix(in srgb, #8b5cf6 10%, var(--theirs)); }
.meeting-result { display: block; font-size: 12px; font-weight: 600; color: #8b5cf6; margin-bottom: 4px; text-decoration: none; }
.meeting-card { margin: 4px 0 0 44px; font-size: 12.5px; color: var(--muted); }
.msg.mine + .meeting-card { text-align: right; margin-left: 0; }
.meeting-card .title { color: #8b5cf6; font-weight: 600; }
.meeting-card a { color: var(--accent); }
.meeting-card .meeting-note { display: block; width: min(420px, 100%); margin: 6px 0 4px auto; font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.meeting-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: #8b5cf6; cursor: pointer; }
.meeting-link:hover { text-decoration: underline; }
.meeting-link[aria-pressed="true"] { background: color-mix(in srgb, #8b5cf6 16%, transparent); border-radius: 6px; padding: 1px 6px; margin: -1px -6px; }
.composer.meeting-mode .field { border-color: #8b5cf6; }
#meeting-stop { margin-right: 12px; font-size: 13px; }

/* Tabs and servers (meeting #3) */
.tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.tab { position: relative; padding: 6px 12px; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.tab.active { color: var(--text); background: var(--bg); box-shadow: 0 -2px 0 var(--accent) inset; }
.tab.alarm { color: var(--danger); }
.tab .dot, .server-item .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: middle; }
.tab-close { align-self: center; margin-left: -6px; padding: 0 6px; color: var(--muted); text-decoration: none; }
.server-panel { padding: 0 12px; flex: 1; overflow-y: auto; font-size: 13px; }
.server-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.server-item { padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.server-item.active { background: var(--mine); }
.server-item.alarm { box-shadow: inset 3px 0 0 var(--danger); }
.server-name { font-weight: 700; font-size: 14px; margin: 4px 0 8px; }
.metric { margin: 0 0 12px; }
.metric-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.metric-value { margin: 2px 0; }
.metric-value.bad { color: var(--danger); font-weight: 600; }
.metric-time { font-size: 11.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 4px 0 2px; }
.bar span { display: block; height: 100%; background: var(--online); }
.bar.warn span { background: #d97706; } .bar.bad span { background: var(--danger); }
.chart { display: block; width: 100%; height: 48px; margin: 6px 0 2px; background: var(--code); border-radius: 4px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart .threshold { stroke: var(--danger); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.limit-name { font-weight: 600; margin-top: 10px; } .limit-name.who-mars { color: var(--mars); } .limit-name.who-mercury { color: var(--mercury); }
.limit-now { color: var(--danger); font-weight: 400; }
.limit-row { margin-top: 4px; }
.warn-text { color: #d97706; }
.resets { color: var(--online); }
.chart-head { margin-top: 10px; }
.chart .line.who-mars { stroke: var(--mars); } .chart .line.who-mercury { stroke: var(--mercury); }
.chart .out { opacity: .18; } .chart .out.who-mars { fill: var(--mars); } .chart .out.who-mercury { fill: var(--mercury); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.swatch::before { content: ''; display: inline-block; width: 10px; height: 2px; margin: 0 4px 3px 0; vertical-align: middle; background: currentColor; }
.swatch.who-mars { color: var(--mars); } .swatch.who-mercury { color: var(--mercury); }
.stale { color: #d97706; font-weight: 600; margin-bottom: 8px; }
.alerts-head { margin-top: 4px; color: var(--danger); }
.alert-card { border: 1px solid var(--danger); border-radius: 8px; padding: 6px 8px; margin: 4px 0 8px; }
.alert-card.unconfirmed { border-color: #d97706; border-style: dashed; }
.muted { color: var(--muted); }

/* Composer */
.composer { position: relative; padding: 8px 20px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.field {
  display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px 6px 6px 12px;
}
.field:focus-within { border-color: var(--accent); }
textarea {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--text);
  font: inherit; padding: 4px 0; max-height: 40vh; overflow-y: auto;
}
.send {
  flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}
.send:disabled { opacity: .45; cursor: default; }
/* Links in one row (it wraps if more agents join); the status always takes its own row below them (#789). */
.compose-foot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 2px; margin-top: 5px; }
.mention-links { display: flex; flex-wrap: wrap; gap: 4px 10px; }
/* Mentions without switching to the Latin layout (#185): a click adds or removes it at the start. */
.mention-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.mention-link.who-mars { color: var(--mars); } .mention-link.who-mercury { color: var(--mercury); } .mention-link.who-jupiter { color: var(--jupiter); }
.mention-link:hover { text-decoration: underline; }
.recipients { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.recipients:empty { display: none; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 6px; }
.suggest {
  position: absolute; left: 20px; bottom: calc(100% - 4px); min-width: 220px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 18%);
}
.option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.option .id { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.option.active { background: var(--mine); }

/* Narrow windows: the sidebar collapses; the header subtitle carries presence. 900px of viewport
   is 720px of the zoomed layout. */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.agent-panel-open {
    display: flex; position: fixed; z-index: 3; inset: 60px 0 auto auto;
    width: min(240px, 100vw); max-height: calc(100dvh - 60px); border-bottom: 1px solid var(--line);
  }
  .agent-panel { display: inline-block; padding: 6px 0; }
  .log, .top, .composer, .working-strip { padding-left: 12px; padding-right: 12px; }
  .msg .avatar-slot { display: none; }
}

/* Tasks (#529): whose move it is; decisions waiting for Roman come first. */
.tab .badge { display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 5px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
.decisions { padding: 8px 20px; background: color-mix(in srgb, var(--danger) 14%, var(--bg)); border-bottom: 1px solid var(--line); font-weight: 600; }
.decisions a { color: var(--danger); }
.tasks-board { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }
.task-section { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.task-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; background: var(--theirs); }
.task-card.turn-roman { border-color: var(--danger); }
.task-card.closed { opacity: .65; }
.task-head { display: flex; gap: 8px; align-items: baseline; font-weight: 600; }
.task-id { color: var(--muted); font-weight: 400; }
.task-turn { display: flex; gap: 8px; align-items: baseline; margin: 4px 0; flex-wrap: wrap; }
.turn-pill { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; border: 1px solid currentColor; }
.turn-pill.who-roman { color: var(--danger); } .turn-pill.who-mars { color: var(--mars); } .turn-pill.who-mercury { color: var(--mercury); }
.task-decision { margin: 6px 0 2px; font-weight: 600; }
.task-actions { display: flex; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.task-comment { flex: 1; min-width: 160px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 18px; font-weight: 600; }

.md-table { max-width: 100%; overflow-x: auto; margin: 6px 0; }
.md-table table { border-collapse: collapse; white-space: normal; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; overflow-wrap: normal; }
.md-table th { background: var(--code); font-weight: 650; }

/* Topics, search, held messages and unknown deliveries (spec v1.4, stage 2) */
.topics-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.topics-head .link { text-transform: none; letter-spacing: 0; font-size: 12px; }
.topics { list-style: none; margin: 0 0 6px; padding: 0 8px; max-height: 30%; overflow-y: auto; }
.topic { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.topic:hover { background: var(--line); }
.topic.active { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.topic-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-mark { color: var(--muted); font-size: 11px; }
.topic .badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
.search { padding: 0 12px 8px; }
.search input { width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.search-results { max-height: 45%; overflow-y: auto; padding: 8px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-results .head { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.search-hit { display: block; width: 100%; text-align: left; padding: 6px 8px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.search-hit .meta { color: var(--muted); font-size: 12px; }
.search-hit mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; }
.held { display: grid; gap: 4px; margin-bottom: 8px; }
.held .item { padding: 6px 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.held .item b { color: var(--text); font-weight: 600; }
.deliveries-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topic-gone { margin: 24px auto; padding: 16px; max-width: 480px; text-align: center; color: var(--muted); }
.topic-gone a { color: var(--accent); }
/* Task board: executor choice, option buttons, outcome and live activity */
.task-assignee { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.task-outcome { margin: 4px 0; font-size: 13px; color: var(--text); }
.activity { margin: 0 0 8px; }
.activity-line { font-size: 13px; color: var(--muted); padding: 1px 0; }

/* Owner release panel on the task board */
.release { padding: 0; }
.release .task-card { margin-bottom: 4px; }
.release input[type=number] { flex: none; width: 90px; min-width: 0; }
