/* Audio archive pages. Everything is scoped under .ap so it cannot touch the home page. */
.ap { padding-bottom: 7.5rem; }
.ap .ahead { padding-block: 1.4rem 1.6rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; justify-content: space-between; }
.ap .ahead h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.ap .ahead p { color: var(--moon-dim); margin-top: 0.7rem; max-width: 36rem; }
.ap .abtn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; background: var(--lamp); color: var(--night); border: 0; text-decoration: none; padding: 0.7rem 1.2rem; border-radius: 8px; cursor: pointer; min-height: 2.75rem; transition: background .2s; }
.ap .abtn:hover { background: #ffc875; }
.ap .abtn.ghost { background: transparent; color: var(--moon); border: 1px solid var(--line); }
.ap .abtn.ghost:hover { border-color: var(--lamp); background: transparent; }

/* overview */
.ap .sec { font-size: 1.6rem; margin: 2.4rem 0 1rem; }
.ap .ygrid, .ap .clist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.ap .ygrid { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.ap .clist { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.ap .ygrid a, .ap .clist a { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .2s, background .2s; min-height: 3.5rem; }
.ap .ygrid a:hover, .ap .clist a:hover { border-color: var(--lamp); background: var(--night-2); }
.ap .ygrid b { font-family: var(--f-display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ap .clist b { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; }
.ap .ygrid span, .ap .clist span { color: var(--moon-dim); font-size: 0.85rem; }

/* list pages */
.ap .yrail { display: flex; gap: 0.5rem; overflow-x: auto; padding-block: 0.3rem 0.8rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; border-bottom: 1px solid var(--line); }
.ap .yrail a { flex: none; font-size: 0.95rem; font-variant-numeric: tabular-nums; color: var(--moon-dim); border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.8rem; text-decoration: none; transition: all .2s; }
.ap .yrail a:hover { color: var(--moon); border-color: var(--moon-dim); }
.ap .yrail a[aria-current] { background: var(--lamp); border-color: var(--lamp); color: var(--night); font-weight: 600; }
.ap .tools { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; padding-block: 1.4rem; }
.ap .tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ap .tabs button { font: inherit; font-size: 0.95rem; color: var(--moon-dim); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; transition: all .2s; min-height: 2.5rem; }
.ap .tabs button:hover { color: var(--moon); }
.ap .tabs button[aria-pressed="true"] { background: var(--night-3); color: var(--lamp); border-color: var(--lamp); }
.ap .tabs b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 0.3rem; color: var(--moon-dim); }
.ap .filter { flex: 0 1 18rem; min-width: 0; }
.ap .filter input { width: 100%; font: inherit; font-size: 0.95rem; color: var(--moon); background: var(--night-2); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; min-height: 2.75rem; }
.ap .filter input::placeholder { color: var(--moon-dim); }
.ap .filter input:focus { outline: none; border-color: var(--lamp); }
.ap .group { margin-top: 1.2rem; }
.ap .group h2 { font-size: 1.5rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem; padding-bottom: 0.7rem; }
.ap .group h2 small { font-family: var(--f-body); font-size: 0.92rem; font-weight: 400; color: var(--moon-dim); letter-spacing: 0; }
.ap .atracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ap .atracks li { display: grid; grid-template-columns: 2.9rem minmax(0, 1fr) 8rem 7rem; gap: 0.2rem 1rem; align-items: center; padding: 0.6rem 0.3rem; border-bottom: 1px solid var(--line); transition: background .2s; cursor: pointer; }
.ap .atracks li:hover { background: var(--night-2); }
.ap .atracks li[aria-current="true"] { background: var(--night-3); }
.ap .pb { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--lamp); cursor: pointer; display: grid; place-items: center; transition: all .2s; }
.ap .pb:hover, .ap li[aria-current="true"] .pb { background: var(--lamp); color: var(--night); border-color: var(--lamp); }
.ap .pb svg { width: 0.95rem; height: 0.95rem; fill: currentColor; }
.ap .tt { min-width: 0; }
.ap .tt b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
.ap .tt span { color: var(--moon-dim); font-size: 0.85rem; overflow-wrap: anywhere; }
.ap .dt { color: var(--moon-dim); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.ap .dl { justify-self: end; font-size: 0.92rem; color: var(--lamp); text-decoration: none; padding: 0.5rem 0.2rem; font-weight: 600; white-space: nowrap; }
.ap .dl:hover { text-decoration: underline; }
.ap .empty { padding: 2rem 0; color: var(--moon-dim); }
.ap .empty b { color: var(--moon); }
.ap .note { margin-top: 2.5rem; color: var(--moon-dim); font-size: 0.9rem; }
.ap .note a { color: var(--lamp); }

/* docked player */
.ap .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--night-3); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ap .dock .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.4rem 1.2rem; align-items: center; padding-block: 0.8rem; }
.ap .aplay { width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 0; background: var(--lamp); color: var(--night); cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.ap .aplay:hover { transform: scale(1.06); }
.ap .aplay svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.ap .dock .meta { min-width: 0; }
.ap .dock .meta b { display: block; font-family: var(--f-display); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap .dock .meta span { font-size: 0.85rem; color: var(--moon-dim); }
.ap .abar { grid-column: 1 / -1; height: 14px; display: flex; align-items: center; cursor: pointer; position: relative; }
.ap .abar::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; background: var(--line); border-radius: 4px; }
.ap .abar i { position: relative; display: block; height: 4px; width: 0; background: var(--lamp); border-radius: 4px; }
.ap .times { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--moon-dim); font-variant-numeric: tabular-nums; margin-top: -0.2rem; }
.ap .nav2 { display: flex; gap: 0.4rem; }
.ap .nav2 .abtn { padding: 0.5rem 0.8rem; min-height: 2.5rem; }

@media (max-width: 760px) {
  .ap .atracks li { grid-template-columns: 2.9rem minmax(0, 1fr) auto; }
  .ap .atracks .dt { grid-column: 2; grid-row: 2; }
  .ap .atracks .dl { grid-column: 3; grid-row: 1 / span 2; }
  .ap .filter { flex: 1 1 100%; }
  .ap .ahead h1 { font-size: 2.2rem; }
}
@media (max-width: 520px) {
  .ap .nav2 { display: none; }
  .ap .dock .wrap { grid-template-columns: auto minmax(0, 1fr); }
  .ap .tabs button { flex: 1 1 auto; text-align: center; }
  .ap .ygrid { grid-template-columns: repeat(3, 1fr); }
  .ap .ygrid span { display: none; }
}

/* phones: the docked player sits above the bottom tab bar */
@media (max-width: 600px) {
  .ap { padding-bottom: calc(7.5rem + var(--tabh, 0px)); }
  .ap .dock { bottom: var(--tabh, 0px); padding-bottom: 0; }
}

/* phone controls: elements that only exist for small screens */
.ap .fbtn, .ap .ysel { display: none; }
.ap .fpanel { display: contents; }

@media (max-width: 600px) {
  /* year: one select instead of a scrolling rail and a second button */
  .ap .yrail, .ap .ahead .abtn { display: none; }
  .ap .ysel { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; }
  .ap .ysel label { color: var(--moon-dim); font-size: 0.95rem; }
  .ap .ysel select { flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--moon); background: var(--night-2); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; min-height: 2.75rem; }
  .ap .ahead { padding-block: 1rem 1rem; }
  .ap .ahead p { margin-top: 0.4rem; }

  /* group tabs and name filter: closed behind one row */
  .ap .tools { display: block; padding-block: 0 0.6rem; }
  .ap .fbtn { display: flex; width: 100%; justify-content: space-between; align-items: center; font: inherit; font-size: 1rem; color: var(--moon); background: var(--night-2); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; min-height: 2.75rem; cursor: pointer; text-align: left; }
  .ap .tools.open .fbtn { border-color: var(--lamp); }
  .ap .fpanel { display: none; margin-top: 0.6rem; }
  .ap .tools.open .fpanel { display: grid; gap: 0.6rem; }
  .ap .tabs { flex-direction: column; }
  .ap .tabs button { text-align: left; border-radius: 8px; display: flex; justify-content: space-between; }
  .ap .filter { flex: none; }

  /* player: one line when idle, two when playing */
  .ap .dock .wrap { grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 0.8rem; padding-block: 0.5rem; }
  .ap .aplay { width: 2.6rem; height: 2.6rem; }
  .ap .dock .meta b { font-size: 1rem; }
  .ap .dock .meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ap .dock .times { display: none; }
  .ap .dock.idle .abar, .ap .dock.idle .meta span { display: none; }
  .ap { padding-bottom: calc(5.5rem + var(--tabh, 0px)); }
}

@media (max-width: 600px) {
  .ap .tools.solo .fbtn { display: none; }
  .ap .tools.solo .fpanel { display: block; margin-top: 0; }
}
