html:has(.page-dance-looper) { scroll-behavior: auto; }
.page-dance-looper { background: #151715; }
.page-dance-looper .site-header {
  position: sticky;
  background: #181c17;
  color: var(--paper);
  border-color: #353b31;
}
.page-dance-looper .site-header :is(.tools-options, .language-options, .mobile-nav) {
  background: #222620;
  color: var(--paper);
  border-color: #353b31;
}
.page-dance-looper .site-header :is(.tools-options, .language-options) a:is(:hover, [aria-current]) {
  background: #353b31;
}
.page-dance-looper .mobile-nav :is(a, .tools-menu > summary) { border-color: #353b31; }
.page-dance-looper .site-header :focus-visible { outline-color: var(--lime); }
.dance-looper {
  --loop-bg: #151715;
  --loop-panel: #1c1f1b;
  --loop-inset: #222620;
  --loop-line: #353b31;
  --loop-text: #f5f5ed;
  --loop-muted: #bdc2b5;
  --loop-accent: #daf666;
  color: var(--loop-text);
  border-top: 5px solid #daf666;
  min-width: 0;
}
.dance-looper [hidden] { display: none; }
.looper-intro, .looper-workspace, .looper-info { width: min(840px, calc(100% - 24px)); margin-inline: auto; }
.looper-intro { position: relative; padding: 24px 0 34px; text-align: center; }
.looper-intro > p { margin-inline: auto; color: var(--loop-muted); font-size: 16px; }
.looper-intro > .looper-name { font-weight: 600; font-size: 14px; }
.looper-intro h1 { margin: 6px 0 10px; font: 700 clamp(24px, 5vw, 36px)/1.2 var(--sans); text-wrap: balance; }
.looper-sources { margin-top: 30px; text-align: left; }
.looper-source { position: relative; }
.looper-source label { display: block; margin-bottom: 5px; color: var(--loop-muted); font-size: 15px; }
.looper-library form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.looper-source input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid #ffffff45;
  border-radius: 8px;
  background: #242923;
  color: #f5f5ed;
  font-size: 17px;
  font-weight: 600;
}
.looper-source input::placeholder { color: #aaafa5; font-weight: 400; }
.looper-source-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dance-looper button, .looper-file, .looper-speed-input input {
  color: var(--loop-text);
  background: #2a3028;
  border: 1px solid #3d4638;
  border-radius: 8px;
  padding: 0 11px;
  min-height: 40px;
  font-size: 14px;
  touch-action: manipulation;
}
.dance-looper button, .looper-file { user-select: none; }
.looper-file {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}
.looper-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.looper-source-options button { background: transparent; border-color: #444c40; }
.looper-source button { inset-inline-start: 0; min-height: 0; padding: 0; border: 0; }
.dance-looper :focus-visible, .looper-file:has(input:focus-visible) {
  outline: 2px solid #daf666;
  outline-offset: 2px;
}
.looper-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.looper-workspace {
  margin-top: 13px;
  padding: 14px 14px 24px;
  background: var(--loop-panel);
  border-radius: 8px;
  box-shadow: 0 7px 18px #17192342;
}
.looper-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  overflow: hidden;
  background: #080908;
  border-radius: 6px;
}
.looper-player > *, .looper-player iframe { display: block; width: 100%; height: 100%; border: 0; }
.looper-player > * { position: absolute; inset: 0; }
.looper-player:has([data-bilibili]:not([hidden])) { aspect-ratio: 16 / 9; }
.looper-workspace:has([data-bilibili]:not([hidden])) :is(.looper-range, .looper-controls) { display: none; }
.looper-player [data-empty] { display: grid; place-items: center; margin: 0; color: var(--loop-muted); font-size: 16px; font-weight: 600; }
.looper-player [data-empty][hidden] { display: none; }
.looper-player video { object-fit: contain; }
.looper-player video.is-mirrored { transform: scaleX(-1); }
.looper-status { font-size: 13px; color: var(--loop-muted); }
.looper-status p { margin: 4px 0 0; }
.looper-status p:empty { margin: 0; }
.looper-status a { display: inline-flex; align-items: center; min-height: 36px; text-decoration: underline; }

/* Compact 2-row dock (Row 1: A-B range slider, Row 2: unified action bar + view modes) */
.looper-dock-zone { position: relative; min-width: 0; }
.looper-peek-bar { display: none; }
.looper-dock-panel { margin-top: 6px; min-width: 0; }
.looper-bar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; flex-wrap: wrap; margin-top: 4px; min-width: 0;
}
.looper-controls { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; }
.looper-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; flex-wrap: wrap; min-width: 0;
}
.looper-bar-left, .looper-bar-center, .looper-bar-right {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0;
}
.looper-bar-row button,
.looper-pop > summary {
  min-height: 32px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; line-height: 1; white-space: nowrap;
}
.looper-bar button[data-skip] { padding-inline: 7px; font-variant-numeric: tabular-nums; }
.looper-bar button[data-jump] { padding-inline: 7px; font-size: 13px; }
.looper-play-compact {
  width: 34px; min-width: 34px; height: 32px; padding: 0 !important;
  border-radius: 50% !important; background: var(--loop-accent) !important;
  border-color: var(--loop-accent) !important; color: #1b2411 !important;
  display: inline-grid; place-items: center; font-size: 13px !important; font-weight: 700;
}
.looper-clock {
  display: inline-flex; align-items: center; padding-inline: 4px;
  color: var(--loop-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.looper-clock-sep { margin-inline: 2px; opacity: .55; }
.looper-bar button[data-mark-a],
.looper-bar button[data-mark-b] {
  background: #2f3828; border-color: #46543b; font-weight: 600;
}
.looper-loop-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--loop-accent) !important; border-color: var(--loop-accent) !important;
  color: #1b2411 !important; font-weight: 700;
}
.looper-loop-pill[aria-pressed="true"] {
  background: #45592b !important; border-color: var(--loop-accent) !important; color: #f6fae4 !important;
}
.looper-bar button[data-mirror][aria-pressed="true"],
.looper-speed-presets button[aria-pressed="true"],
.looper-view-modes button[aria-pressed="true"],
.looper-pop-actions button[data-zoom][aria-pressed="true"] {
  background: #3b4928; border-color: var(--loop-accent); color: #f6fae4; font-weight: 600;
}

/* Upward compact popovers (Fine-tune & Speed) */
.looper-pop { position: relative; }
.looper-pop > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 3px;
  background: #2a3028; border: 1px solid #3d4638; color: var(--loop-text);
  cursor: pointer; user-select: none; font-variant-numeric: tabular-nums;
}
.looper-pop > summary::-webkit-details-marker { display: none; }
.looper-pop[open] > summary { border-color: var(--loop-accent); background: #333c2b; }
.looper-controls:disabled .looper-pop > summary { pointer-events: none; opacity: .62; }
.looper-pop-panel {
  position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 30;
  min-width: 198px; padding: 8px;
  border: 1px solid #444f3d; border-radius: 10px;
  background: #1a1e19f7; box-shadow: 0 10px 28px #00000080; backdrop-filter: blur(12px);
  display: grid; gap: 6px;
}
[data-ab-pop] .looper-pop-panel { left: 50%; right: auto; transform: translateX(-50%); }
.looper-pop-row {
  display: grid; grid-template-columns: 20px 1fr 1fr; align-items: center; gap: 4px;
}
.looper-pop-row > span {
  font-size: 11px; font-weight: 700; color: var(--loop-accent); text-align: center;
}
.looper-pop-row button { min-height: 30px; padding: 0 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.looper-pop-actions {
  display: flex; gap: 4px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid #30372d;
}
.looper-pop-actions button { flex: 1 1 auto; min-height: 30px; padding: 0 7px; font-size: 11px; }
.looper-pop-actions button[data-clear-ab] { background: transparent; border-color: #444c40; color: var(--loop-muted); }
.looper-speed-panel { min-width: 214px; }
.looper-speed-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.looper-speed-presets button { min-height: 30px; padding: 0 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.looper-speed-fine {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding-top: 6px; border-top: 1px solid #30372d;
}
.looper-speed-fine button { min-width: 34px; min-height: 32px; padding: 0; font-size: 15px; }
.looper-speed-input { position: relative; display: inline-flex; align-items: center; }
.looper-speed-input input {
  appearance: textfield; min-height: 32px; width: 64px;
  padding: 0 18px 0 6px; background: var(--loop-inset); text-align: center; font-size: 14px;
}
.looper-speed-input input::-webkit-inner-spin-button,
.looper-speed-input input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.looper-speed-input span { position: absolute; right: 7px; color: var(--loop-muted); pointer-events: none; font-size: 13px; }
.looper-controls :disabled, .looper-library :disabled { cursor: default; opacity: .62; }

.looper-range {
  position: relative;
  height: 48px;
  margin: 2px 4px 0;
  --handle-width: 18px;
}
.looper-rail {
  position: absolute;
  top: 22px;
  inset-inline: calc(var(--handle-width) / 2);
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(to right, #545d4c var(--loop-position, 0%), #353d32 0);
  pointer-events: none;
}
.looper-rail span {
  position: absolute;
  inset-block: 0;
  left: var(--loop-start, 0%);
  right: calc(100% - var(--loop-end, 100%));
  border-radius: inherit;
  background: linear-gradient(90deg,#b2cd5d,var(--loop-accent));
}
.looper-range:not([data-marked]) .looper-rail span { opacity: .24; }
.looper-dock-panel:has(.looper-controls:not(:disabled)) .looper-rail::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--loop-position, 0%);
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: #fcfdf6;
  box-shadow: 0 0 0 2px #1c2019;
  transform: translate(-50%, -50%);
}
.looper-bound, .looper-scrub { position: absolute; inset-inline: 0; top: 5px; pointer-events: none; }
.looper-range input { appearance: none; display: block; width: 100%; height: 38px; margin: 0; background: transparent; }
.looper-range input:focus-visible { outline: none; }
.looper-range input:focus-visible:not(:active)::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--loop-inset), 0 0 0 4px var(--loop-accent); }
.looper-range input:focus-visible:not(:active)::-moz-range-thumb { box-shadow: 0 0 0 2px var(--loop-inset), 0 0 0 4px var(--loop-accent); }
.looper-scrub input { pointer-events: auto; cursor: pointer; }
.looper-scrub input::-webkit-slider-thumb { appearance: none; width: var(--handle-width); height: 18px; border-radius: 5px; background: transparent; }
.looper-scrub input::-moz-range-thumb { width: var(--handle-width); height: 18px; border: 0; border-radius: 5px; background: transparent; }
.looper-bound input {
  pointer-events: none;
  --mark: radial-gradient(circle,var(--loop-accent) 0 4.5px,#1c2019 5px 6px,transparent 6.5px) center 3px / 13px 13px no-repeat,
    linear-gradient(var(--loop-accent),var(--loop-accent)) center 13px / 2px 8px no-repeat;
}
.looper-bound-b input {
  --mark: radial-gradient(circle,var(--loop-accent) 0 4.5px,#1c2019 5px 6px,transparent 6.5px) center 16px / 13px 13px no-repeat,
    linear-gradient(var(--loop-accent),var(--loop-accent)) center 11px / 2px 8px no-repeat;
}
.looper-bound input::-webkit-slider-thumb {
  appearance: none; width: var(--handle-width); height: 32px; border-radius: 5px; pointer-events: auto; cursor: ew-resize; background: var(--mark);
}
.looper-bound input::-moz-range-thumb {
  width: var(--handle-width); height: 32px; border: 0; border-radius: 5px; pointer-events: auto; cursor: ew-resize; background: var(--mark);
}
.looper-range-label {
  position: absolute; pointer-events: none; padding: 1px 5px; border-radius: 4px;
  background: #272d24e6; color: var(--loop-text); font-size: 10px;
  font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap;
}
.looper-range-label-a { left: clamp(0px, calc(var(--loop-start, 0%) - 26px), calc(100% - 64px)); top: 0; }
.looper-range-label-b { left: clamp(0px, calc(var(--loop-end, 100%) - 26px), calc(100% - 64px)); bottom: 0; }
.dance-looper [data-zoom]:disabled { opacity: .45; }
.looper-library { margin: 14px 4px 0; padding: 14px; border: 1px solid var(--loop-line); border-radius: 8px; background: var(--loop-inset); }
.looper-library h2 { margin: 0 0 6px; color: var(--loop-muted); font: 700 13px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .05em; }
.looper-library input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #454e41;
  border-radius: 8px;
  background: #2a2e28;
  color: var(--loop-text);
  font-size: 16px;
}
.looper-library input::placeholder { color: #bdc2b5; }
.looper-library [data-save] { min-width: 66px; font-weight: 600; }
.looper-library p { font-size: 13px; color: var(--loop-muted); margin: 6px 0 0; }
.looper-library [data-empty-saved], .looper-library ul:not(:empty) { margin-top: 7px; border-top: 1px solid var(--loop-line); }
.looper-library [data-empty-saved] { text-align: center; padding: 20px 6px 9px; }
.looper-library [data-save-status]:empty { display: none; }
.looper-library ul { list-style: none; margin: 0; padding: 0; }
.looper-library li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; padding-inline: 2px; }
.looper-library li + li { border-top: 1px solid var(--loop-line); }
.looper-library .looper-row-button { min-width: 0; padding: 8px; border: 0; background: transparent; text-align: left; line-height: 1.35; }
.looper-row-button span:not(.icon) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.looper-library .looper-row-button[aria-current="true"] { color: var(--loop-accent); background: #343d29; }
.looper-library .looper-folder-row .looper-row-button { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.looper-library small { display: block; color: var(--loop-muted); }
.looper-info { margin-top: 42px; padding: 20px 0 58px; border-top: 1px solid #444c40; }
.looper-info p { margin: 12px 0 0; color: var(--loop-muted); }
.looper-info h2 { margin: 26px 0 8px; font: 700 clamp(19px, 4vw, 23px)/1.35 var(--sans); }
.looper-info h2:first-child { margin-top: 0; }
.looper-info li { margin-block: 5px; }
.looper-info dl { margin: 0; max-width: 460px; }
.looper-info dl div { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: 10px; padding-block: 5px; }
.looper-info dd { margin: 0; color: var(--loop-muted); }
.looper-info a { text-decoration: underline; }
@media (hover: hover) and (pointer: fine) {
  .dance-looper button:enabled:hover, .looper-file:hover, .looper-pop > summary:hover { filter: brightness(1.12); }
}
.dance-looper button:enabled:active, .looper-file:active { filter: brightness(.92); }
@media (max-width: 480px) {
  .looper-intro { padding: 20px 0 18px; }
  .looper-sources { margin-top: 19px; }
  .looper-source input { min-height: 46px; }
  .looper-workspace { margin-top: 8px; padding: 11px 11px 16px; }
  .looper-file, .looper-source-options button { min-height: 44px; }
  .looper-library { margin-inline: 0; }
  .looper-range { margin-inline: 2px; }
}

.dance-looper [data-save] { background: var(--loop-accent); color: #1b2411; }
.looper-dock-panel textarea {
  width: 100%; resize: vertical; padding: 8px 10px; min-height: 54px; margin: 8px 0 0;
  border: 1px solid #454e41; border-radius: 8px; background: #252b24; color: var(--loop-text); font: inherit;
}
.looper-save-summary, .looper-library-tools { display: flex; align-items: center; gap: 5px; }
.looper-save-summary { margin-top: 5px; }
.looper-save-summary p { margin: 0; }
.looper-library-tools { justify-content: flex-end; min-height: 38px; margin-top: 3px; }
.looper-folder-heading { display: flex; align-items: center; min-width: 0; margin-inline-end: auto; }
.looper-folder-heading strong { overflow-wrap: anywhere; }
.looper-library .looper-icon-button:not([hidden]) {
  display: inline-grid; place-items: center; width: 36px; min-height: 36px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--loop-muted);
  cursor: pointer; text-decoration: none; font-size: 15px;
}
.looper-library .looper-icon-button:hover, .looper-menu[open] > .looper-icon-button { background: #343b30; color: var(--loop-text); }
.looper-menu { position: relative; }
.looper-menu > summary { list-style: none; }
.looper-menu > summary::-webkit-details-marker { display: none; }
.looper-menu-panel {
  position: absolute; z-index: 5; inset-inline-end: 0; top: calc(100% + 4px); min-width: 165px;
  padding: 4px; border: 1px solid #424b3d; border-radius: 8px; background: #272d24; box-shadow: 0 8px 20px #0006;
}
.looper-menu-panel :is(button, .looper-file, .looper-move-menu summary) {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 37px; justify-content: flex-start;
  padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--loop-text);
  cursor: pointer; text-align: left; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere;
}
.looper-menu-panel :is(button, .looper-file, .looper-move-menu summary):hover { background: #373e32; }
.looper-menu-panel .looper-move-menu summary::after { content: '›'; margin-inline-start: auto; color: var(--loop-muted); }
.looper-menu-panel .looper-move-menu button { padding-inline-start: 16px; }
.looper-menu-panel .looper-remove { color: #f5ada3; }
.looper-library .looper-sort-row { grid-template-columns: minmax(0, 1fr) repeat(2, auto); cursor: grab; }
.looper-sort-row .looper-row-button { opacity: 1; }
.looper-library [data-folder-form] { grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; margin-top: 6px; }
.looper-library [data-share-url] { margin-top: 6px; }
@media (max-width: 480px) {
  .looper-library .looper-icon-button:not([hidden]) { width: 40px; min-height: 40px; }
}

.looper-faqs { margin-top: 26px; border-top: 1px solid #353b31; }
.looper-faq { border-bottom: 1px solid #353b31; padding-block: 12px; }
.looper-faq summary { cursor: pointer; font-weight: 600; color: var(--loop-text); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.looper-faq summary::-webkit-details-marker { display: none; }
.looper-faq summary::after { content: '+'; color: var(--loop-accent); font-size: 18px; flex-shrink: 0; }
.looper-faq[open] summary::after { content: '−'; }
.looper-faq p { margin: 8px 0 2px; font-size: 14px; line-height: 1.65; color: var(--loop-muted); }
.looper-app-upsell {
  margin-top: 28px; padding: 20px; border: 1px solid #455234; border-radius: 10px;
  background: linear-gradient(135deg, #21281c, #1a1f18);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.looper-app-upsell h2 { margin: 0 0 6px; font-size: 18px; color: var(--loop-text); }
.looper-app-upsell p { margin: 0; font-size: 14px; color: var(--loop-muted); max-width: 44ch; }
.looper-app-upsell .button { flex-shrink: 0; text-decoration: none; min-height: 44px; padding: 10px 20px; }

/* Bilibili-style view modes & hover-floating immersive dock */
body.looper-viewport-lock { overflow: hidden; }
.looper-view-modes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex-shrink: 0; margin-left: auto; }

/* Wide / Theater mode */
.dance-looper.is-wide .looper-workspace { width: min(1240px, calc(100% - 24px)); }
.dance-looper.is-wide .looper-player { max-height: 76vh; }

/* Web Fullscreen & Native Fullscreen: 100% full-bleed video + hover-floating 2-row bottom dock */
.dance-looper.is-webfull .looper-workspace,
.looper-workspace:fullscreen,
.looper-workspace:-webkit-full-screen {
  position: fixed; inset: 0; z-index: 95;
  width: 100vw; max-width: none; height: 100dvh;
  margin: 0; padding: 0; border-radius: 0;
  background: #080908; overflow: hidden;
}
.looper-workspace.is-immersive .looper-player {
  position: absolute; inset: 0; width: 100%; height: 100%;
  min-height: 0; aspect-ratio: auto; max-height: none; border-radius: 0;
}
.looper-workspace.is-immersive .looper-library { display: none; }
.looper-workspace.is-immersive .looper-dock-zone {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column-reverse;
}
.looper-workspace.is-immersive .looper-peek-bar {
  display: grid; place-items: center; width: 100%; height: 8px;
  min-height: 0; padding: 0; border: 0; border-radius: 0;
  background: #0a0c0af2; cursor: pointer; flex-shrink: 0;
}
.looper-workspace.is-immersive .looper-peek-bar span {
  display: block; width: 46px; height: 4px; border-radius: 99px;
  background: #daf66675; transition: width .18s ease, background .18s ease;
}
.looper-workspace.is-immersive .looper-peek-bar:hover span {
  width: 68px; background: var(--loop-accent);
}
.looper-workspace.is-immersive .looper-dock-panel {
  margin: 0; padding: 14px 16px 4px;
  background: linear-gradient(to top, #0a0c0af2 68%, #0a0c0ab3 90%, transparent);
  opacity: 1; transform: translateY(0); overflow: visible;
  transition: opacity .2s ease, transform .2s ease;
}
.looper-workspace.is-immersive .looper-dock-zone.is-collapsed .looper-peek-bar {
  height: 22px; background: linear-gradient(to top, #0a0c0a88, transparent);
}
.looper-workspace.is-immersive .looper-dock-zone.is-collapsed .looper-peek-bar span {
  background: #daf666b8; box-shadow: 0 1px 6px #000a;
}
.looper-workspace.is-immersive .looper-dock-zone.is-collapsed .looper-dock-panel {
  opacity: 0; transform: translateY(100%); pointer-events: none;
  max-height: 0; padding-block: 0; overflow: hidden;
}
.looper-workspace.is-immersive .looper-range { height: 44px; margin: 0 2px; }
.looper-workspace.is-immersive .looper-rail { top: 20px; }
.looper-workspace.is-immersive .looper-bound,
.looper-workspace.is-immersive .looper-scrub { top: 3px; }
.looper-workspace.is-immersive .looper-bar-row { margin-top: 2px; }
.looper-workspace.is-immersive .looper-bar-row button,
.looper-workspace.is-immersive .looper-pop > summary {
  background: #1d221cd9; border-color: #3d4739cc; backdrop-filter: blur(6px);
}
.looper-workspace.is-immersive .looper-bar button[data-mark-a],
.looper-workspace.is-immersive .looper-bar button[data-mark-b] {
  background: #2c3625e0; border-color: #4b5a3d;
}
.looper-workspace.is-immersive .looper-bar button[data-mirror][aria-pressed="true"],
.looper-workspace.is-immersive .looper-speed-presets button[aria-pressed="true"],
.looper-workspace.is-immersive .looper-view-modes button[aria-pressed="true"] {
  background: #3b4928eb; border-color: var(--loop-accent);
}

@media (max-width: 520px) {
  .looper-bar-row { gap: 4px; }
  .looper-bar { gap: 4px; }
  .looper-bar-left, .looper-bar-center, .looper-bar-right { gap: 3px; }
  .looper-bar-row button,
  .looper-pop > summary { min-height: 32px; padding: 0 7px; font-size: 11px; }
  .looper-play-compact { width: 32px; min-width: 32px; height: 32px; }
  .looper-clock { font-size: 11px; padding-inline: 2px; }
  .looper-view-modes { width: 100%; justify-content: flex-end; }
  [data-ab-pop] .looper-pop-panel { left: 0; right: auto; transform: none; max-width: calc(100vw - 24px); }
  [data-speed-pop] .looper-pop-panel { right: 0; left: auto; transform: none; max-width: calc(100vw - 24px); }
  .looper-workspace.is-immersive .looper-dock-panel { padding: 10px 8px 4px; }
}
