/* AI-ПРАВЛЕНИЕ (18 сентября 2026, Проект №4): AI-команда в «Структуре
   компании», комната совещаний, шапка панели Boro в роли. Своей палитры нет —
   токены --rp-* страницы; цвет роли приходит переменной --aib-accent
   (src/boro/roles.js). Отдельный файл, чтобы не пересекаться с правками
   общих стилей в параллельных ветках. */

.ai-board-card { padding: 16px; }
.aib-head { margin-bottom: 12px; }
.aib-h { margin: 0 0 4px; font-size: 17px; color: var(--rp-ink-1, #e6ebf3); }
.aib-h3 { margin: 18px 0 8px; font-size: 14px; color: var(--rp-ink-1, #e6ebf3); }
/* «История совещаний · 7» — одна строка вместо семи разворотов по два экрана
   (владелец, 20 сентября 2026). Выглядит как заголовок, ведёт себя как
   переключатель: в закрытом состоянии не занимает ничего. */
.aib-history-toggle {
  display: block; width: 100%; margin: 18px 0 8px; padding: 8px 10px;
  text-align: start; font: inherit; font-size: 14px;
  color: var(--rp-ink-2, #c3ccda); background: transparent; cursor: pointer;
  border: 1px dashed var(--rp-line, rgba(127, 127, 127, 0.28)); border-radius: 10px;
}
.aib-history-toggle:hover { color: var(--rp-ink-1, #e6ebf3); border-style: solid; }
.aib-history { display: grid; gap: 8px; }
.aib-h4 { margin: 10px 0 4px; font-size: 13px; color: var(--rp-ink-2, #c3ccda); }
.aib-sub { margin: 0; font-size: 13px; color: var(--rp-ink-3, #8a94a6); max-width: 820px; }
.aib-note { margin: 6px 0 0; font-size: 12px; color: var(--rp-ink-3, #8a94a6); }
.aib-notice { margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; background: rgba(79, 140, 255, 0.12); color: var(--rp-ink-1, #e6ebf3); }

.aib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.aib-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--rp-line, rgba(255,255,255,0.1));
  border-top: 3px solid var(--aib-accent, #6d5dfc);
  background: var(--rp-panel, rgba(255,255,255,0.02));
}
.aib-card.is-available { opacity: .92; }
.aib-card-head { display: flex; align-items: center; gap: 10px; }
.aib-card-names { display: flex; flex-direction: column; min-width: 0; }
.aib-name { font-size: 15px; color: var(--rp-ink-1, #e6ebf3); }
.aib-title { font-size: 12px; color: var(--rp-ink-3, #8a94a6); }
.aib-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border-radius: 50%; font-weight: 700; font-size: 18px; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.35), transparent 55%), var(--aib-accent, #6d5dfc);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}
.aib-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aib-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.aib-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--rp-line, rgba(255,255,255,0.1)); color: var(--rp-ink-2, #c3ccda); }
.aib-badge.is-on { border-color: var(--rp-green, #3ecf8e); color: var(--rp-green, #3ecf8e); }
.aib-badge.is-dev { border-color: var(--rp-amber, #f5a524); color: var(--rp-amber, #f5a524); }
.aib-summary { margin: 0; font-size: 13px; color: var(--rp-ink-2, #c3ccda); }
.aib-zone { margin: 0; font-size: 12px; color: var(--rp-ink-3, #8a94a6); }
.aib-zone.is-on { color: var(--rp-green, #3ecf8e); }
.aib-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.aib-btn {
  padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--rp-line, rgba(255,255,255,0.14)); background: transparent; color: var(--rp-ink-1, #e6ebf3);
}
.aib-btn.is-primary { background: var(--aib-accent, var(--rp-blue, #4f8cff)); border-color: transparent; color: #fff; }
.aib-room .aib-btn.is-primary, .aib-decision .aib-btn.is-primary { background: var(--rp-blue, #4f8cff); }
.aib-btn.is-quiet { color: var(--rp-ink-3, #8a94a6); }
.aib-btn:disabled { opacity: .5; cursor: default; }
.aib-choose { margin-top: 6px; padding: 8px; border-radius: 8px; border: 1px dashed var(--rp-line, rgba(255,255,255,0.14)); display: flex; flex-direction: column; gap: 4px; }
.aib-choose-title { margin: 0; font-size: 12px; color: var(--rp-ink-2, #c3ccda); }
.aib-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--rp-ink-2, #c3ccda); }

.aib-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.aib-topic {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 9px; font: inherit; font-size: 14px; resize: vertical;
  border: 1px solid var(--rp-line, rgba(255,255,255,0.14)); background-color: var(--rp-panel); color: var(--rp-ink, #e6ebf3);
}
.aib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aib-chip {
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--aib-accent, #6d5dfc); background: transparent; color: var(--rp-ink-1, #e6ebf3);
}
.aib-chip.is-on { background: var(--aib-accent, #6d5dfc); color: #fff; }
.aib-chip.is-off { opacity: .45; border-style: dashed; }
.aib-form > .aib-btn { align-self: flex-start; }

.aib-meeting { border: 1px solid var(--rp-line, rgba(255,255,255,0.1)); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.aib-meeting-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; text-align: start;
  font: inherit; font-size: 13px; border: 0; background: transparent; color: var(--rp-ink-1, #e6ebf3); cursor: pointer;
}
.aib-meeting-meta { color: var(--rp-ink-3, #8a94a6); font-size: 12px; }
.aib-speech, .aib-decision { margin: 0 12px 10px; padding: 10px 12px; border-radius: 10px; border-inline-start: 3px solid var(--aib-accent, #6d5dfc); background: rgba(255,255,255,0.03); }
.aib-decision { border-inline-start-color: #6d5dfc; background: rgba(109, 93, 252, 0.08); }
.aib-speech-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.aib-speech-head .aib-avatar { font-size: 12px; }
.aib-speech-text { margin: 0; font-size: 13px; white-space: pre-wrap; color: var(--rp-ink-2, #c3ccda); }
.aib-decision-line { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--rp-ink-1, #e6ebf3); }
.aib-list { margin: 0; padding-inline-start: 18px; font-size: 13px; color: var(--rp-ink-2, #c3ccda); }
.aib-thinking { margin: 0 12px 10px; font-size: 13px; color: var(--rp-ink-3, #8a94a6); font-style: italic; }

/* Панель Boro в роли правления: полоса цвета роли и кнопка «← Boro». */
.boro-panel.boro-panel-role .boro-panel-head { box-shadow: inset 0 3px 0 var(--boro-role-accent, #6d5dfc); }
.boro-panel.boro-panel-role .boro-panel-head-title strong { color: var(--boro-role-accent, #6d5dfc); }
.boro-role-back {
  align-self: flex-start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font: inherit; font-size: 11px; cursor: pointer;
  border: 1px solid var(--boro-role-accent, #6d5dfc); background: transparent; color: inherit;
}

/* Живые фигурки (src/boro/teamFigure.js). */
.tf-host { position: relative; }
.tf-canvas { display: block; width: 100%; height: 100%; }
.tf-fallback { display: flex; align-items: center; justify-content: center; }
.tf-svg { height: 100%; max-height: 100%; width: auto; }
.tf-host.tf-gesture .tf-svg { animation: tf-hop 0.65s ease-in-out 3; }
.tf-host.tf-speaking .tf-mouth { animation: tf-mouth 0.28s ease-in-out infinite alternate; transform-origin: 60px 46px; }
@keyframes tf-hop { 50% { transform: translateY(-6px) rotate(-3deg); } }
@keyframes tf-mouth { from { transform: scaleX(0.7) scaleY(0.6); } to { transform: scaleX(1.1) scaleY(1.3); } }
.aib-figure {
  height: 190px; margin: -4px -4px 2px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--aib-accent, #6d5dfc) 22%, transparent), transparent 70%);
}
.aib-phrase { margin: 0; font-size: 12px; font-style: italic; color: var(--aib-accent, #6d5dfc); }
.aib-table-stage {
  height: 440px; margin: 12px 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--rp-line, rgba(255,255,255,0.1));
  background: radial-gradient(ellipse at 50% 40%, #13244a 0%, #0a1222 70%);
}
.tf-svg-table { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 28px; height: 100%; padding: 24px; box-sizing: border-box; }
.tf-svg-seat { height: 120px; opacity: .8; }
.tf-svg-seat.is-speaking { opacity: 1; transform: scale(1.12); }

/* Окно разговора с ролью: фигурка в шапке, плавное появление, «говорит». */
.boro-role-figure { width: 46px; height: 52px; flex: 0 0 46px; border-radius: 10px; overflow: hidden; }
.boro-panel.boro-role-enter { animation: boro-role-in 0.42s cubic-bezier(.2,.8,.2,1); }
@keyframes boro-role-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.boro-panel.boro-role-speaking .boro-panel-head { box-shadow: inset 0 3px 0 var(--boro-role-accent, #6d5dfc), 0 0 18px -6px var(--boro-role-accent, #6d5dfc); }
@media (prefers-reduced-motion: reduce) {
  .boro-panel.boro-role-enter, .tf-host.tf-gesture .tf-svg, .tf-host.tf-speaking .tf-mouth { animation: none; }
}

@media (max-width: 640px) {
  .aib-grid { grid-template-columns: 1fr; }
  .aib-table-stage { height: 300px; }
}

/* ── 19 сентября 2026: «как пользоваться», «В совещание», вращение, комната-герой ──
   Владелец: «а как и где комната, как объединять их, как использовать,
   крутить-вертеть как Boro?». Всё на токенах --rp-*; направление — логическими
   свойствами (inline-start/end), чтобы арабский зеркалился сам. */

/* Прокрутка к разделу не прячет заголовок под шапкой страницы, а верхний край
   прокрутки — мягкий: содержимое уходит под шапку растворяясь, а не срезаясь
   («заголовок обрезан шапкой»). */
.ai-board-card { scroll-margin-top: 16px; }
#ai-board-room, #ai-board-team { scroll-margin-top: 16px; }
.page-stack.org-page { scroll-padding-top: 16px; }
@supports (animation-timeline: scroll()) {
  .page-stack.org-page { animation: org-top-soft linear both; animation-timeline: scroll(self); animation-range: 0 32px; }
  @keyframes org-top-soft {
    from { -webkit-mask-image: none; mask-image: none; }
    to { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }
  }
}
.aib-head { padding-top: 2px; }
.aib-h { font-size: 19px; line-height: 1.3; }

/* «Как пользоваться» */
.aib-howto {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px;
  border-radius: var(--rp-r, 12px); border: 1px solid var(--rp-line, rgba(255,255,255,0.1));
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.10), rgba(34, 211, 238, 0.06));
}
.aib-howto-steps { display: flex; flex: 1 1 520px; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.aib-howto-step { display: flex; align-items: center; gap: 8px; flex: 1 1 180px; min-width: 0; }
.aib-howto-num {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: #6d5dfc;
}
.aib-howto-icon { font-size: 20px; line-height: 1; }
.aib-howto-words { display: flex; flex-direction: column; min-width: 0; font-size: 12px; color: var(--rp-ink-3, #8a94a6); }
.aib-howto-words strong { font-size: 14px; color: var(--rp-ink, #e6ebf3); }
.aib-btn.is-hero { padding: 10px 18px; font-size: 14px; font-weight: 600; border-radius: 10px; background: #6d5dfc; border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px rgba(109, 93, 252, 0.8); }
.aib-btn.is-hero:hover:not(:disabled) { filter: brightness(1.08); }

/* Карточка: фигурка крутится рукой, выбранная — подсвечена */
.aib-card { position: relative; transition: box-shadow .2s ease, border-color .2s ease; }
.aib-card.is-picked { border-color: var(--aib-accent, #6d5dfc); box-shadow: 0 0 0 1px var(--aib-accent, #6d5dfc), 0 10px 30px -18px var(--aib-accent, #6d5dfc); }
.aib-figwrap { position: relative; }
.tf-host.tf-spin { cursor: grab; user-select: none; -webkit-user-select: none; }
.tf-host.tf-spin.tf-grabbing { cursor: grabbing; }
.aib-fig-hint {
  position: absolute; inset-inline-end: 8px; bottom: 6px; padding: 2px 7px; border-radius: 999px; font-size: 10.5px;
  color: var(--rp-ink-2, #c3ccda); background: rgba(10, 16, 28, 0.55); opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.aib-card:hover .aib-fig-hint, .aib-card:focus-within .aib-fig-hint { opacity: 1; }
@media (hover: none) { .aib-fig-hint { opacity: .85; } }
.aib-bubble {
  position: absolute; inset-inline: 8px; top: 8px; z-index: 2; padding: 9px 11px; border-radius: 12px;
  background: rgba(12, 18, 32, 0.94); border: 1px solid var(--aib-accent, #6d5dfc); box-shadow: 0 8px 24px -10px rgba(0,0,0,.7);
  animation: aib-pop .28s cubic-bezier(.2,.8,.2,1);
}
.aib-bubble-text { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--rp-ink, #e6ebf3); }
.aib-bubble-row { display: flex; gap: 6px; margin-top: 6px; }
.aib-bubble-btn {
  padding: 3px 9px; border-radius: 999px; font: inherit; font-size: 11.5px; cursor: pointer;
  border: 1px solid var(--aib-accent, #6d5dfc); background: transparent; color: var(--rp-ink, #e6ebf3);
}
@keyframes aib-pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.aib-card-head { justify-content: space-between; align-items: flex-start; }
.aib-join {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  font-size: 11.5px; white-space: nowrap; color: var(--rp-ink-2, #c3ccda); border: 1px solid var(--rp-line-2, rgba(255,255,255,0.18));
}
.aib-join input { margin: 0; accent-color: var(--aib-accent, #6d5dfc); }
.aib-join.is-on { color: #fff; background: var(--aib-accent, #6d5dfc); border-color: transparent; }
.aib-join.is-locked { border-style: dashed; }
.aib-join.is-chair { cursor: default; border-style: dotted; color: var(--rp-ink-3, #8a94a6); }

/* Полоса «Выбрано» */
.aib-pickbar {
  position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 12px; border-radius: 14px;
  background: rgba(14, 20, 32, 0.96); border: 1px solid #6d5dfc; box-shadow: 0 14px 34px -14px rgba(0,0,0,.8), 0 0 0 1px rgba(109,93,252,.25);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
/* ПОЛОСА — У НИЖНЕГО КРАЯ, А НЕ ПОСРЕДИ ЭКРАНА. Липкий bottom отсчитывается от
   края прокрутки ЗА ВЫЧЕТОМ её padding-bottom, а у main.workspace > .page-stack
   он 132px (угол Boro, pack-design.css). С bottom: 12px полоса висела в 144px
   от низа (1024×768: y 498–562 при нижней границе 706), и карточки проезжали
   под ней серединой. Минус 120px = 12px от настоящего края; справа — отступ
   под Boro (его покой — 90px шириной в 12px от края), чтобы он не закрывал
   «Начать совещание». */
main.workspace > .page-stack .aib-pickbar { bottom: -120px; margin-inline-end: 96px; }
.aib-pickbar-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.aib-pickbar-label { font-size: 12px; font-weight: 600; color: var(--rp-ink-2, #c3ccda); }
.aib-pickbar-chip {
  padding: 3px 9px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; color: #fff;
  background: var(--aib-accent, #6d5dfc); border: 0;
}
.aib-pickbar-topic {
  flex: 1 1 240px; min-width: 0; padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 13px;
  border: 1px solid var(--rp-line-2, rgba(255,255,255,0.18)); background: var(--rp-panel, #0e1420); color: var(--rp-ink, #e6ebf3);
}
.aib-pickbar-hint { font-size: 11.5px; color: var(--rp-amber, #f5a524); }

/* Комната совещаний — герой страницы */
.ai-board-card[data-ai-board="room"] {
  padding: 20px; border-color: rgba(109, 93, 252, 0.35);
  background: radial-gradient(ellipse at 50% 0%, rgba(59, 124, 255, 0.10), transparent 60%), var(--rp-panel, #0e1420);
}
.aib-room-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aib-room-titles { min-width: 0; flex: 1 1 420px; }
.aib-room-h { font-size: 22px; }
.aib-state {
  flex: 0 0 auto; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--rp-line-2, rgba(255,255,255,0.18)); color: var(--rp-ink-2, #c3ccda);
}
.aib-state.is-ready { color: var(--rp-green, #3ecf8e); border-color: var(--rp-green, #3ecf8e); }
.aib-state.is-live { color: #fff; background: #6d5dfc; border-color: transparent; animation: aib-live 1.6s ease-in-out infinite; }
.aib-state.is-wait, .aib-state.is-setup { color: var(--rp-amber, #f5a524); border-color: var(--rp-amber, #f5a524); }
@keyframes aib-live { 50% { box-shadow: 0 0 0 6px rgba(109, 93, 252, 0.18); } }
.aib-stage { position: relative; margin: 14px 0 6px; }
.aib-stage .aib-table-stage { height: 520px; margin: 0; }
.aib-stage-seats {
  position: absolute; inset-inline: 12px; bottom: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; pointer-events: none;
}
.aib-seat {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; color: #fff; background: rgba(10, 16, 28, 0.72);
  border: 1px solid var(--aib-accent, #6d5dfc);
}
.aib-seat.is-speaking { background: var(--aib-accent, #6d5dfc); box-shadow: 0 0 16px -2px var(--aib-accent, #6d5dfc); }
.aib-seat.is-empty { border-style: dashed; color: var(--rp-ink-3, #8a94a6); }
.aib-stage-hint {
  position: absolute; top: 10px; inset-inline-end: 12px; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  color: var(--rp-ink-2, #c3ccda); background: rgba(10, 16, 28, 0.55); pointer-events: none;
}
.aib-label { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--rp-ink-2, #c3ccda); }
.aib-ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.aib-ideas-label { font-size: 12px; color: var(--rp-ink-3, #8a94a6); }
.aib-idea {
  padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: start;
  border: 1px dashed var(--rp-line-2, rgba(255,255,255,0.22)); background: rgba(255,255,255,0.02); color: var(--rp-ink-2, #c3ccda);
}
.aib-idea:hover:not(:disabled), .aib-idea.is-on { border-style: solid; border-color: #6d5dfc; color: var(--rp-ink, #e6ebf3); }
.aib-form .aib-topic { min-height: 60px; height: 64px; }
.aib-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.aib-room .aib-btn.is-hero { background: #6d5dfc; }

@media (max-width: 640px) {
  .aib-stage .aib-table-stage { height: 320px; }
  .aib-howto-steps { flex-basis: 100%; }
  .aib-howto > .aib-btn.is-hero { width: 100%; }
  .aib-pickbar { bottom: 8px; }
  main.workspace > .page-stack .aib-pickbar { bottom: -124px; }
  .aib-pickbar > .aib-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .aib-bubble, .aib-state.is-live { animation: none; }
}
