:root{color-scheme:light;font-family:system-ui,"PingFang SC","Microsoft YaHei",sans-serif;background:#e7eee3;color:#20342a;--line:#dce6da;--green:#205341;--paper:#f7faf5}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
button,input,textarea{font:inherit}
button{border:0;border-radius:10px;background:var(--green);color:white;padding:.65rem 1rem;cursor:pointer;white-space:nowrap}
button:disabled{opacity:.55;cursor:wait}
button:focus-visible,input:focus-visible,textarea:focus-visible,.attachment:focus-within{outline:2px solid #50896c;outline-offset:2px}
.quiet{background:#e8f0e6;color:var(--green)}
.shell{max-width:1080px;margin:auto;height:100vh;height:100dvh;display:flex;flex-direction:column;background:var(--paper)}
.customer{max-width:730px}
.mast{background:#f1f5ed;display:flex;align-items:center;gap:12px;min-height:65px;padding:12px clamp(14px,4vw,28px);border-bottom:1px solid var(--line)}
.mark{display:grid;place-items:center;background:var(--green);color:white;border-radius:12px;width:38px;height:38px;font-size:20px;flex:none}
h1,h2{margin:0;font-size:18px}
.mast nav{margin-left:auto;display:flex;gap:6px}
.workspace{display:grid;grid-template-columns:215px minmax(0,1fr);flex:1;min-height:0}
.sidebar{border-right:1px solid var(--line);overflow:auto;background:#f1f5ed;padding:16px 10px}
.sidebar h2{font-size:14px;margin:2px 5px 10px}
.rooms{display:grid;gap:5px}
.rooms button{text-align:left;background:transparent;color:inherit;padding:9px;display:grid;gap:3px}
.rooms button[aria-pressed=true]{background:#d8eadc}
.rooms small,.meta,.blank{color:#4f695a}
.chat-pane{display:flex;flex-direction:column;min-height:0;min-width:0}
.messages{flex:1;min-height:0;overflow:auto;padding:18px clamp(13px,4vw,28px);overscroll-behavior:contain}
.message{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:16px}
.message.mine{align-items:flex-end}
.meta{font-size:12px;margin:0 4px 4px}
.bubble{white-space:pre-wrap;overflow-wrap:anywhere;max-width:min(86%,410px);background:white;border:1px solid var(--line);border-radius:4px 14px 14px;padding:9px 12px;line-height:1.55}
.mine .bubble{background:#d8ebd7;border-color:#d8ebd7;border-radius:14px 4px 14px 14px}
.bubble img,.bubble video{display:block;max-width:100%;width:auto;max-height:310px;border-radius:5px}
.bubble video{width:320px;background:#15271f}
.bubble a{color:var(--green);font-size:.9rem}
.composer{background:#f1f5ed;border-top:1px solid var(--line);padding:10px clamp(10px,3vw,22px);padding-bottom:calc(10px + env(safe-area-inset-bottom))}
.compose-row{display:flex;align-items:center;gap:8px}
.attachment{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;position:relative;overflow:hidden;background:#e3ede0;color:var(--green);font-size:22px;flex:none}
.attachment input{opacity:0;position:absolute;inset:0;width:100%;height:100%;cursor:pointer}
input,textarea{border:1px solid #bdcdbd;border-radius:9px;background:white;color:inherit;padding:9px;min-width:0}
textarea{resize:vertical}
.compose-row textarea{flex:1;resize:none}
.notice,#login-error,#settings-status{color:#84401f;margin:4px 0 0;font-size:13px}
.notice:empty,.blank:empty{display:none}
.replies{display:flex;gap:6px;overflow-x:auto;margin-bottom:8px}
.replies:empty{display:none}
.replies button{max-width:200px;overflow:hidden;text-overflow:ellipsis;font-size:13px;padding:5px 8px}
.blank{font-size:14px;text-align:center}
.login,dialog form{display:grid;gap:12px}
.login{width:min(360px,calc(100% - 32px));margin:10vh auto 0}
dialog{width:min(580px,calc(100% - 24px));max-height:90vh;overflow:auto;border:1px solid var(--line);border-radius:16px;background:var(--paper);color:inherit;padding:20px}
.reply-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.reply-heading h3,.reply-heading h4{margin:0;font-size:15px}
#reply-count,.setting-help{font-size:13px;color:#4f695a}
.setting-help{margin:0;line-height:1.6}
.reply-list{display:grid;gap:12px}
.reply-editor{display:grid;gap:8px;border:1px solid var(--line);border-radius:12px;background:white;padding:12px}
.reply-editor label{font-size:13px}
.reply-editor .quiet{font-size:13px;padding:4px 9px}
dialog::backdrop{background:#172c2370}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px}
@media(max-width:640px){
  .workspace{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}
  .sidebar{border-right:0;border-bottom:1px solid var(--line);padding:8px}
  .sidebar h2{margin-bottom:5px}
  .rooms{display:flex;overflow-x:auto}
  .rooms button{flex:none}
}
