/* Roger team: the Team button in the top bar, the team screen (cards, chat, add people) and the /team page.
   Colors and glossy round buttons come from styles.css. */

/* top bar button */
.teamb {
  position: relative; appearance: none; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid #b9dcf7;
  color: var(--neon2); cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 51%), linear-gradient(180deg, #e9f6ff, #bfe1fa);
  box-shadow: inset 0 1px 0 #fff, inset 0 -3px 6px rgba(11, 111, 184, 0.14), 0 4px 10px rgba(11, 111, 184, 0.18);
}
.teamb svg.i { width: 22px; height: 22px; }
.teamb[hidden] { display: none; }
.teamb i {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff;
  font: 700 11px/19px system-ui; text-align: center; box-shadow: 0 2px 5px rgba(217, 48, 79, 0.45);
}
.teamb i[hidden] { display: none; }
.teamb.pulse { animation: cwring 1.4s ease-out 3; }

/* the team screen, same place as the dial pad: between the top bar and the tab bar */
body.cw-open { overflow: hidden; }
.cw {
  position: fixed; left: 0; right: 0; top: var(--cw-top, 58px); bottom: var(--cw-bot, 56px); z-index: 5;
  width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  background: linear-gradient(180deg, #ffffff, var(--bg));
}
.cw[hidden] { display: none; }
.cw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cw-head h2 { margin: 0; font-size: 20px; }
.cw-x { appearance: none; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid #b9dcf7; color: var(--neon2); cursor: pointer; display: grid; place-items: center; background: linear-gradient(180deg, #fff, #dff0ff); }

.cw-root { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1 1 0; }
.cw-tabs { display: flex; gap: 6px; flex: none; }
.cw-tab {
  appearance: none; position: relative; flex: 1; min-height: 42px; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--text); font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
}
.cw-tab[aria-selected="true"] { color: #fff; border-color: #0e6db8; text-shadow: 0 1px 1px rgba(0, 60, 120, 0.4); background: linear-gradient(180deg, #55c0fb, #0f78c8); }
.cw-tab i { position: absolute; top: -5px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 700 11px/18px system-ui; text-align: center; }
.cw-tab i[hidden] { display: none; }
.cw-body { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.cw-panel { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.cw-panel[hidden] { display: none; }
.cw-note { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.cw-err { color: var(--bad); font-size: 14px; min-height: 18px; }
.cw-err.ok { color: var(--good); }

/* who is online */
.cw-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--muted); }
.cw-sum b { color: var(--text); }
.cw-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cw-card {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(11, 111, 184, 0.06); overflow: hidden;
}
.cw-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--bad); }
.cw-card.cw-online::before, .cw-card.cw-call::before { background: var(--good); }
.cw-card.cw-offline { background: #fbfdff; }
.cw-av {
  position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 1px 1px rgba(0, 60, 120, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 52%), linear-gradient(180deg, #4cbafa, #0f78c8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -3px 5px rgba(0, 50, 110, 0.25);
}
.cw-offline .cw-av { filter: grayscale(0.7); opacity: 0.8; }
.cw-dot { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; background: var(--bad); }
.cw-online .cw-dot, .cw-call .cw-dot { background: #19c37d; }
.cw-call .cw-dot { animation: cwring 1.1s ease-out infinite; }
@keyframes cwring { 0% { box-shadow: 0 0 0 0 rgba(25, 195, 125, 0.65); } 70% { box-shadow: 0 0 0 9px rgba(25, 195, 125, 0); } 100% { box-shadow: 0 0 0 0 rgba(25, 195, 125, 0); } }
@media (prefers-reduced-motion: reduce) { .cw-call .cw-dot, .teamb.pulse { animation: none; } .cw-call .cw-dot { box-shadow: 0 0 0 4px rgba(25, 195, 125, 0.35); } }
.cw-who { min-width: 0; display: grid; gap: 1px; }
.cw-who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-who small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-call .cw-who small { color: var(--good); font-weight: 700; }
.cw-role { align-self: start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--neon2); text-transform: uppercase; letter-spacing: 0.6px; }
.cw-calls { text-align: right; font-size: 12px; color: var(--muted); line-height: 1.15; }
.cw-calls b { display: block; font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }

/* chat */
.cw-chat { gap: 8px; overflow: hidden; }
.cw-msgs { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; -webkit-overflow-scrolling: touch; }
.cw-m { max-width: 86%; padding: 8px 12px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); align-self: flex-start; overflow-wrap: anywhere; }
.cw-m.me { align-self: flex-end; border-radius: 18px 18px 6px 18px; color: #fff; border-color: #0e6db8; text-shadow: 0 1px 1px rgba(0, 60, 120, 0.3); background: linear-gradient(180deg, #55c0fb, #0f78c8); }
.cw-m small { display: block; font-size: 12px; font-weight: 700; color: var(--neon2); margin-bottom: 1px; }
.cw-m.me small { color: rgba(255, 255, 255, 0.85); }
.cw-m time { display: block; margin-top: 2px; font-size: 11px; opacity: 0.7; text-align: right; }
.cw-m p { margin: 0; white-space: pre-wrap; font-size: 16px; line-height: 1.35; }
.cw-empty { margin: auto; text-align: center; color: var(--muted); padding: 20px; }
.cw-comp { flex: none; display: flex; gap: 8px; align-items: flex-end; }
.cw-comp textarea { flex: 1; min-height: 46px; max-height: 110px; resize: none; padding: 11px 14px; border-radius: 22px; }
.cw-comp .btn { flex: none; min-height: 46px; padding: 8px 18px; }

/* add people */
.cw-card2 { padding: 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: grid; gap: 8px; }
.cw-card2 h3 { margin: 0; font-size: 16px; color: var(--neon2); }
.cw-row { display: flex; gap: 8px; }
.cw-row > * { min-width: 0; }
.cw-row input { flex: 2; }
.cw-row select { flex: 1; }
.cw-code { display: grid; gap: 6px; padding: 12px; border-radius: 18px; background: #e9f9f1; border: 1px solid #a6e3c6; }
.cw-code b { font-size: 30px; letter-spacing: 3px; font-variant-numeric: tabular-nums; color: #0b6b43; text-align: center; user-select: all; -webkit-user-select: all; }
.cw-code span { font-size: 13px; color: #35705a; text-align: center; }
.cw-mem { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cw-mem:first-of-type { border-top: 0; }
.cw-mem .cw-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.cw-mem .btn { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.cw-mem select { min-height: 38px; padding: 6px 10px; width: auto; }

/* the /team page */
body.cw-page { margin: 0; }
.cw-pagebar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(255, 255, 255, 0.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.cw-pagebar h1 { margin: 0; font-size: 20px; flex: 1; letter-spacing: 0; }
.cw-pagebar a, .cw-pagebar button { font: inherit; font-size: 14px; color: var(--neon2); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 6px; }
.cw-wrap { max-width: 980px; margin: 0 auto; padding: 14px; display: grid; gap: 12px; }
.cw-wrap .cw-root { height: calc(100dvh - 90px); min-height: 480px; }
.cw-login { max-width: 360px; margin: 12vh auto 0; padding: 0 16px; display: grid; gap: 10px; text-align: center; }
.cw-login[hidden] { display: none; }
.cw-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.cw-line b { max-width: 100%; }
