.waveform-container {
    position: relative;
}

.media-editor-root {
    width: 100%;
}

.small-select .mud-select-input {
    font-size: 0.75rem;
}

.media-editor-root .media-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 1px !important;
    column-gap: 1px !important;
}

.media-editor-root .media-row > .video-col,
.media-editor-root .media-row > .wave-col {
    margin: 0;
    padding: 0;
}

.media-editor-root .media-row .video-col {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
}

.media-editor-root .media-row .video-col video {
    height: var(--wf-h, 150px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.plyr--fullscreen-active video,
.plyr--fullscreen-active .plyr__video-wrapper,
.plyr:fullscreen video,
.plyr:fullscreen .plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    border-radius: 0 !important;
}

.plyr--fullscreen-active,
.plyr:fullscreen {
    background: #000;
}

.media-editor-root .media-row .wave-col {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.media-editor-root .media-row .waveform-container {
    width: 100%;
    height: var(--wf-h, 150px);
    margin: 0;
    padding: 0;
}

/* Multi-track: the container grows with the lanes under the waveform */
.media-editor-root .media-row .waveform-container.multitrack {
    height: auto;
}

.media-editor-root .waveform-container:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.media-toolbar {
    width: 100%;
    box-sizing: border-box;
}

.media-editor-root .media-row.pip-active .video-col {
    flex: 0;
    min-width: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.media-editor-root .media-row.pip-active .wave-col {
    flex: 1;
    width: 100%;
    transition: all 0.3s ease;
}

.media-editor-root .media-row.pip-hidden .video-col {
    display: none;
}

.media-toolbar .compact-time.mud-input-control {
    width: auto;
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 90px;
    margin-right: 10px;
}

.media-toolbar .compact-time .mud-input-input {
    font-size: 0.80rem !important;
    padding: 4px 8px !important;
    height: 32px !important;
    line-height: 24px !important;
}

.media-toolbar .compact-time .mud-input-root {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

.selected-region {
    background-color: #505050 !important; /* Gray 300 */
}

.selected-region > td {
    color: #212121 !important; /* Gray 900 */
}

.selected-region > td .mud-input,
.selected-region > td .mud-input-root,
.selected-region > td .mud-input-input {
    color: white !important;
}

/* Row the operator has ticked as "checked" (green) — kept distinct from the
   grey .selected-region click highlight; wins when a row is both. */
.checked-region {
    background-color: rgba(76, 175, 80, 0.22) !important;
}

.checked-region > td:first-child {
    box-shadow: inset 4px 0 0 0 #4caf50;
}

/* ---- Segment grid (Content page) — compact layout for 1920x1080 ---- */

/* Every column carries an explicit px width on its <th> (see Content.razor).
   Fixed layout makes the browser honour those widths instead of collapsing the
   table to fit a narrow container: spare space is spread across the columns, and
   if the screen is too small the table scrolls horizontally rather than crushing
   Label/Description down to ~100px. */
.segments-grid .mud-table-root {
    width: 100% !important;
    table-layout: fixed !important;
}

/* Trim the generous default cell padding so every column fits without wrapping */
.segments-grid .mud-table-cell {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Type / Label / Description wrap their editor in a MudTooltip, whose root renders
   as inline-block and shrink-wraps to content. MudBlazor only un-inlines it when the
   direct child carries .mud-width-full, but MudInput uses .mud-input-control-full-width,
   so the wrapper stays narrow and the FullWidth input has nothing to fill. Force the
   tooltip that sits directly in a cell to be a full-width block (the action-button
   tooltips are nested deeper and unaffected). */
.segments-grid .mud-table-cell > .mud-tooltip-root {
    display: block;
    width: 100%;
}

/* Keep the action buttons on a single line */
.segments-grid__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.segments-grid__actions .mud-button-root {
    flex: 0 0 auto;
}
