/*
 * Audiodrive visual system (UX revamp, Oct 2026).
 * Loaded after application.css and sidebar.css; overrides their tokens.
 * One accent colour for primary actions, the playing row and progress. Everything else neutral.
 */

:root,
[data-bs-theme="light"] {
  --ab-accent: #c2410c;          /* 5.2:1 on white */
  --ab-accent-hover: #9a3412;
  --ab-accent-subtle: rgba(194, 65, 12, 0.09);
  --ab-on-accent: #ffffff;

  --ab-text: #1c1917;
  --ab-text-muted: #57534e;      /* 7:1 on --ab-bg */
  --ab-text-faint: #78716c;      /* 4.6:1 on --ab-bg */

  --ab-bg: #f7f5f2;
  --ab-bg-surface: #ffffff;
  --ab-bg-sidebar: #efece7;
  --ab-bg-raised: #ffffff;

  --ab-border: rgba(28, 25, 23, 0.08);
  --ab-border-strong: rgba(28, 25, 23, 0.14);
  --ab-border-player: rgba(28, 25, 23, 0.1);

  --ab-primary: var(--ab-accent);
  --ab-primary-hover: var(--ab-accent-hover);
  --ab-primary-subtle: var(--ab-accent-subtle);

  --ab-radius-sm: 6px;
  --ab-radius: 10px;
  --ab-radius-lg: 14px;
  --ab-shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 4px 16px rgba(28, 25, 23, 0.06);

  --ab-player-h: 68px;
  --ab-tabbar-h: 0px;

  --bs-primary: var(--ab-accent);
  --bs-primary-rgb: 194, 65, 12;
  --bs-link-color: var(--ab-accent);
  --bs-link-color-rgb: 194, 65, 12;
  --bs-link-hover-color: var(--ab-accent-hover);
  --bs-link-hover-color-rgb: 154, 52, 18;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--ab-bg);
  --bs-body-color: var(--ab-text);
  --bs-secondary-color: var(--ab-text-muted);
  --bs-tertiary-color: var(--ab-text-faint);
  --bs-border-color: var(--ab-border-strong);
  --bs-focus-ring-color: rgba(194, 65, 12, 0.3);
}

[data-bs-theme="dark"] {
  --ab-accent: #fb923c;          /* 8.4:1 on #16151a */
  --ab-accent-hover: #fdba74;
  --ab-accent-subtle: rgba(251, 146, 60, 0.12);
  --ab-on-accent: #1c1917;

  --ab-text: #f5f5f4;
  --ab-text-muted: #c4c0bb;
  --ab-text-faint: #a8a29e;

  --ab-bg: #16151a;
  --ab-bg-surface: #1e1d23;
  --ab-bg-sidebar: #121116;
  --ab-bg-raised: #26252c;

  --ab-border: rgba(255, 255, 255, 0.07);
  --ab-border-strong: rgba(255, 255, 255, 0.13);
  --ab-border-player: rgba(255, 255, 255, 0.1);

  --ab-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);

  --bs-primary: var(--ab-accent);
  --bs-primary-rgb: 251, 146, 60;
  --bs-link-color: var(--ab-accent);
  --bs-link-color-rgb: 251, 146, 60;
  --bs-link-hover-color: var(--ab-accent-hover);
  --bs-link-hover-color-rgb: 253, 186, 116;
  --bs-body-bg: var(--ab-bg);
  --bs-body-color: var(--ab-text);
  --bs-secondary-color: var(--ab-text-muted);
  --bs-tertiary-color: var(--ab-text-faint);
  --bs-border-color: var(--ab-border-strong);
  --bs-focus-ring-color: rgba(251, 146, 60, 0.35);
}

body.ab-app {
  font-family: var(--bs-body-font-family);
  background: var(--ab-bg);
  color: var(--ab-text);
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  height: 100dvh;
}

.text-accent { color: var(--ab-accent) !important; }

/* Sentence case everywhere: neutralise old uppercase micro-labels. */
.text-uppercase,
.section-label,
.sidebar-nav-label { text-transform: none !important; letter-spacing: normal !important; }

/* ===== Buttons ===== */
.btn { border-radius: var(--ab-radius-sm); font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--ab-accent);
  --bs-btn-border-color: var(--ab-accent);
  --bs-btn-color: var(--ab-on-accent);
  --bs-btn-hover-bg: var(--ab-accent-hover);
  --bs-btn-hover-border-color: var(--ab-accent-hover);
  --bs-btn-hover-color: var(--ab-on-accent);
  --bs-btn-active-bg: var(--ab-accent-hover);
  --bs-btn-active-border-color: var(--ab-accent-hover);
  --bs-btn-active-color: var(--ab-on-accent);
  --bs-btn-disabled-bg: var(--ab-accent);
  --bs-btn-disabled-border-color: var(--ab-accent);
  --bs-btn-disabled-color: var(--ab-on-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--ab-accent);
  --bs-btn-border-color: var(--ab-accent);
  --bs-btn-hover-bg: var(--ab-accent);
  --bs-btn-hover-border-color: var(--ab-accent);
  --bs-btn-hover-color: var(--ab-on-accent);
  --bs-btn-active-bg: var(--ab-accent-hover);
  --bs-btn-active-color: var(--ab-on-accent);
}
.btn-quiet {
  --bs-btn-color: var(--ab-text);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--ab-border-strong);
  --bs-btn-hover-bg: var(--ab-accent-subtle);
  --bs-btn-hover-border-color: var(--ab-border-strong);
  --bs-btn-hover-color: var(--ab-text);
  --bs-btn-active-bg: var(--ab-accent-subtle);
  --bs-btn-active-color: var(--ab-text);
}

.ab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ab-text);
  font-size: 1.15rem;
}
.ab-icon-btn:hover { background: var(--ab-accent-subtle); }
.ab-icon-btn:focus-visible,
.ab-play-btn:focus-visible { outline: 2px solid var(--ab-accent); outline-offset: 2px; }

.ab-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--ab-accent);
  color: var(--ab-on-accent);
  font-size: 1.35rem;
  flex-shrink: 0;
}
.ab-play-btn:hover { background: var(--ab-accent-hover); }
.ab-play-btn--lg { width: 60px; height: 60px; font-size: 1.9rem; }
.ab-play-btn--sm { width: 36px; height: 36px; font-size: 1.1rem; }
.ab-play-btn:disabled { background: var(--ab-border-strong); color: var(--ab-text-faint); cursor: not-allowed; }

.ab-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ab-accent);
  color: var(--ab-on-accent);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
}

/* ===== App shell ===== */
.ab-skip-link { position: absolute; z-index: 2000; left: 8px; top: 8px; padding: 8px 12px; background: var(--ab-bg-surface); border-radius: var(--ab-radius-sm); }

.left-sidebar-container { width: 260px; flex-shrink: 0; min-width: 0; background: var(--ab-bg-sidebar); border-right: 1px solid var(--ab-border); }
.left-sidebar-container .sidebar { width: 260px; background: var(--ab-bg-sidebar); color: var(--ab-text); min-height: 0; }
.sidebar-expand-btn { z-index: 1052; bottom: 96px; left: 4px; }
.sidebar-nav-link { color: var(--ab-text-muted); font-size: 0.95rem; padding: 0.6rem 0.75rem; border-radius: var(--ab-radius-sm); }
.sidebar-nav-link:hover { background: var(--ab-accent-subtle); color: var(--ab-text); }
.sidebar-nav-link.active { background: var(--ab-bg-surface); color: var(--ab-text); font-weight: 600; box-shadow: var(--ab-shadow); }
.sidebar-nav-link.active .sidebar-nav-icon { color: var(--ab-accent); }

.ab-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--ab-text); text-decoration: none; letter-spacing: -0.01em; }
.ab-brand .bi { color: var(--ab-accent); }
.ab-brand--lg { font-size: 1.35rem; }

.ab-main-column { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.ab-topbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem; min-height: 56px; border-bottom: 1px solid var(--ab-border); background: var(--ab-bg); z-index: 1040; }
.ab-content-row { flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden; }
.ab-main { flex: 1 1 auto; min-width: 0; overflow: auto; padding: 1rem 1rem calc(var(--ab-tabbar-h) + 24px); }
body.ab-has-player .ab-main { padding-bottom: calc(var(--ab-player-h) + var(--ab-tabbar-h) + 24px); }
@media (min-width: 768px) { .ab-main { padding: 1.5rem 2rem calc(var(--ab-tabbar-h) + 32px); } }
.ab-right-sidebar { flex: 0 0 34%; max-width: 420px; overflow-y: auto; border-left: 1px solid var(--ab-border); background: var(--ab-bg-surface); }

.ab-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; background: var(--ab-accent-subtle); border-bottom: 1px solid var(--ab-border); font-size: 0.9rem; }

.ab-public-footer { margin-top: 3rem; padding: 1.5rem 0; text-align: center; color: var(--ab-text-faint); font-size: 0.85rem; }

/* ===== Storage meter ===== */
.ab-storage { padding: 0.75rem; border-radius: var(--ab-radius); background: var(--ab-bg-surface); border: 1px solid var(--ab-border); }
.ab-storage__bar { height: 6px; margin-top: 0.4rem; background: var(--ab-border); }
.ab-storage__bar .progress-bar { background: var(--ab-text-muted); }
.ab-storage__bar .ab-storage__previews { background: var(--ab-accent); }

/* ===== Phone tab bar ===== */
@media (max-width: 991.98px) {
  body.ab-app:has(.ab-tabbar) { --ab-tabbar-h: 60px; }
}
.ab-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1045;
  display: flex;
  height: calc(var(--ab-tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--ab-bg-surface);
  border-top: 1px solid var(--ab-border);
}
.ab-tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--ab-text-muted);
  font-size: 0.72rem;
  text-decoration: none;
}
.ab-tabbar__item .bi { font-size: 1.25rem; }
.ab-tabbar__item.active { color: var(--ab-accent); font-weight: 600; }

/* ===== Player ===== */
.ab-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--ab-tabbar-h) + env(safe-area-inset-bottom));
  z-index: 1050;
  background: var(--ab-bg-surface);
  border-top: 1px solid var(--ab-border-player);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}
@media (min-width: 992px) {
  body.ab-app:not(.ab-app--public) .ab-player { left: 260px; }
  body.ab-app:has(.left-sidebar-container.sidebar-collapsed) .ab-player { left: var(--ab-collapsed-w, 0px); }
}
.ab-player__bar { position: relative; display: flex; align-items: center; gap: 0.75rem; min-height: var(--ab-player-min, 68px); padding: 0.375rem 0.75rem 0.375rem 0.5rem; }
.ab-player__info { display: flex; align-items: center; gap: 0.75rem; flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 0.25rem; text-align: left; color: inherit; border-radius: var(--ab-radius-sm); }
.ab-player__info:hover { background: var(--ab-accent-subtle); }
.ab-player__info-text { min-width: 0; flex: 1; }
.ab-player__controls { display: flex; align-items: center; gap: 0.25rem; }
.ab-player__art {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--ab-radius-sm);
  background: linear-gradient(135deg, var(--ab-accent-subtle), var(--ab-border-strong));
  background-size: cover;
  background-position: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ab-accent);
}
.ab-player__art.has-image .bi { display: none; }
.ab-player__art--large { width: 72px; height: 72px; font-size: 1.6rem; border-radius: var(--ab-radius); }

.ab-player__panel { padding: 1rem 1rem 0.5rem; border-bottom: 1px solid var(--ab-border); max-height: min(70dvh, 640px); display: flex; flex-direction: column; gap: 0.75rem; }
.ab-player__panel[hidden] { display: none; }
.ab-player__sheet-head { display: flex; align-items: center; justify-content: space-between; }
@media (min-width: 768px) {
  .ab-player__panel { position: absolute; right: 12px; bottom: calc(100% + 8px); width: 420px; border: 1px solid var(--ab-border-strong); border-radius: var(--ab-radius-lg); background: var(--ab-bg-raised); box-shadow: var(--ab-shadow); }
}
/* Phones: the expanded player is a full-screen sheet above everything else. */
@media (max-width: 767.98px) {
  .ab-player--expanded .ab-player__panel {
    position: fixed;
    inset: 0;
    z-index: 1065;
    max-height: none;
    padding: calc(0.5rem + env(safe-area-inset-top)) 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--ab-bg-surface);
    border: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ab-player--expanded .ab-player__queue { min-height: 160px; }
  .ab-player--expanded .ab-player__now { flex-direction: column; text-align: center; gap: 0.75rem; }
  .ab-player--expanded .ab-player__now-text { width: 100%; }
  .ab-player--expanded .ab-player__art--large { width: min(64vw, 30dvh, 280px); height: min(64vw, 30dvh, 280px); font-size: 3rem; }
}
/* Short phones: no big artwork, so the controls and queue get the room. */
@media (max-width: 767.98px) and (max-height: 600px) {
  .ab-player--expanded .ab-player__now { flex-direction: row; text-align: left; }
  .ab-player--expanded .ab-player__art--large { width: 56px; height: 56px; font-size: 1.4rem; }
  .ab-player--expanded .ab-player__panel { gap: 0.5rem; }
}

.ab-player__now { display: flex; align-items: center; gap: 1rem; }
.ab-player__now-text { min-width: 0; flex: 1; }
.ab-player__transport { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.ab-player__queue-head { display: flex; align-items: center; justify-content: space-between; padding-top: 0.5rem; border-top: 1px solid var(--ab-border); }
.ab-player__queue-head .active { color: var(--ab-accent) !important; }
.ab-player__queue { overflow-y: auto; min-height: 0; flex: 1 1 auto; margin: 0 -0.5rem; }

.ab-queue-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border-radius: var(--ab-radius-sm); cursor: pointer; min-height: 48px; }
.ab-queue-item:hover { background: var(--ab-accent-subtle); }
.ab-queue-item.is-current { background: var(--ab-accent-subtle); font-weight: 600; }
.ab-queue-item--drop { box-shadow: inset 0 2px 0 var(--ab-accent); }
.ab-queue-item__text { flex: 1; min-width: 0; }
.ab-empty-note { padding: 1rem; text-align: center; color: var(--ab-text-faint); font-size: 0.9rem; }

/* Range scrubber with an accent-filled track. */
.ab-scrubber { --ab-progress: 0%; width: 100%; height: 20px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.ab-scrubber::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ab-accent) var(--ab-progress), var(--ab-border-strong) var(--ab-progress)); }
.ab-scrubber::-moz-range-track { height: 4px; border-radius: 2px; background: var(--ab-border-strong); }
.ab-scrubber::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ab-accent); }
.ab-scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--ab-accent); border: 0; }
.ab-scrubber::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ab-accent); border: 0; }
.ab-scrubber--edge { position: absolute; left: 0; right: 0; top: -10px; z-index: 1; }
.ab-scrubber--edge::-webkit-slider-thumb { opacity: 0; }
.ab-scrubber--edge:hover::-webkit-slider-thumb,
.ab-scrubber--edge:focus-visible::-webkit-slider-thumb { opacity: 1; }

/* ===== Toasts ===== */
.ab-toasts { position: fixed; left: 16px; bottom: calc(var(--ab-tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 1090; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
body.ab-has-player .ab-toasts { bottom: calc(var(--ab-player-h) + var(--ab-tabbar-h) + 16px + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { body.ab-app:not(.ab-app--public) .ab-toasts { left: 276px; } body.ab-app:has(.left-sidebar-container.sidebar-collapsed) .ab-toasts { left: 16px; } }
.ab-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.75rem 0.75rem 0.75rem 1rem; border-radius: var(--ab-radius); background: var(--ab-text); color: var(--ab-bg); box-shadow: var(--ab-shadow); font-size: 0.92rem; animation: ab-toast-in 0.18s ease-out; }
.ab-toast .btn-close { filter: invert(1) grayscale(100%) brightness(200%); margin-left: auto; }
[data-bs-theme="dark"] .ab-toast .btn-close { filter: none; }
.ab-toast--success .bi { color: #4ade80; }
.ab-toast--error { background: #991b1b; color: #fff; }
.ab-toast--error .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.ab-toast__text { flex: 1; }
.ab-toast.is-leaving { opacity: 0; transform: translateY(4px); transition: all 0.2s; }
@keyframes ab-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== Page header and sections ===== */
.page-header h1 { font-weight: 600; letter-spacing: -0.02em; }
.ab-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; color: var(--ab-text-muted); font-size: 0.9rem; }
.ab-meta a, .ab-meta button { color: inherit; }
.ab-meta-button { border: 0; background: transparent; padding: 0; text-decoration: underline; text-decoration-color: var(--ab-border-strong); text-underline-offset: 3px; }
.ab-meta-button:hover { color: var(--ab-accent); }
.section-card { border-radius: var(--ab-radius-lg); border: 1px solid var(--ab-border); background: var(--ab-bg-surface); }

.ab-empty { text-align: center; padding: 3rem 1rem; border: 2px dashed var(--ab-border-strong); border-radius: var(--ab-radius-lg); background: var(--ab-bg-surface); }
.ab-empty .bi { font-size: 2.5rem; color: var(--ab-accent); }
.ab-empty h2 { font-size: 1.1rem; font-weight: 600; margin-top: 0.75rem; }
.ab-empty p { color: var(--ab-text-muted); margin-bottom: 1rem; }

/* ===== File list ===== */
.fs-browser .fs-table tbody tr { height: 56px; }
.fs-browser tr.is-playing > th, .fs-browser tr.is-playing > td { background: var(--ab-accent-subtle) !important; }
.fs-browser tr.is-playing .fs-name__label a { color: var(--ab-accent) !important; }
.fs-browser th[data-column], .fs-browser td[data-column] { white-space: nowrap; }
.fs-browser .ab-optional-col { display: none !important; }
.fs-browser.show-size .ab-col-size,
.fs-browser.show-loudness .ab-col-loudness,
.fs-browser.show-resolution .ab-col-resolution { display: table-cell !important; }
.ab-versions-badge { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.5rem; padding: 0 0.5rem; border: 0; border-radius: 999px; background: var(--ab-accent-subtle); color: var(--ab-text-muted); font-size: 0.75rem; line-height: 1.6; }
.ab-share-indicator { color: var(--ab-text-faint); margin-left: 0.4rem; font-size: 0.85rem; }
.ab-pending-play { position: relative; }
.dropdown-header { font-size: 0.75rem; color: var(--ab-text-faint); }

.ab-selection-bar { position: sticky; bottom: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; padding: 0.5rem 0.75rem; border-radius: var(--ab-radius); background: var(--ab-text); color: var(--ab-bg); box-shadow: var(--ab-shadow); }
.ab-selection-bar .btn { --bs-btn-color: var(--ab-bg); --bs-btn-hover-color: var(--ab-bg); --bs-btn-hover-bg: rgba(255,255,255,0.12); }
.ab-selection-bar .form-select { max-width: 220px; }

/* ===== Share dialog ===== */
.ab-share-people { list-style: none; padding: 0; margin: 0; }
.ab-share-person { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--ab-border); }
.ab-share-person:last-child { border-bottom: 0; }
.ab-avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ab-accent-subtle); color: var(--ab-accent); font-weight: 600; font-size: 0.85rem; }
.ab-status { font-size: 0.75rem; padding: 0 0.45rem; border-radius: 999px; background: var(--ab-border); color: var(--ab-text-muted); }
.ab-status--invited { background: var(--ab-accent-subtle); color: var(--ab-accent); }

/* ===== Drop overlay ===== */
.ab-drop-overlay { position: fixed; inset: 0; z-index: 1080; display: none; align-items: center; justify-content: center; background: rgba(28, 25, 23, 0.55); backdrop-filter: blur(2px); pointer-events: none; }
.ab-drop-overlay.is-active { display: flex; }
.ab-drop-overlay__card { padding: 2rem 2.5rem; border-radius: var(--ab-radius-lg); border: 2px dashed var(--ab-accent); background: var(--ab-bg-surface); color: var(--ab-text); font-size: 1.15rem; font-weight: 600; text-align: center; }
.ab-drop-overlay__card .bi { display: block; font-size: 2.5rem; color: var(--ab-accent); margin-bottom: 0.5rem; }

/* Upload overlay docks above the player. */
#upload-overlay { bottom: calc(var(--ab-tabbar-h) + 16px) !important; border-radius: var(--ab-radius) !important; }
body.ab-has-player #upload-overlay { bottom: calc(var(--ab-player-h) + var(--ab-tabbar-h) + 16px) !important; }

/* ===== File page ===== */
.ab-file-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.ab-file-hero__cover { width: 112px; height: 112px; border-radius: var(--ab-radius); object-fit: cover; background: linear-gradient(135deg, var(--ab-accent-subtle), var(--ab-border-strong)); display: inline-flex; align-items: center; justify-content: center; color: var(--ab-accent); font-size: 2.5rem; flex-shrink: 0; }
.ab-file-hero__text { flex: 1 1 260px; min-width: 0; }
.ab-file-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ab-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; padding: 0.75rem 1rem; }
.ab-details > summary::-webkit-details-marker { display: none; }
.ab-details > summary .bi-chevron-right { transition: transform 0.15s; }
.ab-details[open] > summary .bi-chevron-right { transform: rotate(90deg); }
.ab-details { border: 1px solid var(--ab-border); border-radius: var(--ab-radius-lg); background: var(--ab-bg-surface); margin-top: 1rem; }
.ab-details__body { padding: 0 1rem 1rem; }
.ab-help { border-bottom: 1px dotted var(--ab-text-faint); cursor: help; }

.audio-inspector-viewport { border-radius: var(--ab-radius) !important; background: var(--ab-bg-surface) !important; border-color: var(--ab-border) !important; }

/* Kill heavy Bootstrap greys on old cards. */
.bg-light { background-color: var(--ab-bg-surface) !important; }
.card { border-color: var(--ab-border); border-radius: var(--ab-radius-lg); background: var(--ab-bg-surface); }
.modal-content { border-radius: var(--ab-radius-lg); background: var(--ab-bg-raised); border: 1px solid var(--ab-border-strong); }
.dropdown-menu { border-radius: var(--ab-radius); border-color: var(--ab-border-strong); box-shadow: var(--ab-shadow); background: var(--ab-bg-raised); }
.form-control, .form-select { border-radius: var(--ab-radius-sm); }

@media (prefers-reduced-motion: reduce) {
  .ab-toast, .ab-details > summary .bi-chevron-right { animation: none; transition: none; }
}

/* The confirm dialog can open on top of another dialog (e.g. Revoke in Share). */
#ab-confirm { z-index: 1075; }
body:has(#ab-confirm.show) .modal-backdrop.show:last-of-type { z-index: 1070; }


/* Track titles are always shown in full: they wrap (at _ - . first) instead of being cut off. */
.ab-track-title { overflow-wrap: anywhere; line-height: 1.25; white-space: normal; }
.ab-player__info { align-items: center; }
.ab-player__info-text .ab-track-title { font-size: 0.95rem; }

/* ===== Small screens =====
   The bottom of a phone holds the tab bar and the mini player; everything else
   (toasts, uploads) moves out of their way, and both shrink on short screens. */
@media (max-width: 991.98px) {
  body.ab-app:has(.ab-tabbar) { --ab-tabbar-h: 56px; }
  .ab-player { bottom: calc(var(--ab-tabbar-offset, var(--ab-tabbar-h)) + env(safe-area-inset-bottom)); transition: bottom 0.2s ease; }
  .ab-tabbar { transition: transform 0.2s ease; }
  /* Scrolling down a list hides the tab bar (scroll_chrome_controller); scrolling up brings it back. */
  body.ab-chrome-hidden { --ab-tabbar-offset: 0px; }
  body.ab-chrome-hidden .ab-tabbar { transform: translateY(100%); }
}
@media (max-width: 767.98px) {
  body.ab-app { --ab-player-min: 60px; }
  .ab-player__bar { gap: 0.5rem; padding: 0.375rem 0.25rem 0.375rem 0.5rem; }
  .ab-player__info-text .ab-track-title { font-size: 0.875rem; }
  /* Tapping the track opens the player sheet; a small chevron hints at that. */
  .ab-player__info::after { content: "\F286"; font-family: "bootstrap-icons"; color: var(--ab-text-faint); font-size: 0.8rem; margin-left: 0.25rem; }
  .ab-player__art { width: 40px; height: 40px; }
  .ab-player__controls .ab-icon-btn { min-width: 40px; }
  .ab-main { padding-left: 0.75rem; padding-right: 0.75rem; }

  /* Toasts drop in under the top bar instead of piling up over the player. */
  .ab-toasts,
  body.ab-has-player .ab-toasts { top: calc(64px + env(safe-area-inset-top)); bottom: auto; left: 8px; right: 8px; max-width: none; }
  .ab-toast { padding: 0.5rem 0.5rem 0.5rem 0.75rem; font-size: 0.875rem; }

  /* Uploads: a full-width panel docked above the player, never wider than the screen. */
  #upload-overlay { left: 8px !important; right: 8px !important; width: auto !important; max-height: 45dvh; }
  #upload-overlay .upload-list { max-height: 25dvh !important; }
}
/* Short screens (small phones, landscape): icon-only tab bar and a slimmer player. */
@media (max-width: 991.98px) and (max-height: 640px) {
  body.ab-app:has(.ab-tabbar) { --ab-tabbar-h: 48px; }
  .ab-tabbar__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ab-tabbar__item .bi { font-size: 1.35rem; }
}
@media (max-height: 480px) {
  body.ab-app { --ab-player-min: 52px; }
  body.ab-app:has(.ab-tabbar) { --ab-tabbar-h: 44px; }
  .ab-player__art { width: 36px; height: 36px; }
  .ab-player__info-text .small { display: none !important; }
  .ab-topbar { min-height: 44px; padding-top: 0.25rem; padding-bottom: 0.25rem; }
  .ab-toasts, body.ab-has-player .ab-toasts { top: calc(52px + env(safe-area-inset-top)); }
}
