:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1c1e21;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --danger: #c62828;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 4px 14px rgba(0, 0, 0, .06);
  --thumb: 200px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1e2126;
    --text: #e8eaed;
    --muted: #9aa0a9;
    --line: #2f343b;
    --accent: #5b8def;
    --danger: #ff8a80;
    --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
}
h1, h2 { margin: 0 0 .4em; }
h2 { font-size: 1rem; color: var(--muted); font-weight: 600; margin: 1.2rem 0 .6rem; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 2rem 0; }
.error { color: var(--danger); min-height: 1.4em; margin: .4rem 0 0; }
.spacer { flex: 1; }

button, .btn, select, input, textarea {
  font: inherit; color: inherit;
}
button, .btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: .45rem .9rem; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--accent); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.dir:focus-visible, .thumb:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.ghost, .btn.ghost { background: transparent; }
button.icon { padding: .35rem .6rem; background: transparent; border-color: transparent; font-size: 1.1rem; }
button:disabled { opacity: .55; cursor: default; }
input, textarea, select {
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; background: var(--panel); width: 100%;
}
select { width: auto; padding: .35rem .5rem; }

/* ---- login ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 1.6rem; }
.login .card { width: min(380px, 100%); display: grid; gap: .8rem; }
.login label, .dlg label, .info label { display: grid; gap: .25rem; font-size: .85rem; color: var(--muted); }
.login input, .dlg input { color: var(--text); font-size: 1rem; }

/* ---- top bar ---- */
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem;
  padding: .55rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line);
}
/* the path keeps at least 18rem (a width the buttons cannot take: they go on a second row, as on a phone below) -- on a tablet
   the nine buttons left it one character wide */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; flex: 1 1 18rem; min-width: 0; }
.bar button, .bar .vidchk { white-space: nowrap; }
.crumbs button { border: 0; background: transparent; padding: .25rem .4rem; border-radius: 6px; }
.crumbs button:hover { background: var(--bg); }
.crumbs .cur { font-weight: 600; padding: .25rem .4rem; }
.crumbs .sep { color: var(--muted); }
.crumbs .albumsub { flex-basis: 100%; color: var(--muted); font-size: .9rem; padding: .25rem .4rem; min-width: 0; white-space: normal; word-break: break-word; }
.crumbs .albumsub .at { color: var(--text); font-weight: 600; }
.who { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a filter is on: the bar turns green, like the apps (iOS: the navigation bar, Android: its action buttons) */
.bar.filtering button, .bar.filtering .crumbs button { color: #00a000; }
.notice { background: #fff4d6; color: #5c4400; padding: .55rem 1rem; border-bottom: 1px solid #ecd58f; }
@media (prefers-color-scheme: dark) { .notice { background: #3a3117; color: #f1dd9c; border-color: #55481f; } }

.content { padding: 0 1rem 3rem; max-width: 1600px; margin: 0 auto; }

/* ---- albums ---- */
.dirs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .7rem; }
.dircard { position: relative; }
.dir {
  /* a folder like the apps draw it (iOS DirView.m DrawDirNodeShape): a tab over a body with 4 px corners and a darker edge at the
     right and the bottom; yellow unless the folder has its own color (--fc, --fs: set by the script) */
  position: relative; margin-top: 8px; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  height: 190px; padding: 2px 4px 4px; border: 0; border-radius: 4px; width: 100%;      /* every card the same height */
  background: var(--fc, #ffff80); box-shadow: inset -1px -1px 0 var(--fs, #bfbf66); cursor: pointer;
}
.dir::before {
  content: ""; position: absolute; left: 0; top: -8px; width: 50px; height: 8px; background: var(--fc, #ffff80);
  border-radius: 4px 0 0 0; clip-path: polygon(0 0, 42px 0, 50px 8px, 0 8px);
}
.dir:hover { transform: translateY(-1px); }
/* the text: the name 18 px, the album line(s) 14 px under it (black 75% / dark gray on the yellow, whatever the theme; white on a dark color) */
.dir .t { font-size: 18px; font-weight: 400; color: rgba(0, 0, 0, .75); white-space: normal; word-break: break-word; line-height: 1.25; }
.dir .s { font-size: 14px; font-weight: 400; color: #404040; white-space: pre-line; word-break: break-word; line-height: 1.3; }
/* a long name (2 lines) or album text (3 lines) is cut with "..." -- the script then shows the "..." button that pops the whole text out */
.dir .t, .dir .s { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; flex: 0 0 auto; }
.dir .t { -webkit-line-clamp: 2; }
.dir .s { -webkit-line-clamp: 3; }
.dir.cut .t, .dir.cut .s { padding-right: 26px; }
.dircard .more {
  position: absolute; right: .45rem; padding: 0 .4rem; font-size: .9rem; line-height: 1.3; border-radius: 6px;
}
.desctext { margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; }
.descdlg { width: min(520px, 92vw); }
.dir.cdark .t { color: rgba(255, 255, 255, .95); }
.dir.cdark .s { color: #ebebeb; }
/* the cover photos: what is left of the card under the text, as a mosaic (the script places the pictures) */
.dir .cover { position: relative; flex: 1 1 auto; min-height: 44px; margin: 4px 2px 0; }
.dir .cover img { position: absolute; display: block; max-width: none; }
/* a folder with only sub-folders: the half-size translucent folder of the apps */
.dir .cover .sub {
  position: absolute; left: 0; bottom: 0; width: 50%; height: min(100%, 54px); border-radius: 4px;
  background: rgba(255, 191, 128, .3); box-shadow: inset -1px -1px 0 rgba(191, 128, 102, .3);
}
.dircard .edit {
  position: absolute; top: .3rem; right: .3rem; padding: .15rem .45rem; font-size: .8rem;
  opacity: 0; border-radius: 6px;
}
.dircard:hover .edit, .dircard .edit:focus-visible { opacity: 1; }
@media (hover: none) { .dircard .edit { opacity: .7; } }

/* a photo's own "edit" button sits next to its thumbnail button (a button cannot contain a button) */
.thumbwrap { position: relative; }
.thumbwrap .thumb { width: 100%; display: block; }
.thumbwrap .edit {
  position: absolute; top: .3rem; right: .3rem; padding: .15rem .45rem; font-size: .8rem;
  opacity: 0; border-radius: 6px;
}
.thumbwrap:hover .edit, .thumbwrap .edit:focus-visible { opacity: 1; }
@media (hover: none) { .thumbwrap .edit { opacity: .7; } }

/* ---- photos ---- */
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb), 1fr)); gap: 6px; }
.thumb {
  position: relative; aspect-ratio: 3 / 2; border: 0; padding: 0; overflow: hidden; border-radius: 8px;
  background: var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .2s; }
.thumb img.ok { opacity: 1; }
.thumb .vid {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.thumb .vid span {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  display: grid; place-items: center; font-size: 1.1rem; padding-left: 3px;
}
.thumb .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem .5rem .3rem; color: #fff; font-size: .75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); opacity: 0; transition: opacity .15s;
  text-align: center; white-space: normal; word-break: break-word; line-height: 1.3;
}
.thumb:hover .cap, .thumb:focus-visible .cap, .thumb .cap.always { opacity: 1; }

/* ---- viewer ---- */
.viewer {
  position: fixed; inset: 0; z-index: 20; background: #0b0c0e; color: #eee;
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) auto;
}
.viewer button, .viewer .btn, .viewer select { color: #eee; border-color: #3a3f47; background: #1a1d21; }
.viewer button.ghost, .viewer .btn.ghost { background: transparent; }
.viewer button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.vtop {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .5rem .8rem;
  background: rgba(0, 0, 0, .5);
}
.vtop .btn, .vtop button { white-space: nowrap; }
/* a tablet (wider than a phone, narrower than the buttons): the buttons that do not fit go on a second row, the close button stays at the right */
.vtop #closeBtn { margin-left: auto; }
.vidchk { display: flex; align-items: center; gap: .3rem; white-space: nowrap; cursor: pointer; }
.vidchk input { width: auto; padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
.vidchk .vic { display: none; }   /* the icon of the switch: a phone only (below) */
/* ---- phone: the check boxes (play video, repeat, description) are icon switches -- no box, no words, so they take little room;
   lit when on, dim when off ---- */
@media (max-width: 720px) {
  .vidchk { position: relative; }
  .vidchk > .ic, .vidchk .lbl { display: none; }   /* the film icon in front of the box, and the words */
  .vidchk input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }   /* (still reached by the keyboard) */
  .vidchk .vic {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; height: 2.1rem; padding: 0 .35rem;
    border: 1px solid currentColor; border-radius: 6px; font-size: 1.05rem; line-height: 1; opacity: .45;
  }
  .vidchk input:checked ~ .vic { opacity: 1; background: var(--accent); border-color: var(--accent); }
  .vidchk input:focus-visible ~ .vic { outline: 2px solid var(--accent); outline-offset: 2px; }
}
.vtitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stage { position: relative; min-height: 0; display: grid; }
/* The picture always fits inside the window (no scrolling): it is laid out to the size of
   the stage, whatever its pixel size, and object-fit keeps the aspect ratio. */
.media { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.media img, .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* zoom: pinch / drag of the picture are ours (see "Zoom of the big picture" in app.js) */
.media img { touch-action: none; user-select: none; -webkit-user-drag: none; }
.media.zoomed { cursor: grab; }
.media.zoomed:active { cursor: grabbing; }
.vfail { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 1.1rem;
  padding: .8rem 1.4rem; background: rgba(0, 0, 0, .55); border-radius: 10px; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 72px;
  font-size: 2rem; padding: 0; border-radius: 10px; background: rgba(0, 0, 0, .45) !important; border-color: transparent !important;
}
.nav.prev { left: 10px; } .nav.next { right: 10px; }
.vcap {
  position: absolute; left: 50%; bottom: .9rem; transform: translateX(-50%); z-index: 2; max-width: min(90%, 60rem);
  padding: .5rem 1.1rem; border-radius: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: clamp(1.15rem, 1rem + 1vw, 1.7rem);
  line-height: 1.4; text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  text-align: center; white-space: pre-wrap; word-break: break-word; pointer-events: none;
}
.vcap.vid { bottom: 4.5rem; }
@media (max-width: 720px) { .vcap { max-width: 94%; } }
.vidplay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 64px; height: 64px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55) !important; border-color: transparent !important; color: #fff; font-size: 1.6rem;
}
.vidplay .ic { padding-left: 4px; }
.vidplay:hover { background: rgba(0, 0, 0, .75) !important; }
.spinner {
  position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.info {
  width: 300px; overflow: auto; padding: 1rem; background: #15171a; border-left: 1px solid #2a2e34; font-size: .85rem;
}
.info dl { margin: 0 0 1rem; display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; }
.info dt { color: #9aa0a9; } .info dd { margin: 0; word-break: break-word; }
.info form { display: grid; gap: .6rem; }
.info input, .info textarea { background: #1a1d21; border-color: #3a3f47; color: #eee; }
@media (max-width: 720px) {
  .viewer { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .info { width: auto; max-height: 45vh; border-left: 0; border-top: 1px solid #2a2e34; }
  .who { display: none; }
  .vtop .btn, .vtop .ghost { padding: .4rem .6rem; }
  .vtop .lbl { display: none; }
  /* two rows: title + position n / total, then the controls (interval, play video, repeat, play, info, download, close) */
  .vtop { gap: .4rem; flex-wrap: wrap; }
  .vtop .spacer { flex: 0 0 100%; height: 0; }
  .vtitle { flex: 1 1 0; }
  #slideSecs { margin-right: auto; }
}

dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dlg { width: min(360px, 90vw); display: grid; gap: .8rem; }
.dlg .row { display: flex; gap: .6rem; justify-content: flex-end; }
.dlg .row.left { justify-content: flex-start; }
.updlg { width: min(440px, 92vw); }
.updest { display: flex; align-items: center; gap: .5rem; }
.updest code, .uppickpath code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppick { display: grid; gap: .5rem; padding: .6rem; border-radius: 10px; background: rgba(127, 127, 127, .12); }
.uppickpath { display: flex; align-items: center; gap: .5rem; }
.uppicklist { list-style: none; margin: 0; padding: 0; max-height: 30vh; overflow: auto; display: grid; gap: .25rem; }
.uppicklist li.muted { color: var(--muted); font-size: .9rem; padding: .2rem .3rem; }
.uppicklist li button { width: 100%; text-align: left; }
.updrop { border: 2px dashed rgba(127, 127, 127, .5); border-radius: 10px; padding: .9rem .6rem; text-align: center; color: var(--muted); font-size: .9rem; }
@media (hover: none) { .updrop { display: none; } }   /* (nothing to drag from on a phone) */
.uplist { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow: auto; display: grid; gap: .25rem; }
.uplist li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .5rem; border-radius: 8px; background: rgba(127, 127, 127, .12); }
.uplist li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uplist li button { padding: .1rem .5rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  background: #22262b; color: #fff; padding: .6rem 1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: 90vw;
}
.toast.err { background: #b3261e; }

/* ---- select mode (multi folder slideshow) ---- */
.selbar {
  position: sticky; top: 49px; z-index: 4; display: flex; align-items: center; gap: .5rem;
  padding: .45rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line);
}
#selBtn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chk {
  position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: none;
  place-items: center; font-size: .85rem; color: transparent; background: rgba(0, 0, 0, .35);
  border: 2px solid #fff; pointer-events: none;
}
.selmode .chk { display: grid; }
.sel .chk { background: var(--accent); color: #fff; }
.selmode .dircard .edit, .selmode .thumbwrap .edit { display: none; }
.dircard.sel .dir { outline: 3px solid var(--accent); }
.thumb.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.thumb.sel img { opacity: .8; }
.dircard .chk { top: 50%; left: auto; right: 10px; transform: translateY(-50%); }


a.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: default; }   /* a link that is "disabled" (the download link while the slideshow plays) */

.prep {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0, 0, 0, .45);
}
.prep .card { display: grid; gap: .8rem; justify-items: center; min-width: 240px; }
.prep p { margin: 0; }
.spinner-inline {
  width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ---- full screen (Netflix like) ---- */
.selbar { flex-wrap: wrap; }
.viewer.fs { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.viewer.fs .vtop {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; transition: opacity .35s;
  background: linear-gradient(rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
}
.viewer.fs .info {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; padding-top: 4.5rem; background: rgba(21, 23, 26, .92);
  transition: opacity .35s;
}
.viewer.fs .nav { transition: opacity .35s; }
.viewer.fs.idle { cursor: none; }
.viewer.fs.idle .vtop, .viewer.fs.idle .nav, .viewer.fs.idle .info { opacity: 0; pointer-events: none; }
/* choosing a whole folder is for a computer: a phone's file chooser has no such thing */
@media (max-width: 720px), (hover: none) { #upAddDir { display: none; } }
/* a tap on the picture hides the bars (also where there is no full screen: a phone) */
.viewer.hidectl .vtop, .viewer.hidectl .nav, .viewer.hidectl .info { opacity: 0; pointer-events: none; }
/* the music player bar (it lies outside the viewer, after it) goes with the viewer's bars: hidden by a tap, or faded out in full screen */
.viewer:not([hidden]).hidectl ~ .mplayer, .viewer:not([hidden]).fs.idle ~ .mplayer,
.camera:not([hidden]).fs.idle ~ .mplayer { opacity: 0; pointer-events: none; }
#fsBtn[aria-pressed="true"], #camFsBtn[aria-pressed="true"] { border-color: var(--accent); }
/* the camera in full screen: the picture fills the screen, the top bar floats over it and fades out when idle */
.camera.fs { grid-template-rows: minmax(0, 1fr); }
.camera.fs .vtop {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; transition: opacity .35s;
  background: linear-gradient(rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
}
.camera.fs.idle { cursor: none; }
.camera.fs.idle .vtop { opacity: 0; pointer-events: none; }

/* ---- camera ---- */
.camera {
  position: fixed; inset: 0; z-index: 20; background: #0b0c0e; color: #eee;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
}
.camera button, .camera .btn { color: #eee; border-color: #3a3f47; background: #1a1d21; }
.camera .vtop { background: rgba(0, 0, 0, .5); }
.camera .stage { position: relative; min-height: 0; overflow: hidden; touch-action: none; }   /* pinch / drag are ours (zoom) */
.camera .stage.zoomed { cursor: grab; }
.camera .stage.zoomed:active { cursor: grabbing; }
.camera img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform; -webkit-user-drag: none; user-select: none; }
.camera .center { color: #eee; }

/* ---- music ---- */
.music {
  position: fixed; inset: 0; z-index: 20; background: #0b0c0e; color: #eee;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr);
}
.music button, .music .btn { color: #eee; border-color: #3a3f47; background: #1a1d21; }
.music button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.music button.ghost { background: transparent; }
.music button:disabled { opacity: .45; }
.music .vtop { background: rgba(0, 0, 0, .5); flex-wrap: wrap; }
.music .mcrumbs { color: #bbb; }
.music .crumbs button { color: #ddd; }
.music .crumbs .cur { color: #fff; }
.mbody { overflow: auto; padding: .6rem 1rem 1rem; min-height: 0; }
.mdirs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.mdirs button { text-align: left; padding: .6rem .8rem; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mtrack { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border-radius: 8px; }
.mtrack:hover { background: #15181c; }
.mtrack.playing { background: #1b2a3d; }
.mtrack label { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; cursor: pointer; }
.mtrack input { width: auto; padding: 0; accent-color: var(--accent); }
.mtrack .mname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtrack .msize { margin-left: auto; color: #8a8f98; font-size: .85rem; white-space: nowrap; }
.mtrack .mplay { padding: .2rem .6rem; }
.music .center { color: #eee; }
.mhint { margin: 0; padding: .3rem 1rem; font-size: .85rem; color: #9aa0a8; order: 0; }
.mplayer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #111316; color: #eee;
  border-top: 1px solid #23272d; padding: .45rem .8rem .6rem; display: grid; gap: .3rem; transition: opacity .35s;
}
.mplayer button { color: #eee; border-color: #3a3f47; background: transparent; }
.mplayer button:disabled { opacity: .45; }
.mtopline { display: flex; align-items: center; gap: .5rem; }
.mnow { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mctl { display: flex; align-items: center; gap: .5rem; }
.mctl audio { flex: 1; min-width: 0; height: 40px; }
/* while the player bar is up, nothing important hides behind it */
body.has-mplayer .content, body.has-mplayer .mbody { padding-bottom: 7.5rem; }
body.has-mplayer .vcap { bottom: 7.5rem; }
body.has-mplayer .vcap.vid { bottom: 10.5rem; }

/* ---- PC not reachable ---- */
.offline { max-width: 460px; margin: 4rem auto; padding: 0 1rem; text-align: center; display: grid; gap: .5rem; justify-items: center; }
.offline .zz { font-size: 3rem; line-height: 1; }
.offline h2 { font-size: 1.25rem; color: var(--text); margin: .4rem 0 0; }
.offline p { margin: 0; }

/* ---- filter dialog ---- */
.scope { display: flex; gap: 1.2rem; }
.scope label { display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.scope input { width: auto; padding: 0; }
.recent { display: grid; grid-auto-rows: max-content; align-content: start; gap: .25rem; max-height: 10rem; overflow: auto; }   /* rows keep their height (a long list scrolls, it is not squeezed) */
.recent button { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ---- album color buttons ---- */
.swfield { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.sw {
  width: 2rem; height: 2rem; padding: 0; border-radius: 50%; border: 2px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #000; cursor: pointer;
}
.sw.dk { color: #fff; }
.sw.on { border-color: var(--text); }
.sw.def { width: auto; padding: 0 .7rem; border-radius: 1rem; background: var(--panel); color: var(--text); border-color: var(--line); font-weight: 400; }
.sw.def.on { border-color: var(--accent); }

.fpanel { display: grid; gap: .6rem; }
.fpanel[hidden] { display: none; }
.fhint { margin: 0; text-align: center; font-size: .85rem; }
#filterDlg { margin-top: 24px; }   /* near the top, like the apps */
.ghost.danger { color: #d33; }

/* ---- phone (narrow screens): the top bar goes on two rows -- the path on its own row (it was squeezed to one
   character wide, so every letter sat on a line of its own), the buttons below it, none of them breaking its text ---- */
@media (max-width: 720px) {
  .bar { position: static; flex-wrap: wrap; gap: .25rem; padding: .5rem .6rem; }
  .crumbs { flex: 1 1 100%; }
  .bar button { white-space: nowrap; padding: .3rem .5rem; font-size: .92rem; }
  .bar .who { display: none; }
  /* the top bar scrolls away now, so the select bar sticks to the top instead of sitting under it */
  .selbar { top: 0; padding: .45rem .6rem; }
  .content { padding-left: .6rem; padding-right: .6rem; }
}
