:root{--bg:#f8fafc;--surface:#fff;--line:#e2e8f0;--text:#0f172a;--muted:#475569;--primary:#1e40af;--primary-h:#1e3a8a;--on-primary:#fff;--ok:#15803d;--ok-bg:#dcfce7;--wn:#b45309;--wn-bg:#fef3c7;--dg:#b91c1c;--dg-bg:#fee2e2;--un:#475569;--un-bg:#f1f5f9}@media (prefers-color-scheme:dark){:root{--bg:#020617;--surface:#0f172a;--line:#334155;--text:#e2e8f0;--muted:#94a3b8;--primary:#60a5fa;--primary-h:#93c5fd;--on-primary:#020617;--ok:#86efac;--ok-bg:#052e16;--wn:#fcd34d;--wn-bg:#451a03;--dg:#fca5a5;--dg-bg:#450a0a;--un:#cbd5e1;--un-bg:#1e293b}}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}a{color:var(--primary)}:focus-visible{outline:2px solid var(--primary);outline-offset:2px}h1{font-size:1.5rem;margin:0 0 .25rem}h2{font-size:1.125rem;margin:0 0 .5rem}.muted{color:var(--muted)}.shell{display:grid;grid-template-columns:220px 1fr;min-height:100vh}.side{background:var(--surface);border-right:1px solid var(--line);padding:1rem}.brand{font-weight:700;margin-bottom:1.5rem}.nav a{display:block;padding:.6rem .75rem;border-radius:8px;text-decoration:none;color:var(--text);min-height:44px}.nav a[aria-current=page]{background:var(--un-bg);font-weight:600}.main{flex-direction:column}.main,.top{display:flex}.top{justify-content:flex-end;align-items:center;gap:1rem;padding:.75rem 1.5rem;border-bottom:1px solid var(--line);background:var(--surface)}.page{padding:1.5rem;max-width:960px;width:100%}.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:1.25rem}.row{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 1.1rem;border-radius:8px;border:1px solid var(--primary);background:var(--primary);color:var(--on-primary);font:inherit;font-weight:600;cursor:pointer;text-decoration:none}.btn:hover{background:var(--primary-h)}.btn.ghost{background:transparent;color:var(--primary)}.btn.ghost:hover{background:var(--un-bg)}.btn:disabled{opacity:.6;cursor:not-allowed}label{display:block;font-weight:600;margin:.9rem 0 .25rem}input[type=email],input[type=password],input[type=text],textarea{width:100%;min-height:44px;padding:.55rem .75rem;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--text);font:inherit}.err{color:var(--dg);font-size:.9rem;margin-top:.25rem}.alert{padding:.75rem 1rem;border-radius:8px;margin:1rem 0;border:1px solid transparent}.alert.dg{background:var(--dg-bg);color:var(--dg)}.alert.wn{background:var(--wn-bg);color:var(--wn)}.alert.ok{background:var(--ok-bg);color:var(--ok)}.pill{display:inline-flex;gap:.35rem;align-items:center;padding:.1rem .6rem;border-radius:999px;font-size:.85rem;font-weight:600}.pill.ok{background:var(--ok-bg);color:var(--ok)}.pill.wn{background:var(--wn-bg);color:var(--wn)}.pill.dg{background:var(--dg-bg);color:var(--dg)}.pill.un{background:var(--un-bg);color:var(--un)}table{width:100%;border-collapse:collapse}td,th{text-align:left;padding:.7rem .5rem;border-bottom:1px solid var(--line)}th{color:var(--muted);font-weight:600;font-size:.85rem}.login{min-height:100vh;display:grid;place-items:center;padding:1rem}.login .card{width:100%;max-width:400px}.steps{display:flex;gap:.5rem;list-style:none;padding:0;margin:1rem 0;flex-wrap:wrap}.steps li{padding:.25rem .75rem;border-radius:999px;background:var(--un-bg);color:var(--muted);font-size:.85rem}.steps li[aria-current=step]{background:var(--primary);color:var(--on-primary);font-weight:600}.qr{display:grid;place-items:center;padding:1rem;background:#fff;border-radius:12px;width:-moz-fit-content;width:fit-content;margin:1rem 0}.qr img{width:280px;height:280px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}@media (prefers-reduced-motion:no-preference){.btn{transition:background-color .15s}}@media (max-width:720px){.shell{grid-template-columns:1fr}.side{border-right:0;border-bottom:1px solid var(--line)}}.page:has(.chatshell){max-width:none;padding:0}.chatshell{display:grid;grid-template-columns:minmax(280px,360px) 1fr;height:calc(100vh - 61px)}.chatlist{border-right:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;min-height:0}.chathead{padding:1rem 1rem .5rem;display:grid;grid-gap:.6rem;gap:.6rem}.chathead h1{margin:0}.search{width:100%;min-height:44px;padding:0 .75rem;border:1px solid var(--line);border-radius:8px;font:inherit;background:var(--bg);color:var(--text)}.chips{display:flex;gap:.4rem;flex-wrap:wrap}.chip{min-height:36px;padding:0 .8rem;border-radius:999px;border:1px solid var(--line);background:transparent;color:var(--text);font:inherit;font-size:.9rem;cursor:pointer}.chip[aria-pressed=true]{background:var(--primary);color:var(--on-primary);border-color:var(--primary);font-weight:600}.chatrows{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1 1}.chatrow{display:flex;gap:.75rem;padding:.7rem 1rem;text-decoration:none;color:var(--text);border-bottom:1px solid var(--line);min-height:64px}.chatrow:hover{background:var(--un-bg)}.chatrow[aria-current=page]{background:var(--un-bg);box-shadow:inset 3px 0 0 var(--primary)}.avatar{flex:none;width:40px;height:40px;border-radius:50%;background:var(--un-bg);color:var(--muted);display:grid;place-items:center;font-weight:700;font-size:.85rem;border:1px solid var(--line)}.chatmain{min-width:0;flex:1 1;display:grid;grid-gap:.1rem;gap:.1rem}.chattop{display:flex;justify-content:space-between;gap:.5rem;align-items:baseline}.chatname{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chattime{flex:none;font-size:.8rem;color:var(--muted);font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.chatprev{color:var(--muted);font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chatprev.deleted{font-style:italic;color:var(--dg)}.more{padding:.75rem;text-align:center;color:var(--muted);min-height:44px}.pad{padding:.75rem 1rem;margin:0}.thread{min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--bg)}.empty{margin:auto;text-align:center;padding:2rem}@media (max-width:760px){.chatshell{grid-template-columns:1fr}.thread{display:none}.chatshell:has(.thread .threadhead) .chatlist{display:none}.chatshell:has(.thread .threadhead) .thread{display:flex}}.navgroup{margin:1rem .75rem .25rem;font-size:.75rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.nav a.navsub{padding-left:1.25rem}.threadhead{display:flex;align-items:center;gap:.75rem;padding:.75rem 1.25rem;background:var(--surface);border-bottom:1px solid var(--line);min-height:72px}.threadhead h1{margin:0;font-size:1.125rem}.grow{flex:1 1;min-width:0}.subline{font-size:.85rem}.avatar.big{width:48px;height:48px}.back{display:none;min-width:44px;min-height:44px;place-items:center;text-decoration:none;font-size:1.25rem}.msgs{flex:1 1;overflow-y:auto;padding:1rem 1.25rem;min-height:0}.older{min-height:28px;font-size:.85rem}.center,.older{text-align:center}.dayrow{display:flex;justify-content:center;margin:1rem 0 .5rem;position:-webkit-sticky;position:sticky;top:0;z-index:1}.daychip{background:var(--un-bg);color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:.1rem .75rem;font-size:.8rem}.msg{display:flex;flex-direction:column;margin:.25rem 0}.msg.in{align-items:flex-start}.msg.out{align-items:flex-end}.bubble{max-width:min(560px,85%);padding:.5rem .75rem;border-radius:12px;background:var(--surface);border:1px solid var(--line);overflow-wrap:anywhere}.msg.in .bubble{border-top-left-radius:4px}.msg.out .bubble{border-top-right-radius:4px;background:var(--un-bg);border-color:var(--primary)}.msg.gone .bubble{border:1px dashed var(--dg);background:var(--dg-bg)}.who{font-size:.8rem;font-weight:600}.body{white-space:pre-wrap}.meta{display:flex;justify-content:flex-end;align-items:center;gap:.5rem;font-size:.75rem;color:var(--muted);font-feature-settings:"tnum";font-variant-numeric:tabular-nums;position:relative}.badge{display:inline-block;font-size:.75rem;font-weight:600;border-radius:6px;padding:0 .4rem;border:0}.badge.wn{background:var(--wn-bg);color:var(--wn);cursor:pointer;min-height:24px}.badge.dg{background:transparent;color:var(--dg);padding:0}.media{padding:.5rem .75rem;margin:.25rem 0}.media,.unsupported{background:var(--un-bg);color:var(--muted);border-radius:8px;font-size:.9rem}.unsupported{padding:.4rem .6rem}.reacts{display:flex;gap:.25rem;margin-top:.2rem}.react{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:0 .45rem;font-size:.85rem}.bubble{position:relative}.editwrap{position:static}.popover{position:absolute;bottom:calc(100% - .25rem);z-index:5;width:280px;text-align:left;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:.75rem;box-shadow:0 8px 24px rgba(0,0,0,.18);font-size:.9rem}.popover ol{list-style:none;margin:.5rem 0 0;padding:0;display:grid;grid-gap:.5rem;gap:.5rem}.readonly{padding:.75rem 1.25rem;background:var(--un-bg);color:var(--muted);border-top:1px solid var(--line);font-size:.9rem;min-height:48px}.msg.in .popover{left:0}.msg.out .popover{right:0}.popover{max-width:min(280px,90vw)}@media (max-width:760px){.back{display:grid}.shell:has(.threadhead) .side{display:none}.chatshell{height:calc(100dvh - 70px)}}