.device-player-intro { max-width: 52rem; margin: 2rem 0; }
.device-player-intro h1 { margin-bottom: 1rem; }
.device-player-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.device-panel { min-width: 0; border: 1px solid var(--line); border-radius: 1.4rem; padding: clamp(1.25rem, 3vw, 2rem); background: var(--surface); }
.device-panel h2 { font-size: 1.6rem; margin: .4rem 0 1rem; }
.device-panel progress { width: 100%; height: .45rem; accent-color: var(--brand); }
.device-battery { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.device-battery p { margin: .35rem 0; }
.device-battery meter { width: 8rem; max-width: 100%; height: .8rem; }
.device-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; margin: 1.1rem 0; }
.device-actions .button { margin: 0; max-width: 100%; white-space: normal; text-align: center; }
.device-panel .custom-select { max-width: 22rem; }
.device-playback { grid-column: 1 / -1; }
.device-playback-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.device-panel select { display: block; max-width: 22rem; width: 100%; margin-top: .5rem; }
.device-player button:disabled, .device-player select:disabled { opacity: .45; cursor: default; }
.device-message:empty { display: none; }
.device-message { margin: 1.5rem 0; }
.device-diagnostics { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.device-diagnostics summary { cursor: pointer; margin-bottom: 1rem; }
.device-diagnostics pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 20rem; overflow: auto; font-size: .76rem; }
@media (max-width: 650px) { .device-player-grid { grid-template-columns: minmax(0, 1fr); } .device-playback-heading { align-items: flex-start; } }
.player-heading .device-workspace { min-width: 0; max-width: 65%; }
.device-badge { display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--line); border-radius: 999px; padding: .65rem .9rem; background: var(--surface); color: var(--ink); font: inherit; font-size: .78rem; cursor: pointer; }
.device-badge[hidden] { display: none; }
.connection-summary[hidden] { display: none; }
.connection-dialog-compact { width: min(440px, calc(100% - 32px)); padding: 26px; border-radius: 1rem; }
.connection-dialog-compact .connection-dialog-heading h2 { margin: 0 0 16px; }
.connection-dialog-compact [data-connection-status] { margin: 0 0 14px; }
.audio-route-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.audio-route-options .button { padding: 10px 12px; white-space: normal; font-size: 12px; }
.audio-route-options [aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.connection-help { margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.connection-help summary { cursor: pointer; }
.connection-help[open] summary { margin-bottom: 12px; }
.connection-help p { margin: 10px 0; }
.connection-audio-footer { align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; }
.connection-audio-footer .button { padding: 10px 16px; font-size: 12px; }
.player-heading .device-badge { max-width: 100%; flex-wrap: wrap; justify-content: center; padding: 4px 12px; background: transparent; border-color: #c9d3c1; font-size: 11px; overflow-wrap: anywhere; }
.device-badge-dot { width: .45rem; height: .45rem; background: var(--muted); border-radius: 50%; }
.device-badge-dot[data-connected="true"] { background: var(--brand); }
.device-badge-battery { display: inline-flex; align-items: center; gap: .45rem; position: relative; font-variant-numeric: tabular-nums; color: var(--muted); }
.device-badge-battery:empty { display: none; }
.device-badge-battery::before { content: ""; flex: 0 0 20px; width: 20px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect x='1' y='3' width='19' height='10' rx='2' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M22 6v4' stroke='black' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect x='1' y='3' width='19' height='10' rx='2' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M22 6v4' stroke='black' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.device-badge-battery::after { content: ""; position: absolute; left: 3px; top: 50%; width: 12px; height: 5px; transform: translateY(-50%); border-radius: 1px; background: linear-gradient(to right, var(--brand) var(--battery-level, 0%), transparent var(--battery-level, 0%)); }
.device-badge-battery[data-charging="true"]::after { left: 6px; width: 8px; height: 15px; border-radius: 0; background: var(--brand); clip-path: polygon(57% 0, 0 57%, 43% 57%, 29% 100%, 100% 36%, 57% 36%); filter: drop-shadow(0 0 1px var(--surface)); }
.device-connection-modal { width: min(34rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: clamp(1.4rem, 4vw, 2.25rem); border: 1px solid var(--line); border-radius: 1.4rem; background: var(--surface); color: var(--ink); box-shadow: 0 1.5rem 5rem #0003; }
.device-connection-modal::backdrop { background: #101f1aaa; backdrop-filter: blur(4px); }
.device-modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.device-modal-heading h2 { margin: .5rem 0 1.3rem; }
.device-modal-close { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.7rem; padding: 0 .4rem; }
.device-modal-status { font-weight: 600; }
.device-saved-card { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; gap: .8rem; padding: .9rem; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: .9rem; }
.device-saved-card[hidden] { display: none; }
.device-saved-card p { margin: .35rem 0 0; }
.device-saved-icon { font-size: 1.5rem; color: var(--brand); }
.device-saved-card .button { margin: 0; }
@media (max-width: 420px) { .device-saved-card { grid-template-columns: 1.5rem minmax(0, 1fr); }.device-saved-card .button { grid-column: 2; justify-self: start; } }

.device-firmware { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: 1rem; }
.device-firmware-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.device-firmware-heading h3 { margin: 0; font: inherit; font-weight: 600; }
.device-firmware .small-copy { margin: .65rem 0; }
.device-firmware progress { width: 100%; height: .55rem; accent-color: var(--brand); }
.device-firmware .device-actions { gap: .75rem; margin: .85rem 0 0; }
.device-firmware .button { padding: .65rem 1rem; font-size: .875rem; }

.device-firmware [hidden] { display: none !important; }

.device-name-settings { margin-top: 1.25rem; border-top: 1px solid var(--border, #dce0d3); padding-top: 1rem; }
.device-name-settings summary { cursor: pointer; }
.device-name-settings label { display: block; margin-bottom: .4rem; }
.device-name-settings input { box-sizing: border-box; width: 100%; min-width: 0; padding: .65rem .8rem; color: inherit; font: inherit; background: transparent; border: 1px solid var(--border, #dce0d3); border-radius: .35rem; }
.device-name-settings .device-actions { margin-top: .75rem; }
