/* Mobile navigation and touch layout, shared across the home, Mastering and BPM pages. */
.mobile-nav-toggle { display: none; }
.inline-arrow { display: inline-flex; width: .9em; height: .9em; margin-left: .22em; vertical-align: -.08em; color: currentColor; }
.inline-arrow svg { width: 100%; height: 100%; overflow: visible; }
.inline-arrow path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) {
  html { scroll-padding-top: 86px; }
  body { overflow-x: clip; }
  body > header {
    z-index: 40 !important;
    min-height: 66px;
    padding: 8px 16px !important;
    gap: 12px !important;
    background: #09090df7 !important;
    border-bottom: 1px solid #ffffff20;
    backdrop-filter: blur(18px);
  }
  body > header:not(.site-header) {
    position: fixed !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  body > header.site-header {
    position: sticky !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  body > header > .brand,
  body > header > .site-brand {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 46px;
    gap: 8px !important;
  }
  body > header > .brand img { width: 48px !important; height: 44px !important; object-fit: contain; }
  body > header > .site-brand img { width: 50px !important; height: 44px !important; object-fit: contain; }
  body > header > .brand span,
  body > header > .site-brand span { font-size: 8px !important; letter-spacing: .16em !important; }
  .mobile-nav-toggle {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 92px;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #ffffff35;
    border-radius: 999px;
    background: #15151a;
    color: #f4f1ed;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-toggle-lines,
  .mobile-nav-toggle-lines::before,
  .mobile-nav-toggle-lines::after {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: #c7fa57;
    transition: transform .18s ease, top .18s ease;
  }
  .mobile-nav-toggle-lines { position: relative; }
  .mobile-nav-toggle-lines::before,
  .mobile-nav-toggle-lines::after { content: ""; position: absolute; left: 0; }
  .mobile-nav-toggle-lines::before { top: -5px; }
  .mobile-nav-toggle-lines::after { top: 5px; }
  .mobile-nav-open .mobile-nav-toggle-lines { background: transparent; }
  .mobile-nav-open .mobile-nav-toggle-lines::before { top: 0; transform: rotate(45deg); }
  .mobile-nav-open .mobile-nav-toggle-lines::after { top: 0; transform: rotate(-45deg); }
  body > header > nav,
  body > header > .site-nav {
    position: absolute !important;
    top: calc(100% + 1px) !important;
    left: 12px !important;
    right: 12px !important;
    z-index: 41;
    display: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 100px);
    overflow: auto !important;
    overscroll-behavior: contain;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 12px !important;
    border: 1px solid #ffffff26;
    border-radius: 18px;
    background: #101015f7;
    box-shadow: 0 22px 60px #000b;
    backdrop-filter: blur(20px);
  }
  body > header:not(.site-header) > nav[hidden],
  body > header.site-header > nav[hidden],
  body > header:not(.site-header) > .site-nav[hidden],
  body > header.site-header > .site-nav[hidden] { display: none !important; }
  body > header.mobile-nav-open > nav,
  body > header.mobile-nav-open > .site-nav { display: grid !important; }
  body > header.mobile-nav-open:not(.site-header) > nav,
  body > header.site-header.mobile-nav-open > .site-nav { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body > header > nav > a,
  body > header > nav > button,
  body > header > .site-nav > a,
  body > header > .site-nav > button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    border: 1px solid #ffffff21 !important;
    border-radius: 12px !important;
    background: #ffffff05 !important;
    color: #e8e4df !important;
    font-size: 10px !important;
    line-height: 1.25;
    letter-spacing: .08em !important;
    text-align: center;
    text-transform: uppercase;
    white-space: normal !important;
    overflow-wrap: anywhere;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  body > header > nav > a:active,
  body > header > nav > button:active,
  body > header > .site-nav > a:active,
  body > header > .site-nav > button:active { border-color: #c7fa57 !important; color: #c7fa57 !important; }
  [id] { scroll-margin-top: 84px; }
  .button, .hero-cta a, .text-link, .tool-cta, .secondary-link,
  .dropzone, .file-label, .play-btn, .tool > a, .info-card > a,
  .workbench-foot > a, .journal-card > a, .journal-story,
  .platform-row > a, .store-grid > a, .community > a, .site-footer > a {
    min-height: 46px;
    max-width: 100%;
    padding-top: 12px;
    padding-bottom: 12px;
    overflow-wrap: anywhere;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .hero-cta { flex-wrap: wrap !important; gap: 10px !important; }
  .headline-line { overflow: visible !important; }
  .headline-line span { animation: none !important; transform: none !important; opacity: 1 !important; }
  .music-player { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; width: 100%; min-width: 0; padding: 18px !important; }
  .music-player > div, .music-player > canvas { min-width: 0; max-width: 100%; }
  .release-embed { min-width: 0; padding: 16px !important; }
  .release-embed-head { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; align-items: start !important; gap: 10px !important; }
  .release-embed-note { max-width: none !important; text-align: left !important; }
  .custom-player { grid-template-columns: minmax(0, 1fr) !important; min-width: 0; }
  .player-now { display: grid !important; grid-template-columns: minmax(90px, .42fr) minmax(0, 1fr); align-content: start; gap: 12px !important; min-width: 0; padding: 16px !important; border-right: 0 !important; border-bottom: 1px solid #ffffff1b; }
  .player-cover { grid-column: 1; grid-row: 1 / span 2; width: 100%; max-height: none !important; aspect-ratio: 1; }
  .player-now-copy { grid-column: 2; min-width: 0; }
  .player-now-copy h3 { font-size: 19px; overflow-wrap: anywhere; }
  .player-controls-main, .player-timeline, .player-volume { grid-column: 1 / -1; min-width: 0; }
  .player-controls-main { display: flex; justify-content: center; }
  .player-transport { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 14px !important; }
  .player-transport button { flex: 0 0 44px; }
  .player-transport .player-play { flex-basis: 52px !important; width: 52px !important; min-width: 52px !important; }
  html body .player-transport .player-play { position: relative; display: grid; place-items: center; font-size: 0 !important; color: transparent !important; }
  html body .player-transport .player-play::before { content: ""; width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 11px solid #111; transform: translateX(1px); }
  html body .player-transport .player-play[aria-label="Pause"]::before,
  html body .player-transport .player-play[aria-label="Pausar"]::before { width: 12px; height: 14px; border: 0; background: linear-gradient(to right,#111 0 4px,transparent 4px 8px,#111 8px 12px); transform: none; }
  html body .player-transport #libraryPrevious, html body .player-transport #libraryNext,
  html body .track-row .track-action { position: relative; display: grid; place-items: center; font-size: 0 !important; color: transparent !important; }
  html body .player-transport #libraryPrevious::before, html body .player-transport #libraryNext::before { content: ""; width: 11px; height: 14px; background: #ddd; clip-path: polygon(100% 0,0 50%,100% 100%); }
  html body .player-transport #libraryPrevious::after, html body .player-transport #libraryNext::after { content: ""; position: absolute; width: 2px; height: 14px; background: #ddd; }
  html body .player-transport #libraryPrevious::after { left: 10px; }
  html body .player-transport #libraryNext::before { transform: scaleX(-1); }
  html body .player-transport #libraryNext::after { right: 10px; }
  html body .track-row .track-action::before { content: ""; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #c7fa57; }
  html body .track-row.is-current .track-action::before { width: 9px; height: 11px; border: 0; background: linear-gradient(to right,#c7fa57 0 3px,transparent 3px 6px,#c7fa57 6px 9px); }
  .player-timeline { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: 8px; align-items: center; }
  .player-timeline input { min-width: 0; width: 100%; }
  .player-volume { display: grid; grid-template-columns: auto minmax(80px, 1fr); gap: 10px; align-items: center; }
  .player-volume input { min-width: 0; width: 100%; }
  .platform-row { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
  .platform-row > a { display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.3; }
  .player-controls { display: grid !important; grid-template-columns: minmax(0, 1fr) 96px; align-items: stretch; gap: 10px !important; width: 100%; min-width: 0; }
  .player-controls .file-label { display: flex; align-items: center; justify-content: center; min-width: 0; width: 100%; margin: 0; line-height: 1.25; text-align: center; white-space: normal; }
  .player-controls .play-btn { display: flex; align-items: center; justify-content: center; flex: 0 0 96px; width: 96px; min-width: 96px; max-width: 96px; padding-right: 8px; padding-left: 8px; white-space: nowrap !important; word-break: normal; }
  .play-orbit { font-size: 0 !important; color: transparent !important; }
  .play-orbit::before { content: ""; width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 15px solid #c7fa57; transform: translateX(2px); }
  .player-controls-main button, .player-transport button,
  .track-action, .artist-filters button, .player-play,
  input[type="range"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .track-action, .player-transport button, .artist-filters button { min-width: 44px !important; min-height: 44px !important; }
  .track-row { grid-template-columns: 30px minmax(0, 1fr) 36px 44px !important; gap: 4px !important; min-height: 56px; }
  .floating-dock { bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
  body:has(.floating-dock) { padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
  .dock-seal span { display: none !important; }
  .inline-arrow { display: inline-flex; width: .9em; height: .9em; margin-left: .22em; vertical-align: -.08em; color: currentColor; }
  .inline-arrow svg { width: 100%; height: 100%; overflow: visible; }
  .inline-arrow path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .dock-seal b { position: relative; display: block; width: 16px; height: 16px; font-size: 0 !important; }
  .dock-seal b::before { content: ""; position: absolute; left: 3px; bottom: 3px; width: 10px; height: 10px; border-top: 2px solid #c7fa57; transform: rotate(45deg); }
  .dock-seal b::after { content: "" !important; position: absolute; right: 1px; top: 1px; width: 7px; height: 7px; border-top: 2px solid #c7fa57; border-right: 2px solid #c7fa57; font-size: 0 !important; }
  .tool-shell { padding: 34px 5vw 68px !important; }
  .tool-hero { grid-template-columns: minmax(0, 1fr) !important; gap: 30px !important; padding-top: 20px; }
  .tool-copy h1 { font-size: clamp(48px, 13vw, 76px) !important; overflow-wrap: anywhere; }
  .workbench { min-width: 0; min-height: 0 !important; padding: 16px !important; }
  .workbench-body { min-height: 0 !important; padding: 20px 6px !important; }
  .workbench-foot { flex-wrap: wrap; }
  .info-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .site-footer { align-items: flex-start !important; flex-direction: column; }
}

@media (max-width: 380px) {
  body > header { padding-right: 12px !important; padding-left: 12px !important; }
  body > header > .brand img, body > header > .site-brand img { width: 42px !important; }
  body > header > .brand span, body > header > .site-brand span { font-size: 7px !important; }
  .mobile-nav-toggle { min-width: 82px; padding: 0 10px; }
  .platform-row { grid-template-columns: minmax(0, 1fr); }
  .player-controls { grid-template-columns: minmax(0, 1fr) 90px; gap: 8px !important; }
  .player-controls .play-btn { flex-basis: 90px; width: 90px; min-width: 90px; max-width: 90px; }
  .hero-copy h1 { font-size: clamp(38px, 12vw, 46px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-toggle-lines, .mobile-nav-toggle-lines::before, .mobile-nav-toggle-lines::after { transition: none !important; }
}

/* Phase 1 hotfix: collapse the legacy always-visible mobile nav. */
@media (max-width: 700px) {
  html body > header:not(.site-header) { position: fixed !important; inset: 0 0 auto 0 !important; display: flex !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: space-between !important; width: 100% !important; min-height: 66px !important; padding: 8px 16px !important; gap: 12px !important; }
  html body > header:not(.site-header) > .brand { flex: 0 1 auto !important; width: auto !important; min-width: 0 !important; }
  html body > header > nav[hidden], html body > header > .site-nav[hidden] { display: none !important; visibility: hidden !important; pointer-events: none !important; }
  html body > header.mobile-nav-open > nav:not([hidden]), html body > header.mobile-nav-open > .site-nav:not([hidden]) { display: grid !important; visibility: visible !important; pointer-events: auto !important; }
  html body > header.mobile-nav-open > nav, html body > header.mobile-nav-open > .site-nav { position: absolute !important; top: calc(100% + 1px) !important; left: 12px !important; right: 12px !important; width: auto !important; max-width: none !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
