.kn-chatroom {
  --chat-ink: #15372e;
  --chat-muted: #52675f;
  --chat-border: #dbe8df;
  --chat-green: #176c4b;
  display: grid;
  grid-template-columns: minmax(245px, 30%) minmax(0, 1fr);
  min-height: 420px;
  height: clamp(460px, 72dvh, 770px);
  border: 1px solid var(--chat-border);
  border-radius: 22px;
  background: #fff;
  color: var(--chat-ink);
  overflow: hidden;
  box-shadow: 0 12px 30px #183e3010;
  margin: 18px 0 30px;
}
.kn-chatroom :is(h1,h2,p) { margin: 0; }
.kn-chatroom__inbox, .kn-chatroom__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.kn-chatroom__inbox { border-right: 1px solid var(--chat-border); }
.kn-chatroom__inbox-title { padding: 22px 20px 16px; }
.kn-chatroom__inbox-title h1 { font-size: clamp(24px, 2.5vw, 31px); letter-spacing: -.045em; }
.kn-chatroom__inbox-title p, .kn-chatroom__empty p { font-size: 13px; color: var(--chat-muted); margin-top: 5px; }
.kn-chatroom__threads { overflow-y: auto; padding: 0 8px 8px; flex: 1; }
.kn-chatroom__thread { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid transparent; border-radius: 13px; color: var(--chat-ink); text-decoration: none; }
.kn-chatroom__thread:hover, .kn-chatroom__thread.is-active { background: #edf7f0; border-color: #deeee2; color: var(--chat-ink); }
.kn-chatroom__avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: #dcefe4; color: #145539; font-size: 16px; font-weight: 750; }
.kn-chatroom__preview, .kn-chatroom__meta { display: grid; gap: 3px; min-width: 0; }
.kn-chatroom__preview > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-chatroom__preview > span, .kn-chatroom__preview small, .kn-chatroom__meta time { font-size: 12px; color: var(--chat-muted); }
.kn-chatroom__preview small { color: #667771; }
.kn-chatroom__meta { align-self: start; justify-items: end; }
.kn-chatroom__meta b { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 4px; border-radius: 12px; background: var(--chat-green); color: #fff; font-size: 11px; }
.kn-chatroom__empty, .kn-chatroom__pages { padding: 14px; }
.kn-chatroom__welcome { display: grid; place-content: center; justify-items: center; background: #f7faf7; text-align: center; padding: 24px; gap: 9px; }
.kn-chatroom__welcome > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: #dcefe4; font-size: 24px; }
.kn-chatroom__welcome h2 { font-size: 24px; letter-spacing: -.03em; }
.kn-chatroom__welcome p { color: var(--chat-muted); }
.kn-chatroom__contact { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--chat-border); }
.kn-chatroom__contact div { min-width: 0; flex: 1; }
.kn-chatroom__contact h2, .kn-chatroom__contact p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-chatroom__contact h2 { font-size: 17px; }
.kn-chatroom__contact p { font-size: 12px; color: var(--chat-muted); }
.kn-chatroom__listing, .kn-chatroom__older { font-size: 12px; font-weight: 700; color: var(--chat-green); }
.kn-chatroom__back { display: none; }
.kn-chatroom__history { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px clamp(12px,3vw,34px); background-color: #f4f8f3; background-image: radial-gradient(#c5d9cb 0.7px, transparent 0.7px); background-size: 17px 17px; }
.kn-chatroom__log { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.kn-chatroom__older { display: table; margin: 0 auto 12px; min-height: 28px; }
.kn-chatroom__date { align-self: center; border-radius: 20px; padding: 3px 11px; font-size: 11px; color: var(--chat-muted); background: #e7efe7; }
.kn-chatroom__bubble { max-width: min(84%, 560px); min-width: 68px; border: 1px solid #deebe1; border-radius: 15px 15px 15px 4px; padding: 8px 12px 5px; background: #fff; color: #17332a; box-shadow: 0 2px 4px #17382a08; }
.kn-chatroom__bubble.is-mine { align-self: flex-end; background: #d9f0e0; border-color: #c9e6d2; border-radius: 15px 15px 4px 15px; }
.kn-chatroom__bubble > div { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 14px; }
.kn-chatroom__bubble footer { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 1px 0 0; background: none; color: var(--chat-muted); font-size: 10px; }
.kn-chatroom__bubble [data-chat-receipt] { color: var(--chat-green); font-weight: 750; }
.kn-chatroom__composer { padding: 11px 14px 9px; border-top: 1px solid var(--chat-border); }
.kn-chatroom__composer form { display: flex; gap: 8px; align-items: end; }
.kn-chatroom__composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 112px; resize: vertical; padding: 10px 13px; border: 1px solid #bfd4c6; border-radius: 13px; background: #f9fcf9; color: var(--chat-ink); font: inherit; }
.kn-chatroom__composer button { display: flex; align-items: center; justify-content: center; min-width: 46px; min-height: 44px; gap: 6px; border: 0; border-radius: 13px; background: var(--chat-green); color: #fff; padding: 0 13px; font-weight: 700; }
.kn-chatroom__composer button:disabled { opacity: .6; }
.kn-chatroom__composer details { margin-top: 7px; color: var(--chat-muted); font-size: 11px; }
.kn-chatroom__composer [data-chat-status] { color: var(--chat-muted); font-size: 12px; padding-top: 6px; }
.kn-chatroom__composer [data-chat-status].is-error { color: #9d3023; }
.kn-chat-nav { position: relative; }
.kn-chat-nav .kn-chat-nav__badge { display: inline-grid; place-items: center; min-width: 18px; min-height: 18px; padding: 0 4px; border-radius: 12px; color: #fff; background: #bd291d; font: 700 11px/1 sans-serif; }
.kn-chat-nav .kn-chat-nav__badge[hidden] { display: none; }
.kn-portal-mobile-nav .kn-chat-nav .kn-chat-nav__badge { position: absolute; z-index: 1; top: 2px; left: 55%; }
.kn-chatroom__safety { display: flex; align-items: flex-start; gap: 10px; position: relative; padding: 10px 15px; background: #fff7e5; border-bottom: 1px solid #ebdec1; color: #543713; font-size: 12px; line-height: 1.4; }
.kn-chatroom__safety > div { flex: 1; }
.kn-chatroom__safety strong { display: block; margin-bottom: 2px; }
.kn-chatroom__report summary { cursor: pointer; font-weight: 700; text-decoration: underline; }
.kn-chatroom__report form { position: absolute; top: 100%; right: 8px; z-index: 3; width: min(280px,calc(100% - 16px)); display: grid; gap: 8px; padding: 12px; background: white; color: var(--chat-ink); box-shadow: 0 6px 16px #15372e24; border: 1px solid var(--chat-border); border-radius: 12px; }
.kn-chatroom__report label { display: grid; gap: 2px; font-weight: 600; }
.kn-chatroom__report :is(select,textarea) { width: 100%; border: 1px solid #bfd4c6; border-radius: 7px; padding: 5px; font: inherit; }
.kn-chatroom__report button { justify-self: start; padding: 6px 9px; border: 0; border-radius: 7px; background: var(--chat-green); color: white; }
.kn-chatroom__composer .kn-chatroom__attach { display: grid; place-items: center; position: relative; flex: 0 0 44px; width: 44px; height: 44px; margin: 0; padding: 0; border: 1px solid #b8d8c6; border-radius: 13px; background: #e7f4eb; color: #125e3e; cursor: pointer; }
.kn-chatroom__composer .kn-chatroom__attach-icon { display: block; width: 21px; height: 21px; color: inherit; pointer-events: none; }
.kn-chatroom__composer .kn-chatroom__attach input { cursor: pointer; position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; opacity: 0; }
.kn-chatroom__composer .kn-chatroom__attach:hover { background: #d7eddf; }
.kn-chatroom__composer .kn-chatroom__attach:focus-within { outline: 2px solid var(--chat-green); outline-offset: 2px; }
.kn-chatroom__selection { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; padding-top: 5px; }
.kn-chatroom__selection[hidden] { display: none; }
.kn-chatroom__selection span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kn-chatroom .kn-chatroom__selection button { min-height: 30px; min-width: 30px; padding: 0; background: #e7f1eb; color: var(--chat-ink); }
.kn-chatroom__attachments { display: grid; gap: 5px; margin: 3px 0; }
.kn-chatroom__attachments :is(img,video) { display: block; width: auto; max-width: min(320px,100%); max-height: 260px; border-radius: 8px; background: #e6eee8; }
.kn-chatroom__attachments a { color: var(--chat-green); font-size: 12px; }
.kn-chatroom :focus-visible { outline: 2px solid #267c54; outline-offset: 2px; }
@media (max-width: 767px) {
  .kn-chatroom { grid-template-columns: minmax(0,1fr); min-height: 390px; height: clamp(410px, 68dvh, 720px); border-radius: 16px; margin-top: 12px; }
  .kn-chatroom.has-thread .kn-chatroom__inbox, .kn-chatroom__welcome { display: none; }
  .kn-chatroom__inbox { border-right: 0; }
  .kn-chatroom__contact { gap: 8px; padding: 8px; }
  .kn-chatroom__contact .kn-chatroom__avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .kn-chatroom__back { display: grid; place-items: center; flex: 0 0 32px; min-height: 44px; font-size: 30px; line-height: 1; color: var(--chat-green); }
  .kn-chatroom__listing { max-width: 75px; text-align: right; }
  .kn-chatroom__composer textarea { font-size: 16px; }
  .kn-chatroom__send-label { display: none; }
  .kn-chatroom__safety { padding: 8px; font-size: 11px; }
  .kn-chatroom__report summary { max-width: 88px; }
}

.kn-chatroom__avatar { overflow: hidden; }
.kn-chatroom__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kn-chatroom__safety-copy { min-width: 0; }
.kn-chatroom__safety-copy p { margin: 0; color: inherit; font-size: inherit; line-height: 1.45; }
.kn-chatroom__safety-mobile { display: none; }
.kn-chatroom__safety-mobile summary { cursor: pointer; width: fit-content; padding-block: 4px; text-decoration: underline; font-weight: 650; }
.kn-chatroom__safety-less,
.kn-chatroom__safety-mobile details[open] .kn-chatroom__safety-more { display: none; }
.kn-chatroom__safety-mobile details[open] .kn-chatroom__safety-less { display: inline; }
.kn-chatroom__safety-mobile details[open] p { margin-top: 4px; }

@media (max-width: 767px) {
    .kn-chatroom__safety-desktop { display: none; }
    .kn-chatroom__safety-mobile { display: block; }
    .kn-chatroom__report { flex: 0 0 auto; }
    .kn-chatroom__report summary { text-align: right; padding-block: 4px; }
}

.kn-chatroom__unsent { margin-top: 4px; font-size: 12px; }
.kn-chatroom__unsent summary { cursor: pointer; text-decoration: underline; }
.kn-chatroom__unsent [data-chat-unsent-text] { max-height: 100px; overflow: auto; }
.kn-chatroom__unsent p { margin-block: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
