/* Capeflow Chat */
.ch-tabs{display:flex;gap:.25rem;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:.25rem;margin-bottom:1rem}
.ch-tabs a{flex:1;text-align:center;padding:.6rem .4rem;border-radius:9px;text-decoration:none;color:var(--muted);font-weight:600;position:relative}
.ch-tabs a[aria-current="page"]{background:var(--navy);color:#fff}
.ch-dot{display:inline-block;min-width:1.25rem;padding:0 .35rem;border-radius:999px;background:var(--copper);color:#fff;font-size:.75rem;line-height:1.25rem;margin-left:.3rem}
.ch-head{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.8rem}
.ch-head h1{margin:0;flex:1}
.ch-filters{display:flex;gap:.4rem;overflow-x:auto;margin-bottom:.7rem;padding-bottom:.2rem}
.ch-filters a{padding:.35rem .8rem;border-radius:999px;background:var(--surface);border:1px solid var(--line);text-decoration:none;color:var(--ink);font-size:.88rem;white-space:nowrap}
.ch-filters a[aria-current="page"]{background:var(--navy);color:#fff;border-color:var(--navy)}
.ch-list{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.ch-row{display:flex;gap:.75rem;align-items:center;padding:.7rem .9rem;text-decoration:none;color:inherit;border-bottom:1px solid var(--grey-soft)}
.ch-row:last-child{border-bottom:0}
.ch-row:hover{background:var(--silver-soft)}
.ch-av{width:46px;height:46px;border-radius:12px;background:var(--copper);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem;flex:none}
.ch-av.person{border-radius:50%;background:var(--grey-soft);color:var(--ink)}
.ch-av.site{background:var(--navy-2)}
.ch-av.sm{width:36px;height:36px;font-size:.78rem;border-radius:10px}
.ch-mid{flex:1;min-width:0;display:block}
.ch-name{font-weight:700;display:flex;gap:.4rem;align-items:center}
.ch-name span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-tag{font-size:.65rem;font-weight:700;letter-spacing:.04em;color:var(--muted);border:1px solid var(--line);border-radius:4px;padding:0 .3rem;flex:none}
.ch-prev{display:block;font-size:.88rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-row.unread .ch-prev{color:var(--ink);font-weight:600}
.ch-right{display:block;text-align:right;font-size:.78rem;color:var(--muted);flex:none}
.ch-row.unread .ch-right{color:var(--copper-2);font-weight:700}
.ch-count{display:inline-block;margin-top:.25rem;min-width:1.35rem;padding:0 .4rem;border-radius:999px;background:var(--copper);color:#fff;text-align:center;line-height:1.35rem}

/* room */
body.chat-room main{padding-bottom:0}
body.chat-room #cfBack{display:none}
.ch-roomhead{display:flex;align-items:center;gap:.6rem;background:var(--navy);color:#fff;border-radius:12px;padding:.55rem .7rem;position:sticky;top:64px;z-index:5;box-shadow:0 -12px 0 var(--bg)}
.ch-roomhead a{color:#fff}
.ch-roomhead .ch-mid small{display:block;color:var(--silver);font-size:.78rem}
.ch-iconbtn{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:0;background:none;color:inherit;border-radius:10px;cursor:pointer;flex:none;text-decoration:none}
.ch-iconbtn:hover{background:rgba(127,127,127,.15)}
.ch-stream{display:flex;flex-direction:column;gap:.45rem;padding:1rem .1rem 1rem;min-height:50vh}
.ch-day{align-self:center;font-size:.78rem;color:var(--muted);background:var(--surface);border:1px solid var(--line);padding:.1rem .7rem;border-radius:999px;margin:.4rem 0}
.ch-sys{align-self:center;font-size:.8rem;color:var(--muted);text-align:center;max-width:90%}
.ch-msg{max-width:min(82%,560px);background:var(--surface);border-radius:14px 14px 14px 4px;padding:.45rem .65rem .35rem;box-shadow:0 1px 1px rgba(0,0,0,.06);align-self:flex-start;position:relative;word-wrap:break-word;overflow-wrap:anywhere}
.ch-msg.mine{align-self:flex-end;background:#DCE8FC;border-radius:14px 14px 4px 14px}
.ch-who{font-size:.78rem;font-weight:700;color:var(--copper-2)}
.ch-text{font-size:.97rem;line-height:1.4}
.ch-meta{display:flex;gap:.5rem;justify-content:flex-end;align-items:center;font-size:.72rem;color:var(--muted);margin-top:.15rem}
.ch-meta form{display:inline}
.ch-meta a.ch-seen{color:var(--muted);text-decoration:underline}
.ch-meta button{border:0;background:none;color:var(--muted);font-size:.72rem;cursor:pointer;padding:0;text-decoration:underline}
.ch-photo{display:block;margin:.3rem 0;border-radius:10px;overflow:hidden;max-width:100%}
.ch-photo img{display:block;max-width:100%;max-height:360px;width:auto;height:auto}
.ch-filed{font-size:.78rem;color:var(--green);font-weight:600;margin-top:.2rem}
.ch-filebtn{border:1px solid var(--line);background:var(--surface);border-radius:8px;font-size:.78rem;padding:.25rem .6rem;cursor:pointer;margin-top:.25rem}
.ch-filechip{display:flex;gap:.6rem;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:.5rem .7rem;margin:.25rem 0;text-decoration:none;color:inherit}
.ch-order{display:flex;gap:.6rem;align-items:center;background:var(--surface);border:1px solid #C2D5F6;border-radius:10px;padding:.45rem .7rem;margin:.3rem 0;text-decoration:none;color:inherit}
.ch-order b{font-family:ui-monospace,Menlo,Consolas,monospace;font-weight:600}
.ch-event{display:flex;gap:.7rem;margin-top:.3rem}
.ch-cal{width:52px;border-radius:8px;overflow:hidden;text-align:center;border:1px solid var(--line);flex:none;background:var(--surface)}
.ch-cal b{display:block;background:#B42318;color:#fff;font-size:.7rem;padding:.1rem 0;letter-spacing:.05em}
.ch-cal span{display:block;font-size:1.35rem;font-weight:700;padding:.1rem 0}
.ch-rsvp{display:flex;gap:.4rem;margin-top:.5rem}
.ch-rsvp button{flex:1;min-height:40px;border-radius:8px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font:inherit}
.ch-rsvp button.on{background:var(--copper);color:#fff;border-color:var(--copper)}
.ch-rsvp button.on-no{background:var(--grey-soft);border-color:var(--muted);font-weight:700}
.ch-deleted{font-style:italic;color:var(--muted)}
.ch-unreadline{align-self:stretch;text-align:center;font-size:.78rem;color:var(--copper-2);border-top:1px solid var(--copper);margin:.5rem 0 .2rem;padding-top:.2rem}
.ch-composer{position:sticky;bottom:0;z-index:6;background:var(--bg);padding:.5rem 0 calc(.6rem + env(safe-area-inset-bottom))}
.ch-composer form{display:flex;align-items:flex-end;gap:.3rem;background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:.25rem .3rem}
.ch-composer textarea{flex:1;border:0;resize:none;min-height:42px;max-height:9rem;padding:.6rem .4rem;font:inherit;background:transparent;outline:none}
.ch-send{width:44px;height:44px;border-radius:50%;border:0;background:var(--copper);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.ch-send:disabled{opacity:.5}
.ch-pending{font-size:.85rem;color:var(--muted);padding:.2rem .8rem}
.ch-plus{position:absolute;bottom:100%;left:0;margin-bottom:.4rem;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 24px rgba(0,0,0,.15);display:none;flex-direction:column;min-width:220px;overflow:hidden}
.ch-plus.open{display:flex}
.ch-plus a,.ch-plus label{padding:.75rem 1rem;text-decoration:none;color:var(--ink);cursor:pointer;border-bottom:1px solid var(--grey-soft)}
.ch-plus a:hover,.ch-plus label:hover{background:var(--silver-soft)}
.ch-older{align-self:center;margin:.3rem 0}

/* news + calendar */
.ch-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:.9rem 1rem;margin-bottom:.8rem}
.ch-card.new{border:2px solid var(--copper)}
.ch-card h2{margin:.4rem 0 .3rem;font-size:1.1rem;border:0;padding:0}
.ch-small{font-size:.8rem;color:var(--muted)}
.ch-bar{height:8px;border-radius:999px;background:var(--grey-soft);overflow:hidden;margin-top:.4rem}
.ch-bar i{display:block;height:100%;background:var(--green)}
.ch-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.3rem;background:var(--navy);color:#fff;border-radius:12px;padding:.6rem;text-align:center;margin-bottom:.9rem}
.ch-week div{font-size:.75rem;color:var(--silver)}
.ch-week b{display:block;font-size:1rem;color:#fff;padding:.25rem 0;border-radius:8px;margin-top:.15rem}
.ch-week .today b{background:var(--copper)}
.ch-week .busy b::after{content:"";display:block;width:5px;height:5px;border-radius:50%;background:#7FB2F0;margin:2px auto 0}
.ch-dayhead{font-size:.78rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:.8rem .2rem .4rem}
.ch-ev{display:flex;gap:.8rem;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:.75rem .9rem;margin-bottom:.5rem;text-decoration:none;color:inherit}
.ch-ev i{width:4px;border-radius:4px;background:var(--copper);flex:none}
.ch-ev.cancelled{opacity:.6}.ch-ev.cancelled b{text-decoration:line-through}
.ch-push{display:flex;gap:.8rem;align-items:center;flex-wrap:wrap;background:var(--copper-soft);border:1px solid #BFD6EF;border-radius:12px;padding:.7rem .9rem;margin-bottom:.9rem}
.ch-people{max-height:22rem;overflow-y:auto;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.ch-people label{display:flex;gap:.6rem;align-items:center;padding:.55rem .8rem;border-bottom:1px solid var(--grey-soft);cursor:pointer}
.ch-people input[type=checkbox]{width:20px;height:20px;min-height:0}
.chatbtn{margin-left:auto;position:relative;color:#fff;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:10px;text-decoration:none}
.chatbtn:hover{background:rgba(255,255,255,.12)}
.chatbtn .ch-count{position:absolute;top:2px;right:0;margin:0;font-size:.7rem;min-width:1.1rem;line-height:1.1rem;padding:0 .3rem}
.chatbtn + .topnav-quick,.chatbtn ~ .navburger{margin-left:0}
