/* Connect and crews (src/crew.js): sheets and pages over the map, the Friends page block, the crew chat,
   the meeting point picker and the crew line on the map. Beta look: navy primary, soft grey round buttons,
   Outfit headings, Inter text. Colours from the theme (--g-*) so dark themes follow. */
:root{--cw-surface:var(--g-surface,#fff);--cw-ink:var(--g-ink,#0B2440);--cw-mut:var(--g-muted,#5B6B79);--cw-line:var(--g-line,#E3E9EE);
  --cw-soft:var(--g-raised,#EDF2F6);--cw-accent:var(--g-accent,#012F56);--cw-on:var(--g-on-accent,#fff);--cw-bg:var(--g-base,#F4F7F9);
  --cw-head:600 20px/1.2 Outfit,Inter,system-ui,sans-serif;--cw-text:var(--ripa-font-text,Inter,system-ui,sans-serif)}
.cw-layer,.cw-picker,.cw-line,.cw-connect,.cw-crews{font-family:var(--cw-text);color:var(--cw-ink);-webkit-tap-highlight-color:transparent}
.cw-layer *,.cw-picker *,.cw-line *,.cw-connect *,.cw-crews *{box-sizing:border-box}
.cw-layer button,.cw-picker button,.cw-line button,.cw-connect button,.cw-crews button{font:inherit;color:inherit;cursor:pointer}
.cw-layer svg,.cw-picker svg,.cw-line svg,.cw-connect svg,.cw-crews svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* A bottom sheet over a dimmed map, or a full page */
.cw-layer{position:fixed;inset:0;z-index:1300;display:flex;align-items:flex-end;justify-content:center;background:rgba(11,36,64,.32);animation:cw-fade .18s ease-out}
.cw-sheet{width:100%;max-width:520px;max-height:calc(100dvh - env(safe-area-inset-top,0px) - 24px);display:flex;flex-direction:column;background:var(--cw-surface);border-radius:22px 22px 0 0;
  padding:10px 22px calc(18px + env(safe-area-inset-bottom,0px));box-shadow:0 -4px 24px rgba(11,36,64,.14);animation:cw-up .22s ease-out}
.cw-page-layer{background:var(--cw-bg);align-items:stretch}
.cw-page{width:100%;max-width:640px;margin:0 auto;display:flex;flex-direction:column;background:var(--cw-bg);padding-top:env(safe-area-inset-top,0px);animation:cw-fade .18s ease-out}
.cw-grab{width:36px;height:5px;border-radius:9px;background:var(--cw-line);margin:0 auto 10px;flex:none}
.cw-head{display:flex;align-items:center;gap:10px;flex:none;min-height:40px}
.cw-page>.cw-head{padding:10px 14px 8px;border-bottom:1px solid var(--cw-line);background:var(--cw-bg)}
.cw-title{flex:1;min-width:0;margin:0;font:var(--cw-head);color:var(--cw-ink);overflow:hidden;text-overflow:ellipsis}
.cw-round{flex:none;width:36px;height:36px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:var(--cw-soft);color:var(--cw-ink)}
.cw-round[hidden]{display:none}
.cw-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-top:4px}
.cw-sheet .cw-body{margin:0 -22px;padding:4px 22px 2px}
@keyframes cw-up{from{transform:translateY(24px);opacity:.4}to{transform:none;opacity:1}}
@keyframes cw-fade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.cw-layer,.cw-sheet,.cw-page{animation:none}}

/* Buttons, rows, switches */
.cw-row-btn svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.cw-row-btn .cw-chev svg{width:16px;height:16px}
.cw-btn{display:flex;align-items:center;justify-content:center;gap:8px;height:46px;padding:0 18px;border:0;border-radius:999px;background:var(--cw-accent);color:var(--cw-on)!important;font:600 15px/1 var(--cw-text)!important}
.cw-btn.cw-soft{background:var(--cw-soft);color:var(--cw-ink)!important}
.cw-btn:disabled{opacity:.5}
.cw-wide{width:100%;margin-top:16px}
.cw-link{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:44px;padding:0;border:0;background:none;font:600 15px/1 var(--cw-text);color:var(--cw-accent)}
.cw-link.cw-mut{color:var(--cw-mut);font-weight:500}
.cw-row-btn{display:flex;align-items:center;gap:14px;width:100%;min-height:56px;padding:9px 0;border:0;border-bottom:1px solid var(--cw-line);background:none;text-align:left;color:var(--cw-ink)}
.cw-row-btn .cw-link{width:auto;flex:none;padding:0 4px}
.cw-ic{width:22px;display:grid;place-items:center;flex:none;color:var(--cw-ink)}
.cw-t{flex:1;min-width:0;display:block}
.cw-t b{display:block;font:500 15px/1.3 var(--cw-text);color:var(--cw-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-t small{display:block;margin-top:1px;font:400 13px/1.35 var(--cw-text);color:var(--cw-mut);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-row-btn em{flex:none;font:400 12px/1 var(--cw-text);font-style:normal;color:var(--cw-mut)}
.cw-chev{flex:none;color:var(--cw-mut);display:grid;place-items:center;font-style:normal}
.cw-chev svg{width:16px;height:16px}
.cw-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--ripa-red,#E4161C)}
.cw-danger .cw-t b{color:var(--g-danger,#B8251D)}
.cw-edit{flex:none;font:600 14px/1 var(--cw-text);color:var(--cw-accent)}
.cw-kick{display:block;margin:22px 0 2px;font:600 12px/1 var(--cw-text);letter-spacing:.08em;color:var(--cw-mut)}
.cw-label{display:block;margin:18px 0 8px;font:600 13px/1.2 var(--cw-text);color:var(--cw-mut)}
.cw-hint{margin:8px 0 0;font:400 13px/1.45 var(--cw-text);color:var(--cw-mut)}
.cw-center{text-align:center}
.cw-sub{display:block;font:400 13px/1.35 var(--cw-text);color:var(--cw-mut)}
.cw-lead{margin:14px 0 6px;font:400 15px/1.45 var(--cw-text);color:var(--cw-ink)}
.cw-switch{flex:none;position:relative;width:44px;height:26px;border-radius:99px;background:#CBD6DF;transition:background .15s}
.cw-switch::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:left .15s}
.cw-switch.on{background:var(--cw-accent)}.cw-switch.on::after{left:21px}
.cw-radio{flex:none;width:22px;height:22px;border-radius:50%;border:2px solid #CBD6DF}
.cw-radio.on{border:7px solid var(--cw-accent)}
.cw-check{flex:none;width:22px;height:22px;border-radius:6px;border:2px solid #CBD6DF;display:grid;place-items:center}
.cw-check.on{background:var(--cw-accent);border-color:var(--cw-accent)}
.cw-check.on::after{content:"";width:10px;height:5px;margin-top:-3px;border:solid #fff;border-width:0 0 2px 2px;transform:rotate(-45deg)}
.cw-chips{display:flex;flex-wrap:wrap;gap:8px}
.cw-chip{display:inline-flex;align-items:center;height:36px;padding:0 14px;border:1px solid var(--cw-line);border-radius:999px;background:var(--cw-surface);font:500 14px/1 var(--cw-text)!important;color:var(--cw-ink)}
.cw-chip.on{background:var(--cw-accent);border-color:var(--cw-accent);color:var(--cw-on)!important}
.cw-choose{display:flex;flex-wrap:wrap;gap:8px;padding:10px 0 4px}
.cw-choose[hidden]{display:none}
.cw-field{display:grid;gap:6px;margin-top:6px;font:600 13px/1.2 var(--cw-text);color:var(--cw-mut)}
.cw-field input{height:46px;padding:0 14px;border:1px solid var(--cw-line);border-radius:12px;background:var(--cw-surface);color:var(--cw-ink);font:400 16px/1 var(--cw-text)}

/* Avatars */
.cw-av{flex:none;width:40px;height:40px;border-radius:50%;background:#E6EDF6;color:#1D4E89;display:grid;place-items:center;font:600 15px/1 var(--cw-text)}
.cw-av-big{width:56px;height:56px;font-size:21px}
.cw-av-dark{background:var(--cw-accent);color:var(--cw-on)}
.cw-stack{position:relative;flex:none;width:40px;height:40px}
.cw-stack i{position:absolute;width:28px;height:28px;border-radius:50%;background:#E6EDF6;color:#1D4E89;border:2px solid var(--cw-bg);display:grid;place-items:center;font:600 11px/1 var(--cw-text);font-style:normal}
.cw-stack i:first-child{left:0;top:0}.cw-stack i:nth-child(2){right:0;bottom:0}
.cw-stack i:only-child{inset:6px}

/* Show my code / Scan */
.cw-seg{display:flex;gap:0;margin:10px 0 2px;padding:3px;border-radius:999px;background:var(--cw-soft)}
.cw-seg button{flex:1;height:36px;display:flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:999px;background:none;font:600 14px/1 var(--cw-text)!important;color:var(--cw-mut)!important}
.cw-seg button.on{background:var(--cw-surface);color:var(--cw-ink)!important;box-shadow:0 1px 2px rgba(11,36,64,.14)}
.cw-seg svg{width:17px;height:17px}
.cw-qrbox{width:212px;height:212px;margin:14px auto 4px;display:grid;place-items:center;padding:8px;border-radius:18px;background:#fff;border:1px solid var(--cw-line)}
.cw-layer .cw-qr{width:196px;height:196px;display:block;stroke:none}
.cw-qrwait{font:400 13px/1.4 var(--cw-text);color:#5B6B79;text-align:center;padding:0 12px}
.cw-cam{position:relative;margin:14px auto 4px;width:min(100%,300px);aspect-ratio:1;border-radius:18px;overflow:hidden;background:#0B2440}
.cw-cam video{width:100%;height:100%;object-fit:cover;display:block}
.cw-frame{position:absolute;inset:18%;border:3px solid rgba(255,255,255,.92);border-radius:16px;box-shadow:0 0 0 999px rgba(11,36,64,.32)}

/* Join */
.cw-join-head{display:flex;align-items:center;gap:14px;margin-top:4px}
.cw-join-head .cw-title{white-space:normal}

/* Friends page block (inside the People pane) */
.cw-connect{margin:6px 0 10px}
.cw-two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cw-two .cw-btn{height:46px;padding:0 10px;white-space:nowrap}
.cw-connect .cw-hint{text-align:center;margin-top:8px}
.cw-crews{margin:0 0 14px}
.cw-crews[hidden],.cw-connect[hidden]{display:none}
.cw-invite{background:rgba(var(--g-accent-rgb,1,47,86),.06);border-radius:14px;border:0;padding:10px 12px;margin-top:8px}

/* Who sees me / lists */
.cw-list{display:block}
.cw-list .cw-row-btn:last-child{border-bottom:0}

/* Crew chat */
.cw-chat-layer .cw-page{height:100dvh}
.cw-chat-layer .cw-head .cw-stack i{border-color:var(--cw-bg)}
.cw-chat-name{flex:1;min-width:0}
.cw-chat-name b{display:block;font:600 17px/1.2 Outfit,Inter,sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-chat-name small{display:block;font:400 12.5px/1.3 var(--cw-text);color:var(--cw-mut);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-chat-body{flex:1;min-height:0;display:flex;flex-direction:column}
.cw-msgs{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;gap:8px;padding:12px 16px}
.cw-msgs>:first-child{margin-top:auto}
.cw-msg{align-self:flex-start;max-width:78%;padding:8px 12px;border-radius:16px;background:var(--cw-surface);border:1px solid var(--cw-line);font:400 15px/1.35 var(--cw-text);overflow-wrap:anywhere;color:var(--cw-ink)}
.cw-msg small{display:block;margin-bottom:1px;font:600 12px/1.3 var(--cw-text);color:var(--cw-mut)}
.cw-msg.mine{align-self:flex-end;background:var(--cw-accent);border-color:var(--cw-accent);color:var(--cw-on)}
.cw-sys{align-self:center;margin:2px 0;font:400 12.5px/1.3 var(--cw-text);color:var(--cw-mut);text-align:center}
.cw-meet{align-self:flex-start;width:min(84%,340px);padding:10px 12px 12px;border:1px solid var(--cw-line);border-radius:16px;background:var(--cw-surface)}
.cw-meet.mine{align-self:flex-end}
.cw-meet p{margin:8px 0 0;font:400 15px/1.35 var(--cw-text)}
.cw-meet .cw-chips{margin-top:10px}
.cw-meet .cw-chip{height:34px}
.cw-meet-map{display:flex;align-items:center;gap:12px;width:100%;padding:0;border:0;background:none;text-align:left}
.cw-meet-map b{display:block;font:600 15px/1.3 var(--cw-text)}
.cw-meet-map small{display:block;font:400 13px/1.3 var(--cw-text);color:var(--cw-mut)}
.cw-meet-pin{flex:none;width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--cw-accent);color:var(--cw-on)}
.cw-going{display:block;margin-top:8px;font:400 12.5px/1.3 var(--cw-text);color:var(--cw-mut)}
.cw-compose{flex:none;display:flex;align-items:center;gap:8px;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--cw-line);background:var(--cw-bg)}
.cw-compose input::placeholder{color:var(--cw-mut)}
.cw-compose input{flex:1;min-width:0;height:42px;padding:0 14px;border:1px solid var(--cw-line);border-radius:999px;background:var(--cw-surface);color:var(--cw-ink);font:400 16px/1 var(--cw-text)}
.cw-layer .cw-send{background:var(--cw-accent);color:var(--cw-on)}

/* Meeting point picker: the map moves under a fixed pin */
body.cw-picking #shellTop,body.cw-picking #shellChips,body.cw-picking #thumbDock,body.cw-picking #thumbRail,body.cw-picking #mapCorner,body.cw-picking #shellLayers,body.cw-picking #shellNav,body.cw-picking .maplibregl-ctrl-bottom-right,body.cw-picking .cw-line{visibility:hidden}
.cw-picker{position:fixed;inset:0;z-index:1250;pointer-events:none}
.cw-picker>*{pointer-events:auto}
.cw-picker-top{position:absolute;left:12px;right:12px;top:calc(env(safe-area-inset-top,0px) + 10px);display:flex;align-items:center;gap:10px;height:48px;padding:0 14px 0 6px;border-radius:999px;background:var(--cw-surface);box-shadow:0 4px 16px rgba(11,36,64,.18);font:500 15px/1 var(--cw-text)}
.cw-picker-pin{position:absolute;left:50%;top:42%;transform:translate(-50%,-100%);display:flex;flex-direction:column;align-items:center;pointer-events:none!important}
.cw-picker-pin span,.cw-meet-marker span{background:var(--cw-accent,#012F56);color:#fff;font:600 12.5px/1 var(--cw-text);padding:6px 10px;border-radius:999px;white-space:nowrap;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.cw-picker-pin i,.cw-meet-marker i{width:2px;height:12px;background:#012F56}
.cw-picker-pin u,.cw-meet-marker u{width:12px;height:12px;border-radius:50%;background:#012F56;border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.cw-picker-sheet{position:absolute;left:0;right:0;bottom:0;margin:0 auto;animation:none}
.cw-picker-sheet .cw-title{flex:none}
.cw-picker-sheet .cw-chips{margin-top:12px}
.cw-picker-sheet [data-day]{margin-top:8px}
.cw-time{margin-top:10px;height:42px;padding:0 12px;border:1px solid var(--cw-line);border-radius:12px;font:400 16px var(--cw-text);color:var(--cw-ink);background:var(--cw-surface)}
.cw-time[hidden]{display:none}
.cw-meet-marker{display:flex;flex-direction:column;align-items:center;padding:0;border:0;background:none;cursor:pointer}

/* The crew line on the map: under the layer chips, left of the round buttons */
.cw-line{position:fixed;z-index:44;left:12px;right:64px;top:calc(var(--chips-top,calc(env(safe-area-inset-top,0px) + 66px)) + 50px);display:flex;align-items:center;gap:6px;
  padding:6px 6px 6px 8px;border-radius:16px;background:var(--cw-surface);box-shadow:0 1px 4px rgba(11,36,64,.18)}
.cw-line[hidden]{display:none}
.cw-line-main{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:0;border:0;background:none;text-align:left}
.cw-line .cw-stack{width:34px;height:34px}
.cw-line .cw-stack i{width:24px;height:24px;font-size:10px;border-color:var(--cw-surface)}
.cw-line .cw-t b{font-size:14px;font-weight:600}
.cw-line .cw-t small{display:flex;align-items:center;gap:5px;font-size:12.5px}
.cw-line .cw-round{width:32px;height:32px}
.cw-line .cw-round svg{width:17px;height:17px}
.cw-live{flex:none;width:7px;height:7px;border-radius:50%;background:#9AA7B2}
.cw-live.on{background:#22c55e}
/* Hidden while a panel, card or the route planner covers the map, and on desktop */
body[data-h76]:not(#_h) .cw-line,body[data-h77]:not(#_h) .cw-line,body[data-h78]:not(#_h) .cw-line,
body[data-h79]:not(#_h) .cw-line,body[data-h80]:not(#_h) .cw-line,body[data-h50]:not(#_h) .cw-line,body[data-h81]:not(#_h) .cw-line,body[data-h82]:not(#_h) .cw-line{display:none}
@media (min-width:900px){.cw-line{display:none}.cw-sheet{border-radius:22px;margin-bottom:24px}.cw-layer{align-items:center}}

/* The welcome on the website for a ?c= link */
.cw-welcome .cw-av{margin:0 auto 10px}

/* People button in the phone shell's top bar */
.shell-people{position:relative;flex:none;width:38px;height:38px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:transparent;color:var(--g-ink,#0B2440);cursor:pointer}
.shell-people svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.shell-people[hidden]{display:none}
.shell-people.sharing::before{content:"";position:absolute;inset:1px;border-radius:50%;box-shadow:0 0 0 2px #22c55e}
.shell-people b{position:absolute;top:0;right:-2px;min-width:18px;height:18px;padding:0 5px;border-radius:99px;background:var(--ripa-red,#E4161C);color:#fff;font:600 11px/14px var(--ripa-font-text,Inter,sans-serif);text-align:center;border:2px solid var(--g-surface,#fff)}
.shell-people b:empty{display:none}

/* RIPA and his friends (src/crew.js gang()): three birds built from brand/, the middle one in front.
   Each bird is the bird picture with its hat laid on top in the same logo units (assets/start/). */
.cw-gang{position:relative;height:82px;width:min(100%,300px);margin:2px auto 6px;pointer-events:none}
.cw-bird{position:absolute;bottom:0;display:block;aspect-ratio:662/453}
.cw-bird img{position:absolute;display:block;max-width:none}
.cw-bird img:first-child{left:0;top:7.06%;width:100%;height:92.94%}
.cw-hat{top:.88%;height:11.26%;left:69.79%;width:27.49%}
.cw-hat-hike{left:66.16%;top:0;width:33.53%;height:13.91%}
.cw-b1{left:0;width:100px}
.cw-b2{left:44%;width:118px;transform:translateX(-50%);z-index:1}
.cw-b3{right:0;width:100px;transform:scaleX(-1)}
.cw-gang-join{margin:6px auto 12px}
.cw-connect{padding:14px 14px 12px;border-radius:18px;background:var(--cw-surface);border:1px solid var(--cw-line)}
.cw-connect-title{display:block;margin:0 0 10px;text-align:center;font:600 18px/1.2 Outfit,Inter,sans-serif;color:var(--cw-ink)}
.cw-join-head b{display:block;font:600 16px/1.25 var(--cw-text);color:var(--cw-ink)}
.cw-back[hidden]{display:none}
.cw-empty{margin:auto 0;display:grid;justify-items:center;gap:4px;padding:24px 0}
.cw-qrwait .cw-link{margin-top:6px}
.cw-welcome .cw-gang{margin-bottom:12px}
