/* MyJam: deep navy-black, soft blue/pink light, thin type, glass surfaces. */

:root {
  --bg-top: #05060c;
  --bg-bottom: #0b1028;
  --text: #f3f5ff;
  --muted: #8d93ad;
  --faint: rgba(255, 255, 255, 0.32);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(22, 26, 48, 0.78);
  --stroke: rgba(255, 255, 255, 0.09);
  --accent: #86a8ff;
  --accent-2: #c79bff;
  --pink: #ff93bd;
  --danger: #ff7d8e;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  color: var(--text);
  font: 400 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg .solid, svg .dot { fill: currentColor; stroke: none; }
strong { color: var(--text); font-weight: 600; }

.display { font-weight: 300; letter-spacing: -0.025em; margin: 0; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.error-text { color: var(--danger); min-height: 1.4em; margin: 0; }

/* Ambient light, like the coloured beams behind the phone in the design */
#ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.glow.blue { width: 420px; height: 420px; left: -180px; top: -120px; background: radial-gradient(circle, #3d6cff 0%, transparent 70%); }
.glow.pink { width: 380px; height: 380px; right: -200px; top: 38%; background: radial-gradient(circle, #ff6fa8 0%, transparent 70%); opacity: 0.35; }

.glass {
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
}

/* ---------------------------------------------------------------- buttons */

.round {
  width: 42px; height: 42px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--stroke);
  flex: none;
}
.round.plain { background: none; border-color: transparent; }
.round:active { transform: scale(0.94); }
.round svg { width: 22px; height: 22px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--text);
  color: #0a0d1c;
  font-weight: 600;
  font-size: 15px;
}
.pill svg { width: 18px; height: 18px; }
.pill.ghost { background: var(--glass); color: var(--text); border: 1px solid var(--stroke); }
.pill.wide { width: 100%; max-width: 300px; }
.pill:active { transform: scale(0.97); }
.text-btn { padding: 8px 6px; color: var(--muted); font-weight: 500; }
.text-btn.accent { color: var(--accent); }

/* ---------------------------------------------------------------- pages */

#app { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.page {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 14px) 20px 24px;
}
.page > * { flex-shrink: 0; } /* the page scrolls; its sections must never be squashed to fit */
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.page-top .display { font-size: 36px; }
.page-top.slim { margin-bottom: 4px; }

.search-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.search-pill svg { width: 19px; height: 19px; flex: none; }
.search-pill input { flex: 1; min-width: 0; padding: 13px 0; border: 0; background: none; outline: none; font-size: 16px; }
.search-pill:focus-within { border-color: rgba(134, 168, 255, 0.5); }

/* ---------------------------------------------------------------- track rows */

.track-list { list-style: none; margin: 0; padding: 0; }
.list-head { margin: 18px 4px 6px; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 48px 24px; list-style: none; }

.row {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 6px;
  border-radius: 16px;
  cursor: pointer;
}
.row:active { background: var(--glass); }
.row.dim { opacity: 0.45; }
.row-art { position: relative; width: 54px; height: 54px; flex: none; }
.row-art img, .row-art .ph { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; background: var(--glass); display: block; }
.row-text { flex: 1; min-width: 0; }
.row-title, .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title { font-size: 16px; font-weight: 400; }
.row-sub { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.row-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .round { width: 36px; height: 36px; color: var(--muted); }
.row .round svg { width: 20px; height: 20px; }
.row.current .row-title { color: var(--accent); }
.busy-text { color: var(--accent); }
.saved-badge { color: var(--accent); display: inline-flex; }
.saved-badge svg { width: 15px; height: 15px; stroke-width: 2; }
.track-list.compact .row-art { width: 46px; height: 46px; }
.track-list.compact .row-art img { border-radius: 12px; }

/* Animated bars on the song that's playing */
.eq { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; background: rgba(5, 6, 12, 0.55); }
.eq i { width: 3px; height: 14px; border-radius: 2px; background: var(--text); animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.eq.paused i { animation: none; height: 5px; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

.add-btn { color: var(--text) !important; }
.add-btn.added { background: var(--text); color: #0a0d1c !important; border-color: transparent; }

/* ---------------------------------------------------------------- playlists */

.playlist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.pl-card { text-align: left; min-width: 0; }
.pl-card:active { transform: scale(0.98); }
.pl-card .mosaic { margin-bottom: 10px; }
.pl-card-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-count { font-size: 13px; color: var(--muted); }
.pl-card.new .mosaic { display: grid; place-items: center; color: var(--muted); border: 1.5px dashed var(--stroke); background: none; }
.pl-card.new .mosaic svg { width: 34px; height: 34px; }

.mosaic {
  aspect-ratio: 1;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(134, 168, 255, 0.35), rgba(255, 147, 189, 0.25));
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
}
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic.one { grid-template-columns: 1fr; }
.mosaic.liked { grid-template-columns: 1fr; place-items: center; background: linear-gradient(135deg, #5b7cff, #c58bff 60%, #ff8fb8); }
.mosaic.liked svg { width: 42%; height: 42%; fill: #fff; stroke: none; }
.mosaic.big { width: 62%; max-width: 260px; margin: 6px auto 18px; }

.pl-hero { text-align: center; margin-bottom: 18px; }
.pl-hero .display { font-size: 30px; }
.pl-hero .muted { margin-top: 4px; }
.pl-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }

/* ---------------------------------------------------------------- mini player + tabs */

.mini {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  margin: 0 12px 8px;
  padding: 8px 8px 8px 8px;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
}
.mini img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mini-text { flex: 1; min-width: 0; }
.mini-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-line { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.mini-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.when-playing { display: none; }
.playing .when-paused { display: none; }
.playing .when-playing { display: block; }

#tabs {
  display: flex;
  margin: 0 12px calc(var(--safe-bottom) + 8px);
  border-radius: 24px;
  padding: 6px;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11px;
}
.tab.on { color: var(--text); background: rgba(255, 255, 255, 0.07); }

/* ---------------------------------------------------------------- full-screen player */

.player {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 6px) 22px calc(var(--safe-bottom) + 14px);
  background: radial-gradient(120% 70% at 50% 0%, #11152c 0%, #05060c 55%, #070a18 100%);
  overflow-y: auto;
  overflow-x: hidden;
  animation: sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.player-bg {
  position: absolute; inset: -60px; z-index: -1;
  background: center / cover no-repeat;
  filter: blur(70px) saturate(1.3) brightness(0.32);
  opacity: 0.9;
  pointer-events: none;
}
.player-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.mode-switch {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}
.mode-switch button { padding: 6px 16px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.mode-switch button.on { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.np-titles { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; }
.np-text { flex: 1; min-width: 0; }
.np-title {
  margin: 0;
  font-size: 34px; font-weight: 300; letter-spacing: -0.025em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-artist { margin: 4px 0 0; font-size: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.like svg { width: 26px; height: 26px; }
.like.on { color: var(--pink); }
.like.on svg { fill: var(--pink); }  /* inherited by the icon's shape */

.pane-player { display: flex; flex-direction: column; align-items: center; padding: 10px 0 6px; }
.disc {
  position: relative;
  width: min(78vw, 330px);
  aspect-ratio: 1;
  touch-action: none;
}
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.07); stroke-width: 10; }
.ring-progress {
  fill: none; stroke: url(#ring-gradient); stroke-width: 3.5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 150px 150px;
  filter: drop-shadow(0 0 6px rgba(134, 168, 255, 0.7));
}
.ring-knob { fill: #fff; stroke: none; filter: drop-shadow(0 0 6px rgba(134, 168, 255, 0.9)); }
.disc-face {
  position: absolute; inset: 9%;
  border-radius: 50%;
  padding: 7%;
  background: radial-gradient(circle at 30% 25%, #1c2140, #080a14 70%);
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.06), 0 30px 60px -20px rgba(0, 0, 0, 0.9);
}
.disc-face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #10142a; }
.ring-time {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(5, 6, 12, 0.75);
  font-size: 13px; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.np-line {
  margin-top: 22px;
  min-height: 2.8em;
  max-width: 100%;
  padding: 0 8px;
  font-size: 19px; font-weight: 400; line-height: 1.4;
  text-align: center;
  color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.np-line .next-line { display: block; color: var(--faint); font-size: 16px; }

.transport { display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 4px; }
.transport .round.big svg { width: 30px; height: 30px; }
.transport .toggle { color: var(--muted); position: relative; }
.transport .toggle.on { color: var(--accent); }
.repeat-one { position: absolute; top: 6px; right: 4px; font-size: 9px; font-weight: 700; display: none; }
.toggle.one .repeat-one { display: block; }
.play-btn {
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #0a0d1c;
  box-shadow: 0 10px 40px -8px rgba(134, 168, 255, 0.55);
}
.play-btn svg { width: 30px; height: 30px; }
.play-btn:active { transform: scale(0.95); }

.up-next { margin-top: 26px; }
.up-next h3 { margin: 0 0 8px; font-size: 22px; font-weight: 400; letter-spacing: -0.01em; }

/* Lyrics mode: lyrics fill the screen, the disc and queue step aside */
.player[data-mode="lyrics"] { overflow: hidden; }
.player[data-mode="lyrics"] .pane-player,
.player[data-mode="lyrics"] .up-next { display: none; }
.player[data-mode="player"] .pane-lyrics { display: none; }
.player[data-mode="lyrics"] .np-title { font-size: 26px; }
.pane-lyrics { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.status {
  margin: 4px 0 2px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 13px;
}
.status.busy { color: var(--text); }
.status.busy::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

.lyrics {
  flex: 1; min-height: 0;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px 2px 40vh;
  mask-image: linear-gradient(transparent, #000 8%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 85%, transparent);
}
.lyrics p { margin: 0; }
.lyrics .line { font-size: 27px; font-weight: 600; line-height: 1.28; letter-spacing: -0.015em; padding: 9px 0; }
.is-synced .line {
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: color 0.3s, transform 0.3s, text-shadow 0.3s;
  transform-origin: left center;
}
.is-synced .line.past { color: rgba(255, 255, 255, 0.18); }
.is-synced .line.active {
  color: #fff;
  transform: scale(1.03);
  text-shadow: 0 0 24px rgba(134, 168, 255, 0.45);
}
.lyrics .instrumental { font-size: 22px; }
.is-plain .line { font-size: 21px; font-weight: 500; padding: 3px 0; color: rgba(255, 255, 255, 0.85); }
.is-plain .gap { height: 18px; }
.is-message { display: flex; flex-direction: column; justify-content: center; text-align: center; padding-bottom: 10vh; }
.msg-title { font-size: 22px; font-weight: 300; }
.msg-detail { color: var(--muted); margin-top: 8px !important; }

.progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress span { width: 36px; }
.progress span:last-child { text-align: right; }
#np-seek { flex: 1; height: 24px; accent-color: var(--accent); }

/* ---------------------------------------------------------------- settings + login */


.login {
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  gap: 14px;
  padding: 24px;
}
.login-icon { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 20px 50px -15px rgba(61, 108, 255, 0.6); }
.login .display { font-size: 44px; }
.code-input {
  width: 100%; max-width: 300px;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  outline: none;
  text-align: center;
  font: 500 26px/1 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.code-input:focus { border-color: rgba(134, 168, 255, 0.6); }
.text-input {
  width: 100%; max-width: 300px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  outline: none;
  font-size: 17px;
}
.text-input.pin { letter-spacing: 0.3em; text-align: center; }
.text-input.pin:placeholder-shown { letter-spacing: normal; }
.text-input:focus { border-color: rgba(134, 168, 255, 0.6); }

/* ---------------------------------------------------------------- settings */

.profile { display: flex; align-items: center; gap: 16px; margin: 0 2px 8px; }
.profile-text { min-width: 0; }
.profile-name { margin: 0; font-size: 24px; font-weight: 300; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 64px; height: 64px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b7cff, #c58bff 60%, #ff8fb8);
  box-shadow: 0 12px 30px -10px rgba(91, 124, 255, 0.7);
  font-size: 26px; font-weight: 500; text-transform: uppercase;
}

.group-title { margin: 26px 6px 10px; font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.group {
  list-style: none; margin: 0 0 12px; padding: 0;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  overflow: hidden;
}
.group:empty { display: none; }

.setting {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 58px;
  padding: 10px 14px;
  text-align: left;
  font-size: 16px;
  cursor: pointer;
}
.setting + .setting, .storage + .setting { border-top: 1px solid var(--stroke); }
button.setting:active, label.setting:active { background: rgba(255, 255, 255, 0.04); }
.setting-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setting-text small { color: var(--muted); font-size: 13px; margin-top: 1px; }
.danger-text { color: var(--danger); }
.chev { width: 18px; height: 18px; color: var(--faint); flex: none; }
.setting-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #fff; }
.setting-icon svg { width: 18px; height: 18px; stroke-width: 1.9; }
.setting-icon.blue { background: linear-gradient(135deg, #5b8cff, #3d6cff); }
.setting-icon.purple { background: linear-gradient(135deg, #b48cff, #8a63ff); }
.setting-icon.red { background: linear-gradient(135deg, #ff8095, #f0506a); }
.setting-icon.amber { background: linear-gradient(135deg, #ffc46b, #ff9f43); }
.setting-icon.green { background: linear-gradient(135deg, #5fe3a1, #23b877); }
.setting-icon.grey { background: rgba(255, 255, 255, 0.12); }

/* iOS-style switch */
input.toggle {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none;
  width: 51px; height: 31px; margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.2s;
  cursor: pointer;
}
input.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}
input.toggle:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
input.toggle:checked::after { transform: translateX(20px); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}
.stat span { font-size: 28px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }

.top-songs li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.top-songs li + li { border-top: 1px solid var(--stroke); }
.top-rank { width: 16px; color: var(--muted); font-size: 14px; text-align: center; flex: none; }
.top-songs img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--glass); }
.top-text { flex: 1; min-width: 0; }
.top-text div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-text div + div { color: var(--muted); font-size: 13px; }
.plays-pill { padding: 3px 10px; border-radius: 999px; background: rgba(134, 168, 255, 0.14); color: var(--accent); font-size: 12px; font-weight: 600; flex: none; }

.storage { padding: 16px 14px 14px; }
.storage-head { display: flex; align-items: baseline; gap: 8px; }
.storage-used { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; }
.meter { display: flex; height: 8px; margin: 12px 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter-cache { background: linear-gradient(90deg, #5b8cff, var(--accent)); transition: width 0.4s; }
.meter-kept { background: linear-gradient(90deg, #b48cff, var(--accent-2)); transition: width 0.4s; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.legend span { white-space: nowrap; }
.legend b { color: var(--text); font-weight: 500; }
.key { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.key.cache { background: var(--accent); }
.key.kept { background: var(--accent-2); }

/* ---------------------------------------------------------------- overlays */

#toast {
  position: fixed; left: 16px; right: 16px; z-index: 40;
  bottom: calc(var(--safe-bottom) + 150px);
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(30, 35, 62, 0.96);
  border: 1px solid var(--stroke);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 15px;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show { opacity: 1; transform: none; pointer-events: auto; }
#toast span { flex: 1; }
.toast-action { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }

.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(2, 3, 8, 0.6); display: flex; align-items: flex-end; }
.overlay.center { align-items: center; justify-content: center; padding: 20px; }
.sheet-panel {
  width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 10px 12px calc(var(--safe-bottom) + 12px);
  border-radius: 26px 26px 0 0;
  background: rgba(18, 21, 40, 0.97);
  border-top: 1px solid var(--stroke);
  animation: sheet-up 0.22s ease-out;
}
.sheet-title { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 8px; }
.sheet-item {
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; padding: 13px 14px;
  border-radius: 14px; text-align: left; font-size: 17px;
}
.sheet-item small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sheet-item:active { background: var(--glass); }
.sheet-item.danger { color: var(--danger); }
.sheet-item.cancel { align-items: center; margin-top: 6px; background: var(--glass); font-weight: 500; }

.dialog {
  width: 100%; max-width: 360px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(18, 21, 40, 0.98);
  border: 1px solid var(--stroke);
  animation: sheet-up 0.2s ease-out;
}
.dialog-title { margin: 0 0 14px; font-size: 18px; text-align: center; }
.dialog-input {
  width: 100%; padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--stroke); background: var(--glass); outline: none; font-size: 17px;
}
.dialog-input:focus { border-color: rgba(134, 168, 255, 0.6); }
.dialog-buttons { display: flex; gap: 10px; margin-top: 16px; }
.dialog-buttons .pill { flex: 1; }
