/* Приглушённые акценты: тип объекта остаётся узнаваемым и без цвета. */
[data-entity="person"] { --entity-rgb: 137, 193, 181; }
[data-entity="team"] { --entity-rgb: 136, 182, 202; }
[data-entity="project"] { --entity-rgb: 165, 174, 216; }
[data-entity="task"] { --entity-rgb: 139, 181, 212; }
[data-entity="commitment"] { --entity-rgb: 202, 181, 144; }
[data-entity="idea"] { --entity-rgb: 187, 163, 217; }
[data-entity="thought"] { --entity-rgb: 200, 164, 187; }
[data-entity="artifact"] { --entity-rgb: 158, 191, 196; }
[data-entity="event"] { --entity-rgb: 172, 193, 151; }
[data-entity="delegation"] { --entity-rgb: 200, 175, 149; }
[data-entity="rest"] { --entity-rgb: 149, 192, 178; }
[data-entity="buffer"], [data-entity="object"] { --entity-rgb: 168, 181, 201; }

.entity-label {
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
  min-width: 0;
  max-width: 100%;
  vertical-align: baseline;
}
.entity-label > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.entity-icon {
  display: inline-flex;
  flex: 0 0 1em;
  align-self: baseline;
  width: 1em;
  height: 1em;
  color: rgb(var(--entity-rgb));
  vertical-align: -.12em;
}
.entity-icon .ui-icon { width: 1em; height: 1em; }

.btn, .icon-btn, .header-action, .chip {
  --button-rgb: 161, 178, 201;
  color: #e6ebea;
  border-color: rgba(var(--button-rgb), .3);
  background: linear-gradient(135deg, rgba(var(--button-rgb), .15), rgba(var(--button-rgb), .045));
  box-shadow: inset 0 1px 0 rgba(var(--button-rgb), .15), inset 0 -1px 0 #0a10102e, 0 3px 9px #080e0d26;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn--primary, .header-action--capture { --button-rgb: 139, 181, 212; }
.btn--ghost { --button-rgb: 153, 169, 191; }
.btn[data-entity], .chip[data-entity] { --button-rgb: var(--entity-rgb); }
.btn.btn--success { --button-rgb: 141, 190, 166; }
.btn.btn--warning, .header-action--quiet { --button-rgb: 202, 179, 140; }
.btn.btn--danger { --button-rgb: 204, 146, 159; }
.header-action--scenario { --button-rgb: 183, 161, 209; }
.header-action--fullscreen { --button-rgb: 141, 190, 177; }
.btn--primary, .btn--success, .btn--warning, .btn--danger, .header-action--capture {
  color: #ecf0ef;
  border-color: rgba(var(--button-rgb), .44);
  background: linear-gradient(135deg, rgba(var(--button-rgb), .23), rgba(var(--button-rgb), .085));
}
.btn:hover:not(:disabled), .icon-btn:hover:not(:disabled),
.header-action:hover:not(:disabled), .header-action:focus-visible, .chip:hover:not(:disabled) {
  color: #f8f7f4;
  border-color: rgba(var(--button-rgb), .65);
  background: linear-gradient(135deg, rgba(var(--button-rgb), .3), rgba(var(--button-rgb), .13));
  box-shadow: inset 0 1px 0 rgba(var(--button-rgb), .25), 0 4px 16px rgba(var(--button-rgb), .09);
}
.chip[aria-pressed="true"], .header-action[aria-pressed="true"], .header-action[aria-expanded="true"] {
  color: #f7f6f3;
  border-color: rgba(var(--button-rgb), .62);
  background: linear-gradient(135deg, rgba(var(--button-rgb), .28), rgba(var(--button-rgb), .12));
  box-shadow: inset 0 1px 0 rgba(var(--button-rgb), .24), 0 2px 10px #080e0d33;
}

.graph-node[data-entity] { color: rgb(var(--entity-rgb)); }
.graph-node[data-entity] .graph-node__shape {
  fill: rgba(var(--entity-rgb), .13);
  stroke: rgba(var(--entity-rgb), .65);
}
.graph-node[data-entity]:hover .graph-node__shape,
.graph-node[data-entity]:focus-visible .graph-node__shape,
.graph-node--selected[data-entity] .graph-node__shape {
  fill: rgba(var(--entity-rgb), .3);
  stroke: rgb(var(--entity-rgb));
}
.graph-entity-icon { pointer-events: none; }

.chip > .entity-icon, .tab > .entity-icon, label > .entity-icon, .orbit-core strong > .entity-icon { margin-right: .35em; }

.condition-label + .condition-label::before { content: "; "; }

/* Компактная сводка: и подпись, и знак используют акцент своей строки. */
.sidebar-summary__item { flex-wrap: nowrap; gap: 7px; }
.sidebar-summary__item--personal { color: #bcb0d9; }
.sidebar-summary__item--work { color: #afbdb9; }
.sidebar-summary__item--waiting { color: #cfb791; }
.sidebar-summary__item .ui-icon { width: 14px; height: 14px; flex: 0 0 14px; }

/* Тосты закреплены по центру viewport, независимо от ширины боковой панели. */
.toast-region {
  zoom: 1;
  left: 50%;
  right: auto;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 24px));
  max-width: none;
  max-height: min(360px, 42dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  gap: 8px;
  padding: 5px;
}
.toast {
  --toast-accent: 149, 194, 225;
  --toast-surface: 20, 43, 65;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 15px;
  border: 1px solid rgba(var(--toast-accent), .45);
  color: #f1f4f3;
  background: linear-gradient(120deg, rgba(var(--toast-accent), .14), transparent 75%), rgba(var(--toast-surface), .95);
  box-shadow: inset 0 1px 0 rgba(var(--toast-accent), .16), 0 6px 18px #080c0c52;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.toast--success { --toast-accent: 154, 211, 182; --toast-surface: 23, 52, 44; }
.toast--error { --toast-accent: 228, 163, 178; --toast-surface: 66, 30, 43; }
.toast__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: rgb(var(--toast-accent));
  background: rgba(var(--toast-accent), .12);
  border: 1px solid rgba(var(--toast-accent), .22);
}
.toast__icon .ui-icon { width: 18px; height: 18px; }
.toast__text { min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
.toast .toast__close {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  color: rgb(var(--toast-accent));
  background: transparent;
  box-shadow: none;
}
.toast .toast__close:hover { background: rgba(var(--toast-accent), .14); }
@media (max-width: 860px) {
  .toast-region { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
/* Над мобильной формой резервируем место для последнего сообщения:
   тост не перекрывает ни поля, ни кнопки. Остальные вернутся после закрытия. */
@media (max-width: 720px) {
  body:has(.dialog-wrap) .toast-region {
    top: calc(8px + env(safe-area-inset-top, 0px));
    bottom: auto;
    max-height: 96px;
  }
  body:has(.dialog-wrap) .toast:not(:last-child) { display: none; }
  body:has(.dialog-wrap) .toast { align-items: start; }
  body:has(.toast) .dialog-wrap {
    padding-top: calc(112px + env(safe-area-inset-top, 0px));
    align-items: flex-start;
  }
  body:has(.toast) .dialog {
    min-height: calc(100dvh - 112px - env(safe-area-inset-top, 0px));
  }
}
@media (pointer: coarse) {
  .toast { grid-template-columns: 32px minmax(0, 1fr) 44px; padding: 7px 9px; }
  .toast .toast__close { width: 44px; height: 44px; }
}

.graph-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0 0 10px; font-size: var(--fs-sm); }
.graph-node--quiet-label .graph-node__label { opacity: 0; }
.graph-node--quiet-label:hover .graph-node__label,
.graph-node--quiet-label:focus-visible .graph-node__label,
.graph-node--quiet-label.graph-node--selected .graph-node__label,
.graph-node--quiet-label.graph-node--neighbour .graph-node__label { opacity: 1; }
.blocker-link { cursor: pointer; font: inherit; font-size: var(--fs-xs); text-align: left; white-space: normal; }
.blocker-link .ui-icon { width: 13px; height: 13px; flex-shrink: 0; }
.blocker-link:hover { border-color: #dda1af; background: #be768c26; }
.blocker-details { border: 1px solid #c991a346; border-radius: 12px; padding: 12px; background: linear-gradient(125deg, #bd84921a, #95a3a009); }
.blocker-details p { margin: 0; }
.blocker-details__head { display: flex; align-items: center; gap: 7px; color: #ddadba; }
.dependency-link { display: flex; flex-direction: column; gap: 6px; padding: 9px; border: 1px solid #b1c0bc33; border-radius: 9px; background: #8fa39e0a; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.dependency-link:hover { background: #c5b4931a; border-color: #decfb266; }
.dependency-link > .text-muted { font-size: var(--fs-sm); }
.personal-summary { margin-bottom: 12px; gap: 8px; }
