/* DenoMCP local media tool: one preview and one editing dock. */
body.bgm-app { height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: minmax(0,1fr) auto; }
.bgm-app .bgm-page { width: 100%; max-width: 1800px; margin-inline: auto; min-height: 0; padding: 18px 30px 5px; overflow: hidden; display: flex; flex-direction: column; container-type: inline-size; container-name: bgm-page; }
.bgm-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex: none; height: 40px; margin-bottom: 8px; }
.bgm-heading h1 { margin: 0; font-size: 23px; font-weight: 200; letter-spacing: -.025em; white-space: nowrap; }
.bgm-heading h1 strong { font-weight: 500; }
.bgm-file-row { display: flex; align-items: center; gap: 14px; min-width: 0; color: var(--text-2); }
.bgm-file-row > span { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.bgm-file-row button { min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule); background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.bgm-file-row button:hover { color: var(--text); }
.bgm-workspace { position: relative; flex: 1; min-height: 0; }
.bgm-source { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.bgm-edit-dock { display: contents; }
.bgm-preview-bar { flex: none; display: flex; justify-content: center; min-height: 36px; }
.bgm-listen-row { display: flex; gap: 22px; }
.bgm-listen-row button { min-height: 36px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text); padding: 5px 8px; font-size: 13px; cursor: pointer; }
.bgm-listen-row button.selected { color: var(--text); border-bottom-color: var(--brass); }
.bgm-stage { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 12px 0 16px; }
.bgm-stage video { position: absolute; display: block; left: 50%; top: 50%; transform: translate(-50%,-50%); max-width: 100%; max-height: 100%; object-fit: contain; outline: none; cursor: pointer; }
.bgm-stage:fullscreen { background: #000; padding: 0; }
.bgm-stage:fullscreen video { width: 100%; height: 100%; }
.bgm-drop { width: min(780px, 100%); align-self: stretch; min-height: 0; border: 1px dashed var(--edge); background: rgba(255,255,255,.015); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 12px; cursor: pointer; }
.bgm-drop:hover { border-color: var(--brass); }
.bgm-drop > svg { width: 44px; height: 44px; color: var(--brass); }
.bgm-drop-title { font-size: 22px; font-weight: 300; }
.bgm-drop-key { padding: 9px 22px; border: 1px solid var(--edge); font-size: 12px; }
.bgm-audio-preview { display: flex; align-items: center; flex-direction: column; gap: 20px; color: var(--text-2); font-size: 14px; }
.bgm-audio-preview > svg { width: 72px; height: 72px; color: var(--brass); }
.bgm-notice { margin: 0 0 6px; flex: none; font-size: 12px; color: var(--text-2); }
.bgm-notice.error { color: #ecc4b2; }
.bgm-region { flex: none; border-top: 1px solid var(--rule); padding-top: 12px; }
.bgm-region-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bgm-region h2 { margin: 0; font-size: 13px; font-weight: 500; color: var(--text); }
.bgm-region-mode { display: flex; gap: 4px; }
.bgm-region-mode button { border: 1px solid var(--rule); padding: 5px 14px; min-height: 34px; background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; }
.bgm-region-mode button[aria-pressed="true"] { background: var(--raised); color: var(--text-strong); border-color: var(--brass); border-radius: 2px; }
.bgm-time-rail { position: relative; height: 48px; margin: 4px 20px 0; touch-action: none; cursor: pointer; }
.bgm-time-track { position: absolute; left: 0; right: 0; top: 23px; height: 1px; background: rgba(255,255,255,.16); }
.bgm-waveform { position: absolute; inset: 0; width: 100%; height: 48px; pointer-events: none; }
.bgm-waveform path { fill: none; stroke: var(--text-2); stroke-width: .5; }
.bgm-time-selection { position: absolute; top: 1px; bottom: 1px; background: rgba(var(--brass-rgb),.10); border-block: 1px solid rgba(var(--brass-rgb),.5); pointer-events: none; }
.bgm-time-handle { position: absolute; width: 40px; height: 48px; top: 0; transform: translateX(-50%); padding: 0; border: 0; background: none; touch-action: none; cursor: ew-resize; z-index: 2; }
.bgm-time-handle::after { content: ''; display: block; width: 8px; height: 48px; margin: 0 auto; background: var(--brass); border-radius: 2px; }
.bgm-time-handle::before { content: ''; position: absolute; left: 19px; top: 19px; width: 2px; height: 10px; background: var(--bg); z-index: 1; }
.bgm-playhead { position: absolute; width: 1px; height: 48px; top: 0; background: var(--text); z-index: 1; pointer-events: none; }
.bgm-time-extents { display: flex; justify-content: space-between; padding: 5px 20px 0; color: var(--text-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.bgm-region[data-scope="whole"] .bgm-time-handle { display: none; }
.bgm-control-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 12px 10px; margin-top: 8px; border: 1px solid var(--rule); background: var(--surface); }
.bgm-workspace[data-media-shape="landscape"] .bgm-region,
.bgm-workspace[data-media-shape="landscape"] .bgm-control-bar { width: min(100%, 1080px); margin-inline: auto; }
.bgm-transport { display: flex; align-items: center; gap: 10px; flex: none; }
.bgm-play-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer; }
.bgm-play-button svg { width: 20px; height: 20px; fill: currentColor; }
.bgm-play-button .pause-symbol { display: none; }
.bgm-play-button[data-playing="true"] .play-symbol { display: none; }
.bgm-play-button[data-playing="true"] .pause-symbol { display: inline; }
.bgm-transport output { min-width: 64px; font-size: 14px; font-variant-numeric: tabular-nums; }
.bgm-icon-button { width: 30px; height: 36px; border: 0; background: none; color: var(--text); padding: 5px; cursor: pointer; }
.bgm-icon-button:hover { color: var(--text); }
.bgm-icon-button svg { width: 20px; height: 20px; stroke-width: 1.8; }
.sound-off { display: none; }
#bgm-mute[data-muted="true"] .sound-on { display: none; }
#bgm-mute[data-muted="true"] .sound-off { display: inline; }
.bgm-region-inputs { display: flex; gap: 12px; flex: none; }
.bgm-region-inputs label { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 12px; }
.bgm-region-inputs input { width: 84px; height: 38px; padding: 5px 7px; border: 1px solid var(--edge); background: var(--bg); color: var(--text-strong); font-size: 14px; border-radius: 2px; font-variant-numeric: tabular-nums; }
.bgm-settings { position: relative; min-width: 0; max-width: none; flex: none; }
.bgm-param-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 38px; padding: 6px 12px; border: 1px solid var(--edge); border-radius: 2px; background: var(--raised); color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; }
.bgm-param-button output { font-weight: 600; }
.bgm-param-button svg { width: 14px; height: 14px; }
.bgm-param-button[aria-expanded="true"] { border-color: var(--brass); }
.bgm-strength-popover { position: fixed; z-index: 120; width: 250px; padding: 16px; border: 1px solid var(--edge); background: var(--surface); box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.bgm-strength-popover[hidden] { display: none !important; }
.bgm-strength-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text); margin-bottom: 5px; }
.bgm-strength-head output { color: var(--text-strong); font-size: 14px; }
.bgm-strength-popover input[type=range] { width: 100%; height: 22px; margin: 0; accent-color: var(--brass); cursor: pointer; }
.bgm-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.bgm-primary-action { position: relative; }
.bgm-process { min-width: 140px; height: 44px; padding: 6px 20px; font-size: 15px; font-weight: 600; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.bgm-page .bgm-process { opacity: 1; background: var(--paper); border-color: var(--paper); color: var(--ink); box-shadow: none; }
.bgm-page .bgm-process:disabled { opacity: .45; }
.bgm-process svg { width: 18px; height: 18px; }
.bgm-process-hint { position: absolute; top: -17px; right: 0; font-size: 11px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bgm-save { display: flex; gap: 12px; }
.bgm-save button { border: 1px solid var(--edge); background: var(--raised); color: var(--text); min-height: 36px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.bgm-page button:disabled { cursor: not-allowed; opacity: .65; }
.bgm-drop-overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(18,18,18,.95); border: 1px dashed var(--brass); pointer-events: none; padding: 24px; text-align: center; }
.bgm-model { flex: none; font-size: 10px; margin-top: 4px; }
.bgm-model summary { cursor: pointer; color: var(--text-2); padding: 5px 0; }
.bgm-model-name { float: right; }
.bgm-model-body { position: fixed; bottom: 62px; right: 30px; z-index: 110; width: min(740px,calc(100vw - 60px)); max-height: calc(100dvh - 140px); overflow: auto; background: var(--surface); border: 1px solid var(--edge); padding: 18px 24px; line-height: 1.8; font-size: 12px; color: var(--text-2); }
.bgm-model-body dl { margin-block: 18px; }
.bgm-model-body dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding-block: 5px; }
.bgm-model-body dd { margin: 0; }
.bgm-model-body nav { display: flex; flex-wrap: wrap; gap: 18px; }
.bgm-model-body a { color: var(--text); text-underline-offset: 4px; }
.bgm-app .bgm-footer { min-height: 24px; padding: 2px 30px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; border-top: 0; font-size: 10px; }
.bgm-footer button { border: 0; background: none; color: var(--text-2); font: inherit; cursor: pointer; padding: 0; }
.bgm-footer a { color: var(--text-2); text-decoration: none; }
.bgm-business { background: var(--surface); color: var(--text); border: 1px solid var(--edge); width: min(520px,calc(100vw - 32px)); padding: 26px; }
.bgm-business::backdrop { background: rgba(0,0,0,.75); }
.bgm-business form { display: flex; justify-content: flex-end; }
.bgm-business form button { width: 36px; height: 36px; border: 0; background: none; color: var(--text); font-size: 24px; cursor: pointer; }
.bgm-business .biz { font-size: 13px; line-height: 1.8; }
.bgm-page :focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.bgm-page [hidden] { display: none !important; }
@container bgm-page (min-width: 600px) and (max-width: 840px) {
 .bgm-control-bar { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px 18px; }
 .bgm-transport { grid-column: 1; grid-row: 1; }
 .bgm-region-inputs { grid-column: 2 / 4; grid-row: 1; justify-self: end; }
 .bgm-settings { grid-column: 1 / 3; grid-row: 2; max-width: none; }
 .bgm-actions { grid-column: 3; grid-row: 2; }
 .bgm-save { flex-direction: column; gap: 4px; }
 .bgm-save button { min-height: 28px; padding-block: 4px; }
 .bgm-settings { min-width: 0; justify-self: start; }
}
@media (min-height: 521px) {
@container bgm-page (min-width: 740px) {
 .bgm-workspace[data-media-shape="portrait"] .bgm-source { display: grid; grid-template-columns: minmax(0,1fr) minmax(340px,.9fr); grid-template-rows: 36px minmax(0,1fr); column-gap: 28px; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-preview-bar { grid-column: 1; grid-row: 1; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-stage { grid-column: 1; grid-row: 2; height: 100%; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-edit-dock { display: flex; flex-direction: column; grid-column: 2; grid-row: 1 / 3; align-self: center; min-width: 0; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-control-bar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; padding: 18px; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-transport { grid-column: 1 / 3; grid-row: 1; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-region-inputs { grid-column: 1 / 3; grid-row: 2; justify-self: stretch; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-region-inputs label { flex: 1; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-region-inputs input { width: 100%; min-width: 0; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-settings { grid-column: 1 / 3; grid-row: 3; max-width: none; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-actions { grid-column: 1 / 3; grid-row: 4; justify-content: space-between; margin-top: 7px; }
 .bgm-workspace[data-media-shape="portrait"] .bgm-save { position: static; flex-direction: row; gap: 8px; }
}
}
@media (max-width: 1300px) and (min-width: 761px) { .bgm-control-bar { gap: 14px; } .bgm-transport { gap: 6px; } .bgm-region-inputs { gap: 6px; } .bgm-region-inputs input { width: 74px; } .bgm-actions { gap: 10px; } .bgm-process { min-width: 120px; padding-inline: 12px; } .bgm-save { gap: 10px; } }
@media (max-height: 760px) and (min-width: 761px) { .bgm-app .bgm-page { padding-top: 10px; } .bgm-heading { height: 32px; margin-bottom: 4px; } .bgm-stage { padding-block: 6px; } .bgm-region { padding-top: 8px; } .bgm-control-bar { padding-top: 11px; } }
@media (max-width: 760px) {
 .bgm-app .bgm-page { padding: 10px 14px 4px; }
 .bgm-heading { height: auto; min-height: 34px; align-items: flex-start; flex-direction: column; gap: 5px; margin-bottom: 5px; }
 .bgm-heading h1 { font-size: 21px; }
 .bgm-file-row { width: 100%; gap: 12px; min-height: 24px; }
 .bgm-file-row > span { max-width: none; flex: 1; font-size: 10px; }
 .bgm-file-row button { min-height: 28px; font-size: 11px; }
 .bgm-listen-row { gap: 18px; }
 .bgm-listen-row button { font-size: 11px; min-height: 30px; }
 .bgm-stage { padding-block: 4px; }
 .bgm-drop-title { font-size: 18px; }
 .bgm-drop > svg { width: 36px; height: 36px; }
 .bgm-region { padding-top: 8px; }
 .bgm-control-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px 8px; padding-top: 10px; }
 .bgm-transport { grid-column: 1; gap: 5px; }
 .bgm-icon-button { width: 25px; }
 .bgm-transport output { font-size: 13px; min-width: 56px; }
 .bgm-region-inputs { grid-column: 2; gap: 7px; }
 .bgm-region-inputs label { flex-direction: column; align-items: flex-start; gap: 1px; font-size: 11px; }
 .bgm-region-inputs input { width: 64px; font-size: 13px; height: 34px; padding-inline: 4px; }
 .bgm-settings { grid-column: 1; max-width: none; min-width: 0; }
 .bgm-actions { grid-column: 2; gap: 0; }
 .bgm-process { min-width: 136px; height: 40px; font-size: 14px; }
 .bgm-save { position: absolute; bottom: 2px; right: 8px; font-size: 10px; }
 .bgm-save button { font-size: 11px; min-height: 28px; padding: 4px 8px; }
 .bgm-control-bar { padding: 18px 8px 36px; position: relative; }
 .bgm-strength-head { font-size: 12px; }
 .bgm-model-body { right: 14px; width: calc(100vw - 28px); padding: 14px; }
 .bgm-model-body dl > div { grid-template-columns: 86px 1fr; gap: 10px; }
 .bgm-model-body dd { overflow-wrap: anywhere; }
 .bgm-app .bgm-footer { padding-inline: 14px; min-height: 22px; }
}
@media (min-width: 761px) and (max-height: 520px) {
 .bgm-app .bgm-page { padding-top: 4px; padding-bottom: 0; }
 .bgm-heading { height: 26px; margin-bottom: 0; }
 .bgm-heading h1 { font-size: 19px; }
 .bgm-preview-bar { min-height: 24px; }
 .bgm-listen-row button { min-height: 24px; padding-block: 2px; font-size: 10px; }
 .bgm-stage { padding-block: 4px; }
 .bgm-region { padding-top: 3px; }
 .bgm-region-mode button { min-height: 22px; padding-block: 2px; }
 .bgm-time-rail { height: 28px; margin-top: 2px; }
 .bgm-waveform { height: 28px; }
 .bgm-time-track { top: 13px; }
 .bgm-time-selection { top: 0; bottom: 0; }
 .bgm-time-handle { height: 40px; top: -6px; }
 .bgm-time-handle::after { height: 28px; margin-block: 6px; }
 .bgm-time-handle::before { top: 15px; }
 .bgm-playhead { height: 28px; }
 .bgm-time-extents { padding-top: 1px; font-size: 9px; }
 .bgm-control-bar { padding-top: 4px; padding-bottom: 2px; gap: 8px; }
 .bgm-play-button { width: 32px; height: 32px; }
 .bgm-process { height: 34px; }
 .bgm-process-hint { top: -14px; font-size: 10px; }
 .bgm-save button { min-height: 18px; }
 .bgm-model { margin: 0; }
 .bgm-model summary { padding-block: 1px; font-size: 9px; }
 .bgm-app .bgm-footer { min-height: 18px; }
 .bgm-source { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 320px; grid-template-rows: 24px minmax(0,1fr); column-gap: 16px; }
 .bgm-preview-bar { grid-column: 1; grid-row: 1; }
 .bgm-stage { grid-column: 1; grid-row: 2; height: 100%; }
 .bgm-edit-dock { grid-column: 2; grid-row: 1 / 3; align-self: center; display: flex; flex-direction: column; min-width: 0; }
 .bgm-region { border-top: 0; }
 .bgm-control-bar { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px 8px; padding: 16px 8px 32px; }
 .bgm-transport { grid-column: 1; gap: 5px; }
 .bgm-icon-button { width: 25px; }
 .bgm-transport output { min-width: 56px; font-size: 11px; }
 .bgm-region-inputs { grid-column: 2; gap: 7px; }
 .bgm-region-inputs label { flex-direction: column; align-items: flex-start; gap: 1px; font-size: 9px; }
 .bgm-region-inputs input { width: 64px; height: 30px; font-size: 13px; padding-inline: 4px; }
 .bgm-settings { grid-column: 1; min-width: 0; max-width: none; }
 .bgm-actions { grid-column: 2; }
 .bgm-process { min-width: 136px; font-size: 14px; }
 .bgm-save { position: absolute; bottom: 0; right: 0; flex-direction: row; gap: 12px; }
 .bgm-notice { position: absolute; bottom: 4px; left: 0; max-width: calc(100% - 336px); z-index: 5; padding: 6px; background: var(--surface); }
}

/* Before a file is selected, offer one compact action instead of an empty editor. */
.bgm-page.bgm-empty { justify-content: center; }
.bgm-empty .bgm-heading { width: min(100%,600px); height: auto; min-height: 34px; margin: 0 auto 20px; justify-content: center; align-items: center; }
.bgm-empty .bgm-workspace { flex: 0 1 300px; width: min(100%,600px); max-height: calc(100dvh - 200px); margin-inline: auto; }
.bgm-empty .bgm-source { display: flex; }
.bgm-empty .bgm-preview-bar, .bgm-empty .bgm-edit-dock { display: none; }
.bgm-empty .bgm-stage { height: 100%; padding: 0; }
.bgm-empty .bgm-drop { width: 100%; gap: 18px; }
.bgm-empty .bgm-drop:focus-visible { outline-offset: -4px; }
.bgm-empty .bgm-drop > svg { width: 36px; height: 36px; }
.bgm-empty .bgm-drop-title { font-size: 18px; }
.bgm-empty .bgm-drop-key { min-height: 44px; padding: 11px 28px; background: var(--paper); border-color: var(--paper); border-radius: 2px; color: var(--ink); font-size: 14px; font-weight: 500; }
.bgm-empty .bgm-notice { position: static; max-width: none; margin: 10px 0 0; padding: 0; text-align: center; }
.bgm-empty .bgm-model { position: relative; width: min(100%,600px); margin: 10px auto 0; }
.bgm-empty .bgm-model-body { position: absolute; bottom: calc(100% + 10px); right: 0; width: 100%; max-height: min(440px,calc(100dvh - 220px)); }
