/* ==============================
   Design Tokens - Theme de base
   ============================== */
:root {
  --page-bg: #414141;
  --shell-bg: linear-gradient(128deg, #f3ece5 0%, #efdcd5 48%, #f4eee8 100%);
  --surface: rgba(255, 255, 255, 0.7);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --text: #171717;
  --muted: #505050;
  --border: rgba(24, 24, 24, 0.16);
  --border-soft: rgba(24, 24, 24, 0.1);
  --shadow-soft: 0 10px 24px rgba(16, 16, 16, 0.1);
  --shadow-nav: 0 1px 0 rgba(255, 255, 255, 0.75), 0 7px 18px rgba(16, 16, 16, 0.08);
  --accent: #ff6a4c;
  --accent-soft: #ffd9cc;
  --pill-bg: rgba(255, 255, 255, 0.74);
  --radius-card: 20px;
  --radius-soft: 12px;
}

/* ==============================
   Design Tokens - Theme sombre
   Identite visuelle assombrie (corail/rose)
   ============================== */
:root[data-theme="dark"] {
  --page-bg: #111316;
  --shell-bg: radial-gradient(1180px 720px at 2% -18%, rgba(173, 77, 68, 0.24), transparent 58%),
    radial-gradient(1080px 680px at 100% 0%, rgba(176, 94, 112, 0.22), transparent 56%), #141922;
  --surface: rgba(29, 35, 45, 0.84);
  --surface-strong: rgba(25, 31, 40, 0.94);
  --text: #f4f6fa;
  --muted: #c4ccd8;
  --border: rgba(231, 206, 198, 0.22);
  --border-soft: rgba(231, 206, 198, 0.14);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.38);
  --shadow-nav: 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px rgba(0, 0, 0, 0.44);
  --accent: #dd7f66;
  --accent-soft: rgba(221, 127, 102, 0.24);
  --pill-bg: rgba(38, 45, 57, 0.88);
}

/* ==============================
   Reset & Base
   ============================== */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--page-bg);
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.56;
  overflow-x: hidden;
}

a {
  color: inherit;
}

/* ==============================
   Navigation - Topbar
   ============================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 220;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-strong);
  box-shadow: var(--shadow-nav);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  min-width: 210px;
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(165, 116, 74, 0.6);
  background: linear-gradient(135deg, #f6d5b6, #e6b786);
  position: relative;
}

.brand-logo::before,
.brand-logo::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.brand-logo::before {
  inset: 5px;
  border: 1px solid rgba(123, 85, 50, 0.72);
}

.brand-logo::after {
  width: 4px;
  height: 4px;
  right: 5px;
  top: 5px;
  background: rgba(123, 85, 50, 0.82);
}

.brand-text {
  display: grid;
  line-height: 1.04;
}

.brand-text strong {
  font-size: 0.96rem;
  font-weight: 700;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--muted);
}

.main-nav {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.64rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 46%, transparent);
}

.nav-link.is-active,
.nav-dropdown.is-active > .nav-trigger {
  border-color: var(--border-soft);
  background: color-mix(in srgb, var(--accent-soft) 58%, transparent);
}

.nav-trigger {
  appearance: none;
  font: inherit;
}

.nav-trigger::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.42rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 245px;
  max-width: min(80vw, 340px);
  display: none;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.nav-dropdown.is-open > .dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: block;
  padding: 0.45rem 0.58rem;
  border-radius: 7px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.86rem;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}

.dropdown-item.is-active {
  border-color: var(--border);
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 0.42rem;
  align-items: center;
}

.theme-toggle,
.listen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  background: var(--pill-bg);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.listen-btn {
  padding: 0.3rem 0.82rem;
}

.theme-toggle {
  width: 2.2rem;
  min-width: 2.2rem;
  padding: 0;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.listen-btn:hover,
.listen-btn:focus-visible {
  background: var(--surface-strong);
}

.theme-toggle-icon {
  position: relative;
  display: inline-block;
  width: 1rem;
  height: 1rem;
}

.theme-toggle[data-icon="moon"] .theme-toggle-icon {
  border-radius: 50%;
  box-shadow: inset -0.28rem 0 0 var(--text);
}

.theme-toggle[data-icon="moon"] .theme-toggle-icon::before {
  content: "";
  position: absolute;
  width: 0.16rem;
  height: 0.16rem;
  border-radius: 50%;
  background: var(--text);
  left: 0.09rem;
  top: 0.15rem;
}

.theme-toggle[data-icon="sun"] .theme-toggle-icon {
  border-radius: 50%;
  background: #ffd470;
  box-shadow: 0 0 0 2px rgba(255, 212, 112, 0.32);
}

.theme-toggle[data-icon="sun"] .theme-toggle-icon::before {
  content: "";
  position: absolute;
  inset: -0.22rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 212, 112, 0.45);
}

.mobile-nav-toggle {
  display: none;
  margin-left: auto;
  min-height: 2.05rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--pill-bg);
  color: var(--text);
  padding: 0.3rem 0.66rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==============================
   Shell Layout
   ============================== */
.app-shell {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  gap: 0.85rem;
  background: var(--shell-bg);
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  outline: none;
}

.view:focus,
.view:focus-visible {
  outline: none;
}

/* ==============================
   Surfaces & Components
   ============================== */
.card {
  border-radius: var(--radius-card);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.64rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
  font-size: 0.84rem;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 28%, transparent);
}

.home-hero {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 0.9rem;
}

.hero-main,
.now-card {
  padding: 1.08rem;
}

.hero-main h1,
.content-header h1,
.static-page h1,
.not-found h1 {
  margin: 0.84rem 0 0.5rem;
  font-family: "Changa", sans-serif;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.hero-main h1 {
  font-size: clamp(1.88rem, 3.8vw, 2.85rem);
}

.hero-main p,
.content-header p,
.static-page p,
.not-found p {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.search-bar {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.search-input {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 2.7rem;
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 48%, white);
  outline-offset: 2px;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.68rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(135deg, #ff6a4c, #ff9ec8);
  color: #171717;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-btn-ghost {
  background: var(--pill-bg);
  color: var(--text);
}

.search-meta {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 0.52rem 0.9rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6a4c, #ff9ec8);
  color: #121212;
}

.btn-ghost {
  background: var(--pill-bg);
}

.now-box {
  margin-top: 0.8rem;
  padding: 0.76rem;
  border-radius: var(--radius-soft);
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
}

.now-title {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: 1.16rem;
  line-height: 1.15;
}

.now-meta {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.home-panels {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1.22fr 0.78fr;
  gap: 0.9rem;
}

.home-panel {
  padding: 1rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.panel-head h2 {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: 1.34rem;
}

.panel-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.home-list,
.category-list {
  margin-top: 0.76rem;
  display: grid;
  gap: 0.6rem;
}

.home-row,
.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.62rem;
  padding: 0.68rem;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
}

.home-row-main,
.category-row-main {
  min-width: 0;
}

.home-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.38rem;
}

.home-row-title {
  margin: 0;
  font-size: 0.99rem;
  font-weight: 700;
  line-height: 1.24;
}

.home-row-meta,
.category-sub {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.category-label {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  border-radius: 999px;
  padding: 0.24rem 0.58rem;
  border: 1px solid var(--border-soft);
  background: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

.content-shell {
  display: grid;
  gap: 0.9rem;
}

.content-header,
.static-page,
.not-found,
.empty-state {
  padding: 1.1rem;
}

.chip-row {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 0.36rem 0.64rem;
  text-decoration: none;
  background: var(--pill-bg);
  font-size: 0.84rem;
  font-weight: 700;
}

.chip.is-active {
  border-color: var(--border);
  background: color-mix(in srgb, var(--accent-soft) 68%, transparent);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.item-card {
  overflow: hidden;
}

.item-cover {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: linear-gradient(135deg, #ffe9f1, #ffd8cf);
}

.item-body {
  padding: 0.9rem;
}

.item-meta {
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.item-title-link {
  text-decoration: none;
}

.item-title-link:hover .item-title,
.item-title-link:focus-visible .item-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.item-title {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: 1.1rem;
  line-height: 1.14;
}

.item-description {
  margin-top: 0.54rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.item-actions {
  margin-top: 0.62rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.item-detail {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  gap: 1rem;
  padding: 1rem;
}

.item-detail-media {
  min-width: 0;
}

.item-detail-cover {
  width: 100%;
  min-height: 270px;
  max-height: 430px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
}

.item-detail-content {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  min-width: 0;
}

.item-detail-content h1 {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2.35rem);
  line-height: 1.08;
}

.item-detail-description {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.58;
}

.detail-related {
  padding: 1rem;
}

.related-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.58rem;
}

.related-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.58rem;
  padding: 0.66rem;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
}

.related-row-main {
  min-width: 0;
}

.item-credits {
  margin-top: 0.74rem;
  font-size: 0.85rem;
}

.item-credits strong {
  font-weight: 700;
}

.credits-panel {
  margin-top: 0.18rem;
  padding: 0.82rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--pill-bg) 82%, transparent);
}

.credits-head h2 {
  margin: 0;
  font-family: "Changa", sans-serif;
  font-size: 0.98rem;
  line-height: 1.12;
}

.credits-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.credits-list {
  margin-top: 0.64rem;
  display: grid;
  gap: 0.46rem;
}

.credit-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.5rem 0.72rem;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
}

.credit-type,
.credit-text {
  margin: 0;
}

.credit-type {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.credit-text {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.platform-links {
  margin-top: 0.62rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.platform-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
  text-decoration: none;
  padding: 0.28rem 0.56rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.player-trigger {
  appearance: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.player-shell {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 260;
  padding: 0.35rem 1rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.player-surface {
  width: min(100%, 1720px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.76rem 0.95rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 96%, transparent);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.player-summary,
.player-timeline {
  min-width: 0;
}

.player-kicker,
.player-title,
.player-meta {
  margin: 0;
}

.player-kicker {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.player-title {
  margin-top: 0.14rem;
  font-family: "Changa", sans-serif;
  font-size: 0.98rem;
  line-height: 1.16;
}

.player-meta {
  margin-top: 0.14rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.player-btn,
.player-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.56rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--pill-bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.player-btn-primary {
  min-width: 5.25rem;
  background: linear-gradient(135deg, #ff6a4c, #ff9ec8);
  color: #171717;
}

.player-btn:disabled,
.player-close:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.player-timeline {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.player-progress {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.player-time {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

body.has-player {
  padding-bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
}

.footer {
  margin-top: auto;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
}

.footer p {
  margin: 0;
  color: var(--muted);
}

.footer p + p {
  margin-top: 0.3rem;
}

.footer-note {
  color: rgb(194, 194, 194);
}

/* ==============================
   Responsive Rules
   ============================== */
@media (max-width: 1100px) {
  .topbar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .app-shell {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .home-hero,
  .home-panels {
    grid-template-columns: 1fr;
  }

  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.has-player {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 900px) {
  .brand {
    min-width: 170px;
  }

  .brand-text span {
    display: none;
  }

  .item-detail {
    grid-template-columns: 1fr;
  }

  .item-detail-cover {
    max-height: 320px;
  }
}

@media (max-width: 740px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.44rem 0.55rem;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    order: 1;
  }

  .topbar-actions {
    order: 2;
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-actions .listen-btn {
    display: none;
  }

  .theme-toggle {
    min-height: 2rem;
    width: 2rem;
    min-width: 2rem;
  }

  .main-nav {
    width: 100%;
    display: none;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 0.34rem;
    padding-top: 0.35rem;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-link,
  .nav-trigger {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.9rem;
  }

  .nav-dropdown,
  .nav-dropdown .dropdown-menu {
    width: 100%;
  }

  .nav-dropdown .dropdown-menu {
    position: static;
    min-width: 0;
    max-width: 100%;
  }

  .app-shell {
    padding: 0.65rem 0.45rem 0.85rem;
  }

  .hero-main h1 {
    font-size: clamp(1.52rem, 6.8vw, 2.1rem);
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-shell {
    padding: 0.35rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }

  .player-surface {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 0.65rem;
  }

  .player-controls {
    justify-content: flex-start;
  }

  .player-close {
    justify-self: flex-start;
  }

  .home-row,
  .category-row,
  .related-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .home-row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .credit-row {
    grid-template-columns: 1fr;
  }

  .item-grid {
    grid-template-columns: 1fr;
  }

  body.has-player {
    padding-bottom: calc(11rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 560px) {
  .search-bar {
    flex-direction: column;
  }

  .search-input,
  .search-btn,
  .search-btn-ghost {
    width: 100%;
  }

  .player-timeline {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .player-time:last-child {
    justify-self: end;
  }

  body.has-player {
    padding-bottom: calc(12.35rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .topbar {
    padding-top: 0.36rem;
    padding-bottom: 0.36rem;
  }

  .hero-main,
  .now-card,
  .home-panel,
  .content-header,
  .static-page,
  .not-found,
  .empty-state {
    padding: 0.85rem;
  }

  .hero-main h1 {
    font-size: clamp(1.4rem, 3.6vw, 2rem);
  }

  .player-shell {
    padding-bottom: calc(0.25rem + env(safe-area-inset-bottom, 0px));
  }

  body.has-player {
    padding-bottom: calc(5.35rem + env(safe-area-inset-bottom, 0px));
  }
}
