.chat-page { background: radial-gradient(ellipse at 75% 0, #4ed28a07, transparent 45%), var(--bg); }
.chat-page svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.chat-page button, .chat-page input, .chat-page textarea { font: inherit; }
.chat-page button { cursor: pointer; }
.chat-page button:disabled { cursor: default; opacity: .4; }
.chat-page :is(button, a, input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.chat-page .chat-section { max-width: 1152px; margin: 0 auto; padding: 42px 32px 56px; }
.chat-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.chat-kicker { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--accent); font-size: .65rem; font-weight: 750; letter-spacing: .18em; }
.chat-kicker > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #4ed28a55; }
.chat-page h1 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.045em; }
.chat-title-dot { color: var(--accent); }
.chat-page-description { margin: 0; color: var(--muted); font-size: .9rem; }
.chat-public-badge { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.chat-public-badge svg { width: 16px; height: 16px; color: var(--accent); }
.chat-workspace { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #151412; box-shadow: 0 24px 70px #0002; }
.chat-conversation { display: flex; flex-direction: column; min-width: 0; }
.chat-channel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 26px; border-bottom: 1px solid var(--line); background: #1a1916; }
.chat-channel-identity { display: flex; align-items: center; gap: 12px; }
.chat-channel-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #4ed28a29; border-radius: 12px; background: #4ed28a0c; color: var(--accent); font-size: 1.7rem; line-height: 1; }
.chat-channel-heading h2 { margin: 0; font-size: .95rem; letter-spacing: -.025em; }
.chat-channel-heading p { margin: 3px 0 0; color: #938d81; font-size: .67rem; }
.chat-search { display: flex; align-items: center; gap: 8px; width: 190px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #141310; color: #827d72; }
.chat-search:focus-within { border-color: #4ed28a80; }
.chat-search svg { width: 15px; height: 15px; }
.chat-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: .7rem; }
.chat-search input:focus-visible { outline: none; }
.chat-search input::placeholder { color: #827d72; }
.chat-welcome { display: flex; align-items: center; gap: 10px; padding: 11px 26px; border-bottom: 1px solid #d6ba6b13; background: #c4a45606; color: #b5ab91; }
.chat-welcome > span { color: #cbb16a; }
.chat-welcome p { margin: 0; font-size: .72rem; }
.chat-timeline { position: relative; flex: 1; min-height: 0; }
.chat-page .chat-messages { display: flex; flex-direction: column; gap: 0; height: clamp(320px, 43vh, 520px); min-height: 320px; max-height: none; overflow-y: auto; padding: 12px 26px 26px; border: 0; border-radius: 0; background: radial-gradient(ellipse at bottom left, #4ed28a03, transparent 65%), #141310; scrollbar-color: #3d3a31 transparent; scrollbar-width: thin; overscroll-behavior: contain; overflow-anchor: none; }
.chat-date { display: flex; align-items: center; gap: 14px; margin: 15px 0 22px; color: #8d877a; font-size: .6rem; font-weight: 550; }
.chat-date::before, .chat-date::after { content: ""; flex: 1; height: 1px; background: #ffffff09; }
.chat-page .chat-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 0; margin: 0 0 22px; border: 0; border-radius: 0; background: none; }
.chat-avatar { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #ffffff12; border-radius: 11px; color: #9be5b8; background: #203b2d; font-size: .76rem; font-weight: 750; }
.chat-avatar[data-color="1"] { background: #342c43; color: #c3aae8; }
.chat-avatar[data-color="2"] { background: #3c3020; color: #e4c18b; }
.chat-avatar[data-color="3"] { background: #24333b; color: #9ccadb; }
.chat-page .chat-message-heading { justify-content: start; align-items: baseline; gap: 10px; min-width: 0; color: #e9e2d6; }
.chat-message-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: .84rem; font-weight: 650; }
.chat-page .chat-message time { flex-shrink: 0; color: #777568; font-size: .61rem; }
.chat-page .chat-message p { width: fit-content; max-width: 100%; margin: 7px 0 0; padding: 11px 15px; border: 1px solid #ffffff09; border-radius: 0 12px 12px; background: #201e19; color: #cec6b9; font-size: .9rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.is-own p { border-color: #4ed28a20; background: #4ed28a0c; color: #d0e8d8; }
.chat-message.is-own .chat-message-heading strong::after { content: "вы"; margin-left: 8px; color: #65806b; font-size: .58rem; font-weight: 400; }
.chat-new-messages { position: absolute; left: 50%; bottom: 12px; display: flex; gap: 14px; align-items: center; transform: translateX(-50%); padding: 9px 15px; border: 1px solid #4ed28a60; border-radius: 20px; background: #253b2e; box-shadow: 0 5px 20px #0006; color: #bcf0d0; font-size: .72rem; white-space: nowrap; }
.chat-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; min-height: 265px; padding: 20px; text-align: center; }
.chat-empty-symbol { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 20px; border: 1px solid #4ed28a29; border-radius: 22px; background: #4ed28a08; color: var(--accent); font-size: 2.4rem; font-weight: 300; transform: rotate(-8deg); }
.chat-empty h3 { margin: 0 0 8px; font-size: 1.1rem; letter-spacing: -.02em; }
.chat-empty p { max-width: 270px; margin: 0; color: #8f897d; font-size: .8rem; line-height: 1.7; }
.chat-compose-area { padding: 18px 26px; border-top: 1px solid var(--line); background: #1a1915; }
.chat-guest { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.chat-guest-copy { display: flex; align-items: center; gap: 12px; }
.chat-guest-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: #a89e89; }
.chat-guest strong { display: block; color: #e3dbcd; font-size: .76rem; font-weight: 650; }
.chat-guest p { max-width: 285px; margin: 4px 0 0; color: #8f897c; font-size: .69rem; line-height: 1.6; }
.chat-guest .action { gap: 12px; flex-shrink: 0; min-height: 42px; padding: 10px 15px; font-size: .73rem; box-shadow: none; }
.chat-page .chat-form { display: grid; gap: 10px; margin: 0; }
.chat-form > label { color: #aaa18e; font-size: .68rem; }
.chat-input-shell { display: flex; gap: 12px; align-items: end; padding: 12px; border: 1px solid #464134; border-radius: 12px; background: #13120f; transition: border-color 160ms; }
.chat-input-shell:focus-within { border-color: #4ed28a80; }
.chat-page .chat-form textarea { display: block; min-width: 0; min-height: 50px; max-height: 180px; padding: 3px; border: 0; border-radius: 0; outline: none; background: transparent; color: #e3dccf; font-size: .82rem; line-height: 1.6; resize: vertical; }
.chat-form textarea:focus-visible { outline: none; }
.chat-form textarea::placeholder { color: #777366; }
.chat-send-button { display: grid; flex-shrink: 0; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #81efb0; border-radius: 10px; background: var(--accent); color: #092915; }
.chat-input-meta { display: flex; justify-content: space-between; gap: 12px; color: #888170; font-size: .61rem; }
.chat-status { margin: 12px 0 0; color: #e5b784; font-size: .74rem; overflow-wrap: anywhere; }
.chat-status:empty { display: none; }
.chat-status.is-success { color: #89cba3; }
.chat-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 26px; border-top: 1px solid #ffffff06; color: #736f61; font-size: .56rem; letter-spacing: .02em; }
.chat-panel-footer > span:last-child { letter-spacing: .14em; font-size: .5rem; }
.chat-connection { display: inline-flex; align-items: center; gap: 6px; }
.chat-connection > i { width: 5px; height: 5px; border-radius: 50%; background: #8e8777; }
.chat-connection[data-state="ready"] > i { background: var(--accent); }
.chat-connection[data-state="error"] > i { background: var(--accent-3); }
@media (max-width: 1100px) {
  .chat-guest { align-items: start; flex-direction: column; gap: 14px; }
  .chat-guest p { max-width: none; }
}
@media (max-width: 760px) {
  .chat-page .chat-section { padding: 28px 16px 32px; }
  .chat-page-heading { margin-bottom: 22px; }
  .chat-page h1 { font-size: 2.25rem; }
  .chat-page-description { max-width: 280px; font-size: .8rem; line-height: 1.7; }
  .chat-public-badge { display: none; }
  .chat-workspace { grid-template-columns: minmax(0, 1fr); border-radius: 14px; }
  .chat-channel-heading { gap: 12px; padding: 16px; }
  .chat-channel-identity { gap: 9px; }
  .chat-channel-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 1.4rem; }
  .chat-channel-heading h2 { font-size: .83rem; }
  .chat-channel-heading p { font-size: .58rem; }
  .chat-search { width: 132px; padding: 8px; }
  .chat-search input { font-size: .65rem; }
  .chat-welcome { align-items: start; gap: 8px; padding: 10px 16px; }
  .chat-welcome p { font-size: .65rem; line-height: 1.7; }
  .chat-page .chat-messages { height: 390px; min-height: 270px; max-height: 53svh; padding: 10px 16px 20px; }
  .chat-page .chat-message { grid-template-columns: 30px minmax(0, 1fr); gap: 9px; }
  .chat-avatar { width: 30px; height: 30px; border-radius: 9px; font-size: .65rem; }
  .chat-page .chat-message p { padding: 9px 11px; font-size: .85rem; }
  .chat-message-heading strong { font-size: .79rem; }
  .chat-page .chat-message-heading { gap: 7px; flex-wrap: wrap; }
  .chat-compose-area { padding: 16px; }
  .chat-guest .action { width: 100%; justify-content: center; min-height: 44px; }
  .chat-guest-copy { align-items: start; }
  .chat-guest p { font-size: .68rem; }
  .chat-input-meta { font-size: .55rem; }
  .chat-form textarea { font-size: 16px !important; }
  .chat-panel-footer { padding: 11px 16px; }
}
