/* Новые разделы используют палитру и масштаб существующего интерфейса. */
#sidebar svg { color: var(--accent); }
.company-details { max-width: 1000px; }
.nav-item.document-nav { height: auto; min-height: var(--nav-row); padding-block: 7px; }
.document-nav > span { min-width: 0; line-height: 19px; overflow-wrap: break-word; }
.document-section { max-width: 900px; }
.unread-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: auto; border-radius: 12px; background: var(--primary); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.unread-count.is-zero { color: var(--faint); background: var(--raised); }
.person-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(82,136,245,.13); color: #a8c4ff; font-size: 12px; font-weight: 600; flex: none; }
.chat-people { margin: 4px 0 0; max-height: 216px; overflow: auto; }
.chat-person.nav-item { min-height: 44px; height: auto; font-size: 12px; gap: 8px; padding-block: 5px; }
.chat-person .person-avatar { width: 28px; height: 28px; }
.chat-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-disclosure { margin-top: 20px; width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.nav-disclosure .nav-chevron { margin-left: auto; transform: rotate(-90deg); }
.nav-disclosure[aria-expanded="true"] .nav-chevron { transform: none; }
.nav-disclosure.is-section-active { color: var(--text); }
.nav-disclosure.is-section-active > svg:first-child { color: var(--accent); }
.sidebar-subnav[hidden] { display: none; }
.sidebar-subnav { margin: 4px 0 18px 16px; padding-left: 9px; border-left: 1px solid var(--border); }
.sidebar-subnav .nav-item { font-size: 12px; min-height: 38px; height: auto; padding-block: 8px; }
@media (max-width: 860px) {
  .nav-disclosure, .sidebar-subnav .nav-item { min-height: 44px; }
}
.settings-destinations { display: grid; gap: 16px; max-width: 900px; }
.settings-destination { display: grid; grid-template-columns: 40px minmax(0,1fr) 20px; align-items: center; gap: 16px; }
.settings-destination > svg { width: 24px; height: 24px; color: var(--accent); stroke-width: 1.5; }
.settings-destination:hover { background: var(--raised); }
.settings-destination p { font-size: 13px; color: var(--muted); line-height: 20px; margin-top: 5px; }
.settings-destination > span { color: var(--muted); }
.reference-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; max-width: 1160px; margin-bottom: 24px; }
.reference-tile { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 18px; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; cursor: pointer; min-width: 0; line-height: 20px; }
.reference-tile svg { width: 18px; height: 18px; flex: none; stroke-width: 1.5; color: var(--muted); margin-top: 1px; }
.reference-tile span { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.reference-tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 6px; }
.reference-tile[aria-pressed="true"] { border-color: var(--accent); background: rgba(82,136,245,.08); }
.reference-tile[aria-pressed="true"] svg { color: var(--accent); }
.reference-tile:hover { background: var(--raised); }
.reference-card { max-width: 1160px; }
.reference-card .section-heading { align-items: flex-start; flex-wrap: wrap; }
.reference-card .btn svg { width: 16px; height: 16px; stroke-width: 1.5; }
.reference-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.reference-toolbar .input { width: min(100%,390px); min-height: 42px; }
.reference-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(110px,auto) auto; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.reference-row:last-child { border-bottom: 0; }
.reference-description h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.reference-description p { font-size: 12px; color: var(--muted); line-height: 19px; margin-top: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.reference-price { text-align: right; font-size: 14px; }
.reference-price small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.archive-label { font-size: 12px; font-weight: 400; color: var(--muted); background: var(--raised); border-radius: 6px; padding: 1px 6px; }
.reference-empty { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.reference-empty svg { width: 26px; height: 26px; stroke-width: 1.3; color: var(--muted); }
.reference-empty p { font-size: 13px; line-height: 20px; color: var(--muted); max-width: 370px; }
.reference-footnote { margin-top: 18px; max-width: 880px; color: var(--muted); font-size: 12px; line-height: 20px; }
.settings-modal textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.chat-directory { display: grid; margin-top: 8px; }
.chat-contact { display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 78px; border-bottom: 1px solid var(--rule); padding: 14px 6px; }
.chat-contact:hover { background: var(--active); }
.chat-contact > div { flex: 1; min-width: 0; }
.chat-contact strong { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.chat-contact p { font-size: 12px; color: var(--muted); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat { max-width: 1000px; }
.chat-header { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.chat-back { display: grid; place-items: center; width: 32px; height: 36px; color: var(--muted); flex: none; }
.chat-header > div { min-width: 0; }
.chat-header h2 { overflow-wrap: anywhere; }
.chat-header p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.chat-messages { display: flex; flex-direction: column; gap: 14px; min-height: 260px; max-height: 450px; overflow: auto; padding: 22px 2px; }
.chat-message { align-self: flex-start; padding: 12px 15px; border: 1px solid var(--border); background: var(--raised); border-radius: 16px 16px 16px 4px; max-width: 80%; }
.chat-message.own { align-self: flex-end; background: rgba(82,136,245,.12); border-radius: 16px 16px 4px 16px; }
.chat-message p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 21px; }
.chat-message time { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chat-empty { margin: auto; text-align: center; padding: 24px 0; }
.chat-empty p { color: var(--muted); font-size: 13px; line-height: 20px; margin-top: 8px; }
#chatForm { border-top: 1px solid var(--rule); padding-top: 18px; }
#chatText { width: 100%; min-height: 80px; padding: 12px; resize: vertical; }
.chat-compose-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 12px 0; }
.chat-compose-footer .btn { flex: none; }
@media(max-width:1100px) {
  .reference-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:640px) {
  .reference-grid { gap: 8px; margin-bottom: 18px; }
  .reference-tile { padding: 14px 12px; gap: 8px; flex-direction: column; }
  .reference-tile span { font-size: 12px; }
  .reference-tile small { margin-top: 3px; }
  .reference-toolbar { gap: 12px; }
  .reference-row { grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 18px 0; }
  .reference-description { grid-column: 1/-1; }
  .reference-price { text-align: left; }
  .reference-row .btn { justify-self: end; }
  .chat-compose-footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .chat-message { max-width: 95%; }
  .settings-destination { grid-template-columns: 26px minmax(0,1fr) 16px; gap: 10px; }
  .chat-messages { min-height: 230px; }
}
