@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/assets/fonts/inter-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/assets/fonts/inter-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/assets/fonts/inter-latin-700.woff2') format('woff2'); }

:root {
  --g50: #EEF4ED; --g100: #D4E0D8; --g200: #8DA9C4; --g300: #6B91B5; --g400: #4A79A6;
  --g500: #134074; --g600: #13315C; --g700: #0B2545; --g800: #091D36; --g900: #061527;
  --blue: #60A5FA; --blue-strong: #2563EB; --sky: #93C5FD; --green: #4ADE80; --mint: #86EFAC;
  --amber: #FBBF24; --red: #F87171; --red-strong: #DC2626;
  --text: #EEF4ED; --muted: #8DA9C4; --line: rgba(141, 169, 196, .16); --line-strong: rgba(141, 169, 196, .3);
  --glass: rgba(11, 37, 69, .62); --glass-strong: rgba(9, 29, 54, .86);
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .65), 0 0 0 1px var(--line);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--g900); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#cipher-fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
#cipher-fx canvas { width: 100%; height: 100%; display: block; }

/* Brand */
.brand-bar { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 40px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 19px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--g200); color: var(--g700); display: grid; place-items: center; font-size: 20px; box-shadow: 0 0 24px rgba(141, 169, 196, .35); }
.brand-name span { color: var(--g200); }
.brand-product { font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sky); border: 1px solid rgba(147, 197, 253, .35); border-radius: 999px; padding: 3px 10px; margin-left: 4px; }
.brand-side { display: flex; gap: 10px; align-items: center; }
body.in-call .brand-bar { display: none; }

#app { position: relative; z-index: 2; min-height: calc(100% - 70px); }
.view { padding: 12px clamp(16px, 4vw, 40px) 48px; animation: viewIn .5s cubic-bezier(.2, .8, .2, 1); }
.view-narrow { max-width: 460px; margin: 6vh auto 0; }
.view-mid { max-width: 980px; margin: 3vh auto 0; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .2s, border-color .2s, transform .15s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--blue-strong), #3B82F6); color: #fff; box-shadow: 0 10px 30px -10px rgba(37, 99, 235, .8), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 40px -10px rgba(59, 130, 246, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { background: rgba(141, 169, 196, .06); border-color: var(--line-strong); color: var(--g100); }
.btn-ghost:hover:not(:disabled) { background: rgba(141, 169, 196, .12); }
.btn-danger { background: var(--red-strong); color: #fff; }
.btn-green { background: linear-gradient(135deg, #16A34A, #22C55E); color: #04140A; }
.btn-link { background: none; border: 0; color: var(--muted); padding: 8px; }
.btn-link:hover { color: var(--text); }
.btn-wide { width: 100%; }
.btn-small { padding: 7px 12px; font-size: 13px; border-radius: 10px; background: rgba(141, 169, 196, .1); border: 1px solid var(--line-strong); }
.btn-small:hover { background: rgba(141, 169, 196, .18); }
.round { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(6, 21, 39, .65); border: 1px solid var(--line-strong); transition: background .2s; }
.round.small { width: 34px; height: 34px; }
.round[aria-pressed="false"] { background: var(--red-strong); border-color: transparent; }

/* Hero */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--sky); letter-spacing: .01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); } 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.hero { max-width: 1180px; margin: 3vh auto 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.06; letter-spacing: -.025em; margin: 0 0 18px; font-weight: 700; }
.grad { background: linear-gradient(100deg, var(--sky), var(--g200) 40%, var(--mint)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--g100); opacity: .86; max-width: 560px; margin: 0 0 28px; }
.code-card { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); max-width: 560px; }
.code-label { display: block; font-size: 13px; font-weight: 600; color: var(--g200); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .1em; }
.code-row { display: flex; gap: 10px; }
.code-field { flex: 1; display: flex; align-items: center; gap: 10px; background: rgba(6, 21, 39, .7); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px; transition: border-color .2s, box-shadow .2s; min-width: 0; }
.code-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(96, 165, 250, .15); }
.code-field .ico { color: var(--muted); }
.code-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 13px 0; font-family: var(--mono); font-size: 18px; letter-spacing: .08em; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.hint.err { color: var(--red); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; max-width: 560px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#create-btn { max-width: 560px; }

.hero-visual { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; justify-self: center; }
#orb { width: 100%; height: 100%; display: block; }
.orb-chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(9, 29, 54, .78); border: 1px solid var(--line-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--g100); animation: float 6s ease-in-out infinite; }
.orb-chip .ico { width: 15px; height: 15px; color: var(--green); }
.orb-chip.c1 { top: 12%; left: 2%; }
.orb-chip.c2 { top: 48%; right: -2%; animation-delay: -2s; }
.orb-chip.c3 { bottom: 10%; left: 12%; animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.features { list-style: none; padding: 0; margin: 56px auto 0; max-width: 1180px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.features li { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: rgba(11, 37, 69, .45); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.features .ico { width: 26px; height: 26px; color: var(--sky); margin-top: 2px; }
.features strong { display: block; font-size: 15px; margin-bottom: 4px; }
.features span { font-size: 13.5px; color: var(--muted); }

/* Panels & forms */
.panel { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.panel.center { text-align: center; }
.panel h2, .wait h2, .modal h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; }
.panel-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 16px; background: linear-gradient(135deg, rgba(96, 165, 250, .25), rgba(74, 222, 128, .18)); border: 1px solid var(--line-strong); }
.panel-icon .ico { width: 26px; height: 26px; color: var(--sky); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2, .form > .muted { text-align: center; margin-top: 0; margin-bottom: 0; }
.form label, .modal label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--g200); }
.form input, .modal input { background: rgba(6, 21, 39, .75); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 400; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.form input:focus, .modal input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(96, 165, 250, .15); }
.form-error { color: var(--red); font-size: 13.5px; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.fine { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0; }
.fine .ico { width: 16px; height: 16px; color: var(--green); }

/* Admin */
.admin-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.admin-head h2 span { color: var(--sky); }
.room-list { display: grid; gap: 10px; }
.room { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(6, 21, 39, .55); border: 1px solid var(--line); }
.room-code { font-family: var(--mono); font-size: 18px; letter-spacing: .06em; }
.room-meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.room-meta .live { color: var(--green); }
.room-meta .away { color: var(--amber); }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; padding: 20px 0 6px; margin: 0; }

/* Prejoin */
.prejoin { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.preview { position: relative; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 50% 40%, var(--g600), var(--g900)); box-shadow: var(--shadow); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.preview-off .ico { width: 40px; height: 40px; }
.preview-tools { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; }
.meter { position: absolute; left: 16px; bottom: 22px; width: 6px; height: 54px; border-radius: 3px; background: rgba(6, 21, 39, .6); overflow: hidden; }
.meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(to top, var(--green), var(--mint)); transition: height .08s; }

/* Wait */
.wait { text-align: center; }
#wait-orb { width: 280px; height: 280px; display: block; margin: 0 auto 10px; }
.wait .btn { margin-top: 18px; }

/* Call */
body.in-call { overflow: hidden; }
body.in-call #app { min-height: 100%; }
.view-call { position: fixed; inset: 0; padding: 0; display: flex; flex-direction: column; }
.view-call > .call-top, .view-call > .banner, .view-call > .dock { flex: none; }
.call-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.call-room { display: flex; gap: 8px; align-items: center; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--g100); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chip .ico { width: 15px; height: 15px; }
button.chip:hover { border-color: var(--line-strong); }
.sec { display: flex; gap: 8px; }
.sec-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(6, 21, 39, .6); border: 1px solid var(--line); color: var(--muted); transition: all .4s; }
.sec-badge .ico { width: 15px; height: 15px; }
.sec-badge.on { color: var(--mint); border-color: rgba(74, 222, 128, .35); background: rgba(22, 101, 52, .25); }
.sec-badge.warn { color: var(--amber); border-color: rgba(251, 191, 36, .4); background: rgba(120, 80, 0, .25); }
.sec-badge.strong { color: #04140A; background: linear-gradient(135deg, var(--green), var(--mint)); border-color: transparent; box-shadow: 0 0 24px rgba(74, 222, 128, .45); }

.banner { margin: 0 16px 8px; padding: 10px 14px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; background: rgba(120, 80, 0, .35); border: 1px solid rgba(251, 191, 36, .4); color: #FDE68A; }
.banner.danger { background: rgba(127, 29, 29, .55); border-color: rgba(248, 113, 113, .5); color: #FECACA; animation: alarm 2s infinite; }
@keyframes alarm { 50% { border-color: rgba(248, 113, 113, .95); } }

.call-body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 16px; }
.stage { flex: 1; min-width: 0; min-height: 0; display: flex; gap: 12px; }
.screen-stage { position: relative; flex: 1; min-width: 0; border-radius: var(--radius); overflow: hidden; background: #02070E; box-shadow: var(--shadow); }
.screen-stage video { width: 100%; height: 100%; object-fit: contain; display: block; outline: none; }
.screen-stage.control video { cursor: crosshair; box-shadow: inset 0 0 0 3px var(--red); }
.screen-tag { position: absolute; top: 12px; left: 12px; padding: 6px 10px; border-radius: 9px; background: rgba(6, 21, 39, .75); font-size: 13px; font-weight: 600; }
.screen-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.screen-stage.control #ctl-toggle { background: var(--red-strong); border-color: transparent; }

.tiles { flex: 1; min-width: 0; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-content: center; }
.stage.has-screen .tiles { flex: 0 0 240px; grid-template-columns: 1fr !important; grid-auto-rows: 150px; align-content: start; overflow-y: auto; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at 50% 35%, var(--g600), var(--g800)); box-shadow: var(--shadow); min-height: 0; transition: box-shadow .25s; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .6s; }
.tile.me video { transform: scaleX(-1); }
.tile.speaking { box-shadow: 0 0 0 2px var(--green), 0 0 30px -4px rgba(74, 222, 128, .6); }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; }
.tile.cam-off .avatar { display: grid; }
.tile.cam-off video { opacity: 0; }
.avatar b { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 700; color: var(--g700); background: linear-gradient(135deg, var(--sky), var(--g200)); box-shadow: 0 0 0 6px rgba(141, 169, 196, .12); }
.tile .label { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.tile .label span.n { padding: 5px 9px; border-radius: 8px; background: rgba(6, 21, 39, .72); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label .mic-off { width: 26px; height: 26px; border-radius: 8px; display: none; place-items: center; background: var(--red-strong); }
.tile .label .mic-off .ico { width: 15px; height: 15px; }
.tile.muted .label .mic-off { display: grid; }
.tile .host-tag { font-size: 11px; padding: 4px 7px; border-radius: 7px; background: var(--blue-strong); text-transform: uppercase; letter-spacing: .06em; }
.tile .lock { position: absolute; top: 10px; right: 10px; display: inline-flex; gap: 5px; align-items: center; padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; background: rgba(6, 21, 39, .72); color: var(--mint); }
.tile .lock .ico { width: 14px; height: 14px; }
.tile .lock:empty { display: none; }
.tile.locked video { filter: blur(18px) saturate(.4) contrast(1.4); }
.tile.locked::after { content: 'Flusso cifrato · password diversa'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 13px; color: var(--amber); background: repeating-linear-gradient(0deg, rgba(6, 21, 39, .35) 0 2px, transparent 2px 4px); text-align: center; padding: 20px; }
.tile.locked .lock { color: var(--amber); }
.tile .state { position: absolute; top: 10px; left: 10px; font-size: 12px; padding: 4px 8px; border-radius: 7px; background: rgba(6, 21, 39, .72); color: var(--amber); }
.tile .state:empty { display: none; }

/* Side panel */
.side { flex: 0 0 340px; min-height: 0; display: flex; flex-direction: column; background: var(--glass-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.side-tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); align-items: center; }
.tab { flex: 1; padding: 8px 10px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.tab[aria-selected="true"] { background: rgba(141, 169, 196, .12); color: var(--text); }
.count { font-size: 12px; color: var(--sky); }
.side-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 12px; }
.side-pane h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 6px 4px 10px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-bottom: 8px; }
.msg { max-width: 92%; }
.msg .who { font-size: 12px; color: var(--muted); margin: 0 0 3px 4px; display: flex; gap: 6px; align-items: center; }
.msg .who .ico { width: 12px; height: 12px; color: var(--green); }
.msg .body { padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: rgba(141, 169, 196, .12); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg.mine { align-self: flex-end; }
.msg.mine .who { justify-content: flex-end; margin-right: 4px; }
.msg.mine .body { background: rgba(37, 99, 235, .4); border-radius: 14px 14px 4px 14px; }
.msg.locked .body { font-family: var(--mono); color: var(--amber); background: rgba(120, 80, 0, .25); }
.msg.system { align-self: center; font-size: 12.5px; color: var(--muted); text-align: center; }
.chat-form { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; background: rgba(6, 21, 39, .7); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 12px; outline: none; }
.chat-form input:focus { border-color: var(--blue); }
.people { display: grid; gap: 6px; margin-bottom: 14px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(6, 21, 39, .45); }
.person b.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: var(--g700); background: linear-gradient(135deg, var(--sky), var(--g200)); flex: none; }
.person .pn { flex: 1; min-width: 0; }
.person .pn div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.person .pn small { display: block; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.person .pn small.warn { color: var(--amber); font-family: var(--font); }
.person .acts { display: flex; gap: 4px; }
.person .acts button { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(141, 169, 196, .06); display: grid; place-items: center; }
.person .acts button:hover { background: rgba(141, 169, 196, .16); }
.person .acts button.ok { color: var(--green); }
.person .acts button.no { color: var(--red); }
.person .acts .ico { width: 16px; height: 16px; }
.host-tools { padding: 10px 4px; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 38px; height: 22px; border-radius: 11px; background: rgba(141, 169, 196, .25); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--blue-strong); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Knocks */
.knocks { position: fixed; top: 64px; right: 16px; z-index: 40; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.knock { padding: 14px; border-radius: 16px; background: var(--glass-strong); box-shadow: var(--shadow), 0 0 0 1px rgba(96, 165, 250, .35); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: knockIn .4s cubic-bezier(.2, .9, .3, 1.3); }
.knock p { margin: 0 0 10px; font-size: 14px; }
.knock p strong { color: var(--sky); }
.knock .warn { color: var(--amber); font-size: 12.5px; }
.knock .row { display: flex; gap: 8px; }
.knock .row .btn { flex: 1; padding: 9px 12px; font-size: 14px; }
@keyframes knockIn { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }

/* Dock */
.dock { display: flex; justify-content: center; gap: 8px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
.dock-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 74px; padding: 10px 10px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); color: var(--g100); font-size: 11.5px; font-weight: 600; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .2s, border-color .2s, color .2s; }
.dock-btn .ico { width: 22px; height: 22px; }
.dock-btn:hover { border-color: var(--line-strong); background: rgba(19, 49, 92, .8); }
.dock-btn[aria-pressed="false"] { background: rgba(220, 38, 38, .85); border-color: transparent; color: #fff; }
.dock-btn.active { background: rgba(37, 99, 235, .55); border-color: rgba(96, 165, 250, .6); color: #fff; }
.dock-btn.secure { background: linear-gradient(135deg, rgba(22, 163, 74, .85), rgba(34, 197, 94, .8)); color: #04140A; border-color: transparent; }
.dock-btn.pending { border-color: var(--amber); color: var(--amber); }
.dock-btn.danger { background: var(--red-strong); border-color: transparent; color: #fff; }
.dock-btn.danger:hover { background: #B91C1C; }
.dock-btn .badge { position: absolute; top: 6px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--g900); }

/* Modal */
.modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: min(440px, calc(100vw - 32px)); width: 100%; }
.modal::backdrop { background: rgba(2, 8, 18, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-body { background: var(--g800); border-radius: 22px; padding: 26px; box-shadow: var(--shadow), 0 0 0 1px var(--line-strong); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.modal-body .muted { margin: 0; }
#modal-fields { display: flex; flex-direction: column; gap: 12px; text-align: left; }
#modal-fields:empty { display: none; }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn { flex: 1; }
.modal .note { font-size: 12.5px; color: var(--muted); text-align: left; margin: 0; }
.modal .note.warn { color: var(--amber); }
.modal .agent-box { text-align: left; font-size: 13.5px; background: rgba(6, 21, 39, .6); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.modal .agent-box a { color: var(--sky); }
.modal .agent-box ol { margin: 6px 0 0; padding-left: 18px; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: calc(100vw - 32px); }
.toast { padding: 10px 16px; border-radius: 12px; background: var(--g800); box-shadow: var(--shadow); font-size: 14px; animation: toastIn .3s ease-out; max-width: 100%; text-align: center; }
.toast.ok { box-shadow: var(--shadow), 0 0 0 1px rgba(74, 222, 128, .5); }
.toast.err { box-shadow: var(--shadow), 0 0 0 1px rgba(248, 113, 113, .6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 340px; order: -1; margin-bottom: -20px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prejoin { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; inset: 60px 10px 96px auto; width: min(360px, calc(100vw - 20px)); }
}
@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
  .code-row { flex-direction: column; }
  .admin-head { flex-direction: column; }
  .room { grid-template-columns: 1fr; }
  .room-actions { justify-content: flex-start; }
  .orb-chip { font-size: 11px; }
  .call-top { flex-wrap: wrap; padding: 10px; }
  .call-body { padding: 0 10px; }
  .sec-badge { padding: 6px 9px; font-size: 11.5px; }
  .dock { gap: 6px; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); }
  .dock-btn { min-width: 0; flex: 1 1 0; padding: 9px 4px 7px; font-size: 10px; }
  .dock-btn .ico { width: 20px; height: 20px; }
  .stage { flex-direction: column; }
  .stage.has-screen .tiles { flex: 0 0 110px; grid-auto-flow: column; grid-auto-columns: 150px; grid-auto-rows: 1fr; overflow-x: auto; overflow-y: hidden; }
  .avatar b { width: 60px; height: 60px; font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
