/* Общий чат хаба (public/chat.js): кнопка в углу и окно поверх страницы почти на весь экран. Всё под префиксом kc-. */
.kc-launch, .kc-modal, .kc-modal * { box-sizing: border-box; }
.kc-launch { position: fixed; right: 18px; bottom: 18px; z-index: 900; width: 54px; height: 54px; border-radius: 50%; border: 1px solid #10b981; background: #121822; color: #34d399; font-size: 23px; line-height: 1; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 18px rgba(52, 211, 153, .18); transition: transform .15s; }
.kc-launch:hover { transform: translateY(-2px); }
.kc-inline { position: relative; }
.kc-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; padding: 0 5px; border-radius: 99px; background: #34d399; color: #03150d; font: 700 11px/20px system-ui, sans-serif; }
.kc-badge.mention { background: #ff5c6c; color: #fff; }
.kc-launch .hidden, .kc-modal .hidden, .kc-modal.hidden { display: none !important; }
body.kc-lock { overflow: hidden; }
.kc-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(0, 0, 0, .66); backdrop-filter: blur(2px); animation: kc-fade .15s ease-out; }
@keyframes kc-fade { from { opacity: 0; } }
.kc-box { width: min(1200px, 100%); height: 100%; display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; background: #0f141c; color: #e6edf3; font: 14.5px/1.5 Inter, system-ui, "Segoe UI", Roboto, sans-serif; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); overflow: hidden; text-align: left; }
.kc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: #0d121a; }
.kc-title { font-size: 16px; }
.kc-title b { color: #34d399; }
.kc-online { color: #94a3b8; font-size: 13px; margin-left: auto; }
.kc-x { border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: none; color: #b6c2d1; font-size: 15px; cursor: pointer; padding: 4px 10px; }
.kc-x:hover { color: #34d399; border-color: #34d399; }
.kc-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.kc-side { min-height: 0; overflow-y: auto; padding: 10px 8px; border-right: 1px solid rgba(255, 255, 255, .08); background: #0f141c; }
.kc-side-h { display: flex; align-items: center; justify-content: space-between; margin: 8px 8px 6px; color: #94a3b8; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kc-dim { color: #6b7a8f; font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.kc-new { border: 1px solid rgba(255, 255, 255, .12); border-radius: 7px; background: none; color: #34d399; font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; padding: 3px 8px; cursor: pointer; }
.kc-new:hover { background: #1b2331; }
.kc-rooms, .kc-people { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.kc-room { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: #e6edf3; text-align: left; padding: 7px 8px; border-radius: 9px; font: inherit; cursor: pointer; }
.kc-room:hover { background: #1b2331; }
.kc-room.active { background: #13322a; box-shadow: inset 3px 0 0 #34d399; }
.kc-room-ic { position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1b2331; font-size: 17px; }
.kc-room-ic.big { width: 40px; height: 40px; font-size: 20px; }
.kc-on { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: #34d399; border: 2px solid #0f141c; }
.kc-room-tx { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.kc-room-tx b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-room-tx small { color: #94a3b8; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-unread { flex: none; min-width: 20px; padding: 0 6px; border-radius: 99px; background: #10b981; color: #fff; font: 700 11px/20px system-ui, sans-serif; font-style: normal; text-align: center; }
.kc-unread.hot { background: #ff5c6c; }
.kc-person { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: #aab6c5; text-align: left; padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-person:hover { background: #1b2331; color: #e6edf3; }
.kc-person i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #334155; }
.kc-person.on { color: #e6edf3; }
.kc-person.on i { background: #34d399; box-shadow: 0 0 6px #34d399; }
.kc-room-head { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.kc-room-head:empty { display: none; }
.kc-room-acts { margin-left: auto; display: flex; gap: 6px; }
.kc-room-acts button { border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: none; color: #b6c2d1; font: inherit; font-size: 12.5px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.kc-room-acts button:hover { color: #34d399; border-color: #34d399; }
.kc-picker { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; }
.kc-picker h3 { margin: 0 0 12px; color: #34d399; font-size: 16px; }
.kc-gname { width: 100%; margin-bottom: 12px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: #0b1017; color: #e6edf3; font: inherit; outline: 0; }
.kc-gname:focus { border-color: #34d399; }
.kc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; margin-bottom: 14px; }
.kc-pick label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.kc-pick label:hover { background: #1b2331; }
.kc-pick input { accent-color: #34d399; }
.kc-pick-acts { display: flex; justify-content: flex-end; gap: 8px; }
.kc-pick-acts button { border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; background: none; color: #e6edf3; font: inherit; padding: 8px 16px; cursor: pointer; }
.kc-pick-acts button.primary { background: #34d399; border-color: #34d399; color: #03150d; font-weight: 800; }
.kc-main { position: relative; min-height: 0; display: flex; flex-direction: column; }
.kc-list { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.kc-empty { margin: auto; color: #94a3b8; text-align: center; font-size: 13.5px; }
.kc-flash { position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%); margin: 0; padding: 6px 12px; border: 1px solid #7a2d36; border-radius: 9px; background: #1a0a0c; color: #ff8a95; font-size: 13px; z-index: 2; }
.kc-msg { max-width: min(720px, 85%); align-self: flex-start; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: #161d28; }
.kc-msg.mine { align-self: flex-end; background: #123028; border-color: rgba(52, 211, 153, .35); }
.kc-msg.teacher { border-color: #8a6d1f; background: #1a1505; }
.kc-msg.teacher .kc-who { color: #ffd166; }
.kc-msg.at-me { box-shadow: 0 0 0 2px rgba(255, 92, 108, .55); }
/* «/всем» — объявление преподавателя: золотое сияние, как у уведомления в колокольчике */
.kc-msg.announce { border-color: rgba(245, 158, 11, .7); background: linear-gradient(135deg, rgba(60, 38, 8, .95), rgba(48, 18, 18, .9)); box-shadow: 0 0 18px rgba(245, 158, 11, .22); }
.kc-announce { margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: rgba(245, 158, 11, .18); color: #fbbf24; font-size: 11.5px; font-weight: 600; }
.kc-sugg button b { color: #fbbf24; }
.kc-msg.sys { align-self: center; max-width: 100%; border: 0; background: none; color: #ffd166; font-size: 13px; text-align: center; padding: 2px 4px; }
.kc-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.kc-meta time, .kc-msg.sys time { color: #6b7a8f; font-size: 11.5px; }
.kc-who { font-weight: 700; }
.kc-tx { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 3px; }
.kc-at { color: #7cc7ff; font-weight: 700; }
.kc-del { margin-left: auto; border: 0; background: none; color: #94a3b8; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s; }
.kc-msg:hover .kc-del { opacity: 1; }
.kc-del:hover { color: #ff5c6c; }
.kc-form { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .08); background: #0d121a; }
.kc-form textarea { flex: 1; min-width: 0; resize: none; max-height: 160px; overflow-y: hidden; white-space: pre-wrap; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: #0b1017; color: #e6edf3; font: inherit; line-height: 1.45; outline: 0; }
.kc-form textarea:focus { border-color: #34d399; }
.kc-form > button { height: 42px; border: 0; border-radius: 10px; background: #34d399; color: #03150d; font-weight: 800; font-size: 16px; padding: 0 16px; cursor: pointer; }
.kc-sugg { position: absolute; left: 16px; bottom: calc(100% + 4px); width: min(320px, calc(100% - 32px)); display: flex; flex-direction: column; padding: 4px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; background: #0d121a; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.kc-sugg button { border: 0; background: none; color: #e6edf3; text-align: left; padding: 7px 9px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13.5px; }
.kc-sugg button:hover { background: #13322a; }
@media (max-width: 760px) {
  .kc-modal { padding: 0; }
  .kc-box { border-radius: 0; border: 0; }
  .kc-body { grid-template-columns: 1fr; }
  .kc-body { grid-template-rows: auto minmax(0, 1fr); }
  .kc-side { max-height: 30vh; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .kc-launch { right: 12px; bottom: 12px; }
}
/* обращение к преподавателю — карточка в личном чате */
.kc-msg.ticket { max-width: min(760px, 92%); border-color: rgba(52, 211, 153, .35); }
.kc-ticket-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; color: #a7f3d0; font-size: 13px; font-weight: 700; }
.kc-ticket-h a { color: #d1fae5; text-decoration: none; border-bottom: 1px dashed #2f7d63; }
.kc-ticket-h a:hover { color: #fff; }
.kc-tstat { margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid; }
.kc-tstat.s-open { color: #ffb4a8; border-color: #8a3a2c; background: #2a0f0b; }
.kc-tstat.s-seen { color: #ffd166; border-color: #8a6d1f; background: #1a1505; }
.kc-tstat.s-resolved { color: #6ee7b7; border-color: rgba(52, 211, 153, .35); background: #0f2a22; }
.kc-tstat.s-cancelled { color: #7c8899; border-color: #2b3443; background: transparent; }
.kc-ticket-code { margin-top: 6px; }
.kc-ticket-code summary { cursor: pointer; color: #8fbfa8; font-size: 12.5px; }
.kc-ticket-code pre { max-height: 220px; overflow: auto; margin: 6px 0 0; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; background: #0b1017; color: #d1fae5; font-size: 12.5px; white-space: pre; }
.kc-ticket-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.kc-ticket-acts button, .kc-ticket-acts a { padding: 5px 12px; border: 1px solid rgba(52, 211, 153, .35); border-radius: 8px; background: #0f2a22; color: #d1fae5; font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.kc-ticket-acts .primary { border-color: #34d399; background: #34d399; color: #03150d; font-weight: 700; }
.kc-ticket-acts button:hover, .kc-ticket-acts a:hover { filter: brightness(1.15); }
.kc-replyto { color: #ffd166; font-size: 11.5px; }
.kc-asks { font-size: 12px; }
.kc-replying { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-top: 1px solid #8a6d1f; background: #1a1505; color: #ffd166; font-size: 12.5px; }
.kc-replying span { flex: 1; min-width: 0; }
.kc-replying button { border: 0; background: none; color: #ffd166; cursor: pointer; font-size: 14px; }
.kc-ticket-checks { margin-top: 6px; color: #ffb4a8; font-size: 12.5px; }
.kc-ticket-checks.ok { color: #6ee7b7; }
.kc-ticket-checks ul { margin: 4px 0 0; padding-left: 4px; list-style: none; }
.kc-ticket-checks li { margin: 2px 0; }
/* код в карточке обращения — моноширинным */
.kc-ticket-code pre { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
