/* Личный кабинет «Связь с домом» — мобильный в первую очередь */
.cab { min-height: 100dvh; }
.cab .grad { background: linear-gradient(90deg, #5ff6ff, #b39cff 50%, #ff7ae2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cab-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(10, 16, 48, 0.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(160, 200, 255, 0.18); }
.cab-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; }
.cab-logo img { height: 32px; width: auto; }
.cab-install { border: 1px solid rgba(200, 230, 255, 0.5); background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.cab-main { max-width: 34rem; margin: 0 auto; padding: 16px 16px 40px; color: #fff; }
.cab-screen { animation: fade-in .5s ease both; }
.cab-hero { text-align: center; margin: 8px 0 18px; }
.cab-hero__img { width: 170px; margin: 0 auto 6px; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .55)); }
.cab-hero h1 { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.5px; }
.cab-hero p { margin-top: 10px; color: rgba(225, 234, 255, .86); }
.cab-card { background: rgba(246, 247, 255, 0.94); color: #0b1230; border-radius: 22px; padding: 20px; box-shadow: 0 16px 44px rgba(5, 10, 40, .45); }
.cab-card h2 { font-size: 22px; margin-bottom: 6px; }
.cab-card p { color: #3e4466; }
.cab-center { text-align: center; }
.cab-big { font-size: 52px; }
.cab-steps { padding-left: 1.2em; margin-bottom: 12px; line-height: 1.5; }
.cab-steps li + li { margin-top: 4px; }
.cab-code { display: flex; flex-direction: column; gap: 12px; }
.cab-code input { text-align: center; font-size: 38px; letter-spacing: 12px; font-weight: 800; padding: 10px; border-radius: 16px; border: 2px solid #c9cff0; background: #fff; color: #0b1230; font-family: inherit; }
.cab-code input:focus { outline: none; border-color: #8a7bff; box-shadow: 0 0 0 4px rgba(138, 123, 255, .2); }
.cab-code .btn, .cab-row .btn { justify-content: center; }
.cab-row { display: flex; gap: 8px; margin-top: 12px; }
.cab-row input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 2px solid #c9cff0; font: inherit; }
.cab-small { font-size: 13px; color: #5b6088; margin-top: 12px; line-height: 1.45; }
.cab-main > .cab-small { color: rgba(220, 230, 255, .75); }
.cab-small a { text-decoration: underline; }
.cab-err { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #ffe6ec; color: #9a1838; font-size: 14px; }
.cab-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cab-chips button, .cab-quick button { border: 1.5px solid #c9cff0; background: #fff; color: #0b1230; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cab-chips button:hover { border-color: #8a7bff; }

.cab-dev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(190, 220, 255, .3); }
.cab-dev img { width: 58px; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.cab-dev b { display: block; font-size: 17px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(220, 230, 255, .85); }
.st::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #8a8fb0; }
.st--on::before { background: #3ce68c; box-shadow: 0 0 8px #3ce68c; }
.cab-badge { margin-left: auto; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: linear-gradient(90deg, #7ef6ff, #c3b3ff); color: #0b1230; font-weight: 700; }

.cab-pending { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cab-req { background: #fff6d6; color: #4a3800; border-radius: 16px; padding: 12px 14px; font-size: 14px; }
.cab-req b { display: block; margin-bottom: 6px; }
.cab-req button { margin-right: 6px; border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.cab-req .ok { background: #2fc876; color: #fff; } .cab-req .no { background: #eee; color: #333; }

.cab-chat { margin: 14px 0 10px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.cab-empty { text-align: center; color: rgba(220, 230, 255, .75); font-size: 14px; padding: 24px 8px; }
.bub { max-width: 82%; align-self: flex-end; background: #dcf8c6; color: #10331a; padding: 9px 13px; border-radius: 18px 18px 4px 18px; font-size: 15px; line-height: 1.35; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.bub.other { align-self: flex-start; background: #eef0ff; color: #18124a; border-radius: 18px 18px 18px 4px; }
.bub small { display: block; margin-top: 3px; font-size: 11px; opacity: .7; text-align: right; }
.bub .who { display: block; font-size: 12px; font-weight: 700; opacity: .7; margin-bottom: 2px; }

.cab-quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px; }
.cab-quick::-webkit-scrollbar { display: none; }
.cab-quick button { flex: 0 0 auto; background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(200, 225, 255, .4); }
.cab-send { position: sticky; bottom: 10px; display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-radius: 22px; background: rgba(246, 247, 255, .96); box-shadow: 0 10px 34px rgba(5, 10, 40, .5); }
.cab-send textarea { flex: 1; resize: none; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; padding: 8px 10px; color: #0b1230; max-height: 140px; }
.cab-send__btn { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; font-size: 20px; color: #0b1230; cursor: pointer; background: linear-gradient(135deg, #7ef6ff, #b6a8ff 60%, #ff9ad8); }
.cab-people { margin-top: 18px; }
.cab-people summary { cursor: pointer; font-weight: 700; }
.cab-people ul { list-style: none; padding: 0; margin-top: 10px; }
.cab-people li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid #e3e6f3; }
.cab-people li button { border: 0; background: #ffe6ec; color: #9a1838; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.cab-demo { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 12px; background: #ffcc3d; color: #3a2a00; padding: 4px 12px; border-radius: 999px; z-index: 50; font-weight: 700; }
.cab-hero__pair { display: flex; justify-content: center; align-items: flex-end; gap: 0; margin-bottom: 6px; }
.cab-hero__pair img { width: 150px; filter: drop-shadow(0 18px 26px rgba(0,0,0,.55)); }
.cab-hero__pair img:first-child { transform: rotate(-6deg); margin-right: -18px; }
.cab-hero__pair img:last-child { transform: rotate(6deg); width: 160px; }
.cab-dev img { width: 58px; height: 48px; object-fit: contain; }
.cab-edit { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; margin-left: 6px; }
.cab-badge + .cab-edit { margin-left: 6px; }
.cab-setup { margin-top: 12px; }
.cab-chars { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cab-chars button { flex: 1 1 120px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 16px; border: 2px solid #d7dcf3; background: #fff; cursor: pointer; font: inherit; font-weight: 700; color: #0b1230; }
.cab-chars button img { width: 90px; height: 70px; object-fit: contain; }
.cab-chars button.on { border-color: #8a7bff; box-shadow: 0 0 0 4px rgba(138,123,255,.2); }
.cab-select { width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 14px; border: 2px solid #c9cff0; background: #fff; color: #0b1230; font: inherit; font-size: 15px; }
.st--wait::before { background: #ffcf4a; box-shadow: 0 0 8px rgba(255, 207, 74, .8); }
.st--off::before { background: #8a8fb0; }
.st--alarm { color: #ffd0d8; font-weight: 700; }
.st--alarm::before { background: #ff3b5c; box-shadow: 0 0 10px #ff3b5c; animation: cab-blink .8s infinite; }
@keyframes cab-blink { 50% { opacity: .3; } }
.cab-modes { display: flex; gap: 6px; margin: 4px 0 8px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(200, 225, 255, .25); }
.cab-modes button { flex: 1; border: 0; background: transparent; color: #fff; border-radius: 999px; padding: 8px 6px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cab-modes button.on { background: #fff; color: #0b1230; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.cab-modes button[data-m="alarm"].on { background: #ff3b5c; color: #fff; }
.cab-modes button[data-m="urgent"].on { background: #ffcf4a; color: #3a2a00; }
.cab-mode-note { font-size: 13px; color: #ffe7a3; margin: 0 4px 8px; }
.cab-alarm { margin-bottom: 10px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 59, 92, .16); border: 1.5px solid rgba(255, 120, 140, .6); color: #fff; font-size: 14px; line-height: 1.45; }
.cab-alarm__kinds { display: flex; gap: 8px; margin-top: 10px; }
.cab-alarm__kinds button { flex: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; cursor: pointer; }
.cab-alarm__kinds button b { font-size: 15px; }
.cab-alarm__kinds button small { font-size: 12px; opacity: .85; line-height: 1.3; }
.cab-alarm__kinds button.on { background: #fff; color: #9a1838; border-color: #fff; }
.cab-send--urgent { box-shadow: 0 0 0 2px #ffcf4a, 0 10px 34px rgba(5, 10, 40, .5); }
.cab-send--alarm { box-shadow: 0 0 0 2px #ff3b5c, 0 10px 34px rgba(5, 10, 40, .5); }
.cab-send--alarm .cab-send__btn { background: #ff3b5c; color: #fff; }
.cab-note { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #e6f7ff; color: #0b3a55; font-size: 14px; line-height: 1.4; }
.hidden { display: none !important; }
.cab-media { margin: 4px 0 10px; padding: 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(200, 225, 255, .3); color: #fff; }
.cab-media summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; }
.cab-media summary::-webkit-details-marker { display: none; }
.cab-media summary::after { content: ' ›'; opacity: .7; }
.cab-media[open] summary::after { content: ' ⌄'; }
.cab-media__h { margin: 12px 0 6px; font-size: 13px; font-weight: 700; opacity: .85; }
.cab-media__list { display: flex; flex-wrap: wrap; gap: 6px; }
.cab-media__list button { border: 1.5px solid rgba(200, 225, 255, .45); background: rgba(255, 255, 255, .12); color: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cab-media__list button:active { background: #fff; color: #0b1230; }
.cab-media__stop { margin-top: 8px; border: 0; background: rgba(255, 255, 255, .9); color: #0b1230; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cab-media .cab-small { color: rgba(220, 230, 255, .75); }
.cab-pick { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px; border-radius: 16px; background: rgba(255, 255, 255, .1); }
.cab-pick__ic { font-size: 20px; width: 28px; text-align: center; }
.cab-pick__arr { flex: 0 0 auto; width: 36px; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.cab-pick__arr:active { background: rgba(255, 255, 255, .3); }
.cab-pick__name { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-pick__play { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; font-size: 17px; color: #0b1230; background: linear-gradient(135deg, #7ef6ff, #b6a8ff 60%, #ff9ad8); }
.cab-pick__stop { background: #fff; width: 40px; height: 40px; font-size: 15px; }
.cab-pick__name { white-space: normal; line-height: 1.15; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 420px) { .cab-pick__ic { display: none; } .cab-pick { gap: 5px; } .cab-pick__arr { width: 32px; } }
.cab-wake-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cab-wake { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .12); }
.cab-wake.off { opacity: .55; }
.cab-wake__t { font-size: 26px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.cab-wake__info { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.cab-wake__info small { display: block; opacity: .75; font-size: 12px; margin-top: 2px; }
.cab-wake__del { border: 0; background: rgba(255, 255, 255, .15); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; }
.cab-switch { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.cab-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cab-switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .25); transition: .2s; cursor: pointer; }
.cab-switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.cab-switch input:checked + i { background: #3ce68c; }
.cab-switch input:checked + i::after { transform: translateX(18px); }
.cab-wake-add { margin-top: 6px; }
.cab-wake-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cab-wake-row input[type=time] { font: inherit; font-size: 24px; font-weight: 800; padding: 6px 10px; border-radius: 14px; border: 0; background: #fff; color: #0b1230; }
.cab-wake-presets, .cab-wake-days { display: flex; gap: 6px; flex-wrap: wrap; }
.cab-wake-days { margin-top: 8px; }
.cab-wake-presets button, .cab-wake-days button { border: 1.5px solid rgba(200, 225, 255, .45); background: rgba(255, 255, 255, .1); color: #fff; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cab-wake-days button { min-width: 38px; padding: 6px 8px; }
.cab-wake-presets button.on, .cab-wake-days button.on { background: #fff; color: #0b1230; border-color: #fff; }
.cab-wake-text { width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 14px; border: 0; font: inherit; font-size: 14px; }
.cab-pick__listen { font-size: 18px; }
.cab-wake-submit { width: 100%; margin-top: 10px; justify-content: center; }
.cab-wake-days { gap: 4px; flex-wrap: nowrap; }
.cab-wake-days button { flex: 1; min-width: 0; padding: 6px 0; text-align: center; }
.cab-login { margin-top: 14px; }
.cab-login b { font-size: 15px; }
.cab-transfer { margin-top: 16px; text-align: center; }
.cab-transfer__code { font-size: 40px; font-weight: 800; letter-spacing: 6px; margin: 8px 0; font-variant-numeric: tabular-nums; }
.cab-quiet { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; line-height: 1.4; color: #3e4466; cursor: pointer; }
.cab-quiet input { margin-top: 2px; width: 18px; height: 18px; flex: 0 0 auto; }
html { scroll-behavior: auto !important; overflow-anchor: auto; }
.cab-time { display: flex; align-items: center; gap: 4px; background: #fff; border-radius: 14px; padding: 4px 8px; }
.cab-time select { -webkit-appearance: none; appearance: none; border: 0; background: #eef0ff; border-radius: 10px; font: inherit; font-size: 26px; font-weight: 800; color: #0b1230; padding: 4px 10px; text-align: center; text-align-last: center; cursor: pointer; font-variant-numeric: tabular-nums; }
.cab-time b { font-size: 26px; color: #0b1230; }

/* ---- история — своё окно с прокруткой ---- */
.cab-chat { max-height: min(52vh, 460px); min-height: 140px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 10px 8px; border-radius: 18px; background: rgba(8, 14, 48, .35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); scrollbar-width: thin; }
.cab-chat::-webkit-scrollbar { width: 6px; }
.cab-chat::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
.cab-chat-down { display: block; margin: -40px auto 10px; position: relative; z-index: 2; border: 0; border-radius: 16px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 700; color: #0b1230; background: #7ef6ff; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); cursor: pointer; }

/* ---- голосовые ---- */
.bub--voice { min-width: 190px; }
.vplay { display: flex; align-items: center; gap: 8px; }
.vplay button { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font-size: 15px; color: #fff; background: #3a48c9; }
.bub.other .vplay button { background: #7b3fd8; }
.vplay i { flex: 1; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .15); overflow: hidden; }
.vplay i b { display: block; height: 100%; width: 0; background: currentColor; opacity: .55; }
.vplay span { font-size: 12px; opacity: .75; min-width: 30px; text-align: right; }
.cab-send__mic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; font-size: 20px; cursor: pointer; background: #e8ebff; }
.cab-send--rec .cab-send__mic { background: #ff3b5c; animation: cabpulse 1s infinite; }
.cab-send--rec textarea { display: none; }
.cab-rec { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 46px; color: #0b1230; font-size: 15px; }
.cab-rec__x { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #555; padding: 4px 6px; }
.cab-rec__dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5c; animation: cabpulse 1s infinite; }
.cab-rec__hint { opacity: .6; font-size: 13px; }
@keyframes cabpulse { 50% { opacity: .45; } }
.cab-talk { text-align: center; margin-top: 8px; color: #7ef6ff; }

/* ---- громкость ---- */
.cab-vol { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; border-radius: 16px; background: rgba(255, 255, 255, .1); }
.cab-vol input { flex: 1; accent-color: #7ef6ff; height: 28px; }
.cab-vol b { min-width: 34px; text-align: right; font-size: 14px; }

/* ---- уведомления сверху ---- */
.cab-toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 1000; transform: translate(-50%, -140%); max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: 16px; background: #f6f7ff; color: #0b1230; font-size: 15px; font-weight: 600; line-height: 1.3; text-align: center;
  box-shadow: 0 12px 34px rgba(5, 10, 40, .55); transition: transform .28s ease; pointer-events: auto; cursor: pointer; }
.cab-toast.on { transform: translate(-50%, 0); }
.cab-toast.bad { background: #ffe1e6; color: #6a0f22; }
