/* Instrument selector and modal */
.instrument-selector-modal[hidden] { display: none; }

   .instrument-selector-modal {
        position: fixed;
        z-index: 99998;
        inset: 0;
        display: grid;
        overflow: hidden;
        padding: clamp(0.75rem, 2vw, 2rem);
        background: rgb(0 0 0 / 82%);
        backdrop-filter: blur(7px) saturate(0.4) brightness(0.45);
        place-items: center;
   }

   .admin-bar .instrument-selector-modal { top: 32px; }

   .instrument-selector-modal-backdrop {
        position: absolute;
        border: 0;
        background: radial-gradient(circle at 50% 42%, transparent, rgb(0 0 0 / 32%) 78%);
        cursor: default;
        inset: 0;
        backdrop-filter: none;
        animation: instrument-selector-backdrop-in 420ms ease-out both;
   }

   .instrument-selector-modal-dialog {
        position: relative;
        box-sizing: border-box;
        width: min(78rem, 100%);
        min-height: min(34rem, 85dvh);
        max-height: 92dvh;
        overflow: auto;
        padding: clamp(1.25rem, 2.5vw, 2rem);
        border: 1px solid rgb(255 255 255 / 22%);
        border-radius: clamp(0.75rem, 1.5vw, 1.25rem);
        outline: 0;
        background: var(--yamaha-color-surface);
        box-shadow: 0 2rem 7rem rgb(0 0 0 / 68%);
        color: var(--yamaha-color-ink);
        animation: instrument-selector-dialog-in 520ms var(--yamaha-easing-standard) both;
        overscroll-behavior: contain;
   }

   .instrument-selector-modal-header {
        position: sticky;
        top: -1px;
        z-index: 2;
        background: var(--yamaha-color-surface);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--yamaha-color-border-strong);
        gap: 1rem;
   }

   .instrument-selector-modal-header p {
        margin: 0;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--yamaha-color-ink-muted);
   }

   .instrument-selector-modal-header button {
        display: grid;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border: 1px solid var(--yamaha-color-border-strong);
        border-radius: 50%;
        background: transparent;
        color: var(--yamaha-color-ink);
        cursor: pointer;
        font: inherit;
        font-size: 1.5rem;
        line-height: 1;
        place-items: center;
        transition: background-color var(--yamaha-motion-fast) var(--yamaha-easing-standard), color var(--yamaha-motion-fast) var(--yamaha-easing-standard);
   }

   .instrument-selector-modal-header button:hover,
   .instrument-selector-modal-header button:focus-visible {
        background: var(--yamaha-color-ink);
        color: var(--yamaha-color-surface);
   }

   .instrument-selector-modal .instrument-selector { margin-top: clamp(1.25rem, 3vw, 2rem); }

   .instrument-selector-modal .instrument-selector-progress p,
   .instrument-selector-modal .instrument-selector-options small,
   .instrument-selector-modal .instrument-selector-kicker,
   .instrument-selector-modal .instrument-selector-result-summary {
        color: var(--yamaha-color-ink-muted);
   }

   .instrument-selector-modal .instrument-selector-progress [data-selector-progress-bar] {
        background: var(--yamaha-color-border-strong);
   }

   .instrument-selector-modal .instrument-selector-progress [data-selector-progress-bar]::after {
        background: var(--yamaha-color-ink);
        box-shadow: none;
   }

   .instrument-selector-modal .instrument-selector-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
        border-color: var(--yamaha-color-border-strong);
        background: var(--yamaha-color-border-strong);
   }

   .instrument-selector-modal .instrument-selector-options label {
        min-width: 0;
        min-height: 6rem;
        flex: 1 1 12rem;
        background: var(--yamaha-color-surface);
   }

   .instrument-selector-modal .instrument-selector-options label > span {
        box-sizing: border-box;
        min-height: 6rem;
        padding: 1.1rem 1.25rem;
        box-shadow: inset 0 0 0 0 var(--yamaha-color-ink);
   }

   .instrument-selector-modal .instrument-selector-options label:hover > span {
        background: var(--yamaha-color-surface-warm);
   }

   .instrument-selector-modal .instrument-selector-options input:checked + span {
        background: var(--yamaha-color-surface-warm);
        box-shadow: inset 0 0 0 2px var(--yamaha-color-ink);
   }

   .instrument-selector-modal .instrument-selector-options input:focus-visible + span {
        outline-color: var(--yamaha-color-ink);
   }

   .instrument-selector-modal .instrument-selector-navigation button,
   .instrument-selector-modal .instrument-selector-result-actions button {
        border-color: var(--yamaha-color-ink);
        background: var(--yamaha-color-ink);
        color: var(--yamaha-color-surface);
   }

   .instrument-selector-modal .instrument-selector-navigation .instrument-selector-back,
   .instrument-selector-modal .instrument-selector-result-actions button {
        background: transparent;
        color: var(--yamaha-color-ink);
   }

   .instrument-selector-modal .instrument-selector-grid,
   .instrument-selector-modal [data-selector-near-grid] {
        background: transparent;
   }

   .instrument-selector-modal .instrument-selector-card {
        background: var(--yamaha-color-surface);
   }

   .instrument-selector-modal .instrument-selector-card a,
   .instrument-selector-modal .instrument-selector-card strong,
   .instrument-selector-modal .instrument-selector-empty a,
   .instrument-selector-modal .instrument-selector-match.is-deviation {
        color: var(--yamaha-color-ink);
   }

   .instrument-selector-modal .instrument-selector-card-meta,
   .instrument-selector-modal .instrument-selector-match,
   .instrument-selector-modal .instrument-selector-near > p,
   .instrument-selector-modal .instrument-selector-empty > p {
        color: var(--yamaha-color-ink-muted);
   }

   .instrument-selector-modal .instrument-selector-step legend {
        max-width: 28ch;
        margin-bottom: clamp(1.25rem, 3vw, 2rem);
        font-size: clamp(1.8rem, 4vw, 3rem);
   }

   .instrument-selector-modal .instrument-selector-options strong {
        font-size: clamp(1.1rem, 1.8vw, 1.45rem);
        line-height: 1.15;
   }

   .instrument-selector-modal .instrument-selector-options small {
        font-size: 0.78rem;
        line-height: 1.35;
   }

   .instrument-selector-modal .instrument-selector-progress {
        margin-bottom: clamp(1.25rem, 3vw, 2rem);
   }

   .instrument-selector-modal .instrument-selector-results > .instrument-selector-kicker {
        display: none;
   }

   .instrument-selector-modal .instrument-selector-results > h2 {
        font-size: clamp(2.5rem, 5vw, 4rem);
   }

   html.instrument-selector-modal-open,
   html.instrument-selector-modal-open body { overflow: hidden; }

   @keyframes instrument-selector-backdrop-in {
        from { opacity: 0; }
        to { opacity: 1; }
   }

   @keyframes instrument-selector-dialog-in {
        from { opacity: 0; transform: translateY(1.25rem) scale(0.975); }
        to { opacity: 1; transform: translateY(0) scale(1); }
   }

   .selector-page {
        width: 100%;
        max-width: none !important;
        padding: clamp(3rem, 8vw, 7rem) clamp(1.25rem, 5vw, 5rem);
   }

   .selector-page > * {
        margin-inline: 0 !important;
   }

   .selector-page > h1 {
        max-width: 13ch;
        margin-block: 0 1.25rem;
        font-size: clamp(3rem, 8vw, 7rem);
        font-weight: 400;
        letter-spacing: -0.06em;
        line-height: 0.95;
   }

   .selector-page > .has-large-font-size {
        max-width: 54rem;
        color: var(--yamaha-color-ink-muted);
        line-height: 1.65;
   }

   .instrument-selector {
        margin-top: clamp(3rem, 7vw, 6rem);
   }

   .instrument-selector-progress {
        margin-bottom: clamp(2rem, 5vw, 4rem);
   }

   .instrument-selector-progress p {
        display: grid;
        margin: 0;
        gap: 0.75rem;
        color: var(--yamaha-color-ink-muted);
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
   }

   .instrument-selector-progress [data-selector-progress-bar] {
        position: relative;
        display: block;
        width: 100%;
        height: 2px;
        overflow: hidden;
        background: var(--yamaha-color-border-strong);
   }

   .instrument-selector-progress [data-selector-progress-bar]::after {
        position: absolute;
        width: var(--selector-progress, 33.333%);
        height: 100%;
        background: var(--yamaha-color-ink);
        content: "";
        transition: width var(--yamaha-motion-standard) var(--yamaha-easing-standard);
   }

   .instrument-selector-step {
        margin: 0;
        padding: 0;
        border: 0;
   }

   .instrument-selector-step[hidden] {
        display: none;
   }

   .instrument-selector-step legend {
        max-width: 22ch;
        margin-bottom: clamp(2rem, 5vw, 3.5rem);
        font-size: clamp(2rem, 5vw, 4.5rem);
        font-weight: 400;
        letter-spacing: -0.045em;
        line-height: 1.05;
   }

   .instrument-selector-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
        overflow: hidden;
        border: 1px solid var(--yamaha-color-border-strong);
        border-radius: var(--yamaha-radius-card);
        background: var(--yamaha-color-border-strong);
        gap: 1px;
   }

   .instrument-selector-options label {
        position: relative;
        display: block;
        min-height: 10rem;
        background: var(--yamaha-color-surface);
        cursor: pointer;
   }

   .instrument-selector-options input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
   }

   .instrument-selector-options label > span {
        box-sizing: border-box;
        display: flex;
        height: 100%;
        min-height: 10rem;
        flex-direction: column;
        justify-content: space-between;
        padding: 1.5rem;
        box-shadow: inset 0 0 0 0 var(--yamaha-color-ink);
        transition: background-color var(--yamaha-motion-fast) var(--yamaha-easing-standard), box-shadow var(--yamaha-motion-fast) var(--yamaha-easing-standard);
   }

   .instrument-selector-options label:hover > span {
        background: var(--yamaha-color-surface-warm);
   }

   .instrument-selector-options input:checked + span {
        background: var(--yamaha-color-surface-warm);
        box-shadow: inset 0 0 0 2px var(--yamaha-color-ink);
   }

   .instrument-selector-options input:focus-visible + span {
        outline: 3px solid var(--yamaha-color-ink);
        outline-offset: -5px;
   }

   .instrument-selector-options strong {
        font-size: clamp(1.25rem, 2vw, 1.75rem);
        font-weight: 400;
   }

   .instrument-selector-options small {
        color: var(--yamaha-color-ink-muted);
        font-size: 0.9rem;
        line-height: 1.5;
   }

   .instrument-selector-navigation,
   .instrument-selector-result-actions {
        display: flex;
        justify-content: space-between;
        margin-top: 2rem;
        gap: 0.75rem;
   }

   .instrument-selector-navigation button,
   .instrument-selector-result-actions button {
        padding: 0.75rem 1.25rem;
        border: 1px solid var(--yamaha-color-ink);
        border-radius: 999px;
        background: var(--yamaha-color-ink);
        color: var(--yamaha-color-surface);
        cursor: pointer;
        font: inherit;
   }

   .instrument-selector-navigation button[disabled] {
        cursor: not-allowed;
        opacity: 0.35;
   }

   .instrument-selector-navigation .instrument-selector-back,
   .instrument-selector-result-actions button {
        background: transparent;
        color: var(--yamaha-color-ink);
   }

   .instrument-selector-results > h2 {
        max-width: 18ch;
        margin-block: 0.5rem 1rem;
        font-size: clamp(2.5rem, 6vw, 5.5rem);
        font-weight: 400;
        letter-spacing: -0.05em;
        line-height: 1;
   }

   .instrument-selector-kicker {
        margin: 0;
        color: var(--yamaha-color-ink-muted);
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.13em;
        text-transform: uppercase;
   }

   .instrument-selector-result-summary {
        color: var(--yamaha-color-ink-muted);
        font-size: clamp(1rem, 2vw, 1.25rem);
   }

   .instrument-selector-grid,
   [data-selector-near-grid] {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
        margin-top: clamp(2rem, 5vw, 4rem);
        overflow: hidden;
        border: 1px solid var(--yamaha-color-border-strong);
        border-radius: var(--yamaha-radius-card);
        background: var(--yamaha-color-border-strong);
        gap: 1px;
   }

   .instrument-selector-card {
        min-height: 18rem;
        padding: clamp(1.5rem, 3vw, 2.5rem);
        background: var(--yamaha-color-surface);
   }

   [data-selector-product][hidden],
   .instrument-selector-grid[hidden],
   .instrument-selector-progress[hidden] {
        display: none;
   }

   .instrument-selector-card h3 {
        margin-block: 0.5rem 1rem;
        font-size: clamp(1.75rem, 3vw, 2.75rem);
        font-weight: 400;
        letter-spacing: -0.04em;
   }

   .instrument-selector-card-meta,
   .instrument-selector-match {
        color: var(--yamaha-color-ink-muted);
   }

   .instrument-selector-match {
        margin: 1rem 0 0;
        font-size: 0.9rem;
   }

   .instrument-selector-match.is-deviation {
        color: var(--yamaha-color-ink);
        font-weight: 600;
   }

   .instrument-selector-card a,
   .instrument-selector-empty a {
        display: inline-flex;
        margin-top: 1rem;
        gap: 0.5rem;
        color: var(--yamaha-color-ink);
        font-weight: 600;
        text-decoration: none;
   }

   .instrument-selector-empty,
   .instrument-selector-near {
        margin-top: 2rem;
        padding: clamp(1.5rem, 3vw, 2.5rem);
        border: 1px solid var(--yamaha-color-border-strong);
        border-radius: var(--yamaha-radius-card);
        background: var(--yamaha-color-surface-warm);
   }

   .instrument-selector-empty[hidden],
   .instrument-selector-near[hidden] {
        display: none;
   }

   .instrument-selector-near [data-selector-near-grid] {
        margin-top: 1.5rem;
   }

   .instrument-selector-navigation .instrument-selector-next {
        margin-left: auto;
   }

   .instrument-selector-modal .instrument-selector-navigation {
        position: sticky;
        bottom: -1px;
        z-index: 1;
        padding-block: 1rem;
        background: var(--yamaha-color-surface);
   }

   .instrument-selector-result-actions {
        justify-content: flex-start;
        margin-top: 1.25rem;
   }

   .instrument-selector-results .instrument-selector-grid {
        margin-top: 1.5rem;
   }

   .instrument-selector-options label > span:not(:has(small)) {
        justify-content: center;
   }

   .instrument-selector [data-selector-product] .sortiment-card-image-link img {
        transition: none;
   }
