/* Codetta: plain CSS, no build step.
   World: liner notes. Booklet stock and ink, one grotesque, hairline rules, and
   one spot colour per album lifted from its cover (see --spot / setSpot()).
   Theme: light by default, dark via the system setting or the theme button
   (data-theme="light" | "dark" on <html> overrides the system). */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/schibsted-grotesk.woff2) format("woff2");
}
@font-face { /* Cyrillic only (Inter's Cyrillic subset): Schibsted Grotesk doesn't cover it */
  font-family: "Codetta Cyrillic";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* The album's spot colour. Registered so it can crossfade when you move
   between albums instead of jumping. */
@property --spot {
  syntax: "<color>";
  inherits: true;
  initial-value: #0e7c74;
}

/* ---- Theme tokens ------------------------------------------------------- */

:root {
  /* Motion: quick, decelerating */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 260ms;

  --font: "Schibsted Grotesk", "Codetta Cyrillic", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Noto Sans",
    "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Noto Sans CJK JP", "PingFang SC", "Microsoft YaHei",
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Nirmala UI", "Noto Sans Devanagari",
    "Leelawadee UI", "Noto Sans Thai", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
  --house-spot: #0e7c74; /* used when an album has no cover */
  --spot: var(--house-spot);
  --bg: #f7f8f8; /* booklet stock: neutral, faintly cool */
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #1b1e24; /* ink */
  --muted: #59606d;
  --faint: #6f7581;
  --rule: rgba(27, 30, 36, 0.1); /* hairlines between credit lines */
  --border: rgba(27, 30, 36, 0.1);
  --border-strong: rgba(27, 30, 36, 0.22);
  --hover: rgba(27, 30, 36, 0.04);
  --pressed: rgba(27, 30, 36, 0.07);
  --danger: #c4291c;
  --danger-soft: rgba(196, 41, 28, 0.08);
  --success: #1f7a3a;
  --warning: #9c4f00;
  --warning-soft: rgba(214, 120, 0, 0.12);
  --input-bg: #ffffff;
  --field-line: #8b919b; /* input borders: 3:1 against the field */
  --on-color: #ffffff; /* text and ticks on the spot or status colours */
  --shadow: 0 1px 2px rgba(27, 30, 36, 0.05), 0 10px 28px rgba(27, 30, 36, 0.07);
  --shadow-lg: 0 24px 64px rgba(27, 30, 36, 0.18);
  --backdrop: rgba(18, 20, 24, 0.3);
  --glass: rgba(247, 248, 248, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --house-spot: #4fc3b4;
    --bg: #131418; /* booklet black */
    --surface: #1a1c21;
    --surface-raised: #23252b;
    --text: #f0f0ec;
    --muted: #a4a9b4;
    --faint: #8a909b;
    --rule: rgba(240, 240, 236, 0.1);
    --border: rgba(240, 240, 236, 0.1);
    --border-strong: rgba(240, 240, 236, 0.2);
    --hover: rgba(240, 240, 236, 0.05);
    --pressed: rgba(240, 240, 236, 0.09);
    --danger: #ff6b5e;
    --danger-soft: rgba(255, 107, 94, 0.12);
    --success: #4cd07d;
    --warning: #ffad42;
    --warning-soft: rgba(255, 173, 66, 0.14);
    --input-bg: #1f2126;
    --field-line: #6e737d;
    --on-color: #131418; /* dark spot/status colours are light: dark text on them */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
    --backdrop: rgba(0, 0, 0, 0.55);
    --glass: rgba(19, 20, 24, 0.82);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --house-spot: #4fc3b4;
  --bg: #131418;
  --surface: #1a1c21;
  --surface-raised: #23252b;
  --text: #f0f0ec;
  --muted: #a4a9b4;
  --faint: #8a909b;
  --rule: rgba(240, 240, 236, 0.1);
  --border: rgba(240, 240, 236, 0.1);
  --border-strong: rgba(240, 240, 236, 0.2);
  --hover: rgba(240, 240, 236, 0.05);
  --pressed: rgba(240, 240, 236, 0.09);
  --danger: #ff6b5e;
  --danger-soft: rgba(255, 107, 94, 0.12);
  --success: #4cd07d;
  --warning: #ffad42;
  --warning-soft: rgba(255, 173, 66, 0.14);
  --input-bg: #1f2126;
  --field-line: #6e737d;
  --on-color: #131418;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --backdrop: rgba(0, 0, 0, 0.55);
  --glass: rgba(19, 20, 24, 0.82);
}

/* Everything that used to be "accent" is now the album's spot colour. */
:root {
  --accent: var(--spot);
  --accent-hover: color-mix(in oklab, var(--spot) 82%, var(--text));
  --accent-soft: color-mix(in oklab, var(--spot) 13%, transparent);
  --selected: color-mix(in oklab, var(--spot) 10%, transparent);
  --on-accent: var(--on-color);
  transition: --spot 700ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) { :root { transition: none; } }

/* ---- Base ------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--border-strong) transparent;
  accent-color: var(--spot);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* Schibsted Grotesk for Latin and Greek, Inter for Cyrillic; good system
     fonts for every other script and colour emoji. */
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: color-mix(in oklab, var(--spot) 26%, transparent); color: inherit; }
input, textarea { caret-color: var(--spot); }
a { text-underline-offset: 0.2em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.num { font-variant-numeric: normal; }

/* ---- App frame ----------------------------------------------------------------- */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  flex: none;
  padding: 4px 2px;
}
/* The wordmark: lowercase, heavy, with a square full stop in the album's spot colour. */
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.brand-icon { display: none; width: 30px; height: 30px; place-items: center; background: var(--spot); color: var(--on-color); font-weight: 800; font-size: 22px; line-height: 1; padding-bottom: 3px; }
.spot-dot { display: inline-block; width: 0.29em; height: 0.29em; margin-left: 0.06em; background: var(--spot); }

.crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  font-weight: 500;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs a:hover { background: var(--hover); color: var(--text); }
.crumbs a[aria-current="page"] { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--faint); }

.topbar-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--field-line);
  color: var(--muted);
  width: 240px;
  /* Opens wider while in use and settles back when you leave it (a soft spring, both ways). */
  transition: width 420ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 200ms ease, border-color 200ms ease,
              background-color 200ms ease;
}
.search-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; position: relative; }
.search > svg { transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1), opacity 200ms ease; }
.search-wrap.active .search > svg { transform: scale(1.08); }
.search-cancel { display: none; }
/* Using the search (or searching Soulseek): it widens to make room. */
.search-wrap.active .search { width: 380px; }
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  color: var(--text);
}
.search input::placeholder { color: var(--faint); }
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); }

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.browser {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px max(24px, env(safe-area-inset-right)) 96px max(24px, env(safe-area-inset-left));
  outline: none;
}

/* ---- Buttons ----------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--field-line);
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:active { background: var(--pressed); }
.btn.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.primary:hover { background: color-mix(in oklab, var(--text) 84%, var(--spot)); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.btn.primary:disabled { opacity: 1; background: var(--hover); color: var(--faint); border-color: var(--border); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--pressed); }

.link-btn { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.link-btn:active { opacity: 0.55; }

/* ---- Folder header & banner ------------------------------------------------------- */

.banner {
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--text);
}
.banner strong { display: block; margin-bottom: 2px; }
.banner code { font-size: 13px; }

.folder-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.folder-head h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.folder-head p { color: var(--muted); margin-top: 4px; }
.folder-actions { display: flex; gap: 8px; }

/* ---- Album header: cover beside a heavy title, like a booklet spread ---------- */

.album-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: end; flex: 1 1 520px; min-width: 0; }
.album-cover-btn { display: block; padding: 0; border: 0; background: none; border-radius: 2px; cursor: zoom-in; }
.album-cover-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.album-cover-btn:active .album-cover { transform: scale(0.98); }
.album-cover {
  width: 200px; height: 200px; display: block; object-fit: cover; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 10px 24px -10px rgba(0, 0, 0, 0.35);
  background: var(--hover);
}
.album-head h1 { font-size: 52px; }
.album-meta { color: var(--muted); margin-top: 8px; font-size: 15px; }
.album-meta b { color: var(--text); font-weight: 600; }
.nowrap { white-space: nowrap; }
.spot-chip {
  display: inline-block; margin-top: 12px; padding: 3px 10px; border-radius: 4px;
  background: var(--accent-soft); color: var(--spot); font-weight: 700; font-size: 13px;
}

/* ---- Tag filter chips ---------------------------------------------------------------------- */

.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 16px; }
.filter-count { color: var(--muted); font-size: 13px; margin-right: 4px; font-variant-numeric: normal; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  max-width: 100%;
}
.filter-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip b { font-weight: 600; }
.chip-x { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); padding: 0; }
.chip-x:hover { background: var(--hover); color: var(--text); }
.chip-x svg { width: 12px; height: 12px; }
#tagfilter-btn.active { color: var(--accent); background: var(--accent-soft); }
dialog.sheet.small { width: min(420px, calc(100vw - 32px)); }

/* ---- Folders ----------------------------------------------------------------------- */

.folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}
.folders:empty { display: none; }
.folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  min-width: 0;
}
@media (hover: hover) { .folder:hover { background: var(--hover); border-color: var(--border-strong); } }
.folder:active { background: var(--pressed); }
.folder svg { color: var(--accent); }
.folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grid view: a contents page. Each folder is a ruled entry, not a boxed tile. */
.folders:not(.as-list) { gap: 4px 28px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.folders:not(.as-list) .folder {
  border: 0; border-top: 1.5px solid var(--text); border-radius: 0; background: transparent;
  min-height: 64px; padding: 12px 2px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
}
@media (hover: hover) { .folders:not(.as-list) .folder:hover { background: var(--hover); border-color: var(--spot); } }

/* List view (default): rows like the track list. */
.folders.as-list {
  display: block;
  border-top: 1.5px solid var(--text); /* the booklet's ink rule */
}
.folders.as-list .folder {
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  min-height: 48px;
  padding: 0 8px 0 4px;
  font-weight: 600;
}
.folders.as-list .folder:last-child { border-bottom: 1px solid var(--rule); }
.folders.as-list:empty { display: none; }
.folder-name { flex: 1; min-width: 0; }
.folder-meta { flex: none; color: var(--muted); font-size: 13px; font-weight: 400; font-variant-numeric: normal; }
.folders.as-list .folder > svg:last-child { color: var(--faint); width: 15px; height: 15px; }

.folder-actions { align-items: center; }
.phone-only { display: none; }
@media (max-width: 760px) { .phone-only { display: inline-flex; } }
/* Grid / list: two icons side by side, each in its own rounded square; the chosen one is lit in
   Codetta's colour, the other dimmed. */
.view-toggle { display: flex; gap: 4px; flex: none; }
.view-toggle .icon-btn { width: 32px; height: 32px; border-radius: 9px; color: var(--muted); opacity: 0.55;
  transition: background var(--dur), color var(--dur), opacity var(--dur); }
@media (hover: hover) { .view-toggle .icon-btn:hover { opacity: 0.9; } }
.view-toggle .icon-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--spot); opacity: 1; }

/* ---- Track list --------------------------------------------------------------------- */

.tracks {
  border-top: 1.5px solid var(--text); /* the booklet's ink rule */
}
.tracks:empty { display: none; }

.track-row {
  display: grid;
  grid-template-columns: var(--cols, 44px 40px 48px minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 76px 60px 56px);
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--rule);
  cursor: default;
}
.track-row.head {
  min-height: 34px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
}
@media (hover: hover) { .track-row:not(.head):hover { background: var(--hover); } }
.track-row.selected { background: var(--selected); }
.track-row.editing { background: var(--accent-soft); }
.track-row.editing .col-title, .track-row.editing .col-num { color: var(--spot); }
.track-row > * { padding: 0 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-row .col-num, .track-row .col-dur { color: var(--muted); text-align: right; }
.track-row .col-num { font-variant-numeric: tabular-nums; font-weight: 600; } /* digits only: tabular keeps 01-99 aligned */
/* One album: columns that would repeat the same value on every row are dropped. */
.tracks.one-album .col-art, .tracks.one-album .col-album, .tracks.one-format .col-fmt, .tracks.same-artist .col-artist { display: none; }
.track-row .col-title { font-weight: 600; }
.track-row .col-title .untitled { color: var(--muted); font-weight: 400; font-style: italic; }
.track-row .col-artist, .track-row .col-album { color: var(--muted); }
.track-row .sub { display: none; }

/* Album-art thumbnail on each track */
.track-row .col-art { display: flex; align-items: center; justify-content: center; padding: 0 4px; overflow: visible; }
.track-row .col-art img { width: 36px; height: 36px; border-radius: 2px; object-fit: cover; display: block; background: var(--hover); box-shadow: 0 0 0 1px var(--border); }
.art-none {
  width: 36px; height: 36px; border-radius: 2px; display: grid; place-items: center;
  background: var(--hover); color: var(--faint); border: 1px dashed var(--border-strong);
}
.art-none svg { width: 15px; height: 15px; }

/* Pending album art in the editor */
.art-square.pending { box-shadow: 0 0 0 2px var(--accent); }
.art-square.removing { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.art-badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent); color: var(--on-color); font-size: 11px; font-weight: 600;
}
.pop-art { display: inline-flex; align-items: center; gap: 6px; }
.pop-art img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
/* Right-to-left names (Arabic, Hebrew…) read in their own direction. */
.track-row > *, .track-row .main, .track-row .sub, .folder-name, .editor-title h2, .editor-title p,
.act-msg, .preview-item .name, .crumbs a, .filter-chip > span { unicode-bidi: plaintext; }
/* ...but columns stay aligned to one edge, whatever the script. */
.track-row .col-title, .track-row .col-artist, .track-row .col-album, .folder-name, .act-msg { text-align: left; }
.skipped-note { color: var(--warning); cursor: help; }
.track-row:not(.head) { cursor: pointer; }
/* Rows off-screen are skipped for layout and painting until scrolled to:
   keeps folders with thousands of tracks fast to draw and filter. */
.track-row:not(.head), .folders.as-list .folder { content-visibility: auto; contain-intrinsic-size: auto 44px; }
.track-row.has-error .col-title { color: var(--danger); }

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--hover);
  color: var(--muted);
}

/* Round checkbox, 44px touch target */
.check-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 !important;
  cursor: pointer;
}
.check-cell input, .check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--input-bg);
  display: grid;
  place-content: center;
  cursor: pointer;
  flex: none;
}
.check input { border-radius: 5px; }
.check-cell input:checked, .check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check-cell input:checked::after, .check input:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border: solid var(--on-color);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.check-cell input:indeterminate { background: var(--accent); border-color: var(--accent); }
.check-cell input:indeterminate::after { content: ""; width: 8px; height: 2px; background: var(--on-color); border-radius: 1px; }

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.loading { padding: 32px 0; color: var(--muted); }

/* ---- Library-wide search ------------------------------------------------------- */

.search-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px 6px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  animation: pop-in var(--dur) var(--ease-out);
}
.search-all svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.search-all b { font-weight: 600; overflow-wrap: anywhere; }
.search-all kbd {
  font: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
}
.search-all:hover { border-color: var(--accent); }
.query-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.query-chip {
  padding: 3px 9px; border-radius: 999px; font-size: 13px;
  background: var(--surface-raised); border: 1px solid var(--border); color: var(--text);
  unicode-bidi: plaintext;
}
.query-chip b { font-weight: 600; }
.search-note { margin-top: 6px; font-size: 13px; color: var(--muted); }
.empty code { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--surface-raised); border: 1px solid var(--border); }
@media (hover: none) { .search-all kbd { display: none; } }

/* ---- Selection bar -------------------------------------------------------------- */

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 10;
  font-weight: 500;
  max-width: calc(100vw - 24px);
}
.selection-actions { display: flex; gap: 6px; }

/* ---- Editor panel ------------------------------------------------------------------ */

.editor {
  width: 500px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  min-height: 0;
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.editor-title { flex: 1; min-width: 0; }
.editor-title h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.editor-title p { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; position: relative; }

/* What will be saved: shown when hovering either Save button */
.changes-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s, transform 0.12s, visibility 0.12s;
  pointer-events: none;
}
.changes-pop:empty { display: none; }
/* Only with a real mouse (a tap would leave it stuck open) or keyboard focus. */
@media (hover: hover) {
  .toolbar-right:has(.btn:not(:disabled):hover) .changes-pop { opacity: 1; visibility: visible; transform: none; }
}
.toolbar-right:has(.btn:not(:disabled):focus-visible) .changes-pop { opacity: 1; visibility: visible; transform: none; }

/* Confirmation sheet */
dialog.confirm .sheet-head { padding-bottom: 4px; }
.confirm-msg { color: var(--muted); }
.confirm-msg + * { margin-top: 14px; } /* breathing room between a sheet's message and what follows */
dialog.confirm .change-list {
  list-style: none; margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--hover);
  display: flex; flex-direction: column; gap: 6px; font-size: 13px; max-height: 40vh; overflow-y: auto;
}
dialog.confirm .change-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.confirm-warning { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--text); font-size: 13px; }
.btn.danger-fill { background: var(--danger); border-color: transparent; color: var(--on-color); }
.btn.danger-fill:hover { filter: brightness(1.08); }
.changes-pop ul, .change-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: hidden; }
.changes-pop li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.pop-head { font-weight: 600; }
.pop-key { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-val { overflow-wrap: anywhere; }
.pop-val s { color: var(--faint); }
.pop-removed { color: var(--danger); }
.pop-foot { color: var(--faint); border-top: 1px solid var(--border); padding-top: 6px; }
.paste-group { display: inline-flex; align-items: center; gap: 2px; }
.icon-btn.small { width: 26px; height: 26px; }
.icon-btn.small svg { width: 14px; height: 14px; }
.btn.small svg { width: 15px; height: 15px; }

.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.group { border-bottom: 1px solid var(--rule); padding: 4px 0 14px; }
.group:last-child { border-bottom: 0; }
.group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--spot);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid var(--faint);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
  margin-right: 4px;
  transition: transform 0.15s;
}
.group:not([open]) > summary::after { transform: rotate(-45deg); }
.group .count { font-weight: 500; color: var(--muted); margin-left: 8px; font-size: 13px; }

.field { display: block; margin: 0 0 10px; border: 0; padding: 0; min-width: 0; }
.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  padding: 0;
}
.field-label .key { color: var(--faint); font-weight: 400; }
.field-label .flag { margin-left: auto; font-size: 11px; font-weight: 600; }
.copy-box {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0 2px 0 0;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--input-bg);
  display: inline-grid;
  place-content: center;
  align-self: center;
  cursor: pointer;
  flex: none;
}
.copy-box:checked { background: var(--accent); border-color: var(--accent); }
.copy-box:checked::after { content: ""; width: 8px; height: 4px; border: solid var(--on-color); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.copy-box:disabled { opacity: 0.35; cursor: default; }
.field.copyable .field-label { color: var(--text); cursor: pointer; }
.field-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--warning);
}
.field-hint .link-btn { font-size: 12px; }

/* Smart suggestions dropdown */
.spark { display: inline-flex; color: var(--accent); opacity: 0.8; }
.spark svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 25;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: min(260px, calc(100vw - 32px)); /* half-width fields (Genre, Disc) stay readable on phones */
}
.row-2 > :last-child .suggest { left: auto; } /* right-hand column: grow leftwards, stay on screen */
.suggest-head { display: flex; align-items: center; gap: 5px; padding: 4px 8px 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.suggest-head svg { width: 11px; height: 11px; fill: var(--accent); stroke: none; }
.suggest-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 12px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}
.suggest-item:hover, .suggest-item.active { background: var(--accent-soft); }
.suggest-value { font-weight: 500; overflow-wrap: break-word; min-width: 0; }
.suggest-note { font-size: 11px; color: var(--faint); white-space: nowrap; flex: none; }
.field-label .flag.changed { color: var(--accent); }
.field-label .flag.removed { color: var(--danger); }

.input-wrap { position: relative; display: flex; }

input[type="text"], input[type="password"], input:not([type]), select, textarea {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}
textarea { height: auto; min-height: 68px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
select { padding-right: 28px; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.input-wrap input { padding-right: 34px; }
.input-wrap .clear {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
}
.input-wrap .clear svg { width: 14px; height: 14px; }
.field.is-changed input, .field.is-changed textarea { border-color: var(--spot); box-shadow: inset 0 -2px 0 var(--spot); }
.field.is-removed input { border-color: var(--danger); background: var(--danger-soft); }
.field.is-mixed input::placeholder { font-style: italic; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.file-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding: 10px 0 4px;
  color: var(--muted);
  font-size: 12px;
}
.file-info .path { width: 100%; overflow-wrap: anywhere; color: var(--faint); }

.add-tag { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }

.hint { color: var(--muted); font-size: 12px; margin: -4px 0 12px; }
.hint code, .chip {
  font-family: var(--mono);
  font-size: 12px;
}
.chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--hover);
  color: var(--text);
  margin: 0 4px 4px 0;
}
button.chip:hover { border-color: var(--accent); color: var(--accent); }

.error-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}

/* ---- Album art ----------------------------------------------------------------------------- */

.art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0 6px;
}
.art-square {
  position: relative;
  width: min(100%, 216px);
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 3px;
  border: 1.5px dashed var(--border-strong);
  background: var(--hover);
  color: var(--muted);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, background 0.15s;
}
.art-square.drag { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) {
  .art-square:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
}
.art-square.has-art { border: 1px solid var(--border); background: var(--hover); box-shadow: var(--shadow); }
.art-square.has-art:hover { border-color: var(--border); }
.art-square img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* With a cover, the box takes its shape (--ar = width / height) within the same 216px space, and a
   tap shows it full size. */
.art-square.has-art { --side: 216px; aspect-ratio: var(--ar, 1); width: calc(var(--side) * min(var(--ar, 1), 1)); max-width: 100%;
  border-radius: 2px; cursor: zoom-in; }
.art-square.busy { pointer-events: none; }
.art-square.busy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  z-index: 1;
}
.art-square.busy::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 26px;
  height: 26px;
  inset: calc(50% - 13px);
  border-radius: 50%;
  border: 2.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  background: none;
  padding: 0;
  opacity: 1;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.art-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; padding: 0 12px; text-align: center; }
.art-empty svg { width: 22px; height: 22px; }
.art-meta { font-size: 12px; color: var(--faint); font-variant-numeric: normal; min-height: 1em; }
.art-meta:empty { display: none; }
.art-actions { display: flex; gap: 6px; }
.art-actions:empty { display: none; }

/* ---- Activity log (bottom of the editor) ------------------------------------------------------ */

.activity {
  flex: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom);
}
.activity-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
}
.activity-head:hover { background: var(--hover); }
.activity.open .activity-latest { font-weight: 700; font-size: 14px; }
.activity-latest { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.activity.open .activity-latest { color: var(--text); }
.activity-time { color: var(--faint); font-variant-numeric: normal; flex: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.activity-dot.ok { background: var(--success); }
.activity-dot.err { background: var(--danger); }
.activity-chevron { width: 14px; height: 14px; color: var(--faint); transition: transform 0.15s; transform: rotate(180deg); }
.activity.open .activity-chevron { transform: none; }

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.act {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12.5px;
}
.act + .act { margin-top: 1px; }
.act.related { background: var(--hover); }
.act.new { animation: act-in 1.6s ease-out; }
@keyframes act-in { from { background: var(--accent-soft); } }
.act-icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--on-color);
  background: var(--success);
}
.act.err .act-icon { background: var(--danger); }
.act-msg { font-weight: 500; overflow-wrap: anywhere; }
.act-change, .act-err { color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.act-key {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-right: 6px;
}
.act-old { text-decoration: line-through; color: var(--faint); }
.act-new { color: var(--text); }
.act-removed { color: var(--danger); }
.act-err { color: var(--danger); }
.act time { color: var(--faint); font-size: 11px; font-variant-numeric: normal; white-space: nowrap; margin-top: 1px; }
.act-empty { color: var(--faint); font-size: 12px; padding: 4px 8px 6px; }
.act-actions { margin-top: 4px; }
.act-undo { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 0; }
.act-undo svg { width: 13px; height: 13px; }
.act-undone { font-size: 11px; color: var(--faint); font-style: italic; }
.act.undone .act-msg { color: var(--muted); }

/* ---- Dialogs (sheets) ----------------------------------------------------------------- */

dialog.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 48px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: var(--backdrop); }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px 20px;
}
.sheet-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.sheet-body { padding: 4px 20px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.sheet-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.sheet-foot .spacer { flex: 1; }

.segmented {
  display: flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--hover);
  gap: 2px;
}
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.segmented input:checked + span { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ms-kind span { height: 36px; padding: 0 6px; }
@media (pointer: coarse) { .ms-kind span { height: 44px; } }
.ms-sign-in { display: contents; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.segmented input:disabled + span { opacity: 0.4; cursor: default; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); cursor: pointer; }

.preview { margin-top: 8px; }
.preview-summary { font-weight: 500; margin-bottom: 8px; }
.preview-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.preview-item { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.preview-item:last-child { border-bottom: 0; }
.preview-item .name { font-weight: 500; overflow-wrap: anywhere; }
.preview-item .changes { margin-top: 4px; font-size: 13px; color: var(--muted); }
.preview-item .changes b { color: var(--text); font-weight: 500; }
.preview-item .note { font-size: 12px; color: var(--faint); margin-top: 2px; }
.preview-item.error .name { color: var(--danger); }

.preset-list { display: flex; flex-direction: column; gap: 8px; }
.preset-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.preset-card .info { flex: 1; min-width: 0; }
.preset-card .name { font-weight: 600; }
.preset-card .desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.preset-card .tags { color: var(--faint); font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

/* ---- Sign in ------------------------------------------------------------------------------------ */

.auth {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
  animation: fade-in var(--dur) ease;
}
.auth-card {
  width: min(440px, 100%);
  padding: 8px 0 26px;
  display: flex;
  flex-direction: column;
  animation: dialog-in var(--dur-slow) var(--ease-out);
}
.auth-logo { color: var(--text); margin-bottom: 30px; padding-bottom: 16px; border-bottom: 1.5px solid var(--text); }
.auth-logo .wordmark { font-size: 56px; letter-spacing: -0.045em; }
.auth-logo .spot-dot { background: var(--house-spot); }
.auth-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; }
.auth-sub { color: var(--muted); margin: 6px 0 20px; }
.auth-sub:empty { margin-bottom: 12px; }
.auth-card .field { margin-bottom: 12px; }
.auth-card input { height: 40px; }
.auth-submit { height: 40px; margin-top: 6px; }
.auth-foot { color: var(--muted); font-size: 12px; margin-top: 14px; }
.auth-foot:empty { display: none; }
.auth-card .error-box { margin: 0 0 12px; }
.auth.shake .auth-card { animation: shake 0.35s ease; }
@keyframes shake { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }

/* Profile */
.profile { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.avatar-lg {
  width: 68px; height: 68px; flex: none; padding: 0; border: 0; border-radius: 50%; overflow: hidden; position: relative;
  display: grid; place-items: center; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--border);
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, 0); transition: background var(--dur-fast) ease;
}
@media (hover: hover) { .avatar-lg:hover::after { background: rgba(0, 0, 0, 0.18); } }
.avatar-initial { font-size: 28px; font-weight: 650; line-height: 1; }
.profile-info { min-width: 0; }
.profile-sub { font-size: 12px; color: var(--muted); }
.profile-name { font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.profile-actions { display: flex; gap: 6px; margin-top: 8px; }
.password-form { padding-top: 14px; border-top: 1px solid var(--border); }

/* Top-bar profile picture */
.avatar-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 1px var(--border-strong); }
#account-btn.has-avatar:hover .avatar-img { box-shadow: 0 0 0 2px var(--accent-soft); }
.about { margin-bottom: 14px; }

/* ---- Advanced mode switch and raw tags ---------------------------------------------- */

.advanced { margin: 0 0 16px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; min-height: 44px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-title { font-weight: 600; color: var(--text); }
.switch-sub { font-size: 12px; color: var(--muted); }
input[role="switch"] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0;
  width: 44px; height: 26px; border-radius: 13px; background: var(--border-strong); cursor: pointer;
  transition: background-color var(--dur) ease;
}
input[role="switch"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform var(--dur) var(--ease-out);
}
input[role="switch"]:checked { background: var(--spot); }
input[role="switch"]:checked::after { transform: translateX(18px); }
input[role="switch"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.raw-system { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.raw-list { padding-bottom: 6px; }
.raw-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.raw-name { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.raw-value { overflow-wrap: anywhere; white-space: pre-wrap; unicode-bidi: plaintext; }
.raw-picture .raw-value, .raw-binary .raw-value { color: var(--muted); font-style: italic; }
.raw-more { color: var(--faint); font-style: normal; }
.about-head { display: flex; align-items: center; gap: 8px; }
.about-head h3 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 650; color: var(--text); text-transform: none; letter-spacing: 0; }
.about-head .btn { margin-left: auto; }
/* Version badge, same look on the sign-in screen and in the About section. */
.version-badge, #about-version { text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; line-height: 1; font-variant-numeric: normal; }
.about-status { color: var(--muted); font-size: 13px; margin-top: 6px; }
.about-status:empty { display: none; }
.about-status a { color: var(--accent); }
.update-box { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--hover); }
.release-notes {
  white-space: pre-wrap; font-size: 12.5px; color: var(--text); max-height: 140px; overflow-y: auto;
  margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.update-steps {
  margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--border);
  font: 12px/1.6 var(--mono); white-space: pre; overflow-x: auto;
}
/* ---- Credit footer: GitHub · Made with ♥ · version ---------------------------------- */

.credit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 40px;
  font-size: 12px;
  color: var(--faint);
  user-select: none;
}
.credit > * + *::before { content: "·"; margin-right: 8px; color: var(--faint); }
.credit-version:empty { display: none; }
.credit-version { font-variant-numeric: normal; }
.credit-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: -4px; border-radius: 6px;
  color: var(--faint); transition: color var(--dur-fast) ease;
}
.credit-link svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.credit-link:hover, .credit-link:focus-visible { color: var(--text); }
.credit-heart { color: var(--faint); }
.credit:hover .credit-heart { color: var(--spot); transition: color var(--dur) ease; }
.auth-credit {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  margin: 0;
}
@media (max-width: 760px) {
  .credit { justify-content: center; }
  .auth-credit { left: 0; right: 0; }
  .credit-link { width: 44px; height: 44px; margin: -14px -10px; } /* touch target */
}
#account-btn { position: relative; }
#account-btn.has-update::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--glass);
}
.password-form h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--text); }

/* ---- Toasts -------------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px); /* above the selection bar */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.toast.error { color: var(--danger); }
.toast-icon { display: inline-flex; vertical-align: -3px; margin-right: 8px; color: var(--success); }
.toast-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }
.act-icon svg { width: 11px; height: 11px; stroke-width: 2.6; }

/* ---- Motion ---------------------------------------------------------------------------------------- */

/* Small state changes ease instead of snapping. */
.btn, .icon-btn, .folder, .track-row, .chip, .chip-x, .link-btn, .segmented span,
.suggest-item, .activity-head, .search, .check-cell input, .copy-box,
input[type="text"], input:not([type]), select, textarea {
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.btn:active, .icon-btn:active { transform: scale(0.97); }
.btn, .icon-btn { transition-property: background-color, border-color, color, box-shadow, opacity, transform; }

/* Folder navigation: content slides in from the direction you're going. */
.nav-forward { animation: nav-in-forward var(--dur-slow) var(--ease-out) both; }
.nav-back { animation: nav-in-back var(--dur-slow) var(--ease-out) both; }
.nav-fade { animation: fade-in var(--dur) var(--ease-out) both; }
#folders.nav-forward, #folders.nav-back { animation-delay: 20ms; }
#tracks.nav-forward, #tracks.nav-back, #tracks.nav-fade { animation-delay: 40ms; }
/* Keep content readable on very wide monitors. */
.browser > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* While a slow folder loads, the current one stays visible, just dimmed. */
.browser > * { transition: opacity var(--dur) ease; }
.browser.is-loading > * { opacity: 0.55; pointer-events: none; }
@keyframes nav-in-forward { from { opacity: 0; translate: 14px 0; } }
@keyframes nav-in-back { from { opacity: 0; translate: -14px 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* Editor panel: slides in from the right on desktop. */
.editor:not([hidden]) { animation: panel-in var(--dur-slow) var(--ease-out); }
.editor.closing { animation: panel-out 160ms var(--ease-in) forwards; pointer-events: none; }
@keyframes panel-in { from { opacity: 0; translate: 28px 0; } }
@keyframes panel-out { to { opacity: 0; translate: 28px 0; } }

/* Dialogs: a gentle scale-up with a fading backdrop. */
dialog.sheet[open] { animation: dialog-in var(--dur) var(--ease-out); }
dialog.sheet[open]::backdrop { animation: fade-in var(--dur) ease; }
dialog.sheet.closing { animation: dialog-out 150ms var(--ease-in) forwards; }
dialog.sheet.closing::backdrop { animation: fade-out 150ms ease forwards; }
@keyframes dialog-in { from { opacity: 0; scale: 0.96; translate: 0 6px; } }
@keyframes dialog-out { to { opacity: 0; scale: 0.97; translate: 0 4px; } }

/* Popovers and small pieces. */
.suggest:not([hidden]) { animation: pop-in 140ms var(--ease-out); transform-origin: top center; }
.filter-chip { animation: pop-in var(--dur) var(--ease-out); }
.activity-list:not([hidden]) { animation: list-open var(--dur) var(--ease-out); }
.activity-chevron { transition: transform var(--dur) var(--ease-out); }
.group > summary::after { transition: transform var(--dur) var(--ease-out); }
@keyframes pop-in { from { opacity: 0; translate: 0 -4px; scale: 0.98; } }
@keyframes list-open { from { opacity: 0; translate: 0 6px; } }

/* Album art fades in once it has loaded. */
.art-square img { opacity: 0; transition: opacity var(--dur-slow) ease; }
.art-square img.loaded { opacity: 1; }

/* Selection bar and toasts rise up, and sink away when they leave. */
.selection-bar:not([hidden]) { animation: rise-in var(--dur-slow) var(--ease-out); }
.selection-bar.leaving { animation: sink-out 160ms var(--ease-in) forwards; }
.toast { animation: rise-in var(--dur) var(--ease-out); }
.toast.leaving { animation: sink-out 200ms var(--ease-in) forwards; }
@keyframes rise-in { from { opacity: 0; translate: 0 14px; } }
@keyframes sink-out { to { opacity: 0; translate: 0 10px; } }

/* Theme switch crossfade (browsers with View Transitions). */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Medium screens: narrower columns ------------------------------------------------------- */

@media (max-width: 1180px) {
  .track-row { grid-template-columns: var(--cols-mid, 44px 40px 48px minmax(0, 2fr) minmax(0, 1.4fr) 76px 60px 56px); }
  .track-row .col-album { display: none; }
}

/* ---- Phones & small tablets ------------------------------------------------------------------------ */

@media (max-width: 760px) {
  body { font-size: 15px; }

  /* iOS zooms into inputs smaller than 16px; keep them at 16px. */
  input, select, textarea { font-size: 16px !important; }
  input[type="text"], input:not([type]), select { height: 40px; }

  .topbar { flex-wrap: wrap; gap: 8px 10px; padding-bottom: 8px; }
  .brand .wordmark { display: none; }
  .brand .brand-icon { display: grid; }
  .crumbs { order: 3; flex-basis: 100%; margin: 0 -6px; }
  /* Row 1: logo + tools. Row 2: the search bar, full width. Row 3: where you are. */
  .topbar-actions { display: contents; }
  .topbar-actions > .icon-btn:first-of-type { margin-left: auto; }
  .topbar-actions > .icon-btn { margin-left: -6px; }
  .search-wrap { order: 2; flex: 1 1 100%; gap: 0; }
  .search { flex: 1; width: auto; height: 42px; border-radius: 10px; padding: 0 12px; }
  .search-wrap.active .search { width: auto; }
  .search-cancel {
    display: block; flex: none; max-width: 0; overflow: hidden; opacity: 0; padding: 0; margin: 0;
    height: 44px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 16px; font-weight: 500;
    white-space: nowrap; cursor: pointer;
    transition: max-width 320ms var(--ease-out), opacity 220ms ease, padding 320ms var(--ease-out);
  }
  .search-wrap.active .search-cancel { max-width: 90px; opacity: 1; padding: 0 2px 0 12px; }
  .icon-btn { width: 40px; height: 40px; }

  .browser { padding: 16px max(16px, env(safe-area-inset-right)) 120px max(16px, env(safe-area-inset-left)); }
  .folder-head h1 { font-size: 30px; }
  .album-head { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .album-cover { width: 96px; height: 96px; }
  .album-head h1 { font-size: 30px; }
  .album-meta { font-size: 14px; }
  .folders { grid-template-columns: 1fr; gap: 0; border-top: 1.5px solid var(--text); }
  .folder { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; min-height: 52px; background: transparent; }

  .track-row { grid-template-columns: 48px 52px minmax(0, 1fr) auto 52px; min-height: 62px; }
  .track-row:not(.head) { contain-intrinsic-size: auto 62px; }
  .track-row.head { display: none; }
  .track-row .col-num, .track-row .col-artist, .track-row .col-album, .track-row .col-fmt { display: none; }
  .track-row .col-title { white-space: normal; padding-top: 8px; padding-bottom: 8px; }
  .track-row .col-title .main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .track-row .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .track-row .col-dur { padding-right: 14px; }
  .check-cell { height: 58px; }
  .check-cell input { width: 22px; height: 22px; }

  /* Selection circles only appear after tapping "Select". */
  .tracks:not(.selecting) .track-row { grid-template-columns: 62px minmax(0, 1fr) auto 52px; }
  .tracks:not(.selecting) .check-cell { display: none; }
  .tracks:not(.selecting) .track-row .col-art { padding-left: 14px; }
  .track-row .col-art img, .track-row .art-none { width: 44px; height: 44px; border-radius: 2px; }
  .tracks.selecting .check-cell { animation: pop-in var(--dur) var(--ease-out); }
  .folder-actions { flex-wrap: wrap; justify-content: flex-end; }

  /* The editor becomes a full-screen sheet. */
  .editor {
    position: fixed;
    inset: 0;
    width: auto;
    z-index: 20;
    border-left: 0;
    padding-top: env(safe-area-inset-top);
  }
  .editor:not([hidden]) { animation: sheet-up 340ms var(--ease-out); }
  .editor.closing { animation: sheet-down 240ms var(--ease-in) forwards; }
  .editor-head { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .editor-body { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .btn { height: 38px; }

  .selection-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; max-width: none; }

  dialog.sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
  dialog.sheet.small { width: 100vw; }
  dialog.sheet[open] { animation: sheet-up 340ms var(--ease-out); }
  dialog.sheet.closing { animation: sheet-down 240ms var(--ease-in) forwards; }
  .row-2 { gap: 8px; }
  .art-square { width: min(62vw, 220px); }
  .art-square.has-art { --side: min(62vw, 220px); }
  .activity-list { max-height: 34vh; }
}

/* Phone sheets slide fully from the bottom and stay solid, like iOS. */
@keyframes sheet-up { from { translate: 0 100%; } }
@keyframes sheet-down { to { translate: 0 100%; } }

/* Phones: a firmer, iOS-like push that never starts fully invisible. */
@media (max-width: 760px) {
  .nav-forward { animation-name: nav-in-forward-phone; animation-duration: 300ms; }
  .nav-back { animation-name: nav-in-back-phone; animation-duration: 300ms; }
  #folders.nav-forward, #folders.nav-back, #tracks.nav-forward, #tracks.nav-back { animation-delay: 0ms; }
}
@keyframes nav-in-forward-phone { from { opacity: 0.35; translate: 36px 0; } }
@keyframes nav-in-back-phone { from { opacity: 0.35; translate: -36px 0; } }

@media (min-width: 761px) {
  .editor-close { order: 0; }
  /* With the editor open, centre the selection bar and toasts over the track list,
     so they never cover the editor (e.g. the activity log's Undo buttons). */
  body:has(.editor:not([hidden])) .selection-bar,
  body:has(.editor:not([hidden])) .toasts { left: calc((100% - 500px) / 2); }
  body:has(.editor:not([hidden])) .selection-bar { max-width: calc(100vw - 500px - 24px); }
}

/* Lyrics: a comfortable box for long (and synced) text. */
.lyrics-input { min-height: 220px; line-height: 1.55; resize: vertical; font-variant-numeric: normal; }
.lyrics-lookup { margin-top: 8px; }
.lyrics-lookup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lyrics-lookup-row .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; margin-right: 4px; }
.lyrics-found {
  margin-top: 10px; padding: 12px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--border); animation: pop-in var(--dur) var(--ease-out);
}
.lyrics-found-head { font-size: 13px; margin-bottom: 8px; }
.lyrics-found-head span { color: var(--muted); }
.lyrics-preview {
  margin: 0 0 10px; padding: 10px; border-radius: 8px; background: var(--surface); max-height: 180px; overflow: auto;
  font: 13px/1.5 inherit; font-family: inherit; white-space: pre-wrap; unicode-bidi: plaintext;
}
.lyrics-found-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field-hint.is-info { color: var(--muted); }

/* ---- Credits sheet: the editor's fields set like liner-notes credits ------------------ */

.editor .field input[type="text"], .editor .field input:not([type]),
.auth-card input[type="text"], .auth-card input[type="password"] {
  border-color: transparent; border-bottom-color: var(--field-line); border-radius: 0; background: transparent; padding-left: 2px;
}
.editor .field input:hover, .auth-card input:hover { border-bottom-color: var(--text); }
.editor .field input:focus, .auth-card input:focus {
  border-color: var(--spot); border-radius: 4px; background: var(--input-bg); padding-left: 10px;
}
.editor .field.is-removed input { background: var(--danger-soft); }
.editor .input-wrap .clear { opacity: 0; transition: opacity var(--dur-fast) ease; }
.editor .input-wrap:hover .clear, .editor .input-wrap:focus-within .clear { opacity: 1; }
@media (hover: none) { .editor .input-wrap .clear { opacity: 1; } } /* touch: no hover to reveal it */

@media (min-width: 761px) {
  .editor .field { display: grid; grid-template-columns: 116px minmax(0, 1fr); column-gap: 14px; align-items: start; margin: 0; padding: 3px 0; }
  .editor .field > .field-label { grid-column: 1; padding-top: 10px; margin: 0; flex-wrap: wrap; row-gap: 2px; min-width: 0; overflow-wrap: anywhere; }
  .editor .field > .field-label .flag { margin-left: 0; flex-basis: 100%; }
  .editor .field > :not(.field-label) { grid-column: 2; }
  .editor .row-2 { display: block; }
  .auth-card .field { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; align-items: center; }
  .auth-card .field > .field-label { margin: 0; }
}

@media (max-width: 760px) {
  /* One album on a phone: the track number takes the thumbnail's place, like a booklet. */
  .tracks.one-album .track-row .col-num { display: block; text-align: left; padding-left: 16px; }
  /* Breadcrumbs: just the way back, since the page title already names where you are. */
  .crumbs a, .crumbs .sep { display: none; }
  .crumbs a:nth-last-of-type(2) { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; color: var(--text); }
  .crumbs a:nth-last-of-type(2)::before {
    content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 1.8px 1.8px; transform: rotate(45deg); flex: none;
  }
  .crumbs:not(:has(a:nth-last-of-type(2))) { display: none; }
}

/* ---- Connections: first-run choice and Settings → Connections ------------------------ */

.welcome { z-index: 210; } /* above the app; the sign-in overlay is already gone */
.welcome-card { width: min(520px, 100%); }
.choices { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; min-width: 0; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; min-height: 44px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.choice:hover { border-color: var(--text); }
.auth-card .choice input {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; padding: 0;
  border: 1.5px solid var(--field-line); border-radius: 50%; background: var(--input-bg); display: grid; place-items: center;
}
.choice input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--spot); transform: scale(0); transition: transform var(--dur-fast) var(--ease-out); }
.choice input:checked { border-color: var(--spot); }
.choice input:checked::after { transform: scale(1); }
.choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--spot); box-shadow: inset 0 0 0 1px var(--spot); }
.choice-body { display: flex; flex-direction: column; gap: 3px; }
.choice-title { font-weight: 700; }
.choice-sub { font-size: 13px; color: var(--muted); }
.welcome-list { border-top: 1.5px solid var(--text); margin-bottom: 14px; animation: fade-in var(--dur) ease; }
.welcome-list .conn-row { padding: 12px 0; border-bottom: 1px solid var(--rule); }

.connections { margin: 0 0 16px; }
.section-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.conn-intro { margin: 0 0 4px; }
.connections .conn-row { padding: 10px 0; border-top: 1px solid var(--rule); }
.connections .conn-row:first-child { border-top: 0; }
.conn-row { align-items: flex-start; }
.conn-row input[role="switch"] { margin-top: 2px; }
.conn-sends { font-size: 12px; color: var(--faint); margin-top: 2px; }
.conn-sends b { font-weight: 600; color: var(--muted); }
.conn-hosts { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
.conn-lock { font-size: 12px; color: var(--warning); margin-top: 2px; }
.conn-row.locked { cursor: default; }
.conn-row.locked input[role="switch"] { opacity: 0.5; cursor: default; }

/* ---- Match on MusicBrainz ------------------------------------------------------------- */

dialog.sheet.wide { width: min(760px, calc(100vw - 32px)); }
.mb-lead { color: var(--muted); margin: 0 0 14px; }
.mb-search, .mb-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.mb-link { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 14px; }
.mb-search .field, .mb-link .field { margin: 0 0 10px; }
.mb-search .btn, .mb-link .btn { margin-bottom: 10px; height: 36px; }
.mb-empty { color: var(--muted); padding: 20px 0; }
.mb-cands { border-top: 1.5px solid var(--text); }
.mb-cand {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%;
  padding: 10px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; cursor: pointer;
  border-radius: 0;
}
.mb-cand:hover { background: var(--hover); }
.mb-cand:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mb-thumb { width: 56px; height: 56px; border-radius: 3px; object-fit: cover; display: block; background: var(--hover); box-shadow: 0 0 0 1px var(--border); }
.mb-noart { display: grid; place-items: center; color: var(--faint); padding: 0; }
.mb-noart svg { width: 22px; height: 22px; }
.mb-cand-main, .mb-release-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mb-cand-title { font-weight: 650; overflow-wrap: anywhere; }
.mb-dis { font-weight: 400; color: var(--muted); }
.mb-cand-artist { color: var(--text); font-size: 14px; }
.mb-cand-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-cand-side { display: flex; align-items: center; gap: 8px; }
.mb-score { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.mb-score.good { color: var(--success); }
.mb-score.ok { color: var(--warning); }
.mb-score.low { color: var(--faint); }
.mb-chev svg { width: 16px; height: 16px; color: var(--faint); display: block; }
.mb-credit { font-size: 12px; color: var(--faint); }
.mb-credit a { color: inherit; }

.mb-release { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1.5px solid var(--text); }
.mb-release .mb-thumb { width: 72px; height: 72px; }
.mb-release-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.mb-release-links a { color: var(--accent); font-weight: 500; }

.mb-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.mb-group { border-bottom: 1px solid var(--rule); }
.mb-group-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.mb-group-row .check { margin: 0; color: var(--text); }
.mb-group-more { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; min-height: 32px; }
.mb-group-more svg { width: 14px; height: 14px; transition: transform var(--dur-fast) ease; }
.mb-group.open .mb-group-more svg { transform: rotate(90deg); }
.mb-group-fields { display: grid; gap: 2px; padding: 0 0 10px 28px; }
.mb-group-fields .check { margin: 0; min-height: 32px; font-size: 13px; }
.mb-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin-top: 8px; }

.mb-files { border-top: 1.5px solid var(--text); }
.mb-file { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.mb-file.check { display: block; margin-top: 0; color: inherit; cursor: auto; } /* not the checkbox-label .check */
.mb-file-head { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, 46%); gap: 10px; align-items: center; }
.mb-file-icon svg { width: 18px; height: 18px; display: block; }
.mb-file.ok .mb-file-icon { color: var(--success); }
.mb-file.check .mb-file-icon, .mb-file.skip .mb-file-icon { color: var(--warning); }
.mb-file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.mb-file .note { font-size: 12px; color: var(--muted); margin: 4px 0 0 30px; }
.mb-file.check .mb-file-head + .note, .mb-file.skip .mb-file-head + .note { color: var(--warning); }
.mb-file.error .mb-file-name { color: var(--danger); }
.mb-diff { margin: 4px 0 0 30px; }
.mb-diff summary { font-size: 12px; color: var(--accent); cursor: pointer; min-height: 28px; display: inline-flex; align-items: center; }
.mb-diff-list { margin-top: 4px; }
.mb-diff-row { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr); gap: 10px; padding: 4px 0; font-size: 13px; border-top: 1px solid var(--rule); }
.mb-diff-key { color: var(--muted); }
.mb-diff-val { overflow-wrap: anywhere; }
.mb-old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.mb-new { color: var(--text); font-weight: 500; }

@media (max-width: 760px) {
  dialog.sheet.wide { width: 100vw; }
  .mb-search { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mb-search .btn, .mb-link .btn { height: 40px; }
  .mb-groups, .mb-options { grid-template-columns: minmax(0, 1fr); }
  .mb-file-head { grid-template-columns: 20px minmax(0, 1fr); }
  .mb-file-head select { grid-column: 2; }
  .mb-cand { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .mb-cand .mb-thumb { width: 48px; height: 48px; }
  .mb-chev { display: none; }
  .choice { padding: 14px; }
}
.mb-current { margin-top: 4px; }
.mb-sound {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; margin: 0 0 14px; border: 1px solid var(--border-strong); border-radius: 10px;
}
.mb-sound-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); min-width: 0; }
.mb-sound-text strong { color: var(--text); font-size: 14px; }
.mb-sound .btn { flex: none; }
.mb-heard { font-size: 12px; color: var(--success); font-weight: 500; }

/* ---- Find in MusicBrainz: hollow button with a MusicBrainz-coloured gradient edge ---- */

.album-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.album-chips .spot-chip { margin-top: 0; }
.mb-find {
  --mb-plum: #ba478f; --mb-orange: #eb743b;
  display: inline-flex; padding: 1.5px; border: 0; border-radius: 7px; cursor: pointer; color: var(--text);
  background: linear-gradient(115deg, var(--mb-plum) 0%, var(--mb-orange) 35%, var(--mb-plum) 70%, var(--mb-orange) 100%);
  background-size: 240% 240%; background-position: 0% 50%;
  transition: transform var(--dur) var(--ease-out), box-shadow 280ms ease;
}
.mb-find-inner {
  display: inline-flex; align-items: center; gap: 7px; height: 29px; padding: 0 11px;
  border-radius: 5.5px; background: var(--bg); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur) ease;
}
.mb-find .mb-logo { width: 16px; height: 16px; stroke: none; }
.mb-logo .mb-l { fill: var(--mb-plum); }
.mb-logo .mb-r { fill: var(--mb-orange); }
.mb-logo .mb-cut { fill: var(--bg); opacity: 0.3; }
.mb-find-short { display: none; }
.mb-find:hover {
  animation: mb-shift 2.2s ease infinite;
  box-shadow: 0 0 16px -2px rgba(186, 71, 143, 0.45), 0 0 22px -4px rgba(235, 116, 59, 0.35);
  transform: translateY(-1px);
}
.mb-find:hover .mb-find-inner { background: color-mix(in oklab, var(--bg) 94%, var(--text)); }
.mb-find:active { transform: scale(0.985); }
.mb-find:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes mb-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .mb-find:hover { animation: none; transform: none; }
}
.mb-find.in-actions { margin-right: auto; } /* far left, opposite Apply preset */
.mb-find.phone-only { display: none; }

@media (max-width: 760px) {
  .mb-find.beside-genre { display: none; }
  .mb-find.phone-only { display: inline-flex; }
  .folder-actions:has(.mb-find) { flex: 1 1 100%; }
  .mb-find-inner { height: 37px; padding: 0 13px; } /* 40px touch target with the edge */
  .mb-find-long { display: none; }
  .mb-find-short { display: inline; }
}

/* Connections: a section you can open and close */
.conn-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 44px;
  padding: 6px 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit;
}
.conn-toggle svg { color: var(--faint); transition: transform var(--dur) var(--ease-out); }




/* ---- Multi-disc albums: a "Disc 2" line between discs ------------------------------- */

.disc-head {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 18px 14px 8px;
  border-bottom: 1px solid var(--rule); color: var(--text); font-weight: 700; font-size: 14px;
}
.disc-head:first-of-type { padding-top: 10px; }
.disc-spin { display: inline-grid; color: var(--spot); }
.disc-spin svg { width: 20px; height: 20px; }
.disc-sub { color: var(--muted); font-weight: 500; }
.disc-head:hover .disc-spin, .disc-head.spinning .disc-spin { animation: disc-spin 2.4s linear infinite; }
.disc-head.spinning .disc-spin { animation-duration: 4s; }
@keyframes disc-spin { to { transform: rotate(360deg); } }
.num-disc { display: none; }
@media (hover: hover) {
  .tracks.multi-disc .track-row:hover .num-track { display: none; }
  .tracks.multi-disc .track-row:hover .num-disc { display: inline; color: var(--spot); }
}

/* ---- Player: a play button at the end of each row ------------------------------------- */

.col-play { position: relative; align-self: stretch; }
.play-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 0; height: 32px; min-width: 32px; padding: 0 8px;
  border: 1px solid var(--border-strong); border-radius: 16px; background: var(--bg); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) ease, gap var(--dur) var(--ease-out),
    padding var(--dur) var(--ease-out), background-color var(--dur-fast) ease;
}
.play-btn svg { width: 14px; height: 14px; }
.play-label { display: inline-block; max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width var(--dur) var(--ease-out), opacity var(--dur-fast) ease; }
@media (hover: hover) {
  .play-btn:hover, .play-btn:focus-visible {
    gap: 6px; padding: 0 12px 0 10px; border-color: var(--spot); color: var(--spot); transform: translateY(-50%) scale(1.06);
  }
  .play-btn:hover .play-label, .play-btn:focus-visible .play-label { max-width: 60px; opacity: 1; }
}
.play-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.track-row.is-current .play-btn { background: var(--spot); border-color: var(--spot); color: var(--on-color); }
.track-row.is-current .col-title .main { color: var(--spot); }
@media (prefers-reduced-motion: reduce) {
  .disc-head:hover .disc-spin, .disc-head.spinning .disc-spin { animation: none; }
}
@media (max-width: 760px) {
  .disc-head { padding-left: 16px; min-height: 48px; }
  .play-btn { right: 8px; height: 40px; min-width: 40px; border-radius: 20px; padding: 0 12px; } /* touch target */
}
.track-row .col-play { overflow: visible; } /* the button grows left over the time when pointed at */
.tracks.multi-disc .track-row .col-num { overflow: visible; text-overflow: clip; }
.num-disc { font-size: 12.5px; letter-spacing: -0.02em; }
.col-dur { transition: opacity var(--dur-fast) ease; }
.track-row:has(.play-btn:hover) .col-dur, .track-row:has(.play-btn:focus-visible) .col-dur { opacity: 0; }

/* ---- Organize ------------------------------------------------------------------------------- */

.org-pattern-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.org-pattern { font-family: var(--mono); font-size: 13px; }
.org-pattern-row select { width: auto; }
.org-tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn {
  min-height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer;
}
.chip-btn:hover { border-color: var(--spot); color: var(--spot); }
.org-help { margin: 8px 0 0; }
.org-example { display: grid; gap: 2px; margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--spot); background: var(--hover); border-radius: 0 6px 6px 0; }
.org-example:empty { display: none; }
.org-example code { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.org-ex-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.org-example .hint { margin: 2px 0 0; }
.org-ex-error { color: var(--danger); font-size: 13px; }
.org-list { border-top: 1.5px solid var(--text); }
.org-move { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.org-from { color: var(--muted); overflow-wrap: anywhere; }
.org-to { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.org-move.conflict .note, .org-move.error .note { color: var(--danger); }
.org-move .note { font-size: 12px; color: var(--faint); margin-top: 2px; }
@media (max-width: 760px) {
  .org-pattern-row { grid-template-columns: minmax(0, 1fr); }
  .chip-btn { min-height: 36px; }
}
.org-warn { font-size: 13px; color: var(--warning); background: var(--warning-soft); padding: 8px 10px; border-radius: 6px; margin: 0 0 10px; }

/* ---- Now playing: a long pill at the bottom centre, grown out of a circle ----------------- */

.now-playing {
  --np-w: min(580px, calc(100vw - 32px));
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 90;
  width: var(--np-w); height: 68px; transform: translateX(-50%);
  border-radius: 34px; overflow: hidden;
  background: var(--surface-raised); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
}
.np-inner { display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 10px 0 10px; }
.np-art {
  width: 48px; height: 48px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--hover); color: var(--faint);
}
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-playing.is-playing .np-art img { animation: disc-spin 12s linear infinite; } /* the cover turns like a record */
.np-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 0; background: none; padding: 4px 2px; text-align: left; cursor: pointer; color: inherit;
}
.np-title, .np-artist { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-title { font-weight: 700; font-size: 14px; }
.np-artist { font-size: 12.5px; color: var(--muted); }
.np-info:hover .np-title { color: var(--spot); }
.np-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.np-play {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--spot); color: var(--on-color); transition: transform var(--dur-fast) var(--ease-out);
}
.np-play:hover { transform: scale(1.06); }
.np-play svg { width: 18px; height: 18px; }
.np-close {
  width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: none; color: var(--muted); cursor: pointer;
}
.np-close:hover { background: var(--hover); color: var(--text); }
.np-close svg { width: 16px; height: 16px; }
.np-play:focus-visible, .np-close:focus-visible, .np-info:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Position: a thin spot-coloured line along the bottom edge; grab it to seek. */
.np-seek {
  position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 12px; margin: 0; cursor: pointer;
  appearance: none; -webkit-appearance: none; background: transparent;
}
.np-seek::-webkit-slider-runnable-track {
  height: 3px; margin-top: 9px;
  background: linear-gradient(var(--spot), var(--spot)) left / var(--pos, 0%) 100% no-repeat, var(--border);
}
.np-seek::-moz-range-track { height: 3px; background: var(--border); }
.np-seek::-moz-range-progress { height: 3px; background: var(--spot); }
.np-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--spot); opacity: 0; transition: opacity var(--dur-fast) ease; }
.np-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--spot); opacity: 0; }
.now-playing:hover .np-seek::-webkit-slider-thumb, .np-seek:focus-visible::-webkit-slider-thumb { opacity: 1; }
.now-playing:hover .np-seek::-moz-range-thumb { opacity: 1; }

/* Grows out of a circle: appear as a dot, then stretch into the pill; content fades in after. */
@keyframes np-grow {
  0% { width: 68px; opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.5); }
  40% { width: 68px; opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { width: var(--np-w); opacity: 1; transform: translateX(-50%); }
}
@keyframes np-shrink {
  0% { width: var(--np-w); opacity: 1; transform: translateX(-50%); }
  55% { width: 68px; opacity: 1; transform: translateX(-50%) scale(1); }
  100% { width: 68px; opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.5); }
}
@keyframes np-content { from { opacity: 0; } to { opacity: 1; } }
.now-playing.np-enter { animation: np-grow 520ms var(--ease-out) both; }
.now-playing.np-enter .np-inner, .now-playing.np-enter .np-seek { animation: np-content 220ms 300ms ease both; }
.now-playing.np-leave { animation: np-shrink 380ms var(--ease-in) both; }
.now-playing.np-leave .np-inner, .now-playing.np-leave .np-seek { opacity: 0; transition: opacity 120ms ease; }
@media (prefers-reduced-motion: reduce) {
  .now-playing.np-enter, .now-playing.np-leave, .now-playing.np-enter .np-inner, .now-playing.np-enter .np-seek { animation: none; }
  .now-playing.is-playing .np-art img { animation: none; }
}
/* Make room: lift it above the selection bar, and lift toasts above it. */
body:has(.selection-bar:not([hidden])) .now-playing { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 72px); }
body:has(.now-playing:not([hidden])) .toasts { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 150px); }
body:has(.now-playing:not([hidden])) .browser { padding-bottom: 120px; }
@media (max-width: 760px) {
  .np-time { display: none; }
  .np-inner { gap: 10px; }
}

/* ---- Setup steps, What's new, Inbox ------------------------------------------------------- */

.setup-count { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: -12px 0 10px; }
.setup-skip { align-self: center; margin-top: 12px; min-height: 36px; }
.choice-code { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.inbox-fields { display: grid; gap: 6px; margin-bottom: 14px; }
.inbox-fields .switch-row { padding: 6px 0; border-top: 1px solid var(--rule); }
.credit-news { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.credit-news:hover { color: var(--text); }
.news-version { padding: 4px 0 14px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.news-version:last-of-type { border-bottom: 0; }
.news-version h3 { font-size: 15px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.news-date { font-size: 12px; font-weight: 500; color: var(--muted); }
.news-version ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.news-version a { color: var(--accent); text-underline-offset: 2px; }
.news-version li { line-height: 1.45; }
.news-version code { font-family: var(--mono); font-size: 12px; background: var(--hover); padding: 0 4px; border-radius: 3px; overflow-wrap: anywhere; }
.news-more { min-height: 36px; }
#inbox-btn { position: relative; }
.badge-count {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--spot); color: var(--on-color); font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
.inbox-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.inbox-list { border-top: 1.5px solid var(--text); }
.inbox-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.inbox-title { font-weight: 650; overflow-wrap: anywhere; }
.inbox-artist { font-weight: 400; color: var(--muted); }
.inbox-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 4px; }
.inbox-chip { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 4px; background: var(--hover); color: var(--muted); }
.inbox-chip.ready, .inbox-chip.filed { background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success); }
.inbox-chip.review, .inbox-chip.nomatch, .inbox-chip.local { background: var(--warning-soft); color: var(--warning); }
.inbox-chip.error { background: var(--danger-soft); color: var(--danger); }
.inbox-chip.matching { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.inbox-note { font-size: 12px; color: var(--muted); }
.inbox-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.inbox-skip { font-size: 12px; min-height: 30px; }
.inbox-item.filed, .inbox-item.skipped { opacity: 0.7; }
.inbox-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .inbox-item { grid-template-columns: 48px minmax(0, 1fr); }
  .inbox-item .mb-thumb { width: 48px; height: 48px; }
  .inbox-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .inbox-actions .btn.small { height: 40px; }
}

/* ---- Notifications: bell, panel, pop-ups ------------------------------------------------- */

#notif-btn { position: relative; }
#notif-btn.ring svg { animation: bell-ring 700ms var(--ease-out); transform-origin: 50% 15%; }
@keyframes bell-ring { 15% { rotate: 14deg; } 35% { rotate: -11deg; } 55% { rotate: 7deg; } 75% { rotate: -3deg; } }
.notif-panel, .notif-pops { position: fixed; z-index: 120; width: min(380px, calc(100vw - 24px)); }
.notif-panel {
  max-height: min(520px, calc(100dvh - 90px)); overflow-y: auto; padding: 6px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.notif-pops { display: grid; gap: 8px; pointer-events: none; }
/* Both grow out of the bell: scaled from the corner nearest it. */
.notif-panel.notif-in, .notif-pop { animation: notif-grow 260ms var(--ease-out) both; transform-origin: calc(100% - var(--origin-x, 24px)) -8px; }
.notif-panel.notif-out, .notif-pop.notif-out { animation: notif-shrink 180ms var(--ease-in) both; transform-origin: calc(100% - var(--origin-x, 24px)) -8px; }
@keyframes notif-grow { from { opacity: 0; transform: scale(0.35); } to { opacity: 1; transform: none; } }
@keyframes notif-shrink { to { opacity: 0; transform: scale(0.35); } }
@media (prefers-reduced-motion: reduce) {
  .notif-panel.notif-in, .notif-pop, .notif-panel.notif-out, .notif-pop.notif-out, #notif-btn.ring svg { animation: none; }
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 6px; }
.notif-tools { display: flex; gap: 12px; font-size: 12px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item, .notif-pop {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%;
  padding: 10px; border: 0; border-radius: 12px; background: none; color: inherit; text-align: left; cursor: pointer;
}
.notif-item:hover { background: var(--hover); }
.notif-pop {
  pointer-events: auto; background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.notif-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--spot); }
.notif-icon svg { width: 16px; height: 16px; }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--muted); }
.notif-text strong { color: var(--text); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.notif-text span { overflow-wrap: anywhere; }
.notif-text time { font-size: 11px; color: var(--faint); }
.notif-item.unread .notif-text strong::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--spot); vertical-align: middle;
}
.notif-empty { padding: 6px 10px 12px; font-size: 13px; color: var(--muted); }
.inbox-mount-help { display: grid; gap: 4px; padding: 10px 12px; border-radius: 8px; background: var(--hover); font-size: 13px; color: var(--muted); }
.inbox-mount-help strong { color: var(--text); }
.inbox-mount-help pre { margin: 2px 0; font-family: var(--mono); font-size: 12px; color: var(--text); white-space: pre-wrap; }
.inbox-chip.downloading { background: var(--accent-soft); color: var(--spot); animation: pulse 1.6s ease-in-out infinite; }

/* ---- Soulseek (slskd): the !slskd chip, Find in slskd, the Soulseek sheet ------------------------- */

.bang-chip {
  --sk-a: #1f7ae0; --sk-b: #4cc0ff;
  display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 8px 0 6px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
  color: #fff; background: linear-gradient(115deg, var(--sk-a), var(--sk-b));
  animation: chip-in 220ms var(--ease-out);
}
.bang-chip[hidden] { display: none; }
.bang-chip .sk-logo { width: 13px; height: 13px; }
.bang-chip .sk-vane { fill: #fff; }
.bang-chip .sk-quill { stroke: #fff; }
.search.banged > svg { display: none; }
.search.banged:focus-within { box-shadow: 0 0 0 2px var(--sk-focus, #1f7ae0); }
@keyframes chip-in { from { transform: scale(0.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bang-chip { animation: none; } }

.sk-logo { fill: none; }
.sk-logo .sk-vane { fill: #2b8ff0; }
.sk-logo .sk-quill { fill: none; stroke: #1559b8; stroke-width: 1.6; stroke-linecap: round; }
[data-theme="dark"] .sk-logo .sk-quill { stroke: #7cc4ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sk-logo .sk-quill { stroke: #7cc4ff; } }

/* Find in slskd: the MusicBrainz button's twin, in slskd's blues */
.sk-find { --mb-plum: #1f7ae0; --mb-orange: #4cc0ff; }
.sk-find .sk-logo { width: 16px; height: 16px; }
.sk-find:hover { box-shadow: 0 0 16px -2px rgba(31, 122, 224, 0.45), 0 0 22px -4px rgba(76, 192, 255, 0.35); }
.mb-find.in-actions:has(+ .sk-find.in-actions) { margin-right: 0; }
.mb-find.phone-only:has(+ .sk-find.in-actions:not(.phone-only)) { margin-right: 0; }

.sk-search { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 0 0 0 8px;
  border: 1px solid var(--field-line); border-radius: 8px; background: var(--surface); }
.sk-search:focus-within { box-shadow: 0 0 0 2px #1f7ae0; }
.sk-search .bang-chip { cursor: default; animation: none; }
.sk-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); height: 38px; }
.sk-search .btn { border-radius: 0 7px 7px 0; height: 40px; margin: -1px -1px -1px 0; }
.sk-thumb { display: grid; place-items: center; }
.sk-thumb .sk-logo { width: 26px; height: 26px; }
.sk-item.focus { background: color-mix(in oklab, #1f7ae0 7%, transparent); }
.sk-progress { height: 4px; margin: 8px 0 2px; border-radius: 2px; background: var(--hover); overflow: hidden; max-width: 360px; }
.sk-progress span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #1f7ae0, #4cc0ff); transition: width 600ms ease; }
.inbox-chip.searching, .inbox-chip.downloading, .inbox-chip.fetched { background: color-mix(in oklab, #1f7ae0 13%, transparent); color: #1f6fd0; }
.inbox-chip.searching { animation: pulse 1.2s ease-in-out infinite; }
.sk-files { margin-top: 6px; font-size: 12px; color: var(--muted); }
.sk-files summary { cursor: pointer; min-height: 28px; display: flex; align-items: center; }
.sk-files ol { margin: 4px 0 0; padding-left: 20px; max-height: 180px; overflow: auto; }
.sk-cands { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.sk-cands li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.sk-cands li.current { opacity: 0.65; }
.sk-cand-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.sk-cand-text strong { overflow-wrap: anywhere; }
.sk-cand-text span { color: var(--muted); font-size: 12px; }

.sk-warn { display: flex; flex-direction: column; gap: 3px; margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text); background: var(--warning-soft); border-left: 3px solid var(--warning); text-align: left; }
.sk-warn strong { color: var(--warning); }
.sk-warn.soft { margin-top: 4px; }
.sk-settings { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.sk-head { display: flex; align-items: center; gap: 6px; margin: 0; }
.sk-head .sk-logo { width: 16px; height: 16px; }
.sk-fields { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.ap-switches { gap: 18px; margin-block: 8px 20px; }
.sk-fields .hint code { font-size: 12px; }
.sk-check { display: flex; flex-direction: column; gap: 6px; }
.sk-check p { margin: 0; }
.sk-ok { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--success); }
.sk-ok svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
@media (max-width: 760px) {
  .sk-search input { font-size: 16px; }
  .sk-cands li .btn.small { height: 40px; }
  .bang-chip { height: 26px; }
}
.search input:focus { box-shadow: none; border-color: transparent; }
.sk-item { grid-template-columns: 56px minmax(0, 1fr); align-items: start; }
.sk-item .inbox-actions { grid-column: 2; justify-content: flex-start; }
@media (max-width: 760px) {
  /* Searching Soulseek: the bar takes the room of the tools it doesn't need. */
  .sk-item { grid-template-columns: 48px minmax(0, 1fr); }
  .sk-item .inbox-actions { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) { .search, .search-cancel { transition: none !important; } }

/* Inbox: its tools are proper buttons, apart from the text */
.inbox-head { align-items: flex-start; flex-wrap: wrap; }
.inbox-head .mb-lead { flex: 1 1 260px; margin-bottom: 0; }
.inbox-tools { display: flex; gap: 8px; flex: none; }
.btn.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn.with-icon svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn.with-icon .sk-logo { stroke: none; }
.inbox-head + .inbox-list { margin-top: 14px; }
@media (max-width: 760px) {
  .inbox-tools { flex: 1 1 100%; }
  .inbox-tools .btn { flex: 1; justify-content: center; height: 44px; }
}

/* Download progress (inbox items still arriving, Soulseek downloads) */
.dl-progress { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-width: 360px; }
.dl-progress .sk-progress { margin: 0; max-width: none; }
.dl-progress-text { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Notifications on phones: within the screen (12px from each edge), a little more compact. */
@media (max-width: 760px) {
  .notif-panel, .notif-pops { width: min(360px, calc(100vw - 24px)); }
  .notif-panel { padding: 4px; border-radius: 14px; max-height: min(460px, calc(100dvh - 140px)); }
  .notif-head { padding: 6px 8px 4px; }
  .notif-head strong { font-size: 14px; }
  .notif-tools .link-btn { min-height: 36px; }
  .notif-item, .notif-pop { grid-template-columns: 26px minmax(0, 1fr); gap: 9px; padding: 8px; border-radius: 10px; }
  .notif-pop { border-radius: 14px; }
  .notif-icon { width: 26px; height: 26px; }
  .notif-icon svg { width: 14px; height: 14px; }
  .notif-text { font-size: 12.5px; gap: 1px; }
  .notif-text strong { font-size: 13.5px; }
  .notif-text time { font-size: 10.5px; }
}

/* ---- Library health: the card on the Library page and its sheet ---------------------------------- */

.health-slot { margin: -4px auto 18px; } /* auto: centred in the page column like everything else */
.health-card {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur) ease, transform var(--dur) var(--ease-out);
}
.health-card:hover { background: var(--hover); }
.health-card:active { transform: scale(0.995); }
.health-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.health-card > svg:last-child { width: 16px; height: 16px; margin-left: auto; fill: none; stroke: var(--faint); stroke-width: 1.8; flex: none; }
.health-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success); }
.health-card.has-issues .health-card-icon { background: var(--warning-soft); color: var(--warning); }
.health-card-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.health-card-text { display: flex; flex-direction: column; min-width: 0; }
.health-card-text strong { font-size: 15px; font-weight: 650; }
.health-card-text span { font-size: 13px; color: var(--muted); }
.health-card-count { margin-left: auto; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px; display: grid; place-items: center;
  background: var(--warning-soft); color: var(--warning); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.health-card-count + svg { margin-left: 4px !important; }

.health-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.health-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; }
.health-chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
.health-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.health-chip.on span { color: color-mix(in oklab, var(--bg) 70%, transparent); }
.health-item { grid-template-columns: 56px minmax(0, 1fr); align-items: start; }
.health-item .inbox-actions { grid-column: 2; justify-content: flex-start; }
.health-thumb { display: grid; place-items: center; }
.health-thumb svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.health-folders { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 6px; font-size: 13px; }
.health-settings .health-cat { margin-top: 14px; }
.health-settings .health-cat h3 { margin: 0 0 4px; }
@media (max-width: 760px) {
  .health-item { grid-template-columns: 48px minmax(0, 1fr); }
  .health-item .inbox-actions { grid-column: 1 / -1; }
  .health-chip { min-height: 36px; }
  .health-card { min-height: 60px; }
}


/* ---- Bangs: the chip per service, and the suggestions under the search bar ------------------------ */

.bang-chip.bang-mb { background: linear-gradient(115deg, #ba478f, #eb743b); }
.bang-chip.bang-mb .mb-logo { width: 13px; height: 13px; }
.bang-chip.bang-mb .mb-logo .mb-l, .bang-chip.bang-mb .mb-logo .mb-r { fill: #fff; }
.bang-chip.bang-mb .mb-logo .mb-cut { fill: #ba478f; opacity: 1; }
.search.banged:has(.bang-mb):focus-within { box-shadow: 0 0 0 2px #ba478f; }
.bang-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; min-width: 300px; padding: 6px;
  background: var(--surface-raised); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lg);
  transform-origin: 50% -8px;
}
.bang-suggest.opening { animation: bang-open 260ms cubic-bezier(0.32, 0.72, 0, 1) both; }
.bang-suggest.closing { animation: bang-close 160ms ease-in both; }
@keyframes bang-open { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
@keyframes bang-close { to { opacity: 0; transform: translateY(-4px) scale(0.97); } }
.bang-suggest-head { margin: 4px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.bang-suggest-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.bang-suggest-item:hover, .bang-suggest-item:focus-visible { background: var(--hover); outline: none; }
.bang-suggest-item .bang-chip { animation: none; cursor: inherit; }
.bang-suggest-about { color: var(--muted); }
.bang-suggest-item kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); }
@media (max-width: 760px) {
  .bang-suggest { min-width: 0; right: 0; }
  .bang-suggest-item kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bang-suggest.opening, .bang-suggest.closing { animation: none; }
  .search, .search > svg { transition: none !important; }
}

/* ---- Explore MusicBrainz: search results, artists, releases ---------------------------------------- */

.mbx { display: flex; flex-direction: column; gap: 26px; }
.mbx-h { font-size: 13px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.mbx-h span { color: var(--faint); font-variant-numeric: tabular-nums; }
.mbx-source { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); margin-top: 8px; }
.mbx-source .mb-logo { width: 13px; height: 13px; }
.mbx-artists { display: flex; flex-direction: column; border-top: 1.5px solid var(--text); }
.mbx-artist { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 4px; border-bottom: 1px solid var(--rule);
  color: var(--text); text-decoration: none; }
.mbx-artist:hover { background: var(--hover); }
.mbx-artist > svg { width: 16px; height: 16px; margin-left: auto; fill: none; stroke: var(--faint); stroke-width: 1.8; flex: none; }
.mbx-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, color-mix(in oklab, #ba478f 30%, var(--surface)), color-mix(in oklab, #eb743b 30%, var(--surface)));
  font-weight: 800; font-size: 17px; }
.mbx-artist-text { display: flex; flex-direction: column; min-width: 0; }
.mbx-artist-text strong { font-weight: 650; overflow-wrap: anywhere; }
.mbx-meta, .mbx-dis { color: var(--muted); font-size: 13px; font-weight: 400; }
.mbx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.mbx-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mbx-card a { color: inherit; text-decoration: none; }
.mbx-card a:hover strong { text-decoration: underline; }
.mbx-cover { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface);
  box-shadow: 0 1px 0 var(--border); display: block; }
.mbx-noart { display: grid; place-items: center; color: var(--faint); }
.mbx-noart svg { width: 28%; height: 28%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.mbx-card-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.mbx-card-text strong { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.mbx-card-text > span { color: var(--muted); overflow-wrap: anywhere; }
.mbx-owned { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; width: fit-content; padding: 1px 8px 1px 6px;
  border-radius: 999px; font-size: 11.5px; font-weight: 650; text-decoration: none;
  background: color-mix(in oklab, var(--success) 14%, transparent); color: var(--success); }
.mbx-owned svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.mbx-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; }
.mbx-links a { color: var(--accent); }
.mbx-tracks { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--text); }
.mbx-track { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; min-height: 46px;
  padding: 12px 4px; border-bottom: 1px solid var(--rule); }
.mbx-n { color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.mbx-t { overflow-wrap: anywhere; }
.mbx-len { color: var(--muted); font-variant-numeric: tabular-nums; }
.mbx-disc { padding: 16px 4px 6px; font-size: 12px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) {
  .mbx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mbx-artist { min-height: 64px; }
}
.folders.mbx-host { display: block; border-top: 0; }
.folder-actions a.btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.folder-actions a.btn.primary { color: var(--bg); }


/* ---- Account as a Control Center: grows out of the profile picture ------------------------------- */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
dialog.cc {
  position: fixed; inset: auto; top: var(--cc-top, 64px); right: var(--cc-right, 12px); left: auto; margin: 0;
  width: var(--cc-width, 420px); max-width: none; max-height: calc(100dvh - var(--cc-top, 64px) - 12px);
  padding: 0; border: 0; background: transparent; overflow: visible; color: var(--text);
}
dialog.cc::backdrop { background: rgba(0, 0, 0, 0.16); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.cc[open]::backdrop { animation: cc-fade 300ms ease both; }
dialog.cc.closing::backdrop { animation: cc-fade 200ms ease reverse both; }
@keyframes cc-fade { from { opacity: 0; } }
.cc-panel {
  max-height: inherit; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: 28px;
  background: color-mix(in oklab, var(--surface-raised) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid color-mix(in oklab, var(--border-strong) 60%, transparent);
  box-shadow: 0 30px 70px -18px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform-origin: var(--cc-ox, 90%) var(--cc-oy, -20px);
}
dialog.cc[open] .cc-panel { animation: cc-in 520ms cubic-bezier(0.32, 0.72, 0, 1) both; }
dialog.cc.closing .cc-panel { animation: cc-out 240ms cubic-bezier(0.4, 0, 1, 1) both; }
@keyframes cc-in { 0% { opacity: 0; transform: scale(0.06); border-radius: 50%; } 35% { opacity: 1; } 100% { transform: none; } }
@keyframes cc-out { to { opacity: 0; transform: scale(0.06); border-radius: 50%; } }
@media (prefers-reduced-motion: reduce) {
  dialog.cc[open] .cc-panel, dialog.cc.closing .cc-panel { animation: cc-fade 150ms ease both; }
}
.cc-tile { margin: 0; padding: 12px 14px; border: 0; border-radius: 20px; background: color-mix(in oklab, var(--text) 5.5%, transparent); }
.cc-tile.profile { display: flex; align-items: center; gap: 14px; }
.cc-tile .about-head { flex-wrap: wrap; }
.cc-tile .conn-toggle { padding: 0; min-height: 40px; }
.cc-tile.connections, .cc-tile.password { border-top: 0; }
.cc-tile .password-form { margin-top: 10px; border-top: 0; padding-top: 0; }
.cc-row.password.open .conn-toggle svg { transform: rotate(90deg); }
.cc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cc-toggle {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  min-height: 92px; padding: 12px 11px; border: 0; border-radius: 20px; background: color-mix(in oklab, var(--text) 5.5%, transparent);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: background-color 250ms ease, transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
}
.cc-toggle:hover { background: color-mix(in oklab, var(--text) 9%, transparent); }
.cc-toggle:active { transform: scale(0.94); }
.cc-toggle input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cc-toggle:has(input:focus-visible), .cc-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cc-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in oklab, var(--text) 10%, transparent); transition: background-color 250ms ease, color 250ms ease; }
.cc-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-label { font-size: 12.5px; font-weight: 650; line-height: 1.15; }
.cc-state { margin-top: -4px; font-size: 11.5px; color: var(--muted); }
.cc-toggle:has(input:checked) .cc-ico, .cc-toggle.on .cc-ico { background: var(--accent); color: var(--on-color, #fff); }
.cc-onoff::after { content: var(--t-off, "Off"); }
.cc-toggle:has(input:checked) .cc-onoff::after { content: var(--t-on, "On"); }
.cc-foot { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0; }
@media (max-width: 760px) {
  .cc-panel { border-radius: 26px; }
  .cc-toggle { min-height: 100px; padding: 11px 9px; }
  .cc-label { font-size: 12px; }
  .cc-foot .btn { height: 44px; }
}


/* ---- Control Center, touched up: concentric corners (inner radius = outer radius - padding) ------- */

.cc-panel { --cc-r: 30px; --cc-pad: 10px; border-radius: var(--cc-r); padding: var(--cc-pad); gap: var(--cc-pad); }
.cc-tile, .cc-toggle { border-radius: calc(var(--cc-r) - var(--cc-pad)); }
.cc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cc-pad); }
.cc-toggle { min-height: 96px; }
.cc-tile .btn, .cc-foot .btn { border-radius: 999px; padding-left: 14px; padding-right: 14px; }
.cc-tile .badge { border-radius: 999px; }
.cc-tile .avatar-lg { box-shadow: 0 0 0 3px color-mix(in oklab, var(--text) 6%, transparent); }
.cc-foot { padding: 4px 8px 2px; }
@media (max-width: 760px) { .cc-panel { --cc-r: 28px; } }

/* ---- Loading, everywhere: a thin line under the top bar, spinners, skeletons ------------------------ */

.net-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none; }
.net-bar::before { content: ""; position: absolute; inset: 0; width: 38%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: net-slide 1.1s cubic-bezier(0.45, 0, 0.25, 1) infinite; }
.net-bar.net-in { animation: cc-fade 200ms ease both; }
.net-bar.net-out { animation: cc-fade 250ms ease reverse both; }
@keyframes net-slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
.spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in oklab, currentColor 22%, transparent); border-top-color: currentColor; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mbx-wait { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-top: 6px; }
.sk-shimmer { background: linear-gradient(90deg, color-mix(in oklab, var(--text) 6%, transparent) 0%, color-mix(in oklab, var(--text) 11%, transparent) 50%,
  color-mix(in oklab, var(--text) 6%, transparent) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-line { display: block; height: 11px; border-radius: 6px; width: 80%; }
.sk-line.short { width: 50%; }
.mbx-skeleton .mbx-cover { box-shadow: none; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor;
  vertical-align: 1px; animation: live 1.2s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.25; transform: scale(0.7); } }
.bang-chip.busy { pointer-events: none; }
/* A button whose action is waiting on the server: a spinner inside it, and no second press. */
.working { pointer-events: none; }
.btn.working { opacity: 0.8; }
.link-btn.working { display: inline-flex; align-items: center; gap: 6px; opacity: 0.8; }
.btn.small.working .spinner, .link-btn.working .spinner { width: 12px; height: 12px; }
.bang-chip.busy svg { animation: spin 900ms linear infinite; }
.field-error { margin: 0; font-size: 13px; color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .net-bar::before { animation-duration: 2.5s; }
  .spinner, .bang-chip.busy svg, .sk-shimmer, .live-dot { animation-duration: 2s; }
}


/* ==== Frosted glass & motion ====================================================================
   Glass only on what floats above the page (sheets, menus, toasts, notifications, the selection bar,
   the now-playing pill), so the blur stays cheap. Motion is transform + opacity only, on one curve. */

:root {
  --spring: cubic-bezier(0.32, 0.72, 0, 1);         /* settles like iOS sheets: quick start, soft landing */
  --glass-pane: color-mix(in oklab, var(--surface-raised) 74%, transparent);
  --glass-line: color-mix(in oklab, var(--border-strong) 55%, transparent);
  --glass-blur: saturate(180%) blur(22px);
  --glass-edge: inset 0 1px 0 color-mix(in oklab, #fff 16%, transparent);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  dialog.sheet, .notif-panel, .notif-pop, .toast, .suggest, .bang-suggest, .selection-bar, .now-playing, .changes-pop {
    background: var(--glass-pane);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-color: var(--glass-line);
    box-shadow: var(--shadow-lg), var(--glass-edge);
  }
  dialog.sheet::backdrop, dialog.confirm::backdrop { -webkit-backdrop-filter: blur(6px) saturate(115%); backdrop-filter: blur(6px) saturate(115%); }
  .topbar { -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); }
  /* Long lists inside a glass sheet get a little more body so text stays crisp. */
  .sheet-body .inbox-list, .sheet-body .mb-cands, .health-settings { background: transparent; }
}
@media (prefers-reduced-transparency: reduce) {
  dialog.sheet, .notif-panel, .notif-pop, .toast, .suggest, .bang-suggest, .selection-bar, .now-playing, .changes-pop, .cc-panel {
    background: var(--surface-raised); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* Rounder floating surfaces, matching the Control Center. */
dialog.sheet { border-radius: 22px; }
.sheet-foot { border-top-color: var(--glass-line); }
.toast { border-radius: 16px; }
.suggest, .bang-suggest { border-radius: 14px; }
.selection-bar { border-radius: 18px; }

/* Sheets settle in on the spring; the backdrop fades and blurs behind them. */
dialog.sheet[open] { animation: glass-in 380ms var(--spring) both; }
dialog.sheet.closing { animation: glass-out 180ms var(--ease-in) forwards; }
dialog.sheet[open]::backdrop { animation: fade-in 320ms ease both; }
@keyframes glass-in { from { opacity: 0; scale: 0.94; translate: 0 10px; } }
@keyframes glass-out { to { opacity: 0; scale: 0.97; translate: 0 6px; } }
@media (max-width: 760px) {
  dialog.sheet { border-radius: 24px 24px 0 0; }
  dialog.sheet[open] { animation: sheet-up 420ms var(--spring) both; }
  dialog.sheet.closing { animation: sheet-down 220ms var(--ease-in) forwards; }
}

/* Menus, toasts, the selection bar: same spring, a touch of scale. */
.suggest:not([hidden]) { animation: glass-pop 220ms var(--spring); }
.toast { animation: toast-in 420ms var(--spring) both; }
.toast.leaving { animation: toast-out 200ms var(--ease-in) forwards; }
.selection-bar:not([hidden]) { animation: toast-in 420ms var(--spring); }
@keyframes glass-pop { from { opacity: 0; scale: 0.96; translate: 0 -6px; } }
@keyframes toast-in { from { opacity: 0; scale: 0.92; translate: 0 18px; } }
@keyframes toast-out { to { opacity: 0; scale: 0.96; translate: 0 10px; } }

/* Things you press give a little. */
.btn, .icon-btn, .mb-find, .health-card, .health-chip, .bang-suggest-item, .folder {
  transition: transform 180ms var(--spring), background-color var(--dur) ease, border-color var(--dur) ease, box-shadow 240ms ease;
}
.btn:active:not(:disabled), .icon-btn:active, .health-chip:active, .bang-suggest-item:active { transform: scale(0.96); }
.folders:not(.as-list) .folder:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.35); }
.folder:active { transform: scale(0.985); }

/* Changing pages: the first rows ripple in (cheap: a few rows, opacity + a short slide). */
.nav-forward > .folder, .nav-back > .folder, .nav-fade > .folder,
.nav-forward > .track-row, .nav-back > .track-row, .nav-fade > .track-row { animation: row-in 360ms var(--spring) both; }
.nav-forward > .folder:nth-child(1), .nav-back > .folder:nth-child(1), .nav-fade > .folder:nth-child(1),
.nav-forward > .track-row:nth-child(1), .nav-back > .track-row:nth-child(1), .nav-fade > .track-row:nth-child(1) { animation-delay: 16ms; }
.nav-forward > .folder:nth-child(2), .nav-back > .folder:nth-child(2), .nav-fade > .folder:nth-child(2),
.nav-forward > .track-row:nth-child(2), .nav-back > .track-row:nth-child(2), .nav-fade > .track-row:nth-child(2) { animation-delay: 32ms; }
.nav-forward > .folder:nth-child(3), .nav-back > .folder:nth-child(3), .nav-fade > .folder:nth-child(3),
.nav-forward > .track-row:nth-child(3), .nav-back > .track-row:nth-child(3), .nav-fade > .track-row:nth-child(3) { animation-delay: 48ms; }
.nav-forward > .folder:nth-child(4), .nav-back > .folder:nth-child(4), .nav-fade > .folder:nth-child(4),
.nav-forward > .track-row:nth-child(4), .nav-back > .track-row:nth-child(4), .nav-fade > .track-row:nth-child(4) { animation-delay: 64ms; }
.nav-forward > .folder:nth-child(5), .nav-back > .folder:nth-child(5), .nav-fade > .folder:nth-child(5),
.nav-forward > .track-row:nth-child(5), .nav-back > .track-row:nth-child(5), .nav-fade > .track-row:nth-child(5) { animation-delay: 80ms; }
.nav-forward > .folder:nth-child(6), .nav-back > .folder:nth-child(6), .nav-fade > .folder:nth-child(6),
.nav-forward > .track-row:nth-child(6), .nav-back > .track-row:nth-child(6), .nav-fade > .track-row:nth-child(6) { animation-delay: 96ms; }
.nav-forward > .folder:nth-child(7), .nav-back > .folder:nth-child(7), .nav-fade > .folder:nth-child(7),
.nav-forward > .track-row:nth-child(7), .nav-back > .track-row:nth-child(7), .nav-fade > .track-row:nth-child(7) { animation-delay: 112ms; }
.nav-forward > .folder:nth-child(8), .nav-back > .folder:nth-child(8), .nav-fade > .folder:nth-child(8),
.nav-forward > .track-row:nth-child(8), .nav-back > .track-row:nth-child(8), .nav-fade > .track-row:nth-child(8) { animation-delay: 128ms; }
.nav-forward > .folder:nth-child(9), .nav-back > .folder:nth-child(9), .nav-fade > .folder:nth-child(9),
.nav-forward > .track-row:nth-child(9), .nav-back > .track-row:nth-child(9), .nav-fade > .track-row:nth-child(9) { animation-delay: 144ms; }
.nav-forward > .folder:nth-child(10), .nav-back > .folder:nth-child(10), .nav-fade > .folder:nth-child(10),
.nav-forward > .track-row:nth-child(10), .nav-back > .track-row:nth-child(10), .nav-fade > .track-row:nth-child(10) { animation-delay: 160ms; }
.nav-forward > .folder:nth-child(11), .nav-back > .folder:nth-child(11), .nav-fade > .folder:nth-child(11),
.nav-forward > .track-row:nth-child(11), .nav-back > .track-row:nth-child(11), .nav-fade > .track-row:nth-child(11) { animation-delay: 176ms; }
.nav-forward > .folder:nth-child(12), .nav-back > .folder:nth-child(12), .nav-fade > .folder:nth-child(12),
.nav-forward > .track-row:nth-child(12), .nav-back > .track-row:nth-child(12), .nav-fade > .track-row:nth-child(12) { animation-delay: 192ms; }
.nav-forward > .folder:nth-child(13), .nav-back > .folder:nth-child(13), .nav-fade > .folder:nth-child(13),
.nav-forward > .track-row:nth-child(13), .nav-back > .track-row:nth-child(13), .nav-fade > .track-row:nth-child(13) { animation-delay: 208ms; }
.nav-forward > .folder:nth-child(14), .nav-back > .folder:nth-child(14), .nav-fade > .folder:nth-child(14),
.nav-forward > .track-row:nth-child(14), .nav-back > .track-row:nth-child(14), .nav-fade > .track-row:nth-child(14) { animation-delay: 224ms; }
@keyframes row-in { from { opacity: 0; translate: 0 6px; } }

/* Covers settle into place; the album header follows. */
.album-cover { animation: cover-in 520ms var(--spring) both; }
@keyframes cover-in { from { opacity: 0; scale: 0.94; } }
.mbx-card { animation: row-in 360ms var(--spring) both; }

@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open], dialog.sheet.closing, .toast, .toast.leaving, .suggest:not([hidden]), .selection-bar:not([hidden]),
  .nav-forward > *, .nav-back > *, .nav-fade > *, .album-cover, .mbx-card { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  .btn:active, .icon-btn:active, .folder:hover, .folder:active { transform: none !important; }
}

/* Softer buttons to match the rounder glass surfaces. */
.btn { border-radius: 10px; }
.btn.small { border-radius: 8px; }
.mb-find { border-radius: 10px; }
.mb-find-inner { border-radius: 8.5px; }
.inbox-chip, .badge { border-radius: 6px; }

/* Control Center: the same quick, simple motion as the other sheets (inbox, presets), still anchored at the profile picture. */
dialog.cc[open] .cc-panel { animation: glass-in 380ms var(--spring) both; }
dialog.cc.closing .cc-panel { animation: glass-out 180ms var(--ease-in) forwards; }
dialog.cc[open]::backdrop { animation: fade-in 320ms ease both; }
dialog.cc.closing::backdrop { animation: fade-out 180ms ease forwards; }
@media (prefers-reduced-motion: reduce) {
  dialog.cc[open] .cc-panel, dialog.cc.closing .cc-panel { animation-duration: 1ms !important; }
}


/* ---- Icon buttons that show their name on hover (Apply preset, Organize, Select) ------------------ */

.btn.icon-expand { display: inline-flex; align-items: center; gap: 0; padding: 0 9px; min-width: 34px; justify-content: center; }
.btn.icon-expand > svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.icon-expand-label { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; margin-left: 0;
  transition: max-width 320ms var(--spring), opacity 180ms ease, margin-left 320ms var(--spring); }
@media (hover: hover) {
  .btn.icon-expand:hover .icon-expand-label, .btn.icon-expand:focus-visible .icon-expand-label { max-width: 150px; opacity: 1; margin-left: 7px; }
}
.btn.icon-expand.primary > svg { stroke: currentColor; }
@media (max-width: 760px) {
  /* One tidy row: Find buttons on the left, compact icons on the right. */
  .folder-actions { gap: 6px; flex-wrap: nowrap; align-items: center; }
  .folder-actions:has(.mb-find) { flex: 1 1 100%; }
  .btn.icon-expand { width: 40px; height: 40px; min-width: 40px; padding: 0; border-radius: 12px; }
  .folder-actions .mb-find-inner { height: 37px; padding: 0 11px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .icon-expand-label { transition: none; } }
.btn.icon-expand.phone-only { display: none; }
@media (max-width: 760px) { .btn.icon-expand.phone-only { display: inline-flex; } }

/* ---- The full player: cover, controls, Up next, lyrics ------------------------------------------- */

.np-next { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none;
  color: var(--text); cursor: pointer; flex: none; transition: transform 160ms var(--spring), opacity var(--dur) ease; }
.np-next svg { width: 18px; height: 18px; }
.np-next:disabled { opacity: 0.35; cursor: default; }
.np-next:active:not(:disabled) { transform: scale(0.9); }
.np-art { cursor: pointer; }
dialog.player-sheet { width: min(480px, calc(100vw - 32px)); }
.player-sheet .sheet-head { justify-content: flex-end; padding-bottom: 0; }
.ps-grabber { display: none; }
.player-sheet .sheet-body { display: flex; flex-direction: column; gap: 14px; padding-top: 0; }
.ps-top { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.ps-cover { width: min(260px, 62vw); aspect-ratio: 1; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: var(--surface); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45); transform: scale(0.94);
  transition: transform 520ms var(--spring); }
.ps-cover.playing { transform: none; }
.ps-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-cover > svg { width: 30%; height: 30%; fill: none; stroke: var(--faint); stroke-width: 1.4; }
.ps-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.ps-title { font-size: 19px; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ps-artist { color: var(--muted); overflow-wrap: anywhere; }
.ps-from { font-size: 13px; margin-top: 2px; }
.ps-seekrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.ps-seek { position: static; width: 100%; height: 22px; opacity: 1; }
.ps-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.ps-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.ps-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--text);
  cursor: pointer; transition: transform 160ms var(--spring), background-color var(--dur) ease, color var(--dur) ease; }
.ps-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ps-btn:hover { background: var(--hover); }
.ps-btn:active:not(:disabled) { transform: scale(0.9); }
.ps-btn:disabled { opacity: 0.35; cursor: default; }
.ps-play { width: 60px; height: 60px; background: var(--text); color: var(--bg); }
.ps-play:hover { background: var(--text); }
.ps-play svg { width: 26px; height: 26px; }
.ps-shuffle, .ps-autoplay, .ps-tabbtn { color: var(--muted); }
.ps-shuffle.on, .ps-autoplay.on, .ps-tabbtn.on { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 420px) { .ps-controls { gap: 6px; } }
.ps-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: color-mix(in oklab, var(--text) 6%, transparent); }
.ps-tabs button { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 13px;
  font-weight: 650; cursor: pointer; transition: background-color var(--dur) ease, color var(--dur) ease; }
.ps-tabs button[aria-selected="true"] { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ps-panel { min-height: 160px; max-height: 38vh; overflow-y: auto; overscroll-behavior: contain; }
.ps-list { list-style: none; margin: 0; padding: 0; }
.ps-item { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--rule); }
.ps-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 4px; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.ps-item-main:hover { background: var(--hover); }
.ps-item-title { font-weight: 600; overflow-wrap: anywhere; }
.ps-item-artist { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ps-remove { flex: none; }
.ps-auto-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 16px 4px 8px; border-bottom: 1px solid var(--rule); }
.ps-auto-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; letter-spacing: .02em; color: var(--accent); }
.ps-auto-title svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ps-auto-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ps-empty { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; padding: 12px 2px; }
.ps-plain { white-space: pre-wrap; font-size: 16px; line-height: 1.6; padding: 6px 2px 20px; }
.ps-lines { list-style: none; margin: 0; padding: 28% 2px 40%; }
.ps-line { padding: 6px 4px; font-size: 21px; font-weight: 750; line-height: 1.3; letter-spacing: -0.01em; color: var(--faint); cursor: pointer;
  border-radius: 8px; transform-origin: left center; transition: color 300ms ease, transform 420ms var(--spring), opacity 300ms ease; }
.ps-line:hover { color: var(--muted); }
.ps-line.current { color: var(--text); transform: scale(1.02); }
@media (max-width: 760px) {
  .ps-grabber { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 0 calc(50% - 18px); }
  .player-sheet .sheet-head { justify-content: space-between; }
  .ps-panel { max-height: 34vh; }
  .ps-line { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .ps-line, .ps-cover { transition: none; } }

.ps-lyrics { position: relative; }
/* Lyrics showing: the cover steps aside so the words get the room. */
.player-sheet.lyrics-mode .ps-top { flex-direction: row; text-align: left; gap: 12px; }
.player-sheet.lyrics-mode .ps-cover { width: 64px; border-radius: 10px; transform: none; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.4); }
.player-sheet.lyrics-mode .ps-meta { align-items: flex-start; }
.player-sheet.lyrics-mode .ps-panel { max-height: 46vh; min-height: 46vh; }
@media (max-width: 760px) {
  dialog.player-sheet { width: 100vw; }
  .player-sheet.lyrics-mode .ps-panel { max-height: 44vh; min-height: 44vh; }
}

.health-more { display: block; margin: 14px auto 4px; }

/* Glass, grounded: more body so what's behind stays a soft hint, never readable text.
   Menus inside the top bar can't blur the page on iOS (the bar is their backdrop), so they're near-solid. */
:root { --glass-pane: color-mix(in oklab, var(--surface-raised) 88%, transparent); --glass-blur: saturate(160%) blur(28px); }
.bang-suggest { background: var(--surface-raised); }
.topbar .suggest { background: color-mix(in oklab, var(--surface-raised) 97%, transparent); }
.cc-panel { background: color-mix(in oklab, var(--surface-raised) 90%, transparent); }

/* Find & replace */
.rep-grid { display: grid; grid-template-columns: 1fr 1fr 170px; gap: 10px; }
.rep-options { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 0 4px; font-size: 13px; }
.rep-check { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.rep-preview { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 10px; }
.rep-count { font-weight: 650; margin: 0 0 8px; }
.rep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rep-list li { display: flex; flex-direction: column; gap: 2px; font-size: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.rep-file { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.rep-change { overflow-wrap: anywhere; }
.rep-change del { color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--danger) 60%, transparent); }
.rep-change ins { color: var(--success); text-decoration: none; font-weight: 600; }
.rename-input { width: 100%; }
@media (max-width: 760px) {
  .rep-grid { grid-template-columns: 1fr; }
  .desktop-only-wide { display: none !important; }
}

/* Actions and plugins */
.act-group { margin-top: 10px; }
.act-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.act-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; min-height: 64px; text-align: left;
  border: 1px solid var(--border-strong); border-radius: 12px; background: none; color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--dur) ease, background-color var(--dur) ease, transform 160ms var(--spring); }
.act-item:hover { background: var(--hover); }
.act-item:active { transform: scale(0.98); }
.act-item.on { border-color: var(--accent); background: var(--accent-soft); }
.act-item strong { font-size: 14px; }
.act-item span { font-size: 12.5px; color: var(--muted); }
.plugin-meta { color: var(--muted); font-weight: 400; font-size: 12px; }
/* Phones: the less-used tools live in a "…" menu */
.btn.icon-expand.tool-more { display: none; }
.tools-menu { position: fixed; z-index: 60; min-width: 200px; padding: 6px; border-radius: 14px; border: 1px solid var(--glass-line);
  background: color-mix(in oklab, var(--surface-raised) 94%, transparent); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg); transform-origin: top right; overflow-y: auto; overscroll-behavior: contain; }
.tools-menu.opening { animation: glass-pop 220ms var(--spring); }
.tools-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.tools-item:hover { background: var(--hover); }
.tools-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) {
  .btn.icon-expand.tool-desktop { display: none; }
  .btn.icon-expand.tool-more { display: inline-flex; }
}
.btn.icon-expand.tool-more .icon-expand-label { display: none; }

/* ---- Phones: 44px touch targets everywhere (Apple's minimum) ------------------------ */
@media (max-width: 760px) {
  .icon-btn { width: 44px; height: 44px; }
  .topbar-actions > .icon-btn { margin-left: -8px; }      /* same visual spacing as before */
  .brand { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  input[type="text"], input:not([type]), input[type="password"], input[type="search"], select { height: 44px; }
  .search { height: 44px; }
  .search input { height: 100%; }                          /* the whole bar takes the tap, not a 25px strip */
  .auth-card input, .auth-submit { height: 44px; }
  .credit-news { padding: 13px 6px; margin: -13px -6px; }  /* a small link with a full-size touch area */
  .crumbs a:nth-last-of-type(2) { min-height: 44px; }
  .view-toggle .icon-btn { width: 44px; height: 40px; }
  .btn.icon-expand { width: 44px; height: 44px; min-width: 44px; }
  .folder-actions .mb-find-inner { height: 41px; }
  .play-btn { height: 44px; min-width: 44px; border-radius: 22px; }
  .btn { min-height: 44px; }
  /* The selection bar: count, Clear, "…" (Preset, Replace, Actions) and Edit fit on one row. */
  #sel-preset, #sel-replace, #sel-actions, #sel-download, #sel-copy, #sel-paste, #sel-add, #sel-match, #sel-compare { display: none; }
  .selection-bar { gap: 10px; padding-left: 14px; }
  #selection-count { white-space: nowrap; }
}

/* Selection bar and playing bar both showing: keep the last rows clear of them. */
body:has(.selection-bar:not([hidden])):has(.now-playing:not([hidden])) .browser { padding-bottom: 190px; }

/* ---- Grid view: covers ---------------------------------------------------------------- */
.folders:not(.as-list) { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 24px 22px; }
.folders:not(.as-list) .folder {
  flex-direction: column; align-items: stretch; gap: 10px; min-height: 0; padding: 0;
  border: 0; background: transparent; font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
}
@media (hover: hover) { .folders:not(.as-list) .folder:hover { background: transparent; } }
.folder-cover {
  aspect-ratio: 1; border-radius: 4px; overflow: hidden; display: grid; place-items: center;
  background: var(--hover); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 20px -10px rgba(0, 0, 0, 0.35);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.folder-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.folders:not(.as-list) .folder-cover svg { width: 30%; height: 30%; color: var(--faint); }
@media (hover: hover) {
  .folders:not(.as-list) .folder:hover .folder-cover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 16px 30px -12px rgba(0, 0, 0, 0.45); }
}
.folders:not(.as-list) .folder:active .folder-cover { transform: scale(0.98); }
.folder-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.folder-text .folder-meta { font-size: 13px; font-weight: 400; letter-spacing: 0; }
@media (max-width: 760px) {
  .folders:not(.as-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; border-top: 0; }
  .folders:not(.as-list) .folder { border: 0; min-height: 0; }
}

/* Phones: the smaller controls get full-size touch areas too (looks stay the same where possible). */
@media (max-width: 760px) {
  .view-toggle { padding: 0; }
  .view-toggle .icon-btn { width: 44px; height: 44px; }
  .input-wrap input { padding-right: 46px; }
  .input-wrap .clear { right: 0; width: 44px; height: 44px; }  /* the "clear" cross fills the field's end */
  .segmented span { height: 40px; }                            /* + the control's 2px inset = a 44px row */
  .chip-btn, .health-chip { min-height: 44px; }
  .link-btn { min-height: 44px; padding: 0 4px; }
  summary { min-height: 44px; display: flex; align-items: center; }
  .np-close, .np-next { width: 44px; height: 44px; }
  .ps-tabs button { min-height: 44px; }
  #conn-toggle, #pw-toggle { min-height: 52px; }
  .credit-news { padding: 14px 6px; margin: -14px -6px; }
}
@media (max-width: 760px) {
  .activity-head { min-height: 44px; }
  .sk-files summary { min-height: 44px; }
  /* Checkbox rows ("Match case", "Remember this pattern"): the whole row is the tap target. */
  label:has(> input[type="checkbox"]:not([role="switch"])) { min-height: 44px; display: inline-flex; align-items: center; }
  .ps-seek { height: 44px; }  /* the player sheet's slider: easy to grab with a thumb */
}

/* A sheet focused as a whole when it opens (see openDialog): no ring around the whole sheet. */
dialog:focus { outline: none; }

/* ---- Context menu (right-click / long press) -------------------------------------------------- */
.ctx-menu { position: fixed; z-index: 60; min-width: 196px; max-width: min(280px, calc(100vw - 16px)); }
.ctx-sep { height: 1px; margin: 4px 8px; background: var(--rule); }
/* A track you were just taken to (Go to album, from a search): lit up for a moment. */
.track-row.row-flash { animation: set-flash 1.8s ease; }
.tools-item.danger { color: var(--danger, #c0392b); }
.tools-item.danger svg { color: currentColor; }
@media (hover: none) {
  /* A long press opens Codetta's menu, not the phone's text-selection pop-up. */
  .track-row, .folder { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}

/* "Move to": a small folder picker inside the confirmation sheet. */
.picker { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.picker-head { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-bottom: 1px solid var(--rule); background: var(--hover); }
.picker-where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list { max-height: min(46vh, 320px); overflow-y: auto; }
.picker-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.picker-item:last-child { border-bottom: 0; }
.picker-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.picker-item svg:last-child { color: var(--faint); }
.picker-item:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) { .picker-item:not(:disabled):hover { background: var(--hover); } }
.picker .hint { padding: 12px; margin: 0; }

/* Get info */
.info-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 4px 0 0; font-size: 14px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.picker-head .icon-btn svg { transform: rotate(180deg); } /* a chevron pointing back: up one folder */

/* ---- Advanced mode ------------------------------------------------------------------------------ */
.native-name {
  margin-left: auto; padding: 1px 6px; border-radius: 4px; background: var(--hover); color: var(--muted);
  font: 500 11px/1.5 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%;
}
.native-name.none { opacity: 0.6; font-style: italic; }
.field-label:has(.native-name) { display: flex; align-items: center; gap: 6px; }

.log-tile > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 52px; }
.log-tile > summary::-webkit-details-marker { display: none; }
.log-tile > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid var(--faint); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); transition: transform var(--dur) var(--ease-out); }
.log-tile[open] > summary::after { transform: rotate(-135deg); }
.log-lines {
  max-height: 260px; overflow: auto; margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  font: 11.5px/1.55 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.log-line { display: grid; grid-template-columns: auto 3.6em minmax(0, 1fr); gap: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-time { color: var(--faint); }
.log-level { color: var(--muted); }
.log-line.warning .log-level { color: #c98a00; }
.log-line.error .log-level, .log-line.critical .log-level { color: var(--danger); }
.log-tile #log-empty { margin: 8px 2px 0; }

/* MusicBrainz and slskd keep their colours in menus: a gradient like the !mb / !slskd chips. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.tools-item svg.mb-logo, .tools-item svg.sk-logo { stroke: none; }
.tools-item .mb-logo .mb-l, .tools-item .mb-logo .mb-r { fill: url(#mb-grad); }
.tools-item .mb-logo .mb-cut { fill: var(--surface-raised); opacity: 0.85; }
.tools-item .sk-logo .sk-vane { fill: url(#sk-grad); }
.tools-item .sk-logo .sk-quill { stroke: #1f7ae0; }
@media (min-width: 761px) {
  /* Desktop: labels sit in a narrow column beside the fields, so the in-file name goes under the label. */
  .field-label:has(.native-name) { flex-direction: column; align-items: flex-start; gap: 3px; }
  .native-name { margin-left: 0; max-width: 100%; }
}

/* Deezer / iTunes results in the match list */
.src-badge { align-self: flex-start; margin-top: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; }
.src-badge.deezer { background: linear-gradient(115deg, #a238ff, #ff5e5e); }
.src-badge.itunes { background: linear-gradient(115deg, #fa233b, #fb5c74); }
.mb-note { margin: 0 0 8px; }

/* Library care */
.choice-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.care-actions { display: flex; gap: 8px; margin: 4px 0 12px; }
.care-review { list-style: none; margin: 6px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.care-review li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.care-folder { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.care-folder strong, .care-folder span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.care-folder span { font-size: 12.5px; color: var(--muted); }

.inbox-found { margin: -4px 0 10px; font-size: 13px; font-weight: 500; display: flex; gap: 6px; align-items: baseline; }
.inbox-found::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.inbox-found.ok { color: #2e8b57; } .inbox-found.ok::before { background: #2e8b57; }
.inbox-found.bad { color: var(--danger); } .inbox-found.bad::before { background: var(--danger); }
:root[data-theme="dark"] .inbox-found.ok { color: #5fd08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .inbox-found.ok { color: #5fd08a; } }

/* Import */
.import-progress { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  width: min(420px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 14px; background: var(--surface-raised);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: grid; gap: 8px; font-size: 13.5px; font-weight: 500; }
.import-progress > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-bar { height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.import-bar > span { display: block; height: 100%; width: 0; background: var(--spot); transition: width 200ms ease; }
.drop-veil { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.drop-veil > div { display: grid; justify-items: center; gap: 8px; padding: 28px 32px; border: 2px dashed var(--spot); border-radius: 18px;
  background: var(--surface-raised); text-align: center; max-width: 340px; }
.drop-veil svg { width: 34px; height: 34px; fill: none; stroke: var(--spot); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop-veil span { color: var(--muted); font-size: 13.5px; }

/* Recently deleted */
.trash-list { max-height: 52vh; overflow-y: auto; }
.trash-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.trash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trash-main strong, .trash-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-main span { font-size: 12.5px; color: var(--muted); }
.trash-actions { display: flex; gap: 6px; flex: none; }
.trash-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 760px) { .trash-item { flex-wrap: wrap; } .trash-actions { width: 100%; justify-content: flex-end; } }
.link-btn.danger-text { color: var(--danger); }
.sheet.small.confirm:has(.trash-list), .sheet.small.confirm:has(.care-sheet) { width: min(640px, calc(100vw - 24px)); max-width: none; }
.inbox-chip.owned { border: 0; cursor: pointer; font-family: inherit; background: color-mix(in oklab, #d97706 16%, transparent); color: #b45309; }
:root[data-theme="dark"] .inbox-chip.owned { color: #fbbf24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .inbox-chip.owned { color: #fbbf24; } }

/* Tidy up: progress */
.care-card .health-card-text { min-width: 0; flex: 1; }
.care-bar { height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; margin-top: 6px; width: 100%; max-width: 360px; }
.care-bar > span { display: block; height: 100%; width: 0; background: var(--spot); border-radius: 2px; transition: width 400ms ease; }
.care-mode { margin: 0 0 10px; font-weight: 600; }
.care-progress { display: grid; gap: 6px; font-size: 14px; }
.care-progress .care-bar { max-width: none; height: 6px; border-radius: 3px; margin: 0; }
.care-when { font-size: 12.5px; color: var(--muted); }
.care-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px; }
.care-stat { display: grid; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.care-stat strong { font-size: 20px; line-height: 1.2; }
.care-stat span { font-size: 12.5px; color: var(--muted); }
.care-stat.warn strong { color: #b45309; }
:root[data-theme="dark"] .care-stat.warn strong { color: #fbbf24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .care-stat.warn strong { color: #fbbf24; } }

/* Search: rolling examples while idle */
.search-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; align-self: stretch; }
.search-roll { position: absolute; inset: 0; pointer-events: none; overflow: hidden; color: var(--faint); }
.roll-line { position: absolute; inset: 0; display: flex; align-items: center; }
.roll-line > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-line.in { animation: roll-in 520ms cubic-bezier(0.32, 0.72, 0, 1) both; }
.roll-line.out { animation: roll-out 420ms cubic-bezier(0.32, 0.72, 0, 1) both; }
@keyframes roll-in { from { opacity: 0; transform: translateY(0.9em); filter: blur(2px); } }
@keyframes roll-out { to { opacity: 0; transform: translateY(-0.9em); filter: blur(2px); } }
@media (prefers-reduced-motion: reduce) {
  .roll-line.in { animation: roll-fade 300ms ease both; }
  .roll-line.out { animation: none; opacity: 0; }
  @keyframes roll-fade { from { opacity: 0; } }
}
/* Search suggestions: your library */
.lib-suggest-item { grid-template-columns: auto auto minmax(0, 1fr); }
.lib-suggest-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--hover); color: var(--muted); }
.lib-suggest-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lib-suggest-label { font-weight: 600; }
.lib-suggest-example { justify-self: end; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--faint); }

/* Editions */
.mb-editions { margin: 4px 0 14px; }
.mb-edition-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 40vh; overflow-y: auto; border: 1px solid var(--rule); border-radius: 10px; }
.mb-edition-list li + li { border-top: 1px solid var(--rule); }
.mb-edition { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mb-edition:hover:not(:disabled) { background: var(--hover); }
.mb-edition:disabled { cursor: default; opacity: 1; }
.mb-edition-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-edition-main span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-edition-tag { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 4px; background: var(--hover); color: var(--muted); }
.mb-edition-tag.rec { background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent); }
.edition-prefs { display: grid; gap: 10px; }

.care-preview { display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; }
.care-preview-album { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.care-preview-move { display: grid; gap: 1px; font-size: 12.5px; }
.care-preview-move .from { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--muted) 50%, transparent); }
.care-preview-move .arrow { color: var(--faint); font-size: 11px; line-height: 1; }
.care-preview-move .to { color: var(--text); font-weight: 500; }
.care-preview-move span { overflow-wrap: anywhere; }
.sheet.small.confirm:has(.care-preview) { width: min(560px, calc(100vw - 24px)); max-width: none; }

/* Report a problem */
.report-text { width: 100%; box-sizing: border-box; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px;
  border-radius: 10px; border: 1px solid var(--field-line); background: var(--surface); color: var(--text); resize: vertical; }
.report-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.sheet.small.confirm:has(.report-sheet) { width: min(600px, calc(100vw - 24px)); max-width: none; }
.care-ignored { margin-top: 12px; }
.care-ignored > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.inbox-filed-head, .care-need-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inbox-filed-head { padding: 14px 0 4px; color: var(--muted); font-size: 14px; }
.inbox-filed-head .link-btn, .care-need-head .link-btn, .health-bulk .link-btn { min-height: 44px; }
.care-need-head .field-label { margin: 0; }
.health-bulk { display: flex; justify-content: flex-end; margin-top: 4px; }
.picker-new-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; white-space: nowrap; }
.picker-new-btn svg { width: 16px; height: 16px; }
.picker-head .picker-new-btn svg { transform: none; }
.picker-new { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.picker-new[hidden] { display: none; }
.picker-new .rename-input { flex: 1; min-width: 0; }
.catalog-grid { max-height: 62vh; overflow-y: auto; padding: 2px; }
.catalog-actions { display: flex; flex-wrap: wrap; gap: 0 12px; }
.catalog-actions .link-btn { min-height: 32px; font-size: 13px; }
/* !dz and !it: each chip in its service's colours, a white mark on the left like MusicBrainz and slskd */
.bang-chip .brand-logo { width: 13px; height: 13px; fill: #fff; stroke: none; flex: none; }
.bang-chip.bang-dz { background: linear-gradient(115deg, #7b22d6, #d6297c); } /* white text stays readable across it */
.bang-chip.bang-it { background: linear-gradient(115deg, #fa233b, #fb5c74); }
.search.banged:has(.bang-dz):focus-within { box-shadow: 0 0 0 2px #a238ff; }
.search.banged:has(.bang-it):focus-within { box-shadow: 0 0 0 2px #fa233b; }
.brand-logo { fill: currentColor; stroke: none; }
/* Tidy up: the "Need you" section stands apart from the stats above it */
.care-need { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.care-need-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.care-need-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--warning); background: var(--warning-soft); }
.care-need-hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* Account sheet: settings grouped into a few cards (Library, Online, Account & help), one row each */
.cc-group { display: grid; gap: 6px; margin: 0; }
.cc-group-title { margin: 6px 14px 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cc-tile.cc-list { padding: 0 14px; }
.cc-row { padding: 6px 0; }
.cc-row + .cc-row { border-top: 1px solid color-mix(in oklab, var(--text) 9%, transparent); }
.cc-row[hidden] { display: none; }
.cc-row[hidden] + .cc-row { border-top: 0; }
.cc-row .password-form { margin: 4px 0 10px; }
/* Find in MusicBrainz as a split button: the main action, and a chevron for Deezer / iTunes */
.mb-find-inner { border: 0; color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
/* The gradient edge is the outer box's padding; the parts inside follow its corners exactly
   (inner radius = outer radius - edge), and the chevron always fills the full height. */
.mb-find { --mb-r: 10px; --mb-edge: 1.5px; border-radius: var(--mb-r); padding: var(--mb-edge); align-items: stretch; }
.mb-find-inner { border-radius: calc(var(--mb-r) - var(--mb-edge)); }
.mb-find.split .mb-find-inner { border-radius: calc(var(--mb-r) - var(--mb-edge)) 0 0 calc(var(--mb-r) - var(--mb-edge)); }
.mb-find-more {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: auto; align-self: stretch;
  margin-left: var(--mb-edge); border: 0; border-radius: 0 calc(var(--mb-r) - var(--mb-edge)) calc(var(--mb-r) - var(--mb-edge)) 0;
  background: var(--bg); color: var(--muted); cursor: pointer;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
@media (max-width: 760px) { .mb-find-more { width: 40px; } } /* a full-size touch target on phones */
.mb-find-more svg { width: 14px; height: 14px; transform: rotate(90deg); }
.mb-find:hover .mb-find-more { background: color-mix(in oklab, var(--bg) 94%, var(--text)); color: var(--text); }
.mb-find-inner:focus-visible, .mb-find-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tools-item .mb-logo { width: 16px; height: 16px; stroke: none; }
.tools-item .brand-logo { width: 16px; height: 16px; }
/* A small heads-up under the search bar while a bang is on (Deezer has no release years) */
.bang-note {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; margin: 0; padding: 8px 12px;
  border-radius: 12px; font-size: 13px; line-height: 1.35; color: #5c4400;
  background: #fde68a; border: 1px solid #f5c84b; box-shadow: var(--shadow-lg); transform-origin: 50% -8px;
}
.bang-note[hidden] { display: none; }
.bang-note.opening { animation: bang-open 260ms cubic-bezier(0.32, 0.72, 0, 1) both; }
:root[data-theme="dark"] .bang-note { color: #fde68a; background: #3d3005; border-color: #6b5407; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bang-note { color: #fde68a; background: #3d3005; border-color: #6b5407; } }
@media (prefers-reduced-motion: reduce) { .bang-note.opening { animation: none; } }
.cc-row.connections { margin: 0; padding-bottom: 6px; } /* the old standalone tile kept a bottom margin */
/* Tidy up: the reason under an album wraps (two lines at most) instead of being cut off */
.care-folder span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Settings → General → Language */
.lang-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; }
.lang-row .switch-text { flex: 1; min-width: 0; }
.lang-row select { width: auto; flex: none; max-width: 50%; }

/* Desktop app, after Quit Codetta in a browser tab */
.quit-note { max-width: 420px; margin: 18vh auto 0; padding: 0 16px; text-align: center; }
.quit-note p { color: var(--muted); }

/* ReplayGain */
.rg-mode { margin: 4px 0 2px; }
.rg-results { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.rg-album-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.rg-album-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-list { list-style: none; margin: 0; padding: 0; }
.rg-list li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid color-mix(in oklab, var(--text) 7%, transparent); }
.rg-file { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-gain { font-weight: 600; white-space: nowrap; }
.rg-list .hint, .rg-album-head .hint { white-space: nowrap; margin: 0; }
.rg-mode + .hint { margin-top: 8px; }
.rg-failed { margin-top: 12px; }

/* Actions with choices (case, tags, separator) */
.act-options { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0 0; }
.act-options:empty { display: none; }
.act-options .field { flex: 1 1 200px; margin: 0; }

/* Tags from file names */
.fn-pattern { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
.fn-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.fn-chip { font: 500 13px/1 var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); cursor: pointer; }
.fn-chip:hover { background: var(--hover); }
.fn-chips select { width: auto; margin-left: auto; }
@media (pointer: coarse) { .fn-chip { min-height: 40px; } }
.fn-unmatched { margin-top: 12px; }
.fn-unmatched summary { cursor: pointer; color: var(--muted); }
@media (max-width: 760px) { .fn-chips select { margin-left: 0; width: 100%; } }

/* Paste a tracklist */
.tl-text { width: 100%; font: 14px/1.5 var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); resize: vertical; margin-top: 4px; }
.tl-line { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-list li.tl-warn { border-left: 3px solid var(--danger, #c0392b); padding-left: 9px; }

/* Save covers as files */
.rep-list li.ce-skip .rep-change { color: var(--muted); }

/* Discogs */
.bang-chip.bang-dg { background: linear-gradient(115deg, #1f1f1f, #4a4a4a); }
.search.banged:has(.bang-dg):focus-within { box-shadow: 0 0 0 2px #4a4a4a; }
.src-badge.discogs { background: linear-gradient(115deg, #1f1f1f, #4a4a4a); }

/* Artist names you can tap (album header, Artist column, player): text until pointed at. */
.artist-link { all: unset; cursor: pointer; color: inherit; font: inherit; border-radius: 4px; overflow-wrap: anywhere; }
@media (hover: hover) { .artist-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; } }
.artist-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .album-meta .artist-link, .ps-artist .artist-link { padding-block: 10px; margin-block: -10px; } }

/* Artist pictures: round, or the artist's initials on a colour of their own. */
.artist-av { display: inline-grid; place-items: center; flex: none; width: var(--av); height: var(--av); border-radius: 50%;
  overflow: hidden; background: hsl(var(--hue) 42% 46%); color: #fff; box-shadow: 0 0 0 1px var(--rule); vertical-align: middle; }
.artist-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.artist-av-ini { font-size: calc(var(--av) * 0.38); font-weight: 700; letter-spacing: .02em; line-height: 1; }
.artist-link { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.artist-stack { display: inline-flex; }
.artist-stack .artist-av + .artist-av { margin-left: -8px; }
.artist-stack .artist-av { box-shadow: 0 0 0 2px var(--bg); }
.col-artist .artist-link { display: inline; }
/* The artist menu: a proper list with pictures. */
.artist-menu { min-width: 240px; max-width: min(340px, calc(100vw - 24px)); padding: 6px; }
.artist-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.artist-item:hover, .artist-item:focus-visible { background: var(--hover); outline: none; }
.artist-item-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.artist-item-name { font-weight: 650; overflow-wrap: anywhere; }
.artist-item-sub { font-size: 12.5px; color: var(--muted); }

/* The track's file name in italics under its title, for a quick look at what's on disk. */
.track-row .fname { display: block; font-size: 12px; font-style: italic; color: var(--muted); opacity: .8; font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
/* Folder tools: computers show the main ones with their names; the rest are in More. */
@media (min-width: 761px) { .btn.icon-expand.tool-labelled { padding: 0 12px; } .btn.icon-expand.tool-labelled .icon-expand-label { max-width: none; opacity: 1; margin-left: 7px; } }
.tools-head { padding: 10px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tools-head:first-child { padding-top: 4px; }
.tools-menu .tools-head ~ .tools-head { margin-top: 4px; border-top: 1px solid var(--rule); }

/* Music apps: a value with Show / Copy beside it. */
.ss-copy { display: flex; gap: 8px; align-items: center; }
.ss-copy input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- Settings: every setting in one place ------------------------------------------------------------
   A full page: sections down the left on a computer, a list you tap into on a phone. */

dialog.settings {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: 0; border: 0; background: var(--bg); color: var(--text);
}
dialog.settings[open] { display: block; animation: set-in 320ms cubic-bezier(0.32, 0.72, 0, 1) both; }
dialog.settings.closing { animation: set-in 200ms ease reverse both; }
@keyframes set-in { from { opacity: 0; transform: scale(0.985); } }
@media (prefers-reduced-motion: reduce) { dialog.settings[open], dialog.settings.closing { animation: cc-fade 150ms ease both; } }
dialog.settings::backdrop { background: var(--bg); }
.set-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100%;
  padding-top: env(safe-area-inset-top); }
.set-nav { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 20px 14px 16px;
  padding-left: max(14px, env(safe-area-inset-left)); border-right: 1px solid var(--border); background: var(--surface); }
.set-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.set-nav-head h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.set-search input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent;
  background: var(--hover); color: var(--text); font: inherit; }
.set-search input:focus { outline: none; border-color: var(--accent); background: var(--surface-raised); }
.set-nav-list { display: grid; gap: 2px; overflow-y: auto; min-height: 0; }
.set-nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 7px 10px; border: 0;
  border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.set-nav-item:hover { background: var(--hover); }
.set-nav-item[aria-current="page"] { background: var(--accent-soft); }
.set-nav-item[aria-current="page"] .set-nav-title { color: var(--spot); }
.set-nav-ico { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px;
  background: var(--spot); color: var(--on-color, #fff); }
.set-nav-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.set-nav-text { display: grid; min-width: 0; flex: 1; }
.set-nav-title { font-weight: 600; }
.set-nav-sub { display: none; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-nav-item > svg { width: 16px; height: 16px; flex: none; display: none; color: var(--faint); fill: none; stroke: currentColor; stroke-width: 1.8; }

.set-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.set-head { display: flex; align-items: center; gap: 12px; padding: 20px 28px 8px; padding-right: max(28px, env(safe-area-inset-right)); }
.set-title { flex: 1; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.set-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 28px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.set-section, .set-results { max-width: 680px; display: grid; gap: 10px; animation: fade-in var(--dur) ease; }
.set-section[hidden], .set-results[hidden] { display: none; }
.set-group { margin: 14px 4px 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.set-group:first-child { margin-top: 0; }
.set-card { padding: 0 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.set-card:empty { display: none; }
.set-card > .cc-row, .set-card > .set-row, .set-card > .conn-row { padding: 8px 0; }
.set-card > * + * { border-top: 1px solid var(--border); }
.set-card > [hidden] { display: none; }
.set-card .profile { padding: 14px 0; border-bottom: 0; }
.set-pad { padding: 14px 0; display: grid; gap: 12px; }
.set-pad > .field { margin: 0; }
.set-lead { margin: 0; }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; }
.set-row .switch-text { flex: 1; }
.set-row > .segmented { flex: none; }
.set-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--muted);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.set-seg button.active { background: var(--surface-raised); color: var(--spot); font-weight: 650; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 0 0 1px var(--border-strong); }
.set-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  vertical-align: 1px; color: var(--muted); background: var(--hover); }
.set-flash { animation: set-flash 1.8s ease; border-radius: 10px; }
@keyframes set-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent-soft); background: var(--accent-soft); } }
.set-result { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 0; border: 0;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.set-result svg { width: 16px; height: 16px; color: var(--faint); fill: none; stroke: currentColor; stroke-width: 1.8; }
.set-result .switch-text { flex: 1; }
/* The boxes that used to live in the account sheet, now cards of their own */
.set-section > [id$="-box"] > * { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.set-section > [id$="-box"]:empty { display: none; }
.set-section .about { padding: 14px 0; }
.set-section .log-tile { padding: 12px 16px; }
.set-section .log-tile[hidden] { display: none; }
.set-section .lang-row { display: flex; align-items: center; gap: 16px; }
.set-section .lang-row .switch-text { flex: 1; }
.org-settings-link { margin: -4px 0 4px; font-size: 13px; }
#settings-dialog .desktop-only { display: inline-flex; }
.set-back { display: none; }

/* The small account menu: who's signed in, quick switches, then Settings */
.cc-who { display: flex; align-items: center; gap: 12px; }
.avatar-md { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  background: var(--accent-soft); color: var(--spot); font-weight: 700; font-size: 18px; }
.avatar-md img { width: 100%; height: 100%; object-fit: cover; }
.cc-who .profile-info { display: grid; }
.conn-toggle.cc-settings { justify-content: flex-start; }
.conn-toggle.cc-settings .switch-text { flex: 1; }
.conn-toggle.cc-settings .cc-ico { width: 32px; height: 32px; }

@media (max-width: 760px) {
  .set-shell { display: block; position: relative; overflow: hidden; }
  .set-nav, .set-main { position: absolute; inset: 0; padding-top: max(12px, env(safe-area-inset-top)); }
  .set-nav { border-right: 0; background: var(--bg); padding: 12px 16px 16px; transition: transform 380ms cubic-bezier(0.32, 0.72, 0, 1); }
  .set-main { background: var(--bg); transform: translateX(100%); transition: transform 380ms cubic-bezier(0.32, 0.72, 0, 1); visibility: hidden; }
  dialog.settings.in-section .set-main { transform: none; visibility: visible; }
  dialog.settings.in-section .set-nav { transform: translateX(-30%); }
  .set-nav-head h2 { font-size: 30px; }
  .set-search input { height: 40px; font-size: 16px; }
  .set-nav-list { gap: 0; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
  .set-nav-item { min-height: 58px; padding: 8px 0; border-radius: 0; }
  .set-nav-item + .set-nav-item { border-top: 1px solid var(--border); }
  .set-nav-item[aria-current="page"] { background: none; }
  .set-nav-item[aria-current="page"] .set-nav-title { color: inherit; }
  .set-nav-sub, .set-nav-item > svg { display: block; }
  .set-head { padding: 4px 16px 8px; display: grid; grid-template-columns: 1fr; }
  .set-back { display: inline-flex; align-items: center; gap: 2px; justify-self: start; min-height: 44px; margin-left: -8px; padding: 0 8px;
    border: 0; background: none; color: var(--spot); font: inherit; font-size: 17px; cursor: pointer; }
  .set-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .set-title { font-size: 28px; }
  #settings-dialog .desktop-only { display: none; }
  .set-body { padding: 4px 16px 32px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .set-row { flex-wrap: wrap; }
  .set-row > .segmented { width: 100%; }
  .set-seg button { flex: 1; height: 36px; }
  .set-section .lang-row { flex-wrap: wrap; }
  .set-section .lang-row select { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .set-nav, .set-main { transition: none; } }

/* ---- Wipe all tags: asked twice, in the middle of the screen (a phone too, not a bottom sheet) ---- */
dialog.sheet.small.confirm-center { margin: auto; }
.wipe-final { display: grid; justify-items: center; gap: 10px; text-align: center; padding-top: 6px; }
.wipe-final p { margin: 0; }
.wipe-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: color-mix(in srgb, var(--danger, #c0392b) 14%, transparent); color: var(--danger, #c0392b); }
.wipe-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
dialog.confirm.wipe-final-step .sheet-head { justify-content: center; text-align: center; }
dialog.confirm.wipe-final-step .sheet-head h2 { width: 100%; }
@media (max-width: 760px) {
  dialog.sheet.small.confirm-center { width: calc(100vw - 32px); max-width: 420px; margin: auto; border-radius: 22px; border-bottom: 1px solid var(--border); }
  dialog.sheet.small.confirm-center[open] { animation: glass-in 380ms var(--spring) both; }
  dialog.sheet.small.confirm-center.closing { animation: glass-out 180ms var(--ease-in) forwards; }
}

/* ---- Settings on a big screen: a centred window, not a page stretched edge to edge ---- */
@media (min-width: 1100px) {
  dialog.settings {
    inset: 0; width: min(1080px, calc(100vw - 64px)); height: min(860px, calc(100dvh - 64px)); margin: auto;
    border: 1px solid var(--border); border-radius: 22px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  }
  dialog.settings::backdrop { background: rgba(0, 0, 0, 0.32); -webkit-backdrop-filter: blur(8px) saturate(115%); backdrop-filter: blur(8px) saturate(115%); }
  dialog.settings[open]::backdrop { animation: fade-in 320ms ease both; }
  .set-shell { grid-template-columns: 280px minmax(0, 1fr); padding-top: 0; }
  .set-section, .set-results { max-width: 700px; margin: 0 auto; }
  .set-head { max-width: 756px; width: 100%; margin: 0 auto; }
}

/* Connections: each switch with its own setup box right under it */
.conn-item:empty { display: none; }
.conn-item > .conn-row { padding: 10px 0; }
.conn-item > [id$="-box"]:empty { display: none; }
.conn-item > [id$="-box"] > .sk-settings { margin-top: 0; padding: 0 0 14px 0; border-top: 0; }
.conn-item .sk-head { display: none; }
.conn-group:not(:has(.conn-row)), .set-group:has(+ .conn-group:not(:has(.conn-row))) { display: none; }

/* ---- The selection bar's buttons carry a small picture beside their names ---- */
.selection-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.selection-actions .btn > svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.selection-actions .btn[hidden] { display: none; }
#selection-count { white-space: nowrap; }
/* Not much room: the quieter tools show only their picture (the name is in the tooltip). */
@media (min-width: 761px) and (max-width: 1360px) {
  #sel-preset .lbl, #sel-replace .lbl, #sel-actions .lbl, #sel-download .lbl, #sel-compare .lbl { display: none; }
}

/* ---- Copy tags: pick which ---- */
.copy-picks { display: flex; gap: 6px; margin: 10px 0; }
.copy-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.copy-row { display: grid; grid-template-columns: auto minmax(110px, 170px) minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 40px; padding: 6px 12px; cursor: pointer; }
.copy-row + .copy-row { border-top: 1px solid var(--rule); }
.copy-row.differs { cursor: default; color: var(--faint); }
.copy-key { font-weight: 600; font-size: 13px; }
.copy-val { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.copy-row.differs .copy-val { font-style: italic; }

/* ---- Compare tags: side by side ---- */
@media (min-width: 761px) { dialog.sheet.compare { width: min(1100px, calc(100vw - 32px)); max-width: none; } }
.cmp-summary { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.cmp-summary svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cmp-summary.bad { background: var(--warning-soft); }
.cmp-summary.good { background: var(--accent-soft); }
.cmp-only { margin: 6px 0; }
.cmp-table { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: 60vh; }
.cmp-row { display: grid; grid-template-columns: minmax(120px, 170px) repeat(var(--cols), minmax(140px, 1fr)); }
.cmp-row + .cmp-row { border-top: 1px solid var(--rule); }
.cmp-key, .cmp-cell { padding: 8px 12px; font-size: 13px; overflow-wrap: anywhere; }
.cmp-key { font-weight: 600; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.cmp-cell + .cmp-cell { border-left: 1px solid var(--rule); }
.cmp-cell.empty { color: var(--faint); }
.cmp-headrow { position: sticky; top: 0; background: var(--surface-raised); z-index: 1; }
.cmp-head { font-weight: 650; }
.cmp-row.diff { background: color-mix(in oklab, var(--warning-soft) 100%, transparent); }
.cmp-row.diff .cmp-key { color: var(--text); }
.cmp-row.diff-song { background: var(--hover); }
.cmp-song { font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); }

/* ---- Match album tags ---- */
.match-from { margin: 12px 0 4px; }
.match-track { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.match-track select { flex: 1; min-width: 180px; }
@media (max-width: 760px) {
  #sel-clear .lbl, #sel-more .icon-expand-label { display: none; }
  #sel-clear { min-width: 44px; justify-content: center; }
  .cmp-row { grid-template-columns: 110px repeat(var(--cols), minmax(130px, 1fr)); }
  .copy-row { grid-template-columns: auto minmax(0, 1fr); }
  .copy-row .copy-val { grid-column: 2; }
}

.sk-more { margin: 6px 0 4px; }
.sk-file-picks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.sk-file-picks label { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 12.5px; cursor: pointer; }
.sk-file-picks label span[dir] { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sk-file-picks label.extra span[dir] { color: var(--muted); }
.sk-file-size { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.sk-file-tools { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 13px; }
@media (max-width: 760px) { .sk-file-picks label { min-height: 40px; } }
.sk-files .sk-file-picks li { border: 0; padding: 0; margin: 0; }

/* ---- An artist's folder: picture, bio, similar artists ---- */
.artist-head { align-items: end; row-gap: 0; }
.artist-head > .artist-av { grid-row: 1 / span 2; align-self: center; }
.artist-head > .artist-title { grid-column: 2; }
.artist-head > .artist-extra { grid-column: 2; align-self: start; }
.artist-head > .artist-av { --av: 168px; width: 200px; height: 200px; justify-self: center; box-shadow: var(--shadow-lg); }
.artist-head > .artist-av img { width: 100%; height: 100%; }
.artist-head > .artist-av .artist-av-ini { font-size: 56px; }
/* A folder for several artists ("Ali Sethi & Nicolas Jaar"): their pictures overlapping, in the picture's place */
.artist-head:has(> .artist-group) { grid-template-columns: auto minmax(0, 1fr); }
.artist-head > .artist-group { grid-row: 1 / span 2; align-self: center; justify-self: center; display: flex; align-items: center; }
.artist-group-item { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; position: relative;
  transition: transform var(--dur) ease; }
.artist-group-item + .artist-group-item { margin-left: -40px; }
.artist-group-item:hover { transform: translateY(-3px); z-index: 1; }
.artist-group-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; z-index: 1; }
.artist-group .artist-av { box-shadow: 0 0 0 4px var(--bg), var(--shadow-lg); }
.artist-group .artist-av-ini { font-size: 48px; }
.artist-group .artist-av { width: 156px; height: 156px; }
.artist-group.n3 .artist-av, .artist-group.n4 .artist-av { width: 116px; height: 116px; }
.artist-group.n3 .artist-group-item + .artist-group-item, .artist-group.n4 .artist-group-item + .artist-group-item { margin-left: -32px; }
.artist-group.n3 .artist-av-ini, .artist-group.n4 .artist-av-ini { font-size: 32px; }
@media (max-width: 760px) {
  .artist-head > .artist-group { grid-row: 1; }
  .artist-group .artist-av { width: 84px; height: 84px; }
  .artist-group .artist-av-ini { font-size: 24px; }
  .artist-group-item + .artist-group-item { margin-left: -22px; }
  .artist-group.n3 .artist-av, .artist-group.n4 .artist-av { width: 56px; height: 56px; }
  .artist-group.n3 .artist-group-item + .artist-group-item, .artist-group.n4 .artist-group-item + .artist-group-item { margin-left: -13px; }
}
@media (prefers-reduced-motion: reduce) { .artist-group-item:hover { transform: none; } }
.artist-extra { display: grid; gap: 12px; margin-top: 12px; max-width: 760px; }
.artist-extra:empty { display: none; }
.artist-bio-text { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.artist-extra.bio-open .artist-bio-text { -webkit-line-clamp: unset; line-clamp: unset; display: block; }
.artist-bio-foot { margin: 4px 0 0; font-size: 13px; color: var(--faint); }
.artist-bio-foot a { color: var(--muted); }
.artist-similar { display: grid; gap: 6px; }
.artist-similar-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.artist-similar-list { display: flex; flex-wrap: wrap; gap: 6px; }
.artist-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.artist-chip.here { color: var(--text); font-weight: 600; border-color: var(--border-strong); }
.artist-chip:hover { background: var(--hover); }
.artist-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; justify-self: start; }
.artist-hint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (max-width: 760px) {
  .artist-head { align-items: center; }
  .artist-head > .artist-av { grid-row: 1; }
  .artist-head > .artist-extra { grid-column: 1 / -1; margin-top: 14px; }
  .artist-chip:nth-child(n + 7) { display: none; }
  .artist-head > .artist-av { width: 96px; height: 96px; }
  .artist-head > .artist-av .artist-av-ini { font-size: 30px; }
}

/* ---- Section titles above a folder's folders and tracks ("Albums", "Tracks"), grid/list on the right ---- */
.sec-head { display: flex; align-items: center; gap: 10px; margin-top: 6px; margin-bottom: 12px; }
.sec-head[hidden] { display: none; }
.sec-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.sec-head .sec-count { color: var(--muted); font-size: 14px; }
.sec-head .spacer { flex: 1; }
#tracks-head { margin-top: 10px; }
@media (max-width: 760px) { .sec-head h2 { font-size: 20px; } }

/* ---- Your music ---- */
.folders.yours-host { display: block; border-top: 0; }
.yours-head h1 { font-size: 44px; }
.yours-head p { color: var(--muted); margin-top: 6px; }
.yours-tools { display: flex; gap: 8px; margin-top: 12px; }
.yours-tools .btn { display: inline-flex; align-items: center; gap: 6px; }
.yours-tools .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.yours-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 28px; }
.yours-tile { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; transition: transform var(--dur) var(--ease-out), border-color var(--dur); }
@media (hover: hover) { .yours-tile:hover { border-color: var(--spot); transform: translateY(-2px); } }
.yours-tile .folder-text { display: grid; gap: 2px; min-width: 0; }
.yours-tile .folder-name { font-weight: 650; }
.yours-tile .folder-meta { color: var(--muted); font-size: 13px; }
.yours-ico { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; color: #fff; }
.yours-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.yours-ico[data-kind="starred"] { background: linear-gradient(135deg, #ff5f7e, #d6336c); }
.yours-ico[data-kind="most"] { background: linear-gradient(135deg, #ffa94d, #e8590c); }
.yours-ico[data-kind="recent"] { background: linear-gradient(135deg, #4dabf7, #1c7ed6); }
.yours-pl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.yours-pl-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.yours-pl-head .btn { display: inline-flex; align-items: center; gap: 6px; }
.yours-pl-head .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.yours-playlists { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 24px 22px; }
.yours-empty { margin: 0; }
.yours-head:has(.yours-title-row) { flex: 1 1 320px; min-width: 0; }
.yours-title-row { display: flex; align-items: center; gap: 12px; }
.yours-title-row h1 { flex: 1; min-width: 0; }

/* Albums and Songs on the overview: a title line (count, See all, grid/list), then the newest. */
.yours-sec { margin: 0 0 30px; }
.yours-sec-head { display: flex; align-items: center; gap: 10px; }
.yours-sec-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.yours-sec-count { color: var(--muted); font-size: 14px; }
.yours-sec-head .spacer { flex: 1; }
.yours-all { color: var(--spot); font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 4px; }
@media (hover: hover) { .yours-all:hover { text-decoration: underline; } }
.yours-sec-sub { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
/* Grid: a shelf you scroll sideways, like a streaming app's. */
.yours-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 22px; overflow-x: auto;
  scroll-snap-type: x proximity; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: thin; }
.yours-shelf > * { scroll-snap-align: start; }
/* List: rows with a small cover. */
.yours-rows, .folders.yours-list { display: block; border-top: 1.5px solid var(--text); }
.yours-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 6px 6px 2px;
  border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--text); font: inherit; text-align: start;
  text-decoration: none; cursor: pointer; }
@media (hover: hover) { .yours-row:hover { background: var(--hover); } }
.yours-row:active { background: var(--pressed); }
.yours-thumb { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 4px;
  overflow: hidden; background: var(--hover); }
.yours-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yours-thumb svg { width: 40%; height: 40%; color: var(--faint); }
.yours-row-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.yours-row-name, .yours-row-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yours-row-name { font-weight: 600; }
.yours-row-meta { color: var(--muted); font-size: 13px; }
.yours-row-end { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
/* Songs play when tapped: a play mark shows over the cover on hover. */
button.yours-card { font: inherit; color: inherit; text-align: start; cursor: pointer; }
.folder-cover, .yours-thumb { position: relative; }
.yours-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); color: #fff;
  opacity: 0; transition: opacity var(--dur); }
.yours-play svg { width: 34%; height: 34%; color: #fff; }
.yours-thumb .yours-play svg { width: 50%; height: 50%; }
@media (hover: hover) { .yours-song:hover .yours-play { opacity: 1; } }
.yours-song:focus-visible .yours-play { opacity: 1; }

/* ---- Phones: a pill at the bottom for Library, Your music and the inbox ---- */
.tabbar { display: none; }
@media (max-width: 760px) {
  #yours-btn, #inbox-btn, #manage-btn, #theme-btn { display: none; }
  .topbar-actions > #tagfilter-btn { margin-left: auto; } /* the first one still showing goes right */
  .tabbar { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 80; transform: translateX(-50%);
    display: flex; gap: 2px; padding: 5px; border-radius: 999px; border: 1px solid var(--glass-line);
    background: color-mix(in oklab, var(--surface-raised) 88%, transparent); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-lg); }
  .tabbar button { position: relative; display: grid; justify-items: center; gap: 1px; min-width: 80px; white-space: nowrap; min-height: 48px; padding: 5px 12px 4px;
    border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
  .tabbar button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar button.active { color: var(--spot); background: var(--accent-soft); }
  .tabbar .badge-count { position: absolute; top: 2px; right: 14px; }
  /* Selecting, editing or a window open: the pill steps aside (the selection bar takes its place). */
  body:has(.selection-bar:not([hidden])) .tabbar, body:has(.editor:not([hidden])) .tabbar { display: none; }
  body:has(.tabbar):not(:has(.selection-bar:not([hidden]))) .now-playing { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 70px); }
  .browser { padding-bottom: 110px; }
  body:has(.now-playing:not([hidden])) .browser { padding-bottom: 190px; }
  .yours-head h1 { font-size: 32px; }
  .yours-tiles { grid-template-columns: 1fr; gap: 8px; }
  .yours-playlists { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .yours-shelf { grid-auto-columns: 138px; gap: 14px; margin: 0 -16px; padding: 2px 16px 10px; scroll-padding: 0 16px; scrollbar-width: none; }
  .yours-shelf::-webkit-scrollbar { display: none; }
  .yours-sec-head h2 { font-size: 20px; }
  .yours-sec-count { display: none; }
  .yours-row-end { display: none; }
  .view-toggle .icon-btn { width: 44px; height: 44px; }
}

/* ---- Covers of every shape ----
   The album header shows a cover at its own shape (--ar = width / height). Square spots (the folder
   grid, the player, the editor) show a cover that isn't square whole, over a blurred copy of itself. */
.album-head { grid-template-columns: auto minmax(0, 1fr); }
.album-cover { width: min(360px, calc(200px * var(--ar, 1))); height: auto; aspect-ratio: var(--ar, 1); object-fit: contain; }
.cover-odd { position: relative; isolation: isolate; }
.cover-odd > .cover-blur { position: absolute; inset: -12%; width: 124%; height: 124%; max-width: none; object-fit: cover;
  filter: blur(18px) saturate(1.15); opacity: 0.6; z-index: -1; pointer-events: none; }
.cover-odd > img.cover-whole { position: relative; width: 100%; height: 100%; object-fit: contain; }
.track-row .col-art img, .mb-thumb, .pop-art img { object-fit: contain; }
@media (max-width: 760px) {
  .album-head { grid-template-columns: auto minmax(0, 1fr); }
  .album-cover { width: min(170px, calc(96px * var(--ar, 1))); height: auto; }
}

/* ---- MusicBrainz review: which cover ---- */
.mb-covers { display: grid; gap: 8px; margin-top: 12px; }
.mb-covers:empty { display: none; }
.mb-cover-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.mb-cover-pick { display: grid; gap: 6px; justify-items: center; flex: none; width: 108px; padding: 6px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.mb-cover-pick.on { border-color: var(--accent); color: var(--text); font-weight: 600; background: var(--accent-soft); }
.mb-cover-img { display: block; width: 94px; height: 94px; border-radius: 3px; overflow: hidden; background: var(--hover); }
.mb-cover-img > img:not(.cover-blur) { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---- Reordering a playlist ---- */
.reorder-grip { display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; border: 0; border-radius: 10px;
  background: none; color: var(--muted); cursor: grab; touch-action: none; }
.reorder-grip:hover, .reorder-grip:focus-visible { background: var(--hover); color: var(--text); }
.reorder-grip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.drag-active, .drag-active * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.drag-active .track-row:not(.dragging) { transition: transform 180ms var(--ease-out); }
.track-row.dragging { position: relative; z-index: 5; background: var(--surface-raised); border-radius: 10px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-strong); }
@media (max-width: 760px) { .reorder-grip { width: 44px; height: 44px; } }

.empty .empty-back { margin-top: 12px; text-decoration: none; display: inline-flex; }
/* The editor open beside the list: the selection bar has half the room, so its tools show only their picture. */
@media (min-width: 761px) {
  body:has(.editor:not([hidden])) .selection-actions .btn:not(#sel-edit):not(#sel-clear) .lbl { display: none; }
  body:has(.editor:not([hidden])) .selection-bar { gap: 10px; }
  body:has(.editor:not([hidden])) .selection-actions { gap: 4px; }
}
#yours-btn[aria-pressed="true"] { color: var(--spot); background: var(--accent-soft); }
/* Under an album: albums like it. Covers in a row that scrolls sideways (snaps a card at a time);
   the library's own first, then past a rule the ones it doesn't have. */
.album-more { margin-top: 36px; display: grid; gap: 28px; }
.album-more[hidden] { display: none; }
.am-group { display: grid; gap: 12px; min-width: 0; }
.am-head { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.am-tag { padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: 0; }
.am-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 164px; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 2px 2px 10px; scrollbar-width: thin;
}
.am-card { display: grid; grid-template-rows: auto auto auto 1fr; gap: 3px; scroll-snap-align: start; min-width: 0;
  color: inherit; text-decoration: none; }
.am-cover { display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; overflow: hidden; margin-bottom: 6px;
  background: var(--hover); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 20px -12px rgba(0, 0, 0, 0.4);
  transition: transform var(--dur) ease, box-shadow var(--dur) ease; }
.am-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.am-cover svg { width: 30%; height: 30%; color: var(--faint); }
@media (hover: hover) {
  a.am-card:hover .am-cover, .am-card a.am-cover:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 16px 30px -12px rgba(0, 0, 0, 0.45); }
}
.am-card:focus-visible, .am-cover:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.am-title { font-size: 14px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.am-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-find {
  justify-self: start; align-self: end; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 11px; border-radius: 9px; border: 1.5px solid color-mix(in oklab, #3b9cf3 70%, var(--rule));
  background: var(--bg); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background-color var(--dur) ease;
}
.am-find svg { width: 14px; height: 14px; }
.am-find:hover { background: var(--hover); }
.am-find:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-away { display: grid; gap: 28px; }
.am-away:empty { min-height: 1px; }
.am-rule { width: 100%; margin: 4px 0 0; border: 0; border-top: 1px solid var(--rule); }
.am-away-label { margin: -12px 0 -12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.am-hint { justify-self: start; display: inline-flex; gap: 6px; align-items: center; }
.am-hint svg { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .album-more { margin-top: 28px; gap: 24px; }
  .am-head { font-size: 17px; }
  .am-row { grid-auto-columns: 138px; gap: 14px; margin: 0 -16px; padding: 2px 16px 10px; scroll-padding: 0 16px; scrollbar-width: none; }
  .am-row::-webkit-scrollbar { display: none; }
  .am-find { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .am-cover { transition: none; } }

/* ---- Album art, full size (js/coverview.js) ---- */
dialog.cover-view { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: hidden; }
dialog.cover-view::backdrop { background: rgba(0, 0, 0, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: fade-in 200ms ease both; }
dialog.cover-view[open] { animation: glass-pop 260ms var(--spring) both; }
dialog.cover-view.closing { animation: fade-out 160ms ease forwards; }
dialog.cover-view.closing::backdrop { animation: fade-out 160ms ease forwards; }
.cover-view-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%;
  padding: max(64px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.cover-view-img { display: block; max-width: 100%; max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain;
  border-radius: 3px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity var(--dur-slow) ease; }
.cover-view-img.loaded { opacity: 1; }
.cover-view-wait { position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; color: #fff; }
.cover-view-cap { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 0; font-size: 14px;
  color: rgba(255, 255, 255, 0.72); text-align: center; }
.cover-view-cap span:first-child:not(:last-child) { color: #fff; font-weight: 600; }
.cover-view-error { color: rgba(255, 255, 255, 0.8); }
.cover-view-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 1;
  width: 44px; height: 44px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cover-view-close:hover { background: rgba(255, 255, 255, 0.24); }
@media (prefers-reduced-motion: reduce) { dialog.cover-view[open], dialog.cover-view::backdrop { animation: none; } }
