/* ---------- «Передать управление» ---------- */
.tile-ctl { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 72%, transparent); color: #fff; font-size: 12px; font-weight: 800; opacity: 0; transition: opacity .15s, background .15s, color .15s; backdrop-filter: blur(6px); }
.tile:hover .tile-ctl { opacity: 1; }
.tile-ctl:hover { background: #fff; color: #000; }
.tile-ctl .ic { fill: none; }

.ctl-tag { position: absolute; left: 10px; top: 10px; z-index: 4; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: #fff; color: #000; font-style: normal; font-size: 11px; font-weight: 800; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.tile.ctl-live { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); }

.ctl-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; animation: ctlPulse 1.6s ease-in-out infinite; }
@keyframes ctlPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }
.ctl-modes { display: inline-flex; gap: 4px; color: var(--muted, #a1a1aa); }
.ctl-modes .ic { width: 14px; height: 14px; }
kbd { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .12); font: 700 10.5px/1 ui-monospace, Consolas, monospace; color: inherit; white-space: nowrap; }

/* слой гостя поверх экрана хозяина */
.ctl-layer { position: absolute; inset: 0; z-index: 5; outline: none; cursor: pointer; display: flex; flex-direction: column; }
.ctl-layer.focus { cursor: default; box-shadow: inset 0 0 0 2px #fff; border-radius: inherit; }
.ctl-layer.locked { cursor: none; }
.ctl-top { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 6px 6px 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 80%, transparent); color: #fff; font-size: 12.5px; backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); max-width: calc(100% - 20px); }
.ctl-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl-take { height: 26px; padding: 0 12px; border-radius: 999px; background: #fff; color: #000; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: transform .12s; }
.ctl-take:hover { transform: scale(1.03); }
.ctl-take kbd { background: rgba(0, 0, 0, .08); box-shadow: none; }
.ctl-hint { flex: 1; display: grid; place-items: center; pointer-events: none; }
.ctl-hint-off { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px; border-radius: 18px; background: color-mix(in srgb, var(--bg) 72%, transparent); color: #fff; backdrop-filter: blur(8px); text-align: center; transition: opacity .2s, transform .2s; }
.ctl-hint-off em { font-style: normal; font-size: 12px; color: var(--muted, #a1a1aa); }
.ctl-hint-on { display: none; align-self: end; margin-bottom: 12px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: #fff; font-size: 11.5px; font-weight: 700; align-items: center; gap: 6px; }
.ctl-layer.focus .ctl-hint-off { display: none; }
.ctl-layer.focus .ctl-hint-on { display: inline-flex; }
.ctl-layer.locked .ctl-hint-on { opacity: .55; }
.tile:has(.ctl-layer) .tile-full, .tile:has(.ctl-layer) .tile-clip, .tile:has(.ctl-layer) .tile-ctl { display: none; }

/* полоса у хозяина */
.ctl-bar { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 9px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--bg-panel); color: #fff; font-size: 13px; box-shadow: inset 0 0 0 1px #26262c, 0 18px 40px rgba(0, 0, 0, .5); animation: ctlIn .25s cubic-bezier(.2, .9, .3, 1.2); }
.ctl-bar.out { animation: ctlOut .2s forwards; }
.ctl-bar .avatar { flex: none; }
.ctl-mini { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted, #a1a1aa); background: var(--bg-active); transition: background .15s, color .15s; }
.ctl-mini.on { background: #fff; color: #000; }
.ctl-mini .ic { width: 14px; height: 14px; }
@keyframes ctlIn { from { opacity: 0; transform: translate(-50%, -10px) scale(.96); } }
@keyframes ctlOut { to { opacity: 0; transform: translate(-50%, -10px) scale(.96); } }

/* окна */
.ctl-modal .modal-head { text-align: center; }
.ctl-hero { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: #fff; color: #000; box-shadow: 0 12px 30px rgba(255, 255, 255, .08); }
.ctl-hero .ic { width: 30px; height: 30px; }
.ctl-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #a1a1aa); margin: 4px 0 8px; }
.ctl-people { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ctl-person { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--bg-hover); color: inherit; font-weight: 700; font-size: 13px; box-shadow: inset 0 0 0 1px #24242a; transition: box-shadow .15s, background .15s; }
.ctl-person i { display: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #000; place-items: center; }
.ctl-person i .ic { width: 12px; height: 12px; }
.ctl-person.on { background: var(--bg-active); box-shadow: inset 0 0 0 2px #fff; }
.ctl-person.on i { display: grid; }
.ctl-perms { display: grid; gap: 8px; margin-bottom: 14px; }
.ctl-perm { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--bg-hover); box-shadow: inset 0 0 0 1px #24242a; cursor: pointer; transition: box-shadow .15s; }
.ctl-perm > .ic { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: #1f1f25; color: var(--muted, #a1a1aa); flex: none; transition: background .15s, color .15s; }
.ctl-perm.on > .ic { background: #fff; color: #000; }
.ctl-perm.on { box-shadow: inset 0 0 0 1px #3a3a42; }
.ctl-perm div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ctl-perm span { font-size: 12px; color: var(--muted, #a1a1aa); }
.ctl-perm input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: #2a2a31; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.ctl-perm input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8a8a94; transition: transform .18s, background .18s; }
.ctl-perm input:checked { background: #fff; }
.ctl-perm input:checked::after { transform: translateX(16px); background: #000; }
.ctl-perm.locked, .ctl-perm.dis { cursor: default; }
.ctl-perm.dis { opacity: .5; }
.ctl-perm input:disabled { cursor: default; }
.ctl-warn, .ctl-note { display: flex; gap: 11px; padding: 12px 14px; border-radius: 14px; background: var(--bg-input); box-shadow: inset 0 0 0 1px #222228; font-size: 12.5px; }
.ctl-warn > .ic, .ctl-note > .ic { flex: none; margin-top: 1px; color: #fff; }
.ctl-warn div, .ctl-note div { display: flex; flex-direction: column; gap: 5px; }
.ctl-warn span, .ctl-note span { color: var(--muted, #a1a1aa); line-height: 1.45; }
.ctl-modes-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 700; font-size: 13px; }
.ctl-modes-row .ic { width: 14px; height: 14px; vertical-align: -2px; }
.ctl-modes-row i { color: var(--muted, #a1a1aa); font-style: normal; }

.ctl-plus { font-style: normal; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 6px; background: #fff; color: #000; }
.tile-ctl:hover .ctl-plus { background: #000; color: #fff; }
.ctl-danger { display: flex; gap: 12px; padding: 13px 14px; margin-bottom: 10px; border-radius: 14px; background: rgba(239, 68, 68, .09); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .35); font-size: 12.5px; }
.ctl-danger-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #ef4444; color: #fff; }
.ctl-danger-ic .ic { width: 18px; height: 18px; }
.ctl-danger div { display: flex; flex-direction: column; gap: 4px; }
.ctl-danger div > b { color: #fca5a5; font-size: 13.5px; }
.ctl-danger span { color: var(--text-2); line-height: 1.45; }
.ctl-danger span b { color: #fff; }
.ctl-agree { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 11px 14px; border-radius: 14px; background: var(--bg-hover); box-shadow: inset 0 0 0 1px #24242a; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: box-shadow .15s; }
.ctl-agree.on { box-shadow: inset 0 0 0 1.5px #fff; }
.ctl-agree input { appearance: none; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px #55555e; cursor: pointer; display: grid; place-items: center; }
.ctl-agree input:checked { background: #fff; box-shadow: none; }
.ctl-agree input:checked::after { content: ""; width: 9px; height: 5px; border: solid #000; border-width: 0 0 2px 2px; transform: translate(0, -1px) rotate(-45deg); }
.ctl-modal [data-ctlgo]:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- автообновление ---------- */
.upd-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 14px 0 18px; border-radius: 16px; background: var(--bg-input); box-shadow: inset 0 0 0 1px #222228; }
.upd-card .upd-txt { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.upd-card small, .upd-bar small { color: var(--muted, #a1a1aa); font-size: 12px; }
.upd-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-active); color: #fff; }
.upd-card.ready .upd-ic, .upd-card.downloading .upd-ic, .upd-bar .upd-ic { background: #fff; color: #000; }
.upd-card.downloading .upd-ic .ic { animation: updBob 1.2s ease-in-out infinite; }
@keyframes updBob { 50% { transform: translateY(3px); } }
.upd-prog { height: 5px; margin-top: 6px; border-radius: 5px; background: #24242a; overflow: hidden; }
.upd-prog i { display: block; height: 100%; background: #fff; border-radius: inherit; transition: width .4s; }
.upd-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 18px; background: var(--bg-panel); box-shadow: inset 0 0 0 1px #26262c, 0 20px 50px rgba(0, 0, 0, .55); animation: ctlIn .3s cubic-bezier(.2, .9, .3, 1.2); max-width: calc(100vw - 32px); }
.upd-bar > div { display: flex; flex-direction: column; gap: 2px; margin-right: 6px; }
.upd-bar.out { animation: ctlOut .2s forwards; }
@media (max-width: 640px) { .upd-bar { flex-wrap: wrap; } }
