/* Talk to Squad, team chat, client care, security and app bits. Works in the day and night looks. */
.talk { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.talk-log { min-height: 320px; max-height: calc(100vh - 330px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; }
.bubble time, .msg time { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.bubble.me { align-self: flex-end; background: var(--blue-hi); color: #fff; border-bottom-right-radius: 4px; }
.bubble.squad { align-self: flex-start; background: rgba(127, 135, 150, .14); border-bottom-left-radius: 4px; }
.bubble.typing { opacity: .6; }
.talk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.talk-chips .chip { cursor: pointer; border: 1px solid var(--line-2); background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; }
.talk-bar, .chat-bar { display: flex; gap: 8px; align-items: center; }
.talk-bar input, .chat-bar input[type=text] { flex: 1; min-width: 0; }
.mic { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; font-size: 20px; cursor: pointer; color: inherit; }
.mic.on { background: var(--red); border-color: var(--red); animation: micPulse 1.2s infinite; }
.mic:disabled { opacity: .4; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(208, 17, 27, .5); } 50% { box-shadow: 0 0 0 10px rgba(208, 17, 27, 0); } }
.voice-dlg { border: 0; border-radius: var(--r-lg); padding: 22px; width: min(480px, calc(100vw - 32px)); background: var(--card); color: var(--text); }
.voice-dlg::backdrop { background: rgba(5, 8, 15, .55); }
.voice-dlg .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 8px 0 14px; }

/* Team chat */
.chatapp { display: grid; grid-template-columns: 280px 1fr; gap: 14px; height: calc(100vh - 120px); min-height: 460px; }
.chat-list, .chat-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.chat-list { overflow-y: auto; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.chat-room { display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; color: inherit; border: 0; background: none; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.chat-room:hover, .chat-room.on { background: rgba(127, 135, 150, .12); }
.chat-room .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-room .t span { font-size: 12.5px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room .count { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.chat-people { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.chat-people .nav-group { padding: 8px 14px 2px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head b { flex: 1; }
.chat-back { display: none; font-size: 26px; line-height: 1; text-decoration: none; color: inherit; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.chat-day { align-self: center; font-size: 12px; opacity: .6; margin: 8px 0; }
.msg { max-width: 78%; align-self: flex-start; background: rgba(127, 135, 150, .14); padding: 8px 12px; border-radius: 14px; border-bottom-left-radius: 4px; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--blue-hi); color: #fff; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg.mine a { color: #fff; text-decoration: underline; }
.msg .who { display: block; font-size: 12px; opacity: .75; margin-bottom: 2px; }
.msg p { margin: 0; white-space: pre-line; }
.msg img, .msg video { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin: 2px 0 4px; }
.msg audio { max-width: 240px; height: 36px; display: block; }
.chat-bar { padding: 10px; border-top: 1px solid var(--line); }
.chat-bar .attach { cursor: pointer; font-size: 20px; padding: 0 4px; }
.chat-bar .mic { width: 40px; height: 40px; font-size: 17px; }
.chat-main [data-chat-note] { margin: 0 14px 10px; }
.center { text-align: center; }

/* Care, security, account */
.ready-reply { border-top: 1px solid var(--line); padding: 10px 0; }
.ready-reply p { margin: 4px 0 6px; white-space: pre-line; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 3px 0; }
.secret-key { font-family: ui-monospace, Menlo, monospace; font-size: 17px; letter-spacing: 1px; padding: 10px 12px; margin: 8px 0; border-radius: var(--r-sm); background: rgba(127, 135, 150, .14); word-break: break-all; cursor: copy; }
.steps-list { padding-left: 20px; margin: 0 0 12px; }
.steps-list li { margin: 8px 0; }
.pwa-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pwa-box p { flex-basis: 100%; margin: 4px 0 0; }

@media (max-width: 860px) {
  .chatapp { grid-template-columns: 1fr; height: calc(100vh - 96px); }
  .chatapp .chat-list { display: none; }
  .chatapp.show-list .chat-list { display: flex; }
  .chatapp.show-list .chat-main { display: none; }
  .chat-back { display: block; }
  .talk-log { max-height: calc(100vh - 300px); }
  .bubble, .msg { max-width: 90%; }
  .voice-dlg .checks { grid-template-columns: 1fr; }
}

/* Settings → Services, grouped by category */
.svc-groups { display: flex; flex-direction: column; gap: 10px; }
.svc-cat { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.svc-cat > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; background: rgba(127, 135, 150, .07); }
.svc-cat > summary::-webkit-details-marker { display: none; }
.svc-cat > summary::before { content: "▸"; margin-right: 6px; transition: transform .2s; }
.svc-cat[open] > summary::before { transform: rotate(90deg); }
.svc-cat > summary b { flex: 1; }
.svc-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 70px; gap: 12px; align-items: end; padding: 12px 14px; border-top: 1px solid var(--line); margin: 0; }
.svc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; align-self: center; }
.svc-name b { font-weight: 600; }
.svc-row label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.svc-row label span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.svc-row select { width: 100%; min-height: 36px; padding: 5px 8px; font-size: 13.5px; }
.svc-ok { font-size: 12px; color: var(--green); align-self: center; }
@media (max-width: 700px) {
  .svc-row { grid-template-columns: 1fr 1fr; }
  .svc-name { grid-column: 1 / -1; }
  .svc-ok { grid-column: 1 / -1; }
}

/* Pictures: hero helmets or photos */
.avatar.has-pic { padding: 0; overflow: hidden; background: #111; }
.avatar.has-pic img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.hero-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.hero-pick label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-size: 12px; padding: 6px; border-radius: 12px; border: 2px solid transparent; }
.hero-pick input { position: absolute; opacity: 0; pointer-events: none; }
.hero-pick img { width: 58px; height: 58px; border-radius: 50%; display: block; }
.hero-pick .none .avatar { width: 58px; height: 58px; line-height: 58px; font-size: 18px; }
.hero-pick label:has(input:checked) { border-color: var(--blue-hi); background: rgba(47, 107, 255, .08); }
.hero-pick label.taken { opacity: .38; cursor: not-allowed; filter: grayscale(.7); }
.hero-pick label:hover:not(.taken) img { transform: scale(1.08); }
.hero-pick img { transition: transform .2s; }
.hero-pick label:focus-within { outline: 2px solid var(--blue-hi); }
/* Module switches: on is clearly green, in both looks */
.sw.on, html.day .sw.on { background: #1FB25A !important; box-shadow: 0 0 12px rgba(31, 178, 90, .45) !important; }
.sw.on span, html.day .sw.on span { background: #fff !important; }

/* My account: cards fill the width in columns instead of one long scroll */
.acct-grid { columns: 400px; column-gap: 18px; }
.acct-grid > .card { break-inside: avoid; display: inline-block; width: 100%; max-width: none !important; margin: 0 0 18px !important; vertical-align: top; }

/* ---------- Phone app: header, bottom tabs, drawer ---------- */
.tabbar, .side-x { display: none; }
@media (max-width: 880px) {
  .topbar { display: flex !important; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 35;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; color: #fff;
    background: rgba(9, 12, 20, .82); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, .07); }
  .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, #2F6BFF, #8B5CF6, #E8344E); opacity: .8; }
  .topbar .tb-me { flex: none; text-decoration: none; }
  .topbar .tb-me .avatar { width: 38px; height: 38px; line-height: 38px; font-size: 13px; box-shadow: 0 0 0 2px rgba(47, 107, 255, .55); }
  .topbar .tb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
  .topbar .tb-title span { font: 700 9.5px var(--display, inherit); letter-spacing: .18em; text-transform: uppercase; color: #8FA6D8; }
  .topbar .tb-title b { font: 800 17px var(--display, inherit); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .tb-btn { flex: none; position: relative; width: 40px; height: 40px; margin: 0 !important; padding: 0 !important; display: grid; place-items: center;
    border-radius: 12px !important; background: rgba(255, 255, 255, .07) !important; border: 1px solid rgba(255, 255, 255, .1) !important; color: #fff; cursor: pointer; }
  .topbar .tb-btn svg { width: 20px; height: 20px; }
  .topbar .tb-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #E8344E; box-shadow: 0 0 0 2px #0B0F1A; }
  html.day .topbar { background: rgba(255, 255, 255, .86); color: #0B1222; border-bottom-color: rgba(10, 20, 40, .08); }
  html.day .topbar .tb-btn { background: rgba(10, 20, 40, .05) !important; border-color: rgba(10, 20, 40, .1) !important; color: #0B1222; }
  html.day .topbar .tb-title span { color: #4A63A8; }

  .tabbar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 34;
    padding: 6px; gap: 2px; border-radius: 22px; background: rgba(12, 16, 27, .9);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 12px 34px rgba(0, 0, 0, .45); }
  .tabbar a, .tabbar button { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px;
    border: 0; background: none; border-radius: 16px; color: #8A93A6; text-decoration: none; font: 600 10.5px var(--body, inherit); cursor: pointer; transition: color .2s, background .2s; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 22px; height: 22px; transition: transform .2s; }
  .tabbar .on { color: #fff; background: linear-gradient(135deg, rgba(47, 107, 255, .32), rgba(139, 92, 246, .26)); }
  .tabbar .on svg { transform: translateY(-1px) scale(1.06); color: #7FA6FF; }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }
  .tabbar .badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: #E8344E; color: #fff; font: 700 10px/17px var(--body, inherit); font-style: normal; text-align: center; box-shadow: 0 0 0 2px #0C101B; }
  html.day .tabbar { background: rgba(255, 255, 255, .92); border-color: rgba(10, 20, 40, .08); box-shadow: 0 10px 30px rgba(10, 20, 40, .16); }
  html.day .tabbar a, html.day .tabbar button { color: #5B6478; }
  html.day .tabbar .on { color: #0B1222; background: linear-gradient(135deg, rgba(47, 107, 255, .14), rgba(139, 92, 246, .12)); }
  html.day .tabbar .on svg { color: #2F6BFF; }

  .main { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px) !important; }
  .moment { bottom: calc(env(safe-area-inset-bottom, 0px) + 92px) !important; }

  .side { padding-top: calc(env(safe-area-inset-top, 0px) + 14px) !important; overflow-y: auto; z-index: 45 !important; border-radius: 0 22px 22px 0; }
  .side-x { display: grid; place-items: center; position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; width: 38px; height: 38px;
    border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #fff; cursor: pointer; z-index: 2; }
  .side-x svg { width: 18px; height: 18px; }
  body.menu .tabbar, body.menu .topbar { opacity: 0; pointer-events: none; }
  .chatapp { height: calc(100dvh - 150px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important; }
}
@media (display-mode: standalone) and (max-width: 880px) { body { overscroll-behavior-y: none; } }

/* Demo videos: the "How this page works" pill, its player, and demos inside Talk to Squad */
.demo-pill { position: fixed; right: 18px; bottom: 18px; z-index: 30; border: 0; cursor: pointer; padding: 10px 16px; border-radius: 999px; color: #fff;
  font: 700 12px var(--display, inherit); letter-spacing: .04em; background: linear-gradient(135deg, #2F6BFF, #8B5CF6 60%, #E8344E); box-shadow: 0 10px 26px rgba(47, 107, 255, .35); }
.demo-dlg { width: min(860px, 94vw); border: 0; border-radius: 18px; padding: 14px; background: var(--card, #12151d); color: inherit; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.demo-dlg::backdrop { background: rgba(5, 8, 15, .7); }
.demo-dlg-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.demo-dlg video { width: 100%; border-radius: 12px; background: #000; display: block; }
.talk-demo { margin: 10px 0 4px; display: grid; gap: 8px; }
.talk-demo video { width: 100%; max-width: 520px; border-radius: 12px; background: #000; }
.talk-demo-cap { font-weight: 700; font-size: 13px; }
.talk-demo .btn { justify-self: start; }
@media (max-width: 880px) { .demo-pill { bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); right: 14px; padding: 9px 13px; font-size: 11px; } }
.bubble:has(.talk-demo) { display: block; }
