/* FEREBRUM «Версия 3» shell. Colours follow the approved mockups (dark, orange accent). */
:root {
  --fx-rail: #0E0F11; --fx-bg: #141518; --fx-side: #191B1F; --fx-card: #202328; --fx-hover: #25282E;
  --fx-line: #23262C; --fx-line2: #2B2E35; --fx-text: #EDEDEF; --fx-soft: #D5D8DD; --fx-muted: #A3A7AE; --fx-label: #9A9EA6;
  --fx-accent: #FF8A1F; --fx-accent-ink: #1A1205; --fx-accent-soft: #2A1C0E; --fx-accent-text: #FFB46E;
  --fx-ok: #7FD39A; --fx-bad: #F2A79C; --fx-rail-w: 76px;
}
html.light {
  --fx-bg: #F6F6F7; --fx-side: #FFFFFF; --fx-card: #F1F2F4; --fx-hover: #ECEDEF; --fx-line: #E3E5E8; --fx-line2: #D9DCE0;
  --fx-text: #1B1D21; --fx-soft: #30343A; --fx-muted: #5F646C; --fx-label: #6B7078; --fx-accent-soft: #FFF0E2; --fx-accent-text: #B5560A;
}
html.fx-dark-boot body { background: #141518; }

/* ---- rail ---- */
#fx-rail { position: fixed; z-index: 45; left: 0; top: 0; bottom: 0; width: var(--fx-rail-w); box-sizing: border-box;
  background: var(--fx-rail); border-right: 1px solid var(--fx-line); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px;
  font-family: Inter, system-ui, sans-serif; overflow-y: auto; scrollbar-width: none; }
#fx-rail .fx-logo { height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; flex: none; }
#fx-rail .fx-logo span { width: 36px; height: 36px; border-radius: 10px; background: var(--fx-accent); color: var(--fx-accent-ink);
  font: 800 18px Manrope, Inter, sans-serif; display: flex; align-items: center; justify-content: center; }
#fx-rail .fx-group { display: flex; flex-direction: column; gap: 4px; }
#fx-rail .fx-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; border-radius: 12px; border: 0;
  background: transparent; color: #A3A7AE; font: 500 11px/1.15 Inter, system-ui, sans-serif; cursor: pointer; text-align: center; width: 100%; }
#fx-rail .fx-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#fx-rail .fx-item:hover { background: #1A1C20; color: #EDEDEF; }
#fx-rail .fx-item.is-active { background: #2A1C0E; color: #FFB46E; font-weight: 600; }
#fx-rail .fx-item:focus-visible, #fx-rail .fx-round:focus-visible { outline: 2px solid var(--fx-accent); outline-offset: 1px; }
#fx-rail .fx-sep { height: 1px; background: var(--fx-line); margin: 8px 6px; flex: none; }
#fx-rail .fx-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 10px; }
#fx-rail .fx-round { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #2B2E35; background: transparent; color: #A3A7AE; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
#fx-rail .fx-profile { width: 40px; height: 40px; border-radius: 50%; background: #3B2A18; color: #FFB46E; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: none; border: 0; cursor: pointer; font-size: 15px; }
#fx-rail .fx-profile:hover { box-shadow: 0 0 0 2px #FF8A1F55; }

/* ---- LibreChat underneath: shift right, hide its own icon column (the real account button sits over our avatar) ---- */
html.fx-on #root { position: fixed; top: 0; bottom: 0; right: 0; left: var(--fx-rail-w); width: auto; }
html.fx-on aside[aria-label="Контрольная панель"] > div > div:has(> [data-testid="close-sidebar-button"]),
html.fx-on aside[aria-label="Контрольная панель"] > div > div:has(> [data-testid="open-sidebar-button"]) {
  width: 0 !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; overflow: visible !important; }
html.fx-on aside[aria-label="Контрольная панель"] > div > div:has(> [data-testid="close-sidebar-button"]) > *:not(.mt-auto),
html.fx-on aside[aria-label="Контрольная панель"] > div > div:has(> [data-testid="open-sidebar-button"]) > *:not(.mt-auto) { display: none !important; }
html.fx-on [data-testid="nav-user"] { position: fixed !important; z-index: 61; left: 18px; bottom: 12px; width: 40px !important; height: 40px !important;
  opacity: 0; border-radius: 50%; }
html.fx-on [data-testid="nav-user"]:focus-visible { opacity: 1; outline: 2px solid var(--fx-accent); background: transparent; }
html.fx-on .rr-rail-mount, html.fx-on .rr-actions-mount { display: none !important; }
/* theme switching lives in the rail (it presses these same native buttons) */
html.fx-on .ferebrum-appearance { display: none !important; }
/* the old floating «Управление сервером» / RU links are replaced by rail sections */
html.fx-on #solargy-server-control-link, html.fx-on #solargy-ru-chat-link { display: none !important; }

/* chats column (history) */
html.fx-on aside[aria-label="Контрольная панель"] nav { background: var(--fx-side) !important; border-right: 1px solid var(--fx-line) !important; }
#fx-search-box { position: relative; margin: 10px 12px 4px; }
#fx-search-box .fx-search { display: flex; align-items: center; gap: 8px; background: var(--fx-card); border-radius: 10px; padding: 0 10px; color: var(--fx-muted); }
#fx-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 9px 0; background: transparent; color: var(--fx-text); font: 13px Inter, system-ui, sans-serif; }
#fx-search-box .fx-search:focus-within { box-shadow: 0 0 0 1px var(--fx-accent); }
#fx-search-box .fx-results { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: var(--fx-card); border: 1px solid var(--fx-line2);
  border-radius: 10px; padding: 4px; max-height: 320px; overflow: auto; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
#fx-search-box .fx-results button { display: block; width: 100%; text-align: left; padding: 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--fx-soft); font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fx-search-box .fx-results button:hover, #fx-search-box .fx-results button:focus-visible { background: var(--fx-hover); color: var(--fx-text); }
#fx-search-box .fx-results p { margin: 6px 8px; font-size: 12px; }
#fx-actions { display: flex; flex-direction: column; gap: 8px; margin: 0 12px; padding: 12px 0; border-top: 1px solid var(--fx-line2); flex: none; }
#fx-actions .fx-label { padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--fx-label); letter-spacing: .6px; }
#fx-actions .fx-qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#fx-actions .fx-qa button { padding: 9px 8px; border-radius: 10px; border: 1px solid var(--fx-line2); background: var(--fx-card); color: var(--fx-text);
  font: 12px Inter, system-ui, sans-serif; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fx-actions .fx-qa button:hover { border-color: var(--fx-accent); }
#fx-actions .fx-room { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-radius: 10px; border: 0;
  background: var(--fx-card); color: var(--fx-text); font: 13px Inter, system-ui, sans-serif; cursor: pointer; }
#fx-actions .fx-room small { font-size: 11px; color: var(--fx-accent-text); }

/* empty chat: registry starters replace the built-in suggestions */
.rr-welcome.fx-welcome > :not(#fx-starters) { display: none !important; }
#fx-starters { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; width: 100%; }
#fx-starters .fx-hello { margin: 0; font: 800 30px Manrope, Inter, sans-serif; color: var(--fx-text); }
#fx-starters .fx-starter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 680px; margin-top: 12px; }
#fx-starters .fx-starter-grid button { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--fx-line2); background: var(--fx-side);
  color: var(--fx-text); font: 13px Inter, system-ui, sans-serif; cursor: pointer; }
#fx-starters .fx-starter-grid button:hover { border-color: var(--fx-accent); }

/* ---- stage: every non-chat section opens here, inside the same window ---- */
#fx-stage { display: none; position: fixed; z-index: 40; left: var(--fx-rail-w); top: 0; right: 0; bottom: 0; background: var(--fx-bg); color: var(--fx-text);
  font-family: Inter, system-ui, sans-serif; }
html.fx-stage-open #fx-stage { display: block; }
#fx-stage > [hidden] { display: none !important; }
.fx-frame, .fx-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--fx-bg); }
.fx-panel { height: 100%; overflow: auto; box-sizing: border-box; }
.fx-panel.fx-two { display: flex; overflow: hidden; }
.fx-side { flex: 0 0 240px; box-sizing: border-box; background: var(--fx-side); border-right: 1px solid var(--fx-line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.fx-side h2 { margin: 0 8px 12px; font-size: 16px; font-weight: 700; }
.fx-side button { text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--fx-soft); font: 14px Inter, sans-serif; cursor: pointer; }
.fx-side button:hover { background: var(--fx-hover); }
.fx-side button.is-active { background: var(--fx-hover); color: var(--fx-text); }
.fx-two .fx-page { flex: 1; overflow: auto; }
.fx-page { box-sizing: border-box; padding: 24px 32px; max-width: 900px; }
.fx-page.fx-wide { max-width: 1280px; }
.fx-page h1 { margin: 0 0 8px; font: 800 24px Manrope, Inter, sans-serif; }
.fx-muted { color: var(--fx-muted); font-size: 13px; margin: 0; }
.fx-hint { color: var(--fx-label) !important; font-size: 12px; margin: 12px 8px 0; }
.fx-rich { font-size: 14px; line-height: 1.6; color: var(--fx-soft); }
.fx-rich p { margin: 0 0 12px; } .fx-rich ul { margin: 0 0 12px; padding-left: 20px; }
.fx-card { margin-top: 18px; background: var(--fx-side); border: 1px solid var(--fx-line2); border-radius: 14px; padding: 16px; }
.fx-card p { margin: 6px 0 0; color: var(--fx-muted); font-size: 13px; }
.fx-soon { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 12vh auto 0; gap: 8px; max-width: 520px; }
.fx-soon-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--fx-accent-soft); color: var(--fx-accent-text); display: flex; align-items: center; justify-content: center; }
.fx-soon p { color: var(--fx-muted); margin: 0; }
.fx-badge { padding: 4px 10px; border-radius: 999px; background: var(--fx-accent-soft); color: var(--fx-accent-text); font-size: 12px; font-weight: 600; }

/* modules editor */
.fx-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.fx-head > div:first-child { max-width: 640px; }
.fx-actions-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.fx-btn { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--fx-line2); background: var(--fx-card); color: var(--fx-text); font: 13px Inter, sans-serif; cursor: pointer; }
.fx-btn:hover { border-color: var(--fx-muted); }
.fx-btn.fx-primary { background: var(--fx-accent); border-color: var(--fx-accent); color: var(--fx-accent-ink); font-weight: 600; }
.fx-btn.fx-danger, .fx-icon-btn.fx-danger { color: var(--fx-bad); border-color: #5A2A24; background: transparent; }
.fx-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fx-tabs button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--fx-line2); background: transparent; color: var(--fx-soft); font: 13px Inter, sans-serif; cursor: pointer; }
.fx-tabs button[aria-selected="true"] { background: var(--fx-accent-soft); border-color: var(--fx-accent); color: var(--fx-accent-text); }
.fx-rows { display: flex; flex-direction: column; background: var(--fx-side); border: 1px solid var(--fx-line2); border-radius: 14px; }
.fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--fx-line); }
.fx-row:last-of-type { border-bottom: 0; }
.fx-row.is-off { opacity: .55; }
.fx-row-col { flex-direction: column; align-items: stretch; }
.fx-row-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fx-in { background: var(--fx-card); color: var(--fx-text); border: 1px solid var(--fx-line2); border-radius: 8px; padding: 7px 9px; font: 13px Inter, sans-serif; min-width: 0; }
input.fx-in { width: 140px; } input.fx-in.fx-grow { flex: 1; min-width: 180px; width: auto; }
textarea.fx-in { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.5; }
.fx-in:focus { outline: 0; border-color: var(--fx-accent); }
.fx-target { display: flex; flex: 1; min-width: 200px; gap: 8px; flex-wrap: wrap; }
.fx-target textarea { flex-basis: 100%; }
.fx-access { display: flex; gap: 6px; flex-wrap: wrap; }
.fx-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fx-muted); }
.fx-switch input { accent-color: var(--fx-accent); width: 16px; height: 16px; }
.fx-move { display: inline-flex; gap: 2px; }
.fx-icon-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--fx-line2); background: transparent; color: var(--fx-muted); cursor: pointer; font-size: 13px; }
.fx-icon-btn:disabled { opacity: .3; cursor: default; }
.fx-icon-prev { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--fx-accent-soft); color: var(--fx-accent-text); }
.fx-lock { width: 28px; text-align: center; font-size: 12px; }
.fx-add { margin: 10px 12px 12px; align-self: flex-start; padding: 8px 12px; border-radius: 999px; border: 1px dashed #3A3E46; background: transparent; color: var(--fx-muted); font: 13px Inter, sans-serif; cursor: pointer; }
.fx-add:hover { color: var(--fx-text); border-color: var(--fx-accent); }
.fx-status { min-height: 20px; margin: 12px 2px; font-size: 13px; color: var(--fx-ok); }
.fx-status.is-bad { color: var(--fx-bad); }
.fx-dialog { background: var(--fx-side); color: var(--fx-text); border: 1px solid var(--fx-line2); border-radius: 16px; padding: 20px; width: min(520px, 92vw); }
.fx-dialog::backdrop { background: rgba(0,0,0,.55); }
.fx-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.fx-dialog .fx-rows { margin: 14px 0; max-height: 50vh; overflow: auto; }
.fx-grow { flex: 1; }

/* ---- База ---- */
.fx-kb-side { flex-basis: 260px; }
.fx-kb-side .fx-folder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.fx-kb-side .fx-folder-row > button:first-child { flex: 1; min-width: 0; }
.fx-kb-side button { display: flex; align-items: center; gap: 6px; }
.fx-kb-side .fx-icon-btn { justify-content: center; border: 0; }
.fx-kb-side .fx-folder-access { flex-basis: 100%; padding: 0 10px 6px; font-size: 11px; color: var(--fx-label); }
.fx-count { font-size: 11px; color: var(--fx-label); }
.fx-sep-h { height: 1px; background: var(--fx-line); margin: 10px 4px; }
.fx-nas { margin: 14px 2px 0; padding: 12px; }
.fx-nas .fx-actions-row { justify-content: flex-start; margin-top: 10px; }
.fx-kb-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.fx-drop { border: 1px dashed #3A3E46; border-radius: 14px; padding: 16px; text-align: center; color: var(--fx-muted); font-size: 13px; margin-bottom: 14px; }
.fx-drop.is-over { border-color: var(--fx-accent); background: var(--fx-accent-soft); color: var(--fx-accent-text); }
.fx-kb-list { display: flex; flex-direction: column; background: var(--fx-side); border: 1px solid var(--fx-line2); border-radius: 14px; overflow: hidden; }
.fx-kb-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 140px 250px; gap: 12px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--fx-line); font-size: 13px; }
.fx-kb-row:last-child { border-bottom: 0; }
.fx-kb-headrow { font-size: 11px; font-weight: 600; letter-spacing: .6px; color: var(--fx-label); text-transform: uppercase; padding: 9px 14px; }
.fx-kb-row.is-error { background: #1F1616; }
.fx-kb-doc { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.fx-kb-doc > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fx-kb-doc strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.fx-kb-doc small { color: var(--fx-muted); font-size: 12px; overflow-wrap: anywhere; }
.fx-kb-doc .fx-err, .fx-err { color: var(--fx-bad) !important; }
.fx-kb-doc .fx-tags { color: var(--fx-accent-text); }
.fx-ext { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--fx-card); color: var(--fx-soft); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fx-ext-pdf { background: #3A1A17; color: #F2A79C; } .fx-ext-docx, .fx-ext-doc { background: #172238; color: #9DB8F2; }
.fx-ext-xlsx, .fx-ext-xls, .fx-ext-csv { background: #16281C; color: #7FD39A; } .fx-ext-pptx { background: #2A1C0E; color: #FFB46E; }
.fx-skill { align-self: flex-start; font-size: 11px; padding: 2px 8px; }
.fx-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.fx-state i { width: 8px; height: 8px; border-radius: 50%; background: #6B7078; flex: none; }
.fx-state-ready i { background: var(--fx-ok); } .fx-state-error i { background: var(--fx-bad); } .fx-state-error { color: var(--fx-bad); }
.fx-state-indexing i, .fx-state-queued i { background: var(--fx-accent); animation: fx-pulse 1s infinite alternate; }
@keyframes fx-pulse { to { opacity: .3; } }
.fx-kb-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fx-btn.fx-sm { padding: 6px 10px; font-size: 12px; }
.fx-btn:disabled { opacity: .45; cursor: default; }
.fx-empty { text-align: center; margin: 0; border: 0; }
.fx-dialog-wide { width: min(720px, 94vw); }
.fx-field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 13px; font-weight: 600; }
.fx-field > small { font-weight: 400; }
.fx-up-list { max-height: 180px; overflow: auto; margin: 10px 0; }
.fx-skill-box { margin-top: 14px; } .fx-skill-box p { margin: 6px 0 10px; }
.fx-preview { white-space: pre-wrap; font: 13px/1.55 Inter, sans-serif; color: var(--fx-soft); background: var(--fx-bg); border: 1px solid var(--fx-line2); border-radius: 10px; padding: 14px; max-height: 55vh; overflow: auto; margin: 12px 0; }
/* «Общий чат» */
.fx-panel.fx-room { display: flex; overflow: hidden; }
.fx-room-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-room-head { padding: 18px 28px 12px; border-bottom: 1px solid var(--fx-line); }
.fx-room-head h1 { margin: 0 0 4px; font: 800 22px Manrope, Inter, sans-serif; }
.fx-room-scroll { flex: 1; overflow: auto; padding: 12px 28px; }
.fx-room-older { display: block; margin: 0 auto 10px; }
.fx-room-list { display: flex; flex-direction: column; gap: 2px; max-width: 920px; }
.fx-room-empty { padding: 40px 0; text-align: center; }
.fx-day { align-self: center; margin: 14px 0 6px; padding: 3px 12px; border-radius: 999px; background: var(--fx-card); color: var(--fx-label); font-size: 12px; }
.fx-msg { display: flex; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.fx-msg:hover { background: var(--fx-side); }
.fx-msg-ava { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--fx-card); color: var(--fx-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.fx-msg.is-me .fx-msg-ava { background: #2A2F38; color: var(--fx-text); }
.fx-msg.is-bot .fx-msg-ava { background: var(--fx-accent); color: var(--fx-accent-ink); }
.fx-msg.is-bot { background: var(--fx-side); border: 1px solid var(--fx-line2); margin: 4px 0; }
.fx-msg.is-rem { border-color: var(--fx-accent); }
.fx-msg-body { min-width: 0; flex: 1; }
.fx-msg-meta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.fx-msg-meta strong { color: var(--fx-text); }
.fx-msg-meta time { color: var(--fx-label); font-size: 12px; }
.fx-msg-del { margin-left: auto; width: 24px; height: 24px; opacity: 0; border: 0; }
.fx-msg:hover .fx-msg-del, .fx-msg-del:focus-visible { opacity: 1; }
.fx-room-text { margin-top: 2px; font-size: 14px; line-height: 1.55; color: var(--fx-soft); overflow-wrap: anywhere; }
.fx-mention { color: var(--fx-accent-text); font-weight: 600; }
.fx-msg-src { margin: 6px 0 0; font-size: 12px; color: var(--fx-label); }
.fx-room-busy { margin: 0 28px 6px; font-size: 13px; color: var(--fx-accent-text); }
.fx-dots { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fx-accent); animation: fx-pulse 1s infinite alternate; }
.fx-room-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 28px 10px; }
.fx-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--fx-line2); background: var(--fx-card);
  color: var(--fx-text); font: 13px Inter, sans-serif; cursor: pointer; }
.fx-chip:hover { border-color: var(--fx-accent); background: var(--fx-accent-soft); }
.fx-chip:focus-visible { outline: 2px solid var(--fx-accent); outline-offset: 1px; }
.fx-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fx-accent); }
.fx-room-compose { display: flex; align-items: flex-end; gap: 8px; margin: 0 28px; padding: 10px; border: 1px solid var(--fx-line2); border-radius: 16px; background: var(--fx-side); }
.fx-room-compose:focus-within { border-color: var(--fx-accent); }
.fx-room-input { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--fx-text); font: 14px/1.5 Inter, sans-serif; padding: 8px 4px; max-height: 180px; }
.fx-room-at { color: var(--fx-accent-text); white-space: nowrap; }
.fx-room-main > .fx-status { margin: 6px 30px 12px; }
.fx-room-side { flex: 0 0 280px; box-sizing: border-box; border-left: 1px solid var(--fx-line); background: var(--fx-side); padding: 18px 16px; overflow: auto; }
.fx-room-side h2 { margin: 6px 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--fx-label); }
.fx-room-rems { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.fx-rem { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 10px; background: var(--fx-card); font-size: 13px; }
.fx-rem strong { color: var(--fx-accent-text); font-size: 12px; }
.fx-rem p { margin: 3px 0 0; color: var(--fx-soft); }
.fx-room-head { display: flex; align-items: flex-start; gap: 12px; }
.fx-room-headtools { display: none; gap: 8px; flex-wrap: wrap; }
.fx-msg-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.fx-msg-ava { overflow: hidden; }
.fx-msg-system { align-self: center; margin: 8px 0; padding: 4px 12px; border-radius: 999px; background: var(--fx-card); color: var(--fx-label); font-size: 12px; text-align: center; }
.fx-room-memtools { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.fx-room-memtools .fx-btn { padding: 7px 11px; font-size: 12px; }
.fx-member .fx-grow { display: flex; flex-direction: column; min-width: 0; }
.fx-member-bday { color: var(--fx-label); font-size: 11px; }
.fx-member.is-bday .fx-member-bday { color: var(--fx-accent-text); font-weight: 600; }
.fx-dialog[open] { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: 90vh; overflow: auto; }
.fx-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.fx-room-dialog { width: min(560px, 94vw); }
.fx-room-dialog h3 { margin: 16px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--fx-label); }
.fx-pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; margin: 12px 0; }
.fx-pick { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--fx-card); cursor: pointer; }
.fx-pick input { accent-color: var(--fx-accent); width: 18px; height: 18px; flex: none; }
.fx-pick .fx-grow { display: flex; flex-direction: column; min-width: 0; }
.fx-pick small { color: var(--fx-muted); font-size: 12px; overflow-wrap: anywhere; }
.fx-pick.is-off { opacity: .6; cursor: default; }
.fx-profile-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.fx-profile-photo { width: 84px !important; height: 84px !important; font-size: 30px !important; }
.fx-profile-row .fx-actions-row { margin-top: 8px; }
.fx-bday-row { padding: 0; border: 0; }
.fx-year { width: 170px; }
@media (max-width: 1000px) { .fx-room-headtools { display: flex; } }
.fx-rem-tag { display: block; font-size: 11px; font-weight: 600; letter-spacing: .3px; color: var(--fx-label); margin-bottom: 2px; }
.fx-rem.is-repeat { border-left: 3px solid var(--fx-accent); }
.fx-room-members { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.fx-member { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fx-soft); }
.fx-member .fx-msg-ava { width: 26px; height: 26px; font-size: 12px; }
.fx-member small { font-size: 11px; color: var(--fx-label); }
.fx-bot-ava { background: var(--fx-accent) !important; color: var(--fx-accent-ink) !important; }
.fx-room-tips { list-style: disc; margin: 0 0 12px; padding-left: 18px; color: var(--fx-soft); font-size: 13px; line-height: 1.7; }
#fx-actions .fx-room small { color: var(--fx-label); }
@media (max-width: 1000px) { .fx-room-side { display: none; } }
@media (max-width: 760px) { .fx-room-scroll, .fx-room-head { padding-left: 14px; padding-right: 14px; } .fx-room-compose { margin: 0 10px 64px; } .fx-room-at { display: none; }
  .fx-room-quick { margin: 0 10px 8px; flex-wrap: nowrap; overflow-x: auto; } .fx-chip { flex: none; } }
/* «Аналитика» */
.fx-an .fx-head { align-items: flex-start; }
.fx-an .fx-actions-row { flex-wrap: wrap; justify-content: flex-end; }
.fx-an-sites { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.fx-an-sites .fx-chip[aria-selected="true"] { background: var(--fx-accent-soft); border-color: var(--fx-accent); color: var(--fx-accent-text); }
.fx-an-sites .fx-chip { padding: 7px 12px; }
.fx-an-report { display: flex; flex-direction: column; gap: 14px; }
.fx-an-period { margin-top: 6px; }
.fx-an-card { background: var(--fx-side); border: 1px solid var(--fx-line2); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.fx-an-card h2 { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--fx-label); }
.fx-an-overview { margin-top: 16px; }
.fx-an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.fx-an-kpi { background: var(--fx-side); border: 1px solid var(--fx-line2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-an-card .fx-an-kpi { background: var(--fx-card); border: 0; }
.fx-an-kpi-label { font-size: 12px; color: var(--fx-muted); }
.fx-an-kpi strong { font: 800 24px Manrope, Inter, sans-serif; color: var(--fx-text); overflow-wrap: anywhere; }
.fx-an-delta { font-size: 12px; color: var(--fx-muted); }
.fx-an-delta.is-up { color: var(--fx-ok); } .fx-an-delta.is-down { color: var(--fx-bad); }
.fx-an-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fx-an-chart { position: relative; outline: none; }
.fx-an-chart:focus-visible { box-shadow: 0 0 0 2px var(--fx-accent); border-radius: 8px; }
.fx-an-line { width: 100%; height: auto; display: block; }
.fx-an-grid { stroke: var(--fx-line2); stroke-width: 1; }
.fx-an-axis { fill: var(--fx-label); font: 11px Inter, sans-serif; }
.fx-an-area { fill: var(--fx-accent); opacity: .12; }
.fx-an-stroke { fill: none; stroke: var(--fx-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fx-an-cross { stroke: var(--fx-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.fx-an-dot { fill: var(--fx-accent); stroke: var(--fx-side); stroke-width: 2; }
.fx-an-tip { position: absolute; top: 4px; width: 140px; padding: 8px 10px; border-radius: 8px; background: var(--fx-card); border: 1px solid var(--fx-line2); display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--fx-muted); pointer-events: none; }
.fx-an-tip strong { color: var(--fx-text); font-size: 13px; }
.fx-an-bars { display: flex; flex-direction: column; gap: 8px; }
.fx-an-bar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 70px; align-items: center; gap: 10px; font-size: 13px; }
.fx-an-bar-label { color: var(--fx-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-an-bar-track { height: 10px; background: var(--fx-card); border-radius: 4px; overflow: hidden; }
.fx-an-bar-fill { display: block; height: 100%; background: var(--fx-accent); border-radius: 0 4px 4px 0; }
.fx-an-bar-value { text-align: right; color: var(--fx-text); font-variant-numeric: tabular-nums; }
.fx-an-table-wrap { overflow-x: auto; }
.fx-an-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fx-an-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--fx-label); letter-spacing: .4px; padding: 6px 8px; border-bottom: 1px solid var(--fx-line2); }
.fx-an-table td { padding: 8px; border-bottom: 1px solid var(--fx-line); color: var(--fx-soft); vertical-align: top; }
.fx-an-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-an-table tr:last-child td { border-bottom: 0; }
.fx-an-page { display: flex; flex-direction: column; color: var(--fx-text); text-decoration: none; min-width: 0; }
.fx-an-page small { color: var(--fx-label); overflow-wrap: anywhere; }
.fx-an-page:hover strong { color: var(--fx-accent-text); }
.fx-an-link { border: 0; background: none; padding: 0; color: var(--fx-text); font: 600 13px Inter, sans-serif; cursor: pointer; text-align: left; }
.fx-an-link:hover { color: var(--fx-accent-text); }
.fx-an-err { color: var(--fx-bad); font-size: 13px; margin: 0; }
.fx-an-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.fx-an-status-label { font-size: 12px; color: var(--fx-label); margin-right: 2px; }
.fx-an-src { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--fx-line2); background: var(--fx-side); font-size: 13px; }
.fx-an-src i { width: 9px; height: 9px; border-radius: 50%; background: var(--fx-label); flex: none; }
.fx-an-src strong { color: var(--fx-text); font-weight: 600; }
.fx-an-src small { color: var(--fx-muted); font-size: 12px; }
.fx-an-src.is-ok { border-color: rgba(127, 211, 154, .45); }
.fx-an-src.is-ok i { background: var(--fx-ok); box-shadow: 0 0 0 3px rgba(127, 211, 154, .18); }
.fx-an-src.is-ok small { color: var(--fx-ok); }
.fx-an-src.is-grant, .fx-an-src.is-error { border-color: var(--fx-accent); }
.fx-an-src.is-grant i, .fx-an-src.is-error i { background: var(--fx-accent); box-shadow: 0 0 0 3px rgba(255, 138, 31, .2); }
.fx-an-src.is-grant small, .fx-an-src.is-error small { color: var(--fx-accent-text); }
.fx-an-src.is-off { opacity: .7; }
.fx-an-status-note { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; color: var(--fx-muted); }
.fx-an-site-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fx-an-marks { display: inline-flex; gap: 3px; flex: none; }
.fx-an-mark { width: 18px; height: 18px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--fx-card); color: var(--fx-label); opacity: .55; }
.fx-an-mark.is-ok { background: rgba(127, 211, 154, .16); color: var(--fx-ok); opacity: 1; }
.fx-an-mark.is-grant, .fx-an-mark.is-error { background: var(--fx-accent-soft); color: var(--fx-accent-text); opacity: 1; }
.fx-an-views { margin: 12px 0 2px; }
.fx-an-ins-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fx-an-ins-head .fx-an-sites { margin: 0; }
.fx-an-ins-head .fx-chip[aria-selected="true"] { background: var(--fx-accent-soft); border-color: var(--fx-accent); color: var(--fx-accent-text); }
.fx-an-summary { margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: var(--fx-text); }
.fx-an-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.fx-an-task { background: var(--fx-card); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fx-an-task p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fx-soft); }
.fx-an-task .fx-an-how { color: var(--fx-muted); white-space: pre-line; }
.fx-an-task-head { display: flex; align-items: flex-start; gap: 8px; }
.fx-an-task-head strong { flex: 1; font-size: 14px; line-height: 1.35; }
.fx-an-task-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--fx-accent); color: var(--fx-accent-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fx-an-prio { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--fx-side); color: var(--fx-muted); }
.fx-an-prio.is-high { color: var(--fx-accent-text); background: var(--fx-accent-soft); }
.fx-an-path { color: var(--fx-accent-text); text-decoration: none; font-size: 12px; overflow-wrap: anywhere; }
.fx-an-path:hover { text-decoration: underline; }
.fx-an-topic { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-an-topic small, .fx-an-qlist { color: var(--fx-muted); font-size: 12px; }
.fx-an-hint2 { margin: -4px 0 10px !important; }
.fx-an-grid2 { align-items: start; }
.fx-an-table td:first-child { min-width: 260px; width: 38%; }
.fx-an-table td.wrap { text-align: left; max-width: 380px; overflow-wrap: anywhere; }
.fx-an-bar { grid-template-columns: minmax(0, 170px) minmax(0, 1fr) 84px; }
.fx-an-home { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.fx-an-hero .fx-an-kpi strong { font-size: 32px; }
.fx-an-hero .fx-an-kpi-label { font-size: 13px; }
.fx-an-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fx-an-changes li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--fx-soft); line-height: 1.45; }
.fx-an-ch-icon { flex: none; width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--fx-card); color: var(--fx-muted); }
.fx-an-changes .is-bad .fx-an-ch-icon { color: var(--fx-bad); }
.fx-an-changes .is-good .fx-an-ch-icon { color: var(--fx-ok); }
.fx-an-changes .is-warn .fx-an-ch-icon { color: var(--fx-accent-text); }
.fx-an-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.fx-an-site { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--fx-line2); background: var(--fx-side); color: var(--fx-text); font: 13px Inter, sans-serif; cursor: pointer; min-width: 0; }
.fx-an-site:hover, .fx-an-site:focus-visible { border-color: var(--fx-accent); outline: none; }
.fx-an-site.has-outage { border-color: #5A2A24; }
.fx-an-site-name { font-weight: 600; color: var(--fx-soft); }
.fx-an-site strong { font: 800 20px Manrope, Inter, sans-serif; }
.fx-an-site-meta { color: var(--fx-muted); font-size: 12px; }
.fx-an-site-warn { color: var(--fx-bad); font-size: 12px; }
.fx-an-spark { width: 100%; height: 36px; margin: 4px 0; }
.fx-an-sitehead { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.fx-an-sitehead .fx-btn { align-self: flex-start; }
@media (max-width: 1000px) { .fx-an-grid2 { grid-template-columns: 1fr; } }
/* «Мои направления» (employee working chats) */
#fx-directions { margin: 4px 12px 6px; display: flex; flex-direction: column; gap: 4px; }
#fx-directions .fx-label { padding: 6px 6px 2px; font-size: 11px; font-weight: 600; color: var(--fx-label); letter-spacing: .6px; }
#fx-directions .fx-dir-list { display: flex; flex-direction: column; gap: 2px; }
#fx-directions button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 8px; border-radius: 8px; border: 0;
  background: transparent; color: var(--fx-soft); font: 13px Inter, system-ui, sans-serif; cursor: pointer; }
#fx-directions button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#fx-directions button svg { flex: none; color: var(--fx-accent-text); }
#fx-directions button:hover { background: var(--fx-hover); color: var(--fx-text); }
#fx-directions button.is-active { background: var(--fx-accent-soft); color: var(--fx-text); }
#fx-directions button:focus-visible { outline: 2px solid var(--fx-accent); }
/* «Модули» → «Сотрудники» */
.fx-rows.fx-rows-plain { background: transparent; border: 0; }
.fx-rows-plain > .fx-panel { height: auto; overflow: visible; }
.fx-people { display: flex; flex-direction: column; gap: 14px; }
.fx-person { background: var(--fx-side); border: 1px solid var(--fx-line2); border-radius: 14px; padding: 16px 18px; }
.fx-person-head { display: flex; align-items: center; gap: 12px; }
.fx-person-head h2 { margin: 0; font: 700 16px Manrope, Inter, sans-serif; }
.fx-person-ava { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--fx-accent-soft); color: var(--fx-accent-text); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.fx-badge.is-ok { background: rgba(127, 211, 154, .14); color: var(--fx-ok); }
.fx-person-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; margin-top: 10px; }
.fx-person h3 { margin: 14px 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--fx-label); }
.fx-person .fx-row { padding: 6px 0; border: 0; }
.fx-person .fx-rows { background: transparent; border: 0; }
.fx-person .fx-add { margin: 4px 0; }
.fx-person footer { justify-content: flex-end; border-top: 1px solid var(--fx-line); margin-top: 12px; padding-top: 10px; }
.fx-person footer .fx-status { margin: 0 auto 0 0; }
.fx-people-sections { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0 22px; }
.fx-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fx-soft); cursor: pointer; }
.fx-check input { accent-color: var(--fx-accent); width: 16px; height: 16px; }
.fx-check input:disabled + span { color: var(--fx-muted); }
@media (max-width: 1000px) { .fx-person-grid { grid-template-columns: 1fr; } }
@media (max-width: 1300px) {
  .fx-kb-row { grid-template-columns: 1fr auto; }
  .fx-kb-row > :nth-child(2), .fx-kb-row > :nth-child(3) { display: none; }
  .fx-kb-headrow { display: none; }
}

/* ---- phones: rail becomes a bottom bar ---- */
@media (max-width: 760px) {
  :root { --fx-rail-w: 0px; }
  #fx-rail { top: auto; right: 0; width: auto; height: 60px; flex-direction: row; padding: 4px 6px; border-right: 0; border-top: 1px solid var(--fx-line); overflow-x: auto; }
  #fx-rail .fx-logo, #fx-rail .fx-sep { display: none; }
  #fx-rail .fx-group, #fx-rail .fx-bottom { flex-direction: row; margin: 0; padding: 0; gap: 2px; }
  #fx-rail .fx-item { width: 64px; flex: none; padding: 6px 2px; }
  #fx-rail .fx-round { display: none; }
  html.fx-on #root { bottom: 60px; }
  #fx-stage { bottom: 60px; }
  html.fx-on [data-testid="nav-user"] { left: auto; right: 10px; bottom: 10px; }
  .fx-page { padding: 16px; }
  .fx-panel.fx-two { flex-direction: column; }
  .fx-side { flex: none; max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--fx-line); }
  #fx-starters .fx-starter-grid { grid-template-columns: 1fr; }
}
