* { box-sizing: border-box; border-radius: 0 !important; }
:root { color-scheme: light; font-family: Arial, "Malgun Gothic", sans-serif; color: #111; background: #fff; }
html, body { margin: 0; min-height: 100%; background: #fff; }
body { min-height: 100vh; }
button, input { font: inherit; border-radius: 0 !important; }
button { border: 1px solid #111; background: #111; color: #fff; padding: 11px 16px; cursor: pointer; }
button:disabled, input:disabled { opacity: .45; cursor: not-allowed; }
input { min-width: 0; border: 1px solid #999; background: #fff; color: #111; padding: 11px 12px; outline: none; }
input:focus { border-color: #111; }
.app { width: min(100%, 820px); min-height: 100vh; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; }
.top { height: 58px; border-bottom: 1px solid #111; display: flex; align-items: center; justify-content: space-between; }
h1 { margin: 0; font-size: 20px; font-weight: 700; }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; }
.status-dot { width: 7px; height: 7px; background: #999; display: inline-block; }
.status-dot.online { background: #111; }
.name-row { display: flex; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid #ddd; }
.name-row label { font-size: 13px; white-space: nowrap; }
.name-row input { flex: 1; }
.messages { flex: 1; min-height: 300px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 16px 0; }
.message { padding: 9px 0; border-bottom: 1px solid #eee; overflow-wrap: anywhere; }
.message-meta { display: flex; gap: 9px; align-items: baseline; margin-bottom: 4px; }
.message-name { font-size: 13px; font-weight: 700; }
.message-time { font-size: 11px; color: #777; }
.message-body { white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.empty { color: #777; font-size: 13px; padding: 20px 0; }
.composer { display: flex; gap: 0; border-top: 1px solid #111; padding: 12px 0; }
.composer input { flex: 1; border-right: 0; }
.composer button { min-width: 76px; }
.bottom { min-height: 36px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #ddd; font-size: 12px; color: #666; }
.text-button { border: 0; background: transparent; color: #111; padding: 7px 0; text-decoration: underline; }
.admin-panel { border-top: 1px solid #111; padding: 14px 0 20px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
#login-form { display: flex; gap: 0; }
#login-form input { flex: 1; border-right: 0; }
#admin-actions p { font-size: 13px; }
.danger { background: #fff; color: #111; border: 1px solid #111; }
@media (max-width: 520px) {
  .app { padding: 0 12px; }
  .messages { max-height: calc(100vh - 145px); }
  .name-row { flex-wrap: wrap; }
}
