/* Spotify now-playing surface, pinned to the menu bar. */
#notch-root .tb-notch,
#notch-root .tb-notch * { box-sizing: border-box; margin: 0; }
#notch-root .tb-notch {
  --sp-surface: #181a19;
  --sp-raised: #292c2a;
  --sp-text: #f8faf9;
  --sp-secondary: #b7beb9;
  --sp-green: #1ed760;
  --sp-line: #3c413e;
  position: relative;
  width: 256px;
  height: var(--tb-menubar-h, 28px);
  color: var(--sp-text);
  font: 13px/1.5 var(--tb-font, -apple-system, BlinkMacSystemFont, sans-serif);
  text-shadow: none;
}
#notch-root .tb-notch [hidden] { display: none !important; }
#notch-root .tb-notch button,
#notch-root .tb-notch input { font: inherit; }
#notch-root .tb-notch button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
#notch-root .tb-notch button:disabled { cursor: default; opacity: .36; }
#notch-root .tb-notch button:focus-visible,
#notch-root .tb-notch input:focus-visible { outline: 2px solid var(--sp-green); outline-offset: 3px; }
#notch-root .tb-notch ::selection { background: var(--sp-green); color: #07120b; }
#notch-root .tb-notch svg { display: block; width: 22px; height: 22px; flex: 0 0 auto; }

/* A real disclosure button keeps the menu-bar player keyboard accessible. */
#notch-root .tb-notch-collapsed {
  display: flex;
  width: 100%; height: 100%; align-items: center; gap: 7px;
  padding: 0 8px; border: 0; border-radius: 6px;
  color: #fff; background: transparent;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  transition: background 150ms ease;
}
#notch-root .tb-notch-collapsed:hover,
#notch-root .tb-notch-collapsed[aria-expanded="true"] { background: rgba(13, 18, 15, .55); }
#notch-root .tb-collapsed-art {
  display: grid; place-items: center; flex: 0 0 auto;
  width: calc(var(--tb-menubar-h, 28px) - 8px); height: calc(var(--tb-menubar-h, 28px) - 8px);
  overflow: hidden; border-radius: 4px;
}
#notch-root .tb-collapsed-art img { width: 100%; height: 100%; object-fit: cover; }
#notch-root .tb-collapsed-art svg { width: 16px; height: 16px; }
#notch-root .tb-collapsed-copy { display: flex; align-items: baseline; gap: 4px; flex: 1; min-width: 0; text-align: left; }
#notch-root .tb-collapsed-title,
#notch-root .tb-collapsed-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 16px; }
#notch-root .tb-collapsed-title { flex: 0 1 auto; max-width: 60%; }
#notch-root .tb-collapsed-artist { flex: 1 1 0; color: #e0e6e1; }
#notch-root .tb-collapsed-artist::before { content: '·'; margin-right: 4px; }
#notch-root .tb-notch-eq { display: flex; align-items: center; gap: 2px; height: 13px; }
#notch-root .tb-notch-eq span { width: 2px; height: 3px; border-radius: 2px; background: #e0e6e1; animation: none; transform: none; }
#notch-root .is-playing .tb-notch-eq span { height: 11px; animation: spotify-level 1s ease-in-out infinite alternate; }
#notch-root .is-playing .tb-notch-eq span:nth-child(2) { animation-delay: -.6s; }
#notch-root .is-playing .tb-notch-eq span:nth-child(3) { animation-delay: -.3s; }
#notch-root .is-playing .tb-notch-eq span:nth-child(4) { animation-delay: -.8s; }
#notch-root .is-playing .tb-notch-eq span:nth-child(5) { animation-delay: -.1s; }
@keyframes spotify-level { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* One music-only surface, with an optional mini layout using the same controls. */
#notch-root .tb-spotify-panel {
  position: absolute; top: calc(100% + 12px); left: 50%;
  width: min(704px, calc(100vw - 32px));
  transform: translateX(-50%);
}
#notch-root .centered .tb-spotify-panel {
  top: calc(50dvh + var(--tb-menubar-h, 28px) / 2);
  transform: translate(-50%, -50%);
}
#notch-root .tb-spotify-surface {
  max-height: calc(100dvh - var(--tb-menubar-h, 28px) - 150px);
  overflow: auto; overscroll-behavior: contain;
  border-radius: 24px; background: var(--sp-surface);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
  scrollbar-width: thin; scrollbar-color: #58645c var(--sp-surface);
}
#notch-root .centered .tb-spotify-surface {
  max-height: calc(100dvh - var(--tb-menubar-h, 28px) - 228px);
}
#notch-root .tb-compact-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: max-content; max-width: 100%; min-height: 40px;
  margin: 12px auto 0; padding: 8px 16px; border: 0; border-radius: 999px;
  background: var(--sp-surface); color: var(--sp-text);
  box-shadow: 0 5px 18px rgba(0, 0, 0, .3);
  font-size: 12px; font-weight: 600;
  transition: background 140ms ease, color 140ms ease;
}
#notch-root .tb-compact-toggle svg { width: 16px; height: 16px; }
#notch-root .tb-compact-toggle:hover { background: var(--sp-raised); color: var(--sp-green); }
#notch-root .tb-spotify-header { display: flex; align-items: center; gap: 12px; padding: 15px 20px 12px 24px; }
#notch-root .tb-spotify-brand { display: flex; align-items: center; gap: 8px; }
#notch-root .tb-spotify-brand img { display: block; width: 25px; height: 25px; border-radius: 50%; }
#notch-root .tb-spotify-brand strong { font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
#notch-root .tb-spotify-playing-status { font-size: 12px; color: var(--sp-secondary); }
#notch-root .is-playing .tb-spotify-playing-status { color: var(--sp-green); }
#notch-root .tb-spotify-view-controls { margin-left: auto; display: flex; gap: 2px; }
#notch-root .tb-spotify-icon {
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  background: transparent; color: var(--sp-secondary);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
#notch-root .tb-spotify-icon:hover:not(:disabled) { color: var(--sp-text); background: var(--sp-raised); }
#notch-root .tb-spotify-icon:active:not(:disabled) { transform: scale(.94); }
#notch-root .tb-spotify-view-controls svg { width: 18px; height: 18px; }
#notch-root .tb-spotify-main { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 28px; padding: 4px 28px 28px; }
#notch-root .tb-track-art {
  width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px;
  display: grid; place-items: center; color: var(--sp-secondary); background: var(--sp-raised);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
#notch-root .tb-track-art > svg { width: 64px; height: 64px; opacity: .6; }
#notch-root .tb-track-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
#notch-root .tb-spotify-details { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
#notch-root .tb-track-copy { min-width: 0; }
#notch-root .tb-track-title {
  font-size: 31px; font-weight: 730; line-height: 1.13; letter-spacing: -.035em;
  text-wrap: balance; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#notch-root .tb-track-artist { margin-top: 8px; font-size: 16px; line-height: 1.4; color: #e1e7e3; }
#notch-root .tb-track-album { margin-top: 3px; color: var(--sp-secondary); font-size: 12px; }
#notch-root .tb-track-artist,
#notch-root .tb-track-album { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#notch-root .tb-track-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 21px; }
#notch-root .tb-track-controls .tb-spotify-icon { color: #e2e8e4; }
#notch-root .tb-track-controls [aria-pressed="true"] { color: var(--sp-green); position: relative; }
#notch-root .tb-track-controls [aria-pressed="true"]::after { content: ''; position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
#notch-root .tb-track-controls .tb-track-play { background: var(--sp-green); color: #092011; width: 54px; height: 54px; }
#notch-root .tb-track-controls .tb-track-play:hover:not(:disabled) { color: #071b0d; background: #3ee57a; transform: scale(1.04); }
#notch-root .tb-track-play svg { width: 28px; height: 28px; }
#notch-root .tb-track-timeline { margin-top: 12px; }
#notch-root .tb-spotify-range {
  --tb-progress: 0%;
  display: block; appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 20px;
  border: 0; padding: 0; background: transparent; cursor: pointer; accent-color: var(--sp-green);
}
#notch-root .tb-spotify-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, #e8ece9 var(--tb-progress), var(--sp-line) var(--tb-progress)); }
#notch-root .tb-spotify-range::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, #e8ece9 var(--tb-progress), var(--sp-line) var(--tb-progress)); }
#notch-root .tb-spotify-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; margin-top: -3px; border-radius: 50%; background: #fff; }
#notch-root .tb-spotify-range::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: #fff; }
#notch-root .tb-spotify-range:hover::-webkit-slider-runnable-track,
#notch-root .tb-spotify-range:focus-visible::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--sp-green) var(--tb-progress), var(--sp-line) var(--tb-progress)); }
#notch-root .tb-spotify-range:hover::-moz-range-track,
#notch-root .tb-spotify-range:focus-visible::-moz-range-track { background: linear-gradient(to right, var(--sp-green) var(--tb-progress), var(--sp-line) var(--tb-progress)); }
#notch-root .tb-spotify-range:disabled { opacity: .35; cursor: default; }
#notch-root .tb-track-times { display: flex; justify-content: space-between; color: var(--sp-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
#notch-root .tb-spotify-footer { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: #121513; }
#notch-root .tb-spotify-device { display: flex; gap: 8px; align-items: center; color: var(--sp-secondary); font-size: 11px; white-space: nowrap; }
#notch-root .tb-spotify-device svg { width: 16px; height: 16px; }
#notch-root .is-playing .tb-spotify-device { color: var(--sp-green); }
#notch-root .tb-spotify-volume { display: flex; align-items: center; gap: 6px; margin-left: auto; width: 172px; }
#notch-root .tb-spotify-mute { width: 32px; height: 36px; }
#notch-root .tb-spotify-mute svg { width: 18px; height: 18px; }
#notch-root .tb-volume-value { width: 32px; flex-shrink: 0; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--sp-secondary); text-align: right; }
#notch-root .tb-spotify-open { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 0 0 6px; border: 0; background: transparent; color: var(--sp-secondary); font-size: 11px; white-space: nowrap; }
#notch-root .tb-spotify-open svg { width: 13px; height: 13px; }
#notch-root .tb-spotify-open:hover:not(:disabled) { color: var(--sp-text); text-decoration: underline; text-underline-offset: 3px; }
#notch-root .tb-spotify-connect { display: flex; align-items: center; gap: 16px; padding: 0 28px 22px; }
#notch-root .tb-spotify-message { color: var(--sp-secondary); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#notch-root .tb-spotify-retry { padding: 8px 14px; border: 0; border-radius: 20px; background: var(--sp-green); color: #071b0d; font-weight: 650; font-size: 12px; flex-shrink: 0; }
#notch-root .tb-spotify-retry:hover:not(:disabled) { background: #3ee57a; }
#notch-root .needs-connection .tb-track-title { font-size: 25px; }

#notch-root .compact .tb-spotify-panel { width: min(380px, calc(100vw - 24px)); }
#notch-root .compact .tb-spotify-header { padding: 12px 14px 6px 20px; }
#notch-root .compact .tb-spotify-main { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 8px 22px 20px; }
#notch-root .compact .tb-spotify-details { display: contents; }
#notch-root .compact .tb-track-copy { align-self: center; }
#notch-root .compact .tb-track-title { font-size: 20px; }
#notch-root .compact .tb-track-artist { margin-top: 4px; font-size: 13px; }
#notch-root .compact .tb-track-album { font-size: 11px; }
#notch-root .compact .tb-track-controls { grid-column: 1 / -1; margin-top: 0; padding: 0; }
#notch-root .compact .tb-track-timeline { grid-column: 1 / -1; margin-top: -8px; }
#notch-root .compact .tb-spotify-footer { flex-wrap: wrap; column-gap: 12px; row-gap: 2px; padding: 10px 22px; }
#notch-root .compact .tb-spotify-volume { width: 152px; }
#notch-root .compact .tb-spotify-open { margin-left: auto; padding: 0; }

@media (max-width: 600px) {
  #notch-root .tb-notch { width: min(256px, 45vw); }
  #notch-root .tb-collapsed-artist { display: none; }
  #notch-root .tb-collapsed-title { max-width: none; flex: 1; }
  #notch-root .tb-spotify-panel { width: min(400px, calc(100vw - 24px)); }
  #notch-root .tb-spotify-surface { border-radius: 22px; }
  #notch-root .tb-spotify-header { padding: 12px 14px 10px 22px; }
  #notch-root .tb-spotify-main { display: flex; flex-direction: column; gap: 22px; padding: 4px 24px 24px; }
  #notch-root .tb-track-art { width: min(100%, 252px); align-self: center; }
  #notch-root .tb-track-title { font-size: 28px; }
  #notch-root .tb-track-controls { margin-top: 16px; }
  #notch-root .tb-spotify-footer { flex-wrap: wrap; column-gap: 12px; row-gap: 2px; padding: 10px 22px; }
  #notch-root .tb-spotify-volume { width: 145px; }
  #notch-root .tb-spotify-device { font-size: 10px; }
  #notch-root .tb-spotify-open { margin-left: auto; padding: 0; }
  #notch-root .tb-spotify-connect { flex-direction: column; align-items: flex-start; padding: 0 26px 20px; gap: 10px; }
  #notch-root .compact .tb-spotify-main { display: grid; gap: 14px; }
  #notch-root .compact .tb-track-art { width: 72px; }
  #notch-root .compact .tb-track-title { font-size: 19px; }
  #notch-root .compact .tb-spotify-playing-status { display: none; }
}
@media (max-width: 370px) {
  #notch-root .tb-spotify-playing-status { display: none; }
  #notch-root .tb-spotify-volume { width: 124px; }
  #notch-root .compact .tb-spotify-volume { width: 124px; }
}
@media (max-height: 760px) and (max-width: 600px) {
  #notch-root .tb-track-art { width: min(100%, 200px); }
}
@media (max-height: 660px) and (max-width: 600px) {
  #notch-root .tb-track-art { width: 144px; }
  #notch-root .tb-spotify-main { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #notch-root .tb-notch *, #notch-root .tb-notch *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  #notch-root .tb-spotify-panel { outline: 1px solid CanvasText; }
  #notch-root .tb-track-controls .tb-track-play { outline: 1px solid ButtonText; }
}

/* Public playlist uses Spotify's own playback controls on every device. */
#notch-root .tb-public-music .tb-spotify-panel { width: min(600px, calc(100vw - 24px)); }
#notch-root .tb-public-music .tb-spotify-surface { max-height: calc(100dvh - 64px); border-radius: 20px; }
#notch-root .tb-public-embed { padding: 0 12px; }
#notch-root .tb-public-embed iframe { display: block; width: 100%; height: min(452px, calc(100dvh - 190px)); min-height: 152px; border: 0; border-radius: 12px; }
#notch-root .tb-public-link { display: block; padding: 14px 24px 18px; color: #b7beb9; text-align: right; font-size: 12px; }

/* Mini and full share one live Spotify embed, preserving the listening session. */
#notch-root .tb-public-music.compact .tb-spotify-panel { width: min(380px, calc(100vw - 24px)); }
#notch-root .tb-public-music.compact .tb-public-embed iframe { height: 152px; }
#notch-root .tb-public-music .tb-public-status { color: var(--sp-secondary); font-size: 12px; margin-left: 12px; }
#notch-root .tb-public-music .tb-spotify-close { margin-left: auto; }
#notch-root .tb-public-music .tb-spotify-surface { max-height: calc(100dvh - 140px); }
#notch-root .tb-public-music .tb-notch-eq span { height: 11px; transform: scaleY(.25); animation: none; }
#notch-root .tb-public-music.is-playing .tb-notch-eq span { background: var(--sp-green); }
#notch-root .tb-public-music .tb-compact-toggle:hover { background: #303731; }
#notch-root .tb-public-music .tb-public-link:hover { color: #fff; }
#notch-root .tb-public-music .tb-public-embed { min-height: 152px; }

/* Calm: one listening surface that opens from the menu bar. */
#notch-root .tb-public-music .tb-spotify-panel { width: min(620px, calc(100vw - 24px)); }
#notch-root .tb-public-music .tb-spotify-surface { background: #141815; border-radius: 26px; overflow: hidden; max-height: calc(100dvh - 110px); box-shadow: 0 24px 80px #0006; }
#notch-root .tb-public-music .tb-spotify-header { display: flex; align-items: center; gap: 12px; padding: 20px 22px 18px; }
#notch-root .tb-public-music .tb-public-status { margin: 0; font-size: 11px; color: #b7c8bb; }
#notch-root .tb-public-music .tb-spotify-brand strong { font-size: 18px; letter-spacing: -.03em; }
#notch-root .tb-public-music .tb-spotify-close { width: 36px; height: 36px; margin-left: auto; }
#notch-root .tb-public-music .tb-player-stage { position: relative; min-height: 152px; }
#notch-root .tb-public-music .tb-public-embed { padding: 0 12px; }
#notch-root .tb-public-music .tb-public-embed iframe { height: min(452px, calc(100dvh - 280px)); min-height: 152px; background: #141815; }
#notch-root .tb-public-music .tb-player-loading { position: absolute; z-index: 1; inset: 0 12px; display: flex; align-items: center; justify-content: center; gap: 22px; padding: 26px; border-radius: 14px; background: #1c241e; }
#notch-root .tb-public-music .tb-loading-art { display: grid; justify-items: center; gap: 18px; flex: 0 0 60px; }
#notch-root .tb-public-music .tb-loading-art img { width: 54px; height: 54px; border-radius: 12px; }
#notch-root .tb-public-music .tb-loading-copy { max-width: 235px; }
#notch-root .tb-public-music .tb-loading-copy h2 { font-size: 30px; line-height: 1.1; letter-spacing: -.035em; font-weight: 650; }
#notch-root .tb-public-music .tb-loading-message { color: #b7c8bb; font-size: 12px; line-height: 1.5; margin-top: 8px; }
#notch-root .tb-public-music .tb-loading-pulse { display: flex; gap: 4px; height: 16px; align-items: center; }
#notch-root .tb-public-music .tb-loading-pulse span { width: 3px; height: 16px; background: #a5d7b5; border-radius: 2px; transform: scaleY(.16); }
#notch-root .tb-public-music .tb-player-retry { margin-top: 14px; padding: 8px 16px; border: 0; border-radius: 99px; background: #1ed760; color: #062610; font-size: 12px; font-weight: 650; min-height: 36px; }
#notch-root .tb-public-music .tb-player-retry:hover { background: #61e991; }
#notch-root .tb-public-music .tb-player-footer { padding: 16px 24px 20px; }
#notch-root .tb-public-music .tb-player-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; margin-bottom: 10px; }
#notch-root .tb-public-music .tb-player-wave span { width: 3px; height: 28px; background: #597660; border-radius: 4px; transform: scaleY(.16); transition: background 250ms ease; }
#notch-root .tb-public-music.is-playing .tb-player-wave span { background: #1ed760; }
#notch-root .tb-public-music .tb-player-footer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#notch-root .tb-public-music .tb-listening-label { font-size: 11px; color: #b7c8bb; }
#notch-root .tb-public-music .tb-public-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; font-size: 11px; color: #d1ded4; text-decoration: none; }
#notch-root .tb-public-music .tb-public-link svg { width: 14px; height: 14px; }
#notch-root .tb-public-music .tb-public-link:hover { text-decoration: underline; text-underline-offset: 4px; }
#notch-root .tb-public-music .tb-compact-toggle { min-height: 44px; padding: 10px 19px; background: #141815; font-size: 12px; box-shadow: 0 8px 22px #0003; }
#notch-root .tb-public-music .tb-compact-toggle svg { width: 16px; height: 16px; }
#notch-root .tb-public-music.compact .tb-spotify-header { padding: 16px 18px 12px; gap: 10px; }
#notch-root .tb-public-music.compact .tb-public-embed iframe { height: 152px; }
#notch-root .tb-public-music.compact .tb-loading-copy h2 { font-size: 26px; }
#notch-root .tb-public-music.compact .tb-player-loading { padding: 18px; gap: 18px; }
#notch-root .tb-public-music.compact .tb-player-footer { padding: 12px 22px 18px; }
#notch-root .tb-public-music.compact .tb-player-wave { height: 26px; margin-bottom: 8px; }
@media (max-width: 420px) {
  #notch-root .tb-public-music .tb-public-status { font-size: 10px; }
  #notch-root .tb-public-music .tb-player-footer { padding: 12px 20px 18px; }
  #notch-root .tb-public-music .tb-player-wave { gap: 3px; }
}
@media (max-height: 480px) {
  #notch-root .tb-public-music .tb-spotify-surface { overflow-y: auto; }
  #notch-root .tb-public-music .tb-player-wave { display: none; }
}

/* A measured spectrum only; no decorative playback loops. */
#notch-root .tb-public-music .tb-spectrum-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
#notch-root .tb-public-music .tb-spectrum-toggle { border: 1px solid #506357; border-radius: 999px; padding: 8px 12px; color: #c9f7d8; background: #203427; font: inherit; font-size: 11px; cursor: pointer; }
#notch-root .tb-public-music .tb-spectrum-toggle:disabled { opacity: .55; cursor: default; }
#notch-root .tb-public-music .tb-spectrum-status { flex: 1 1 180px; font-size: 10px; line-height: 1.5; color: #b7c8bb; }
