:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #232d25;
  background: #f7f5ed;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(740px, 100%); margin: auto; padding: 32px 18px 18px; }
header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: 2rem; letter-spacing: .08em; }
h2 { font-size: 1.12rem; }
header p, footer, #status, #count { color: #59675c; font-size: .88rem; }
header p { margin-top: 4px; }
.cup { display: grid; place-items: center; background: #e2eadb; border-radius: 18px; width: 58px; height: 58px; font-size: 1.65rem; }
.chat { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: min(670px, 72dvh); min-height: 340px; border: 1px solid #d6ddcf; border-radius: 20px; background: #fffefa; overflow: hidden; }
.bar, form { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; }
.bar > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.bar { background: #edf2e8; }
#status { padding: 10px 16px; border-bottom: 1px solid #e7eae2; }
#feed { margin: 0; padding: 10px 16px; list-style: none; overflow: auto; overscroll-behavior: contain; }
#feed li { padding: 9px 0; }
#feed small { display: block; color: #526456; margin-bottom: 3px; }
#feed p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
form { border-top: 1px solid #e7eae2; }
button, input { font: inherit; border-radius: 10px; min-height: 44px; }
button { cursor: pointer; border: 0; background: #31553b; color: white; padding: 8px 14px; white-space: nowrap; }
button:disabled { opacity: .55; cursor: default; }
input { flex: 1; min-width: 0; border: 1px solid #c7d0c3; background: #fff; padding: 8px 10px; }
:focus-visible { outline: 2px solid #346940; outline-offset: 2px; }
footer { padding: 12px 2px; line-height: 1.5; }
@media (max-width: 520px) {
  main { padding: 16px 10px 6px; }
  .chat { height: max(340px, calc(100dvh - 155px)); }
}
