:root {
  --bg: #0b0d10;
  --bg-elev: #15191e;
  --bg-elev2: #1d232a;
  --fg: #e8eaed;
  --fg-dim: #9aa3ad;
  --accent: #ff7a45;
  --accent-dim: #b85630;
  --border: #2a3038;
  --radius: 12px;
  --radius-lg: 18px;
  --player-h: 168px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

img { max-width: 100%; }
button { font: inherit; color: inherit; touch-action: manipulation; }

.view {
  padding-bottom: calc(var(--player-h) + var(--safe-bottom) + 16px);
}
.view-profile { padding-bottom: 0; }
[hidden] { display: none !important; }

.hint {
  color: var(--fg-dim);
  text-align: center;
  padding: 24px 0;
}

/* ============================================================
   Profile picker
============================================================ */
.view-profile {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255,122,69,0.10), transparent 60%),
    var(--bg);
}

.picker {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.picker-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
  color: var(--fg-dim);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.profile-tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease, color 0.12s ease;
}
.profile-tile:hover {
  background: var(--bg-elev2);
  border-color: var(--accent);
  color: var(--accent);
}
.profile-tile:active { transform: scale(0.98); }
.profile-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================================
   Home
============================================================ */
.home-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.home-hello {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.home-hello:active { opacity: 0.6; }
.home-hi { color: var(--fg-dim); align-self: baseline; }
.home-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; align-self: baseline; }
.home-chevron { color: var(--fg-dim); margin-left: 2px; display: block; }

.ghost-btn {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--fg); border-color: var(--fg-dim); }

.row {
  padding: 16px;
  max-width: 1000px;
  margin: 0 auto;
}
.row-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin: 0 0 10px;
}

.card-list {
  display: grid;
  /* minmax(0, 1fr) lets long titles ellipsize instead of blowing out the row. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.now-card {
  display: flex;
  gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  align-items: center;
  min-width: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.now-card:hover { background: var(--bg-elev2); border-color: var(--accent-dim); }
.now-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--bg-elev2);
  object-fit: cover;
  flex: 0 0 64px;
}
.now-body { flex: 1; min-width: 0; }
.now-label {
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 2px;
}
.now-title {
  font-weight: 600;
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.now-title.is-scrolling {
  display: block;
  -webkit-line-clamp: unset;
  height: calc(1.3em * 2);
}
.now-title.is-scrolling .title-inner {
  display: block;
  animation: title-vscroll var(--scroll-dur, 14s) ease-in-out infinite;
}
.now-meta { color: var(--fg-dim); font-size: 13px; }
.now-progress {
  height: 3px;
  background: var(--bg-elev2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.now-progress > span { display: block; height: 100%; background: var(--accent); }

.row-expand-btn {
  background: transparent;
  color: var(--fg-dim);
  border: 0;
  padding: 8px 12px;
  font: 600 13px/1 inherit;
  cursor: pointer;
  text-align: center;
  margin-top: 2px;
}
.row-expand-btn:hover { color: var(--fg); }
.row-expand-btn:active { transform: scale(0.97); }

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.show-tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease;
  display: flex;
  flex-direction: column;
}
.show-tile:hover { border-color: var(--accent-dim); }
.show-tile:active { transform: scale(0.98); }
.show-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #2a1e16, #15191e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  object-fit: cover;
}
img.show-art { font-size: 0; }
.show-name {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================================
   Feed view
============================================================ */
.feed-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.feed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}
.back-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.back-btn svg { display: block; }
.sort-btn { flex: 0 0 auto; }
.feed-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 16px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font: 600 13px/1 inherit;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: 6px;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
}
.chip:active { transform: scale(0.96); }
.chip[aria-current="true"] {
  background: var(--accent);
  color: #15100c;
  border-color: var(--accent);
}

.episodes {
  padding: 12px 12px;
  max-width: 880px;
  margin: 0 auto;
}

.jump-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--player-h) + var(--safe-bottom) + 20px);
  z-index: 19;
  background: var(--accent);
  color: #15100c;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: 700 13px/1 inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.jump-btn:active { transform: scale(0.96); }

.ep {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin: 0 0 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  align-items: flex-start;
}
.ep:hover { background: var(--bg-elev2); }
.ep.playing { border-color: var(--accent); }

.ep-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--bg-elev2);
  flex: 0 0 56px;
  object-fit: cover;
}

.ep-body { flex: 1; min-width: 0; }

.ep-title {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* When 2 lines aren't enough, JS adds .is-scrolling to vertically scroll the
   text inside the same 2-line box (revealing the truncated portion). */
.ep-title.is-scrolling {
  display: block;
  -webkit-line-clamp: unset;
  height: calc(1.3em * 2);
}
.ep-title.is-scrolling .title-inner {
  display: block;
  animation: title-vscroll var(--scroll-dur, 14s) ease-in-out infinite;
}
@keyframes title-vscroll {
  0%, 12%   { transform: translateY(0); }
  48%, 62%  { transform: translateY(var(--scroll-end, 0)); }
  92%, 100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ep-title.is-scrolling .title-inner { animation: none; }
}

.ep-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--fg-dim);
  font-size: 13px;
}

.ep-played-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: var(--accent);
  padding: 4px 6px;
  margin: -4px -6px;
  font: 700 11px/1 inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 6px;
}
.ep-played-mark:active { background: rgba(255,122,69,0.10); }
.ep-played-mark svg { display: block; }
.ep-time-progress {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.ep-time-cur, .ep-time-dur, .ep-time-only {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ep-time-cur  { color: var(--accent); }
.ep-time-dur  { color: var(--fg); }
.ep-time-only { color: var(--fg-dim); }
.ep-time-sep  { color: var(--fg-dim); font-weight: 400; }

.ep-progress {
  height: 3px;
  background: var(--bg-elev2);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.ep-progress > span { display: block; height: 100%; background: var(--accent); }

.now-played-btn {
  flex: 0 0 auto;
  align-self: center;
  background: transparent;
  color: var(--fg-dim);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
}
.now-played-btn:hover { color: var(--accent); border-color: var(--accent); }
.now-played-btn:active { transform: scale(0.94); }
.now-played-btn svg { display: block; }

/* ============================================================
   Mini player (bottom bar)
============================================================ */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 10px 12px calc(20px + var(--safe-bottom));
  z-index: 20;
}

.player-tap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 4px;
  margin: 0 0 4px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
.player-tap:active { background: var(--bg-elev2); }

.mini-art {
  width: 40px; height: 40px;
  border-radius: 6px;
  background: var(--bg-elev2);
  object-fit: cover;
  flex: 0 0 40px;
}
.player-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.player-title { font-weight: 600; font-size: 14px; }
.player-feed { color: var(--fg-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Marquee (auto-scroll overflowing single-line titles)
============================================================ */
.marquee {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  min-width: 0;
  mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 14px), transparent 100%);
}
.marquee-inner {
  display: inline-block;
  padding-right: 2em;     /* breathing room at the end of the scroll */
  will-change: transform;
}
.marquee.is-overflow .marquee-inner {
  animation: marquee-scroll var(--marquee-dur, 14s) linear infinite;
}
@keyframes marquee-scroll {
  0%, 8%   { transform: translateX(0); }
  48%, 58% { transform: translateX(var(--marquee-end, 0)); }
  92%, 100%{ transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee.is-overflow .marquee-inner { animation: none; }
}
.player-expand {
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex: 0 0 auto;
}
.player-expand svg { display: block; }

/* Seek bar (shared)
   Layered: track (bg) → buffered (faint) → elapsed (accent) → thumb */
.seek-stack {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
}
.seek-stack::before {
  /* track */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  height: var(--track-h, 5px);
  background: var(--bg-elev2);
  border-radius: 999px;
  pointer-events: none;
}
.seek-buffer {
  /* buffered ahead */
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  height: var(--track-h, 5px);
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  width: 0;
  pointer-events: none;
  z-index: 1;
}
.seek-stack::after {
  /* elapsed (driven by --seek-pct on .seek) */
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  height: var(--track-h, 5px);
  background: var(--accent);
  border-radius: 999px;
  width: var(--seek-pct, 0%);
  pointer-events: none;
  z-index: 2;
}

.seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;          /* full stack height for big touch area */
  background: transparent;
  margin: 0;
  position: relative;
  z-index: 3;
}
.seek::-webkit-slider-runnable-track { height: 22px; background: transparent; border: 0; }
.seek::-moz-range-track { height: 22px; background: transparent; border: 0; }
.seek::-moz-range-progress { height: 0; background: transparent; }
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
  margin-top: 0;
  box-shadow:
    0 0 0 4px rgba(255, 122, 69, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}
.seek:active::-webkit-slider-thumb,
.seek:focus::-webkit-slider-thumb {
  box-shadow:
    0 0 0 9px rgba(255, 122, 69, 0.28),
    0 3px 8px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}
.seek::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  cursor: pointer;
  box-shadow:
    0 0 0 4px rgba(255, 122, 69, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s ease;
}
.seek:active::-moz-range-thumb,
.seek:focus::-moz-range-thumb {
  box-shadow:
    0 0 0 9px rgba(255, 122, 69, 0.28),
    0 3px 8px rgba(0, 0, 0, 0.5);
}
.seek:focus { outline: none; }

.seek-big { --track-h: 7px; }
.seek-big.seek::-webkit-slider-thumb { width: 18px; height: 18px; }
.seek-big.seek::-moz-range-thumb { width: 18px; height: 18px; }

.player-times {
  display: flex;
  justify-content: space-between;
  color: var(--fg-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}
.time-toggle {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 4px;
}
.time-toggle:active { background: rgba(255,255,255,0.06); }

.player-controls {
  /* 5 equal columns, all real buttons — play sits in the center column. */
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  gap: 4px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.ctl {
  background: var(--bg-elev2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 44px;
  min-width: 56px;
  padding: 0 12px;
  font: 600 14px/1 inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ctl:active { transform: scale(0.97); }
.ctl-skip {
  padding: 0;
  background: transparent;
  border-color: transparent;
}
.ctl-skip svg { display: block; }
.ctl-primary {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  height: 60px;
  min-width: 60px;
  padding: 0;
}
.ctl-primary .play-icon { width: 48px; height: 48px; display: block; }
.ctl-play .play-icon { width: 60px; height: 60px; display: block; }
.ctl-speed {
  min-width: 48px;
  background: transparent;
  border-color: transparent;
  color: var(--fg-dim);
}

.player-controls { flex-wrap: nowrap; }

@media (min-width: 600px) {
  .player { padding: 12px 20px calc(12px + var(--safe-bottom)); }
  .player-controls { gap: 18px; }
}

/* Very narrow phones (~iPhone SE width). Tighten mini player + NP controls. */
@media (max-width: 360px) {
  .player-controls { gap: 8px; }
  .ctl { min-width: 48px; padding: 0 8px; }
  .ctl-primary { min-width: 56px; }
  .ctl-speed { min-width: 44px; }
  .np-controls { gap: 4px; }
  .ctl-circle { width: 46px; height: 46px; min-width: 46px; }
  .ctl-play { width: 58px; height: 58px; min-width: 58px; font-size: 20px; }
  .np-side { min-width: 40px; padding: 0 6px; font-size: 12px; }
}

/* Landscape on a phone — make the artwork small so controls always fit. */
@media (orientation: landscape) and (max-height: 520px) {
  .np-art { width: auto; height: 100%; max-height: 38vh; }
  .np-art-wrap { padding: 4px 0 8px; }
  .np-title { font-size: 18px; }
  .np-meta { padding-bottom: 8px; }
  .np-controls { padding-top: 8px; }
}

/* ============================================================
   Now Playing (full-screen)
============================================================ */
.np {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: linear-gradient(180deg, #1d130c 0%, #0b0d10 55%);
  display: flex;
  flex-direction: column;
  padding: 12px 16px calc(32px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0, 0.2, 1);
  visibility: hidden;
  overflow: hidden;
  height: 100dvh;
}
.np.open {
  transform: translateY(0);
  visibility: visible;
}

.np-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 8px;
}
.np-icon-btn {
  background: transparent;
  border: 0;
  color: var(--fg);
  font: 600 18px/1 inherit;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 36px;
}
.np-icon-btn:active { background: rgba(255,255,255,0.06); }
.np-icon-btn.active,
.ctl-skip.active {
  color: var(--accent);
}
.np-bar-mid {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-art-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 14px;
  flex: 1 1 auto;
  min-height: 0;
  touch-action: none;       /* gesture handlers manage all touch in this zone */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.np-art {
  width: min(70vw, 360px);
  max-height: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);
  background: var(--bg-elev2);
}

.np-meta { padding: 0 4px 14px; text-align: left; }
.np-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.np-title.is-scrolling {
  display: block;
  -webkit-line-clamp: unset;
  height: calc(1.25em * 2);
}
.np-title.is-scrolling .title-inner {
  display: block;
  animation: title-vscroll var(--scroll-dur, 14s) ease-in-out infinite;
}
.np-feed { color: var(--fg-dim); margin: 0; font-size: 14px; }

.np-seek-wrap { padding: 6px 4px 8px; }
.np-times {
  display: flex;
  justify-content: space-between;
  color: var(--fg-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.np-controls {
  /* Grid keeps the play button mathematically centered no matter how wide
     the side buttons are (e.g., "0.25×"). */
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 18px 0 12px;
}
.np-controls > * { justify-self: center; }
.np-icon-btn svg, .np-icon-ctl svg { display: block; }
.np-icon-ctl { padding: 0; }
.ctl-circle {
  height: 52px;
  width: 52px;
  min-width: 52px;
  padding: 0;
  border-radius: 50%;
  font-size: 12px;
}
.ctl-play {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  height: 72px;
  width: 72px;
  min-width: 72px;
  padding: 0;
}
.np-side {
  min-width: 56px;
  height: 44px;
  padding: 0 10px;
  background: transparent;
  border-color: transparent;
  color: var(--fg-dim);
  font-size: 17px;
  font-weight: 700;
  flex: 0 0 auto;
}
.np-side[aria-pressed="true"] {
  color: var(--accent);
  background: rgba(255,122,69,0.10);
  border-color: rgba(255,122,69,0.25);
}

.np-sleep-status {
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  margin: 14px 0 0;
  font-variant-numeric: tabular-nums;
}

/* Double-tap skip indicators — chevron + small cumulative amount */
.np-skip-ripple {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38%;
  height: 75%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 0.18s ease;
  color: var(--accent);
  z-index: 3;
}
.np-skip-ripple svg { display: block; }
.np-skip-amount {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.np-skip-ripple.left { left: 2%; }
.np-skip-ripple.right { right: 2%; }
.np-skip-ripple.show { opacity: 1; }

/* Brightness overlay (browsers can't access device brightness — this dims the
   page as a visual simulation). */
.np-brightness-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

/* Gesture indicator (volume / brightness) */
.np-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 22px 16px;
  border-radius: 14px;
  z-index: 8;
  pointer-events: none;
  text-align: center;
  min-width: 180px;
  backdrop-filter: blur(6px);
}
.np-indicator-label {
  color: var(--fg-dim);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.np-indicator-value {
  color: var(--fg);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.np-indicator-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
}
.np-indicator-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.04s linear;
}

/* Sheet description */
.sheet-desc {
  color: var(--fg-dim);
  font-size: 13px;
  text-align: center;
  margin: -4px 0 12px;
  line-height: 1.4;
}

/* ============================================================
   Bottom sheets
============================================================ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sheet-backdrop.open { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 51;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0, 0.2, 1);
  padding: 0 12px calc(12px + var(--safe-bottom));
  visibility: hidden;
}
.sheet.open { transform: translateY(0); visibility: visible; }

.sheet-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px 16px 8px 8px;
  padding: 14px 14px 8px;
  max-width: 520px;
  margin: 0 auto;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}
.sheet-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.sheet-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-option {
  background: var(--bg-elev2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font: 600 15px/1 inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sheet-option:active { transform: scale(0.99); }
.sheet-option[aria-current="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.sheet-option-meta { color: var(--fg-dim); font-weight: 500; font-size: 13px; }

/* Speed picker — full grid of all options (long-press to open) */
.speed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  padding: 4px 0;
}
.speed-pill {
  padding: 14px 8px;
  background: var(--bg-elev2);
  color: var(--fg);
  border: 0;
  border-radius: 12px;
  font: 700 15px/1 inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}
.speed-pill:active { transform: scale(0.96); }
.speed-pill.is-current {
  background: var(--accent);
  color: #15100c;
}

/* Sleep pill grid (cleaner than a vertical list) */
.sleep-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 0;
}
.sleep-pill {
  padding: 16px 10px;
  background: var(--bg-elev2);
  color: var(--fg);
  border: 0;
  border-radius: 12px;
  font: 600 14px/1.2 inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}
.sleep-pill:active { transform: scale(0.97); }
.sleep-pill.is-current {
  background: var(--accent);
  color: #15100c;
}
