/* 웹 보호자 화면 — 가족 대화방(P-21, assets/portal-talk.js · portal-chat.js). 인라인 스타일 없음 · 외부 요청 없음. 색 · 글은 site.css 의 변수를 쓴다. */
.pt-chat { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; box-shadow: 0 4px 14px rgba(23, 37, 30, .05); }
.pt-chat__banners:empty { display: none; }
.pt-chat__banner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--brand-soft); color: var(--ink); font-size: 14px; line-height: 1.5; border-bottom: 1px solid var(--line); }
.pt-chat__banner--error { background: #FDECEC; color: #8A1C1C; font-weight: 600; }
.pt-chat__banner-text { flex: 1 1 auto; min-width: 0; }
.pt-chat__spin { flex: none; width: 16px; height: 16px; border: 2px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: pt-chat-spin .9s linear infinite; }
.pt-chat__rec { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #D14343; animation: pt-chat-pulse 1.2s ease-in-out infinite; }
@keyframes pt-chat-spin { to { transform: rotate(360deg); } }
@keyframes pt-chat-pulse { 50% { opacity: .35; } }
.pt-chat__pad { padding: 8px 14px; }
.pt-chat__list { height: min(62vh, 560px); min-height: 260px; overflow-y: auto; padding: 8px 12px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.pt-chat__list:focus-visible { outline: 3px solid var(--sun); outline-offset: -3px; }
.pt-chat__day { align-self: center; margin: 10px 0 4px; font-size: 12px; color: var(--sub); }
.pt-chat__row { display: grid; justify-items: start; gap: 2px; padding: 2px 0; max-width: 100%; }
.pt-chat__row.is-mine { justify-items: end; }
.pt-chat__nick { margin-left: 4px; font-size: 12px; color: var(--sub); }
.pt-chat__line { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.pt-chat__row.is-mine .pt-chat__line { justify-content: flex-end; }
.pt-chat__status { flex: none; font-size: 11px; color: var(--sub); white-space: nowrap; }
.pt-chat__bubble { min-width: 0; max-width: min(78vw, 520px); padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.pt-chat__row.is-mine .pt-chat__bubble { background: var(--brand-soft); border-color: #CBE6D6; }
.pt-chat__bubble.is-failed { background: #FDECEC; border-color: #F2C4C4; }
.pt-chat__text { white-space: pre-wrap; user-select: text; word-break: break-word; }
.pt-chat__again { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-chat__more { align-self: center; margin: 4px 0; color: var(--sub); font-size: 14px; }
.pt-chat__empty { margin: auto; padding: 24px; text-align: center; color: var(--sub); font-size: 15px; }
.pt-chat__file { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.pt-chat__file-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-size: 18px; }
.pt-chat__file-text { display: grid; min-width: 0; flex: 1 1 auto; }
.pt-chat__file-text strong { font-size: 15px; overflow-wrap: anywhere; }
.pt-chat__file-text small { color: var(--sub); font-size: 12px; }
.pt-chat__file-text small.is-bad { color: #8A1C1C; }
.pt-chat__upload { display: grid; gap: 6px; min-width: min(280px, 70vw); }
.pt-chat__upload small { color: var(--sub); font-size: 12px; }
.pt-chat__upload-error { color: #8A1C1C !important; font-weight: 600; font-size: 13px !important; }
.pt-chat__x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--sub); cursor: pointer; font-size: 16px; }
.pt-chat__x:hover { background: rgba(23, 37, 30, .08); }
.pt-chat__composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: var(--card); }
.pt-chat__input { flex: 1 1 auto; min-width: 0; min-height: 44px; max-height: 132px; resize: none; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; font: 16px/1.5 var(--font); color: var(--ink); background: #fff; }
.pt-chat__input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.pt-chat__input:disabled { background: var(--bg); color: var(--sub); }
.pt-chat__btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--brand-ink); cursor: pointer; font-size: 22px; }
.pt-chat__btn:hover:not(:disabled) { background: var(--brand-soft); }
.pt-chat__btn:focus-visible, .pt-chat__x:focus-visible, .pt-chat__choice:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.pt-chat__btn:disabled { opacity: .45; cursor: default; }
.pt-chat__btn.is-on { color: #D14343; background: #FDECEC; }
.pt-chat__btn--send { background: var(--brand-ink); color: #fff; }
.pt-chat__btn--send:hover:not(:disabled) { background: var(--ink); }
.pt-chat__choices { display: grid; gap: 8px; }
.pt-chat__choice { display: grid; gap: 2px; text-align: left; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; }
.pt-chat__choice:hover { background: var(--brand-soft); border-color: var(--brand); }
.pt-chat__choice small { color: var(--sub); font-size: 13px; }
.pt-chat__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
  .pt-chat__list { height: calc(100dvh - 330px); min-height: 240px; }
  .pt-chat__bubble { max-width: 76vw; }
}
@media (prefers-reduced-motion: reduce) { .pt-chat__spin, .pt-chat__rec { animation: none; } }
