:root {
  --bg: #b3b3b3;
  --panel: #d4d4d4;
  --panel-soft: #bebebe;
  --text: #161616;
  --muted: #3d3d3d;
  --line: #7d7d7d;
  --accent: #008c39;
  --left-col-width: 460px;
  --splitter-size: 8px;
  --left-panel-height: 360px;
  --center-panel-height: 610px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Verdana, Arial, sans-serif;
}

body {
  min-height: 100vh;
}

.login-shell {
  min-height: calc(100vh - 24px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 18px;
}

.login-card .field {
  display: block;
  margin: 12px 0;
}

.login-card .field span {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
}

.login-card .field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  cursor: pointer;
  user-select: none;
}

.login-card .field-check input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.login-error {
  margin: 10px 0;
  padding: 7px;
  border: 1px solid #b97777;
  background: #f8dddd;
  color: #7b1818;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #c7c7c7;
}

h1 {
  margin: 0;
  font-size: 17px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

h2 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
}

h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

#hourStatusLabel {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: none;
  cursor: default;
}

.hour-status-ok {
  color: #ffffff;
  background: #0a7a2d;
}

.hour-status-warn {
  color: #ffffff;
  background: #b31a1a;
}

.header-actions,
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-slots {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.window-menu-wrap {
  position: relative;
}

.header-menu-link {
  border: 0;
  background: transparent;
  color: #1a1a1a;
  padding: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.header-menu-link:hover {
  text-decoration: underline;
}

.window-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  z-index: 1800;
  min-width: 170px;
  padding: 6px;
  border: 1px solid #777;
  background: #f4f4f4;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.window-menu.hidden {
  display: none;
}

.window-menu-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 2px;
  white-space: nowrap;
  font-size: 11px;
}

.help-menu-btn {
  width: 100%;
  text-align: left;
}

.row.wrap {
  flex-wrap: wrap;
}

.app-grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--left-col-width) var(--splitter-size) calc(100% - var(--left-col-width) - var(--splitter-size));
  grid-template-rows: var(--left-panel-height) var(--splitter-size) var(--center-panel-height);
  grid-template-areas:
    "left vsplit right"
    "hsplit vsplit right"
    "center vsplit right";
  gap: 8px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.panel-header {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-grid.is-window-mode {
  position: relative;
  display: block;
  height: calc(100vh - 36px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #858585;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    #a7a7a7;
  background-size: 24px 24px;
}

.app-grid.is-window-mode .window-panel {
  position: absolute;
  min-width: 280px;
  min-height: 180px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.app-grid.is-window-mode .window-panel.is-window-hidden {
  display: none !important;
}

.app-grid.is-window-mode .window-panel > .panel-header,
.app-grid.is-window-mode .window-panel > h3,
.app-grid.is-window-mode .window-panel > .replace-popup-header {
  position: relative;
  padding-right: 30px;
  cursor: move;
  user-select: none;
}

.window-close-btn {
  position: absolute;
  top: 4px;
  right: 5px;
  margin-left: 0;
  padding: 0 6px;
  line-height: 1.25;
  z-index: 2;
}

.app-grid:not(.is-window-mode) .window-close-btn {
  display: none;
}

.app-grid.is-window-mode .center-module > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-grid.is-window-mode .right-panel > .panel-header {
  padding-right: 30px;
}

.app-grid.is-window-mode .right-panel > .panel-header h2 {
  margin: 0;
  line-height: 1.2;
}

.app-grid.is-window-mode .panel-body {
  min-height: 0;
}

.app-grid.is-window-mode .center-panel {
  display: contents;
}

.app-grid.is-window-mode .center-panel > .panel-header {
  display: none;
}

.app-grid.is-window-mode .center-panel > .panel-body {
  display: contents;
  padding: 0;
}

.app-grid.is-window-mode .left-panel {
  height: auto;
}

.app-grid.is-window-mode .center-module {
  display: flex;
  flex-direction: column;
  overflow: auto;
  margin: 0;
}

.app-grid.is-window-mode .center-module > h3 {
  margin: -6px -6px 6px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.app-grid.is-window-mode .splitter {
  display: none;
}

.window-resize-handle {
  display: none;
}

.app-grid.is-window-mode .window-panel > .window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  left: auto;
  top: auto;
  display: block;
  width: 16px;
  height: 16px;
  z-index: 6;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(0, 0, 0, 0.35) 45% 55%, transparent 55%),
    linear-gradient(135deg, transparent 0 64%, rgba(0, 0, 0, 0.35) 64% 74%, transparent 74%);
}

.app-grid.is-window-mode .window-resize-handle.is-window-hidden {
  display: none;
}

.panel-body {
  padding: 4px;
}

.left-panel,
.center-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.left-panel .panel-body,
.center-panel .panel-body,
.right-panel .panel-body {
  flex: 1;
  min-height: 0;
}

.left-panel .panel-body,
.center-panel .panel-body {
  flex: 1;
  overflow: auto;
}

.right-panel .panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-panel .panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.tracks-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
/* File drag-to-import onto the search results, scoped to the selected category. */
.tracks-table-wrap.is-file-dragover {
  outline: 2px dashed #2e9e5b;
  outline-offset: -2px;
  background: #f2fbf5;
}
.tracks-table-wrap.is-file-dragover-invalid {
  outline-color: #d0342c;
  background: #fdf3f2;
}
.tracks-table-wrap.is-file-dragover::before {
  content: attr(data-drop-hint);
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
  display: block;
  padding: 8px 10px;
  background: rgba(46, 158, 91, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.tracks-table-wrap.is-file-dragover-invalid::before {
  background: rgba(208, 52, 44, 0.95);
}
/* Inline upload progress for drag-to-import, shown in the search panel footer. */
.search-import-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}
.search-import-progress .sip-bar {
  flex: 1 1 auto;
  height: 6px;
  background: #e3e8ef;
  border-radius: 3px;
  overflow: hidden;
}
.search-import-progress .sip-fill {
  height: 100%;
  width: 0;
  background: #2e9e5b;
  transition: width 0.15s ease;
}
.search-import-progress .sip-text {
  flex: 0 1 auto;
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.panel-footer {
  border-top: 1px solid var(--line);
  padding: 4px 6px;
}

.split-vertical {
  display: grid;
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  background: #e2e2e2;
  padding: 6px;
}

.btn {
  border: 1px solid #6f6f6f;
  background: #d9d9d9;
  color: var(--text);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.btn.compact {
  padding: 3px 5px;
  font-size: 11px;
}

.btn.is-active {
  border-color: #1e5f9f;
  background: #b8d7ff;
}

.btn:hover {
  background: #ededed;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: #3f8f3f;
  background: #9de59d;
}

.btn-primary.is-clean:not(:disabled) {
  opacity: 0.62;
}

.btn-primary.is-dirty {
  opacity: 1;
  border-color: #8b5d00;
  background: #ffd37a;
  font-weight: 700;
}

input,
select {
  background: #fff;
  color: var(--text);
  border: 1px solid #7f7f7f;
  padding: 3px 6px;
  font-size: 12px;
}

input[type="search"] {
  min-width: 140px;
}

input[type="datetime-local"] {
  min-width: 170px;
}

input[type="date"] {
  min-width: 122px;
}

.playout-hour-picker {
  display: grid;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 260px;
  margin-bottom: 5px;
}

.hour-log-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.playout-hour-picker .row {
  justify-content: flex-start;
}

.hour-buttons {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}

.hour-button {
  border: 1px solid #777;
  background: #e1e1e1;
  color: var(--text);
  min-width: 0;
  padding: 3px 0;
  font-size: 10px;
  line-height: 1.1;
  cursor: pointer;
}

.hour-button:hover {
  background: #f3f3f3;
}

.hour-button.is-active {
  background: #001a8d;
  border-color: #001a8d;
  color: #fff;
  font-weight: 800;
}

.hour-button.is-now:not(.is-active) {
  box-shadow: inset 0 0 0 2px #1f7a38;
}

.hour-button.is-readonly:not(.is-active) {
  background: repeating-linear-gradient(
    -45deg,
    #d8d8d8,
    #d8d8d8 4px,
    #cfcfcf 4px,
    #cfcfcf 8px
  );
  color: #8a8a8a;
  border-color: #b3b3b3;
}

.hour-button.is-readonly.is-active {
  opacity: 0.92;
}

.hour-readonly-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin-bottom: 5px;
  border: 1px solid #d8a200;
  border-left-width: 4px;
  border-radius: 3px;
  background: #fff6da;
  color: #7a5b00;
  font-size: 11px;
  font-weight: 600;
}

.hour-readonly-notice .fa {
  font-size: 12px;
}

.hour-log-table-wrap.is-readonly-hour {
  opacity: 0.85;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 3px 5px;
  text-align: left;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table th {
  font-size: 10px;
  background: #efefef;
  color: #1d1d1d;
  text-transform: none;
  letter-spacing: 0;
  border-right: 1px solid #c4c4c4;
}

.table th:last-child {
  border-right: 0;
}

.table.compact th,
.table.compact td {
  padding: 2px 4px;
}

#tracksTable thead th.is-sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 14px;
  position: relative;
}

#tracksTable thead th.is-sortable:hover {
  background: #e4e4e4;
}

#tracksTable thead th.is-sorted-asc::after,
#tracksTable thead th.is-sorted-desc::after {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: #444;
  pointer-events: none;
}

#tracksTable thead th.is-sorted-asc::after {
  content: "▲";
}

#tracksTable thead th.is-sorted-desc::after {
  content: "▼";
}

.table tbody tr {
  cursor: pointer;
}

.table tbody tr:hover {
  filter: brightness(0.95);
}

.table tbody tr.is-selected {
  outline: 2px solid #1b4cc7;
}

#tracksTable tbody tr.is-selected {
  outline: 2px solid #2b5bd4;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 9999px rgba(43, 91, 212, 0.08);
}

#tracksTable tbody tr.is-primary-selected {
  outline: 2px solid #0f3ca8;
  box-shadow:
    inset 4px 0 0 #0f3ca8,
    inset 0 0 0 9999px rgba(15, 60, 168, 0.15);
}

#hourLogTable tbody tr.is-selected {
  position: relative;
  outline: 3px solid #001a8d;
  outline-offset: -3px;
  box-shadow:
    inset 7px 0 0 #001a8d,
    inset 0 0 0 9999px rgba(255, 255, 255, 0.24);
}

#hourLogTable tbody tr.is-selected:not(.is-primary-selected) {
  outline: 2px solid rgba(0, 26, 141, 0.55);
  box-shadow:
    inset 5px 0 0 rgba(0, 26, 141, 0.65),
    inset 0 0 0 9999px rgba(255, 255, 255, 0.16);
}

#hourLogTable tbody tr.is-selected td:first-child {
  font-weight: 800;
}

.table tbody tr.is-drop-target {
  outline: none;
}

#hourLogTable tbody tr.is-drop-before td {
  box-shadow: inset 0 3px 0 #1b4cc7;
}

#hourLogTable tbody tr.is-drop-after td {
  box-shadow: inset 0 -3px 0 #1b4cc7;
}

#hourLogTable tbody.is-file-dragover {
  outline: 2px dashed #2b7de0;
  outline-offset: -2px;
  background: #f2f7fe;
}

#hourLogTable tbody tr.log-pending-row td {
  background: #eef5ff;
  box-shadow: inset 3px 0 0 #2b7de0;
}
#hourLogTable tbody tr.log-pending-row.is-error td {
  background: #fdf3f2;
  box-shadow: inset 3px 0 0 #c0392b;
}
.log-pending-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.log-pending-icon { color: #2b7de0; flex: 0 0 auto; }
tr.log-pending-row.is-error .log-pending-icon { color: #c0392b; }
.log-pending-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #333;
}
.log-pending-status { flex: 0 0 auto; font-size: 11px; color: #555; white-space: nowrap; }
tr.log-pending-row.is-error .log-pending-status { color: #c0392b; }
.log-pending-progress {
  flex: 1 1 80px;
  min-width: 60px;
  height: 4px;
  border-radius: 3px;
  background: #d9e6f7;
  overflow: hidden;
}
.log-pending-progress-fill {
  height: 100%;
  width: 0;
  background: #2b7de0;
  transition: width 0.12s linear;
}
tr.log-pending-row.is-error .log-pending-progress-fill { background: #c0392b; }

.table tbody tr.is-played {
  box-shadow: inset 4px 0 0 #1f7a38;
}

.table tbody tr.is-in-past {
  opacity: 0.86;
}

.table tbody tr.will-skip td {
  color: #6b5a35;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* PlayIt will drop this row to fit the hour — make the risk obvious. */
.table tbody tr.will-skip {
  box-shadow: inset 4px 0 0 #c47a00;
  background-image: linear-gradient(90deg, rgba(196, 122, 0, 0.12), transparent 40%);
}

.table tbody tr.is-soft-deleted td {
  text-decoration: line-through;
}

.table tbody tr.is-invalid {
  outline: 2px dashed rgba(184, 25, 25, 0.75);
  outline-offset: -2px;
}

.table tbody tr.is-protected {
  box-shadow: inset 0 0 0 2px rgba(34, 74, 173, 0.45);
}

/* Currently playing (on-air) row: keep the row's own colours readable and just
   mark it with the ON AIR badge + an inline progress bar under the title. */
.table tbody tr.is-current { opacity: 1; }
.onair-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #1f9d4d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  vertical-align: middle;
}
.onair-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: onair-pulse 1.4s infinite;
}
@keyframes onair-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.log-current-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.log-current-bar {
  flex: 1 1 auto;
  min-width: 60px;
  height: 5px;
  border-radius: 3px;
  background: rgba(128, 128, 128, 0.3);
  overflow: hidden;
}
.log-current-fill {
  height: 100%;
  width: 0;
  background: #17b45a;
  transition: width 0.5s linear;
}
.log-current-elapsed,
.log-current-remaining {
  flex: 0 0 auto;
  font-size: 10px;
  color: inherit;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.skip-toggle-cell {
  text-align: center;
  width: 48px;
}

#hourLogTable th[data-col-key="skip"],
#hourLogTable td[data-col-key="skip"] {
  width: 44px !important;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}

#hourLogTable th[data-col-key="protected"],
#hourLogTable td[data-col-key="protected"] {
  width: 28px !important;
  min-width: 28px;
  max-width: 28px;
  text-align: center;
  padding-left: 2px;
  padding-right: 2px;
}

.skip-toggle-cell input {
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
}

.skip-toggle-cell input:disabled {
  cursor: not-allowed;
}

.protected-toggle-cell {
  text-align: center;
  vertical-align: middle;
}

.protect-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 14px;
  padding: 0;
  border: 1px solid #c5cdd8;
  border-radius: 2px;
  background: #f7f8fa;
  color: #8a93a0;
  cursor: pointer;
  line-height: 1;
  font-size: 10px;
  vertical-align: middle;
  box-sizing: border-box;
}

.protect-lock-btn i {
  font-size: 10px;
  line-height: 1;
}

.protect-lock-btn:hover:not(:disabled) {
  border-color: #9fb9d8;
  color: #5a6a7d;
  background: #eef3f9;
}

.protect-lock-btn.is-locked {
  color: #b8860b;
  border-color: #b8860b;
  background: #fdf6e3;
}

.protect-lock-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.time-cell {
  white-space: nowrap;
}

.played-checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  margin-right: 4px;
  font-weight: 700;
  color: #0f5a28;
}

.time-text {
  vertical-align: middle;
}

.tempo-adjust-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border: 1px solid rgba(139, 79, 0, 0.45);
  border-radius: 999px;
  background: rgba(255, 239, 205, 0.9);
  font-weight: 800;
  font-size: 9px;
  line-height: 1.2;
  color: #8b4f00;
  white-space: nowrap;
}

.tempo-adjust-cell {
  text-align: center;
}

.search-neighbor-actions {
  display: inline-flex;
  gap: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.search-neighbor-actions .btn {
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1.25;
}

.waveform-context-panel {
  margin-top: 4px;
  padding: 4px;
  border: 1px solid #d1d1d1;
  background: rgba(255, 255, 255, 0.62);
}

.waveform-context-panel summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 10px;
}

.waveform-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.waveform-context-slot {
  min-height: 26px;
  padding: 4px 5px;
  border: 1px dashed #8d9bb8;
  background: #f7faff;
  font-size: 10px;
}

.waveform-context-slot strong,
.waveform-context-slot span {
  display: block;
}

.waveform-context-slot strong {
  color: #2f3f74;
}

.waveform-context-slot.is-drop-target {
  border-color: #2456c9;
  background: #e7efff;
  box-shadow: inset 0 0 0 1px #2456c9;
}

.waveform-favorites-row {
  margin-top: 4px;
  align-items: center;
  gap: 4px;
}

.waveform-favorites {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.waveform-favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 180px;
  padding: 1px 5px;
  border: 1px solid #b7a36f;
  background: #fff6dc;
  font-size: 10px;
  cursor: grab;
}

.waveform-favorite-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.tempo-adjust-badge::before {
  content: "↯";
  font-size: 10px;
  line-height: 1;
}

.playout-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  vertical-align: middle;
}

.playout-icon-badge img {
  width: 16px;
  height: 16px;
  display: block;
}

.playout-icon-badge .fa {
  font-size: 14px;
  line-height: 1;
}

.playout-icon-badge.is-text {
  width: auto;
  min-width: 18px;
  padding: 1px 4px;
  border: 1px solid #999;
  border-radius: 3px;
  background: #f2f2f2;
  font-size: 9px;
  font-weight: 700;
}

.row-tag-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.row-tag-main {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-status-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.row-flag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(70, 70, 70, 0.35);
  background: rgba(255, 255, 255, 0.72);
  padding: 1px 5px;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 700;
}

.row-flag-chip.soft-deleted {
  color: #5c5c5c;
}

.row-flag-chip.protected {
  color: #2347a3;
}

.row-flag-chip.invalid {
  color: #a11d1d;
  border-color: rgba(161, 29, 29, 0.45);
}

.row-flag-chip.will-skip {
  color: #8b5d00;
}

.row-flag-chip.in-past {
  color: #6a40b5;
}

.row-flag-chip.played {
  color: #0f5a28;
}

.log-type-track {
  background: #75ff55;
}

.log-type-advert {
  background: #ffd73b;
}

#hourLogTable tbody tr.is-pipl-preview {
  background: rgba(47, 109, 237, 0.22) !important;
}
#hourLogTable tbody tr.is-pipl-preview.is-pipl-intro {
  background: rgba(111, 66, 193, 0.2) !important;
}
#hourLogTable tbody tr.is-pipl-preview td[data-col-key="title"] {
  font-style: italic;
}
.pipl-preview-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(30, 64, 175, 0.55);
  color: #dbeafe;
  margin-right: 4px;
  vertical-align: middle;
}

.log-type-voice {
  background: #ff9557;
}

.log-type-jingle {
  background: #7ee4ff;
}

.log-type-news {
  background: #fb81ff;
}

.log-type-hook,
.log-type-marker {
  background: #81f3f3;
}

.log-type-aux {
  background: #ff8080;
}

.log-type-other {
  background: #d3d3d3;
}

.track-tools-module h3 {
  margin-bottom: 6px;
}

.track-tools-module {
  background: #dfe3de;
  border: 1px solid #7e857d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  padding: 6px;
}

.track-tools-actions {
  gap: 6px;
  margin: 6px -6px 0;
  padding: 6px;
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #dfe3de;
  border-top: 1px solid #b4bab1;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}

.track-fields {
  display: block;
  margin: 0 0 6px;
}

.track-editor-shell {
  display: grid;
  gap: 6px;
}

.track-editor-section {
  border: 1px solid #8b9289;
  background: #ecefeb;
  padding: 5px 6px 6px;
}

.track-editor-section h4 {
  margin: 0 0 5px;
  font-size: 11px;
  color: #2b2f2b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.track-editor-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.track-editor-row:last-child {
  margin-bottom: 0;
}

.track-editor-row-multi {
  align-items: start;
}

.track-editor-label {
  font-size: 11px;
  color: #1f2420;
  font-weight: 700;
}

.track-editor-row input,
.track-editor-row select,
.track-editor-row textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #7b817a;
  background: #fff;
  color: #121412;
  padding: 2px 4px;
  font-size: 12px;
}

.track-editor-row input,
.track-editor-row select {
  height: 24px;
}

.track-editor-row textarea {
  min-height: 44px;
  resize: vertical;
}

.track-editor-category-dates {
  margin-top: 6px;
}

.track-editor-category-dates-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.track-editor-category-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  padding: 2px 0;
  border-bottom: 1px dotted #c7ccc4;
}

.track-editor-category-date-row:last-child {
  border-bottom: none;
}

.track-editor-category-date-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-editor-category-date-value {
  color: #4a504a;
  font-variant-numeric: tabular-nums;
}

.track-editor-group-wrap {
  display: grid;
  gap: 4px;
}

.track-editor-group-list {
  max-height: 132px;
  overflow: auto;
  border: 1px solid #a6aba4;
  background: #fff;
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
}

.track-editor-group-item {
  display: inline-flex;
  align-items: center;
  border: 1px solid #9ba39a;
  background: #f4f6f3;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
}

.track-editor-group-item:hover {
  background: #e8efe6;
}

.track-editor-group-item.is-selected {
  border-color: #3e6fb3;
  background: #d9e7ff;
  color: #10386f;
}

.track-editor-group-item.is-filtered-out {
  display: none;
}

.track-editor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}

.track-editor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #90988f;
  background: #f2f6f1;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

.track-editor-badge-remove {
  border: 0;
  background: transparent;
  color: #7a1f1f;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}

.track-editor-tag-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.track-editor-tag-input {
  flex: 1 1 auto;
}

.track-editor-related-status {
  font-size: 11px;
  line-height: 1.3;
}

.track-editor-related-status.is-error {
  color: #9a1f1f;
}

.track-editor-related-empty {
  font-size: 11px;
}

.track-editor-related-badge.is-disabled {
  opacity: 0.55;
  text-decoration: line-through;
}

.track-editor-related-input {
  flex: 1 1 auto;
}

.track-editor-related-parts {
  display: grid;
  gap: 8px;
}

.track-editor-related-part {
  display: grid;
  gap: 4px;
}

.track-editor-related-part + .track-editor-related-part {
  border-top: 1px dashed #c4cabf;
  padding-top: 8px;
}

.track-editor-related-part-name {
  font-weight: 600;
  font-size: 12px;
  color: #102542;
}

.track-editor-related-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 6px;
}

.track-editor-related-tab {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-editor-group-dropdown {
  position: relative;
}

.track-editor-group-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.track-editor-group-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #a6aba4;
  border-radius: 4px;
  padding: 4px;
  display: grid;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.track-editor-group-panel.hidden {
  display: none;
}

.track-editor-row .is-readonly {
  background: #e7ebe6;
  color: #586057;
}

.track-editor-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.track-editor-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #1f2420;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 3px;
  margin-bottom: 4px;
}

.meta-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid #d8d8d8;
  background: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.meta-row strong {
  flex: 0 0 auto;
  color: #666;
  text-transform: none;
  letter-spacing: 0;
  font-size: 9px;
}

.meta-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mix-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 106px));
  justify-content: start;
  gap: 4px;
  margin-top: 4px;
}

.mix-fields.is-hidden {
  display: none;
}

.track-editor-inline-title {
  grid-column: 1 / -1;
  margin: 0 0 3px;
  font-size: 11px;
  color: #2b2f2b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.track-mix-field {
  border-color: #a8ada6;
  background: #f7f8f6;
}

.field {
  display: grid;
  gap: 2px;
  padding: 3px;
  border: 1px solid #d8d8d8;
  background: rgba(255, 255, 255, 0.38);
  font-size: 10px;
}

.field span {
  font-weight: 700;
  color: #4f4739;
}

.field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 22px;
  padding: 1px 3px;
  font-size: 11px;
}

.timeline {
  min-height: 130px;
  overflow-x: auto;
}

.history-controls {
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

.history-controls #historySummary {
  flex: 1 1 auto;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.history-controls #historyWindowLabel {
  flex: 0 1 auto;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.history-controls .btn {
  padding: 2px 5px;
  font-size: 10px;
}

.history-controls select {
  max-width: 92px;
  padding: 2px 4px;
  font-size: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 11px;
  border: 1px solid #6f6f6f;
  border-radius: 999px;
  padding: 3px 7px;
  background: #f3f3f3;
}

.history-grid-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  background: #fff;
}

.history-grid-table th,
.history-grid-table td {
  border: 1px solid #c8c8c8;
  padding: 1px 3px;
  font-size: 10px;
  text-align: center;
  min-width: 22px;
  height: 19px;
}

.history-grid-table thead th {
  background: #ffffff;
  font-weight: 700;
}

.history-grid-table tbody th {
  text-align: left;
  padding-left: 6px;
  background: #ffffff;
  font-weight: 400;
}

.history-grid-table .is-selected-day {
  background: #000;
  color: #fff;
  font-weight: 700;
}

.history-grid-table .is-current-axis {
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.06);
}

.history-grid-table th.is-current-axis:not(.is-selected-day) {
  background: #dedede;
  font-weight: 700;
}

.history-grid-table td.is-current-hour {
  background: #000;
  box-shadow: inset 0 0 0 2px #000;
}

.history-grid-table td.is-current-hour .history-marker {
  border-color: #fff;
}

.history-grid-table.is-vertical thead th {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  min-width: 28px;
  height: 92px;
}

.history-grid-table.is-vertical tbody th {
  min-width: 36px;
  text-align: center;
  font-weight: 700;
}

.history-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  margin: 0;
  font-size: 10px;
  line-height: 1;
}

.history-marker.track-play {
  background: #b6f2be;
}

.history-marker.artist-play {
  background: #d8dbf8;
}

.history-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #257b3f;
  background: #ddffe7;
  color: #1f3f2a;
  z-index: 3000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  max-width: min(420px, calc(100vw - 28px));
}

.toast.is-error {
  border-color: #8a2e2e;
  background: #ffd9d9;
  color: #5a1414;
}

.hidden {
  display: none;
}

.left-panel { grid-area: left; }
.center-panel { grid-area: center; }
.right-panel { grid-area: right; }
.right-panel .panel-body { position: relative; }

.left-panel {
  height: var(--left-panel-height);
}

.splitter {
  background: #9f9f9f;
  border: 1px solid #7a7a7a;
  z-index: 20;
}

.splitter-vertical {
  grid-area: vsplit;
  cursor: col-resize;
}

.splitter-horizontal {
  grid-area: hsplit;
  cursor: row-resize;
}

.table thead th {
  position: relative;
}

.table thead th[draggable="true"] {
  cursor: grab;
}

.table thead th.col-dragging {
  opacity: 0.65;
}

.table thead th.col-drop-target {
  outline: 2px dashed #1b4cc7;
  outline-offset: -2px;
}

.table .is-col-hidden {
  display: none;
}

.column-menu {
  position: fixed;
  min-width: 160px;
  max-width: 240px;
  margin: 0;
  padding: 6px;
  border: 1px solid #707070;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  z-index: 2300;
}

.column-menu.hidden {
  display: none;
}

.column-menu-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 1px;
  background: #777;
  opacity: 0.75;
}

.table thead th:hover .col-resizer::after {
  width: 2px;
  background: #1b4cc7;
  opacity: 1;
}

.replace-popup {
  position: absolute;
  right: 10px;
  top: 10px;
  width: min(760px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  background: #ececec;
  border: 1px solid #777;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  padding: 6px;
  z-index: 15;
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) minmax(220px, auto);
  gap: 6px;
}

.app-grid.is-window-mode .replace-popup {
  right: auto;
  max-height: none;
  overflow: auto;
}

.replace-popup.hidden {
  display: none;
}

.replace-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.replace-popup-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.replace-popup-table-wrap {
  max-height: 300px;
  min-height: 220px;
  overflow: auto;
  border: 1px solid #aaa;
  background: #fff;
}

.replace-history-compare {
  border: 1px solid #999;
  background: #f9f9f9;
  padding: 6px;
  font-size: 11px;
  min-height: 220px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.replace-history-compare.is-partial {
  background: #f6f6f6;
}

.replace-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.replace-history-card {
  border: 1px solid #bbb;
  background: #fff;
  padding: 6px;
}

.help-shortcuts-modal {
  position: fixed;
  z-index: 2200;
  right: 14px;
  top: 54px;
  width: min(460px, calc(100% - 28px));
  max-height: calc(100vh - 72px);
  overflow: auto;
  border: 1px solid #747474;
  background: #f1f1f1;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.help-shortcuts-modal.hidden {
  display: none;
}

.help-shortcuts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-shortcuts-body {
  display: grid;
  gap: 10px;
}

.help-shortcuts-section {
  border: 1px solid #a8a8a8;
  background: #fbfbfb;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.help-shortcuts-section h4 {
  margin: 0 0 4px;
  font-size: 12px;
}

.help-shortcut-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.help-shortcut-row kbd {
  display: inline-block;
  border: 1px solid #999;
  border-bottom-color: #777;
  border-radius: 3px;
  background: #fff;
  color: #1d1d1d;
  font-size: 10px;
  font-family: inherit;
  font-weight: 700;
  padding: 1px 6px;
  line-height: 1.4;
}

.help-shortcuts-note {
  font-size: 10px;
}

.replace-history-card h4 {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
}

.replace-history-lines {
  display: grid;
  gap: 3px;
}

.replace-history-lines-empty {
  opacity: 0.72;
}

.replace-candidate-history {
  margin-top: 2px;
  min-height: 132px;
}

.replace-candidate-history-placeholder {
  border: 1px dashed #b8b8b8;
  background: #fff;
  padding: 8px;
  display: flex;
  align-items: center;
}

.replace-candidate-history h4 {
  margin: 0 0 5px;
  font-size: 11px;
  text-transform: uppercase;
}

.replace-history-table {
  max-width: 100%;
}

#replaceTable tbody .replace-state-row td {
  color: #555;
  font-style: italic;
}

.current-hour-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #000;
  border: 1px solid #000;
}

.waveform-card {
  background: #f7f7f7;
}

.waveform-placeholder {
  height: 124px;
  border: 1px solid #8f8f8f;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
}

.app-grid.is-window-mode .waveform-module .waveform-placeholder {
  flex: 1;
  height: auto;
  min-height: 120px;
}

.waveform-placeholder canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.waveform-placeholder canvas.wave-cursor-default {
  cursor: crosshair;
}

.waveform-placeholder canvas.wave-cursor-pan {
  cursor: grab;
}

.waveform-placeholder canvas.wave-cursor-grabbing {
  cursor: grabbing;
}

.waveform-placeholder canvas.wave-cursor-cue {
  cursor: col-resize;
}

.waveform-placeholder canvas.wave-cursor-next-shift {
  cursor: ew-resize;
}

.waveform-toolbar {
  margin-top: 6px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
}

.waveform-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}

.waveform-toolbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.waveform-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.waveform-toolbar .icon-only {
  width: 32px;
  min-width: 32px;
  padding: 4px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.waveform-toolbar .icon-only i {
  font-size: 13px;
}

.waveform-use-next-toggle {
  font-size: 11px;
}

.waveform-toolbar-bottom #wavePlayPauseBtn {
  min-width: 94px;
}

.waveform-toolbar-bottom #waveTestHookBtn[hidden] {
  display: none !important;
}

.waveform-placeholder canvas:focus {
  outline: 2px solid #4474c9;
  outline-offset: -2px;
}

.context-menu {
  position: fixed;
  /* Above the floating-window band (windows cap ~900). JS also pins this via ensureOverlayMenu. */
  z-index: 10000;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #707070;
  background: #ececec;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.context-menu.hidden {
  display: none;
}

.context-menu-item {
  border: 1px solid #8a8a8a;
  background: #f7f7f7;
  color: #161616;
  text-align: left;
  font-size: 12px;
  padding: 5px 7px;
  cursor: pointer;
}

.context-menu-item:hover {
  background: #e4eefc;
}

.context-menu-item.cue-action {
  border-left-width: 4px;
}

.context-menu-item.cue-in {
  border-left-color: #5d99d8;
}

.context-menu-item.cue-intro {
  border-left-color: #3fbf73;
}

.context-menu-item.cue-hook {
  border-left-color: #7a58c1;
}

.context-menu-item.cue-out {
  border-left-color: #d86666;
}

.context-menu-item.cue-early-out {
  border-left-color: #f3a34c;
}

.context-menu-item.danger {
  color: #9c1919;
  border-color: #b97777;
}

.context-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.context-menu-item.hidden {
  display: none !important;
}

.context-menu-info {
  margin-top: 2px;
  font-size: 10px;
}

.track-context-menu {
  min-width: 220px;
  max-width: 280px;
}

.track-context-menu .context-menu-item.has-submenu {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.track-context-menu .context-menu-item.is-open {
  background: #dbe8ff;
  border-color: #6d8ec7;
}

.context-submenu {
  position: fixed;
  z-index: 10010;
  min-width: 220px;
  max-width: 300px;
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #707070;
  background: #ececec;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.context-submenu.hidden {
  display: none;
}

.context-submenu-item.is-selected {
  background: #dbe8ff;
  border-color: #6d8ec7;
  font-weight: 700;
}

.context-submenu-item.is-partial {
  background: #e9eef8;
}

.context-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.context-check-indicator {
  width: 14px;
  flex: 0 0 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.context-check-label {
  flex: 1 1 auto;
  min-width: 0;
}

#trackCtxGroupsSubmenu {
  gap: 2px;
  padding: 3px;
  min-width: 200px;
}

#trackCtxGroupsSubmenu .context-menu-item {
  padding: 2px 6px;
  font-size: 11px;
}

.context-submenu-empty {
  font-size: 11px;
  padding: 4px 2px;
}

.track-editor-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
}

.track-editor-tab {
  border: 1px solid #8d9bb2;
  border-radius: 4px;
  background: #edf1f8;
  color: #20324f;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
}

.track-editor-tab.is-active {
  background: #d7e5ff;
  border-color: #4e73b8;
  font-weight: 600;
}

.track-editor-tab-pane {
  display: none;
}

.track-editor-tab-pane.is-active {
  display: block;
}

.track-editor-daypart-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.track-editor-daypart-enabled {
  justify-self: start;
  gap: 4px;
  font-size: 11px;
}

.track-editor-daypart-enabled input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.track-editor-daypart-summary {
  font-size: 11px;
  color: #586057;
}

.track-editor-daypart-grid {
  display: grid;
  grid-template-columns: 40px repeat(24, minmax(18px, 1fr));
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 3px;
  user-select: none;
}

.track-editor-daypart-corner,
.track-editor-daypart-hour {
  min-width: 18px;
  font-size: 9px;
  color: #596163;
  text-align: center;
  line-height: 18px;
}

.track-editor-daypart-day,
.track-editor-daypart-cell {
  border: 1px solid #9ca8b6;
  border-radius: 3px;
  background: #f5f7fb;
  color: #1f2420;
  min-height: 18px;
  padding: 0;
  cursor: pointer;
}

.track-editor-daypart-day {
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.track-editor-daypart-cell {
  min-width: 18px;
  touch-action: none;
}

.track-editor-daypart-day:hover,
.track-editor-daypart-cell:hover {
  border-color: #4e73b8;
}

.track-editor-daypart-cell.is-selected {
  background: #3e6fb3;
  border-color: #315a95;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

@media (max-width: 1400px) {
  .app-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "right"
      "left"
      "center";
  }

  .splitter {
    display: none;
  }

  .left-panel {
    height: min(62vh, var(--left-panel-height));
  }
}

/* ===================== Audio Editor ===================== */
.audio-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2400;
}
.audio-editor-backdrop.hidden { display: none; }

.audio-editor-modal {
  position: fixed;
  z-index: 2500;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1240px, calc(100% - 40px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #ececec;
  border: 1px solid #6f6f6f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #11161d;
  border: 1px solid #2b3645;
  color: #d7e2f0;
}
.audio-editor-modal.hidden { display: none; }

.audio-editor-header,
.audio-editor-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #161d27;
  border-bottom: 1px solid #2b3645;
  color: #d7e2f0;
}
.audio-editor-footer {
  border-bottom: none;
  border-top: 1px solid #2b3645;
}
.audio-editor-header .muted { font-weight: normal; color: #8da3bd; }
.ae-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  max-width: 280px;
  flex: 1;
}
.ae-progress.hidden { display: none; }
.ae-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #2b3645;
  overflow: hidden;
}
.ae-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2f6aa8, #4f8fd0);
  transition: width 0.15s ease-out;
}
.ae-progress-label {
  font-size: 12px;
  color: #9fb0c4;
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ae-spacer { flex: 1; }
.ae-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin: 0 4px;
}

.audio-editor-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}
.audio-editor-body.ae-dark {
  background: #11161d;
  color: #d7e2f0;
}

.ae-toolbar,
.ae-transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px;
  background: #1a222e;
  border: 1px solid #2b3645;
  border-radius: 4px;
}
.ae-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.audio-editor-modal .ae-sep {
  background: #38465a;
}
.audio-editor-modal .btn {
  background: #28323f;
  color: #d7e2f0;
  border: 1px solid #3a485b;
}
.audio-editor-modal .btn:hover:not(:disabled) { background: #33414f; }
.audio-editor-modal .btn:disabled { opacity: 0.4; }
.audio-editor-modal .btn.active { background: #2f6aa8; border-color: #4f8fd0; color: #fff; }
.audio-editor-modal .btn.btn-primary { background: #2f6aa8; border-color: #4f8fd0; color: #fff; }
.audio-editor-modal .btn.danger { background: #3a2222; border-color: #7a4040; color: #ffb0b0; }

.ae-toolbar .ae-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #9fb0c4;
}
.ae-toolbar .ae-field input {
  width: 58px;
  padding: 2px 4px;
  background: #0e141b;
  color: #e6eefb;
  border: 1px solid #3a485b;
}
.ae-zoom .btn { min-width: 30px; font-weight: 600; }

.ae-canvas-wrap {
  width: 100%;
  border: 1px solid #2b3645;
  background: #0c1118;
  border-radius: 3px;
}
#audioEditorCanvas {
  display: block;
  width: 100%;
  height: 320px;
  cursor: crosshair;
}

.ae-scroll {
  width: 100%;
  margin: 0;
  accent-color: #2f6aa8;
}

.ae-transport { justify-content: flex-start; }
.ae-readout {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #9fb0c4;
  padding: 0 6px;
  font-family: Consolas, monospace;
}
#aeTimeReadout { color: #ffd24a; }

.audio-editor-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.audio-editor-columns h4 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.ae-ops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}
.ae-ops-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  background: #fbfbfb;
  border: 1px solid #c4c4c4;
  font-size: 12px;
}
.ae-cue-list {
  display: grid;
  gap: 4px;
}
.ae-cue-row {
  display: grid;
  grid-template-columns: 14px 80px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  background: #fbfbfb;
  border: 1px solid #c4c4c4;
  font-size: 12px;
}
.ae-cue-row.ae-cue-flagged { border-color: #d98a00; background: #fff5e0; }
.ae-cue-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.ae-cue-name { font-weight: 600; }
.ae-cue-value { font-variant-numeric: tabular-nums; }
.ae-nofade { margin-top: 8px; display: inline-flex; gap: 6px; font-size: 12px; }
.ae-cue-hint { margin: 8px 0 0; font-size: 11px; }
.btn.danger { color: #7a0000; border-color: #b06a6a; }
.audio-editor-ctx { z-index: 2600; }

/* Dark theme for the editor body content */
.ae-dark .audio-editor-columns h4 { color: #8da3bd; }
.ae-dark .ae-ops-list li {
  background: #18202b;
  border-color: #2f3b4a;
  color: #d7e2f0;
}
.ae-dark .ae-ops-list li.muted { color: #6f8197; }
.ae-dark .ae-cue-row {
  background: #18202b;
  border-color: #2f3b4a;
  color: #d7e2f0;
}
.ae-dark .ae-cue-row.ae-cue-flagged { border-color: #d98a00; background: #2c2412; }
.ae-dark .ae-cue-hint { color: #6f8197; }
.ae-dark .checkbox-inline { color: #9fb0c4; }

/* ============================ Clocks window ============================ */
.clocks-window {
  background: #ececec;
  border: 1px solid #777;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.clocks-window .clocks-window-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}
.clocks-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  border: 1px solid #b8b8b8;
  background: #f6f6f6;
  border-radius: 4px;
  padding: 6px;
}
.clocks-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.clocks-filter {
  width: 100%;
  box-sizing: border-box;
}
.clocks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 3px;
}
.clocks-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}
.clocks-list-item:hover { background: #eef4fb; }
.clocks-list-item.is-active { background: #d7e8fb; font-weight: 600; }
.clocks-list-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: #bbb;
  flex: 0 0 auto;
}
.clocks-list-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clocks-list-count { flex: 0 0 auto; font-size: 11px; }

.clocks-editor {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #b8b8b8;
  background: #fdfdfd;
  border-radius: 4px;
  overflow: hidden;
}
.clocks-editor-empty {
  padding: 24px;
  color: #666;
  font-size: 13px;
}
.clocks-editor-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.clocks-editor-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #ddd;
  background: #f2f2f2;
}
.clocks-editor-toolbar .field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.clocks-name-field { flex: 1 1 220px; }
.clocks-name-field input { width: 100%; box-sizing: border-box; }
.clocks-color-field input[type="color"] { width: 44px; height: 26px; padding: 0; border: 1px solid #aaa; }
.clocks-summary { font-size: 11px; }
.clocks-dirty { color: #b8860b; font-size: 11px; font-weight: 600; }
.clocks-editor-toolbar .btn-primary { margin-left: auto; }

.clocks-items-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px 8px; }
.clocks-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.clock-item-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-top: 2px;
  border: 1px dashed #c3c3c3;
  border-radius: 3px;
  color: #6a6a6a;
  font-size: 12px;
  cursor: pointer;
  background: #fafafa;
  user-select: none;
}
.clock-item-add-row:hover { border-color: #2b7de0; color: #2b7de0; background: #f2f7fe; }
.clock-item-add-row:focus-visible { outline: 2px solid #2b7de0; outline-offset: 1px; }
.clock-add-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2b7de0;
  color: #fff;
  font-weight: 700;
  line-height: 1;
}
.clock-item.is-selected { background: #e8f1fd; border-color: #2b7de0; }
.clock-item.is-selected:hover { border-color: #2b7de0; }
.clock-add-item { display: flex; align-items: center; gap: 8px; }
.clock-add-item-icon { width: 16px; text-align: center; color: #5a5a5a; flex: 0 0 auto; }
.clock-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 1px solid #d6d6d6;
  border-left: 6px solid var(--clock-item-color, #d6d6d6);
  border-radius: 3px;
  background: #fff;
}
.clock-item:hover { border-color: #9fb9d8; border-left-color: var(--clock-item-color, #9fb9d8); }
.clock-item.is-dragging { opacity: 0.45; }
.clock-item.drag-over-before { box-shadow: 0 -3px 0 -1px #2b7de0; }
.clock-item.drag-over-after { box-shadow: 0 3px 0 -1px #2b7de0; }
.clock-item-index { width: 22px; text-align: right; color: #999; font-size: 11px; flex: 0 0 auto; }
.clock-item-grip { cursor: grab; user-select: none; }
.clock-item-grip:active { cursor: grabbing; }
.clock-item-grip::before { content: "\2807"; margin-right: 3px; color: #bbb; }
.clock-item-time {
  flex: 0 0 auto;
  width: 104px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.clock-item-start { font-size: 12px; font-weight: 600; color: #2b4a6f; }
.clock-item-dur { font-size: 10px; color: #888; }
.clock-item-icon { width: 16px; text-align: center; color: #5a5a5a; flex: 0 0 auto; }
.clock-item-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.clock-item-type { font-size: 11px; color: #777; flex: 0 0 92px; }
.clock-item-value { display: flex; align-items: flex-end; gap: 8px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.clock-item-value .clock-item-select { flex: 1 1 auto; min-width: 120px; max-width: 320px; }
.clock-field { display: inline-flex; flex-direction: column; gap: 1px; }
.clock-field-grow { flex: 1 1 140px; min-width: 120px; }
.clock-field-grow .clock-item-text { width: 100%; box-sizing: border-box; }
.clock-field-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; color: #8a8a8a; padding-left: 1px; }
.clock-item-track-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.clock-track-picker { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.clock-track-current { display: flex; align-items: center; gap: 6px; min-width: 0; }
.clock-track-play { padding: 2px 8px; flex: 0 0 auto; }
.clock-track-play.is-playing { color: #b21f2d; border-color: #b21f2d; }
.clock-track-searchwrap { position: relative; min-width: 0; }
.clock-track-search { width: 100%; box-sizing: border-box; font-size: 12px; padding: 3px 6px; }
.clock-track-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid #c3c3c3;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
.clock-track-result { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #f0f0f0; }
.clock-track-result:last-child { border-bottom: none; }
.clock-track-result-play { padding: 2px 7px; margin: 3px 0 3px 4px; flex: 0 0 auto; }
.clock-track-result-play.is-playing { color: #b21f2d; border-color: #b21f2d; }
.clock-track-result-pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 4px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}
.clock-track-result-pick:hover { background: #eef4fd; }
.clock-track-result-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock-track-result-dur { flex: 0 0 auto; color: #888; font-size: 11px; }
.clock-track-result-empty { padding: 8px; font-size: 12px; }
.clock-item-duration { width: 60px; }
.clock-item-number { width: 56px; }
.clock-item-text { flex: 1 1 120px; min-width: 100px; }
.clock-item-voice-desc { flex: none; width: 170px; min-width: 0; }
.clock-item-readonly { font-size: 11px; font-style: italic; }
.clock-item-controls { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.clock-item-segue { width: 120px; }
.clock-item-segue:disabled { opacity: 0.5; }
.clock-item-segue-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.clock-item-segue-toggle input { margin: 0; }
.clock-item-lock { padding: 2px 7px; color: #999; }
.clock-item-lock.is-locked { color: #b8860b; border-color: #b8860b; background: #fdf6e3; }
.clock-item-buttons { display: flex; gap: 2px; flex: 0 0 auto; }
.clock-item-btn { padding: 2px 6px; }
.clocks-list-dot { width: 14px; height: 14px; }

/* ============================ Track importer ============================ */
.import-window-body { display: flex; flex-direction: column; gap: 10px; padding: 10px; min-height: 0; overflow: hidden; }
/* In window mode the panel has a fixed height, so make it a flex column and let
   the body fill it. Only the file list scrolls; the dropzone/controls/actions
   (incl. the "Importer" button) stay pinned and always reachable. */
.app-grid.is-window-mode .import-window { display: flex; flex-direction: column; }
.app-grid.is-window-mode .import-window > .import-window-body { flex: 1 1 auto; }
.import-controls,
.import-newgroup,
.import-dropzone,
.import-actions { flex: 0 0 auto; }
.import-controls { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.import-group-field { display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.import-group-field span { font-size: 11px; color: #666; }
.import-group-field select { min-width: 160px; }
.import-group-row { display: flex; align-items: center; gap: 6px; }
.import-newgroup { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.import-newgroup.hidden { display: none; }
.import-newgroup input[type="text"] { flex: 1 1 200px; min-width: 140px; }
.import-newgroup input[type="color"] { width: 34px; height: 28px; padding: 1px; }
.import-analyse-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #444; cursor: pointer; user-select: none; }
.import-dropzone {
  border: 2px dashed #c3c3c3;
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.import-dropzone:hover { border-color: #9fb9d8; }
.import-dropzone.is-dragover { border-color: #2b7de0; background: #f2f7fe; }
.import-dropzone-title { margin: 0 0 8px; color: #555; font-size: 13px; }
.import-dropzone small { display: block; margin-top: 8px; }
.import-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow: auto; }
.import-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
}
.import-item.is-done { border-left-color: #2e9c53; }
.import-item.is-error { border-left-color: #c0392b; background: #fdf3f2; }
.import-item.is-uploading { border-left-color: #2b7de0; }
.import-item-main { grid-column: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.import-item-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: #333; }
.import-item-status { flex: 0 0 auto; font-size: 11px; color: #777; white-space: nowrap; }
.import-item.is-error .import-item-status { color: #c0392b; }
.import-item.is-done .import-item-status { color: #2e9c53; }
.import-progress { grid-column: 1; height: 4px; border-radius: 3px; background: #ececec; overflow: hidden; }
.import-progress-fill { height: 100%; width: 0; background: #2b7de0; transition: width 0.12s linear; }
.import-item.is-done .import-progress-fill { background: #2e9c53; }
.import-item-remove { grid-column: 2; grid-row: 1 / span 2; padding: 2px 7px; }
.import-actions { display: flex; align-items: center; gap: 10px; }
.import-summary { flex: 1 1 auto; font-size: 12px; }

/* ============================ Schedule (Programmation) ============================ */
.schedule-window {
  background: #ececec;
  border: 1px solid #777;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.schedule-window-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.schedule-nav { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.schedule-nav-spacer { flex: 1 1 auto; }
.schedule-range { font-size: 12px; font-weight: 600; color: #333; white-space: nowrap; }
.schedule-window-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow: hidden; }
.schedule-grid-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid #b8b8b8; background: #fff; border-radius: 4px; }
.schedule-status { flex: 0 0 auto; font-size: 12px; }

.schedule-grid { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; font-size: 11px; }
.schedule-grid th, .schedule-grid td { border-right: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; }
.schedule-grid thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f3f3f3; color: #333;
  padding: 4px 3px; text-align: center; font-weight: 600;
}
.schedule-grid thead th.is-today { background: #dcecff; }
.schedule-day-head { display: table-cell; }
.schedule-day-name { display: block; }
.schedule-day-date { display: block; font-size: 10px; font-weight: 400; }
.schedule-corner { left: 0; z-index: 4 !important; width: 52px; }
.schedule-hour-head {
  position: sticky; left: 0; z-index: 2;
  background: #f3f3f3; color: #555;
  width: 52px; text-align: right; padding: 0 6px;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.schedule-cell {
  height: 26px; padding: 0 4px; cursor: pointer; position: relative;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  --sch-cell-color: transparent;
  transition: filter 0.1s ease, box-shadow 0.1s ease;
}
.schedule-cell.is-empty { color: #ccc; text-align: center; background: #fafafa; }
.schedule-cell.is-empty .schedule-cell-plus { font-size: 13px; opacity: 0; transition: opacity 0.1s ease; }
.schedule-cell.is-empty:hover { background: #eef4ff; }
.schedule-cell.is-empty:hover .schedule-cell-plus { opacity: 1; color: #2b7de0; }
.schedule-cell.is-filled {
  background: var(--sch-cell-color);
  color: #1a1a1a; font-weight: 600;
}
.schedule-cell.is-filled.is-dark { color: #fff; }
.schedule-cell.is-filled:hover { filter: brightness(1.06); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35); }
.schedule-cell-label { display: block; overflow: hidden; text-overflow: ellipsis; }
.schedule-cell.is-modified::after {
  content: ""; position: absolute; top: 2px; right: 2px;
  width: 5px; height: 5px; border-radius: 50%; background: rgba(0, 0, 0, 0.55);
}
.schedule-cell.is-filled.is-dark.is-modified::after { background: rgba(255, 255, 255, 0.85); }
.schedule-cell-badge { display: none; }
.schedule-cell.is-now { box-shadow: inset 2px 0 0 #e0392b; }
.schedule-grid thead th.is-today.is-now { }

/* ===== Playout log scheduler (Programmation du log) ===== */
.logsched-window {
  background: #ececec;
  border: 1px solid #777;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.logsched-window-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logsched-nav { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.logsched-window-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; overflow: hidden; }
.logsched-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11px; color: #444; }
.logsched-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.logsched-legend .lg-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.2); display: inline-block; }
.logsched-legend .lg-empty { background: #fafafa; }
.logsched-legend .lg-done { background: #cdeccd; }
.logsched-legend .lg-warn { background: #fbe7a6; }
.logsched-legend .lg-mic-empty-legend { color: #d0342c; font-weight: 700; }
.logsched-legend .lg-open-legend { color: #2b7de0; font-weight: 700; border: 1px solid rgba(43,125,224,0.4); border-radius: 3px; padding: 0 3px; }
.logsched-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }
.logsched-overwrite { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.logsched-selcount { font-size: 12px; }

.logsched-cell {
  height: 26px; padding: 0 4px; cursor: pointer; position: relative;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: #fafafa; user-select: none;
  transition: filter 0.1s ease, box-shadow 0.1s ease;
}
.logsched-cell.ls-empty { background: #fafafa; color: #bbb; text-align: center; }
.logsched-cell.ls-empty::before { content: "·"; }
.logsched-cell.ls-done { background: #cdeccd; color: #143d14; font-weight: 600; }
.logsched-cell.ls-warn { background: #fbe7a6; color: #5a4600; }
.logsched-cell .ls-clock { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; padding-left: 3px; }
.logsched-cell .ls-mic { position: absolute; top: 1px; right: 2px; font-size: 10px; line-height: 1; }
/* Recorded voicetrack: normal mic. Unrecorded placeholder: red badge so unfilled
   hours stand out at a glance. */
.logsched-cell .ls-mic-filled { filter: grayscale(0.1); }
.logsched-cell .ls-mic-empty { filter: none; }
.logsched-cell .ls-mic-empty::after {
  content: "!"; position: absolute; top: -3px; right: -5px;
  font-size: 8px; font-weight: 700; color: #fff; background: #d0342c;
  border-radius: 50%; width: 9px; height: 9px; line-height: 9px; text-align: center;
}
.logsched-cell.ls-voice-empty { box-shadow: inset 0 -3px 0 rgba(208, 52, 44, 0.55); }
/* Off-target duration badge (minutes over/under the 60 min hour). Long hours get
   a soft neutral chip; short hours get a red chip since they're the ones that
   actually leave dead air to fill. */
.logsched-cell .ls-delta {
  position: absolute; bottom: 0; right: 1px; z-index: 1;
  font-size: 9px; font-weight: 700; line-height: 12px;
  padding: 0 3px; border-radius: 3px; pointer-events: none;
}
.logsched-cell .ls-delta-long { background: rgba(90, 70, 0, 0.16); color: #5a4600; }
.logsched-cell .ls-delta-short { background: #d0342c; color: #fff; }
/* Per-hour "open in log" button, revealed on hover. */
.logsched-cell .ls-open {
  position: absolute; bottom: 0; left: 1px; width: 15px; height: 15px; padding: 0;
  border: none; background: rgba(255, 255, 255, 0.82); color: #2b7de0;
  border-radius: 3px; font-size: 10px; line-height: 15px; cursor: pointer;
  opacity: 0; transition: opacity 0.1s ease; z-index: 2;
}
.logsched-cell:hover .ls-open { opacity: 1; }
.logsched-cell .ls-open:hover { background: #2b7de0; color: #fff; }
.logsched-cell.is-past { opacity: 0.5; cursor: not-allowed; background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.03) 0 4px, transparent 4px 8px); }
.logsched-cell.is-current-hour { box-shadow: inset 2px 0 0 #e0392b; cursor: not-allowed; }
.logsched-cell:not(.is-past):hover { filter: brightness(1.04); box-shadow: inset 0 0 0 2px rgba(43, 125, 224, 0.5); }
.logsched-cell.is-selected { box-shadow: inset 0 0 0 2px #2b7de0, inset 0 0 0 100px rgba(43, 125, 224, 0.22); }
.logsched-cell.is-selected.ls-done { box-shadow: inset 0 0 0 2px #2b7de0, inset 0 0 0 100px rgba(43, 125, 224, 0.28); }
.logsched-day-head, .logsched-hour-head { cursor: pointer; }
.logsched-day-head:hover, .logsched-hour-head:hover { background: #e4eefc; }
.logsched-cell.ls-processing { background: #dbe9fb; color: transparent; }
.logsched-cell.ls-processing .ls-clock,
.logsched-cell.ls-processing .ls-mic { visibility: hidden; }
.logsched-cell .ls-spin {
  position: absolute; top: 50%; left: 50%; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border-radius: 50%;
  border: 2px solid rgba(43, 125, 224, 0.35); border-top-color: #2b7de0;
  animation: ls-spin-rot 0.6s linear infinite;
}
@keyframes ls-spin-rot { to { transform: rotate(360deg); } }

/* Slot picker popup */
.schedule-picker {
  position: fixed;
  min-width: 240px; max-width: 300px;
  max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid #888;
  border-radius: 6px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  padding: 8px; z-index: 3000;
  display: flex; flex-direction: column; gap: 6px;
}
.schedule-picker-header { display: flex; flex-direction: column; gap: 2px; }
.schedule-picker-header strong { font-size: 12px; text-transform: capitalize; }
.schedule-picker-current { font-size: 11px; }
.schedule-picker-filter { width: 100%; box-sizing: border-box; padding: 4px 6px; font-size: 12px; }
.schedule-picker-list { display: flex; flex-direction: column; gap: 1px; max-height: 260px; overflow: auto; }
.schedule-picker-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 6px; border: none; background: transparent;
  text-align: left; cursor: pointer; border-radius: 4px; font-size: 12px;
}
.schedule-picker-item:hover { background: #eef4ff; }
.schedule-picker-item.is-current { background: #e3efff; font-weight: 600; }
.schedule-picker-dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 3px; background: #bbb; border: 1px solid rgba(0, 0, 0, 0.25); }
.schedule-picker-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-picker-empty { padding: 8px 6px; font-size: 12px; }
.schedule-picker-clear { border-top: 1px solid #e2e2e2; padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.schedule-picker-clear-title { font-size: 11px; }
.schedule-picker-clear-btn {
  padding: 5px 6px; border: 1px solid #cfcfcf; background: #f6f6f6;
  border-radius: 4px; cursor: pointer; font-size: 12px; text-align: left;
}
.schedule-picker-clear-btn:hover { background: #eee; }
.schedule-picker-clear-btn.danger { color: #c0392b; border-color: #e6b3ad; }
.schedule-picker-clear-btn.danger:hover { background: #fdeceb; }
.schedule-picker-repeat {
  border-top: 1px solid #e2e2e2; padding-top: 6px; margin-top: 2px;
}
.schedule-picker-repeat-btn {
  width: 100%; padding: 6px; border: 1px solid #cfcfcf; background: #f0f6ff;
  border-radius: 4px; cursor: pointer; font-size: 12px; color: #1c5fb0; font-weight: 600;
}
.schedule-picker-repeat-btn:hover { background: #e3efff; }

/* Recurrence editor modal */
.schedule-repeat-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 4000;
}
.schedule-repeat-backdrop.hidden { display: none; }
.schedule-repeat-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(560px, 94vw); max-height: 90vh; overflow: hidden;
  background: #f4f4f4; border: 1px solid #777; border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); z-index: 4001;
  display: flex; flex-direction: column;
}
.schedule-repeat-modal.hidden { display: none; }
.srm-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #e6e6e6; border-bottom: 1px solid #ccc; }
.srm-header strong { font-size: 14px; }
.srm-body { padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.srm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.srm-row.hidden { display: none; }
.srm-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.srm-field > span { font-weight: 600; color: #444; }
.srm-field select, .srm-field input[type="date"], .srm-field input[type="number"] { padding: 4px 6px; font-size: 13px; }
.srm-every-row { display: inline-flex; align-items: center; gap: 6px; }
.srm-every-row input { width: 60px; }
.srm-label { font-weight: 600; color: #444; font-size: 12px; flex: 0 0 auto; align-self: flex-start; margin-top: 4px; }
.srm-days { display: flex; flex-wrap: wrap; gap: 4px; }
.srm-day-btn {
  padding: 5px 9px; border: 1px solid #bbb; background: #fff; border-radius: 4px;
  cursor: pointer; font-size: 12px; user-select: none;
}
.srm-day-btn.is-on { background: #2b7de0; border-color: #2b7de0; color: #fff; font-weight: 600; }
.srm-hours-row { align-items: flex-start; }
.srm-hour-all { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin-top: 3px; }
.srm-hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; flex: 1 1 auto; min-width: 260px; }
.srm-hour-btn {
  padding: 4px 0; border: 1px solid #bbb; background: #fff; border-radius: 3px;
  cursor: pointer; font-size: 11px; text-align: center; user-select: none;
  font-variant-numeric: tabular-nums;
}
.srm-hour-btn.is-on { background: #2b7de0; border-color: #2b7de0; color: #fff; font-weight: 600; }
.srm-grid-row { align-items: flex-start; }
.srm-grid-wrap { overflow: auto; max-width: 100%; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
.srm-grid { border-collapse: collapse; font-size: 10px; }
.srm-grid th, .srm-grid td { border: 1px solid #e4e4e4; text-align: center; }
.srm-grid thead th {
  background: #f3f3f3; color: #444; font-weight: 600; padding: 2px 0; min-width: 17px;
  cursor: pointer; user-select: none; font-variant-numeric: tabular-nums;
}
.srm-grid thead th.srm-grid-corner { cursor: default; min-width: 30px; }
.srm-grid thead th:hover:not(.srm-grid-corner) { background: #e3efff; }
.srm-grid tbody th {
  background: #f3f3f3; color: #444; font-weight: 600; padding: 0 6px; cursor: pointer;
  user-select: none; text-align: right; white-space: nowrap;
}
.srm-grid tbody th:hover { background: #e3efff; }
.srm-grid-cell { width: 17px; height: 17px; cursor: pointer; background: #fff; }
.srm-grid-cell:hover { background: #eef4ff; }
.srm-grid-cell.is-on { background: #2b7de0; }
.srm-radio { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.srm-hint { font-size: 11px; margin: 0; }
.srm-footer { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #ececec; border-top: 1px solid #ccc; }
.srm-status { flex: 1 1 auto; font-size: 12px; }

/* Restricted (non-admin) users: hide admin-only windows and controls. The
   elements stay in the DOM so app.js references remain valid; they're just
   never shown, and the window menu filters them out client-side. */
body.is-restricted .access-admin-only,
body.is-restricted [data-window-key="waveform"],
body.is-restricted [data-window-key="history"],
body.is-restricted [data-window-key="smartReplace"],
body.is-restricted #clocksWindow,
body.is-restricted #importWindow,
body.is-restricted #scheduleWindow,
body.is-restricted #logSchedWindow {
    display: none !important;
}

/* Voice-track recorder modal + per-row record button */
#vtRecorderModal.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}
#vtRecorderModal.hidden { display: none; }
#vtRecorderModal .modal {
    background: #f4f4f4; border: 1px solid #b8b8b8; border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); overflow: hidden;
}
#vtRecorderModal .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 12px; background: #e4e4e4; border-bottom: 1px solid #ccc;
}
#vtRecorderModal .modal-header h3 { margin: 0; font-size: 15px; }
#vtRecorderModal .modal-body { padding: 14px 12px; }
#vtRecorderModal .modal-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 10px 12px; background: #ececec; border-top: 1px solid #ccc;
}

#bulkEditModal.modal-backdrop {
    position: fixed; inset: 0; z-index: 210;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}
#bulkEditModal.hidden { display: none; }
#bulkEditModal .modal {
    width: min(520px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #f4f4f4;
    border: 1px solid #b8b8b8;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
#bulkEditModal .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 12px; background: #e4e4e4; border-bottom: 1px solid #ccc;
    flex: 0 0 auto;
}
#bulkEditModal .modal-header h3 { margin: 0; font-size: 15px; }
#bulkEditModal .modal-body {
    padding: 12px;
    overflow: auto;
    display: grid;
    gap: 8px;
}
#bulkEditModal .modal-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 10px;
    padding: 10px 12px; background: #ececec; border-top: 1px solid #ccc;
    flex: 0 0 auto;
}
.bulk-edit-hint {
    margin: 0;
    font-size: 12px;
}
.bulk-edit-form {
    display: grid;
    gap: 6px;
}
.bulk-edit-row {
    display: grid;
    grid-template-columns: 18px 110px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin: 0;
    font-size: 12px;
}
.bulk-edit-row-tall {
    align-items: start;
}
.bulk-edit-row-tall span {
    padding-top: 4px;
}
.bulk-edit-row input[type="checkbox"] {
    margin: 0;
}
.bulk-edit-row input:not([type="checkbox"]),
.bulk-edit-row select,
.bulk-edit-row textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font: inherit;
    padding: 4px 6px;
    border: 1px solid #b8b8b8;
    border-radius: 3px;
    background: #fff;
}
.bulk-edit-row input:disabled,
.bulk-edit-row select:disabled,
.bulk-edit-row textarea:disabled {
    background: #eee;
    color: #888;
}
#bulkEditStatus {
    display: block;
    min-height: 1em;
}
.vt-drag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border: 1px dashed #7a7a7a; border-radius: 14px;
    background: #eee; font-size: 12px; cursor: grab; user-select: none;
    white-space: nowrap;
}
.vt-drag-chip:hover { background: #e2e2e2; }
.vt-drag-chip:active { cursor: grabbing; }

/* Podcast recording marker chips */
.podcast-chip.podcast-chip-start { border-color: #b93b3b; background: #fdecec; color: #a11f1f; }
.podcast-chip.podcast-chip-start:hover { background: #f9dede; }
.podcast-chip.podcast-chip-stop { border-color: #3a63b0; background: #eaf0fb; color: #234a92; }
.podcast-chip.podcast-chip-stop:hover { background: #dde8fa; }

/* Podcast picker popup (searchable dropdown) */
.podcast-picker {
    position: fixed;
    min-width: 280px; max-width: 340px;
    background: #fff; border: 1px solid #888;
    border-radius: 6px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
    padding: 8px; z-index: 3200;
    display: flex; flex-direction: column; gap: 6px;
}
.podcast-picker.hidden { display: none; }
.podcast-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.podcast-picker-header strong { font-size: 12px; }
.podcast-picker-search { width: 100%; box-sizing: border-box; padding: 5px 7px; font-size: 12px; }
.podcast-picker-list { display: flex; flex-direction: column; gap: 1px; max-height: 300px; overflow: auto; }
.podcast-picker-item {
    display: flex; align-items: baseline; gap: 7px;
    padding: 6px 7px; border: none; background: transparent;
    text-align: left; cursor: pointer; border-radius: 4px; font-size: 12px;
}
.podcast-picker-item:hover, .podcast-picker-item.is-active { background: #fdecec; }
.podcast-picker-item .podcast-picker-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.podcast-picker-item .podcast-picker-meta { flex: 0 0 auto; color: #888; font-size: 11px; }
.podcast-picker-empty { padding: 8px 6px; font-size: 12px; color: #888; }
.podcast-picker-info { min-height: 14px; }

/* Podcast recording segment highlighting in the hour log. Keep the element's
   own row color intact — only draw a red left-edge bracket to link the segment
   (a continuous bar down the segment, capped at the start/stop rows). */
#hourLogTable tbody tr.is-rec-start td:first-child,
#hourLogTable tbody tr.is-rec-stop td:first-child,
#hourLogTable tbody tr.is-rec-inside td:first-child {
    box-shadow: inset 4px 0 0 #c0392b;
}
#hourLogTable tbody tr.is-rec-start td:first-child { box-shadow: inset 4px 4px 0 #c0392b; }
#hourLogTable tbody tr.is-rec-stop td:first-child { box-shadow: inset 4px -4px 0 #c0392b; }
.rec-marker-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 6px; margin-right: 6px; border-radius: 10px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
    background: #c0392b; color: #fff;
    border: none; line-height: 1.5; font-family: inherit;
    max-width: 20em; vertical-align: middle;
}
/* Only the podcast name may ellipsize; the icon and pencil stay visible and the
   badge stays bounded so it never blows out the (fixed-layout) title cell. */
.rec-marker-badge .rec-badge-icon,
.rec-marker-badge .rec-badge-edit { flex: 0 0 auto; }
.rec-marker-badge .rec-badge-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-marker-badge.is-stop { background: #234a92; }
button.rec-marker-editable { cursor: pointer; }
button.rec-marker-editable:hover { background: #a93226; }

.vt-recorder { width: min(460px, 92vw); }
.vt-recorder-body { display: flex; flex-direction: column; gap: 12px; }
.vt-recorder-controls { align-items: center; gap: 12px; }
.vt-recorder-timer { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; margin-left: auto; }
.vt-recorder-preview { width: 100%; }
.vt-recorder-status { min-height: 16px; }
.vt-record-btn { margin-left: 6px; padding-left: 5px; padding-right: 5px; }
.vt-record-btn.is-recorded { color: #0a7d28; }
.vt-listen-btn { margin-left: 6px; padding-left: 5px; padding-right: 5px; color: #1a5fb4; }
.vt-listen-btn.is-playing { color: #b45309; font-weight: 600; }
/* The title cell is clipped (overflow:hidden) and can be very narrow under custom
   column layouts, which hides the voice-track action buttons. Let voice-track rows'
   title cell overflow so the compact ▶ / 🎙 buttons stay visible and clickable,
   spilling over the (empty) neighbouring tempo/group cells. */
#hourLogTable tbody tr.log-type-voice td[data-col-key="title"] {
  overflow: visible;
  position: relative;
  z-index: 2;
}
#hourLogTable tbody tr.log-type-voice .vt-listen-btn,
#hourLogTable tbody tr.log-type-voice .vt-record-btn {
  position: relative;
  z-index: 3;
}

