/* Family chat, rethought around the family world. Layout + values from r4box-home chat.html,
   moved onto the frozen look (black page, deep panels, glow) and the shared density classes. */
body{display:block}
#app{display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden}
#app>header{flex:none;position:relative!important;inset:auto!important;background:#000;border-bottom:1px solid var(--line)}
.hbtn{all:unset;cursor:pointer;flex:none;min-width:34px;height:34px;padding:0 8px;box-sizing:border-box;display:grid;place-items:center;border-radius:99px;border:1px solid var(--line);background:#ffffff0a;font-size:14px;font-weight:700;white-space:nowrap}
.hbtn.on{color:var(--teal);border-color:#3DD6C655}
.hbtn.live{color:#062A26;background:var(--teal);border-color:var(--teal);animation:cglow 1.6s ease-in-out infinite}
@keyframes cglow{50%{box-shadow:0 0 0 6px #3DD6C633}}
/* the garden: everyone's tree, and what chat grew */
.garden{position:relative;flex:none;height:150px;border-bottom:1px solid var(--line);overflow:hidden}
.garden canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:pointer}
.garden .cap{position:absolute;z-index:2;left:10px;top:8px;font-size:11px;font-weight:700;color:var(--faint);pointer-events:none}
.garden .cap b{color:var(--violet)}
.garden .filt{position:absolute;z-index:3;right:8px;top:6px;all:unset;cursor:pointer;padding:4px 10px;border-radius:99px;background:#000c;border:1px solid var(--line);font-size:11.5px;font-weight:700;color:var(--ink)}
.dens-play .garden{height:200px}.dens-pilot .garden{height:112px}
/* pinned: the trip and its open polls */
.pins{flex:none;display:flex;gap:6px;overflow-x:auto;padding:8px 10px;border-bottom:1px solid var(--line);scrollbar-width:none;align-items:stretch}
.pins::-webkit-scrollbar{display:none}
.pins .vpick{flex:none}
.pin{all:unset;cursor:pointer;flex:none;display:flex;gap:8px;align-items:center;max-width:250px;padding:6px 10px 6px 6px;border-radius:12px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--glow)}
.pin .ri{flex:none;width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:#141130;font-size:15px}
.pin b{display:block;font-size:12.5px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pin small{display:block;font-size:10.5px;color:var(--teal);font-weight:700;white-space:nowrap}
.pin .bars{display:flex;gap:2px;margin-top:3px}.pin .bars i{height:4px;border-radius:2px;background:#B9A6FF55;min-width:4px}.pin .bars i.lead{background:var(--teal)}
.dens-play .pins{display:none}
/* the log */
#log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#msgs{display:flex;flex-direction:column;gap:2px;padding:10px 10px 14px}
.cday{align-self:center;margin:12px 0 6px;font:700 10.5px/1 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--faint)}
.msg{display:flex;gap:7px;align-items:flex-end;max-width:86%;margin-top:2px}
.msg.first{margin-top:9px}.msg.me{align-self:flex-end;flex-direction:row-reverse}
.av{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font:800 12px/1 var(--display);background:#141130;border:1px solid var(--line);overflow:hidden;color:var(--ink)}
.av img{width:100%;height:100%;object-fit:cover}.av.claude{background:#F5C5421f;border-color:#F5C54266;color:var(--gold);font-size:14px}
.msg:not(.last) .av{visibility:hidden}.msg.me .av{display:none}
.bub{position:relative;min-width:0;padding:7px 11px;border-radius:17px;background:var(--panel);border:1px solid var(--line);box-shadow:var(--glow);overflow-wrap:anywhere;cursor:pointer;font-size:15px;line-height:1.42}
.msg.me .bub{background:color-mix(in srgb,var(--teal) 13%,var(--panel));border-color:#3DD6C640}
.msg.claude .bub{background:color-mix(in srgb,var(--gold) 7%,var(--panel));border-color:#F5C54240}
.bub .who{display:block;font-size:11.5px;font-weight:800;color:var(--violet);margin-bottom:1px}.msg.claude .who{color:var(--gold)}
.bub .tx{white-space:pre-wrap}.bub .tx a{color:var(--teal)}.bub .tx .at{color:var(--gold);font-weight:700}.bub .tx mark{background:#F5C54240;color:inherit;border-radius:3px}
.bub .tm{display:block;text-align:right;font-size:10.5px;color:var(--faint);margin-top:1px}
.bub .meta{display:none;font:500 10px/1.3 ui-monospace,monospace;color:var(--faint);margin-top:3px}
.dens-dev .bub .meta{display:block}
.msg.flash .bub{animation:flash 1.4s ease-out}@keyframes flash{0%{box-shadow:0 0 0 3px var(--gold)}100%{box-shadow:var(--glow)}}
.ph{display:grid;place-items:center;width:min(240px,62vw);aspect-ratio:4/3;margin:2px 0 3px;border-radius:12px;background:repeating-linear-gradient(45deg,#ffffff06 0 10px,transparent 10px 20px),#08061A;border:1px dashed var(--line);color:var(--faint);font-size:12px;text-align:center;padding:10px}
/* refs */
.rcard,.rcall,.rstory{display:flex;gap:9px;align-items:center;margin:3px 0 2px;padding:7px;border-radius:12px;background:#0006;border:1px solid #ffffff1c;color:inherit;text-decoration:none;min-width:min(240px,62vw)}
.rcard .ri,.rstory .ri{flex:none;width:48px;height:48px;border-radius:9px;display:grid;place-items:center;background:#141130;font-size:22px}
.rcard small,.rstory small{display:block;color:var(--teal);font-weight:700;font-size:11px}
.rcard b,.rstory b{display:block;font-size:14px;line-height:1.3}
.rstory em{display:block;font-style:normal;font-size:12.5px;color:var(--muted);line-height:1.35;margin-top:2px}
.rstory small{color:var(--violet)}
.rcall .ri{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:#141130;font-size:18px}
.rcall.live .ri{background:#3DD6C626;box-shadow:0 0 0 1px #3DD6C688}
.rcall span:nth-child(2){flex:1;min-width:0}.rcall b{display:block;font-size:14px}.rcall small{display:block;color:var(--muted);font-size:11.5px}.rcall.live small{color:var(--teal);font-weight:700}
.rcall button{flex:none;all:unset;cursor:pointer;border-radius:99px;padding:7px 13px;background:var(--teal);color:#062A26;font-weight:800;font-size:13px}
.rpoll{margin:3px 0 2px;min-width:min(250px,64vw)}
.rpoll .q{font-weight:800;margin-bottom:3px}.rpoll .q small{display:block;color:var(--teal);font-size:11px;font-weight:700}
.rpoll .po{position:relative;display:flex;justify-content:space-between;gap:8px;width:100%;margin-top:5px;padding:8px 10px;border-radius:11px;border:1.5px solid #ffffff22;background:#0005;color:var(--ink);font:inherit;font-size:14px;text-align:left;cursor:pointer;overflow:hidden;isolation:isolate}
.rpoll .po i{position:absolute;inset:0 auto 0 0;z-index:-1;background:#B9A6FF33;transition:width .3s}
.rpoll .po.mine{border-color:var(--teal)}.rpoll .po.mine i{background:#3DD6C644}
.rpoll .po .pn{flex:none;color:var(--muted);font-size:12px;font-weight:700}
.rpoll .pf{display:flex;justify-content:space-between;gap:8px;margin-top:5px;font-size:11.5px;color:var(--faint)}.rpoll .pf a{color:var(--teal);text-decoration:none;font-weight:700}
.flower{all:unset;cursor:pointer;display:flex;align-items:center;gap:7px;margin-top:6px;padding:5px 9px 5px 6px;border-radius:99px;background:#B9A6FF14;border:1px solid #B9A6FF40;font-size:12px;font-weight:700;color:var(--violet)}
.flower i{width:16px;height:16px;border-radius:99px;display:grid;place-items:center;font-style:normal;background:#B9A6FF26;box-shadow:0 0 10px #B9A6FF88;font-size:11px}
/* reactions, threads */
.reacts{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.reacts button{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:99px;background:#ffffff0c;border:1px solid var(--line);font-size:12px;font-weight:700;color:var(--muted)}
.reacts button.mine{border-color:#3DD6C666;color:var(--teal);background:#3DD6C612}
.thr{all:unset;cursor:pointer;display:block;margin-top:4px;font-size:12px;font-weight:700;color:var(--teal)}
.inrep{display:block;margin:-1px 0 4px;padding-left:8px;border-left:2px solid var(--line);font-size:12px;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}
.acts{position:fixed;z-index:12;display:flex;gap:2px;align-items:center;padding:4px;border-radius:99px;background:#141130;border:1px solid var(--line);box-shadow:0 10px 24px #000c,var(--glow)}
.acts button{all:unset;cursor:pointer;min-width:34px;height:34px;display:grid;place-items:center;border-radius:99px;font-size:18px}
.acts button:hover{background:#ffffff12}.acts .t{font-size:12px;font-weight:700;padding:0 9px;color:var(--ink)}.acts .t.bad{color:var(--hot)}
.think{align-self:flex-start;color:var(--gold);font-size:13.5px;margin:8px 0 0 35px;animation:tp 1.4s ease-in-out infinite}@keyframes tp{50%{opacity:.45}}
@media (prefers-reduced-motion:reduce){.think,.hbtn.live,.msg.flash .bub{animation:none}}
.empty{margin:auto;text-align:center;color:var(--muted);padding:40px 0}.empty b{display:block;font:800 20px/1.2 var(--display);color:var(--ink);margin-bottom:6px}
/* composer */
.replying{display:flex;gap:8px;align-items:center;margin-bottom:7px;padding:5px 8px;border-radius:10px;background:var(--panel);border:1px solid var(--line);font-size:12.5px;color:var(--muted)}
.replying b{color:var(--violet)}.replying span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.replying button{all:unset;cursor:pointer;color:var(--faint);padding:0 4px}
.dens-play .bub{font-size:17px}
.dens-pilot .bub{font-size:14px;padding:6px 10px}.dens-pilot #msgs{padding:8px 8px 12px}.dens-pilot .msg.first{margin-top:6px}
/* dev strip */
.devs{display:none;flex:none;gap:10px;align-items:center;overflow-x:auto;padding:5px 10px;border-bottom:1px solid var(--line);font:500 10.5px/1 ui-monospace,monospace;color:var(--faint);white-space:nowrap;scrollbar-width:none}
.devs b{color:var(--ink)}.devs button{all:unset;cursor:pointer;color:var(--teal);padding:2px 0}
.dens-dev .devs{display:flex}
/* search */
.csearch{position:absolute;z-index:14;inset:0;display:flex;flex-direction:column;background:#000}
.csearch .bar{display:flex;gap:8px;align-items:center;padding:max(10px,env(safe-area-inset-top)) 10px 10px;border-bottom:1px solid var(--line)}
.csearch input{flex:1;min-width:0;min-height:42px;padding:0 14px;border-radius:12px;border:1.5px solid var(--line);background:var(--panel);font:400 16px var(--body);color:var(--ink);outline:none}
.csearch .bar button{all:unset;cursor:pointer;font-weight:700;color:var(--teal);font-size:14px;padding:0 4px}
.csearch .res{flex:1;overflow:auto;padding:8px 10px;display:grid;align-content:start;gap:6px}
.csearch .res button{all:unset;cursor:pointer;display:grid;gap:3px;padding:9px 11px;border-radius:12px;background:var(--panel);border:1px solid var(--line)}
.csearch .res small{font-size:11px;color:var(--faint);font-weight:700}.csearch .res span{font-size:14px;line-height:1.4}.csearch .res mark{background:#F5C54240;color:inherit;border-radius:3px}
.csearch .hintq{color:var(--faint);font-size:13px;padding:8px 2px}
/* thread page */
.thread .subb{display:flex;flex-direction:column;min-height:calc(100dvh - 60px)}
.thread .tlog{flex:1;display:flex;flex-direction:column;gap:2px;padding:10px}
.thread .troot{opacity:.95;padding-bottom:10px;margin-bottom:6px;border-bottom:1px solid var(--line)}
/* call */
#call{position:fixed;inset:0;z-index:40;display:flex;flex-direction:column;background:radial-gradient(700px 500px at 50% 30%,#141130,#000 70%)}
#call .stage{flex:1;min-height:0;display:grid;gap:6px;padding:max(8px,env(safe-area-inset-top)) 8px 8px;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));grid-auto-rows:minmax(0,1fr);position:relative}
#call .tile{position:relative;min-height:0;border-radius:18px;overflow:hidden;background:#08061A;border:1px solid var(--line);display:grid;place-items:center}
#call .tile .face{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font:800 32px/1 var(--display);color:var(--violet);box-shadow:0 0 0 1px #B9A6FF55,0 0 0 10px #B9A6FF12,0 0 0 22px #B9A6FF0a;overflow:hidden}
#call .tile .face img{width:100%;height:100%;object-fit:cover}
#call .tile .nm{position:absolute;left:10px;bottom:10px;padding:4px 10px;border-radius:99px;background:#000b;font-size:12.5px;font-weight:700}
#call .tile .st{position:absolute;top:10px;right:10px;font-size:12px;padding:3px 8px;border-radius:99px;background:#000b;color:var(--muted)}
#call .tile.wait .face{animation:tp 1.6s ease-in-out infinite}
#call .bar{flex:none;display:flex;justify-content:center;gap:14px;padding:12px 16px max(14px,env(safe-area-inset-bottom))}
#call .bar button{all:unset;cursor:pointer;width:54px;height:54px;border-radius:50%;border:1.5px solid #ffffff2a;background:#ffffff12;font-size:21px;display:grid;place-items:center}
#call .bar button[aria-pressed="true"]{background:#F3F1FF;color:#000}#call .bar .end{background:var(--hot);border-color:var(--hot);width:66px}
dialog.cdlg{border:1px solid var(--line);border-radius:18px;background:#141130;color:var(--ink);padding:16px;width:min(340px,calc(100% - 32px));box-shadow:var(--glow)}
dialog.cdlg::backdrop{background:#000c}
dialog.cdlg .picks{display:grid;gap:7px;margin-top:10px}
dialog.cdlg .picks button{all:unset;cursor:pointer;display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:13px;border:1.5px solid #ffffff22;background:#ffffff0a;font-weight:700}
dialog.cdlg .row{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}
dialog.cdlg .row button{all:unset;cursor:pointer;padding:8px 14px;border-radius:12px;border:1.5px solid #ffffff22;background:#ffffff0e;font-weight:700}
dialog.cdlg .row .bad{background:#4A2230;border-color:transparent}
.ctoast{position:fixed;left:50%;bottom:calc(120px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;max-width:calc(100% - 32px);padding:9px 14px;border-radius:14px;background:#141130;border:1px solid var(--line);box-shadow:0 10px 24px #000c;font-size:13.5px}
.settingsp .subb{padding:12px}

/* the viewing-as bar is a row under the composer on this page */

#msgs{padding-bottom:22px}

/* ---- condensed ---- */
.hbtn{min-width:30px;height:30px;padding:0 7px;font-size:13px}
#app>header{padding-top:max(6px,env(safe-area-inset-top));padding-bottom:6px;gap:6px}
.garden{height:96px}.dens-pilot .garden{height:76px}
.garden .cap{top:5px;left:8px;font-size:10.5px}
.pins{padding:5px 8px;gap:5px}.pin{padding:3px 8px 3px 3px;border-radius:10px}.pin .ri{width:24px;height:24px;font-size:12px;border-radius:6px}.pin b{font-size:11.5px}.pin small{font-size:10px}
#msgs{padding:4px 8px 18px;gap:1px}
.cday{margin:7px 0 3px;font-size:9.5px}
.msg{gap:5px;max-width:88%;margin-top:1px}.msg.first{margin-top:5px}
.av{width:22px;height:22px;font-size:10px}.av.claude{font-size:11px}
.bub{padding:4px 9px 5px;border-radius:13px;font-size:14px;line-height:1.36}
.bub .who{font-size:10.5px;margin-bottom:0}.bub .tm{font-size:9.5px;margin-top:0}
.reacts{margin-top:2px;gap:3px}.reacts button{padding:1px 6px;font-size:11px}
.thr{margin-top:2px;font-size:11px}
.flower{margin-top:4px;padding:3px 8px 3px 4px;font-size:11px}.flower i{width:14px;height:14px;font-size:9px}

/* big preview (first time) and thumbnail (after) */
.big{margin:2px 0}.phimg{display:block;max-width:min(260px,100%);max-height:300px;border-radius:12px}
.shrink{all:unset;cursor:pointer;float:right;margin:0 0 0 8px;font-size:10.5px;font-weight:700;color:var(--faint)}
.vid{all:unset;cursor:pointer;position:relative;display:grid;place-items:center;width:min(260px,64vw);aspect-ratio:16/9;border-radius:12px;background:radial-gradient(120% 90% at 30% 20%,#141130,#08061A 70%);border:1px solid var(--line);box-sizing:border-box}
.vid .pl{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#000a;border:1px solid #fff3;font-size:16px;padding-left:3px;box-sizing:border-box}
.vid .t{position:absolute;left:9px;bottom:7px;font-size:11.5px;font-weight:700;max-width:70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vid .d{position:absolute;right:8px;bottom:6px;font:600 10.5px/1 ui-monospace,monospace;padding:3px 6px;border-radius:6px;background:#000b}
.mini{all:unset;cursor:pointer;box-sizing:border-box;display:flex;gap:7px;align-items:center;margin:2px 0 1px;padding:3px 7px 3px 3px;border-radius:9px;background:#0006;border:1px solid #ffffff1c;max-width:250px}
.mini .th{flex:none;width:30px;height:30px;border-radius:6px;display:grid;place-items:center;background:#141130;font-size:14px;overflow:hidden}.mini .th img{width:100%;height:100%;object-fit:cover}
.mini .ml{min-width:0;flex:1}.mini b{display:block;font-size:12px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini small{display:block;font-size:10px;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini .ex{flex:none;color:var(--faint);font-size:11px}
.mini.wide{display:flex;max-width:none;width:100%;padding:6px 10px 6px 6px;border-radius:12px;background:var(--panel);border-color:var(--line);box-shadow:var(--glow)}.mini.wide .th{width:40px;height:40px;font-size:18px;border-radius:8px}.mini.wide b{font-size:13.5px}.mini.wide small{font-size:11px}
.mtabs{position:sticky;top:0;z-index:1;display:flex;gap:5px;overflow-x:auto;padding:8px 10px;border-bottom:1px solid var(--line);background:#000;scrollbar-width:none}
.mtabs button{all:unset;cursor:pointer;flex:none;padding:5px 11px;border-radius:99px;border:1px solid var(--line);font-size:12px;font-weight:700;color:var(--muted)}.mtabs button.on{background:#ffffff16;color:var(--ink);border-color:var(--muted)}.mtabs small{color:var(--faint);font-weight:600}
.mgrid{display:grid;gap:6px;padding:8px 10px 20px}
.mediap .hintq{color:var(--faint);font-size:13px}
/* Play keeps it big and friendly */
.dens-play .garden{height:160px}.dens-play .bub{font-size:16.5px;padding:7px 12px}.dens-play .av{width:28px;height:28px;font-size:12px}

.csearch .mtabs{position:static}.csearch .res .mini.wide{display:flex}
#log{position:relative}.reacts button{white-space:nowrap;flex:none}
.msg:not(.claude) .av{cursor:pointer}.msg.last:not(.claude) .av:hover{box-shadow:0 0 0 2px var(--violet)}
#gfilt{all:unset;cursor:pointer;flex:none;align-self:center;margin:6px auto 0;padding:4px 11px;border-radius:99px;background:#B9A6FF14;border:1px solid #B9A6FF55;font-size:11.5px;font-weight:600;color:var(--muted)}#gfilt b{color:var(--violet)}#gfilt[hidden]{display:none}

/* ---- condensed, level 2 ---- */
#msgs{padding:2px 6px 14px;gap:0}
.cday{margin:5px 0 2px;font-size:9px;letter-spacing:.1em}
.msg{gap:4px;max-width:90%;margin-top:1px}.msg.first{margin-top:3px}
.av{width:18px;height:18px;font-size:9px;border-width:1px}.av.claude{font-size:9px}
.bub{padding:3px 8px 4px;border-radius:11px;font-size:13px;line-height:1.32;box-shadow:none}
.msg.last .bub{box-shadow:var(--glow)}
.bub .who{font-size:10px;line-height:1.2}
.bub .tm{display:inline;float:right;margin:3px 0 0 8px;font-size:9px;line-height:1.2}
.msg.claude .bub .tx{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.msg.claude.full .bub .tx{display:inline;-webkit-line-clamp:unset}
.more{all:unset;cursor:pointer;display:block;font-size:10.5px;font-weight:700;color:var(--gold);margin-top:1px}
.reacts{margin-top:1px}.reacts button{padding:0 5px;font-size:10.5px;line-height:1.5}
.thr{margin-top:1px;font-size:10.5px}
.flower{margin-top:2px;padding:2px 7px 2px 3px;font-size:10.5px;gap:5px}.flower i{width:12px;height:12px;font-size:8px}
.mini{margin:1px 0;padding:2px 6px 2px 2px;gap:6px;border-radius:8px}.mini .th{width:24px;height:24px;font-size:12px;border-radius:5px}.mini b{font-size:11.5px}.mini small{font-size:9.5px}
.pins{padding:4px 6px}.pin .ri{width:20px;height:20px;font-size:11px}.pin b{font-size:11px}.pin small{font-size:9.5px}
.dens-play .bub{font-size:16px;padding:6px 11px}.dens-play .av{width:26px;height:26px}.dens-play .msg.claude .bub .tx{display:inline;-webkit-line-clamp:unset}
/* avatars: bigger, photo inset in the ring */
.av{width:30px;height:30px;font-size:12px}.av img{width:26px;height:26px;border-radius:50%}.av.claude{font-size:13px}
.dens-play .av{width:32px;height:32px}.dens-play .av img{width:28px;height:28px}
/* Claude's answers: a wider bubble so the 3-line preview says more */
.msg.claude{max-width:94%}.msg.claude .bub{width:min(385px,calc(100vw - 56px));box-sizing:border-box}.msg.claude .bub .tx{font-size:13px}
.dens-play .msg.claude .bub{width:auto}
/* condensed attachment beside its bubble */
.msg>.mini.side{flex:none;align-self:flex-end;font-size:14px;max-width:170px;margin:0 0 1px}
/* use the width, save the height: name, words, reactions and replies share lines */
.msg{max-width:96%}
.msg:not(.claude) .bub .who{display:inline;margin-right:5px}
.msg:not(.claude) .bub .tx{display:inline}
.bub .reacts{display:inline-flex;vertical-align:middle;margin:0 0 0 6px}
.bub .thr{display:inline;margin-left:6px}
.bub.slim{padding:3px 8px}.bub.slim .who{margin-right:0}
.msg>.mini.side{max-width:210px}
.msg.me>.mini.side{margin-right:2px}
.msg>.mini.alone{background:var(--panel);border-color:var(--line);box-shadow:var(--glow)}
/* each person's bubbles glow in their colour (same as their dot in the family world) */
.p-dad_commander{--gc:#F5C542}.p-obanai_rocks{--gc:#3DD6C6}.p-phoenix_lord{--gc:#FF5A4A}.p-claude{--gc:#FFE08A}
.msg[class*="p-"] .bub{box-shadow:0 0 0 1px color-mix(in srgb,var(--gc) 14%,transparent),0 0 18px -6px color-mix(in srgb,var(--gc) 55%,transparent)}
.msg[class*="p-"]:not(.last) .bub{box-shadow:0 0 0 1px color-mix(in srgb,var(--gc) 10%,transparent)}
.msg[class*="p-"]:not(.me):not(.claude) .bub{border-color:color-mix(in srgb,var(--gc) 22%,var(--line))}
.msg>.mini.side:not(.alone){align-self:center}
/* the time sits under the avatar (your own messages keep it in the bubble) */
.avc{flex:none;display:flex;flex-direction:column;align-items:center;gap:1px;align-self:flex-end}
.avc .tm{float:none;display:block;margin:0;font:500 9px/1.1 Sora,system-ui,sans-serif;color:var(--faint);white-space:nowrap}
.msg.me .avc{display:none}
/* attachments: a "tray" chip, not a bubble — dark well, dashed edge in the sender's colour, square corners, no glow */
.mini.side,.att .mini{all:unset;cursor:pointer;box-sizing:border-box;display:flex;align-items:center;gap:7px;width:auto;min-width:150px;max-width:220px;height:34px;padding:3px 9px 3px 3px;border-radius:7px;background:#08061A;border:1px dashed color-mix(in srgb,var(--gc,#B9A6FF) 45%,transparent);box-shadow:none}
.mini.side .th,.att .mini .th{width:26px;height:26px;border-radius:5px;font-size:13px;background:color-mix(in srgb,var(--gc,#B9A6FF) 16%,#000)}
.mini.side .ml,.att .mini .ml{min-width:0;flex:1}
.mini.side b,.att .mini b{font-size:11.5px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini.side small,.att .mini small{font:500 9.5px/1.2 ui-monospace,monospace;letter-spacing:.02em;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini.side .ex,.att .mini .ex{flex:none;color:color-mix(in srgb,var(--gc,#B9A6FF) 70%,#fff);font-size:10px}
.mini.side:hover,.att .mini:hover{border-style:solid;background:#0D0B1F}
.msg>.mini.side{align-self:center;margin:0 0 0 2px}.msg.me>.mini.side{margin:0 2px 0 0}
/* an attachment with no words: the tray chip on its own, reactions and replies under it */
.att{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.msg.me .att{align-items:flex-end}
.att .reacts{margin:0}.att .thr{margin:0}
/* breathing room between people, tight within one person's run */
#msgs>.msg.first{margin-top:11px}#msgs>.cday+.msg.first{margin-top:4px}.thread .tlog>.msg.first{margin-top:11px}
.dens-play #msgs>.msg.first{margin-top:14px}
.shrinkg{all:unset;cursor:pointer;flex:none;align-self:center;width:24px;height:24px;margin:0 2px;display:grid;place-items:center;border-radius:7px;border:1px solid var(--line);background:#08061A;color:var(--faint);font-size:12px}
.shrinkg:hover{color:var(--ink);border-color:color-mix(in srgb,var(--gc,#B9A6FF) 50%,var(--line))}
/* pinned trip + polls live behind 📌 in the header */
#app{position:relative}
.pins{display:none;position:absolute;z-index:15;top:46px;right:8px;flex-direction:column;align-items:stretch;gap:6px;width:min(300px,calc(100% - 16px));padding:8px;border:1px solid var(--line);border-radius:14px;background:#000;box-shadow:0 14px 30px #000e,var(--glow);overflow:visible}
.pins.open{display:flex}.pins .pin{max-width:none}
.dens-play .pins.open{display:flex}
.hbtn{position:relative}.hbtn .badge{position:absolute;top:-3px;right:-3px;min-width:14px;height:14px;padding:0 3px;box-sizing:border-box;border-radius:99px;background:var(--hot);color:#fff;font:800 9px/14px var(--body);font-style:normal;text-align:center}
/* developer strip: stat cells + tool chips */
.dens-dev .devs{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:6px 8px;background:#05040C;overflow:visible;white-space:normal}
.dstats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}
.dstats .dc{display:grid;justify-items:center;gap:1px;padding:4px 2px;border-radius:6px;background:#0D0B1F;border:1px solid var(--line)}
.dstats b{font:700 12.5px/1 ui-monospace,monospace;color:var(--ink)}.dstats small{font:600 8px/1 var(--body);letter-spacing:.08em;text-transform:uppercase;color:var(--faint)}
.dacts{display:grid;gap:3px}
.dacts button{all:unset;cursor:pointer;padding:3px 7px;border-radius:5px;border:1px solid var(--line);font:600 9.5px/1.2 ui-monospace,monospace;color:var(--teal);white-space:nowrap;text-align:left}
.dacts button:hover{background:#3DD6C612;border-color:#3DD6C655}
/* make each view visibly its own in chat: Explore roomy, Pilot tight (the base), Developer tight + tools */
.dens-explore .bub{font-size:15px;line-height:1.42;padding:6px 11px 7px;border-radius:15px}
.dens-explore #msgs{padding:6px 10px 18px;gap:2px}.dens-explore #msgs>.msg.first{margin-top:15px}
.dens-explore .msg.claude .bub .tx{-webkit-line-clamp:5}.dens-explore .msg.claude .bub{width:min(420px,calc(100vw - 56px))}
.dens-explore .mini.side,.dens-explore .att .mini{height:40px;max-width:240px}.dens-explore .mini.side b,.dens-explore .att .mini b{font-size:12.5px}
.dens-dev .avc .tm,.dens-dev .bub .tm{font-family:ui-monospace,monospace;letter-spacing:-.02em}

#msgs{padding-left:max(6px,env(safe-area-inset-left));padding-right:max(6px,env(safe-area-inset-right))}
/* a trip thrown into the chat, and its conversation */
button.rtrip{font:inherit;text-align:left;cursor:pointer;width:100%}
.rtrip em{display:block;font-style:normal;color:var(--muted);font-size:12px;margin-top:2px}
.tripban{margin:4px 0 14px;padding:14px;border-radius:16px;background:linear-gradient(160deg,#F5C54222,#141130 60%);border:1px solid #F5C54255}
.tripban small{display:block;color:var(--gold,#F5C542);font-weight:800;font-size:11px;letter-spacing:.12em;text-transform:uppercase}
.tripban>b{display:block;font-size:20px;margin:4px 0 2px}
.tripban>span{display:block;color:var(--muted);font-size:13px;margin-bottom:8px}
.tripban .rpoll{margin-top:8px}
.tbacts{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline;margin-top:8px;font-size:12px;color:var(--faint,#7A73A8)}
.tbacts a{color:var(--teal);font-weight:700;text-decoration:none}

/* The chat fills exactly the screen it has. Phones sometimes report a stale height when the app
   opens (the bottom went under the system bar until the phone was turned); the page measures the
   real one (--app-h) whenever it can change, and the composer keeps clear of the system bar. */
#app{position:fixed;top:0;left:0;right:0;margin:0 auto;height:var(--app-h,100dvh)}

/* ---- Family and Personal redesign (design system box-nav, fp-family): one header, a pinned row, one + ----
   Comes last on purpose: it wins over the density layers above for the header, pins and composer. */
.li{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#app>header.fh{display:flex;align-items:center;gap:8px;padding:max(8px,env(safe-area-inset-top)) 10px 8px;border-top:3px solid var(--violet)}
header.fh .back{all:unset;cursor:pointer;flex:none;width:44px;height:44px;display:grid;place-items:center;border-radius:12px;color:var(--ink);font-size:inherit}
header.fh .back:hover{background:#ffffff0d}
header.fh .ft{display:flex;flex-direction:column;gap:1px;min-width:0}
header.fh .fsp{display:flex;align-items:center;gap:6px;font:700 11px/1.2 var(--body);color:var(--violet)}
header.fh .fsp i{width:8px;height:8px;border-radius:2px;background:var(--violet)}
header.fh h1{margin:0;font:700 17px/1.2 var(--display);letter-spacing:-.01em}
.hbtn.hx{min-width:44px;height:44px;padding:0 12px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font:700 13px/1 var(--body);color:var(--ink)}
.hbtn.hx .li{width:18px;height:18px}
#callbtn.live{border-color:var(--teal);color:var(--teal)}
@media (max-width:400px){#srch span{display:none}#srch{padding:0}}
.pinrow{position:relative;flex:none;display:flex;gap:8px;align-items:center;padding:6px 10px;border-bottom:1px solid var(--line)}
#pinsbtn{all:unset;cursor:pointer;box-sizing:border-box;position:relative;flex:1;min-width:0;display:flex;align-items:center;gap:8px;min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);font:500 13px var(--body);color:var(--muted)}
#pinsbtn b{color:var(--ink);font-weight:700}
#pinsbtn span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#pinsbtn .li{width:16px;height:16px;color:var(--violet)}
#pinsbtn[aria-expanded="true"]{border-color:var(--violet)}
#pinsbtn .badge{position:static;margin-left:auto}
.pinrow .pins{top:calc(100% + 2px);left:10px;right:auto}
.hbtn.hx:focus-visible,#pinsbtn:focus-visible,header.fh .back:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
@media (min-width:1000px){html.r4nav-side #app{left:var(--r4nav-w)}}
/* on a computer: the chat uses the width, and a thread opens beside it instead of over it */
@media (min-width:1100px){
  #app{max-width:900px!important}
  .subpage.thread{left:auto;right:0;transform:none;width:420px;max-width:420px;border-left:1px solid var(--line);animation:none}
  body:has(.subpage.thread) #app{right:420px;max-width:none!important}
}

/* the time on your own bubble reads against its tint */
[data-b] > .tm{color:#D9D4F5}


/* ---- the composer (Studio board r4box-home/family-composer v1): the os card, adapted ----
   One card: a growing box with a round Send, one toolbar (Photo, mic, Trip and Pickup on a computer, the @claude chip, +).
   @claude lights up gold, and asking Claude gives the card a gold edge and a line saying who answers. Sizes follow the density. */
.comp{--tb:34px;--go:38px;--rad:18px;--fs:15px;--tfs:12px;--line2:#332B60;flex:none;position:relative;padding:6px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));background:#000}
.dens-play .comp{--tb:44px;--go:48px;--rad:22px;--fs:18px;--tfs:14px}
.dens-explore .comp{--tb:38px;--go:42px;--rad:20px;--fs:16px;--tfs:13px}
.subpage.thread .comp{--tb:30px;--go:34px;--rad:16px;--fs:14px}
.ccard{position:relative;display:block;border-radius:var(--rad);border:1px solid var(--line2);background:var(--panel);transition:border-color .15s,box-shadow .15s}
.ccard:focus-within{border-color:#4A3F86}
.ccard.ask{border-color:#F5C54299;box-shadow:0 0 0 3px #F5C54214}
.cpre{padding:6px 10px 0}
.cpre:not(:has(>:not([hidden]))){display:none}
.quick{display:none;gap:6px}
.dens-play .quick:not([hidden]){display:flex}
.quick button{all:unset;cursor:pointer;flex:1;height:40px;display:grid;place-items:center;border-radius:12px;background:#ffffff0a;font-size:22px}
.preview{position:relative;display:inline-flex;align-items:flex-end;gap:10px;margin:0}
.preview .im{width:68px;height:68px;border-radius:12px;border:1px solid var(--line2);background-size:cover;background-position:center}
.dens-play .preview .im{width:96px;height:96px}
.preview .x{all:unset;cursor:pointer;position:absolute;top:4px;left:48px;width:22px;height:22px;border-radius:50%;background:#000c;display:grid;place-items:center;color:#fff}
.dens-play .preview .x{left:70px;width:26px;height:26px}
.preview .x .li{width:12px;height:12px;stroke-width:2.4}
.preview small{font-size:11.5px;color:var(--faint);padding-bottom:2px}
.cl{display:flex;align-items:center;gap:7px;min-height:28px;font-size:12.5px;color:var(--muted)}
.cl .sp2{color:var(--gold);font-weight:800}
.cl b{color:var(--gold);font-weight:700}
.mhint{display:flex;align-items:center;gap:7px;min-height:28px;font-size:12.5px;color:var(--muted)}
.mhint i{width:8px;height:8px;border-radius:50%;background:var(--hot);animation:cbeat 1.2s infinite}
@keyframes cbeat{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.mhint i,.ct.rec{animation:none}}
.cin{display:flex;align-items:flex-end;gap:6px;padding:2px 6px 0 13px}
.boxw{flex:1;min-width:0;position:relative}
#text,#ttext,.hl{font:400 var(--fs)/1.45 var(--body);padding:9px 0 7px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.boxw textarea{position:relative;z-index:1;display:block;width:100%;box-sizing:border-box;resize:none;border:0!important;outline:0;background:transparent!important;border-radius:0!important;color:transparent;caret-color:var(--ink);max-height:130px;min-height:40px}
.boxw textarea::placeholder{color:var(--faint)}
.boxw textarea::selection{background:#4A3F8699;color:transparent}
.hl{position:absolute;inset:0;color:var(--ink);pointer-events:none;overflow:hidden}
.hl .at{color:var(--gold);font-weight:700}
@supports (-webkit-touch-callout:none){#text,#ttext,.hl{font-size:max(16px,var(--fs))}}
.go{all:unset;cursor:pointer;flex:none;box-sizing:border-box;width:var(--go);height:var(--go);margin-bottom:3px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:var(--teal);color:#062A26;position:relative;transition:opacity .15s;font:800 16px/1 var(--body)}
.go .li{stroke-width:2.3}
.go .gl{display:none}
.dens-play .go{width:auto;padding:0 18px 0 14px;border-radius:99px}
.dens-play .go .gl{display:inline}
.go.off{opacity:.35;cursor:default}
.go::after{content:"";position:absolute;inset:-4px}
.go:disabled{opacity:.5;cursor:default}
.ctb{display:flex;align-items:center;gap:2px;padding:2px 5px 5px}
.ctb .fl{flex:1}
.ctb .sep{width:1px;height:18px;background:var(--line2);margin:0 4px;flex:none}
.ct{all:unset;cursor:pointer;box-sizing:border-box;flex:none;height:var(--tb);min-width:var(--tb);padding:0 8px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font:600 var(--tfs)/1 var(--body);color:var(--muted);position:relative;white-space:nowrap}
.ct::after{content:"";position:absolute;inset:-5px -1px}
.ct:hover{background:#ffffff0a;color:var(--ink)}
.ct[hidden]{display:none}
.ct.icn{padding:0}
.ct .li{width:18px;height:18px}
.dens-play .ct .li{width:21px;height:21px}
.ct .w2{display:none}
.dens-play .ct .w2{display:inline;font-weight:700}
.ct.rec{background:var(--hot);color:#fff;animation:cbeat 1.4s infinite}
.ct.on{background:#ffffff10;color:var(--ink)}
.ct.claude{color:var(--gold);border:1px solid #F5C54255;height:calc(var(--tb) - 4px);border-radius:99px;padding:0 10px;font-weight:700}
.ct.claude.on{background:var(--gold);color:var(--gold-ink,#2A2100);border-color:var(--gold)}
.ct.claude small{font:700 10.5px/1 var(--body);padding:3px 6px;border-radius:99px;background:#F5C54222;color:var(--gold)}
.ct.claude.on small{background:#0002;color:var(--gold-ink,#2A2100)}
.ct.claude.none{opacity:.5}
.wide{display:none!important}
.ct:focus-visible,.go:focus-visible,.quick button:focus-visible,#csheet button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
/* @ suggestions as you type */
#ment{position:absolute;left:8px;right:8px;bottom:calc(100% - 2px);z-index:5;border-radius:14px;border:1px solid var(--line2);background:var(--panel-2,#141130);box-shadow:0 -12px 30px #000a;overflow:hidden}
#ment[hidden]{display:none}
#ment h4{margin:8px 12px 4px;font:800 10px/1 var(--body);letter-spacing:.12em;text-transform:uppercase;color:var(--faint)}
#ment button{all:unset;cursor:pointer;box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:6px 12px;border-top:1px solid var(--line)}
#ment button:hover,#ment button.on{background:#ffffff08}
#ment .mav{width:28px;height:28px;flex:none;border-radius:50%;display:grid;place-items:center;font:800 11px/1 var(--display);background:var(--panel-2,#141130);border:1px solid var(--line)}
#ment b{font-size:13.5px}
#ment .d{flex:1;font-size:12px;color:var(--faint)}
#ment small{font:700 11px var(--body);color:var(--gold)}
/* +: a short sheet from below on a phone, a small panel over the card on a computer */
#cback{position:fixed;inset:0;z-index:40;background:#0009;opacity:0;pointer-events:none;transition:opacity .2s}
#csheet{position:fixed;left:0;right:0;bottom:0;z-index:41;background:#0E0B24;border:1px solid var(--line2);border-bottom:0;border-radius:20px 20px 0 0;box-shadow:0 -12px 40px #000a;transform:translateY(105%);visibility:hidden;transition:transform .25s cubic-bezier(.2,.8,.2,1);padding:0 12px max(14px,env(safe-area-inset-bottom))}
body.csheet #cback{opacity:1;pointer-events:auto}
body.csheet #csheet{transform:none;visibility:visible}
#csheet .grab{display:block;width:34px;height:4px;border-radius:4px;background:#ffffff26;margin:8px auto 8px}
#csheet .sh2{display:flex;align-items:center;gap:8px;padding:0 0 10px 4px}
#csheet .sh2 b{flex:1;font:800 15px/1.2 var(--display)}
#csheet .x2{all:unset;cursor:pointer;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#ffffff10;color:var(--muted)}
.crows{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel)}
.crows>button{all:unset;cursor:pointer;box-sizing:border-box;display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:6px 12px;border-top:1px solid var(--line)}
.crows>:first-child{border-top:0}
.crows>button:hover{background:#ffffff06}
.crows .ri{width:34px;height:34px;flex:none;border-radius:9px;display:grid;place-items:center;background:var(--panel-2,#141130);color:var(--muted)}
.crows div{flex:1;min-width:0}
.crows b{display:block;font-size:14px;font-weight:650}
.crows small{display:block;font-size:12px;color:var(--faint);margin-top:1px}
.dens-play .crows b{font-size:16px}.dens-play .crows>button{min-height:60px}
@media (max-width:374px){.dens-play .ct .w2{display:none}}
@media (min-width:1000px){
  .wide{display:inline-flex!important}
  .phonly{display:none!important}
  #csheet{left:auto;right:var(--sr,16px);bottom:var(--sb,118px);width:340px;border:1px solid var(--line2);border-radius:16px;padding-top:12px;opacity:0;pointer-events:none;transform:translateY(8px);transition:opacity .15s,transform .15s}
  body.csheet #csheet{opacity:1;pointer-events:auto;transform:none}
  #csheet .grab{display:none}
  #cback{background:transparent}
}
#csheet button:focus-visible{outline-offset:-3px}
