:root {
  color-scheme: light;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-2: #f0f1f5;
  --surface-3: #e5e6eb;
  --text: #1c1b1f;
  --muted: #6f727c;
  --outline: #c6c7cf;
  --primary: #7b5000;
  --primary-ink: #ffffff;
  --primary-soft: #ffdea4;
  --primary-soft-ink: #271900;
  --secondary-soft: #e9e1cf;
  --error: #ba1a1a;
  --card-note: #d92d20;
  --nav-height: 76px;
  --appbar-height: 64px;
  --viewport-height: 100vh;
  --radius: 18px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

@supports (height: 100dvh) {
  :root { --viewport-height: 100dvh; }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101113;
  --surface: #191a1e;
  --surface-2: #23252a;
  --surface-3: #31333a;
  --text: #f1f0f4;
  --muted: #b8bac4;
  --outline: #474a53;
  --primary: #ffca45;
  --primary-ink: #402d00;
  --primary-soft: #5e4300;
  --primary-soft-ink: #ffdfa0;
  --secondary-soft: #464238;
  --error: #ffb4ab;
  --card-note: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: min(320px, 100%); line-height: 1.4; overscroll-behavior: none; }
button, input, output { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
::selection { background: var(--primary-soft); color: var(--primary-soft-ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input, textarea { caret-color: var(--primary); }
svg { display: block; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.receiver-shell { width: min(100%, 780px); min-height: var(--viewport-height); margin: 0 auto; background: var(--bg); }
.receiver-main { min-height: calc(var(--viewport-height) - var(--nav-height)); padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); }
.receiver-main.has-appbar { padding-top: var(--appbar-height); }
.receiver-subpage .receiver-main { padding-bottom: 28px; }

.receiver-appbar { position: fixed; z-index: 30; top: 0; left: 50%; display: grid; grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr); align-items: center; width: min(100%, 780px); height: var(--appbar-height); padding: 0 16px; transform: translateX(-50%); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); }
.receiver-appbar h1 { grid-column: 2; margin: 0; font-size: 22px; font-weight: 650; }
.receiver-appbar > button { grid-column: 1; justify-self: start; }
.receiver-appbar-actions { grid-column: 3; justify-self: end; }
.receiver-appbar button { border: 0; background: transparent; min-width: 42px; min-height: 42px; border-radius: 21px; display: inline-grid; place-items: center; }
.receiver-appbar button:hover { background: var(--surface-2); }

.receiver-nav { position: fixed; z-index: 40; left: 50%; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 780px); min-height: calc(var(--nav-height) + env(safe-area-inset-bottom)); padding: 8px 10px env(safe-area-inset-bottom); transform: translateX(-50%); background: color-mix(in srgb, var(--surface) 95%, transparent); border-top: 1px solid color-mix(in srgb, var(--outline) 60%, transparent); backdrop-filter: blur(18px); }
.receiver-nav-item { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; text-decoration: none; }
.receiver-nav-icon { display: grid; place-items: center; width: 64px; height: 34px; border-radius: 18px; transition: background 140ms ease, color 140ms ease; }
.receiver-nav-icon svg { width: 23px; height: 23px; }
.receiver-nav-item.is-active { color: var(--text); font-weight: 650; }
.receiver-nav-item.is-active .receiver-nav-icon { color: var(--primary-soft-ink); background: var(--primary-soft); }
.receiver-nav-item.is-disabled { color: color-mix(in srgb, var(--muted) 48%, transparent); cursor: not-allowed; }
.receiver-nav-item.is-disabled .receiver-nav-icon { background: transparent; color: inherit; }

.receiver-empty, .receiver-loading, .receiver-startup { display: flex; min-height: calc(var(--viewport-height) - var(--nav-height)); padding: 36px 24px; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.receiver-empty-icon, .receiver-startup-icon { display: grid; place-items: center; width: 68px; height: 68px; color: var(--muted); font-size: 52px; }
.receiver-empty-icon svg { width: 54px; height: 54px; stroke-width: 1.6; }
.receiver-startup-icon { color: var(--primary); }
.receiver-empty h2, .receiver-loading h2 { margin: 14px 0 4px; font-size: 22px; font-weight: 560; }
.receiver-empty p, .receiver-loading p, .receiver-startup p { margin: 5px 0 18px; color: var(--muted); }
.receiver-error .receiver-empty-icon, .receiver-source-error { color: var(--error); }

.receiver-spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: receiver-spin 750ms linear infinite; }
.receiver-spinner.is-small { width: 18px; height: 18px; border-width: 2px; }
@keyframes receiver-spin { to { transform: rotate(360deg); } }
.receiver-linear-progress { position: relative; width: 100%; height: 3px; overflow: hidden; background: var(--surface-3); }
.receiver-linear-progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--primary); animation: receiver-progress 1.1s ease-in-out infinite; }
@keyframes receiver-progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(390%); } }

.receiver-filled, .receiver-outlined { min-height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 650; }
.receiver-filled { border: 0; background: var(--primary); color: var(--primary-ink); }
.receiver-filled.is-danger { background: var(--error); color: var(--bg); }
.receiver-outlined { border: 1px solid var(--outline); background: transparent; }
.receiver-filled:disabled, .receiver-outlined:disabled { opacity: .45; }

.receiver-player { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; min-width: 0; height: calc(var(--viewport-height) - var(--nav-height)); overflow: hidden; background: var(--bg); }
.receiver-player > * { min-width: 0; }
.receiver-player-heading { padding: 20px 20px 8px; text-align: center; }
.receiver-player-heading h2 { margin: 0; color: var(--primary); font-size: clamp(24px, 5vw, 32px); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receiver-player-heading h2.is-wrapped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-height: 2.4em; white-space: normal; overflow-wrap: anywhere; }
.receiver-player-heading p { margin: 5px 0 0; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.receiver-player-identity { position: relative; width: min(100%, 540px); min-height: 64px; margin: 0 auto; padding-inline: 72px; }
.receiver-card-split-warning { position: absolute; right: 0; bottom: 0; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 28px; color: var(--primary); }
.receiver-card-split-warning[hidden] { display: none; }
.receiver-card-split-warning svg { width: 24px; height: 24px; }
.receiver-player-identity .receiver-card-split-warning { top: 0; bottom: auto; width: 64px; height: 64px; }
.receiver-player-identity .receiver-card-split-warning svg { width: 64px; height: 64px; }
.receiver-card-split-warning.is-inline { position: static; flex-shrink: 0; }
.receiver-card-annotation { position: relative; width: min(100%, 540px); margin: 3px auto 0; text-align: center; }
.receiver-card-note { display: inline-block; max-width: 100%; min-height: 28px; padding: 3px 4px; border: 0; border-radius: 2px; background: transparent; color: var(--card-note); font-size: 18px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; text-align: center; }
.receiver-card-note:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.receiver-card-note:disabled { cursor: not-allowed; opacity: .5; }
.receiver-card-annotation.is-standalone { padding-inline: 30px; }
.receiver-card-annotation.is-standalone .receiver-card-split-warning { top: 0; bottom: auto; }
.receiver-card-annotation-tools { margin-top: 8px; }
.receiver-annotation-button { display: inline-flex; min-width: 42px; min-height: 36px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid var(--outline); border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; }
.receiver-annotation-button svg { width: 17px; height: 17px; }
.receiver-annotation-button:hover:not(:disabled) { background: var(--surface-2); }
.receiver-annotation-button:disabled { cursor: not-allowed; opacity: .5; }
.receiver-annotation-button.is-primary { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.receiver-card-note-editor { position: fixed; z-index: 110; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .64); }
.receiver-card-note-editor[hidden] { display: none; }
.receiver-card-note-dialog { width: min(100%, 420px); padding: 22px; border: 1px solid var(--outline); border-radius: 8px; background: var(--surface); box-shadow: 0 24px 72px rgba(0, 0, 0, .34); }
.receiver-card-note-dialog h2 { margin: 0 0 14px; font-size: 18px; }
.receiver-card-note-editor textarea, .receiver-mark-recovery-form input { width: 100%; min-height: 66px; resize: vertical; padding: 9px 11px; border: 1px solid var(--outline); border-radius: 8px; outline: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.receiver-card-note-editor textarea:focus, .receiver-mark-recovery-form input:focus { border-color: var(--primary); }
.receiver-card-note-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.receiver-card-note-footer > span { display: flex; gap: 6px; }
.receiver-card-note-footer .receiver-annotation-button { min-height: 32px; }
.receiver-lyrics { position: relative; min-height: 0; padding: calc(50% - 30px) 14px; overflow: auto; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%); }
.receiver-lyrics::-webkit-scrollbar { display: none; }
.receiver-lyric-row { display: block; width: 100%; min-width: 0; overflow-wrap: anywhere; min-height: max(30px, calc(var(--lyric-font-size, 17px) + var(--lyric-line-spacing, 17px))); margin: 0; padding: 3px 8px; border: 0; background: transparent; color: var(--muted); font-size: var(--lyric-font-size, 17px); line-height: 1.12; text-align: center; transition: color 130ms ease, font-weight 130ms ease, opacity 130ms ease; }
.receiver-lyric-row:not(.is-active) { opacity: .88; }
.receiver-lyric-row.is-active { color: var(--primary); font-weight: 760; opacity: 1; }
.receiver-lyric-row:disabled { cursor: default; }
.receiver-lyric-text { display: inline; }
.receiver-lyric-word { color: inherit; }
.receiver-lyric-row.is-active .receiver-lyric-word { color: transparent; background: linear-gradient(90deg, var(--primary) 0 var(--word-progress, 0%), var(--muted) var(--word-progress, 0%) 100%); background-clip: text; -webkit-background-clip: text; }
.receiver-no-lyrics { display: grid; min-height: 100%; place-items: center; color: var(--muted); }

.receiver-player-controls { position: relative; z-index: 4; padding: 7px 14px 10px; border-top: 1px solid var(--outline); background: var(--bg); }
.receiver-utility-row { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.receiver-utility-spacer { flex: 1; }
.receiver-mini-button { min-width: 46px; height: 30px; padding: 0 9px; border: 1px solid var(--outline); border-radius: 6px; background: transparent; font-size: 12px; font-weight: 650; }
.receiver-mini-button[aria-pressed="true"], .receiver-mini-button:active { border-color: var(--primary); color: var(--primary); }
.receiver-card-mark { flex-shrink: 0; }
.receiver-mini-button:disabled { cursor: not-allowed; opacity: .5; }
.receiver-mini-button[aria-expanded="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-soft-ink); }
.receiver-mini-button.icon-only { min-width: 38px; font-size: 17px; }
.receiver-control-overlays { position: static; pointer-events: none; }
.receiver-control-panel { position: absolute; z-index: 8; right: 14px; bottom: calc(100% + 8px); padding: 10px; border: 1px solid var(--outline); border-radius: 10px; background: var(--surface-2); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); pointer-events: auto; }
.receiver-control-panel[hidden] { display: none !important; }
.receiver-control-panel.is-slider { left: 14px; right: auto; display: flex; width: 72px; height: 128px; flex-direction: column; align-items: center; padding: 7px 6px 5px; }
.receiver-control-panel.is-slider.is-right { left: auto; right: 14px; }
.receiver-control-panel.is-slider label { display: block; flex: 0 0 auto; margin-bottom: 2px; color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; }
.receiver-control-panel.is-slider input[type="range"] { position: absolute; left: 50%; top: 73px; width: 94px; height: 32px; margin: 0; transform: translate(-50%, -50%) rotate(-90deg); writing-mode: horizontal-tb; direction: ltr; touch-action: none; accent-color: var(--primary); }
.receiver-control-panel.is-vocal input[type="range"] { width: 100%; accent-color: var(--primary); }
.receiver-control-panel.is-quality { display: grid; gap: 5px; width: 92px; }
.receiver-control-panel.is-quality button { min-height: 34px; border: 1px solid var(--outline); border-radius: 6px; background: transparent; font-size: 11px; }
.receiver-control-panel.is-quality button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-soft-ink); }
.receiver-control-panel.is-vocal { width: min(320px, calc(100vw - 28px)); }
.receiver-vocal-head, .receiver-vocal-labels { display: flex; align-items: center; justify-content: space-between; }
.receiver-vocal-head { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.receiver-vocal-labels { font-size: 10px; }
.receiver-control-panel.is-vocal small { display: block; margin-top: 5px; color: var(--muted); }
.receiver-toggle { position: relative; display: inline-flex; }
.receiver-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.receiver-toggle > span { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--surface-3); transition: background 150ms ease; }
.receiver-toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 150ms ease, background 150ms ease; }
.receiver-toggle input:checked + span { background: var(--primary); }
.receiver-toggle input:checked + span::after { transform: translateX(16px); background: var(--primary-ink); }
.receiver-toggle input:disabled + span { opacity: .45; }
.receiver-progress-wrap { position: relative; height: 20px; }
.receiver-progress-wrap input { width: 100%; height: 20px; margin: 0; accent-color: var(--primary); touch-action: pan-y; }
.receiver-chorus-marker { position: absolute; z-index: 1; top: 5px; width: 10px; height: 10px; padding: 0; transform: translateX(-50%); border: 1px solid var(--primary-ink); border-radius: 50%; background: #72dbe4; }
.receiver-time-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.receiver-transport-grid { display: grid; grid-template-columns: 1fr 78px 1fr; align-items: end; gap: 10px; margin-top: 5px; }
.receiver-key-controls { display: grid; width: min(100%, 260px); grid-template-columns: repeat(3, minmax(46px, 1fr)); gap: 5px; }
.receiver-key-controls button:nth-child(4) { grid-column: 1; min-height: 40px; }
.receiver-key-controls button:nth-child(5) { grid-column: 3; min-height: 40px; }
.receiver-key-controls button, .receiver-rate-controls button { min-height: 29px; padding: 0 5px; border: 1px solid var(--outline); border-radius: 6px; background: transparent; font-size: 12px; font-weight: 650; }
.receiver-key-controls button.active { border-color: var(--primary); color: var(--primary); }
.receiver-play-button { display: flex; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 9px; background: var(--primary); color: var(--primary-ink); font-size: 11px; font-weight: 750; }
.receiver-play-button svg { width: 21px; height: 21px; }
.receiver-rate-controls { position: relative; display: grid; grid-template-columns: minmax(58px, 88px) minmax(126px, 1fr); align-items: end; gap: 6px; padding-left: clamp(32px, 15.5%, 50px); font-size: 12px; }
.receiver-volume-control { position: absolute; top: -33px; right: 0; width: min(148px, 58%); height: 14px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.receiver-speed-controls { display: grid; grid-template-columns: max-content 32px 42px 32px; align-items: center; justify-content: end; gap: 5px; }
.receiver-rate-controls output { text-align: center; color: var(--muted); font-weight: 650; }
.receiver-rate-controls [data-live-chorus-jump] { width: 100%; min-height: 40px; }

.receiver-inline-head { display: flex; height: 48px; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); }
.receiver-inline-head button { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; }
.receiver-inline-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.receiver-inline-head + .receiver-player { height: calc(var(--viewport-height) - var(--nav-height) - 48px); }

.receiver-search-page, .receiver-armies-page { min-height: calc(var(--viewport-height) - var(--nav-height)); padding: 8px 12px 24px; }
.receiver-search-form { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; align-items: center; min-height: 54px; margin: 0 4px 8px; padding: 0 6px 0 14px; border: 1px solid var(--outline); border-radius: 15px; background: var(--surface); }
.receiver-search-form > span { color: var(--muted); }
.receiver-search-form input { width: 100%; height: 50px; padding: 0 9px; border: 0; outline: 0; background: transparent; color: var(--text); }
.receiver-search-form button { height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary-soft-ink); font-weight: 650; }
.receiver-search-form .receiver-input-clear { display: grid; width: 36px; padding: 0; place-items: center; background: transparent; color: var(--muted); }
.receiver-search-form .receiver-input-clear[hidden] { display: none; }
.receiver-search-results, .receiver-result-list { display: grid; gap: 7px; padding: 5px 0; }
.receiver-search-results > .receiver-empty { min-height: calc(var(--viewport-height) - var(--nav-height) - 82px); }
.receiver-source-error { margin: 8px; font-size: 13px; }
.receiver-song-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 34px; min-height: 66px; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--outline) 75%, transparent); border-radius: 15px; background: var(--surface); text-align: left; }
.receiver-song-row:active { background: var(--surface-2); }
.receiver-song-row.has-split-warning { grid-template-columns: 50px minmax(0, 1fr) auto; }
.receiver-source-badge { justify-self: center; padding: 4px 7px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-soft-ink); font-size: 11px; font-weight: 760; white-space: nowrap; }
.receiver-source-badge.is-netease { background: var(--secondary-soft); color: var(--text); }
.receiver-song-copy { display: grid; min-width: 0; gap: 3px; }
.receiver-song-copy strong, .receiver-song-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receiver-song-copy strong { font-size: 15px; font-weight: 600; }
.receiver-song-copy small { color: var(--muted); font-size: 12px; }
.receiver-row-action { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--primary); }
.receiver-song-row.has-split-warning .receiver-row-action { gap: 24px; }
.receiver-row-action svg { width: 24px; height: 24px; }
.receiver-song-pending { grid-template-columns: 50px minmax(0, 1fr) auto; }
.receiver-song-pending button { min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: var(--primary); }
.receiver-song-pending button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.receiver-settings-list { display: grid; gap: 14px; padding: 12px 16px 30px; }
.receiver-settings-card { padding: 16px; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--surface); }
.receiver-settings-card h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 18px; }
.receiver-card-header-action { margin-left: auto; padding: 3px 0; border: 0; background: transparent; color: var(--error); font-size: 13px; font-weight: 650; cursor: pointer; }
.receiver-card-header-action:hover { text-decoration: underline; }
.receiver-card-header-action:disabled { cursor: wait; opacity: .5; }
.receiver-settings-card h2 > span { color: var(--primary); }
.receiver-settings-card h2 svg { width: 21px; height: 21px; }
.receiver-settings-card.is-compact { padding-block: 8px; }
.receiver-settings-card.is-compact h2 { display: none; }
.receiver-account-row { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.receiver-account-avatar { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 25px; font-weight: 700; }
.receiver-account-row div { display: grid; gap: 3px; }
.receiver-account-row strong { font-size: 17px; }
.receiver-account-row small, .receiver-settings-link small { color: var(--muted); }
.receiver-action-row { display: grid; grid-template-columns: 1fr 48px; gap: 9px; }
.receiver-renew-button { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; }
.receiver-renew-button svg { width: 18px; height: 18px; }
.receiver-renew-button small { color: var(--muted); font-size: 12px; }
.receiver-icon-button { display: grid; place-items: center; border: 1px solid var(--outline); border-radius: 14px; background: transparent; }
.receiver-settings-link { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 4px; border: 0; background: transparent; text-align: left; }
.receiver-settings-link:disabled, .receiver-settings-link.is-disabled { cursor: not-allowed; opacity: .42; }
.receiver-icon-button:disabled, .receiver-inline-actions button:disabled { cursor: not-allowed; opacity: .42; }
.receiver-settings-link > span:first-child { color: var(--primary); }
.receiver-settings-link > span:nth-child(2) { display: grid; gap: 2px; }
.receiver-settings-link > svg:last-child { justify-self: end; color: var(--muted); }
.receiver-settings-card.is-shortcut { padding-block: 4px; }
.receiver-settings-card.is-shortcut .receiver-settings-link { min-height: 44px; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; padding: 2px 0; }
.receiver-settings-card.is-shortcut [hidden] { display: none !important; }
.receiver-import-link strong { white-space: nowrap; }
.receiver-import-link .receiver-inline-actions { gap: 4px; }
.receiver-import-link .receiver-inline-actions button { min-height: 44px; padding-inline: 7px; }
.receiver-inline-actions { display: flex !important; grid-auto-flow: column; gap: 5px; }
.receiver-inline-actions button { min-height: 36px; padding: 0 9px; border: 1px solid var(--outline); border-radius: 9px; background: transparent; }
.receiver-mark-profile { display: grid; gap: 10px; padding: 4px 6px 10px; }
.receiver-mark-profile > p { margin: 0; }
.receiver-mark-profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.receiver-mark-recovery summary { width: fit-content; min-height: 44px; padding-block: 10px; color: var(--primary); cursor: pointer; }
.receiver-mark-recovery > p { margin: 0 0 12px; line-height: 1.6; }
.receiver-mark-recovery-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.receiver-mark-recovery-form label, .receiver-mark-recovery-form p { grid-column: 1 / -1; margin: 0; }
.receiver-mark-recovery-form input { min-width: 0; min-height: 44px; resize: none; text-transform: uppercase; font-size: 16px; }
.receiver-mark-recovery-form .receiver-filled { min-height: 44px; padding-inline: 14px; }
.receiver-muted { color: var(--muted); }
.receiver-centered { text-align: center; }
.receiver-pair-code { display: grid; width: 100%; margin: 8px 0 12px; padding: 13px; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-2); text-align: center; }
.receiver-pair-code span, .receiver-pair-code small { color: var(--muted); }
.receiver-pair-code strong { font-size: 30px; letter-spacing: .15em; }
.receiver-settings-card > .receiver-filled { width: 100%; }
.receiver-theme-toggle { white-space: nowrap; color: var(--text); }

.receiver-playlist-page { padding: 8px 16px 28px; }
.receiver-switch { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 0 4px; }
.receiver-switch input { width: 19px; height: 19px; accent-color: var(--primary); }
.receiver-playlist-list { display: grid; gap: 8px; margin-top: 10px; }
.receiver-playlist-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 28px; min-height: 64px; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid var(--outline); border-radius: 15px; background: var(--surface); text-align: left; }
.receiver-playlist-row.is-selected { border-color: var(--primary); }
.receiver-playlist-row > span:first-child, .receiver-playlist-row > span:last-child { color: var(--primary); text-align: center; font-size: 20px; }
.receiver-playlist-row > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.receiver-playlist-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receiver-playlist-row small { color: var(--muted); }

.receiver-private-page { display: grid; gap: 14px; padding: 12px 16px 28px; }
.receiver-offline-page { display: grid; gap: 18px; padding: 12px 20px 32px; }
.receiver-offline-page > p { margin: 0; line-height: 1.65; }
.receiver-offline-summary { display: grid; gap: 8px; min-width: 0; padding-block: 6px 18px; border-bottom: 1px solid var(--outline); }
.receiver-offline-summary > strong { font-size: 20px; }
.receiver-offline-summary > span, .receiver-offline-summary > p { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.receiver-offline-summary progress { width: 100%; height: 8px; margin-block: 8px; accent-color: var(--primary); border: 0; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.receiver-offline-summary progress::-webkit-progress-bar { background: var(--surface-3); }
.receiver-offline-summary progress::-webkit-progress-value { background: var(--primary); }
.receiver-offline-summary progress::-moz-progress-bar { background: var(--primary); }
.receiver-offline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.receiver-offline-actions button, .receiver-offline-row button { min-height: 44px; }
.receiver-offline-list { min-width: 0; }
.receiver-offline-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 84px; padding-block: 14px; border-bottom: 1px solid color-mix(in srgb, var(--outline) 60%, transparent); }
.receiver-offline-row > div { display: grid; gap: 4px; min-width: 0; }
.receiver-offline-row strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.receiver-offline-row span, .receiver-offline-row small { font-size: 13px; overflow-wrap: anywhere; }
.receiver-offline-row button { flex: 0 0 auto; }
.receiver-offline-page button:disabled { cursor: not-allowed; opacity: .45; }
.receiver-offline-page [hidden] { display: none !important; }
.receiver-private-page .receiver-settings-card p { margin: 0; }
.receiver-private-list { overflow: hidden; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--surface); }
.receiver-private-row { display: grid; min-height: 58px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--outline); }
.receiver-private-row:last-child { border-bottom: 0; }
.receiver-private-row > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.receiver-private-row strong, .receiver-private-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receiver-private-row small { color: var(--muted); }
.receiver-private-status { color: var(--success, #2e9d63); font-weight: 700; }
.receiver-private-empty { padding: 28px 16px; }

/* Safari on older iPads ignores inset; keep physical edges for every modal. */
.receiver-modal-backdrop { position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .64); }
.receiver-modal { position: relative; width: min(100%, 380px); padding: 24px; border-radius: 24px; background: var(--surface); text-align: center; box-shadow: 0 24px 72px rgba(0, 0, 0, .34); }
.receiver-modal h2 { margin: 4px 0 20px; }
.receiver-modal-close { position: absolute; top: 10px; right: 10px; display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 50%; background: transparent; }
.receiver-qr-stage { display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.receiver-qr-stage img { display: block; width: 240px; height: 240px; border-radius: 13px; background: #fff; object-fit: contain; }
.receiver-json-modal { width: min(100%, 560px); text-align: left; }
.receiver-json-modal textarea { width: 100%; min-height: 220px; resize: vertical; padding: 12px; border: 1px solid var(--outline); border-radius: 10px; outline: 0; background: var(--bg); color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.receiver-json-modal textarea:focus { border-color: var(--primary); }
.receiver-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.receiver-import-conflict-modal { width: min(100%, 620px); max-height: min(88vh, 760px); display: flex; flex-direction: column; text-align: left; }
.receiver-import-conflict-modal h2 { margin: 4px 36px 4px 0; font-size: 20px; }
.receiver-import-conflict-modal > p { margin: 0 0 12px; color: var(--muted); }
.receiver-import-conflict-list { min-height: 0; overflow: auto; border-top: 1px solid var(--outline); border-bottom: 1px solid var(--outline); }
.receiver-import-conflict { padding: 13px 0; border-bottom: 1px solid var(--outline); }
.receiver-import-conflict:last-child { border-bottom: 0; }
.receiver-import-conflict h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.receiver-import-conflict h3 small { color: var(--muted); font-size: 13px; font-weight: 450; }
.receiver-import-conflict-options { display: grid; gap: 6px; }
.receiver-import-conflict-option { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px; padding: 9px 10px; border: 1px solid var(--outline); border-radius: 8px; cursor: pointer; }
.receiver-import-conflict-option:has(input:checked) { border-color: var(--primary); background: var(--surface-2); }
.receiver-import-conflict-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.receiver-import-conflict-option span { display: grid; min-width: 0; gap: 3px; }
.receiver-import-conflict-option strong { font-size: 13px; }
.receiver-import-conflict-option small { color: var(--muted); font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.receiver-import-conflict-modal .receiver-modal-actions { flex: 0 0 auto; }
.receiver-recovery-modal { width: min(100%, 460px); text-align: left; }
.receiver-recovery-modal h2 { margin: 4px 0 8px; font-size: 20px; }
.receiver-recovery-modal p { color: var(--muted); }
.receiver-recovery-modal textarea { width: 100%; min-height: 70px; resize: none; padding: 12px; border: 1px solid var(--outline); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 600 17px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; overflow-wrap: anywhere; }
.receiver-recovery-confirm { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0 14px; color: var(--text); font-size: 14px; }
.receiver-recovery-confirm input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); }
.receiver-recovery-modal > .receiver-filled { width: 100%; }
.receiver-recovery-modal > .receiver-filled:disabled { cursor: not-allowed; opacity: .45; }

.toast { position: fixed; z-index: 150; left: 50%; bottom: calc(var(--nav-height) + 22px + env(safe-area-inset-bottom)); max-width: min(88vw, 480px); padding: 11px 16px; border-radius: 12px; background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity 160ms ease, transform 160ms ease; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Chromium 110 and older WebViews ignore color-mix; keep these surfaces
   opaque and readable instead of losing their entire background/border. */
@supports not (background: color-mix(in srgb, #000 50%, #fff)) {
  .receiver-appbar { background: var(--bg); }
  .receiver-nav { background: var(--surface); border-top-color: var(--outline); }
  .receiver-nav-item.is-disabled { color: var(--muted); opacity: .48; }
  .receiver-song-row { border-color: var(--outline); }
  .toast { background: var(--text); }
  .receiver-shell { border-inline-color: var(--outline); }
}

@media (max-width: 540px) {
  :root { --nav-height: 70px; }
  .receiver-player-heading { padding: 12px 14px 4px; }
  .receiver-player-heading h2 { font-size: 23px; }
  .receiver-player-heading p { font-size: 14px; }
  .receiver-annotation-button { min-height: 38px; padding-inline: 10px; }
  .receiver-mark-recovery-form { grid-template-columns: 1fr; }
  .receiver-lyrics { padding-block: calc(50% - 24px); }
  .receiver-lyric-row { padding-block: 2px; }
  .receiver-player-controls { padding: 5px 9px 7px; }
  .receiver-utility-row { margin-bottom: 3px; }
  .receiver-mini-button { height: 27px; min-width: 42px; padding-inline: 7px; font-size: 11px; }
  .receiver-control-panel { right: 9px; }
  .receiver-control-panel.is-slider { left: 9px; }
  .receiver-control-panel.is-slider.is-right { right: 9px; }
  .receiver-transport-grid { grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); gap: 6px; }
  .receiver-key-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .receiver-key-controls button, .receiver-rate-controls button { min-width: 0; min-height: 27px; padding-inline: 2px; font-size: 11px; }
  .receiver-key-controls button:nth-child(4), .receiver-key-controls button:nth-child(5), .receiver-rate-controls [data-live-chorus-jump] { min-height: 35px; }
  .receiver-play-button { min-height: 44px; }
  .receiver-rate-controls { align-self: stretch; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: minmax(20px, 1fr) auto; column-gap: 3px; row-gap: 3px; padding-left: 0; font-size: 10px; }
  .receiver-volume-control { grid-column: 2; grid-row: 1; position: static; align-self: center; width: 100%; height: 18px; }
  .receiver-speed-controls { grid-template-columns: max-content 22px 28px 22px; gap: 2px; }
  .receiver-rate-controls [data-live-chorus-jump] { grid-column: 1; grid-row: 2; width: 38px; }
  .receiver-rate-controls .receiver-speed-controls { grid-column: 2; grid-row: 2; }
}

@media (pointer: coarse) {
  /* Keep the compact visual track while giving touch users a taller hit area. */
  .receiver-progress-wrap input { position: absolute; inset: -8px 0 auto; height: 36px; }
}

@media (max-width: 360px) {
  .receiver-settings-card.is-shortcut { padding-inline: 12px; }
  .receiver-settings-card.is-shortcut .receiver-settings-link { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; }
  .receiver-import-link strong { font-size: 15px; }
  .receiver-import-link .receiver-inline-actions button { padding-inline: 5px; }
}

@media (min-width: 781px) {
  body { background: color-mix(in srgb, var(--bg) 80%, #000 20%); }
  .receiver-shell { border-inline: 1px solid color-mix(in srgb, var(--outline) 45%, transparent); }
  .receiver-settings-list { padding-inline: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
