:root {
  color-scheme: dark;
  --bg: #080b14;
  --panel: rgba(16, 21, 36, .86);
  --panel-solid: #101524;
  --line: rgba(255,255,255,.09);
  --muted: #8d95a9;
  --text: #f5f7fb;
  --violet: #7868ff;
  --violet-2: #a79eff;
  --lime: #b8f36b;
  --danger: #ff6e7f;
  --radius: 20px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(110px); opacity: .18; pointer-events: none; }
.ambient-a { width: 42rem; height: 42rem; background: var(--violet); top: -22rem; left: -12rem; }
.ambient-b { width: 30rem; height: 30rem; background: #38bdf8; bottom: -18rem; right: -12rem; opacity: .1; }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 700; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--violet); color: white; font: 700 .72rem ui-monospace, monospace; box-shadow: 0 0 25px rgba(120,104,255,.3); }
.brand-logo { width: 2rem; height: 2rem; object-fit: contain; border-radius: 7px; }
.entry-shell { min-height: 100vh; padding: 2.25rem max(5vw, 2rem); position: relative; }
.entry-grid { min-height: calc(100vh - 7rem); display: grid; grid-template-columns: 1.08fr .72fr; gap: 7vw; align-items: center; max-width: 1200px; margin: auto; }
.eyebrow, .crumb { color: var(--violet-2); font: 700 .72rem ui-monospace, monospace; letter-spacing: .14em; margin: 0 0 1.1rem; }
.intro h1 { font-size: clamp(3.3rem, 6.8vw, 6.8rem); line-height: .94; letter-spacing: -.075em; margin: 0; font-weight: 600; }
.intro h1 span { color: transparent; -webkit-text-stroke: 1px rgba(245,247,251,.65); }
.intro h1 .hero-solid { color: var(--text); -webkit-text-stroke: 0; }
.intro-copy { color: #aab1c1; font-size: 1.1rem; line-height: 1.7; max-width: 33rem; margin: 2rem 0; }
.trust-row { display: flex; align-items: center; gap: 1rem; color: #757d92; font: .7rem ui-monospace, monospace; letter-spacing: .08em; }
.trust-row b { font: inherit; font-weight: 400; }
.trust-row i { width: 2.5rem; height: 1px; background: var(--line); }
.entry-card { background: linear-gradient(145deg, rgba(27,34,56,.92), rgba(12,16,29,.96)); border: 1px solid var(--line); border-radius: 26px; padding: 1.1rem; box-shadow: 0 30px 90px rgba(0,0,0,.38); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; background: rgba(3,6,14,.58); padding: .35rem; border-radius: 13px; }
.mode { border: 0; background: transparent; padding: .85rem; border-radius: 9px; color: var(--muted); cursor: pointer; }
.mode.active { color: var(--text); background: rgba(255,255,255,.08); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset; }
.entry-card form { padding: 2rem 1.25rem 1.15rem; }
.device-identity { display: flex; align-items: center; gap: .8rem; padding: .8rem; margin: -.5rem 0 1.4rem; border: 1px solid var(--line); border-radius: 11px; background: rgba(120,104,255,.06); }
.device-icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; background: rgba(120,104,255,.18); color: var(--violet-2); }
.device-identity small, .device-identity strong { display: block; }
.device-identity small { color: var(--muted); font-size: .7rem; margin-bottom: .15rem; }
.device-identity strong { font: 700 .92rem ui-monospace, monospace; letter-spacing: .12em; }
label { display: block; color: #c8cede; font-size: .86rem; margin-bottom: .55rem; }
input, textarea { width: 100%; border: 1px solid rgba(255,255,255,.11); background: rgba(4,7,15,.62); color: white; border-radius: 11px; padding: .95rem 1rem; outline: 0; }
input:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(120,104,255,.14); }
#codeField { margin-top: 1rem; }
#joinCode { font: 700 1.35rem ui-monospace, monospace; letter-spacing: .3em; }
.primary { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 11px; background: var(--violet); padding: .95rem 1rem; margin-top: 1.3rem; cursor: pointer; font-weight: 600; box-shadow: 0 12px 35px rgba(120,104,255,.25); }
.primary:hover { background: #897bff; }
.primary.small { width: auto; margin: 0; }
.keycap { font: .8rem ui-monospace, monospace; padding: .2rem .4rem; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; }
.form-note { color: #778096; font-size: .78rem; line-height: 1.5; margin: 1rem 0 0; }
.field-hint { color: #6f778c; font-size: .72rem; margin: .5rem 0 0; }
.error { color: var(--danger); min-height: 1.2em; margin: 0 2.3rem 1rem; font-size: .85rem; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { border-right: 1px solid var(--line); background: rgba(7,10,18,.9); padding: 1.75rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 3; }
.sidebar .brand { padding: 0 .65rem; margin-bottom: 3rem; }
nav { display: grid; gap: .35rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; width: 100%; border: 0; background: transparent; color: var(--muted); padding: .8rem .75rem; border-radius: 10px; cursor: pointer; text-align: left; }
.nav-item span { font: 1.1rem ui-monospace, monospace; color: #71798d; }
.nav-item b { margin-left: auto; min-width: 1.5rem; padding: .1rem .35rem; border-radius: 10px; background: rgba(255,255,255,.07); font: .66rem ui-monospace, monospace; text-align: center; }
.nav-item.active { background: rgba(120,104,255,.12); color: white; }
.nav-item.active span { color: var(--violet-2); }
.session-mini { margin-top: auto; padding: .85rem .65rem; border-top: 1px solid var(--line); display: flex; gap: .65rem; align-items: center; }
.status-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #f1b85b; box-shadow: 0 0 0 4px rgba(241,184,91,.1); }
.status-dot.connected { background: var(--lime); box-shadow: 0 0 0 4px rgba(184,243,107,.1); }
.session-mini strong, .session-mini small { display: block; }
.session-mini strong { font-size: .78rem; }
.session-mini small { color: var(--muted); font-size: .7rem; margin-top: .2rem; }
.leave { border: 1px solid var(--line); background: transparent; color: #9da5b8; border-radius: 9px; padding: .65rem; cursor: pointer; margin-top: .75rem; }
.leave:hover { color: var(--danger); border-color: rgba(255,110,127,.35); }
.main-area { min-width: 0; padding: 0 clamp(1rem,3vw,3.25rem) 3rem; }
.topbar { min-height: 106px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.topbar h2, .section-heading h2 { font-size: 1.35rem; margin: 0; letter-spacing: -.03em; }
.topbar .crumb, .section-heading .crumb { margin-bottom: .45rem; }
.pairing-chip { display: flex; align-items: center; gap: .85rem; color: var(--muted); font-size: .74rem; }
.pairing-chip button { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 10px; padding: .6rem .75rem; cursor: pointer; }
.pairing-chip strong { font: 700 1rem ui-monospace, monospace; letter-spacing: .15em; }
.pairing-chip em { color: var(--violet-2); font-style: normal; font-size: .7rem; }
.panel { display: none; max-width: 1420px; margin: 0 auto; }
.panel.active { display: block; }
.screen-stage { min-height: 430px; height: min(56vh, 650px); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); background: radial-gradient(circle at 50% 45%, #192037 0%, #0d111e 55%, #090c15 100%); position: relative; overflow: hidden; display: grid; place-items: center; }
.screen-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 45px 45px; mask-image: radial-gradient(circle, black, transparent 73%); }
#remoteVideo { width: 100%; height: 100%; object-fit: contain; background: #05070d; position: absolute; inset: 0; display: none; }
.screen-empty { text-align: center; z-index: 1; max-width: 31rem; padding: 2rem; }
.screen-empty h3 { font-size: 1.45rem; margin: 1.8rem 0 .5rem; }
.screen-empty p { color: var(--muted); line-height: 1.6; margin: 0; }
.signal-orbit { width: 88px; height: 88px; position: relative; display: grid; place-items: center; margin: auto; }
.signal-orbit span { position: absolute; inset: 0; border: 1px solid rgba(167,158,255,.18); border-radius: 50%; animation: pulse 2.8s infinite; }
.signal-orbit span:nth-child(2) { inset: 12px; animation-delay: .3s; }
.signal-orbit span:nth-child(3) { inset: 24px; animation-delay: .6s; }
.signal-orbit b { color: var(--violet-2); font-size: 1.8rem; }
@keyframes pulse { 50% { border-color: rgba(167,158,255,.58); box-shadow: 0 0 28px rgba(120,104,255,.18); } }
.screen-badge { position: absolute; top: 1rem; left: 1rem; display: flex; align-items: center; gap: .5rem; background: rgba(3,5,11,.72); backdrop-filter: blur(10px); padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 8px; font-size: .7rem; z-index: 3; }
.screen-badge span { width: .42rem; height: .42rem; background: #687085; border-radius: 50%; }
.screen-badge span.live { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.remote-pointer { position: absolute; left: 50%; top: 50%; z-index: 5; pointer-events: none; transition: left .08s linear, top .08s linear; }
.remote-pointer span { display: block; width: 0; height: 0; border-top: 15px solid var(--lime); border-right: 10px solid transparent; transform: rotate(-18deg); filter: drop-shadow(0 2px 2px #000); }
.remote-pointer small { background: var(--lime); color: #111; border-radius: 4px; padding: .15rem .35rem; font-size: .6rem; }
.action-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: .85rem 0 1.6rem; }
.tool { min-width: 0; display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 13px; padding: .85rem; cursor: pointer; text-align: left; }
.tool:hover { border-color: rgba(167,158,255,.32); background: rgba(120,104,255,.07); }
.tool > span { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: 0 0 auto; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--violet-2); }
.tool b, .tool small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool b { font-size: .82rem; }
.tool small { color: var(--muted); font-size: .66rem; margin-top: .25rem; }
.primary-tool { background: var(--violet); border-color: var(--violet); }
.primary-tool:hover { background: #887aff; }
.primary-tool > span { color: white; background: rgba(255,255,255,.12); }
.primary-tool small { color: rgba(255,255,255,.7); }
.overview-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: .85rem; }
.overview-grid article { border: 1px solid var(--line); background: rgba(255,255,255,.022); border-radius: 14px; padding: 1.2rem; }
.overview-grid article > p { color: var(--muted); font: .66rem ui-monospace, monospace; letter-spacing: .12em; margin: 0 0 1rem; }
.overview-grid h3 { margin: 0 0 .4rem; font-size: .95rem; }
.overview-grid article > span { color: var(--muted); font-size: .72rem; }
.activity-list { display: grid; gap: .65rem; }
.activity-list div { display: flex; align-items: center; gap: .6rem; font-size: .75rem; }
.activity-list i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--lime); }
.activity-list i.violet { background: var(--violet); }
.activity-list time { margin-left: auto; color: var(--muted); font: .62rem ui-monospace, monospace; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: .75rem 0 2rem; }
.upload-button { margin: 0; display: inline-flex; align-items: center; padding: .75rem 1rem; border-radius: 10px; background: var(--violet); color: white; cursor: pointer; }
.upload-button input { display: none; }
.drop-zone { border: 1px dashed rgba(167,158,255,.3); background: rgba(120,104,255,.04); border-radius: 18px; padding: 3.25rem 2rem; text-align: center; transition: .2s; }
.drop-zone.dragging { border-color: var(--lime); background: rgba(184,243,107,.05); transform: scale(.995); }
.drop-zone > span { color: var(--violet-2); font-size: 2rem; }
.drop-zone h3 { margin: .7rem 0 .35rem; }
.drop-zone p { color: var(--muted); margin: 0; }
.upload-queue { margin-top: 1rem; display: grid; gap: .5rem; }
.upload-item { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; padding: .8rem 1rem; border-radius: 10px; background: rgba(255,255,255,.03); font-size: .78rem; }
.upload-item progress { grid-column: 1/-1; width: 100%; accent-color: var(--violet); }
.file-list { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.file-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 1.25rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.file-row small { color: var(--muted); }
.file-row button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: .5rem .7rem; cursor: pointer; }
.empty-row { text-align: center; color: var(--muted); padding: 2rem; }
.chat-panel { min-height: calc(100vh - 140px); position: relative; padding-bottom: 85px; }
.messages { display: flex; flex-direction: column; gap: .8rem; }
.message { align-self: flex-start; max-width: min(70%, 600px); background: rgba(255,255,255,.06); padding: .75rem 1rem; border-radius: 14px 14px 14px 4px; line-height: 1.45; font-size: .9rem; }
.message.own { align-self: flex-end; background: var(--violet); border-radius: 14px 14px 4px 14px; }
.message.system { align-self: center; background: transparent; color: var(--muted); font-size: .75rem; }
.message small { display: block; opacity: .6; margin-top: .25rem; font-size: .62rem; }
.composer { position: fixed; left: calc(240px + 3vw); right: 3vw; bottom: 1.5rem; max-width: 1420px; margin: auto; display: grid; grid-template-columns: 1fr auto; gap: .7rem; background: rgba(8,11,20,.84); backdrop-filter: blur(15px); padding: .6rem; border: 1px solid var(--line); border-radius: 14px; }
.composer button { border: 0; background: var(--violet); border-radius: 9px; padding: 0 1.3rem; cursor: pointer; }
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: #f5f7fb; color: #131722; border-radius: 10px; padding: .8rem 1rem; box-shadow: 0 15px 50px #0007; transform: translateY(120px); opacity: 0; transition: .25s; z-index: 20; }
.toast.show { transform: translateY(0); opacity: 1; }
.update-available { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 25; display: flex; align-items: center; gap: .7rem; border: 1px solid rgba(184,243,107,.28); background: #151c20; color: white; border-radius: 12px; padding: .7rem .9rem; box-shadow: 0 16px 50px rgba(0,0,0,.42); cursor: pointer; text-align: left; animation: updateIn .35s ease-out; }
.update-available > span { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: rgba(184,243,107,.12); color: var(--lime); font-size: 1.1rem; }
.update-available b, .update-available small { display: block; }
.update-available b { font-size: .78rem; }
.update-available small { margin-top: .15rem; color: #9ba6a0; font-size: .66rem; }
@keyframes updateIn { from { transform: translateY(-12px); opacity: 0; } }
dialog { border: 1px solid var(--line); border-radius: 18px; background: #111624; color: white; max-width: 520px; width: calc(100% - 2rem); padding: 1.5rem; box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(5px); }
dialog h3 { margin: 0 0 1rem; }
dialog textarea { height: 180px; resize: vertical; }
dialog form > div { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1rem; }
.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: .7rem 1rem; }
@media (max-width: 900px) {
  .entry-grid { grid-template-columns: 1fr; gap: 3rem; padding: 4rem 0; }
  .intro h1 { font-size: clamp(3rem, 12vw, 5rem); }
  .workspace { grid-template-columns: 1fr; padding-bottom: 74px; }
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: 70px; flex-direction: row; padding: .55rem; border: 1px solid var(--line); background: rgba(8,11,20,.95); backdrop-filter: blur(15px); }
  .sidebar .brand, .session-mini, .leave { display: none; }
  .sidebar nav { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .nav-item { flex-direction: column; gap: .15rem; justify-content: center; padding: .35rem; font-size: .67rem; }
  .nav-item span { font-size: 1rem; }
  .nav-item b { position: absolute; margin: 0 0 1.25rem 2.2rem; }
  .main-area { padding: 0 1rem 2rem; }
  .topbar { min-height: 88px; }
  .pairing-chip > span { display: none; }
  .action-strip { grid-template-columns: 1fr 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .screen-stage { min-height: 330px; height: 48vh; }
  .composer { left: 1rem; right: 1rem; bottom: 84px; }
}
@media (max-width: 560px) {
  .entry-shell { padding: 1.25rem; }
  .entry-grid { padding-top: 2rem; }
  .intro-copy { font-size: 1rem; }
  .trust-row { gap: .5rem; }
  .trust-row i { width: .7rem; }
  .entry-card form { padding: 1.5rem .5rem .5rem; }
  .topbar { align-items: center; }
  .topbar h2 { font-size: 1rem; }
  .pairing-chip strong { font-size: .85rem; }
  .pairing-chip em { display: none; }
  .action-strip { grid-template-columns: 1fr; }
  .overview-grid { display: none; }
  .screen-stage { min-height: 300px; }
  .screen-empty { padding: 1.25rem; }
  .file-row { grid-template-columns: minmax(0,1fr) auto; }
  .file-row > small { display: none; }
  .message { max-width: 88%; }
}
