.bsp-soundboard {
    --bsp-sb-width: 980px;
    --bsp-sb-max-height: 680px;
    --bsp-sb-columns: 8;
    --bsp-sb-grid-units: 160;
    --bsp-sb-grid-units-tablet: 80;
    --bsp-sb-grid-units-mobile: 60;
    --bsp-sb-grid-min-width: 698px;
    --bsp-sb-grid-min-width-tablet: 330px;
    --bsp-sb-grid-min-width-mobile: 228px;
    --bsp-sb-font-scale: 1;
    --bsp-sb-short: #fff0bd;
    --bsp-sb-long: #ffe18a;
    --bsp-sb-diphthong: #ffd45c;
    --bsp-sb-voiced: #bfd7ec;
    --bsp-sb-voiceless: #c4dfca;
    --bsp-sb-other: #d6dee8;
    --bsp-sb-tone: #d8d9ef;
    --bsp-sb-initial: #d7dee8;
    --bsp-sb-rhyme: #f3e1b5;
    --bsp-sb-final: #c6e1cc;
    --bsp-sb-active: #2563eb;
    --bsp-sb-border: #dbe3ed;
    --bsp-sb-text: #10213a;
    color: var(--bsp-sb-text);
    font-size: calc(14px * var(--bsp-sb-font-scale));
    line-height: 1.4;
    text-align: left;
}

.bsp-sb-position-floating,
.bsp-sb-position-fixed {
    position: fixed;
    top: var(--bsp-sb-top);
    right: var(--bsp-sb-right);
    z-index: 99990;
}

.bsp-sb-position-inline {
    position: relative;
    width: 100%;
    margin: 18px 0;
}

.bsp-sb-launcher {
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .16);
    color: var(--bsp-sb-active);
    cursor: pointer;
    font: 700 24px/1 "Segoe UI", sans-serif;
}

.bsp-sb-launcher:hover,
.bsp-sb-launcher:focus-visible {
    border-color: var(--bsp-sb-active);
    outline: 3px solid color-mix(in srgb, var(--bsp-sb-active) 20%, transparent);
}

.bsp-sb-shell {
    box-sizing: border-box;
    width: min(var(--bsp-sb-width), calc(100vw - 24px));
    max-height: min(var(--bsp-sb-max-height), calc(100vh - 24px));
    overflow: hidden;
    border: 1px solid var(--bsp-sb-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 38px rgba(15, 23, 42, .18);
}

.bsp-sb-position-inline .bsp-sb-shell {
    width: 100%;
    max-height: none;
    overflow: visible;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .08);
}

.bsp-sb-position-inline .bsp-sb-content {
    max-height: none;
    overflow: visible;
}

.bsp-sb-position-inline .bsp-sb-details {
    max-height: none;
    overflow: visible;
}

.bsp-sb-position-inline .bsp-sb-layout-toggle,
.bsp-sb-position-inline .bsp-sb-close {
    display: none !important;
}

.bsp-sb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    padding: 10px 14px;
    border-bottom: 1px solid #e7edf4;
    background: #fff;
}

.bsp-sb-header > div:first-child {
    display: grid;
    min-width: 0;
}

.bsp-sb-header strong {
    overflow: hidden;
    font-size: 1.05em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bsp-sb-header small {
    color: #8290a6;
    font-size: .72em;
}

.bsp-sb-header-controls,
.bsp-sb-dialect {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bsp-sb-header-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bsp-sb-header-controls button,
.bsp-sb-segment-switch button,
.bsp-sb-dialect button {
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff !important;
    color: #475569 !important;
    cursor: pointer;
    font: inherit;
    font-size: .78em;
}

.bsp-sb-dialect button[aria-pressed="true"] {
    border-color: var(--bsp-sb-active) !important;
    background: var(--bsp-sb-active) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--bsp-sb-active) 20%, transparent);
}

.bsp-sb-dialect button[aria-pressed="true"]::before {
    content: "✓ ";
}

.bsp-sb-dialect button[aria-pressed="false"] {
    border-color: #cbd5e1 !important;
    background: #fff !important;
    color: #475569 !important;
}

.bsp-sb-mode-toggle {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.bsp-sb-mode-toggle button {
    min-height: 30px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #475569 !important;
    font-size: .72em !important;
}

.bsp-sb-mode-toggle button + button {
    border-left: 1px solid #cbd5e1 !important;
}

.bsp-sb-mode-toggle button[aria-pressed="true"] {
    background: var(--bsp-sb-active) !important;
    color: #fff !important;
    font-weight: 700;
}

.bsp-sb-layout-toggle,
.bsp-sb-close {
    width: 31px;
    padding: 0 !important;
    font-size: 18px !important;
}

.bsp-sb-assessment-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #52627a;
    font-size: .72em;
    white-space: nowrap;
}

.bsp-sb-details-toggle[aria-pressed="true"] {
    border-color: var(--bsp-sb-active) !important;
    background: var(--bsp-sb-active) !important;
    color: #fff !important;
    font-weight: 700;
}

.bsp-sb-content {
    position: relative;
    box-sizing: border-box;
    max-height: calc(min(var(--bsp-sb-max-height), 100vh) - 74px);
    overflow: auto;
    padding: 12px 14px 16px;
    overscroll-behavior: contain;
}

.bsp-sb-segment-switch {
    display: none;
    position: sticky;
    left: 0;
    z-index: 3;
    align-items: center;
    gap: 5px;
    padding-right: 8px;
    background: #fff;
}

.bsp-sb-segment-switch button[aria-current="true"] {
    border-color: var(--bsp-sb-active);
    background: var(--bsp-sb-active);
    color: #fff;
}

.bsp-sb-sections {
    display: grid;
    gap: 12px;
}

.bsp-sb-content-layout {
    display: grid;
    min-width: 0;
}

.bsp-sb-content-layout.has-details {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 12px;
}

.bsp-sb-content-layout.has-details.is-details-open {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 32%);
}

.bsp-sb-main {
    min-width: 0;
}

.bsp-sb-section {
    min-width: 0;
    margin: 0;
}

.bsp-sb-section > summary,
.bsp-sb-section > h3,
.bsp-sb-section-header h3 {
    margin: 0 0 7px;
    color: #24354e;
    font-size: .78em;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.bsp-sb-section-header,
.bsp-sb-section-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bsp-sb-section-header {
    margin-bottom: 7px;
}

.bsp-sb-section-header h3 {
    margin: 0;
}

.bsp-sb-section-actions {
    margin-left: auto;
}

.bsp-sb-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style-position: inside;
}

.bsp-sb-section > summary small {
    padding: 1px 7px;
    border-radius: 99px;
    background: #f1f5f9;
    color: #64748b;
}

.bsp-sb-grid {
    display: grid;
    grid-template-columns: repeat(var(--bsp-sb-grid-units), minmax(0, 1fr));
    width: calc(100% + 6px);
    min-width: calc(var(--bsp-sb-grid-min-width) + 6px);
    margin-inline: -3px;
    column-gap: 0;
    row-gap: 6px;
}

.bsp-sb-tile {
    position: relative;
    display: block;
    grid-column: span 20;
    box-sizing: border-box;
    min-width: 0;
    min-height: 66px;
    margin-inline: 3px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--tile-color, var(--bsp-sb-other)) 70%, #64748b) !important;
    border-radius: 8px;
    background-color: var(--tile-color, var(--bsp-sb-other)) !important;
    background-image: none !important;
    color: var(--tile-text-color, var(--bsp-sb-text)) !important;
    cursor: default;
    font: inherit;
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

.bsp-sb-tile.bsp-sb-spacer {
    grid-column: span var(--bsp-spacer-units, 20);
    visibility: hidden;
    pointer-events: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none;
}

.bsp-sb-tile.bsp-sb-spacer:hover,
.bsp-sb-tile.bsp-sb-spacer:focus-within {
    z-index: auto;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.bsp-sb-tile-select {
    display: grid;
    box-sizing: border-box;
    width: 100%;
    min-height: 64px;
    padding: 7px 34px 7px 8px;
    border: 0 !important;
    border-radius: inherit;
    background: transparent !important;
    color: inherit !important;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-transform: none !important;
}

.bsp-sb-tile-play {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 3;
    display: grid;
    width: 26px;
    height: 26px;
    padding: 0;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--tile-text-color) 35%, transparent) !important;
    border-radius: 6px;
    background: color-mix(in srgb, var(--tile-text-color) 10%, transparent) !important;
    color: var(--tile-text-color, var(--bsp-sb-text)) !important;
    cursor: pointer;
    font: inherit;
}

.bsp-sb-tile-play:hover,
.bsp-sb-tile-play:focus-visible {
    background: color-mix(in srgb, var(--tile-text-color) 20%, transparent) !important;
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.bsp-sb-tile.category-short { --tile-color: var(--bsp-sb-short); }
.bsp-sb-tile.category-long { --tile-color: var(--bsp-sb-long); }
.bsp-sb-tile.category-diphthong { --tile-color: var(--bsp-sb-diphthong); }
.bsp-sb-tile.category-vowel { --tile-color: var(--bsp-sb-short); }
.bsp-sb-tile.category-voiced { --tile-color: var(--bsp-sb-voiced); }
.bsp-sb-tile.category-voiceless { --tile-color: var(--bsp-sb-voiceless); }
.bsp-sb-tile.category-other { --tile-color: var(--bsp-sb-other); }
.bsp-sb-tile.category-tone { --tile-color: var(--bsp-sb-tone); }
.bsp-sb-tile.category-initial { --tile-color: var(--bsp-sb-initial); }
.bsp-sb-tile.category-rhyme { --tile-color: var(--bsp-sb-rhyme); }
.bsp-sb-tile.category-final { --tile-color: var(--bsp-sb-final); }

.bsp-sb-tile:hover,
.bsp-sb-tile:focus-within {
    z-index: 2;
    border-color: color-mix(in srgb, var(--tile-color) 70%, #334155) !important;
    outline: none;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--tile-color) 20%, transparent);
    transform: translateY(-1px);
}

.bsp-sb-tile.is-selected {
    border-color: color-mix(in srgb, var(--tile-color) 72%, #0f172a) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tile-color) 30%, transparent);
}

.bsp-sb-tile-top,
.bsp-sb-tile-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
}

.bsp-sb-tile-top strong {
    font-family: "Segoe UI", "Arial Unicode MS", sans-serif;
    font-size: 1.2em;
    text-transform: none !important;
}

.bsp-sb-tile-top small {
    overflow: hidden;
    color: var(--tile-text-color, var(--bsp-sb-text)) !important;
    font-size: .62em;
    font-weight: 700;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.bsp-sb-tile-bottom {
    align-self: end;
    color: var(--tile-text-color, var(--bsp-sb-text)) !important;
    font-size: .72em;
    font-weight: 600;
}

.bsp-sb-tile-bottom span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bsp-sb-tile-bottom i {
    color: var(--tile-text-color, var(--bsp-sb-text)) !important;
    font-size: .85em;
}

.bsp-sb-tone-path {
    width: 56px;
    height: 22px;
    margin: 1px auto;
}

.bsp-sb-tone-path path,
.bsp-sb-tone-cards path {
    fill: none;
    stroke: var(--tile-color, var(--bsp-sb-tone));
    stroke-linecap: round;
    stroke-width: 2.5;
}

.bsp-sb-tone-path path {
    stroke: var(--tile-text-color, var(--bsp-sb-text));
}

.bsp-sb-pair-connector {
    display: none;
    position: absolute;
    top: 50%;
    right: -8px;
    z-index: 4;
    width: 10px;
    height: 3px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--tile-color) 75%, #334155);
}

.bsp-sb-tile.is-pair-start .bsp-sb-pair-connector {
    display: block;
}

.bsp-sb-tile.is-loading i {
    animation: bsp-sb-pulse .7s infinite alternate;
}

.bsp-sb-tile.is-playing {
    border-color: var(--tile-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile-color) 22%, transparent);
    transform: translateY(-2px);
}

.bsp-sb-tile.is-sequence-active {
    border-color: var(--bsp-sb-active);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bsp-sb-active) 24%, transparent);
    transform: scale(1.035);
}

.bsp-sb-tile.is-phrase-match {
    border-color: var(--bsp-sb-active) !important;
    box-shadow: inset 0 0 0 3px var(--bsp-sb-active), 0 3px 10px color-mix(in srgb, var(--bsp-sb-active) 20%, transparent);
}

.bsp-sb-tile.is-score-good,
.bsp-sb-tile.is-score-warning,
.bsp-sb-tile.is-score-error { --tile-text-color: #071426 !important; }
.bsp-sb-tile.is-score-good { background-color: #dcfce7 !important; }
.bsp-sb-tile.is-score-warning { background-color: #fef3c7 !important; }
.bsp-sb-tile.is-score-error { background-color: #fee2e2 !important; }

.bsp-sb-details {
    position: sticky;
    top: 0;
    max-height: calc(min(var(--bsp-sb-max-height), 100vh) - 102px);
    margin: 0;
    overflow: auto;
    border: 1px solid var(--bsp-sb-border);
    border-radius: 9px;
    background: #f8fafc;
}

.bsp-sb-details > summary {
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.bsp-sb-details > summary::-webkit-details-marker {
    display: none;
}

.bsp-sb-details:not([open]) > summary {
    display: grid;
    min-height: 132px;
    padding: 10px;
    place-items: center;
    writing-mode: vertical-rl;
}

.bsp-sb-details-body {
    display: flow-root;
    padding: 0 12px 12px;
}

.bsp-sb-details-body p {
    margin: 7px 0;
}

.bsp-sb-detail-nav {
    display: none;
}

.bsp-sb-detail-play,
.bsp-sb-show-tones {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    margin: 0 0 7px;
    padding: 6px 11px;
    border: 1px solid var(--bsp-sb-active);
    border-radius: 7px;
    background: var(--bsp-sb-active) !important;
    color: #fff !important;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.bsp-sb-show-tones {
    margin-right: 7px;
    border-color: #cbd5e1;
    background: #f8fafc !important;
    color: #334155 !important;
}

.bsp-sb-detail-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 7px;
}

.bsp-sound-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.bsp-sound-details-header .bsp-sb-detail-heading {
    min-width: 0;
    margin-bottom: 0;
}

.bsp-soundboard .bsp-typing-guide-row.is-collapsed {
    display: none !important;
}

.bsp-sb-detail-heading strong {
    font-size: 1.8em;
}

.bsp-sb-detail-heading span {
    color: #64748b;
}

.bsp-sb-detail-image {
    float: left;
    max-width: min(260px, 45%);
    max-height: 220px;
    margin: 8px 14px 8px 0;
    border-radius: 8px;
    object-fit: contain;
}

.bsp-sb-video iframe,
.bsp-sb-video-file {
    width: min(100%, 560px);
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
}

.bsp-sb-live-message {
    min-height: 1em;
    margin-top: 5px;
    color: #b42318;
    font-size: .75em;
}

.bsp-sb-shell.is-ribbon {
    width: min(var(--bsp-sb-width), calc(100vw - 24px));
}

.bsp-sb-shell.is-ribbon .bsp-sb-content {
    max-height: 122px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
}

.bsp-sb-shell.is-ribbon .bsp-sb-content-layout,
.bsp-sb-shell.is-ribbon .bsp-sb-main {
    display: flex;
    min-width: max-content;
}

.bsp-sb-shell.is-ribbon .bsp-sb-main {
    gap: 8px;
}

.bsp-sb-shell.is-ribbon .bsp-sb-segment-switch {
    display: flex;
}

.bsp-sb-shell.is-ribbon .bsp-sb-sections {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.bsp-sb-shell.is-ribbon .bsp-sb-section {
    display: block;
    min-width: max-content;
}

.bsp-sb-shell.is-ribbon .bsp-sb-section > summary,
.bsp-sb-shell.is-ribbon .bsp-sb-section > h3 {
    display: none;
}

.bsp-sb-shell.is-ribbon .bsp-sb-grid {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    min-width: 0;
}

.bsp-sb-shell.is-ribbon .bsp-sb-section:not([open]) > .bsp-sb-grid {
    display: flex;
}

.bsp-sb-shell.is-ribbon .bsp-sb-tile {
    width: 108px;
    min-width: 108px;
    min-height: 78px;
}

.bsp-sb-shell.is-ribbon .bsp-sb-spacer {
    width: var(--bsp-spacer-ribbon-width, 108px);
    min-width: var(--bsp-spacer-ribbon-width, 108px);
}

.bsp-sb-shell.is-ribbon .bsp-sb-tile-select {
    min-height: 76px;
}

.bsp-sb-shell.is-ribbon .bsp-sb-details,
.bsp-sb-shell.is-ribbon .bsp-sb-live-message {
    display: none;
}

.bsp-sb-tone-sweep {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: grid;
    padding: 14px;
    place-items: center;
    background: rgba(15, 23, 42, .38);
}

.bsp-sb-tone-sweep-panel {
    width: min(930px, calc(100vw - 28px));
    padding: 14px 16px;
    border: 1px solid #dbe3ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 54px rgba(15, 23, 42, .28);
}

.bsp-sb-tone-sweep-panel > header,
.bsp-sb-tone-sweep-panel > header > div,
.bsp-sb-tone-sweep-panel > header span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bsp-sb-tone-sweep-panel > header {
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7edf4;
}

.bsp-sb-tone-sweep-panel > header > div > strong {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    font-size: 1.4em;
}

.bsp-sb-tone-sweep-panel > header span {
    display: grid;
    gap: 0;
}

.bsp-sb-tone-sweep-panel > header small {
    color: #8290a6;
}

.bsp-soundboard .bsp-sb-tone-sweep-panel .bsp-sb-tone-close {
    display: grid !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    place-items: center;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #8290a6 !important;
    cursor: pointer;
    font: 400 26px/1 "Segoe UI", sans-serif !important;
}

.bsp-soundboard .bsp-sb-tone-sweep-panel .bsp-sb-tone-close:hover,
.bsp-soundboard .bsp-sb-tone-sweep-panel .bsp-sb-tone-close:focus-visible {
    border-color: #cbd5e1 !important;
    background: transparent !important;
    color: #475569 !important;
    outline: none;
}

.bsp-sb-tone-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.bsp-sb-tone-card {
    display: grid;
    min-height: 128px;
    padding: 10px;
    place-items: center;
    border: 1px solid #dbe3ed;
    border-radius: 9px;
    background: #f8fafc;
    color: #17233a;
    font: inherit;
}

.bsp-sb-tone-card:hover,
.bsp-sb-tone-card:focus-within {
    border-color: var(--bsp-sb-tone);
    outline: 3px solid color-mix(in srgb, var(--bsp-sb-tone) 18%, transparent);
}

.bsp-sb-tone-card-play {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid var(--bsp-sb-active) !important;
    border-radius: 6px;
    background: var(--bsp-sb-active) !important;
    color: #fff !important;
    cursor: pointer;
    font: inherit;
    font-size: .72em;
    font-weight: 700;
    text-transform: none !important;
}

.bsp-sb-tone-cards svg {
    width: 64px;
    height: 28px;
}

.bsp-sb-tone-cards strong {
    font-size: 1.25em;
}

.bsp-sb-tone-cards span,
.bsp-sb-tone-cards small {
    color: #7b8aa2;
    font-size: .67em;
    text-align: center;
}

.bsp-soundboard .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes bsp-sb-pulse {
    from { opacity: .25; transform: scale(.85); }
    to { opacity: 1; transform: scale(1.05); }
}

@media (min-width: 992px) {
    .bsp-soundboard-layout {
        display: grid;
        gap: 24px;
        align-items: start;
    }

    .bsp-soundboard-layout.has-details {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .bsp-soundboard-layout.has-details.is-details-open {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .bsp-soundboard .bsp-soundboard-details-panel {
        position: sticky;
        top: 20px;
        align-self: start;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        border-radius: 12px;
    }
}

@media (max-width: 991px) {
    .bsp-soundboard-layout {
        display: flex;
        flex-direction: column;
    }

    .bsp-soundboard .bsp-soundboard-details-panel {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 12px;
        overflow: visible;
    }

    .bsp-soundboard-details-panel:not([open]) > summary {
        min-height: 0;
        writing-mode: initial;
    }
}

@media (max-width: 900px) {
    .bsp-sb-grid {
        grid-template-columns: repeat(var(--bsp-sb-grid-units-tablet), minmax(0, 1fr));
        min-width: calc(var(--bsp-sb-grid-min-width-tablet) + 6px);
    }
    .bsp-sb-tile.bsp-sb-spacer { grid-column: span var(--bsp-spacer-units-tablet, 20); }
    .bsp-sb-tone-cards { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
}

@media (max-width: 560px) {
    .bsp-soundboard { --bsp-sb-font-scale: .95; }
    .bsp-sb-position-floating,
    .bsp-sb-position-fixed { inset: auto 6px 6px 6px !important; }
    .bsp-sb-launcher { margin-left: auto; }
    .bsp-sb-shell { width: 100%; max-height: calc(100vh - 12px); border-radius: 11px; }
    .bsp-sb-header { align-items: flex-start; }
    .bsp-sb-header small { display: none; }
    .bsp-sb-dialect button { padding-inline: 6px; }
    .bsp-sb-segment-switch {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 8;
        width: 100%;
        margin-bottom: 9px;
        padding: 7px 0;
        overflow-x: auto;
        background: #fff;
        box-shadow: 0 1px 0 var(--bsp-sb-border);
        scrollbar-width: thin;
    }
    .bsp-sb-segment-switch button { flex: 0 0 auto; }
    .bsp-sb-section { scroll-margin-top: 54px; }
    .bsp-sb-grid {
        grid-template-columns: repeat(var(--bsp-sb-grid-units-mobile), minmax(0, 1fr));
        min-width: calc(var(--bsp-sb-grid-min-width-mobile) + 6px);
    }
    .bsp-sb-tile.bsp-sb-spacer { grid-column: span var(--bsp-spacer-units-mobile, 20); }
    .bsp-sb-content { max-height: calc(100vh - 76px); padding: 9px; }
    .bsp-sb-content-layout.has-details,
    .bsp-sb-content-layout.has-details.is-details-open { grid-template-columns: minmax(0, 1fr); }
    .bsp-sb-details { position: static; max-height: none; margin-top: 12px; scroll-margin-top: 54px; }
    .bsp-sb-details:not([open]) > summary { min-height: 0; writing-mode: initial; }
    .bsp-sb-detail-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        margin: 4px 0 10px;
    }
    .bsp-sb-detail-nav button {
        min-height: 36px;
        padding: 6px 8px;
        border: 1px solid var(--bsp-sb-border);
        border-radius: 7px;
        background: #fff;
        color: #0f172a;
        font: inherit;
        font-weight: 700;
    }
    .bsp-sb-detail-nav button:disabled { opacity: .38; }
    .bsp-sb-detail-nav span { color: #64748b; font-size: .82em; white-space: nowrap; }
    .bsp-sb-tone-cards { grid-template-columns: repeat(2, minmax(100px, 1fr)); max-height: 70vh; overflow: auto; }
    .bsp-sb-detail-image { float: none; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .bsp-sb-tile { transition: none; }
    .bsp-sb-tile.is-loading i { animation: none; }
}
