header button{min-height:28px;padding:0 8px;border:0;background:transparent;font-size:19px}.brand{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:700}.brand small{font-size:11px;font-weight:400}.logo{background:var(--j-accent);color:white;border-radius:7px;width:24px;height:24px;display:grid;place-items:center;font-size:18px}#notice{padding:5px 12px;background:var(--j-lavender);font-size:12px;text-align:center}#notice:empty{display:none}#shell{display:grid;grid-template-columns:252px minmax(0,1fr);max-width:1120px;margin:auto;min-height:calc(100dvh - 64px);border-inline:1px solid var(--j-border)}aside{padding:12px 10px;border-right:1px solid var(--j-border);background:var(--j-soft)}.sectiontitle{height:36px;display:flex;align-items:center;justify-content:space-between;font-weight:700}#groups{display:grid;gap:8px}.groupcard{text-align:left;display:grid;gap:4px;padding:12px;min-height:72px}.groupcard.active small{color:#fff}.sidehint{font-size:12px;margin:16px 3px}main{min-width:0;display:flex;flex-direction:column;background:var(--j-surface)}.groupbar{display:flex;justify-content:space-between;align-items:center;padding:12px;gap:8px}.groupbar small{font-size:12px}.groupbar select{max-width:45%;display:none}nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--j-gap);padding:0 10px 9px;border-bottom:1px solid var(--j-border)}nav button{padding:7px 2px;background:var(--j-lavender)}#content{padding:12px;min-width:0;flex:1}.chat{display:flex;flex-direction:column;height:calc(100dvh - 190px);min-height:300px}.messages{flex:1;overflow:auto;display:flex;flex-direction:column;gap:13px;padding:8px 0}.msg{max-width:85%;align-self:flex-start}.msg.mine{align-self:flex-end}.msg .who{font-size:12px;color:var(--j-muted);margin:0 4px 3px}.bubble{border:1px solid var(--j-border);border-radius:var(--j-radius);background:var(--j-ivory);padding:9px 12px;white-space:pre-wrap;overflow-wrap:anywhere}.mine .bubble{background:var(--j-lavender)}.bubble img{display:block;max-width:100%;max-height:220px;border-radius:7px;cursor:pointer}.time{font-size:11px;color:var(--j-muted);text-align:right}.compose{display:grid;grid-template-columns:44px 1fr 62px;gap:5px;margin-top:8px}.compose input[type=text]{min-width:0}.compose button{padding:5px}.panel{background:var(--j-surface);border:1px solid var(--j-border);border-radius:var(--j-radius);padding:12px;margin-bottom:10px}.row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.accounthead{background:var(--j-ivory);padding:12px;border-radius:var(--j-radius);margin-bottom:10px}.accounthead select{max-width:100%}.summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px;margin:10px 0}.stat{padding:10px;background:var(--j-bg);border:1px solid var(--j-border);border-radius:var(--j-radius)}.stat strong{display:block;overflow-wrap:anywhere;font-size:17px}.ledger{display:grid;gap:8px}.entry{border:1px solid var(--j-border);border-radius:var(--j-radius);padding:10px;background:var(--j-surface)}.entry .amount{font-weight:700;white-space:nowrap}.income{color:var(--j-green)}.expense{color:var(--j-red)}.entry small{display:block}.entry button{min-height:32px;padding:4px 8px;font-size:13px}.entry img{width:56px;height:56px;object-fit:cover;border:3px solid var(--j-ivory);border-radius:var(--j-radius);cursor:pointer}.badge{font-size:12px;background:var(--j-lavender);border-radius:6px;padding:2px 6px}.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px}.gallery button{padding:3px;aspect-ratio:1;background:var(--j-ivory)}.gallery img{width:100%;height:100%;object-fit:cover;border-radius:7px}.photoView{max-width:100%;max-height:60dvh;object-fit:contain}.empty{text-align:center;color:var(--j-muted);padding:30px 10px}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);max-width:90vw;background:var(--j-header-ink);color:#fff;border-radius:10px;padding:10px 16px;z-index:100}#login{max-width:340px;margin:40px auto;padding:20px;display:grid;gap:12px}#login form{display:grid;gap:8px}#loginError{color:var(--j-red)}@media(max-width:640px){#shell{display:block;border:0}aside{display:none}.groupbar select{display:block}.groupbar{padding:9px 10px}#content{padding:9px}.chat{height:calc(100dvh - 160px);min-height:250px}.summary{grid-template-columns:repeat(2,minmax(0,1fr))}.stat strong{font-size:15px}.msg{max-width:90%}}
.chat-toolbar{padding-bottom:5px;border-bottom:1px solid var(--j-border)}.chat-toolbar button,.tiny{font-size:12px;min-height:30px;padding:3px 7px}.hidden-image{display:block;margin-top:5px;min-height:36px;background:var(--j-ivory)}.bubble img{min-height:28px;margin:5px 0}.account-actions{margin-bottom:9px}.account-actions button{padding:5px 1px;font-size:13px}.ledger-note{font-size:12px;margin:6px 0 10px}.form-error{color:var(--j-red);font-size:13px}.form-inner{padding:0}.currency{margin-top:8px}.currency .summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.currency .stat{padding:7px;font-size:12px}.currency .stat strong{font-size:15px}.gallery{margin-top:12px}.panel{margin-top:8px}
/* Viewport/keyboard safe: composer stays below a separately scrolling conversation. */
body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}header,#notice{flex-shrink:0}#shell{width:100%;flex:1;min-height:0;overflow:hidden;margin:0 auto}aside{min-height:0;overflow:auto}main{height:100%;min-height:0;overflow:hidden}.groupbar,nav{flex-shrink:0}#content{min-height:0;overflow:auto}.chat{height:100%;min-height:0}.messages{min-height:0}.compose,.chat-toolbar{flex-shrink:0}#login{overflow:auto}.bubble img{width:auto;height:auto;max-width:100%;max-height:220px}.stat strong{word-break:break-word}
header{background:var(--j-header);color:var(--j-header-ink)}header small{color:var(--j-header-ink)}header .logo{background:var(--j-surface);color:var(--j-accent)}aside{background:var(--j-soft)}.groupbar{background:var(--j-surface)}nav{grid-template-columns:repeat(5,minmax(0,1fr))}nav button{font-size:14px}.groupcard{background:var(--j-surface);border-color:var(--j-lavender-deep)}.groupcard.active{background:var(--j-accent)}.accounthead{background:var(--j-lavender)}.stat{background:var(--j-surface)}.chat-toolbar{justify-content:flex-start;gap:5px}.chat-toolbar small{margin-right:auto}.msg-actions{display:flex;gap:4px;justify-content:flex-end;flex-wrap:wrap;margin-top:3px}.msg-actions button{font-size:12px;padding:2px 6px;min-height:25px;background:var(--j-surface)}.msg-actions button.active{background:var(--j-accent)}.quote{background:var(--j-soft);border-left:3px solid var(--j-accent);border-radius:5px;padding:5px 8px;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}.pre{white-space:pre-wrap;overflow-wrap:anywhere}.unread{background:var(--j-red);color:white;border-radius:10px;padding:1px 7px;font-size:12px}.checkline{display:flex;align-items:center;gap:8px}.checkline input{width:auto}.account-actions button{background:var(--j-lavender)}details{padding:10px;border:1px solid var(--j-border);border-radius:var(--j-radius)}details p{font-size:13px;margin:5px 0}@media(max-width:420px){nav button{font-size:13px}.chat-toolbar button{font-size:11px;padding:3px 5px}.chat-toolbar small{font-size:11px}}

.login-modes{display:grid;grid-template-columns:1fr 1fr;gap:var(--j-gap)}.login-modes button{min-height:var(--j-title-height);padding:5px}.login-modes button:not(.active){background:var(--j-lavender)}
