:root{--paper: 28 27 26;--bg: 245 243 239;--surface: 255 255 255;--ink: 28 27 26;--ink-soft: 110 106 100;--line: 228 224 217;--accent: 198 64 50;--me: 219 234 254;--them: 255 255 255;--radius: 14px;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:rgb(var(--bg));color:rgb(var(--ink))}button{font:inherit;cursor:pointer}.app{display:flex;flex-direction:column;height:100%}.topbar{display:flex;align-items:center;gap:12px;padding:10px 16px;background:rgb(var(--paper));color:rgb(var(--bg))}.topbar .brand{font-weight:700;letter-spacing:.2px}.topbar .spacer{flex:1}.topbar select,.topbar button{background:#ffffff1a;color:rgb(var(--bg));border:1px solid rgba(255,255,255,.18);border-radius:8px;padding:6px 10px}.topbar .me-pill{display:flex;align-items:center;gap:8px;font-size:14px}.layout{display:flex;flex:1;min-height:0}.sidebar{width:340px;min-width:280px;border-right:1px solid rgb(var(--line));display:flex;flex-direction:column;background:rgb(var(--surface))}.sidebar header{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid rgb(var(--line))}.sidebar header h2{font-size:16px;margin:0;flex:1}.sidebar .new-btn{background:rgb(var(--accent));color:#fff;border:0;border-radius:8px;padding:7px 12px;font-weight:600}.conv-list{overflow-y:auto;flex:1}.conv{display:flex;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid rgb(var(--line));width:100%;text-align:left;background:none;border-left:3px solid transparent}.conv:hover{background:rgb(var(--bg))}.conv.active{background:rgb(var(--bg));border-left-color:rgb(var(--accent))}.avatar{width:44px;height:44px;border-radius:50%;flex:none;background:rgb(var(--line));color:rgb(var(--ink));display:grid;place-items:center;font-weight:700;position:relative}.avatar .dot{position:absolute;right:0;bottom:0;width:11px;height:11px;border-radius:50%;border:2px solid white;background:#9aa0a6}.avatar .dot.online{background:#34a853}.conv .meta{min-width:0;flex:1}.conv .row1{display:flex;justify-content:space-between;gap:8px}.conv .title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv .time{color:rgb(var(--ink-soft));font-size:12px;flex:none}.conv .preview{color:rgb(var(--ink-soft));font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.badge{background:rgb(var(--accent));color:#fff;border-radius:999px;min-width:20px;height:20px;padding:0 6px;font-size:12px;display:grid;place-items:center}.thread{flex:1;display:flex;flex-direction:column;min-width:0;background:rgb(var(--bg))}.thread .empty{margin:auto;color:rgb(var(--ink-soft))}.thread header{display:flex;align-items:center;gap:12px;padding:12px 16px;background:rgb(var(--surface));border-bottom:1px solid rgb(var(--line))}.thread header .title{font-weight:600}.thread header .sub{font-size:12px;color:rgb(var(--ink-soft))}.back-only{display:none;background:none;border:0;font-size:24px;line-height:1;color:rgb(var(--ink));padding:0 4px}@media (max-width: 720px){.back-only{display:inline}}.messages{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:6px}.msg{max-width:min(72%,560px);padding:8px 12px;border-radius:var(--radius);background:rgb(var(--them));box-shadow:0 1px 1px #0000000f;align-self:flex-start;position:relative}.msg.mine{background:rgb(var(--me));align-self:flex-end}.msg .sender{font-size:12px;font-weight:700;color:rgb(var(--accent));margin-bottom:2px}.msg .text{white-space:pre-wrap;word-break:break-word;line-height:1.35}.msg .text b{font-weight:700}.msg .text i{font-style:italic}.msg .text code{background:#0000000f;padding:1px 4px;border-radius:4px;font-family:ui-monospace,monospace;font-size:.92em}.msg .stamp{font-size:11px;color:rgb(var(--ink-soft));text-align:right;margin-top:2px}.msg .stamp .tick{margin-left:4px}.msg.deleted .text{font-style:italic;color:rgb(var(--ink-soft))}.msg .reactions{display:flex;gap:4px;margin-top:4px;flex-wrap:wrap}.msg .reactions .chip{background:#0000000f;border:0;border-radius:999px;padding:1px 8px;font-size:12px}.msg .reactions .chip.mine-r{background:rgb(var(--accent));color:#fff}.msg .tools{position:absolute;top:-10px;right:6px;display:none;gap:2px;background:#fff;border:1px solid rgb(var(--line));border-radius:8px;padding:2px}.msg:hover .tools{display:flex}.msg .tools button{border:0;background:none;padding:2px 5px;border-radius:6px}.msg .tools button:hover{background:rgb(var(--bg))}.typing{font-size:12px;color:rgb(var(--ink-soft));padding:0 18px 6px;height:16px}.composer{display:flex;gap:8px;padding:12px 16px;background:rgb(var(--surface));border-top:1px solid rgb(var(--line));align-items:flex-end}.composer textarea{flex:1;resize:none;border:1px solid rgb(var(--line));border-radius:12px;padding:10px 12px;font:inherit;max-height:140px}.composer .fmt{display:flex;gap:2px}.composer .fmt button{border:1px solid rgb(var(--line));background:#fff;border-radius:8px;width:32px;height:32px}.composer .send{background:rgb(var(--accent));color:#fff;border:0;border-radius:12px;padding:0 18px;height:40px;font-weight:700}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:grid;place-items:center;z-index:50}.dialog{background:#fff;border-radius:16px;padding:22px;width:min(420px,92vw)}.dialog h3{margin:0 0 12px}.dialog input{width:100%;padding:10px 12px;border:1px solid rgb(var(--line));border-radius:10px;font:inherit;margin-bottom:12px}.dialog .actions{display:flex;justify-content:flex-end;gap:8px}.dialog .actions .primary{background:rgb(var(--accent));color:#fff;border:0;border-radius:10px;padding:9px 16px;font-weight:600}.dialog .actions .ghost{background:none;border:1px solid rgb(var(--line));border-radius:10px;padding:9px 16px}.center{margin:auto;display:grid;place-items:center;gap:14px;text-align:center;padding:40px}.center .big{background:rgb(var(--accent));color:#fff;border:0;border-radius:12px;padding:12px 22px;font-weight:700;font-size:16px}@media (max-width: 720px){.sidebar{width:100%}.layout.has-active .sidebar{display:none}.layout:not(.has-active) .thread{display:none}}.stories-strip{display:flex;gap:12px;padding:12px 14px;overflow-x:auto;border-bottom:1px solid rgb(var(--line))}.story-item{background:none;border:0;display:flex;flex-direction:column;align-items:center;gap:4px;flex:none;width:64px;cursor:pointer}.story-ring{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;font-weight:700;color:rgb(var(--ink));background:rgb(var(--line));position:relative}.story-ring.has{box-shadow:0 0 0 2px rgb(var(--surface)),0 0 0 4px rgb(var(--accent))}.story-ring.add{box-shadow:0 0 0 2px rgb(var(--surface)),0 0 0 4px rgb(var(--line))}.story-ring .plus{position:absolute;right:-2px;bottom:-2px;width:18px;height:18px;border-radius:50%;background:rgb(var(--accent));color:#fff;font-size:13px;line-height:1;display:grid;place-items:center;border:2px solid rgb(var(--surface))}.story-name{font-size:11px;color:rgb(var(--ink-soft));max-width:64px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.story-preview{border-radius:12px;min-height:120px;display:grid;place-items:center;color:#fff;text-align:center;padding:16px;margin-bottom:10px;white-space:pre-wrap;font-size:18px}.story-text{width:100%;border:1px solid rgb(var(--line));border-radius:10px;padding:8px;font:inherit;margin-bottom:10px;resize:none}.bg-row{display:flex;gap:8px;margin-bottom:14px}.bg-dot{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer}.bg-dot.sel{border-color:rgb(var(--ink))}.story-viewer{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000eb;z-index:60;display:flex;flex-direction:column}.sv-progress{display:flex;gap:4px;padding:10px}.sv-progress .seg{flex:1;height:3px;border-radius:2px;background:#ffffff4d}.sv-progress .seg.on{background:#fff}.sv-head{color:#fff;padding:4px 14px;font-weight:600}.sv-body{flex:1;display:grid;place-items:center;margin:8px;border-radius:16px;overflow:hidden;cursor:pointer}.sv-body img{max-width:100%;max-height:100%}.sv-text{color:#fff;font-size:26px;text-align:center;padding:24px;white-space:pre-wrap}.sv-close{position:absolute;top:10px;right:14px;background:none;border:0;color:#fff;font-size:22px;cursor:pointer}
