/*html,
body {
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    align-content: center;
    flex-wrap: wrap;
}

body > * {
    overflow: hidden;
}
*/

.at-wrap {
    position: relative;
    width: 100%;
    max-width: 924px; /* responsive: shrink with browser */
    /* border: 1px solid rgba(0, 0, 0, 0.12); */
    background: #fff;
    display: flex;
    margin: 0 auto;
    flex-direction: column;
    overflow: hidden;
}

.at-content {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
}

.at-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 924px; /* match at-wrap max width */
    background: rgba(248, 248, 248, .92);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    border-top: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 -4px 24px rgba(0,0,0,.08);
    z-index: 9999;
    overflow: visible; /* allow dropdowns to overflow upwards */
}

.btn-show-track {
    min-width: 40px;
    border: 1px solid #f0f0f0;
}

.btn-show-track:hover + .at-trackbar,
.btn-show-track:active + .at-trackbar,
.btn-show-track:focus + .at-trackbar,
.at-trackbar:hover {display: flex;}

.at-trackbar-content {
    display: flex;
    flex-direction: column;
}

.at-track-list {
    flex: 1;
    overflow: auto;
}

.at-trackbar {
    display: none;
    min-width: 300px;
    max-width: 100%;
    align-content: stretch;
    z-index: 1001;
    position: fixed;
    bottom: 46px;
    height: 80vh;
    overflow: hidden;
    background: #f8f8f8;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.at-sidebar:hover {
    max-width: 400px;
    transition: max-width 0.2s;
    overflow-y: auto;
}

.at-viewport {
    overflow: visible; /* show full score without inner scrollbars */
    /*position: absolute;*/
    top: 0;
    left: 70px;
    right: 0;
    bottom: 0;
    padding-right: 20px;
    max-height: none;
}

/* Fullscreen: make score use full screen width, like original */
.gtptab-2025-fullscreen { width: 100vw; overflow-x: hidden; background: #fff; }
.gtptab-2025-fullscreen .at-wrap { width: 100% !important; max-width: 100% !important; margin: 0 auto; border-left: 0; border-right: 0; background: #fff; box-sizing: border-box; }
.gtptab-2025-fullscreen .at-content { background: #fff; }
.gtptab-2025-fullscreen .at-viewport { left: 0 !important; padding-right: 0 !important; }
.gtptab-2025-fullscreen .at-waveform { max-width: 100%; }
.gtptab-2025-fullscreen .at-footer { left: 0 !important; transform: none !important; width: 100vw !important; max-width: none !important; }

/* Align legacy track icons row */
.a-i-c { align-items: center; }

/* Ensure checkbox aligns with mute/solo icons */
.dropdown-track .tracklist .trackitem .check { display: inline-flex; align-items: center; height: 24px; }
.dropdown-track .tracklist .trackitem .check i { line-height: 1; font-size: 20px; }

/* Selected track highlight */
.dropdown-track .tracklist .trackitem.selected { 
    border-left: 3px solid #0366d6; 
    background: #f8f8f8; 
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.dropdown-track .tracklist .trackitem.selected .name { 
    color: #0366d6; 
}

.at-song-title {
    font-weight: 500;
}

.at-track {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: 'icon title' 'icon controls';
    padding: 5px;
    transition: background 0.2s;
    grid-gap: 5px;
    cursor: pointer;
}

.at-track:hover {
    background: rgba(0, 0, 0, 0.1);
}

.at-track > .at-track-icon {
    grid-area: icon;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.2s;
    width: 64px;
    height: 64px;
}

.at-track:hover > .at-track-icon {
    opacity: 0.8;
}

.at-track.active {
    background: rgba(0, 0, 0, 0.03);
}

.at-track.active > .at-track-icon {
    color: #4972a1;
    opacity: 1;
}

.at-track > .at-track-name {
    grid-area: title;
    font-weight: 500;
}

.at-track > .at-track-controls {
    grid-area: controls;
    display: flex;
    align-items: center;
}

.at-track > .at-track-controls > * {
    margin: 0 2px;
}

.at-track > .at-track-controls > button.active:hover {
    background: transparent;
}

input[type='range'] {
    -webkit-appearance: none;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    height: 5px;
}

/* ------------------------------
   Mobile adaptations
   - Make track selector a bottom sheet on phones
   - Ensure full-width usable area and avoid overflow under footer
   ------------------------------ */
@media (max-width: 768px) {
  /* Bottom sheet style for track list */
  .gtptab-2025-fullscreen .dropdown-track .tracklist {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(var(--at-footer-h, 64px) + env(safe-area-inset-bottom, 0px) + 8px) !important; /* above footer */
    top: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: 55vh !important;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.24);
    background: #fff;
  }

  /* Smoother scroll for tall lists */
  .gtptab-2025-fullscreen .dropdown-track .tracklist.scroll-auto-y {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Touch friendly paddings */
  .gtptab-2025-fullscreen .dropdown-track .tracklist .trackitem {
    padding: 10px 12px;
  }
  .gtptab-2025-fullscreen .dropdown-track .tracklist .trackitem .slider-volume {
    width: 100%;
  }

  /* Keep footer full width without centering offset on mobile */
  .gtptab-2025-fullscreen .at-footer {
    left: 0 !important;
    transform: none !important;
    width: 100vw !important;
    max-width: none !important;
  }
}

input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4972a1;
    cursor: pointer;
}

input[type='range']::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4972a1;
    cursor: pointer;
}

.at-overlay {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    backdrop-filter: blur(3px);
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: flex-start;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    transition-delay: 0;
}

.at-wrap.loading .at-overlay,
.at-wrap.dragging .at-overlay {
    visibility: visible;
    opacity: 1;
    transition-delay: 0.2s;
}

.at-overlay-content {
    margin-top: 20px;
    background: #fff;
    box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.3);
    padding: 10px;
}

.at-overlay-content > .spinner-border {
    color: #4972a1;
}

.at-player {
    display: flex;
    gap: 6px;
    padding: 4px 8px;
    align-items: center;
    position: relative;
    min-height: 56px; /* keep enough height when side controls are hidden */
}

.at-player a {
    text-decoration: none;
}

.at-player > div {
    padding: 2px;
    display: flex;
    justify-content: flex-start;
    align-content: center;
    align-items: center;
    gap: 4px;
}
.at-player-left > *,
.at-player-right > * {
    margin-right: 4px;
}

.at-player-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.at-player-left > a.disabled,
.at-player-left > a.disabled:hover,
.at-player-left > a.disabled:active {
    color: rgba(0, 0, 0, 0.3);
}

.at-footer button {
    display: inline-flex;
    border: none;
    width: 36px;
    height: 36px;
    text-align: center;
    box-sizing: content-box;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #444;
    background: transparent;
    transition: color .15s ease, background-color .15s ease, box-shadow .2s ease;
}

.at-footer button:hover {
    background: rgba(0,0,0,.06);
}

.at-footer button.active {
    /* keep per-icon colors; only highlight background/border */
    background: rgba(13,110,253,.12);
    box-shadow: inset 0 0 0 1px rgba(13,110,253,.2);
}

/* Emphasize play/pause button */
.at-footer .at-play-pause {
    width: 40px;
    height: 40px;
    aspect-ratio: 1 / 1;            /* enforce perfect circle */
    border-radius: 50%;
    background: linear-gradient(180deg, #ff5a4e, #e53935);
    color: #fff;
    box-shadow: 0 6px 16px rgba(229,57,53,.35);
    position: relative;
    box-sizing: border-box !important; /* ignore parent content-box */
    padding: 0;                        /* avoid affecting shape */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;                 /* allow pulse ring to show outside */
}
.at-footer .at-play-pause:hover { filter: brightness(1.03); }
.at-footer .at-play-pause i {
    font-size: 16px;
    color: #fff !important; /* override iconfont color */
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
    transform: translateX(.5px); /* optical centering of triangle */
}

/* subtle pulse ring while playing */
.at-footer .at-play-pause.is-playing::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(229,57,53,.18);
    animation: atPulse 1.8s ease-out infinite;
}

@keyframes atPulse {
    0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(229,57,53,.18); }
    70% { transform: scale(1.15); opacity: .5; box-shadow: 0 0 0 12px rgba(229,57,53,0); }
    100% { transform: scale(1.2); opacity: 0; box-shadow: 0 0 0 0 rgba(229,57,53,0); }
}

.at-footer a > i {
    vertical-align: top;
    font-size: 16px;
}

.at-footer .btn {
    padding: 4px;
    border-radius: 0;
    height: 40px;
}

.at-footer .btn:hover {
    background: #5588c7;
}

.at-footer a.active,
.at-footer a:hover {
    background: #5588c7;
    text-decoration: none;
}

.at-footer .dropdown-menu {
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
    border: 0;
    border-radius: 4px;
    color: #fff;
}

.at-footer .dropdown-item {
    color: initial;
    width: auto;
    height: auto;
    text-align: left;
    justify-content: start;
}

.at-footer .dropdown-item > i {
    margin-right: 4px;
}

.at-footer .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.at-time-position {
    font-weight: bold;
}

.at-time-slider {
    height: 4px; /* slimmer when not hovered */
    background: linear-gradient(90deg, #e9ecef, #dee2e6);
    border-radius: 999px;
    overflow: hidden;
}

.at-time-slider:hover {
    transition: all 0.15s ease;
    height: 8px; /* grow when hovered */
    cursor: pointer;
}

.at-time-slider-value {
    height: 100%;
    background: linear-gradient(90deg, #3fa3ff, #007aff); /* playback progress gradient */
    width: 0;
}

/* Make gradient more visible and ensure it overrides generic rules */
.at-footer .at-time-slider > .at-time-slider-value {
    background-image: linear-gradient(90deg,
        #66ccff 0%,
        #3ea7ff 40%,
        #1f8fff 70%,
        #007aff 100%) !important;
}

.at-speed-value {
    font-size: 0.8rem;
    margin: 0 0.5em;
}

/* Hide "save as image" icon per request (logic kept) */
.at-player .at-save-image { display: none !important; }
/* utility: JS-controlled hiding without layout glitches */
.at-hide { display: none !important; }
.at-player button, .at-player a {
    cursor: pointer;
}
/* Distinct icon colors (inspired by legacy theme) */
.at-footer .icon-slider { color: #F64C85; }
.at-footer .icon-daojishi { color: #FFAC2D; }
.at-footer .icon-jiepaiqi { color: #ff3399; }
.at-footer .icon-Loop { color: #4CAF50; }
.at-footer .icon-image { color: #4745A1; }
.at-footer .icon-print { color: #25C6FC; }
.at-footer .icon-full { color: #77C34F; }
/* Increase specificity for print/full in case other rules override */
.at-footer .at-print > i { color: #25C6FC !important; }
.at-footer .at-fullscreen > i { color: #77C34F !important; }

/* Dim disabled controls consistently */
.at-player .disabled { opacity: .45; pointer-events: none; }

/* Shared pill control */
.at-pill {
    border: 1px solid rgba(0,0,0,.16);
    background: #fff;
    border-radius: 10px;
    padding: 4px 10px; /* vertical 4 for better centering of 18px icon in 28px pill */
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* controlled with fixed icon box */
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    vertical-align: middle;
    line-height: 24px;
    background-clip: padding-box;
    overflow: hidden; /* clip icon glyph overflows from iconfont */
}
.at-pill i.at-icon {
    width: 18px; height: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center; justify-content: center;
    line-height: 1; text-align: center;
    margin: 0; overflow: hidden;
}
.at-pill:hover { background: rgba(0,0,0,.06); }

/* Zoom dropdown styling */
.at-zoom { position: relative; }
.at-zoom .at-zoom-toggle { composes: at-pill; }
.at-zoom .at-zoom-toggle { /* fallback if composes not supported */
    border: 1px solid rgba(0,0,0,.16);
    background: #fff;
    border-radius: 10px;
    padding: 2px 10px;
    height: 28px;
    width: auto; /* override .at-footer button fixed width */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.at-zoom .at-zoom-toggle i { color: #007aff; font-size: 14px; }
.at-zoom .at-zoom-label { font-size: 13px; color: #333; min-width: 42px; text-align: center; }

.at-zoom .at-zoom-options { /* default, may be moved to body and turned fixed via JS */
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: none;
    min-width: 140px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    z-index: 20000; /* above footer */
}
.at-zoom .at-zoom-options .dropdown-item { display: block; padding: 6px 12px; color: #333; cursor: pointer; }
.at-zoom .at-zoom-options .dropdown-item:hover { background: rgba(0,122,255,.08); color: #007aff; }

/* Speed select as pill */
.at-player .at-speed-options {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid rgba(0,0,0,.14);
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="%23999" d="M4 6l4 4 4-4z"/></svg>') no-repeat right .35rem center/12px 12px;
    padding: 2px 22px 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    height: 30px;
    line-height: 26px;
    box-sizing: border-box;
    vertical-align: middle;
}
.at-player .at-speed-options:focus { outline: none; box-shadow: 0 0 0 3px rgba(13,110,253,.15); border-color: rgba(13,110,253,.3); }

/** Circular Progress Bar https://jsfiddle.net/bootstrapious/3xnomecr  **/
.progress {
    width: 28px;
    height: 28px;
    background: none;
    position: relative;
}

.progress::after {
    content: '';
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #eee;
    position: absolute;
    top: 0;
    left: 0;
}

.progress > span {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: absolute;
    top: 0;
    z-index: 1;
}

.progress .progress-left {
    left: 0;
}

.progress .progress-bar {
    width: 100%;
    height: 100%;
    background: none;
    position: absolute;
    top: 0;
    border: 3px solid #4972a1;
}

.progress .progress-left .progress-bar {
    left: 100%;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    border-left: 0;
    -webkit-transform-origin: center left;
    transform-origin: center left;
}

.progress .progress-right {
    right: 0;
}

.progress .progress-right .progress-bar {
    left: -100%;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    border-right: 0;
    -webkit-transform-origin: center right;
    transform-origin: center right;
}

.progress .progress-value {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 8px;
}

/* Responsive behavior: shrink gaps -> hide time -> hide side buttons */
@media screen and (max-width: 980px) {
  .at-player { gap: 4px; }
  .at-player > div { gap: 2px; }
  .at-player-right { gap: 6px; }
  .at-footer button { width: 34px; height: 34px; }
  .at-player { min-height: 52px; }
}
@media screen and (max-width: 660px) {
  /* hide time to free space */
  .at-player .at-time-position { display: none !important; }
}
@media screen and (max-width: 560px) {
  /* compact labels */
  .at-zoom .at-zoom-label, .at-speed .at-speed-label { display: none; }
}
/* @media screen and (max-width: 320px) {
  .at-player-left .at-speed, .at-player-left .at-zoom, .at-player-left .at-stave { display: none !important; }
} 
*/
/* progressively hide right-side buttons from the ends as space shrinks */
@media screen and (max-width: 640px) { .at-player .at-fullscreen { display: none !important; } }
@media screen and (max-width: 500px) { .at-player .at-print     { display: none !important; } }
@media screen and (max-width: 360px) { .at-player .at-loop      { display: none !important; } }
/* @media screen and (max-width: 220px) { .at-player .at-metronome { display: none !important; } }
@media screen and (max-width: 200px) { .at-player .at-count-in  { display: none !important; } }
@media screen and (max-width: 180px) { .at-player .dropdown-track { display: none !important; } } */

@media screen and (max-width: 1100px) {
    .at-footer * {
        font-size: 12px !important;
    }
    .at-logo img {
        height: 18px;
    }

    .at-sidebar {
        display: none;
    }

    .at-viewport {
        left: 0 !important;
    }
}

.at-menu {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    overflow: initial;
}

.at-menu .dropdown-toggle::after {
    display: none;
}

.at-waveform {
    position: relative;
    background: #f7f7f7;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.at-waveform > canvas {
    width: 100%;
    opacity: 0.5;
}

.at-waveform-cursor {
    position: absolute;
    top: 0; 
    left: 0;
    bottom: 0;
    width: 1px;
    background: rgba(64, 64, 255, 0.75);
}


.d-none {display: none;}

.editor-wrap {
    height: 20vh;
}
.editor-wrap > * {
    width: 90vw;
    height: 20vh;
}

.at-cursor-bar {
    /* Defines the color of the bar background when a bar is played */
    background: rgba(255, 242, 0, 0.25);
}

.at-selection div {
    /* Defines the color of the selection background */
    background: rgba(64, 64, 255, 0.2);
}

.at-cursor-beat {
    /* Defines the beat cursor */
    background: rgba(64, 64, 255, 0.75);
    width: 3px;
}

.at-highlight * {
    /* Defines the color of the music symbols when they are being played (svg) */
    fill: #0078ff;
    stroke: #0078ff;
}


.gtptab-2025-fullscreen {
    width: 100%;
    height: 100%;
    overflow-y: auto;
}
.at-speed { position: relative; }
.at-speed .at-speed-toggle { composes: at-pill; }
.at-speed .at-speed-toggle { /* fallback */
    border: 1px solid rgba(0,0,0,.16);
    background: #fff;
    border-radius: 10px;
    padding: 2px 10px;
    height: 28px;
    width: auto; /* override .at-footer button fixed width */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Layout: center play button, place track toggle near count-in */
.at-player { display: flex; align-items: center; position: relative; }
.at-player-left { display: flex; align-items: center; flex: 1 1 auto; order: 1; }
.dropdown-track { order: 2; margin: 0 8px; flex: 0 0 auto; }
.at-player-right { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; order: 3; margin-left: auto !important; gap: 8px; }
.at-player-right > * { flex: 0 0 auto; margin: 0; }
.at-player-right > *:last-child { margin-right: 0; }
.at-player-right .dropdown-track { order: 0; }
.at-player-right button { order: 1; }
.at-player .at-play-pause { position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; }
.at-speed .at-speed-toggle i { color: #ff3399; font-size: 14px; }
.at-speed .at-speed-label { font-size: 13px; color: #333; min-width: 42px; text-align: center; }
.at-footer .at-speed-toggle:hover { background: rgba(0,0,0,.06); }

.at-speed .at-speed-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: none;
    min-width: 140px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    z-index: 20000;
}
.at-speed .at-speed-menu .dropdown-item { display: block; padding: 6px 12px; color: #333; cursor: pointer; }
.at-speed .at-speed-menu .dropdown-item:hover { background: rgba(255,51,153,.08); color: #ff3399; }

/* Stave (五/六线谱) dropdown styling */
.at-stave { position: relative; }
.at-stave .at-stave-toggle { composes: at-pill; }
.at-stave .at-stave-toggle { /* fallback */
    border: 1px solid rgba(0,0,0,.16);
    background: #fff;
    border-radius: 10px;
    padding: 2px 10px;
    height: 28px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.at-stave .at-stave-toggle i { color: #316771; font-size: 14px; }
.at-stave .at-stave-label { font-size: 13px; color: #333; min-width: 52px; text-align: center; }
.at-footer .at-stave-toggle:hover { background: rgba(0,0,0,.06); }

.at-stave .at-stave-options {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: none;
    min-width: 160px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    z-index: 20000;
}
.at-stave .at-stave-options .dropdown-item { display:block; padding:6px 12px; color:#333; cursor:pointer; white-space:nowrap; }
.at-stave .at-stave-options .dropdown-item:hover { background: rgba(49,103,113,.08); color:#316771; }

/* Temporarily hide Stave toggle per request (logic retained) */
.at-player .at-stave { display: none !important; }
