/* Interface layer modelled on the large multi-model apps (ChatGPT, Claude,
   Perplexity, Poe): a quiet header, everything optional behind "+", the
   profile and settings at the bottom of the sidebar. Loaded last. */

/* Header: no language picker or server pill; a new-chat button on phones. */
.chat-toolbar .status-indicator { display: none !important; }
.chat-toolbar [data-language-switch] { display: none !important; }
.mobile-new-chat {
  display: none; margin-left: auto; width: 44px; height: 44px;
  border: 0; border-radius: 12px; background: transparent; color: #000; font-size: 1.15rem;
}
@media (max-width: 900px) {
  .mobile-new-chat { display: grid; place-items: center; }
  /* One "new chat" per screen: on a phone it is the pen in the header. */
  .app-shell .sidebar #newChatBtn { display: none; }
}

/* Specialist picker next to the model picker, same look and behaviour. */
.assistant-title { position: relative; min-width: 0; flex: 0 1 auto; }
.assistant-picker-btn { color: #2f4a3f; }
.assistant-picker-btn.chosen { background: #e7efe9; color: #000; }
.assistant-picker-btn i:first-child { font-size: .95rem; }
.assistant-title .assistant-picker {
  left: 0; right: auto; top: calc(100% + 6px); bottom: auto; z-index: 60;
}
@media (max-width: 600px) {
  /* On a phone the two pickers get their own row under the header buttons,
     so both names stay readable. */
  .app-shell .chat-toolbar { flex-wrap: wrap; flex-shrink: 0; row-gap: 2px; height: auto !important; padding-bottom: 4px !important; }
  .app-shell .chat-toolbar::after { content: ""; order: 9; flex-basis: 100%; height: 0; }
  .chat-toolbar .model-title, .chat-toolbar .assistant-title { order: 10; flex: 1 1 0; min-width: 0; }
  .chat-toolbar .mobile-new-chat { margin-left: auto; }
  .chat-toolbar .model-picker-btn { max-width: 100%; min-width: 0; }
  .chat-toolbar .model-picker-btn strong { min-width: 0; }
  .assistant-title .assistant-picker { left: auto; right: 0; }
}

/* Council lives in the "+" menu now; the toolbar keeps the mode switch. */
#councilModeBtn { display: none !important; }

/* Sidebar: new chat and history on top, tools in the middle, profile and
   its settings menu at the bottom. */
.sidebar > .sidebar-brand { order: 0; }
.sidebar > #newChatBtn { order: 1; }
.sidebar > .sidebar-section { order: 2; flex: 1 1 auto; min-height: 120px; overflow: auto; }
.sidebar > .sidebar-nav { order: 3; }
.sidebar > #profileActions { order: 98; }
.sidebar > #toggleStatusBtn { order: 99; margin-top: 4px; }
.profile-language {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; font-weight: 700;
}
.profile-language select { max-width: 60%; }

/* Empty chat: greeting first, then suggestions (as in every big app). */
.quick-start-greeting {
  margin: clamp(12px, 6vh, 64px) 0 18px; text-align: center;
  font-size: clamp(1.6rem, 4.5vw, 2.3rem); letter-spacing: -0.03em; line-height: 1.2; color: #000;
}
.chatPanel:has(#quickStart:not([hidden])) .welcome-turn { display: none; }

/* "+" menu above the composer. */
.composer-wrap { position: relative; }
.plus-menu {
  position: absolute; left: 12px; bottom: calc(100% + 8px); z-index: 30;
  min-width: 240px; padding: 6px; border-radius: 14px;
  background: #fff; border: 1px solid #d6dbd8; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.plus-menu[hidden] { display: none; }
.plus-menu button {
  display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px;
  border: 0; border-radius: 10px; background: transparent; color: #000; font-weight: 700; text-align: left;
}
.plus-menu button:hover, .plus-menu button:focus-visible { background: #eef3f0; }
.plus-menu small { display: block; font-weight: 600; color: #3a3a3a; }
.plus-menu i { width: 20px; text-align: center; }

/* Active Council chip above the input. */
.council-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px 12px;
  padding: 6px 10px; border-radius: 999px; background: #e7f1ec; color: #0f3b2c; font-weight: 800; font-size: .9rem;
}
.council-chip[hidden] { display: none; }
.council-chip button { border: 0; background: transparent; font-weight: 800; color: inherit; padding: 0 2px; }
.sidebar > #toggleStatusBtn { margin-top: auto; }
.sidebar:has(#profileActions:not([hidden])) > #profileActions { margin-top: auto; }
.sidebar:has(#profileActions:not([hidden])) > #toggleStatusBtn { margin-top: 4px; }
/* The messages area (which also holds the suggestions) shrinks and scrolls,
   so the composer stays on screen when the Council picker or chip shows. */
.chatPanel #chatMessages { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* Header model picker. */
.model-title { position: relative; }
.model-picker-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: min(46vw, 320px);
  padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: #000;
}
.model-picker-btn strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-picker-btn i { font-size: .8rem; }
.model-picker-btn:hover, .model-picker-btn[aria-expanded="true"] { background: #eef3f0; }
.model-picker-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; width: min(320px, calc(100vw - 24px));
  padding: 6px; border-radius: 14px; background: #fff; border: 1px solid #d6dbd8; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.model-picker-menu[hidden] { display: none; }
.model-picker-menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: #000; text-align: left;
}
.model-picker-menu button:hover:not(:disabled) { background: #eef3f0; }
.model-picker-menu button:disabled { opacity: .45; }
.model-picker-menu small { display: block !important; font-weight: 600; color: #3a3a3a; font-size: .8rem; }
.model-title { min-width: 0; flex: 0 1 auto; }
.model-picker-menu i { visibility: hidden; color: #2f6b52; }
.model-picker-menu button[aria-checked="true"] i { visibility: visible; }

/* Stop button while an answer streams. */
#sendBtn.is-stop { background: #000; color: #fff; }

/* Retry with another model. */
.message-actions { position: relative; }
.retry-model-menu {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 40; min-width: 210px;
  padding: 6px; border-radius: 12px; background: #fff; border: 1px solid #d6dbd8; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.retry-model-menu button {
  display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
  background: transparent; color: #000; font-weight: 700; text-align: left;
}
.retry-model-menu button:hover { background: #eef3f0; }
.save-google-note { margin: 2px 0 8px; font-size: 14px; color: #33413a; }
.save-google-note a { color: #2f6b52; font-weight: 700; }

/* Editing a sent message. */
.message-edit { display: flex; flex-direction: column; gap: 8px; width: min(100%, 680px); margin-left: auto; }
.message-edit textarea {
  width: 100%; padding: 12px 14px; border: 2px solid #2f6b52; border-radius: 14px;
  font: inherit; color: #000; resize: vertical; background: #fff;
}
.message-edit-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.message-edit-buttons button {
  padding: 8px 14px; border-radius: 10px; border: 1px solid #c9d0cc; background: #fff; color: #000; font-weight: 700;
}
.message-edit-buttons button.primary { background: #000; border-color: #000; color: #fff; }

/* Council answers side by side (desktop) and swipeable (phone). */
.message.has-council-columns { max-width: 100%; }
.council-columns {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 12px;
  margin: 10px 0 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px;
}
.council-card {
  scroll-snap-align: start; padding: 12px 14px; border-radius: 14px;
  background: #fff; border: 1px solid #d6dbd8; min-width: 0;
}
.council-card h3 { margin-top: 0; font-size: 1rem; }
@media (max-width: 720px) {
  .council-columns { grid-auto-columns: 86%; }
}
.assistant-turn:not(:last-child) .retry-action { display: none; }

/* Assistant chip and picker, "/" prompts. */
.assistant-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 0 0 6px 6px;
  padding: 6px 10px; border-radius: 999px; background: #e7efe9; color: #000; font-weight: 700;
}
.assistant-chip[hidden] { display: none; }
.assistant-chip button { border: 0; background: transparent; font-weight: 800; color: inherit; padding: 0 2px; }
.assistant-picker, .slash-menu {
  position: absolute; left: 8px; bottom: calc(100% + 8px); z-index: 45; width: min(340px, calc(100vw - 32px));
  max-height: 60vh; overflow-y: auto; padding: 6px; border-radius: 14px;
  background: #fff; border: 1px solid #d6dbd8; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.assistant-picker[hidden], .slash-menu[hidden] { display: none; }
.assistant-picker button, .slash-menu button {
  display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: #000; text-align: left;
}
.assistant-picker button:hover, .assistant-picker button[aria-checked="true"],
.slash-menu button:hover, .slash-menu button[aria-selected="true"] { background: #eef3f0; }
.assistant-picker i { width: 20px; text-align: center; }
.assistant-picker small { display: block; font-weight: 600; color: #3a3a3a; }
.slash-menu code { font-weight: 800; color: #2f6b52; min-width: 84px; }

/* Share conversation dialog. */
.share-dialog {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.35);
}
.share-dialog[hidden] { display: none; }
.share-card {
  width: min(480px, 100%); padding: 18px; border-radius: 18px; background: #fff; color: #000;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-head h2 { margin: 0; font-size: 1.2rem; }
.share-close { border: 0; background: transparent; font-size: 1.1rem; font-weight: 800; color: #000; }
.share-note { margin: 10px 0 14px; font-size: .95rem; }
.share-link { display: flex; gap: 8px; }
.share-link[hidden] { display: none; }
.share-link input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #c9d0cc; border-radius: 10px; font: inherit; font-size: .9rem; color: #000;
}
.share-status { min-height: 1.4em; margin: 10px 0 0; font-size: .9rem; color: #2f6b52; }
.share-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share-card button.share-copy, .share-actions button {
  padding: 9px 14px; border-radius: 10px; border: 1px solid #c9d0cc; background: #fff; color: #000; font-weight: 700;
}
.share-actions .primary { background: #000; border-color: #000; color: #fff; }
.share-stop { color: #a3261c !important; }

/* Blind comparison. */
.compare-box { margin: 14px 0; }
.compare-question { font-weight: 800; margin: 0 0 4px; }
.compare-status { margin: 0 0 6px; color: #2f6b52; font-weight: 700; }
.compare-votes { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-votes button {
  flex: 1 1 110px; padding: 10px 12px; border-radius: 12px; border: 1px solid #c9d0cc;
  background: #fff; color: #000; font-weight: 800;
}
.compare-votes button:hover { background: #eef3f0; }

/* The person's own assistants and prompts. */
.library-form {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px); z-index: 46;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px;
  background: #fff; border: 1px solid #d6dbd8; box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.library-form[hidden] { display: none; }
.library-form input, .library-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c9d0cc; border-radius: 10px; font: inherit; color: #000;
}
.library-form div { display: flex; justify-content: flex-end; gap: 8px; }
.library-form button {
  padding: 8px 14px; border-radius: 10px; border: 1px solid #c9d0cc; background: #fff; color: #000; font-weight: 700;
}
.library-form button.primary { background: #000; border-color: #000; color: #fff; }
.library-remove { margin-left: auto; padding: 2px 8px; border-radius: 8px; font-weight: 800; color: #a3261c; }
.library-remove:hover { background: #f6e4e2; }
.library-add { border-top: 1px solid #e3e7e4 !important; border-radius: 0 0 10px 10px !important; }

/* Knowledge files dialog. */
.knowledge-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.knowledge-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #f3f6f4; }
.knowledge-list li span { overflow-wrap: anywhere; }
.knowledge-list li button { border: 0; background: transparent; color: #a3261c; font-weight: 800; }
.knowledge-empty { color: #3a3a3a; background: transparent !important; }

/* "Моят аватар": the person's own profile for their avatar. */
.avatar-form { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; }
.avatar-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.avatar-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #c9d3cd; border-radius: 10px; font: inherit; font-weight: 400; resize: vertical; }
.avatar-clear { border: 0; background: transparent; color: #a3261c; font-weight: 800; }

/* "Каузи": proposed causes and likes. */
.causes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; }
.causes-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 10px; background: #f3f6f4; }
.causes-list li.cause-hidden { opacity: 0.6; }
.causes-list p { margin: 4px 0; overflow-wrap: anywhere; }
.causes-list small { color: #3a3a3a; }
.cause-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.cause-like { border: 1px solid #c9d3cd; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; }
.cause-like.on { background: #0f5132; border-color: #0f5132; color: #fff; }
.cause-remove { border: 0; background: transparent; color: #a3261c; font-weight: 800; }
.causes-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.causes-form input, .causes-form textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #c9d3cd; border-radius: 10px; font: inherit; }
.causes-form button { align-self: flex-end; }
.cause-project { margin-top: 6px; }
.cause-project summary { cursor: pointer; font-weight: 700; color: #0f5132; }
.cause-project-text { white-space: pre-wrap; margin-top: 6px; overflow-wrap: anywhere; }
.cause-prepare { margin-top: 6px; border: 1px solid #0f5132; background: #fff; color: #0f5132; border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.morning-toggle { display: block; margin-top: 10px; border: 1px solid #0f5132; background: #fff; color: #0f5132; border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.morning-toggle[aria-pressed="true"] { background: #0f5132; color: #fff; }
.reply-draft { margin-top: 6px; }
.reply-draft-result { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #f3f6f4; white-space: pre-wrap; overflow-wrap: anywhere; }
.archive-add { border: 1px solid #0f5132; background: #fff; color: #0f5132; border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.generated-image { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.generated-image img { max-width: min(100%, 420px); border-radius: 12px; }
.generated-video { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.generated-video video { max-width: min(100%, 420px); max-height: 70vh; border-radius: 12px; background: #000; }
.generated-video .video-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.generated-video .video-actions button { font: inherit; padding: 6px 12px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.generated-video .video-actions button:disabled { opacity: .6; cursor: default; }
.generated-video .video-note { font-size: .92em; }

/* "Отвори отстрани": the document panel. */
.doc-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(46vw, 720px); z-index: 60; display: flex; flex-direction: column; background: #fff; border-left: 1px solid #d5ddd8; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08); }
.doc-panel[hidden] { display: none; }
.doc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #e2e8e4; }
.doc-panel-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-panel-tools button, .doc-chart-button { border: 1px solid #c9d3cd; background: #fff; border-radius: 999px; padding: 5px 11px; font-weight: 700; }
.doc-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; line-height: 1.6; overflow-wrap: anywhere; }
.doc-panel-body table { border-collapse: collapse; width: 100%; }
.doc-panel-body th, .doc-panel-body td { border: 1px solid #d5ddd8; padding: 6px 8px; text-align: left; }
.doc-panel-status { margin: 0; padding: 0 14px 10px; color: #0f5132; }
.doc-chart { width: 100%; margin: 10px 0; font: 13px system-ui, sans-serif; }
.doc-chart rect { fill: #0f5132; }
.doc-chart text { fill: #1f2a24; }
.doc-chart-title { font-weight: 700; }
body.doc-panel-open main, body.doc-panel-open .chat-main { margin-right: min(46vw, 720px); }
@media (max-width: 760px) {
  .doc-panel { width: 100vw; }
  body.doc-panel-open main, body.doc-panel-open .chat-main { margin-right: 0; }
}
@media print {
  body.doc-panel-printing > *:not(.doc-panel) { display: none !important; }
  body.doc-panel-printing .doc-panel { position: static; width: auto; box-shadow: none; border: 0; }
  body.doc-panel-printing .doc-panel-head, body.doc-panel-printing .doc-panel-status, body.doc-panel-printing .doc-chart-button { display: none !important; }
}

/* Start screen: every assistant one tap away. */
.quick-start > .assistant-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px;
}
.quick-start .assistant-row-title {
  flex-basis: 100%; margin: 0 0 2px; text-align: center; font-size: 0.875rem; color: #4b5a55;
}
.quick-start .assistant-row button,
.app-shell .quick-start .assistant-row button {
  flex-direction: row; align-items: center; gap: 8px; min-height: 0; padding: 8px 14px;
  border-radius: 999px; font-size: 0.9rem; font-weight: 700;
}
.quick-start .assistant-row i { font-size: 0.95rem; margin: 0; }
.quick-start .assistant-row span { color: inherit; font-size: inherit; }

/* Side menu: "Моят аватар" — the person's own things in one place. */
.mine-group { margin: 4px 0 10px; }
.mine-group .mine-title {
  margin: 0 0 4px; padding: 0 8px; font-size: 0.8rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; color: #b9d8c9;
}
.mine-group > button { width: 100%; }
.plus-menu .plus-sub { padding-left: 36px; }
.plus-menu .plus-sub[hidden] { display: none; }

/* Ordinary accounts get one plain chat: the Chat/Work switch and the
   project/agent button are tools for running the project, so only the
   owner sees them. */
body[data-user-role="member"] #interactionModeBar { display: none !important; }

/* Talk with voice, hands-free: the headset button glows while it runs. */
.voice-btn.talk-btn.talking {
  color: #fff !important;
  background: var(--sx-accent, #146c52) !important;
  animation: voice-pulse 1.2s ease-in-out infinite;
}
body.talk-mode .voice-btn.listening {
  background: #d93025 !important;
}

/* The chosen specialist's tools, under its chip. */
.assistant-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px 6px;
  font-size: 0.8rem;
  color: var(--sx-muted, #5d6b66);
}
.assistant-tools[hidden] { display: none; }
.assistant-tool {
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed currentColor;
  opacity: 0.7;
}
.assistant-tool:disabled { cursor: default; }
.assistant-tool.ready {
  border-style: solid;
  border-color: rgba(20, 108, 82, 0.35);
  background: rgba(20, 108, 82, 0.08);
  opacity: 1;
}
.assistant-tool-connect {
  font-weight: 700;
  color: var(--sx-accent, #146c52);
  text-decoration: underline;
}
.assistant-tool-icons {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  opacity: 0.6;
}
.answer-todos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  padding: 4px 11px;
  border: 1px solid rgba(20, 108, 82, 0.35);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.answer-todos.done { background: rgba(20, 108, 82, 0.1); cursor: default; }

/* "Откъде знам това": small chips under an answer. */
.answer-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  font-size: 0.82rem;
  color: var(--sx-muted, #5d6b66);
}
.answer-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(20, 108, 82, 0.08);
  color: inherit;
  overflow-wrap: anywhere;
}

/* "Моите задачи" */
.todo-note,
.todo-add input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid rgba(18, 32, 29, 0.18);
  border-radius: 12px;
}
.todo-add {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.todo-add input {
  flex: 1;
  min-width: 0;
}
.todo-list,
.todo-suggestions ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.todo-list li,
.todo-suggestions li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.todo-list label,
.todo-suggestions label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: anywhere;
}
.todo-remove {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}
.todo-record.listening {
  color: #fff;
  background: #d93025;
}
.todo-empty,
.todo-done-count {
  opacity: 0.7;
  font-size: 0.9rem;
}
.model-picker-menu .model-picker-group { margin: 4px 12px 6px; font-size: .78rem; font-weight: 800; color: #2f6b52; text-transform: uppercase; letter-spacing: .03em; }

/* Tools list: why a live check failed, under its badge. */
.tool-live-reason { display: block; margin-top: 4px; max-width: 220px; color: #8a2b1f; font-size: .78rem; font-weight: 600; }

/* Owner „Активност“. */
.activity-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.activity-totals div { padding: 12px; border: 1px solid #d6dbd8; border-radius: 12px; background: #fff; }
.activity-totals strong { display: block; font-size: 22px; color: #000; }
.activity-totals span { font-size: 13px; color: #4a5650; }
.activity-note { font-size: 13px; color: #4a5650; margin: 0 0 10px; }
.activity-table-wrap { overflow-x: auto; }
.activity-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.activity-table th, .activity-table td { padding: 7px 6px; border-bottom: 1px solid #e3e7e5; text-align: left; white-space: nowrap; }
.activity-table td:nth-child(2) { position: relative; min-width: 70px; }
.activity-bar { display: inline-block; height: 8px; margin-right: 6px; border-radius: 4px; background: #2f6b52; vertical-align: middle; max-width: 50px; }

/* One header row: the Чат/Работа switch sits in the header next to the
   pickers. „Код“ and „Проекти и режими“ open from the menu, so the header
   has no extra buttons (the coding models are in the model picker). */
#codeWorkspaceBtn { display: none !important; }
.app-shell .chat-toolbar > .interaction-mode-bar {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto; width: auto !important; min-width: 0 !important; max-width: none;
  margin: 0; padding: 0 !important; border: 0 !important; min-height: 0;
  background: transparent !important; box-shadow: none !important; position: static;
}
.chat-toolbar > .interaction-mode-bar .interaction-mode-switch { margin: 0; }

@media (max-width: 600px) {
  .app-shell .chat-toolbar {
    flex-wrap: nowrap; gap: 2px; min-height: 0 !important;
    padding: 6px 6px !important;
  }
  .app-shell .chat-toolbar::after { display: none; }
  .chat-toolbar .model-title { order: 0; flex: 1 1 0; min-width: 0; }
  /* The specialist shows its name once one is chosen; until then only the
     icon, so the model name has room. */
  .chat-toolbar .assistant-title { order: 0; flex: 0 1 auto; min-width: 0; max-width: 34%; }
  .chat-toolbar .assistant-picker-btn:not(.chosen) :is(strong, span) { display: none; }
  .chat-toolbar :is(.mobile-menu, .mobile-new-chat) { width: 34px; height: 34px; min-width: 34px; flex: 0 0 34px; font-size: 1rem; margin: 0; }
  .chat-toolbar .mobile-new-chat { margin-left: 0; }
  .chat-toolbar .chat-options > summary { width: 32px; height: 36px; min-width: 32px; }
  .chat-toolbar .model-picker-btn {
    height: 34px; min-height: 34px; padding: 0 4px; gap: 2px; font-size: .82rem;
    width: auto; max-width: 100%; justify-content: flex-start;
  }
  .chat-toolbar .model-picker-btn strong { flex: 0 1 auto; max-width: none; }
  .chat-toolbar .model-picker-btn :is(strong, span) {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  }
  .chat-toolbar .model-picker-btn i { font-size: .7rem; flex: 0 0 auto; }
  /* The narrow header buttons open their lists across the screen width. */
  /* Model and specialist sit next to "+"; their lists open upwards across
     the screen width. */
  .composer-pickers { grid-area: pick; display: flex; gap: 4px; min-width: 0; align-items: center; }
  .composer-pickers .model-title { flex: 0 1 auto; min-width: 0; }
  .composer-pickers .assistant-title { flex: 0 1 auto; min-width: 0; max-width: 45%; }
  .composer-pickers .model-picker-btn {
    height: 34px; min-height: 34px; padding: 0 7px; gap: 2px; font-size: .8rem;
    border-radius: 17px; background: #eef3f0; max-width: 100%; min-width: 0;
  }
  .composer-pickers .model-picker-btn :is(strong, span) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .composer-pickers .model-picker-btn i { font-size: .7rem; flex: 0 0 auto; }
  .composer-pickers .assistant-picker-btn:not(.chosen) :is(strong, span, .fa-chevron-down) { display: none; }
  .composer-pickers .assistant-picker-btn:not(.chosen) { width: 34px; padding: 0; justify-content: center; }
  .chat-toolbar .ai-spend, .chat-toolbar .chat-options { margin-left: 0 !important; }
  .composer-pickers .model-picker-btn .fa-chevron-down { display: none; }
  .composer-pickers :is(.assistant-picker, .model-picker-menu) {
    position: fixed !important; left: 8px !important; right: 8px !important;
    top: auto !important; bottom: 120px !important; width: auto !important; max-width: none !important;
    max-height: 60vh; overflow: auto; z-index: 200 !important;
  }
  .app-shell .chat-toolbar { position: relative; z-index: 40; }
  .chat-toolbar > .interaction-mode-bar { flex-wrap: nowrap !important; gap: 0 !important; margin-right: auto !important; }
  .chat-toolbar > .interaction-mode-bar .work-context-controls { display: none !important; }
  .chat-toolbar > .interaction-mode-bar .interaction-mode-switch { padding: 2px !important; gap: 2px; }
  .chat-toolbar > .interaction-mode-bar .interaction-mode-switch button {
    width: 30px !important; min-width: 30px; height: 30px; min-height: 30px !important;
    padding: 0 !important; justify-content: center;
  }
  .chat-toolbar > .interaction-mode-bar .interaction-mode-switch button span { display: none !important; }
  .chat-toolbar .ai-spend > summary { transform: scale(.8); margin: 0 -3px; }

  /* Composer: the text gets the whole width; the buttons sit under it. */
  .app-shell .chat-input-area {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "text text text text text" "attach pick voice talk send";
    align-items: center; gap: 4px 4px; padding: 8px 6px 6px !important;
  }
  .app-shell .chat-input-area #chatInput { grid-area: text; width: 100%; min-height: 40px; padding: 6px 6px 2px; font-size: 1rem; }
  .app-shell .chat-input-area #attachBtn { grid-area: attach; }
  .app-shell .chat-input-area #voiceBtn { grid-area: voice; }
  .app-shell .chat-input-area #talkBtn { grid-area: talk; }
  .app-shell .chat-input-area #sendBtn { grid-area: send; }
  .app-shell .chat-input-area :is(#attachBtn, #voiceBtn, #talkBtn, #sendBtn) {
    width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  }
}

@media (max-width: 600px) {
  .app-shell .chat-input-area :is(#voiceBtn, #talkBtn) { width: 32px; min-width: 32px; }
  /* The header has room again, so Чат/Работа keep their names. */
  .chat-toolbar > .interaction-mode-bar .interaction-mode-switch button { width: auto !important; padding: 0 10px !important; gap: 6px; }
  .chat-toolbar > .interaction-mode-bar .interaction-mode-switch button span { display: inline !important; }
}
