/* CUE/IO design system. Load after view styles; all shared visual values live here.
   Geometry for waveform/DMX/timeline controls stays in its owning stylesheet. */
:root {
  color-scheme: dark;
  --sc-bg: #0c0e12;
  --sc-surface: #14171c;
  --sc-surface-raised: #1d2128;
  --sc-surface-soft: #101318;
  --sc-surface-hover: #242a32;
  --sc-border: #2a3039;
  --sc-border-strong: #566273;
  --sc-text: #edf0f4;
  --sc-muted: #a4aebb;
  --sc-subtle: #8d98a7;
  /* Brand blue comes directly from the CUE/IO wordmark's slash. */
  --sc-primary: #00e0ff;
  --sc-primary-strong: #00b8d6;
  --sc-primary-hover: #6cecff;
  --sc-on-primary: #06232d;
  --sc-primary-rgb: 0 224 255;
  --sc-success: #70d5aa;
  --sc-success-rgb: 112 213 170;
  --sc-warning: #edc375;
  --sc-warning-rgb: 237 195 117;
  --sc-danger: #f28c96;
  --sc-danger-strong: #a82e41;
  --sc-danger-rgb: 242 140 150;
  --sc-record: var(--sc-danger);
  --sc-record-strong: var(--sc-danger-strong);
  --sc-player: var(--sc-primary);
  --sc-player-strong: var(--sc-primary-strong);
  --sc-timecode: #b9a4e8;
  --sc-timecode-strong: #6a519d;
  --sc-timecode-rgb: 185 164 232;
  --sc-neutral-rgb: 164 174 187;
  --sc-surface-rgb: 16 19 24;
  --sc-white-rgb: 237 240 244;
  --sc-black-rgb: 0 0 0;
  --sc-space-1: 4px;
  --sc-space-2: 8px;
  --sc-space-3: 12px;
  --sc-space-4: 16px;
  --sc-space-5: 20px;
  --sc-space-6: 24px;
  --sc-space-8: 32px;
  --sc-space-10: 40px;
  --sc-space-12: 48px;
  --sc-radius-xs: 4px;
  --sc-radius-sm: 8px;
  --sc-radius: 12px;
  --sc-radius-dialog: 16px;
  --sc-radius-pill: 999px;
  --sc-shadow: none;
  --sc-shadow-popover: 0 12px 32px rgb(0 0 0 / .32);
  --sc-shadow-dialog: 0 24px 80px rgb(0 0 0 / .48);
  --sc-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sc-font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sc-type-caption: .75rem;
  --sc-type-label: .8125rem;
  --sc-type-body: .875rem;
  --sc-type-section: 1rem;
  --sc-type-title: 1.5rem;
  --sc-control-height: 44px;
  --sc-control-compact: 36px;
  --sc-header-height: 64px;
  --sc-sidebar-width: 224px;
  --sc-desktop-content-width: 1600px;
  --sc-focus: 0 0 0 3px rgb(var(--sc-primary-rgb) / .22);
  --text-main: var(--sc-text);
  --text-muted: var(--sc-muted);
  --accent-1: var(--sc-primary);
  --bs-body-color: var(--sc-text);
  --bs-body-bg: var(--sc-bg);
  --bs-secondary-color: var(--sc-muted);
  --bs-border-color: var(--sc-border);
  --bs-tertiary-bg: var(--sc-surface-raised);
  --bs-secondary-bg: var(--sc-surface-soft);
  --bs-primary-rgb: 0, 224, 255;
  --bs-info-rgb: 0, 224, 255;
  --bs-success-rgb: 112, 213, 170;
  --bs-warning-rgb: 237, 195, 117;
  --bs-danger-rgb: 242, 140, 150;
  --bs-link-color: var(--sc-primary);
  --bs-link-hover-color: var(--sc-primary-hover);
}

html { scroll-padding-top: calc(var(--sc-header-height) + var(--sc-space-6)); }
body {
  background: var(--sc-bg);
  font-family: var(--sc-font);
  font-size: var(--sc-type-body);
  line-height: 1.5;
}
a { color: var(--sc-primary); text-underline-offset: 3px; }
a:hover { color: var(--sc-primary-hover); }
::selection { color: var(--sc-text); background: rgb(var(--sc-primary-rgb) / .25); }
:focus-visible { outline: 2px solid var(--sc-primary); outline-offset: 3px; }
:disabled { cursor: not-allowed; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
strong, b { font-weight: 600; }
.h4, .h3 { font-size: var(--sc-type-title); }
.h5, .h6 { font-size: var(--sc-type-section); }
.small, small, .form-text { font-size: var(--sc-type-caption); line-height: 1.5; }
.form-text { color: var(--sc-muted); margin-top: var(--sc-space-2); }
.showcore-main { padding: var(--sc-space-8) var(--sc-space-8) var(--sc-space-12); }
.showcore-main.showcore-main-wide { max-width: none; }
.app-header { background: var(--sc-bg); box-shadow: none; backdrop-filter: none; }
.app-header .navbar { min-height: var(--sc-header-height); }
.brand-subtitle, .desktop-topbar-copy small, .sidebar-footer small { font-size: var(--sc-type-caption); }
.language-picker-toggle { min-height: var(--sc-control-height); border-radius: var(--sc-radius-sm); background: var(--sc-surface); }
.language-picker-menu { background: var(--sc-surface-raised); border-radius: var(--sc-radius); box-shadow: var(--sc-shadow-popover); }
.language-option-name, .language-picker-current-name { font-size: var(--sc-type-label); }
.language-option { border-radius: var(--sc-radius-sm); }
.language-option.is-selected { background: rgb(var(--sc-primary-rgb) / .1); }

/* Page chrome and section rhythm. */
.ui-page-heading, .page-heading { margin: 0 0 var(--sc-space-6); gap: var(--sc-space-4); }
.ui-page-heading h1, .page-heading h1 { font-size: var(--sc-type-title); margin-bottom: var(--sc-space-1); font-weight: 600; }
.ui-page-heading p, .page-heading p { color: var(--sc-muted); line-height: 1.6; max-width: 72ch; }
.ui-page-heading > i, .ui-page-heading h1 > i { color: var(--sc-muted); }
.ui-page-panel.card, .ui-page-shell { border: 0; background: transparent; box-shadow: none; padding: 0 !important; }
.ui-page-shell > .ui-page-heading { padding-bottom: var(--sc-space-6); border-bottom: 1px solid var(--sc-border); }
.card { background: var(--sc-surface); border-color: var(--sc-border); border-radius: var(--sc-radius); box-shadow: none; }
.card-header, .card-footer { background: transparent; padding: var(--sc-space-4) var(--sc-space-5); }
.card-body { padding: var(--sc-space-5); }
.card.p-3 { padding: var(--sc-space-5) !important; }
.card.p-4 { padding: var(--sc-space-6) !important; }
.ui-page-panel.card.p-4 { padding: 0 !important; }
.ui-page-panel.card.p-3 { padding: 0 !important; }
.record-metric, .player-metric, .readiness-panel { padding: var(--sc-space-4); border-radius: var(--sc-radius-sm); background: var(--sc-surface-soft); }
.record-metric-value, .player-metric-value { font-weight: 600; }

/* Shared controls. Semantic variants use Bootstrap's interaction contract. */
.btn, .action-btn, .file-actions-trigger, .dmx-console .btn, .show-timeline .btn {
  --bs-btn-font-weight: 600;
  min-height: var(--sc-control-height);
  padding: var(--sc-space-2) var(--sc-space-4);
  border-radius: var(--sc-radius-sm);
  font-size: var(--sc-type-label);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sm, .dmx-console .btn-sm, .show-timeline .btn-sm { min-height: var(--sc-control-compact); padding: var(--sc-space-1) var(--sc-space-3); font-size: var(--sc-type-caption); }
.btn-lg { min-height: var(--sc-space-12); padding: var(--sc-space-3) var(--sc-space-5); }
.btn-primary, .btn-info, .dmx-console .btn-info {
  --bs-btn-color: var(--sc-on-primary);
  --bs-btn-bg: var(--sc-primary);
  --bs-btn-border-color: var(--sc-primary);
  --bs-btn-hover-color: var(--sc-on-primary);
  --bs-btn-hover-bg: var(--sc-primary-hover);
  --bs-btn-hover-border-color: var(--sc-primary-hover);
  --bs-btn-active-color: var(--sc-on-primary);
  --bs-btn-active-bg: var(--sc-primary-hover);
  --bs-btn-active-border-color: var(--sc-primary-hover);
  --bs-btn-disabled-color: var(--sc-on-primary);
  --bs-btn-disabled-bg: var(--sc-primary);
  --bs-btn-disabled-border-color: var(--sc-primary);
  background: var(--sc-primary); border-color: var(--sc-primary); color: var(--sc-on-primary);
}
.btn-primary:is(:hover, :active, :focus-visible), .btn-info:is(:hover, :active, :focus-visible), .dmx-console .btn-info:hover { background: var(--sc-primary-hover); border-color: var(--sc-primary-hover); color: var(--sc-on-primary); }
.btn-outline-light, .btn-outline-secondary, .btn-secondary, .dmx-console .btn-outline-light, .dmx-console .btn-outline-secondary {
  --bs-btn-active-bg: var(--sc-surface-hover);
  --bs-btn-active-color: var(--sc-text);
  --bs-btn-disabled-color: var(--sc-muted);
  background: var(--sc-surface-raised); border-color: var(--sc-border-strong); color: var(--sc-text);
}
.btn-outline-light:is(:hover, :active, :focus-visible), .btn-outline-secondary:is(:hover, :active, :focus-visible), .btn-secondary:hover, .dmx-console .btn-outline-light:hover { background: var(--sc-surface-hover); border-color: var(--sc-subtle); color: var(--sc-text); }
.btn-outline-primary, .btn-outline-info { color: var(--sc-primary); border-color: rgb(var(--sc-primary-rgb) / .4); background: transparent; }
.btn-outline-primary:is(:hover, :active), .btn-outline-info:is(:hover, :active) { color: var(--sc-primary-hover); border-color: var(--sc-primary); background: rgb(var(--sc-primary-rgb) / .1); }
.btn-danger { background: var(--sc-danger-strong); border-color: var(--sc-danger-strong); color: var(--sc-text); }
.btn-danger:is(:hover, :active) { background: color-mix(in srgb, var(--sc-danger-strong), var(--sc-danger) 20%); border-color: var(--sc-danger); }
.btn-warning { background: var(--sc-warning); border-color: var(--sc-warning); color: var(--sc-on-primary); }
.btn-warning:is(:hover, :active) { background: color-mix(in srgb, var(--sc-warning), var(--sc-text) 20%); border-color: var(--sc-warning); color: var(--sc-on-primary); }
.btn-outline-danger, .dmx-console .btn-outline-danger { background: transparent; color: var(--sc-danger); border-color: rgb(var(--sc-danger-rgb) / .4); }
.btn-outline-danger:is(:hover, :active), .dmx-console .btn-outline-danger:hover { color: var(--sc-danger); background: rgb(var(--sc-danger-rgb) / .12); border-color: var(--sc-danger); }
.btn-outline-warning { background: transparent; color: var(--sc-warning); border-color: rgb(var(--sc-warning-rgb) / .4); }
.btn-outline-warning:is(:hover, :active) { color: var(--sc-warning); background: rgb(var(--sc-warning-rgb) / .12); border-color: var(--sc-warning); }
.btn-outline-success { background: transparent; color: var(--sc-success); border-color: rgb(var(--sc-success-rgb) / .4); }
.btn-outline-success:is(:hover, :active) { color: var(--sc-success); background: rgb(var(--sc-success-rgb) / .12); border-color: var(--sc-success); }
.btn-link { background: transparent; color: var(--sc-primary); }
.btn:focus-visible { box-shadow: var(--sc-focus); }
.btn:disabled, .btn.disabled, .dmx-console .btn:disabled { opacity: .45; filter: none; transform: none; }
.primary-action-row .btn { min-height: var(--sc-space-12); }
.form-label, .record-form-label, .dmx-console .form-label, .show-timeline .form-label {
  display: block; margin-bottom: var(--sc-space-2); color: var(--sc-text); font-size: var(--sc-type-label); font-weight: 500; letter-spacing: 0; text-transform: none;
}
.form-control, .form-select, .dmx-console .form-control, .dmx-console .form-select, .show-timeline .form-control, .show-timeline .form-select {
  min-height: var(--sc-control-height); border: 1px solid var(--sc-border-strong); border-radius: var(--sc-radius-sm); background-color: var(--sc-surface-soft); color: var(--sc-text); padding: var(--sc-space-2) var(--sc-space-3); font-size: var(--sc-type-body); line-height: 1.5;
}
.form-select, .dmx-console .form-select, .show-timeline .form-select { padding-right: var(--sc-space-8); }
.form-control::placeholder { color: var(--sc-subtle); opacity: 1; }
.form-control:focus, .form-select:focus, .dmx-console .form-control:focus, .dmx-console .form-select:focus, .show-timeline .form-control:focus, .show-timeline .form-select:focus { border-color: var(--sc-primary); background-color: var(--sc-surface-soft); color: var(--sc-text); box-shadow: var(--sc-focus); }
.form-control:disabled, .form-select:disabled { opacity: .6; background-color: var(--sc-surface-raised); }
.input-group-text { color: var(--sc-muted); background: var(--sc-surface-raised); border-color: var(--sc-border-strong); border-radius: var(--sc-radius-sm); }
.form-check { min-height: var(--sc-space-6); padding-top: var(--sc-space-1); }
.form-check-label { color: var(--sc-text); line-height: 1.5; cursor: pointer; }
.form-check-input { border-color: var(--sc-subtle); background-color: var(--sc-surface-soft); width: 1.125rem; height: 1.125rem; margin-top: .15em; }
.form-check-input:checked { border-color: var(--sc-primary); background-color: var(--sc-primary); }
.license-removal-panel .form-check-input:checked { background-color: var(--sc-danger); border-color: var(--sc-danger); }
.form-check-input:checked[type="checkbox"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2306232d' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-check-input:checked[type="radio"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%2306232d'/%3e%3c/svg%3e"); }
.form-check-input[type="checkbox"]:indeterminate { background-color: var(--sc-primary); border-color: var(--sc-primary); --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2306232d' stroke-linecap='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e"); }
.form-check-input:focus { box-shadow: var(--sc-focus); border-color: var(--sc-primary); }
.form-switch .form-check-input { width: 2.25em; }
.form-switch .form-check-input:checked { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2306232d'/%3e%3c/svg%3e"); }
.form-range { accent-color: var(--sc-primary); }
.form-range::-webkit-slider-thumb { background: var(--sc-primary); }
.form-range::-moz-range-thumb { background: var(--sc-primary); }

/* Navigation and tabs. */
.showcore-main .status-view-nav, .tl-tabs { border-color: var(--sc-border); background: var(--sc-surface-soft); border-radius: var(--sc-radius-sm); padding: var(--sc-space-1); gap: var(--sc-space-1); }
.status-view-nav-link, .tl-tab, .manual-builder-tab, .player-library-tab { border-radius: var(--sc-radius-xs); font-size: var(--sc-type-label); font-weight: 500; letter-spacing: 0; }
.showcore-main .status-view-nav-link.is-active, .tl-tab.is-active { color: var(--sc-text); border-color: var(--sc-border-strong); background: var(--sc-surface-hover); }
.tl-tab { min-height: var(--sc-control-height); }
#settingsTabs { gap: var(--sc-space-1); margin-bottom: var(--sc-space-6); padding-bottom: var(--sc-space-4); border-bottom: 1px solid var(--sc-border); }
#settingsTabs .nav-link { display: inline-flex; align-items: center; min-height: var(--sc-control-height); padding: var(--sc-space-2) var(--sc-space-3); border: 1px solid transparent; border-radius: var(--sc-radius-sm); color: var(--sc-muted); font-size: var(--sc-type-label); font-weight: 500; }
#settingsTabs .nav-link:hover { color: var(--sc-text); background: var(--sc-surface-raised); }
#settingsTabs .nav-link.active { color: var(--sc-primary); background: rgb(var(--sc-primary-rgb) / .09); border-color: rgb(var(--sc-primary-rgb) / .22); }
.settings-page-shell .tab-content.pt-4 { padding-top: 0 !important; }
.nav-link:focus-visible, .tl-tab:focus-visible { outline: 2px solid var(--sc-primary); }

/* Tables, menus, dialogs, feedback and empty states. */
.table { --bs-table-striped-bg: rgb(var(--sc-white-rgb) / .015); --bs-table-hover-bg: rgb(var(--sc-white-rgb) / .035); --bs-table-border-color: var(--sc-border); font-size: var(--sc-type-label); }
.table > :not(caption) > * > * { padding: var(--sc-space-4); vertical-align: middle; }
.table thead th, .show-table th { background: var(--sc-surface-soft); color: var(--sc-muted); font-size: var(--sc-type-caption); font-weight: 500; letter-spacing: .02em; text-transform: none; border-bottom: 1px solid var(--sc-border-strong); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-responsive { border: 1px solid var(--sc-border); border-radius: var(--sc-radius); background: var(--sc-surface); }
.table-responsive .table { margin-bottom: 0; }
.dropdown-menu { --bs-dropdown-link-hover-bg: var(--sc-surface-hover); --bs-dropdown-link-active-bg: rgb(var(--sc-primary-rgb) / .12); --bs-dropdown-link-color: var(--sc-text); --bs-dropdown-link-hover-color: var(--sc-text); padding: var(--sc-space-1); border: 1px solid var(--sc-border-strong); border-radius: var(--sc-radius-sm); background: var(--sc-surface-raised); box-shadow: var(--sc-shadow-popover); }
.dropdown-item { min-height: var(--sc-control-height); display: flex; align-items: center; gap: var(--sc-space-2); padding: var(--sc-space-2) var(--sc-space-3); border-radius: var(--sc-radius-xs); font-size: var(--sc-type-label); }
.file-actions-menu :is(.file-action-duplicate, .file-action-audio-manage, .file-action-trim) { color: var(--sc-text); }
.file-actions-menu :is(.file-action-duplicate, .file-action-audio-manage, .file-action-trim):is(:hover, :focus) { color: var(--sc-text); background: var(--sc-surface-hover); }
.modal-content { border-color: var(--sc-border-strong); border-radius: var(--sc-radius-dialog); background: var(--sc-surface); box-shadow: var(--sc-shadow-dialog); }
.modal-header, .modal-footer { padding: var(--sc-space-5) var(--sc-space-6); border-color: var(--sc-border); gap: var(--sc-space-2); }
.modal-body { padding: var(--sc-space-6); }
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-footer .btn { margin: 0; }
/* A form between modal-content and modal-body must participate in the flex
   layout, otherwise the body's scroll area grows beyond a phone viewport. */
.modal { --sc-modal-height: calc(100dvh - 2 * var(--bs-modal-margin, .5rem)); overflow-y: auto; }
.modal .modal-content { max-height: var(--sc-modal-height); min-height: 0; }
.modal .modal-content > form { display: flex; flex-direction: column; min-height: 0; max-height: var(--sc-modal-height); overflow: hidden; }
.modal .modal-header, .modal .modal-footer { flex-shrink: 0; }
.modal .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.modal .modal-body > :last-child { margin-bottom: 0; }
.modal .form-control, .modal .form-select { max-width: 100%; }
.scheduler-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.scheduler-summary-grid > .scheduler-summary-card { margin-bottom: 0 !important; min-width: 0; }
@media (max-width: 767.98px) {
  .scheduler-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-dialog { margin: .5rem; }
  .modal .modal-footer { padding-bottom: max(var(--sc-space-4), env(safe-area-inset-bottom)); }
}
.offcanvas { background: var(--sc-surface); }
.alert { padding: var(--sc-space-4); border-radius: var(--sc-radius-sm); font-size: var(--sc-type-label); line-height: 1.6; }
.alert-info { color: var(--sc-primary); border-color: rgb(var(--sc-primary-rgb) / .25); background: rgb(var(--sc-primary-rgb) / .07); }
.alert-success { color: var(--sc-success); border-color: rgb(var(--sc-success-rgb) / .25); background: rgb(var(--sc-success-rgb) / .07); }
.alert-warning { color: var(--sc-warning); border-color: rgb(var(--sc-warning-rgb) / .25); background: rgb(var(--sc-warning-rgb) / .07); }
.alert-danger { color: var(--sc-danger); border-color: rgb(var(--sc-danger-rgb) / .3); background: rgb(var(--sc-danger-rgb) / .08); }
.alert-secondary { color: var(--sc-muted); border-color: var(--sc-border); background: var(--sc-surface-soft); }
.badge { padding: var(--sc-space-1) var(--sc-space-2); border-radius: var(--sc-radius-xs); font-size: var(--sc-type-caption); font-weight: 500; line-height: 1.4; }
.badge:is(.bg-primary, .bg-info, .bg-success, .bg-warning, .bg-danger, .text-bg-primary, .text-bg-info, .text-bg-success, .text-bg-warning, .text-bg-danger) { color: var(--sc-on-primary) !important; }
.progress { border-radius: var(--sc-radius-xs); background: var(--sc-surface-hover); }
.progress-bar { background: var(--sc-primary); }
.empty-panel { padding: var(--sc-space-12) var(--sc-space-6); color: var(--sc-muted); line-height: 1.6; }
.empty-panel i { font-size: 2rem; color: var(--sc-subtle); margin-bottom: var(--sc-space-4); }
.page-link { min-width: var(--sc-control-height); min-height: var(--sc-control-height); display: grid; place-items: center; color: var(--sc-muted); background: var(--sc-surface); border-color: var(--sc-border); }
.page-link:hover, .page-item.active .page-link { color: var(--sc-primary); background: var(--sc-surface-hover); border-color: var(--sc-border-strong); }
.placeholder { background-color: var(--sc-surface-hover); border-radius: var(--sc-radius-xs); }
.tooltip { --bs-tooltip-bg: var(--sc-surface-hover); --bs-tooltip-color: var(--sc-text); --bs-tooltip-border-radius: var(--sc-radius-xs); --bs-tooltip-font-size: var(--sc-type-caption); }

/* Workspace-specific surfaces use the same visual vocabulary. */
.mode-selector-shell { padding: var(--sc-space-5); background: var(--sc-surface); }
.mode-selector-heading { margin-bottom: var(--sc-space-4); }
.mode-selector-title { font-size: var(--sc-type-section); font-weight: 600; letter-spacing: -.02em; text-transform: none; }
.mode-btn { min-height: 88px; padding: var(--sc-space-4); border-radius: var(--sc-radius-sm); background: var(--sc-surface-soft); gap: var(--sc-space-3); justify-content: flex-start; box-shadow: none; }
.mode-btn-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: var(--sc-radius-sm); font-size: 1.25rem; background: transparent; }
.mode-btn-label { font-size: var(--sc-type-label); font-weight: 600; letter-spacing: .035em; }
.mode-btn-description, .mode-btn-state { font-size: var(--sc-type-caption); font-weight: 400; }
.mode-btn-state::before { box-shadow: none; width: 6px; height: 6px; }
.mode-btn.is-active { border-color: var(--mode-color); background: color-mix(in srgb, var(--mode-color) 7%, var(--sc-surface)); box-shadow: none; }
.mode-stop-all { min-height: var(--sc-control-height); border-radius: var(--sc-radius-sm); padding: var(--sc-space-2) var(--sc-space-3); font-weight: 500; }
.record-command-center, .record-setup-panel, .record-live-panel, .tc-command-center { background: var(--sc-surface); box-shadow: none; border-color: var(--sc-border); }
.record-command-display { background: var(--sc-surface-soft); border-color: var(--sc-border); border-radius: var(--sc-radius-sm); }
.record-command-signal { background: rgb(var(--sc-danger-rgb) / .08); box-shadow: none; }
.record-start-button:not(:disabled) { box-shadow: none; }
.record-section-kicker, .record-command-label, .record-command-timer > span, .player-metric-label, .record-metric-label { font-size: var(--sc-type-caption); color: var(--sc-muted); font-weight: 500; letter-spacing: .025em; }
.player-layout { gap: var(--sc-space-6); }
.player-now-playing { border: 1px solid var(--sc-border); border-radius: var(--sc-radius-sm); padding: var(--sc-space-5); background: var(--sc-surface-soft); box-shadow: none; }
.player-now-playing-title { font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.3; }
.player-now-playing-label, .player-waveform-label { color: var(--sc-muted); font-weight: 500; letter-spacing: .04em; }
.player-output-monitor-toggle { border-radius: var(--sc-radius-sm); background: transparent; border-color: var(--sc-border-strong); }
.player-audio-file, .player-audio-status { border-radius: var(--sc-radius-xs); }
.player-library-list .show-item { background: var(--sc-surface-soft); box-shadow: none; }
.player-waveform-stage { background: var(--sc-surface-soft); border-radius: var(--sc-radius-sm); }
.device-profile-card { background: var(--sc-surface); border-color: var(--sc-border) !important; }
.device-profile-icon, .monitor-page-icon, .dmx-console-icon { border-radius: var(--sc-radius-sm); background: var(--sc-surface-raised); color: var(--sc-primary); }
.device-profile-editor, .device-profile-technical, .rtc-device { background: var(--sc-surface-soft); border-radius: var(--sc-radius-sm); }
.show-timeline { --tl-accent: var(--sc-primary); --tl-border: var(--sc-border); color: var(--sc-text); }
.dmx-console { --console-panel: var(--sc-surface); }
.show-timeline .card, .dmx-console .card { background: var(--sc-surface); border: 1px solid var(--sc-border); border-radius: var(--sc-radius); padding: var(--sc-space-5); box-shadow: none; }
.dmx-console-workspace, .dmx-console-sidebar, .dmx-console-stage { gap: var(--sc-space-5); }
.dmx-console-profile-picker-toggle { min-height: var(--sc-control-height); border-radius: var(--sc-radius-sm); background: var(--sc-surface-soft); border-color: var(--sc-border-strong); font-size: var(--sc-type-label); }
.dmx-console-profile-picker-panel, .dmx-console-profile-menu { background: var(--sc-surface-raised); border-color: var(--sc-border-strong); border-radius: var(--sc-radius-sm); box-shadow: var(--sc-shadow-popover); }
.dmx-console-profile-search-wrap, .dmx-console-profile-search-wrap input { background: var(--sc-surface-soft); }
.tl-cue-item, .tl-fader { background: var(--sc-surface-soft); border-radius: var(--sc-radius-sm); border-color: var(--sc-border); }
.tl-cue-item.is-selected { border-color: var(--sc-primary); background: rgb(var(--sc-primary-rgb) / .07); }
.tl-block { background: color-mix(in srgb, var(--sc-primary) 16%, var(--sc-surface-soft)); color: var(--sc-text); }
.tl-block.is-effect { background: color-mix(in srgb, var(--sc-timecode) 16%, var(--sc-surface-soft)); color: var(--sc-text); }
.tl-output-settings[open] { flex: 1 1 100%; width: 100%; }
.tl-output-settings .tl-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); width: 100%; max-width: 100%; align-items: end; }
.tl-output-settings .tl-actions > div { min-width: 0; }
.tl-heading, .dmx-console-heading, .monitor-page-header { margin-top: 0; margin-bottom: var(--sc-space-6); }
.tl-eyebrow, .dmx-console-eyebrow { color: var(--sc-muted); font-size: var(--sc-type-caption); letter-spacing: .06em; font-weight: 500; }
.monitor-status-pill, .dmx-console-status, .tl-status, .record-state-badge { font-size: var(--sc-type-caption); font-weight: 500; border-radius: var(--sc-radius-sm); }
.status-dot.online, .sidebar-footer-status i { box-shadow: none; filter: none; }
.sidebar-footer-status i { color: var(--sc-primary); }
/* Legacy component accents share brand blue. Success and live-state widgets
   retain green; fixture swatches and measured signal colors retain their data. */
.mode-device-identity,
.show-actions .play-btn,
.player-library-actions .player-library-play,
.player-library-actions .play-btn,
.player-output-universe-chip,
.dmx-console-rate,
.dmx-console-profile-picker-toggle[aria-expanded="true"],
.dmx-console-profile-search-wrap:focus-within,
.dmx-console-profile-option[aria-selected="true"],
.dmx-console-profile-sync > i,
.dmx-console-range,
.tl-fixture-card.is-selected .tl-fixture-symbol,
.tl-fixture-check,
.tl-group-chip button:hover,
.tl-look-tile.is-selected,
.tl-look-controls output,
.tl-clip-envelope,
.tl-handle-fade-in,
.is-drop-target,
.manual-effect-forest-families,
.manual-effect-forest-family-card:has(input:checked),
.manual-effect-forest-family-card:has(input:focus-visible),
.rtc-device.is-selected,
.rtc-device-selected,
.gpio-preset,
.show-sequence-fixed-value,
.monitor-current-value,
.monitor-value-card {
  --sc-success: var(--sc-primary);
  --sc-success-rgb: var(--sc-primary-rgb);
}
.dmx-console .btn:focus-visible,
.dmx-console input:focus-visible,
.dmx-console select:focus-visible,
.dmx-console-channel-name:focus-visible { outline-color: var(--sc-primary); }
.show-table .badge.text-bg-success { background-color: rgb(var(--sc-primary-rgb) / .12) !important; color: var(--sc-primary) !important; }
.file-manager-toolbar { --file-manager-control-height: var(--sc-control-height); }
.help-card, .docs-card, .docs-sidebar { box-shadow: none; }

@media (min-width: 768px) {
  .show-table { min-width: 900px; width: 100%; table-layout: fixed; }
  .show-table > :not(caption) > * > * { padding: var(--sc-space-4) var(--sc-space-3); overflow-wrap: anywhere; }
  .show-table th { white-space: normal; }
  .show-table th:nth-child(1) { width: 22%; }
  .show-table th:nth-child(2) { width: 16%; }
  .show-table th:nth-child(3) { width: 10%; }
  .show-table th:nth-child(4) { width: 9%; }
  .show-table th:nth-child(5) { width: 9%; }
  .show-table th:nth-child(6) { width: 10%; }
  .show-table th:nth-child(7) { width: 12%; }
  .show-table th:nth-child(8) { width: 12%; }
  .show-table .file-actions { min-width: 0; }
  .show-table .file-actions-trigger { gap: var(--sc-space-1); padding-inline: var(--sc-space-2); }
  .desktop-sidebar { background: var(--sc-surface-soft); box-shadow: none; padding: var(--sc-space-6) var(--sc-space-3) var(--sc-space-4); }
  .sidebar-brand { margin: 0 var(--sc-space-3) var(--sc-space-8); padding: 0; }
  .sidebar-brand-wordmark { width: 112px; }
  .sidebar-brand-subtitle { font-size: .6875rem; line-height: 1.5; letter-spacing: 0; white-space: normal; }
  .desktop-sidebar .desktop-nav { gap: var(--sc-space-6); }
  .sidebar-nav-label { font-size: .6875rem; letter-spacing: .06em; font-weight: 500; color: var(--sc-subtle); margin: 0 var(--sc-space-3) var(--sc-space-2); }
  .desktop-sidebar .app-nav-link { min-height: var(--sc-control-height); border-radius: var(--sc-radius-sm); padding: var(--sc-space-2) var(--sc-space-3); font-size: var(--sc-type-label); font-weight: 500; gap: var(--sc-space-3); }
  .desktop-sidebar .app-nav-link.is-active { background: rgb(var(--sc-primary-rgb) / .09); color: var(--sc-primary); border-color: transparent; box-shadow: none; }
  .desktop-sidebar .app-nav-link.is-active::before { display: none; }
  .desktop-sidebar .app-nav-link:hover { background: var(--sc-surface-raised); border-color: transparent; }
  .desktop-sidebar .app-nav-link > i { color: var(--sc-subtle); }
  .sidebar-footer-status { font-size: var(--sc-type-caption); }
  .app-header .navbar { padding: var(--sc-space-2) var(--sc-space-8); }
  .desktop-topbar-copy { flex-direction: row; gap: var(--sc-space-3); align-items: center; }
  .desktop-topbar-copy strong { font-size: var(--sc-type-label); font-weight: 500; }
  .desktop-topbar-copy small { padding-left: var(--sc-space-3); border-left: 1px solid var(--sc-border-strong); }
}
@media (min-width: 1200px) {
  #settings-form { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 var(--sc-space-8); align-items: start; }
  #settingsTabs { position: sticky; top: calc(var(--sc-header-height) + var(--sc-space-6)); display: flex; flex-direction: column; border: 0; padding: 0; margin: 0; }
  #settingsTabs .nav-link { width: 100%; text-align: left; }
  #settingsTabs.mt-3 { margin-top: 0 !important; }
  .settings-page-shell .tab-content.pt-4 { padding-top: 0 !important; }
  .settings-page-shell .tab-content { min-width: 0; }
  #settings-save-actions { grid-column: 2; }
}
@media (max-width: 1199.98px) {
  #settingsTabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; }
  #settingsTabs .nav-item { flex-shrink: 0; width: auto; }
  #settingsTabs .nav-link { white-space: nowrap; }
}
@media (max-width: 767.98px) {
  :root { --sc-control-compact: 44px; --sc-type-title: 1.25rem; }
  .showcore-main { padding: var(--sc-space-5) var(--sc-space-4) calc(96px + env(safe-area-inset-bottom)); }
  .app-header .navbar { padding-inline: var(--sc-space-4); }
  .form-control, .form-select, .dmx-console .form-control, .dmx-console .form-select, .show-timeline .form-control, .show-timeline .form-select { font-size: 16px; }
  .card.p-4 { padding: var(--sc-space-4) !important; }
  .ui-page-panel.card.p-4 { padding: 0 !important; }
  .ui-page-heading, .page-heading { gap: var(--sc-space-3); margin-bottom: var(--sc-space-5); }
  .mode-selector-shell { padding: var(--sc-space-3); }
  .mode-selector-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sc-space-2); }
  .mode-selector-title { margin: 0; font-size: var(--sc-type-section); }
  .mode-selector-heading-actions { display: contents; }
  .mode-device-identity { display: none; }
  .mode-backend-state { grid-column: 1; grid-row: 2; max-width: 100%; width: max-content; }
  .mode-stop-all { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
  .mode-selector { gap: var(--sc-space-2); }
  .mode-btn { height: 88px; min-height: 88px; flex-direction: column; align-items: center; justify-content: center; padding: var(--sc-space-2) var(--sc-space-1); gap: var(--sc-space-1); }
  .mode-btn-icon { width: 28px; height: 28px; flex: 0 0 28px; font-size: 1.25rem; }
  .mode-btn-label { font-size: .75rem; letter-spacing: 0; }
  .mode-btn-state { font-size: .6875rem; }
  .mode-btn-description { display: none; }
  .mobile-bottom-nav { background: var(--sc-surface-soft); border-color: var(--sc-border); box-shadow: none; backdrop-filter: none; }
  .mobile-nav-item { border-radius: var(--sc-radius-sm); font-weight: 500; }
  .mobile-nav-item.is-active { background: rgb(var(--sc-primary-rgb) / .09); color: var(--sc-primary); }
  .mobile-more-menu { border-radius: var(--sc-radius-dialog) var(--sc-radius-dialog) 0 0; }
  .modal-header, .modal-footer, .modal-body { padding: var(--sc-space-4); }
  .show-timeline .card, .dmx-console .card { padding: var(--sc-space-4); }
  .tl-topbar > .tl-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sc-space-2); width: 100%; }
  .tl-topbar #tl-save-state { align-self: center; }
  .tl-topbar #tl-reload { justify-self: end; }
  .tl-topbar :is(#tl-export, #tl-save) { width: 100%; min-height: 56px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight; }
  .btn, .mode-btn, .card, .nav-link.active { border: 1px solid ButtonText; }
}
