.bgm-player[hidden], .bgm-player button[hidden] { display: none; }
.bgm-player {
    position: fixed; z-index: 50; inset: auto 0 0;
    color: #163630; background: #f2f8f6;
    border-top: 1px solid #bdd5cf;
    padding-bottom: env(safe-area-inset-bottom);
}
body.with-bgm { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
.bgm-inner {
    display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(85px, .8fr) auto;
    align-items: center; gap: 12px; min-height: 56px;
    max-width: 1120px; margin: auto; padding: 7px 16px;
}
.bgm-details { min-width: 0; line-height: 1.35; }
.bgm-details strong, .bgm-details a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgm-details strong { font-size: 14px; }
.bgm-details a { color: #486a61; font-size: 12px; }
.bgm-actions, .bgm-progress { display: flex; align-items: center; gap: 5px; }
.bgm-actions button {
    display: inline-grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0;
    border: 1px solid transparent; border-radius: 5px; color: #1d5146; background: transparent; cursor: pointer;
}
.bgm-actions button:hover, .bgm-actions button[aria-pressed="true"] { border-color: #9cbfb4; background: #dceee7; }
.bgm-actions button[data-bgm-action="play"], .bgm-actions button[data-bgm-action="pause"] {
    background: #236454; color: #fff;
}
.bgm-player :focus-visible { outline: 2px solid #246c5c; outline-offset: 2px; }
.bgm-progress input[type=range] { width: 100%; min-width: 0; padding: 0; accent-color: #2b7360; }
.bgm-progress span, .bgm-status { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bgm-progress span { min-width: 3ch; }
.bgm-status { min-width: 65px; color: #486a61; text-align: right; }
@media (max-width: 660px) {
    body.with-bgm { padding-bottom: calc(109px + env(safe-area-inset-bottom)); }
    .bgm-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 9px; padding: 8px 12px; }
    .bgm-details { grid-column: 1; }
    .bgm-actions { grid-column: 2; grid-row: 2; gap: 2px; }
    .bgm-actions button { width: 34px; height: 38px; }
    .bgm-progress { grid-column: 1; grid-row: 2; }
    .bgm-status { grid-column: 2; grid-row: 1; }
}
