/* Gather – shared styles for the home page and the call page. */
:root {
  --brand: #12805f;
  --brand-dark: #0a5a43;
  --brand-soft: #e2f2ea;
  --bg: #f7f3ec;
  --card: #ffffff;
  --ink: #1c1f1e;
  --muted: #5f6763;
  --line: #e4ded3;
  --danger: #d94848;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 31, 30, .04), 0 12px 32px -12px rgba(28, 31, 30, .12);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.5; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
svg { display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- password gate ---------- */
body.gated > :not(#gate) { visibility: hidden; }
#gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 50% -10%, rgba(18, 128, 95, .35), transparent 70%), #0f1412; color: #f2f4f3; font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-card .mark { width: 64px; height: 64px; margin: 0 auto 14px; }
.gate-card h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.gate-card p { color: #9aa39e; margin: 0 0 18px; }
.gate-card input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid #2a332e; background: #161c19; color: #fff; font-size: 17px; text-align: center; }
.gate-card input:focus { outline: 2px solid #12805f; }
.gate-err { color: #ff8a8a; font-size: 14px; min-height: 20px; margin: 8px 0; }
.gate-card button { width: 100%; padding: 14px; border-radius: 12px; border: 0; background: #12805f; color: #fff; font-size: 17px; font-weight: 700; }
.gate-card button:disabled { opacity: .6; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.01em; color: inherit; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; }
.mark.small { width: 24px; height: 24px; border-radius: 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--brand); }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; white-space: nowrap; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: #f3efe7; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.big { font-size: 17px; padding: 15px 26px; border-radius: 14px; }
.field { flex: 1 1 200px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.field:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.textbtn { background: none; border: 0; padding: 4px 6px; color: var(--brand); font-weight: 600; border-radius: 6px; }
.textbtn:hover { background: var(--brand-soft); }

/* ---------- home ---------- */
.top { padding: 18px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; }
.top-link { font-weight: 600; color: var(--muted); text-decoration: none; font-size: 15px; }
.top-link:hover { color: var(--ink); }

.hero { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 24px 20px 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 16px; font-weight: 800; }
.hero .lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: 34em; }
.cta { margin-bottom: 18px; }
.joinrow { display: flex; gap: 10px; max-width: 460px; }
.joinrow .field { flex: 1; }

.roomcard { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.roomcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.roomtitle { font-size: 26px; margin: 0 0 12px; letter-spacing: -0.02em; line-height: 1.2; word-break: break-word; }
.rename { display: flex; gap: 8px; margin-bottom: 12px; }
.linkchip { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 12px; padding: 11px 14px; font-size: 14px; color: var(--muted); word-break: break-all; margin-bottom: 14px; }
.linkchip svg { flex: 0 0 auto; color: var(--brand); }
.roomcard .row .btn { flex: 1 1 auto; }
.hint { font-size: 13px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }

.section-title { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 18px; }
.steps { padding: 36px 20px 8px; }
.stepgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; counter-reset: step; }
.stepgrid li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.num { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; }
.stepgrid h3, .feature h3 { margin: 4px 0 4px; font-size: 17px; }
.stepgrid p, .feature p { margin: 0; color: var(--muted); font-size: 15px; }

.features { padding: 28px 20px 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feature { padding: 18px 4px; }
.feature .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 10px; }

.foot { padding: 36px 20px 48px; color: var(--muted); font-size: 14px; }
.foot .tip { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; margin-bottom: 22px; color: var(--ink); }
.foot .tip img { width: 44px; height: 44px; border-radius: 11px; flex: 0 0 auto; }
.foot .tip strong { display: block; margin-bottom: 2px; }
.foot .tip span { color: var(--muted); font-size: 14px; }

/* name chip, direct files */
.top-right { display: flex; align-items: center; gap: 14px; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; max-width: 180px; }
.me-chip:hover { background: #f3efe7; }
.me-chip #meName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }

.direct { padding: 0 20px 24px; }
.direct-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.dtitle { font-size: 22px; letter-spacing: -0.02em; margin: 6px 0 16px; line-height: 1.2; }
.dlabel { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.dselect { width: 100%; appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='none' stroke='%235f6763' stroke-width='2.2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 40px; font-weight: 600; }
.dselect:disabled { color: var(--muted); background-color: var(--bg); }
.ddrop { display: flex; align-items: center; gap: 10px; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); cursor: pointer; font-weight: 600; transition: border-color .15s, background .15s; min-width: 0; }
.ddrop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddrop svg { flex: 0 0 auto; color: var(--brand); }
.ddrop:hover, .ddrop.over { border-color: var(--brand); background: var(--brand-soft); }
.ddrop.has { border-style: solid; border-color: var(--brand); color: var(--ink); background: var(--brand-soft); }
.dprogress { height: 6px; border-radius: 3px; background: var(--bg); margin-top: 14px; overflow: hidden; }
.dprogress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.dsend { width: 100%; margin-top: 16px; }
.dsend:disabled { opacity: .5; cursor: default; }
.dstatus { min-height: 1.2em; margin: 10px 0 0; font-weight: 600; font-size: 14px; color: var(--muted); }
.dstatus.ok { color: var(--brand); }
.dstatus.bad { color: var(--danger); }
.dhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dcount { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; letter-spacing: 0; text-transform: none; font-size: 11.5px; }
.dlist { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.dempty { color: var(--muted); font-size: 15px; margin: 18px 0 8px; }
.ditem { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 12px 6px; border-top: 1px solid var(--line); }
.ditem:first-child { border-top: 0; }
.ditem.fresh .dname::after { content: 'New'; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.dico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.dmeta { min-width: 0; }
.dname { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsub { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dget { padding: 9px 14px; font-size: 14px; }
.dget.wait { opacity: .5; pointer-events: none; }

.namegate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(247, 243, 236, .92); backdrop-filter: blur(6px); }
body.naming { overflow: hidden; }
.namecard { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px 24px 22px; box-shadow: 0 30px 80px -20px rgba(28, 31, 30, .3); text-align: center; }
.namecard .mark { width: 56px; height: 56px; margin: 0 auto 12px; }
.namecard h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.namecard p { color: var(--muted); margin: 0 0 18px; }
.namecard .field { width: 100%; font-size: 18px; text-align: center; padding: 14px; }
.namecard .btn { width: 100%; margin-top: 8px; }
.namecard .textbtn { margin-top: 12px; }
.name-err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 6px 0 2px; }
#toast.hometoast { box-shadow: 0 10px 30px -8px rgba(28, 31, 30, .35); bottom: 24px; }

@media (max-width: 480px) {
  .top-link { display: none; }
  .ditem { grid-template-columns: 40px 1fr; }
  .ditem .dget { grid-column: 2; justify-self: start; margin-top: 4px; }
}

@media (min-width: 880px) {
  .direct-grid { grid-template-columns: 1fr 1.15fr; }
  .hero { grid-template-columns: 1.15fr 1fr; gap: 56px; padding: 40px 20px 56px; }
  .stepgrid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- call page (dark) ---------- */
body.call-page { background: #0f1412; color: #f2f4f3; height: 100dvh; overflow: hidden; }
.screen { height: 100%; }

/* pre-join */
#prejoin { display: flex; flex-direction: column; overflow-y: auto; background: radial-gradient(900px 500px at 50% -10%, rgba(18, 128, 95, .35), transparent 70%), #0f1412; }
#prejoin .top { padding: 16px 20px; padding-top: calc(16px + env(safe-area-inset-top)); }
#prejoin .top .wrap { padding: 0; }
.pre-main { flex: 1; display: grid; place-items: center; padding: 8px 16px 32px; }
.pre-card { width: 100%; max-width: 520px; }
.pre-card h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 18px; letter-spacing: -0.02em; word-break: break-word; }
.preview { position: relative; aspect-ratio: 4 / 3; background: #1a211e; border-radius: 20px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview.no-video video { visibility: hidden; }
.preview .avatar { position: absolute; inset: 0; display: none; place-items: center; }
.preview.no-video .avatar { display: grid; }
.preview .pre-ctl { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.pre-status { color: #f0b36b; font-size: 14px; margin: -4px 0 12px; min-height: 1em; line-height: 1.45; }
.pre-card .name { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid #2a332e; background: #161c19; color: #fff; margin-bottom: 12px; }
.pre-card .name::placeholder { color: #7c8580; }
.pre-card .name:focus { outline: 2px solid var(--brand); }
.join { width: 100%; padding: 15px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; }
.join:hover { background: #159a72; }
.join:disabled { opacity: .6; cursor: default; }
.pre-card .foot { margin-top: 14px; font-size: 13px; color: #9aa39e; text-align: center; padding: 0; }
.pre-card .foot a { color: #d5dbd8; }

/* in-call layout */
#call { display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); font-size: 14px; }
.bar .room { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar .room strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.bar .pill { background: #1e2622; padding: 4px 10px; border-radius: 999px; color: #d5dbd8; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.bar .right { display: flex; align-items: center; gap: 10px; }
.bar #timer { color: #9aa39e; font-variant-numeric: tabular-nums; }
.bar #netStatus { color: #f0b36b; }
.bar #netStatus:empty { display: none; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; border: 0; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.linkbtn:hover { background: #159a72; }

#layout { flex: 1; min-height: 0; padding: 0 8px; display: flex; gap: 8px; flex-direction: column; }
#grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; }
#grid.scroll { grid-auto-rows: auto; align-content: start; overflow-y: auto; }
#grid.scroll .tile { aspect-ratio: 4 / 3; }
#stage { display: none; flex: 1; min-height: 0; }
#stage .tile { width: 100%; height: 100%; }
#strip { display: none; }
.has-stage #grid { display: none; }
.has-stage #stage { display: block; }
.has-stage #strip { display: flex; gap: 8px; overflow-x: auto; flex: 0 0 auto; scrollbar-width: thin; }
.has-stage #strip .tile { flex: 0 0 auto; width: 150px; aspect-ratio: 4 / 3; }
@media (min-width: 900px) {
  .has-stage #layout { flex-direction: row; }
  .has-stage #strip { flex-direction: column; width: 220px; overflow-x: hidden; overflow-y: auto; }
  .has-stage #strip .tile { width: 100%; }
}

.tile { position: relative; background: #1a211e; border-radius: 16px; overflow: hidden; min-height: 0; min-width: 0; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile[data-kind="screen"] { background: #0a0d0c; }
.tile[data-kind="screen"] video { object-fit: contain; background: #0a0d0c; }
.tile.mirror video { transform: scaleX(-1); }
.tile.no-video video { visibility: hidden; }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; }
.tile.no-video .avatar { display: grid; }
.avatar span { width: clamp(48px, 22%, 120px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(20px, 5vw, 46px); font-weight: 700; color: #fff; background: var(--c, #12805f); }
.tile.speaking { box-shadow: inset 0 0 0 3px #3ddc84; }
.tile .status { position: absolute; inset: 0; display: none; place-items: center; font-size: 14px; color: #d5dbd8; background: rgba(0, 0, 0, .45); }
.tile.connecting .status { display: grid; }
.badge { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; max-width: calc(100% - 20px); }
.badge .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge .mic-off { display: none; color: #ff8a8a; }
.tile.muted .badge .mic-off { display: inline-flex; }
.tile .pin { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.tile:hover .pin, .tile.pinned .pin { opacity: 1; }
.tile.pinned .pin { background: var(--brand); }
@media (pointer: coarse) { .tile .pin { opacity: .7; } }

.controls { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
.ctl { width: 54px; height: 54px; border-radius: 50%; border: 0; background: #262f2a; color: #fff; display: grid; place-items: center; position: relative; transition: background .15s; }
.ctl:hover { background: #313c36; }
.ctl.off { background: var(--danger); }
.ctl.on { background: var(--brand); }
.ctl:disabled { opacity: .45; cursor: default; }
.ctl .i-on, .ctl .i-off { display: block; }
.ctl:not(.off) .i-off { display: none; }
.ctl.off .i-on { display: none; }
.ctl.leave { width: auto; padding: 0 22px; border-radius: 27px; background: var(--danger); font-weight: 700; }
.ctl.leave:hover { background: #c33d3d; }

/* share menu (desktop: screen or photos) */
.controls { position: relative; }
.sharemenu { position: absolute; bottom: calc(100% - 2px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; min-width: 290px; padding: 6px; background: #1b221f; border: 1px solid #2a332e; border-radius: 16px; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7); }
.sharemenu button { display: flex; gap: 12px; align-items: center; text-align: left; background: none; border: 0; color: #fff; padding: 12px; border-radius: 12px; }
.sharemenu button:hover { background: #262f2a; }
.sharemenu svg { flex: 0 0 auto; color: #3ddc84; }
.sharemenu strong { display: block; font-size: 15px; }
.sharemenu small { display: block; color: #9aa39e; font-size: 13px; }

/* presenter bar: shown to whoever is sharing */
.presentbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 8px 8px 0; padding: 8px 10px 8px 14px; background: #15231d; border: 1px solid #1f3a2f; border-radius: 14px; font-size: 14px; }
.pb-label { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-right: auto; white-space: nowrap; }
.pb-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 4px rgba(255, 90, 90, .2); }
.pb-media { display: flex; align-items: center; gap: 4px; }
.pb-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: #22302a; color: #fff; display: grid; place-items: center; }
.pb-btn:hover { background: #2c3d35; }
.pb-btn:disabled { opacity: .35; cursor: default; }
.pb-count { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; color: #c9d3ce; font-weight: 600; }
#pbPlay .i-play { display: none; }
#pbPlay.paused .i-play { display: block; }
#pbPlay.paused .i-pause { display: none; }
.pb-tv { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: #d5dbd8; padding: 7px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.pb-tv:hover { background: #22302a; }
.pb-switch { width: 34px; height: 20px; border-radius: 10px; background: #3a4540; position: relative; transition: background .15s; flex: 0 0 auto; }
.pb-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pb-tv.on .pb-switch { background: var(--brand); }
.pb-tv.on .pb-switch::after { transform: translateX(14px); }
.pb-stop { background: var(--danger); color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; }
.pb-stop:hover { background: #c33d3d; }
#presenterPool { position: fixed; left: 0; top: 0; width: 2px; height: 2px; overflow: hidden; opacity: .01; pointer-events: none; }
#presenterPool video, #presenterPool canvas { width: 2px; height: 2px; }

/* files */
.iconbtn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #1e2622; color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.iconbtn:hover { background: #262f2a; }
.iconbtn.on { background: var(--brand); }
.badge-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #3ddc84; color: #0f1412; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.filespanel { position: fixed; top: calc(64px + env(safe-area-inset-top)); right: 12px; bottom: calc(88px + env(safe-area-inset-bottom)); width: 360px; z-index: 15; display: flex; flex-direction: column; background: #161c19; border: 1px solid #2a332e; border-radius: 18px; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .8); overflow: hidden; }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 18px; }
.fp-head h2 { margin: 0; font-size: 18px; }
.fp-close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: #c9d3ce; display: grid; place-items: center; }
.fp-close:hover { background: #22302a; }
.fp-send { padding: 6px 18px 14px; border-bottom: 1px solid #232b27; }
.fp-send .btn { width: 100%; }
.fp-send small { display: block; color: #8d9792; font-size: 12.5px; margin-top: 8px; line-height: 1.4; }
.fp-list { list-style: none; margin: 0; padding: 6px 8px 10px; overflow-y: auto; flex: 1; }
.fp-empty { color: #8d9792; font-size: 14px; text-align: center; padding: 24px 24px 30px; margin: 0; }
.fp-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; }
.fp-item:hover { background: #1c2420; }
.fp-ico { width: 40px; height: 40px; border-radius: 10px; background: #22302a; color: #3ddc84; display: grid; place-items: center; }
.fp-meta { min-width: 0; }
.fp-name { display: block; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-sub { display: block; color: #8d9792; font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-bar { height: 4px; border-radius: 2px; background: #2a332e; margin-top: 7px; overflow: hidden; }
.fp-bar i { display: block; height: 100%; width: 0; background: #3ddc84; transition: width .2s; }
.fp-get { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #22302a; color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.fp-get:hover { background: #2c3d35; }
.fp-get.wait { opacity: .55; pointer-events: none; }
.fp-state { color: #8d9792; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fp-state.bad { color: #ff8a8a; }
.drophint { position: fixed; inset: 10px; z-index: 30; border: 3px dashed #3ddc84; border-radius: 22px; background: rgba(15, 20, 18, .82); display: grid; place-items: center; pointer-events: none; }
.drophint div { font-size: 26px; font-weight: 800; color: #fff; }
@media (max-width: 700px) {
  .filespanel { left: 8px; right: 8px; width: auto; top: auto; max-height: 64vh; bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .bar #timer { display: none; }
}
body.tv #filesBtn, body.tv .filespanel, body.tv .drophint { display: none; }

/* TV mode: nothing to press, bigger labels, remote's Back leaves */
body.tv .presentbar, body.tv .sharemenu { display: none; }

/* TV full screen: the sharer's picture edge to edge, nothing else */
body.tv.tv-full { background: #000; }
body.tv.tv-full .bar, body.tv.tv-full #strip { display: none; }
body.tv.tv-full #layout { padding: 0; }
body.tv.tv-full #stage { position: fixed; inset: 0; z-index: 5; }
body.tv.tv-full #stage .tile { border-radius: 0; background: #000; box-shadow: none; }
body.tv.tv-full #stage .tile video { object-fit: contain; background: #000; }
body.tv.tv-full #stage .badge { display: none; }
body.tv .controls, body.tv #linkBtn, body.tv .tile .pin { display: none; }
body.tv #layout { padding: 0 12px 12px; }
body.tv .bar { font-size: 18px; padding: 12px 18px; }
body.tv .bar .room strong { font-size: 20px; }
body.tv .badge { font-size: 17px; padding: 7px 14px; }
body.tv .tile .status { font-size: 20px; }
body.tv #left .btn { padding: 16px 26px; font-size: 20px; }
body.tv #left .btn:focus { outline: 3px solid #3ddc84; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 10px); background: #fff; color: #111; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 10; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#left { display: grid; place-items: center; padding: 20px; text-align: center; background: radial-gradient(900px 500px at 50% -10%, rgba(18, 128, 95, .35), transparent 70%), #0f1412; }
#left > div { width: 100%; max-width: 420px; }
#left .brand { justify-content: center; margin-bottom: 28px; }
#left h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -0.02em; }
#left p { color: #9aa39e; margin: 0 0 22px; }
#left .row { justify-content: center; }
#left .btn { background: #1e2622; border-color: #2a332e; color: #fff; }
#left .btn:hover { background: #262f2a; }
#left .btn.primary { background: var(--brand); border-color: var(--brand); }
#left .btn.primary:hover { background: #159a72; }
