/* Stalex на комп'ютері — стиль туру застосунку: пастельне тло, скляні картки й кнопки.
   Палітра: рожевий — головний, білий і зелений — другорядні; офіційні кольори тривог — лише для тривог. */

:root {
  --pink: #db407d; --pink-2: #ee6e66; --pink-deep: #ad1f61;
  --green: #05b366; --teal: #00a3b3; --signal: #0f7333;
  --ink: #082912; --ink-2: rgba(8, 41, 18, .62); --ink-3: rgba(8, 41, 18, .42);
  --bg: #ffffff; --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .82); --line: rgba(8, 41, 18, .09);
  --bubble-me: #d4f0db; --bubble: #ffffff;
  --red: #e33b2e; --amber: #f7c71a;
  --shadow: 0 14px 44px rgba(8, 41, 18, .10);
  --r: 22px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #ffffff; --ink-2: rgba(255, 255, 255, .66); --ink-3: rgba(255, 255, 255, .42);
  --bg: #000; --glass: rgba(28, 34, 31, .62); --glass-2: rgba(40, 48, 44, .86); --line: rgba(255, 255, 255, .10);
  --bubble-me: rgba(255, 255, 255, .17); --bubble: rgba(255, 255, 255, .08); --signal: #66e07a;
  --shadow: 0 14px 44px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.4 var(--font); color: var(--ink); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--pink); }
svg { display: block; }
::selection { background: rgba(219, 64, 125, .25); }

/* Пастельне тло (як StalexBackdrop): зелений, бірюзовий, рожевий. */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(420px 420px at 20% 12%, rgba(5, 179, 102, .30), transparent 70%),
    radial-gradient(380px 380px at 90% 35%, rgba(0, 163, 179, .26), transparent 70%),
    radial-gradient(320px 320px at 85% 85%, rgba(219, 64, 125, .16), transparent 70%),
    radial-gradient(360px 360px at 40% 100%, rgba(5, 179, 102, .18), transparent 70%); }
:root[data-theme="dark"] .backdrop { opacity: .75; }

.glass { background: var(--glass); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
         border: 1px solid rgba(255, 255, 255, .55); box-shadow: var(--shadow); }
:root[data-theme="dark"] .glass { border-color: rgba(255, 255, 255, .10); }
.card { border-radius: var(--r); padding: 18px; }

#app { position: relative; z-index: 1; height: 100%; }
.shell { height: 100%; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; position: relative; }

/* Нижня панель вкладок (як таб-бар застосунку). */
.tabbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; gap: 4px; padding: 6px;
          border-radius: 999px; }
.tabbar button { width: 84px; height: 54px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center;
                 gap: 2px; font-size: 11px; font-weight: 700; color: var(--ink-2); position: relative; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--pink); background: rgba(219, 64, 125, .12); }
.tabbar button.alert { color: var(--red); }
.tabbar .badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
                 background: var(--pink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.tabbar .badge.sos { background: var(--red); }
.tabbar .avatar { width: 26px; height: 26px; }

/* Загальні елементи */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px;
       font-weight: 800; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn.primary { background: linear-gradient(135deg, var(--pink-2), var(--pink) 55%, var(--pink-deep)); color: #fff; box-shadow: 0 8px 22px rgba(219, 64, 125, .35); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 8px 22px rgba(5, 179, 102, .3); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.icon-btn.glass { box-shadow: var(--shadow); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { background: rgba(219, 64, 125, .10); }
.field { width: 100%; height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass-2); outline: none; }
.field:focus { border-color: rgba(219, 64, 125, .5); box-shadow: 0 0 0 4px rgba(219, 64, 125, .12); }
textarea.field { height: auto; padding: 12px 16px; resize: none; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .16em; color: var(--pink); text-transform: uppercase; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scroll { overflow: auto; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { width: 8px; } .scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill svg { width: 15px; height: 15px; }
.plus { font-size: 10px; font-weight: 900; color: #2b1900; background: linear-gradient(135deg, #ffd66b, #ffb020); padding: 2px 6px; border-radius: 6px; }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 200; padding: 12px 18px; border-radius: 16px; font-weight: 700;
         max-width: min(560px, 92vw); text-align: center; }
.empty { display: grid; place-items: center; text-align: center; padding: 40px; gap: 10px; color: var(--ink-2); }
.empty svg { width: 54px; height: 54px; color: var(--pink); }

/* Аватар */
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Модальні вікна */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(8, 20, 14, .35); display: grid; place-items: center; padding: 20px; }
.modal { width: min(520px, 100%); max-height: 88vh; overflow: auto; border-radius: 28px; padding: 22px; }
.modal h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }

/* Вхід */
.login { height: 100%; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(940px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 34px; padding: 34px; border-radius: 34px; }
@media (max-width: 820px) { .login .card { grid-template-columns: 1fr; } }
.login h1 { font-size: 40px; line-height: 1.05; margin: 8px 0 12px; font-weight: 900; letter-spacing: -.02em; }
.login .qr { border-radius: 24px; overflow: hidden; background: #fff; width: 280px; height: 280px; display: grid; place-items: center; margin: 0 auto; }
.login .qr svg { width: 280px; height: 280px; }
.login ol { margin: 14px 0 0; padding-left: 20px; line-height: 1.7; color: var(--ink-2); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; letter-spacing: .02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.grad { background: linear-gradient(135deg, var(--green), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Небо */
.sky { position: absolute; inset: 0; }
.sky .map { position: absolute; inset: 0; }
.sky .head { position: absolute; left: 18px; top: 18px; right: 18px; z-index: 5; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.sky .head > * { pointer-events: auto; }
.sky .logo { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; font-weight: 900; letter-spacing: .14em; }
.sky .logo svg { width: 26px; height: 26px; color: var(--signal); }
.sky .panel { position: absolute; left: 18px; top: 78px; max-height: calc(100% - 174px); width: 380px; z-index: 5; border-radius: 28px; display: flex; flex-direction: column; }
@media (max-width: 760px) { .sky .panel { left: 10px; right: 10px; width: auto; top: auto; max-height: 52%; } }
.state { border-radius: 22px; padding: 16px; display: flex; gap: 14px; align-items: center; }
.state .dot { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; color: #fff; }
.state .dot svg { width: 28px; height: 28px; }
.state b { font-size: 18px; font-weight: 900; display: block; }
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row i { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(5, 179, 102, .2); }
.live.bad i { background: var(--amber); box-shadow: 0 0 0 4px rgba(247, 199, 26, .2); }
.maplibregl-ctrl-attrib { font-size: 10px; background: var(--glass) !important; }
.maplibregl-ctrl-group { background: var(--glass-2) !important; border-radius: 14px !important; }

/* Чати */
.chats { position: absolute; inset: 0; display: grid; grid-template-columns: 380px 1fr; gap: 14px; padding: 14px 14px 92px; }
@media (max-width: 860px) { .chats { grid-template-columns: 1fr; } .chats.open .list-pane { display: none; } .chats:not(.open) .conv-pane { display: none; } }
.list-pane, .conv-pane { border-radius: 28px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.list-head { padding: 16px 16px 10px; display: flex; align-items: center; gap: 8px; }
.list-head h2 { margin: 0; font-size: 24px; font-weight: 900; flex: 1; }
.search { margin: 0 14px 8px; position: relative; }
.search svg { position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; color: var(--ink-3); }
.search input { padding-left: 38px; height: 42px; border-radius: 14px; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; border-radius: 18px; margin: 0 6px; }
.chat-item:hover { background: rgba(219, 64, 125, .07); }
.chat-item.on { background: rgba(219, 64, 125, .13); }
.chat-item .t { font-weight: 800; }
.chat-item .p { font-size: 13.5px; color: var(--ink-2); }
.chat-item .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--ink-3); }
.unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.unread.muted-b { background: var(--ink-3); }
.status-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; color: #fff; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.conv-head .t { font-weight: 900; font-size: 17px; }
.conv-head .s { font-size: 13px; color: var(--ink-2); }
.msgs { flex: 1; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font-size: 12px; font-weight: 800; color: var(--ink-2); padding: 4px 12px; border-radius: 999px; margin: 10px 0; }
.msg { max-width: min(560px, 78%); display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 20px; background: var(--bubble); box-shadow: 0 1px 2px rgba(8, 41, 18, .07); word-wrap: break-word; white-space: pre-wrap; }
.msg.me .bubble { background: var(--bubble-me); }
.bubble .who { font-size: 12.5px; font-weight: 800; color: var(--pink); margin-bottom: 2px; }
.bubble .meta { float: right; margin: 6px 0 -4px 10px; font-size: 11px; color: var(--ink-3); display: inline-flex; gap: 4px; align-items: center; }
.bubble .meta svg { width: 14px; height: 14px; }
.bubble .reply { border-left: 3px solid var(--pink); padding: 2px 8px; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); border-radius: 4px; background: rgba(219, 64, 125, .06); }
.bubble.deleted { font-style: italic; color: var(--ink-3); }
.bubble img.photo, .bubble video { max-width: 100%; max-height: 420px; border-radius: 14px; display: block; margin: 2px 0 4px; cursor: zoom-in; }
.bubble .ph { width: 280px; height: 200px; border-radius: 14px; background-size: cover; filter: blur(6px); }
.reactions { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.reactions button { padding: 2px 8px; border-radius: 999px; font-size: 13px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.reactions button.mine { box-shadow: inset 0 0 0 2px var(--pink); }
.msg-menu { position: absolute; z-index: 20; top: 100%; display: flex; flex-direction: column; border-radius: 18px; padding: 6px; min-width: 210px; }
.msg.me .msg-menu { right: 0; }
.msg-menu .em { display: flex; gap: 2px; padding: 4px; }
.msg-menu .em button { font-size: 20px; width: 34px; height: 34px; border-radius: 10px; }
.msg-menu .em button:hover, .msg-menu > button:hover { background: rgba(219, 64, 125, .1); }
.msg-menu > button { text-align: left; padding: 9px 12px; border-radius: 12px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.msg-menu > button svg { width: 18px; height: 18px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; max-height: 180px; border-radius: 22px; padding: 11px 16px; }
.composer .icon-btn { flex: none; }
.send { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--pink-2), var(--pink)); color: #fff; display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; }
.replybar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.typing { font-size: 13px; color: var(--pink); font-weight: 700; }
.card-msg { border-radius: 18px; padding: 12px; display: flex; gap: 12px; align-items: center; min-width: 240px; }
.card-msg .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; }
.card-msg .ic svg { width: 22px; height: 22px; }
.poll { min-width: 280px; }
.poll button.opt { width: 100%; text-align: left; position: relative; padding: 9px 12px; border-radius: 12px; margin-top: 6px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.poll button.opt .bar { position: absolute; inset: 0 auto 0 0; background: rgba(219, 64, 125, .14); }
.poll button.opt span { position: relative; display: flex; justify-content: space-between; gap: 8px; }
.poll button.opt.mine { box-shadow: inset 0 0 0 2px var(--pink); }
.sos-card { border-radius: 18px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, #f0524a, #c9201b); }

/* Ефір */
.air { position: absolute; inset: 0; display: grid; grid-template-columns: 380px 1fr; gap: 14px; padding: 14px 14px 92px; }
@media (max-width: 860px) { .air { grid-template-columns: 1fr; } .air.open .list-pane { display: none; } .air:not(.open) .conv-pane { display: none; } }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--pink); color: #fff; }
.post { max-width: 640px; align-self: stretch; }
.post .bubble { white-space: pre-wrap; }

/* Транспорт */
.transport { position: absolute; inset: 0; }
.transport .map { position: absolute; inset: 0; }
.transport .panel { position: absolute; left: 18px; top: 18px; max-height: calc(100% - 114px); width: 380px; z-index: 5; border-radius: 28px; display: flex; flex-direction: column; }
@media (max-width: 760px) { .transport .panel { left: 10px; right: 10px; width: auto; top: auto; max-height: 55%; } }
.route-chip { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 8px; color: #fff; font-weight: 900; font-size: 13px; }
.arr { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.arr .eta { margin-left: auto; font-weight: 900; }
.arr .eta.live { color: var(--green); }

/* Профіль */
.profile { position: absolute; inset: 0; padding: 14px 14px 100px; }
.profile .inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.section { border-radius: 24px; padding: 6px 0; }
.section h3 { margin: 10px 18px 4px; font-size: 12px; letter-spacing: .14em; color: var(--ink-2); font-weight: 800; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.item + .item { border-top: 1px solid var(--line); }
.item svg { width: 22px; height: 22px; color: var(--pink); flex: none; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--ink-3); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(18px); }

/* Дзвінок */
.call { position: fixed; inset: 0; z-index: 150; background: #071a10; color: #fff; display: flex; flex-direction: column; align-items: center; }
.call video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call video.local { position: absolute; right: 20px; top: 20px; width: 220px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 20px; transform: scaleX(-1);
                    border: 1px solid rgba(255, 255, 255, .35); z-index: 3; }
.call .info { position: relative; z-index: 2; margin-top: 12vh; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.call .info b { font-size: 34px; font-weight: 900; }
.call .ctrls { position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 14px; padding: 10px; border-radius: 999px; }
.call .ctrls button { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; }
.call .ctrls button.off { background: #fff; color: #071a10; }
.call .ctrls button.end { background: var(--red); width: 72px; border-radius: 999px; }
.call .ctrls button.ok { background: var(--green); }
.call .ctrls svg { width: 26px; height: 26px; }
.call .veil { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center; background: rgba(7, 26, 16, .55);
              backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: opacity .9s; }
.call .veil b { font-size: 34px; font-weight: 900; display: block; margin-top: 10px; }
.call .badges { position: absolute; left: 50%; transform: translateX(-50%); bottom: 120px; z-index: 4; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.call .badges span { background: rgba(0, 0, 0, .5); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.call .keyemoji { position: absolute; left: 20px; top: 20px; z-index: 4; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 22px; }
.incoming { position: fixed; right: 20px; top: 20px; z-index: 160; width: 340px; border-radius: 26px; padding: 18px; }
@keyframes rise { from { transform: translateY(0) scale(.5); opacity: 1; } to { transform: translateY(-45vh) scale(1.1); opacity: 0; } }
