* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #e6ece9; color: #172c29; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid #258162; outline-offset: -2px; }
#app { height: 100vh; height: 100dvh; max-width: 660px; margin: auto; display: flex; flex-direction: column; background: #f4f7f5; }
header { display: flex; align-items: center; gap: 12px; padding: calc(15px + env(safe-area-inset-top)) 17px 10px; }
header img { width: 36px; height: 36px; border-radius: 11px; }
h1 { margin: 0; font-size: 22px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#back { font-size: 34px; line-height: 1; min-width: 36px; min-height: 40px; }
#status { margin: 0; padding: 0 20px 10px; color: #506a61; font-size: 13px; }
#search-bar { padding: 0 16px 13px; }
input, textarea { background: white; border: 1px solid #d4e0d8; border-radius: 12px; padding: 9px 11px; min-width: 0; }
#search { width: 100%; }
#pair { display: grid; gap: 12px; margin: 16px; background: white; padding: 18px; border-radius: 14px; }
main { overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.rows { background: white; border-block: 1px solid #dfe7e1; }
.row { display: flex; width: 100%; align-items: center; text-align: left; gap: 12px; padding: 0 17px; }
.row:active { background: #e9f4ee; }
.tile { background: #d9eee2; color: #24664e; font-weight: 650; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; flex: none; }
.row-body { flex: 1; min-width: 0; padding: 13px 0; border-bottom: 1px solid #e8eee9; }
.row:last-child .row-body { border: 0; }
.line { display: flex; align-items: baseline; gap: 8px; }
.line strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
time, .excerpt, .empty, .who { color: #61746a; }
time { font-size: 12px; }
.excerpt { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 14px 16px; text-align: center; }
.messages { padding: 10px 15px; }
.older { display: block; color: #246a52; min-height: 44px; margin: auto; }
.message { margin: 0 0 15px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mine { align-items: flex-end; }
.who { font-size: 12px; padding: 0 5px; }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 94%; padding: 10px 13px; background: white; border: 1px solid #dee7e1; border-radius: 4px 16px 16px; }
.mine .bubble { background: #cdebd9; border-color: #c2e1d0; border-radius: 16px 4px 16px 16px; }
.file { padding: 9px 12px; background: white; border: 1px solid #d9e4dc; border-radius: 11px; overflow-wrap: anywhere; text-align: left; }
#composer { background: #fafcfb; border-top: 1px solid #dbe5de; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 8px; }
#draft { flex: 1; resize: none; }
.primary { background: #216951; color: white; padding: 10px 14px; border-radius: 11px; text-decoration: none; }
.primary:disabled { opacity: .5; }
.preview { padding: 0 12px 12px; }
.preview-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; padding: 10px 0; background: #f4f7f5; }
.preview-page { margin: 0; text-align: center; }
.preview img { display: block; width: 100%; height: auto; object-fit: contain; border: 1px solid #d9e4dc; background: #fff; }
.slide-stream { display: grid; gap: 13px; padding-block: 8px; }
.slide-card { margin: 0; }
.slide-placeholder { display: grid; place-items: center; min-height: 150px; aspect-ratio: 16 / 9; background: #e6eee8; border: 1px solid #d9e4dc; }
.slide-placeholder-label, .slide-number { color: #526b61; font-size: 13px; }
.slide-number { text-align: center; padding-top: 4px; }
.bubble.formatted { white-space: normal; min-width: 0; }
.formatted p:first-child { margin-top: 0; }
.formatted p:last-child { margin-bottom: 0; }
.formatted pre, .formatted .katex-display { overflow-x: auto; overflow-y: hidden; padding-block: 3px; }
.formatted pre { background: #eef4f0; border-radius: 8px; padding: 10px; }
.formatted code { font-family: ui-monospace, Consolas, monospace; }
.formatted h1, .formatted h2, .formatted h3 { white-space: normal; }
.formatted table { display: block; overflow-x: auto; border-collapse: collapse; }
.formatted td, .formatted th { border: 1px solid #d8e6de; padding: 4px 8px; }
