/* ============================================================
   Kosmas Web – what the desktop app.css doesn't have:
   sign-in, sharing box, local folders, the docked player.
   app.css is the desktop file unchanged; mobile.css (≤ 760 px)
   comes after the view styles.
   ============================================================ */
[hidden] { display: none !important; }
.badge.video { background: rgba(229,100,110,.18); color: #f19aa1; }
.mob-only { display: none !important; }
#mob-scrim { display: none; }
img.ub-avatar { object-fit: cover; }
a.npb { display: inline-grid; place-items: center; text-decoration: none; }

/* ---------- visibility, licence, tokens ---------- */
.webmeta { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.webmeta .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.webmeta .seg { flex-wrap: wrap; }
.webmeta select.input { height: 30px; }
.webmeta .lnk { font-size: 12px; color: var(--text-3); word-break: break-all; }
.tok-new { font: 13px ui-monospace, monospace; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--input); word-break: break-all; user-select: all; }

/* ---------- sign-in ---------- */
.login { height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg-0); }
.login .box { width: min(400px, 100%); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 26px; }
.login .mark { width: 44px; height: 44px; display: block; margin: 0 0 14px; }
.login h1 { margin: 0 0 6px; font: 650 22px var(--font-display); display: flex; align-items: center; }
.login p { color: var(--text-2); margin: 0 0 18px; }
.login .btn { width: 100%; height: 38px; justify-content: center; }
.login .discord { background: #5865f2; color: #fff; font-weight: 600; }
.login .discord:hover { background: #4752c4; }

/* ---------- alpha: a plain tag and one line under the header ---------- */
.alpha-badge { display: inline-block; margin-left: 8px; padding: 0 5px; border-radius: 3px; border: 1px solid var(--border-2); color: var(--text-3);
  font: 600 10px/16px var(--font); letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.alpha-note { flex: none; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 6px 4px 16px; background: var(--bg-2);
  border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.alpha-note .grow { min-width: 0; }
.alpha-note b { color: var(--text-2); font-weight: 600; }
.alpha-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.alpha-note .npb { width: 26px; height: 26px; }
.alpha-note .npb i { font-size: 15px; }
.login .alpha-badge { vertical-align: 0; }

/* ---------- account + desktop download in the user bar ---------- */
.userbar .ub-acc { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; cursor: pointer; border-radius: 4px; padding: 2px; margin: -2px; }
.userbar .ub-acc:hover { background: var(--hover); }
.dl-desk { display: flex; align-items: center; gap: 8px; margin: 0 8px 6px; padding: 6px 10px; border-radius: 4px; color: var(--text-2); font-size: 13px; }
.dl-desk:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.dl-desk i { color: var(--text-3); }
.desk-only { color: var(--text-3); font-size: 12px; }
.desk-only a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- test data ---------- */
.badge.test { background: rgba(239,154,75,.16); color: #ef9a4b; }

/* ---------- local folders ---------- */
.loc-side .grp { display: flex; align-items: center; gap: 2px; }
.loc-side .grp button:first-of-type { margin-left: auto; }
.loc-side .loc-root .loc-x { opacity: 0; margin-left: 2px; width: 22px; height: 22px; }
.loc-side .loc-root:hover .loc-x, .loc-side .loc-root:focus-within .loc-x { opacity: 1; }
.loc-side .loc-root.wait { color: #ef9a4b; }
.loc-side .loc-root.wait .n { color: inherit; }
.loc-side .loc-add { color: var(--text-2); }
.loc-scan { margin: 6px 10px; color: var(--text-2); }
.loc-bar { height: 3px; border-radius: 2px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.loc-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.spin { animation: lspin 1s linear infinite; display: inline-block; }
@keyframes lspin { to { transform: rotate(360deg); } }
.mcard .th .lmiss, .mtile .lmiss { position: absolute; left: 8px; bottom: 8px; font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,.72); color: #fff; display: flex; align-items: center; gap: 4px; max-width: calc(100% - 70px); }
.kv-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.kv-file code { word-break: break-all; font-size: 12.5px; }
.lmiss-box { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border-2); }
.lmiss-box > i { font-size: 20px; color: var(--text-3); }
.mtile.missing { opacity: .6; }
.mtile > i { position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; font-size: 22px; color: var(--text-3); }
.lib-insp .hero > img + .pl, .lib-insp .hero > .pl { z-index: 1; }
@media (max-width: 760px) {
  .sg { grid-template-columns: 46px minmax(0, 1fr) auto !important; }
  .sg .mtile { display: none; }
  .lmiss-box { flex-wrap: wrap; }
}

/* ============================================================
   Player – rpcatalog/ui/player.py (STYLE): docked right of the
   content, its own dark palette like the native player
   ============================================================ */
#dock { --pl-bg: #0b0d11; --pl-line: #2a303a; --pl-tx: #c9ced6; --pl-tx2: #7d8490; --pl-btn: #1c2129;
  position: relative; flex: none; width: var(--pl-w, 44vw); min-width: 380px; max-width: calc(100vw - 420px); display: flex; flex-direction: column;
  background: var(--pl-bg); border-left: 3px solid var(--bg-0); color: var(--pl-tx); min-height: 0; }
body.pl-narrow #members { display: none; }
.pl-resize { position: absolute; left: -5px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 5; }
.pl-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--pl-bg); }
.pl-detail { flex: 1; min-height: 0; overflow-y: auto; background: var(--bg); border-top: 3px solid var(--bg-0); }
.pl-detail .lib-insp.pane { width: auto; border: 0; }
.pl-detail .lib-insp.pane .pad { padding: 14px 18px 24px; }
#dock.no-detail .pl-detail { display: none; }
#dock.no-detail .pl-main, #dock.pl-beside .pl-main { flex: 1; }
#dock.pl-beside { flex-direction: row; }
#dock.pl-beside .pl-main { min-width: 0; }
#dock.pl-beside .pl-detail { flex: none; width: clamp(300px, 36%, 440px); border-top: 0; border-left: 3px solid var(--bg-0); }

.pl-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 8px 14px; min-width: 0; }
.pl-ttl { flex: 1; min-width: 0; }
.pl-ttl .t { color: #f1f2f5; font: 600 15px/1.3 var(--font-display); }
.pl-ttl .s { color: var(--pl-tx2); font-size: 12px; }
.pl-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pl-ab { height: 30px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1); background: var(--pl-btn); color: #e9ebef;
  font-size: 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.pl-ab:hover { background: #242a34; }
.pl-ab i { font-size: 15px; }
.pl-ab.armed { background: #3a2f12; color: #f2cd6b; border-color: #e3b341; }
.pl-ib { min-width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--pl-tx); cursor: pointer;
  display: inline-grid; place-items: center; padding: 0 4px; font-size: 12px; }
.pl-ib i { font-size: 18px; }
.pl-ib:hover { background: rgba(255,255,255,.07); color: #fff; }
.pl-ib.on { color: #e3b341; }

.pl-stage { position: relative; flex: none; aspect-ratio: 16 / 9; max-height: 58vh; background: #000; overflow: hidden; display: grid; place-items: center; }
#dock.no-detail .pl-stage, #dock.pl-beside .pl-stage { flex: 1; aspect-ratio: auto; max-height: none; min-height: 160px; }
.pl-stage video.pl-video, .pl-yt, .pl-yt iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; }
.pl-stage video.pl-video { object-fit: contain; outline: none; cursor: pointer; }
.pl-yt { position: absolute; inset: 0; }
.pl-osd { position: absolute; left: 14px; top: 12px; padding: 4px 9px; border-radius: 5px; background: rgba(0,0,0,.7); color: #fff; font: 600 13px var(--font);
  pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 3; font-variant-numeric: tabular-nums; }
.pl-osd.on { opacity: 1; transition: none; }
.pl-err { position: absolute; inset: auto 14px 14px 14px; display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 6px;
  background: rgba(0,0,0,.8); color: #f1f2f5; font-size: 13px; z-index: 3; }
.pl-err i { color: #ef9a4b; }
.pl-views { position: absolute; right: 10px; top: 10px; width: 28%; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.pl-view { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; cursor: pointer; }
.pl-views:has(.big) { width: 50%; }
.pl-view video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pl-view .lbl { position: absolute; left: 4px; bottom: 3px; right: 4px; font-size: 10.5px; color: #fff; background: rgba(0,0,0,.6); padding: 0 4px; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-view.outside video { opacity: .25; }

.pl-ctl { flex: none; padding: 4px 0 0; }
/* seek bar: label lane on top, flags above the track, references below (SeekBar.paintEvent) */
.pl-seek { position: relative; height: 46px; margin: 0 6px; cursor: pointer; touch-action: none; user-select: none; }
.pl-lane { position: absolute; left: 0; right: 0; top: 0; height: 15px; pointer-events: none; }
.pl-lb { position: absolute; top: 0; height: 15px; font-size: 10.5px; line-height: 15px; color: var(--pl-tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 5px; border-left: 2px solid var(--c); pointer-events: auto; cursor: pointer; transform: translateX(-1px); }
.pl-lb:hover { color: #f1f2f5; }
.pl-track { position: absolute; left: 8px; right: 8px; top: 29px; height: 4px; border-radius: 2px; background: var(--pl-line); transition: height .1s, top .1s; }
.pl-seek:hover .pl-track, .pl-seek.active .pl-track { height: 6px; top: 28px; border-radius: 3px; }
.pl-fill, .pl-hov { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; width: 0; }
.pl-hov { background: rgba(255,255,255,.16); }
.pl-fill { background: #e3b341; }
.pl-marks { position: absolute; left: 8px; right: 8px; top: 0; bottom: 0; pointer-events: none; }
.pl-m { position: absolute; pointer-events: auto; cursor: grab; }
.pl-m.drag { cursor: grabbing; z-index: 2; }
.pl-m.pt { top: 18px; width: 9px; height: 9px; margin-left: -4.5px; background: var(--c);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 66%, 0 100%); }
.pl-m.pt:hover, .pl-m.drag { transform: scale(1.35); transform-origin: 50% 100%; }
.pl-m.auto { top: 22px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255,255,255,.4); }
.pl-m.rng { top: 20px; height: 5px; min-width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--c) 70%, transparent);
  border-left: 2px solid var(--c); border-right: 2px solid var(--c); }
.pl-m.rng:hover, .pl-m.rng.drag { background: var(--c); }
.pl-m.rng::before { content: ""; position: absolute; inset: -5px 0; }
.pl-m.ref { top: 36px; width: 8px; height: 8px; margin-left: -4px; background: var(--c); transform: rotate(45deg); cursor: pointer; }
.pl-clip { position: absolute; top: 16px; height: 28px; margin-left: 8px; background: rgba(92,201,138,.22); border-radius: 3px; pointer-events: none;
  max-width: calc(100% - 16px); }
.pl-clip i { position: absolute; top: -1px; bottom: -1px; width: 4px; background: #5cc98a; border-radius: 2px; }
.pl-clip i.a { left: -2px; } .pl-clip i.b { right: -2px; }
.pl-clip.open i.b { display: none; }
.pl-rangea { position: absolute; top: 17px; height: 26px; margin-left: 8px; background: rgba(227,179,65,.25); border-left: 2px solid #e3b341; pointer-events: none; }
.pl-knob { position: absolute; top: 31px; width: 10px; height: 10px; margin: -5px 0 0 3px; border-radius: 50%; background: #fff; pointer-events: none;
  transition: width .1s, height .1s, margin .1s; }
.pl-seek:hover .pl-knob, .pl-seek.active .pl-knob { width: 14px; height: 14px; margin: -7px 0 0 1px; }
.pl-prev { position: absolute; bottom: calc(100% + 6px); left: 0; width: 192px; background: var(--pl-bg); border: 1px solid rgba(255,255,255,.18); border-radius: 6px;
  overflow: hidden; pointer-events: none; opacity: 0; z-index: 6; }
.pl-prev.on { opacity: 1; }
.pl-prev img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.pl-prev span { display: block; text-align: center; font: 600 12px var(--font); color: #fff; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; }
.pl-ov { display: none; position: relative; height: 6px; margin: 0 14px 4px; border-radius: 3px; background: var(--pl-line); cursor: pointer; }
.pl-ov.on { display: block; }
.pl-ov > i { position: absolute; top: -2px; bottom: -2px; border: 1px solid #e3b341; border-radius: 3px; background: rgba(227,179,65,.18); }
.pl-row { display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.pl-play { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #e3b341; color: #1a1405; display: grid; place-items: center; cursor: pointer; flex: none; }
.pl-play:hover { background: #f2cd6b; }
.pl-play i { font-size: 18px; }
.pl-time { color: var(--pl-tx); font-size: 12px; margin-left: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-speed { font-size: 12px; min-width: 40px; }
.pl-zoom { gap: 4px; display: inline-flex; color: #e3b341; }
.pl-zoom i { font-size: 15px; }
.pl-vol { width: 90px; accent-color: #e3b341; height: 4px; }
.pl-trk { display: flex; align-items: center; gap: 6px; padding: 6px 14px 10px; min-width: 0; }
.pl-trk-ic { color: var(--pl-tx2); font-size: 16px; }
.pl-tracks { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pl-pill { height: 26px; padding: 0 12px; border-radius: 13px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: #161a20; color: #a7adb8;
  font-size: 12px; cursor: pointer; white-space: nowrap; }
.pl-pill:hover { border-color: rgba(255,255,255,.2); color: #e9ebef; }
.pl-pill.on { background: var(--c); border-color: var(--c); color: #111; font-weight: 600; }
.pl-note { color: var(--pl-tx2); font-size: 12px; }
.pl-warn { color: #ef9a4b; font-size: 11px; text-align: right; }
.pl-trk .pl-ib i { font-size: 16px; }
.pl-clipbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 14px; background: rgba(92,201,138,.10); border-top: 1px solid rgba(92,201,138,.35); flex-wrap: wrap; }
.pl-clipbar .lbl { flex: 1; min-width: 160px; color: #8fe0b0; font-weight: 600; font-size: 12.5px; white-space: pre-wrap; }
.pl-clipbar.rec { background: rgba(239,107,115,.12); border-top-color: rgba(239,107,115,.4); }
.pl-clipbar.rec .lbl { color: #f19aa1; }
.pl-clipbar.rec .pl-ab:not(:last-child) { display: none; }
.pl-pop { position: absolute; z-index: 20; min-width: 250px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: #1c2129;
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #e9ebef; font-size: 12.5px; }
.pl-pop .hd { font-weight: 600; }
.pl-pop input[type=range] { flex: 1; accent-color: #e3b341; }
.pl-pop .v { min-width: 42px; text-align: right; color: var(--pl-tx); }
.pl-pop .row { display: flex; align-items: center; gap: 4px; }
.pl-pop .pl-ab { height: 26px; padding: 0 8px; }
.pl-pop .input { height: 26px; background: #0f1216; }
/* full screen: video + controls only (set_chrome_visible) */
.pl-main:fullscreen { background: #000; }
.pl-main:fullscreen .pl-head { display: none; }
.pl-main:fullscreen .pl-stage { flex: 1; aspect-ratio: auto; max-height: none; }
/* narrow dock: icon-only actions (the desktop header has the room, a browser window often doesn't) */
#dock .pl-main { container: plmain / inline-size; }
.pl-ttl { min-width: 110px; }
@container plmain (max-width: 760px) {
  .pl-head .pl-ab span { display: none; }
  .pl-head .pl-ab { padding: 0 9px; }
}
@container plmain (max-width: 520px) {
  .pl-vol { display: none; }
}
body.pl-open .alpha-note { display: none; }
