/* Habit loop: My station, favourite stars, the push opt-in card, notification settings, the install and
   update banners, Now Playing additions, and the /offline page. Uses app.css tokens for light and dark. */

/* Favourite star */
.fav-button {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.fav-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fav-button:hover { background: var(--hover); }
.fav-button.is-on { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.fav-button.is-on svg { fill: currentColor; }
.fav-button.compact { width: 32px; height: 32px; padding: 0; justify-content: center; border-color: transparent; background: transparent; color: var(--text-2); }
.fav-button.compact:hover { background: var(--hover); color: var(--text); }
.fav-button.compact.is-on { background: transparent; color: #f5a524; }
.fav-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sh-row > .fav-button { margin-left: auto; }
.sh-row > .fav-button ~ * { margin-left: 0; }

/* My station */
.my-station { scroll-margin-top: 80px; }
.my-station .row-head { align-items: center; }
.ms-bell { flex: none; }
.ms-bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ms-bell.is-on { color: var(--accent); }
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface);
}
.ms-chip-link { display: inline-flex; align-items: center; gap: 8px; padding-right: 4px; color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; }
.ms-chip-link:hover { text-decoration: underline; }
.ms-chip-art { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex: none; }
.ms-block { margin-top: 6px; }
.ms-block + .ms-block { margin-top: 18px; }
.ms-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ms-block-title { margin: 0 0 10px; font: 600 16px/1.3 var(--font-display); color: var(--text); }
.ms-play-all { display: inline-flex; align-items: center; gap: 6px; height: 32px; }
.ms-play-all svg { width: 15px; height: 15px; fill: currentColor; }
.ms-empty { margin: 0 0 8px; color: var(--text-2); font-size: 14px; }
.ms-intro {
  padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: 18px; background: var(--surface);
}
.ms-intro-title { margin: 0; font: 650 18px/1.3 var(--font-display); }
.ms-intro-body { margin: 4px 0 12px; color: var(--text-2); font-size: 14px; max-width: 60ch; }
.ms-intro .ms-chips { margin: 0; }
.ms-stories {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 14px;
  overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.ms-story {
  display: flex; flex-direction: column; gap: 6px; padding: 0 0 12px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); overflow: hidden; cursor: pointer; scroll-snap-align: start;
}
.ms-story:hover { border-color: var(--line-strong); }
.ms-story-media { aspect-ratio: 16 / 9; background: var(--raised); }
.ms-story-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-story-title { margin: 6px 14px 0; font: 600 15px/1.35 var(--font-display); }
.ms-story-title a { color: var(--text); text-decoration: none; }
.ms-story-title a:hover { text-decoration: underline; }
.ms-story:not(:has(.ms-story-media)) .ms-story-title { margin-top: 14px; }
.ms-story-meta { margin: 0 14px; color: var(--text-2); font-size: 13px; }

/* Push opt-in card */
.push-card {
  margin-top: 16px; padding: 16px 18px; border-radius: 18px; background: var(--accent-soft); color: var(--text);
}
.push-card-title { margin: 0; font: 650 16px/1.3 var(--font-display); }
.push-card-body { margin: 4px 0 12px; color: var(--text-2); font-size: 14px; max-width: 64ch; }
.push-card-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Notification settings sheet */
.notify-sheet .sheet-body { gap: 12px; }
.ns-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ns-copy { display: flex; flex-direction: column; gap: 2px; }
.ns-label { font-weight: 500; }
.ns-sub, .ns-note { color: var(--text-2); font-size: 14px; margin: 0; }
.ns-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.ns-row select { max-width: 50%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.ns-email { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ns-email-title { flex-basis: 100%; margin: 0; font: 600 16px/1.3 var(--font-display); }
.ns-email .ns-note { flex-basis: 100%; }
.ns-email input[type="email"] { flex: 1 1 220px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }

/* Install and update banners */
.pwa-banner {
  position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px 12px 18px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  animation: pwa-rise 0.3s var(--ease);
}
body.has-player .pwa-banner { bottom: 112px; }
.pwa-banner-copy { min-width: 0; }
.pwa-banner-title { margin: 0; font-weight: 600; }
.pwa-banner-sub { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.pwa-banner-actions { display: flex; align-items: center; gap: 10px; flex: none; }
@keyframes pwa-rise { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (max-width: 760px) {
  .pwa-banner { bottom: calc(var(--tabbar-h, 64px) + 12px); flex-wrap: wrap; }
  body.has-player .pwa-banner { bottom: calc(var(--tabbar-h, 64px) + 96px); }
}

/* Now Playing additions */
.np-fav-slot { display: inline-flex; }
.np-offline svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.np-offline.is-on { color: var(--accent); }
.np-offline.is-busy { opacity: 0.5; }
.np-autoplay { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.np-autoplay input { width: 18px; height: 18px; accent-color: var(--accent); }

/* /offline */
.offline-page { max-width: 720px; margin: 0 auto; padding: 32px 20px 64px; }
.offline-page .page-kicker a { color: var(--accent); text-decoration: none; font-weight: 600; }
.offline-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.offline-play {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.offline-play:hover, .offline-play[aria-current="true"] { border-color: var(--accent); }
.offline-empty { color: var(--text-2); }
#offline-audio { width: 100%; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .pwa-banner { animation: none; }
}
