:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --app-shell-width: 1380px;
  --line: #d9dee7;
  --muted: #637083;
  --surface-muted: #f7f9fb;
  background: #eef1f4;
  color: #1f2933;
}

body {
  margin: 0;
}

body.auth-loading .shell,
body.auth-loading .auth-page {
  display: none;
}

body.auth-required .shell {
  display: none;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-page[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(31, 41, 51, 0.14);
}

.login-card img {
  width: 132px;
  height: auto;
}

.login-card h1 {
  font-size: 26px;
}

.login-error {
  color: #ED0A3A;
  font-size: 14px;
}

.shell {
  width: min(var(--app-shell-width), calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: 128px;
  height: auto;
  display: block;
}

.topbar-status {
  min-width: 180px;
  flex: 1 1 auto;
}

.account-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 188px;
  flex: 0 0 auto;
}

.account-copy {
  display: grid;
  gap: 2px;
  text-align: right;
  line-height: 1.1;
}

.account-copy span {
  color: #8a96a3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-copy strong {
  max-width: 170px;
  color: #233848;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #c8d3df;
  border-radius: 50%;
  background: #fff;
  color: #496172;
  font-size: 18px;
  line-height: 1;
}

.logout-button:hover:not(:disabled) {
  border-color: #012F46;
  color: #012F46;
}

.logout-button:disabled {
  color: #aab4bf;
  cursor: default;
  opacity: 0.72;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 19px;
}

.topbar p,
.muted {
  color: #687482;
  margin-top: 6px;
}

.tabs {
  display: inline-flex;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.tab,
button {
  appearance: none;
  border: 0;
  background: #fff;
  color: #1f2933;
  font: inherit;
  cursor: pointer;
}

.tab {
  padding: 10px 14px;
  border-right: 1px solid #b8c1cc;
}

.tab:last-child {
  border-right: 0;
}

.tab.active,
button[type="submit"],
.section-head button {
  background: #012F46;
  color: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics.customer-dashboard {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics article,
.panel,
.table-wrap {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
}

.metrics article {
  padding: 14px;
}

.metrics span {
  display: block;
  color: #687482;
  font-size: 13px;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.section-head.compact {
  justify-content: flex-start;
  align-items: center;
}

.section-head.compact button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.section-head.centered {
  justify-content: center;
}

.section-head button,
button[type="submit"] {
  border-radius: 7px;
  padding: 10px 14px;
}

.secondary {
  width: fit-content;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 8px 11px;
  margin-bottom: 10px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button,
.form-actions button,
.modal-actions button,
.user-actions button,
.location-actions button,
.media-upload-actions button,
.campaign-actions button,
.row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.points-table {
  table-layout: fixed;
}

.points-table th:nth-child(1),
.points-table td:nth-child(1) {
  width: 210px;
}

.points-table th:nth-child(2),
.points-table td:nth-child(2) {
  width: 110px;
}

.points-table th:nth-child(4),
.points-table td:nth-child(4) {
  width: 150px;
}

.points-table th:nth-child(5),
.points-table td:nth-child(5) {
  width: 260px;
}

.points-table td {
  overflow-wrap: anywhere;
}

.points-table td:nth-child(5) {
  white-space: normal;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e3e8ee;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #687482;
  font-size: 13px;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.track-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: #F2F6F8;
  color: #012F46;
  font-size: 13px;
}

.status.offline {
  background: #FFF1F4;
  color: #ED0A3A;
}

.danger {
  border: 1px solid #F29AAD;
  border-radius: 7px;
  padding: 8px 10px;
  color: #ED0A3A;
}

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

.clock-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.62fr) minmax(720px, 1.8fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.form-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-bottom: 0;
}

.form-actions button:not(.secondary):not(.danger) {
  border-radius: 7px;
  background: #012F46;
  color: #fff;
  padding: 8px 14px;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.panel.wide {
  margin-top: 16px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watermark-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.watermark-file-status,
.watermark-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.watermark-file-card,
.watermark-status-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid #d7dfe7;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafb;
}

.watermark-file-card.ready {
  border-color: #8AA7B6;
}

.watermark-file-card.missing {
  border-color: #F29AAD;
}

.watermark-file-card span,
.watermark-status-grid span {
  color: #687482;
  font-size: 13px;
}

.watermark-status-grid strong {
  font-size: 22px;
}

.analytics-panel {
  display: grid;
  gap: 12px;
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.analytics-card {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.analytics-card span,
.analytics-list-row span,
.heat-row span,
.analytics-table small {
  display: block;
  color: #687482;
  font-size: 12px;
  margin-top: 4px;
}

.analytics-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.analytics-card.ok,
.analytics-badge.ok {
  border-color: #8AA7B6;
  background: #eefaf2;
  color: #012F46;
}

.analytics-card.attention,
.analytics-badge.attention {
  border-color: #d8bd68;
  background: #fff8df;
  color: #7a5a00;
}

.analytics-card.warn,
.analytics-badge.warn {
  border-color: #e58b9c;
  background: #fff1f4;
  color: #9f1239;
}

.analytics-card.offline,
.analytics-badge.offline {
  border-color: #c9d1dc;
  background: #f2f5f8;
  color: #5c6875;
}

.analytics-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #ccd4dd;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.analytics-scroll {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  border-bottom: 1px solid #e1e6ec;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.analytics-table th {
  color: #687482;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.analytics-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analytics-columns h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.analytics-list-row {
  border-bottom: 1px solid #e1e6ec;
  padding: 8px 0;
}

.analytics-heatmap {
  display: grid;
  gap: 8px;
}

.heat-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 2fr) 64px;
  align-items: center;
  gap: 12px;
}

.heat-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e6ec;
}

.heat-bar span {
  display: block;
  height: 100%;
  margin: 0;
  background: #012F46;
}

.heat-row em {
  color: #233848;
  font-style: normal;
  font-weight: 700;
  text-align: right;
}

label {
  display: grid;
  gap: 6px;
  color: #3a4652;
  font-size: 14px;
}

input,
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
}

input.invalid {
  border-color: #ED0A3A;
  box-shadow: 0 0 0 2px rgba(155, 44, 44, 0.12);
}

input.valid {
  border-color: #012F46;
  box-shadow: 0 0 0 2px rgba(1, 47, 70, 0.12);
}

.field-hint {
  color: #687482;
  font-size: 12px;
}

.field-hint.error {
  color: #ED0A3A;
}

.field-hint.ok {
  color: #012F46;
}

textarea {
  resize: vertical;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.client-list {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}

.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
}

.client-row:hover {
  border-color: #012F46;
  background: #F2F6F8;
}

.client-row strong,
.client-row small,
.client-row-meta {
  display: block;
}

.client-row small,
.client-row-meta {
  color: #687482;
  font-size: 13px;
  margin-top: 4px;
}

.client-row-meta {
  text-align: right;
}

.client-detail[hidden] {
  display: none;
}


.client-settings-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
}

.client-settings-header .icon-button {
  width: 38px;
  min-height: 34px;
  padding: 0;
  border-color: #b8c1cc;
  background: #fff;
  color: #012F46;
  font-size: 19px;
  line-height: 1;
}

.client-settings-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.client-settings-title h2 {
  margin: 0;
  color: #0d2230;
  font-size: 20px;
  line-height: 1.15;
}

.client-settings-title p {
  margin: 0;
  color: #687482;
  font-size: 13px;
  line-height: 1.25;
}

.client-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px 48px;
  padding: 3px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #F2F6F8;
  width: fit-content;
  max-width: calc(100% - 48px);
}

.client-settings-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #012F46;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.client-settings-tabs button.active {
  background: #012F46;
  color: #fff;
  box-shadow: 0 1px 2px rgba(1, 47, 70, 0.16);
}

.client-settings-section {
  display: none;
}

.client-settings-section.active {
  display: block;
}

.client-settings-section .panel:first-child,
.client-settings-section .clock-layout:first-child {
  margin-top: 0;
}

.danger-zone {
  border-color: #F29AAD;
  background: #FFF1F4;
}

.danger-zone h2 {
  color: #ED0A3A;
}

.playlist-list,
.location-list,
.clock-category-library,
.clock-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.clock-category-library {
  align-content: start;
  height: 900px;
  min-height: 900px;
  max-height: 900px;
  overflow: auto;
  padding-right: 2px;
}

.clock-source-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.clock-source-toolbar .secondary {
  margin-bottom: 0;
}

.clock-source-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-field {
  display: grid;
  grid-template-columns: auto 160px;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.schedule-mode-field {
  margin-left: 0;
}

.schedule-mode-field select,
.inline-field select {
  min-height: 36px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 6px 32px 6px 10px;
  background: #fff;
  color: #1f2933;
  font: inherit;
}

#clockScheduleDateField[hidden],
#clearDateSchedule[hidden] {
  display: none;
}


.section-head.compact .secondary.active {
  border-color: #012F46;
  background: #F2F6F8;
  color: #012F46;
}

.clock-toolbar {
  grid-template-columns: auto minmax(240px, 0.9fr) minmax(260px, 1.1fr) auto auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 8px;
}

.clock-toolbar h2 {
  align-self: end;
  margin: 0 6px 6px 0;
  font-size: 18px;
  line-height: 34px;
}

.clock-toolbar button {
  align-self: end;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  margin-bottom: 0;
  white-space: nowrap;
}

.clock-select-field {
  display: grid;
  grid-template-rows: 14px 34px;
  gap: 3px;
  min-width: 0;
  margin: 0;
}

.clock-select-field span {
  color: #687482;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
}

.clock-select-field select {
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 0 34px 0 10px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  background: #fff;
  color: #1f2933;
  font: inherit;
}

.clock-name-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  align-self: end;
  gap: 8px;
  min-width: 0;
}

.clock-name-slot .clock-name {
  width: 100%;
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  background: #fff;
  color: #1f2933;
  font: inherit;
}

.clock-name-slot button {
  border: 1px solid #b8c1cc;
  border-radius: 7px;
}


.clock-list-item {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.clock-list-item span {
  color: #687482;
  font-size: 13px;
}

.clock-list-item.selected {
  border-color: #012F46;
  background: #F2F6F8;
  box-shadow: 0 0 0 2px rgba(1, 47, 70, 0.12);
}

.clock-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.clock-editor-body {
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(320px, 1.22fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.clock-order-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.clock-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border-bottom: 1px solid #d9e0e7;
  background: #F2F6F8;
  color: #012F46;
}

.clock-order-head span {
  color: #687482;
  font-size: 12px;
  font-weight: 700;
}

.hour-schedule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.clock-schedule-grid {
  display: grid;
  grid-template-columns: 74px repeat(7, minmax(120px, 1fr));
  gap: 0;
  overflow-x: auto;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #d9e0e7;
}

.clock-schedule-grid.date-mode {
  grid-template-columns: 74px minmax(220px, 1fr);
}

.clock-schedule-corner,
.clock-schedule-head,
.clock-schedule-hour {
  display: grid;
  align-items: center;
  min-height: 32px;
  padding: 5px 8px;
  background: #f7f9fb;
  color: #5f6c7a;
  font-weight: 700;
}

.clock-schedule-head {
  justify-content: center;
  text-align: center;
}

.clock-schedule-hour {
  justify-content: end;
  border-top: 1px solid #d9e0e7;
}

.clock-schedule-cell {
  display: grid;
  gap: 1px;
  min-height: 34px;
  border: 0;
  border-top: 1px solid #d9e0e7;
  border-left: 1px solid #d9e0e7;
  padding: 4px 8px;
  background: #fff;
  text-align: left;
  user-select: none;
  touch-action: none;
}

.clock-schedule-cell span {
  color: #8a96a3;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.clock-schedule-cell strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

.clock-schedule-cell:hover {
  background: #f8fafc;
}

.clock-schedule-cell.selected {
  position: relative;
  z-index: 1;
  background: #F2F6F8;
  box-shadow: inset 0 0 0 2px #012F46;
}

.clock-schedule-grid.selecting,
.clock-schedule-grid.selecting .clock-schedule-cell {
  cursor: crosshair;
  user-select: none;
}

.hour-slot {
  display: grid;
  gap: 8px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  text-align: left;
}

.hour-slot span {
  color: #687482;
  font-size: 13px;
  font-weight: 700;
}

.hour-slot strong {
  min-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hour-slot:hover {
  border-color: #9fb0c2;
  background: #f8fafc;
}

.hour-slot.selected {
  border-color: #012F46;
  box-shadow: 0 0 0 2px rgba(1, 47, 70, 0.14);
  background: #F2F6F8;
}

.clock-category,
.clock-card {
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: #fff;
}

.clock-category {
  cursor: grab;
  padding: 8px 9px;
}

.clock-category.archive-source {
  border-color: #d2b36a;
  background: #fff8e3;
}

.clock-category.folder-labeled,
.clock-item.folder-labeled,
.media-row.folder.folder-labeled,
.media-tree-row.folder-labeled {
  background: rgba(var(--folder-label-rgb), 0.13);
  box-shadow: inset 4px 0 0 var(--folder-label-color);
}

.clock-category.folder-labeled,
.clock-item.folder-labeled,
.media-row.folder.folder-labeled {
  border-color: rgba(var(--folder-label-rgb), 0.45);
}

.clock-category.folder-labeled:hover,
.media-row.folder.folder-labeled:hover {
  background: rgba(var(--folder-label-rgb), 0.2);
}

.clock-category:active {
  cursor: grabbing;
}

.clock-category strong,
.clock-category small {
  display: block;
}

.clock-category small,
.clock-foot,
.clock-empty {
  color: #687482;
  font-size: 12px;
  margin-top: 2px;
}

.clock-card {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.clock-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.clock-head .clock-name {
  min-height: 34px;
  padding: 7px 10px;
}

.clock-head button,
.clock-name-slot button,
.clock-item button {
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 8px 10px;
}

.clock-item button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  min-height: 22px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.clock-dropzone {
  display: grid;
  align-content: start;
  gap: 2px;
  height: 790px;
  min-height: 790px;
  max-height: 790px;
  overflow: auto;
  border: 1px dashed #b8c1cc;
  border-radius: 0;
  padding: 6px;
  background: #fafbfc;
}

.clock-wheel-panel {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(130px, 0.8fr);
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.clock-wheel-stage {
  position: relative;
  width: min(100%, 330px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  transition: box-shadow 0.16s ease, background 0.16s ease;
}

.clock-wheel-stage.drop-target,
.clock-dropzone.drop-target {
  background: #F2F6F8;
  box-shadow: 0 0 0 3px rgba(1, 47, 70, 0.18);
}

.clock-wheel {
  display: block;
  width: 100%;
  height: 100%;
}

.clock-wheel-base {
  fill: #F2F6F8;
  stroke: #8AA7B6;
  stroke-width: 1.2;
}

.clock-wheel-empty {
  fill: #F7F9FB;
  stroke: #cfd8e3;
  stroke-width: 0.8;
}

.clock-wheel-segment {
  stroke: #012F46;
  stroke-width: 0.8;
  cursor: default;
}

.clock-wheel-segment:hover {
  filter: brightness(1.04);
  stroke-width: 1.6;
}

.clock-wheel-tick {
  stroke: #012F46;
  stroke-width: 0.9;
  opacity: 0.35;
}

.clock-wheel-hole {
  fill: #fff;
  stroke: #8AA7B6;
  stroke-width: 1;
}

.clock-wheel-label {
  fill: #0d2230;
  font-size: 7px;
  font-weight: 700;
  pointer-events: none;
}

.clock-wheel-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34%;
  text-align: center;
  pointer-events: none;
}

.clock-wheel-center strong {
  color: #012F46;
  font-size: 18px;
  line-height: 1;
}

.clock-wheel-center span {
  color: #687482;
  font-size: 11px;
  line-height: 1.15;
}

.clock-wheel-meta {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 0;
}

.clock-wheel-meta strong {
  color: #012F46;
  font-size: 17px;
}

.clock-wheel-meta span {
  color: #1f2933;
  font-weight: 700;
}

.clock-wheel-meta small {
  color: #687482;
  line-height: 1.35;
}

.clock-wheel-panel.overfull {
  border-color: #F29AAD;
  background: #FFF1F4;
}

.clock-wheel-panel.complete {
  border-color: #8AA7B6;
  background: #F2F6F8;
}


.clock-item {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 18px 58px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 5px;
  height: 24px;
  min-height: 24px;
  border: 1px solid #d9e0e7;
  border-radius: 5px;
  background: #fff;
  padding: 1px 4px;
}

.clock-item[draggable="true"] {
  cursor: grab;
}

.clock-item.dragging {
  opacity: 0.55;
}

.clock-item-start {
  color: #687482;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.clock-item-number {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #F2F6F8;
  color: #012F46;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.clock-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.1;
}

.clock-item strong small {
  display: inline;
  color: #687482;
  font-size: 11px;
  font-weight: 700;
  margin-left: 5px;
}

.clock-context-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 4px;
  min-width: 210px;
  max-width: 280px;
  padding: 6px;
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.18);
}

.clock-context-menu[hidden] {
  display: none;
}

.clock-context-menu button {
  width: 100%;
  border-radius: 6px;
  padding: 9px 10px;
  text-align: left;
}

.clock-context-menu button:hover {
  background: #F2F6F8;
}

.playlist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 10px;
}

.playlist-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.playlist-row input {
  width: auto;
}

.playlist-row small {
  display: block;
  color: #687482;
  margin-top: 3px;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-actions button {
  width: 34px;
  height: 32px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
}

.row-actions button:disabled {
  color: #9aa5b1;
  cursor: default;
}

.location-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding: 4px 2px 0;
  color: #687482;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.location-group-header:first-child {
  margin-top: 0;
}

.location-group-header.test {
  margin-top: 14px;
  border-top: 1px dashed #d9bf58;
  padding-top: 12px;
  color: #7a5f00;
}

.location-card {
  display: grid;
  gap: 0;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.location-card.test-location {
  border-color: #efd777;
  background: #fff9df;
}

.location-card.test-location .location-row {
  background: #fff9df;
}

.location-row {
  display: grid;
  grid-template-columns: 32px minmax(140px, 1.15fr) 64px 78px 66px minmax(118px, 0.9fr) 68px 76px minmax(120px, 0.9fr) 70px minmax(248px, 248px);
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 14px;
}

.location-name,
.location-id,
.location-version,
.location-now-playing,
.location-cache-count,
.location-folder-size,
.location-activity,
.power-state {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-id {
  color: #3a4652;
  font-variant-numeric: tabular-nums;
}

.location-version,
.location-now-playing,
.location-cache-count,
.location-folder-size,
.location-activity {
  display: grid;
  gap: 1px;
}

.location-version span,
.location-now-playing span,
.location-cache-count span,
.location-folder-size span,
.location-activity span {
  color: #687482;
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.location-version strong,
.location-now-playing strong,
.location-cache-count strong,
.location-folder-size strong,
.location-activity strong,
.location-activity em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.location-version strong,
.location-now-playing strong,
.location-cache-count strong,
.location-folder-size strong,
.location-activity strong {
  font-size: 13px;
}

.location-activity em {
  color: #687482;
  font-size: 12px;
  font-style: normal;
}

.location-activity.online strong {
  color: #012F46;
}

.location-activity.offline strong {
  color: #ED0A3A;
}

.power-state {
  color: #012F46;
  font-size: 13px;
}

.power-state.off {
  color: #ED0A3A;
}

.expand-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 0;
  line-height: 1;
}

.expand-button {
  font-size: 24px;
  transition: transform 0.15s ease;
}

.location-card.expanded .expand-button {
  transform: rotate(90deg);
}

.danger-icon {
  color: #ED0A3A;
}

.location-row .status {
  min-height: 22px;
  padding: 0 8px;
  font-size: 12px;
}

.location-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
}

.location-actions button {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 13px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.location-actions .icon-button {
  width: 32px;
  padding: 0;
}

.point-playlist-row td {
  background: #F2F6F8;
}

.point-playlist {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  max-width: 100%;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  margin: 0 10px 10px 54px;
  padding: 12px;
  overflow-wrap: anywhere;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 41, 51, 0.34);
}

.modal[hidden] {
  display: none;
}

.modal-dialog {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(31, 41, 51, 0.22);
}

.user-dialog {
  width: min(840px, 100%);
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

.password-row .icon-button {
  width: 38px;
  height: 38px;
}

.location-test-toggle {
  width: 100%;
  border: 1px solid #d9bf58;
  border-radius: 7px;
  padding: 9px 12px;
  color: #7a5f00;
  background: #fff9df;
  font-weight: 700;
}

.location-test-toggle.active {
  border-color: #b99200;
  background: #ffeaa0;
  color: #4c3b00;
}

.location-volume-control {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e0e8;
  border-radius: 7px;
  padding: 10px 12px;
  background: #f8fafc;
}

.location-volume-control[hidden] {
  display: none;
}

.location-volume-head,
.location-volume-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.location-volume-head span {
  font-weight: 700;
  color: #1f2933;
}

.location-volume-head strong {
  font-variant-numeric: tabular-nums;
  color: #0f766e;
}

.location-volume-control input[type="range"] {
  width: 100%;
  accent-color: #0f766e;
}

.location-volume-scale {
  color: #6b7280;
  font-size: 12px;
}

.role-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.role-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  border: 1px solid #ccd4dd;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}

.role-choice input {
  width: auto;
}

.users-table,
.permission-matrix {
  overflow: auto;
}

.users-table table,
.permission-matrix table {
  min-width: 1100px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.role-pill,
.client-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 12px;
  padding: 0 8px;
  font-size: 12px;
}

.role-pill {
  background: #fde9ef;
  color: #b4234d;
}

.client-pill {
  background: #eef3f6;
  color: #233848;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-actions .secondary {
  margin-bottom: 0;
}

.permission-matrix th,
.permission-matrix td {
  min-width: 138px;
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 320px;
  background: #fff;
}

.permission-matrix td:first-child small {
  display: block;
  max-width: 340px;
  margin-top: 5px;
  color: #687482;
  line-height: 1.35;
}

.permission-toggle {
  min-width: 64px;
  border: 1px solid;
  border-radius: 14px;
  padding: 8px 14px;
  font-weight: 700;
}

.permission-toggle.yes {
  border-color: #8AA7B6;
  background: #E8F0F4;
  color: #012F46;
}

.permission-toggle.no {
  border-color: #efbec8;
  background: #fde8ed;
  color: #b4234d;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
}

.point-playlist-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.point-playlist-head small {
  color: #687482;
}

.now-grid,
.playlist-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.now-grid > div,
.playlist-columns > div {
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 10px;
}

.now-grid strong,
.now-grid span,
.playlist-columns strong {
  display: block;
}

.now-grid span {
  color: #3a4652;
  margin-top: 5px;
}

.playlist-columns ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.playlist-columns li {
  margin-bottom: 5px;
  color: #3a4652;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.category-card {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.category-card strong,
.category-card span {
  display: block;
}

.category-card span {
  color: #687482;
  margin-top: 5px;
  font-size: 13px;
}

.card {
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.card p {
  color: #687482;
  margin-top: 4px;
}

.media-browser {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 560px;
  border: 1px solid #ccd4dd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.media-sidebar {
  display: grid;
  align-content: start;
  gap: 4px;
  border-right: 1px solid #e3e8ee;
  background: #f8fafc;
  padding: 10px;
}

.media-roots {
  display: grid;
  gap: 4px;
}

.media-kind {
  border-radius: 7px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
}

.media-kind.archive-kind {
  border: 1px solid #d2b36a;
  background: #fff8e3;
  color: #5f4700;
  font-weight: 700;
  margin-bottom: 8px;
}

.media-kind.trash-kind {
  border: 1px solid #c6ccd4;
  background: #f1f3f5;
  color: #3a4652;
  font-weight: 700;
  margin-top: 8px;
}

.media-kind.active,
.media-kind:hover {
  background: #E8F0F4;
  color: #012F46;
}

.media-kind.active {
  box-shadow: inset 4px 0 0 #012F46, inset 0 0 0 1px #8AA7B6;
  font-weight: 800;
}

.media-kind.archive-kind.active,
.media-kind.archive-kind:hover {
  background: #fff0ba;
  color: #4c3900;
}

.media-kind.trash-kind.active,
.media-kind.trash-kind:hover {
  background: #e4e8ed;
  color: #1f2933;
}

.rotation-rules-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(520px, 1.5fr);
  gap: 16px;
  align-items: start;
}

.rotation-rule-list,
.rotation-source-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.rotation-rule-row {
  display: grid;
  gap: 4px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 11px;
  text-align: left;
}

.rotation-rule-row.selected {
  border-color: #012F46;
  background: #F2F6F8;
}

.rotation-rule-row span,
.rotation-source-row small {
  color: #687482;
  font-size: 13px;
}

.rotation-window-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rotation-assigned-rules {
  display: grid;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.rotation-rule-table-head,
.rotation-rule-param-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
}

.rotation-rule-table-head {
  background: #f2f4f6;
  color: #3a4652;
  font-size: 13px;
  font-weight: 700;
}

.rotation-rule-table-head span,
.rotation-rule-param-row span {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid #d4dbe3;
}

.rotation-rule-table-head span:last-child {
  border-right: 0;
}

.rotation-rule-param-row {
  gap: 0;
  border-top: 1px solid #d4dbe3;
  color: #1f2933;
  font-size: 14px;
}

.rotation-rule-param-row input {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  padding: 0 10px;
  font: inherit;
}

.rotation-source-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 8px;
}

.rotation-source-list[hidden] {
  display: none;
}

.rotation-source-note,
.field-hint {
  color: #687482;
  font-size: 13px;
  line-height: 1.35;
}

.rotation-source-note {
  margin: 6px 0 8px;
}

.rotation-source-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid #edf1f5;
  border-radius: 7px;
  padding: 9px;
}

.rotation-source-row.disabled {
  opacity: 0.58;
}

.rotation-source-row strong,
.rotation-source-row small {
  display: block;
}

#mediaNewFolderSide {
  margin-top: 10px;
  width: 100%;
}


.media-tree {
  display: grid;
  gap: 3px;
}

.media-tree-item {
  display: grid;
  gap: 2px;
}

.media-tree-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding-left: calc(var(--level, 0) * 15px);
  border-radius: 7px;
}

.media-tree-row.active {
  background: #E8F0F4;
  box-shadow: inset 4px 0 0 #012F46, inset 0 0 0 1px #8AA7B6;
}

.media-tree-row.folder-labeled.active {
  background: rgba(var(--folder-label-rgb), 0.22);
  box-shadow: inset 4px 0 0 var(--folder-label-color), inset 0 0 0 1px rgba(var(--folder-label-rgb), 0.52);
}

.media-tree-row.active .media-tree-toggle,
.media-tree-row.active .media-tree-label {
  color: #012F46;
  font-weight: 800;
}

.media-tree-row.drop-target {
  background: #E8F0F4;
  box-shadow: inset 0 0 0 2px #012F46;
}

.media-tree-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #496172;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.media-tree-toggle:hover {
  color: #012F46;
}

.media-tree-label {
  min-width: 0;
  width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-tree-empty {
  padding: 4px 8px 6px calc(22px + var(--level, 0) * 14px);
  color: #8a96a3;
  font-size: 12px;
}

.media-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
}

.media-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e3e8ee;
  padding: 12px;
}

.media-toolbar .actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 0;
}

.media-toolbar > div:first-child {
  min-width: 190px;
}

.media-search {
  display: grid;
  gap: 4px;
  flex: 1 1 260px;
  max-width: 380px;
  min-width: 220px;
}

.media-search span {
  color: #687482;
  font-size: 12px;
  font-weight: 700;
}

.media-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 8px 11px;
  background: #fff;
}

.media-search input:focus {
  border-color: #012F46;
  box-shadow: 0 0 0 3px rgba(1, 47, 70, 0.12);
  outline: none;
}


.media-filterbar {
  display: flex;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid #e3e8ee;
  padding: 8px 12px 10px;
  background: #F2F6F8;
  overflow: hidden;
}

.media-search-toggle {
  flex: 0 0 auto;
  align-self: end;
  width: 38px;
  min-width: 38px;
  height: 38px;
  margin-top: 20px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.media-search {
  display: grid;
  gap: 4px;
  flex: 0 0 0;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: flex-basis 180ms ease, max-width 180ms ease, opacity 160ms ease, transform 180ms ease;
}

.media-filterbar.search-open .media-search {
  flex-basis: calc(100% - 48px);
  max-width: calc(100% - 48px);
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.media-filter-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 160ms ease, transform 180ms ease, max-width 180ms ease;
}

.media-filter-controls > button {
  align-self: end;
  min-height: 38px;
  margin-top: 20px;
}

.media-filterbar.search-open .media-filter-controls {
  max-width: 0;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  overflow: hidden;
}

.media-filter-field {
  display: grid;
  grid-template-rows: 16px 38px;
  align-items: end;
  gap: 4px;
  min-width: 118px;
}

.media-filter-field span,
.media-pages span,
.media-search span {
  color: #687482;
  font-size: 12px;
  font-weight: 700;
}

.media-search input,
.media-filter-field input,
.media-filter-field select {
  width: 100%;
  height: 38px;
  min-height: 38px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  line-height: 20px;
}

.media-search input:focus,
.media-filter-field input:focus,
.media-filter-field select:focus {
  border-color: #012F46;
  box-shadow: 0 0 0 3px rgba(1, 47, 70, 0.12);
  outline: none;
}

.media-pages {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e3e8ee;
  padding: 9px 12px;
  background: #fff;
}

.media-pages .icon-only {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.media-toolbar .actions button {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
}

.media-toolbar .icon-only {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.media-toolbar .text-icon {
  width: 54px;
  min-width: 54px;
  font-size: 13px;
  font-weight: 700;
}

.media-toolbar .wide-icon {
  font-size: 22px;
}

.media-upload-button {
  min-height: 38px;
  border: 1px solid #012F46;
  border-radius: 7px;
  background: #012F46;
  color: #fff;
  padding: 0 16px;
}

.media-upload-button.dragging {
  background: #ED0A3A;
  border-color: #ED0A3A;
  box-shadow: 0 0 0 3px rgba(237, 10, 58, 0.18);
}

.media-upload-button:disabled {
  border-color: #b8c1cc;
  background: #e5ebf0;
  color: #687482;
}

.media-toolbar strong,
.media-toolbar span {
  display: block;
}

.media-dropzone {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: #fff;
}

.media-dropzone.dragging {
  box-shadow: inset 0 0 0 3px rgba(1, 47, 70, 0.24);
  background: #F2F6F8;
}

.media-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border-bottom: 1px solid #eef2f5;
  padding: 8px 12px;
  color: #687482;
}

.media-breadcrumbs button {
  border-radius: 6px;
  padding: 4px 7px;
  color: #012F46;
}

.media-list {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow: auto;
  outline: none;
}

.media-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--media-columns, 28px minmax(320px, 1fr) 72px 58px 70px 76px 70px 104px 92px 92px);
  gap: 10px;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid #dbe2ea;
  padding: 0 12px;
  background: #f8fafc;
}

.media-table-head button {
  min-width: 0;
  border: 0;
  padding: 0;
  color: #556273;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-table-head button:hover,
.media-table-head button.active {
  color: #012F46;
}

.media-table-head button span {
  margin-left: 4px;
}

.media-row {
  display: grid;
  grid-template-columns: var(--media-columns, 28px minmax(320px, 1fr) 72px 58px 70px 76px 70px 104px 92px 92px);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid #eef2f5;
  padding: 0 12px;
  text-align: left;
}

.media-row:hover {
  background: #f8fafc;
}

.media-row.selected {
  background: #F2F6F8;
  box-shadow: inset 3px 0 0 #012F46;
}

.media-row.folder.folder-labeled.selected {
  background: rgba(var(--folder-label-rgb), 0.22);
  box-shadow: inset 4px 0 0 var(--folder-label-color), inset 0 0 0 1px rgba(var(--folder-label-rgb), 0.5);
}

.media-row.drop-target {
  background: #E8F0F4;
  box-shadow: inset 0 0 0 2px #012F46;
}

.media-icon,
.media-duration,
.media-bpm,
.media-camelot,
.media-key,
.media-size,
.media-uploader,
.media-date,
.media-modified {
  color: #687482;
  font-size: 13px;
}

.media-camelot,
.media-key,
.media-uploader,
.media-date,
.media-modified,
.media-size,
.media-duration,
.media-bpm {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-icon {
  position: relative;
  width: 18px;
  height: 18px;
}

.media-row.folder .media-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 16px;
  height: 11px;
  border-radius: 2px;
  background: #8AA7B6;
}

.media-row.folder .media-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 8px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #8AA7B6;
}

.media-row.access-restricted .media-name::after {
  content: " / access";
  color: #9a6a13;
  font-size: 12px;
  font-weight: 700;
}

.media-row.file .media-icon::before {
  content: "\266A";
  position: absolute;
  left: 2px;
  top: -1px;
  color: #687482;
  font-size: 18px;
  line-height: 18px;
}

.media-row.search-result {
  min-height: 52px;
}

.media-name {
  min-width: 0;
  font-size: 13px;
  color: #1f2933;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-row.search-result .media-name {
  display: grid;
  gap: 2px;
}

.media-row.search-result .media-name small {
  min-width: 0;
  color: #687482;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-empty {
  padding: 28px 12px;
  color: #687482;
  text-align: center;
}

.media-upload-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: grid;
  gap: 10px;
  width: min(430px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 44px));
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 20px 58px rgba(31, 41, 51, 0.22);
}

.media-upload-panel[hidden] {
  display: none;
}

.media-upload-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.media-upload-head strong,
.media-upload-head span {
  display: block;
  min-width: 0;
}

.media-upload-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.media-upload-actions .secondary {
  margin-bottom: 0;
  padding: 8px 10px;
}

.media-upload-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 7px;
  background: #e5ebf0;
}

.media-upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #012F46;
  transition: width 0.16s ease;
}

.media-upload-list {
  display: grid;
  gap: 4px;
  overflow: auto;
  padding-right: 2px;
}

.media-upload-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(86px, auto);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid #edf1f5;
  border-radius: 7px;
  padding: 6px 8px;
  background: #fbfcfd;
}

.media-upload-row.done {
  border-color: #8AA7B6;
  background: #F2F6F8;
}

.media-upload-row.failed {
  border-color: #f1c0c9;
  background: #fff5f7;
}

.media-upload-row.cancelled {
  opacity: 0.72;
}

.media-upload-status {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5ebf0;
  color: #496172;
  font-size: 11px;
  font-weight: 700;
}

.media-upload-row.uploading .media-upload-status {
  border: 2px solid #cbd6df;
  border-top-color: #012F46;
  background: transparent;
  animation: media-upload-spin 0.9s linear infinite;
}

.media-upload-row.done .media-upload-status {
  background: #012F46;
  color: #fff;
}

.media-upload-row.failed .media-upload-status {
  background: #b4234d;
  color: #fff;
}

.media-upload-name,
.media-upload-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-upload-name {
  color: #1f2933;
  font-weight: 700;
}

.media-upload-meta {
  color: #687482;
  font-size: 12px;
  text-align: right;
}

.media-upload-row.failed .media-upload-meta,
.media-upload-scan-error {
  color: #ED0A3A;
}

.media-upload-scan-error {
  border: 1px solid #f1c0c9;
  border-radius: 7px;
  background: #fff5f7;
  padding: 8px;
  font-size: 13px;
}

@keyframes media-upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.media-player-dialog {
  width: min(680px, 100%);
}

.media-name-dialog {
  width: min(480px, 100%);
}

.media-access-dialog {
  width: min(620px, 100%);
}

.media-access-help {
  color: #687482;
  font-size: 13px;
}

.media-access-users {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.media-access-user {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 8px;
}

.media-access-user:hover {
  background: #F2F6F8;
}

.media-access-user input {
  width: auto;
}

.media-access-user span,
.media-access-user strong,
.media-access-user small {
  display: block;
  min-width: 0;
}

.media-access-user small {
  color: #687482;
}

.media-player-dialog {
  width: min(680px, 100%);
}

.media-player-body video {
  display: block;
  width: 100%;
  max-height: 70vh;
}

.custom-audio-player {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid #d7dfe7;
  border-radius: 8px;
  background: linear-gradient(135deg, #F2F6F8 0%, #fff 58%, #FFF1F4 100%);
}

.custom-audio-player audio {
  display: none;
}

.custom-player-visual {
  --progress: 0deg;
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#ED0A3A var(--progress), #E8F0F4 0deg);
  box-shadow: 0 14px 28px rgba(1, 47, 70, 0.18);
}

.custom-player-toggle {
  display: inline-grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 0;
  border-radius: 50%;
  background: #012F46;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.custom-player-toggle:hover {
  background: #0A405D;
}

.custom-player-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.custom-player-track {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.custom-player-track strong,
.custom-player-track span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-player-track strong {
  color: #17212b;
  font-size: 18px;
}

.custom-player-track span,
.custom-player-footer {
  color: #687482;
  font-size: 13px;
}

.custom-player-seek {
  width: 100%;
  accent-color: #ED0A3A;
}

.custom-player-footer {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
}

.custom-player-footer span:last-child {
  text-align: right;
}

.custom-player-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.custom-player-controls button {
  min-width: 54px;
  padding: 7px 10px;
}

.tap-tempo-panel {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d7dfe7;
  border-radius: 8px;
  background: #F2F6F8;
}

.tap-tempo-button {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 0;
  background: #012F46;
  color: #fff;
  box-shadow: 0 6px 16px rgba(1, 47, 70, 0.2);
}

.tap-tempo-button strong {
  font-size: 24px;
  line-height: 1;
}

.tap-tempo-button span {
  font-size: 12px;
  opacity: 0.86;
}

.tap-tempo-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tap-tempo-meta span {
  color: #687482;
  font-size: 13px;
}

.media-player-error {
  margin: 12px 0 0;
  color: #a3332d;
  font-size: 13px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-line input {
  width: auto;
}

.media-info-readonly {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 12px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.media-info-readonly span {
  color: #687482;
}

.media-info-readonly strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inline-bpm-input {
  width: 120px;
  min-height: 32px;
  padding: 5px 8px;
}

.inline-bpm-input.invalid {
  border-color: #b4234d;
  box-shadow: 0 0 0 2px rgba(180, 35, 77, 0.1);
}

.inline-bpm-input.saving {
  opacity: 0.65;
}

.inline-bpm-input.saved {
  border-color: #012F46;
}

.audio-analysis-readonly {
  background: #F2F6F8;
}

.media-context-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 4px;
  min-width: 190px;
  max-width: min(260px, calc(100vw - 16px));
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.18);
}

.media-context-menu[hidden] {
  display: none;
}

.media-context-menu button {
  width: 100%;
  border-radius: 6px;
  padding: 9px 10px;
  text-align: left;
}

.media-context-menu button:hover {
  background: #F2F6F8;
}

.media-folder-color-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 7px;
  align-items: center;
  border-top: 1px solid #e3e8ee;
  margin-top: 4px;
  padding: 8px 4px 3px;
  overflow: hidden;
}

.media-folder-color-title {
  grid-column: 1 / -1;
  color: #687482;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.media-folder-color-swatches {
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 5px;
  min-width: 0;
}

.media-folder-color-swatches button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(31, 41, 51, 0.22);
  border-radius: 999px;
  padding: 0;
  background: var(--swatch-color);
}

.media-folder-color-swatches button.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #012F46;
}

.media-folder-color-custom {
  grid-column: 1;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #3a4652;
  font-size: 13px;
}

.media-folder-color-custom input[type="color"] {
  width: 34px;
  height: 30px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 2px;
  background: #fff;
}

.media-folder-color-clear {
  grid-column: 2;
  width: 68px;
  min-width: 68px;
  height: 30px;
  padding: 0;
  text-align: center;
  font-size: 12px;
}

code {
  font-family: Consolas, monospace;
}

@media (max-width: 1320px) {
  .analytics-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clock-layout {
    grid-template-columns: 1fr;
  }

  .hour-schedule {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .location-row {
    grid-template-columns: 34px minmax(180px, 1fr) 82px 92px 100px;
  }

  .location-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .topbar,
  .grid,
  .clock-layout,
  .window-grid,
  .contact-form,
  .user-form-grid,
  .now-grid,
  .playlist-columns,
  .hour-schedule,
  .watermark-grid,
  .watermark-file-status,
  .watermark-status-grid,
  .analytics-columns,
  .media-browser {
    display: grid;
    grid-template-columns: 1fr;
  }

  .analytics-cards {
    grid-template-columns: 1fr;
  }

  .heat-row {
    grid-template-columns: 1fr;
  }

  .heat-row em {
    text-align: left;
  }

  .brand img {
    width: 112px;
  }

  .account-menu {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .account-copy {
    text-align: left;
  }

  .account-copy strong {
    max-width: calc(100vw - 96px);
  }

  .media-sidebar {
    display: flex;
    border-right: 0;
    border-bottom: 1px solid #e3e8ee;
    overflow-x: auto;
  }

  .media-table-head,
  .media-row {
    grid-template-columns: 28px minmax(120px, 1fr) 76px;
  }

  .tap-tempo-panel {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .tap-tempo-panel button:not(.tap-tempo-button) {
    grid-column: 1 / -1;
  }

  .media-table-head button:nth-of-type(n + 3) {
    display: none;
  }

  .media-upload-panel {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: min(480px, calc(100vh - 20px));
  }

  .media-upload-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .media-upload-meta {
    grid-column: 2;
    text-align: left;
  }

  .media-size,
  .media-bpm,
  .media-camelot,
  .media-key,
  .media-uploader,
  .media-date,
  .media-modified {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tab {
    border-right: 0;
    border-bottom: 1px solid #b8c1cc;
  }

  .location-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .location-row .status,
  .location-id,
  .location-version,
  .location-now-playing,
  .location-cache-count,
  .location-folder-size,
  .location-activity,
  .power-state,
  .location-actions {
    grid-column: 2;
  }

  .location-actions {
    align-items: stretch;
  }

  .location-actions button {
    width: 100%;
  }

  .point-playlist {
    margin-left: 10px;
  }
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.campaign-grid label,
.ad-window-row label {
  display: grid;
  gap: 6px;
  color: #687482;
  font-size: 13px;
}

.campaign-grid input,
.campaign-grid select,
.ad-window-row input {
  min-height: 38px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  padding: 0 10px;
  font: inherit;
  color: #1f2933;
}

.campaign-locations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.location-picker {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid #ccd4dd;
  border-radius: 7px;
  padding: 10px;
  text-align: left;
}

.location-picker span,
.campaign-card small,
.campaign-slot-table small {
  color: #687482;
  font-size: 12px;
}

.location-picker.selected,
.slot-toggle.selected {
  border-color: #012F46;
  background: #F2F6F8;
  color: #012F46;
}

.campaign-upload {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 92px;
  margin-top: 14px;
  border: 2px dashed #b8c1cc;
  border-radius: 8px;
  background: #f8fafb;
  cursor: pointer;
}

.campaign-upload.dragging {
  border-color: #012F46;
  background: #F2F6F8;
}

.campaign-slots {
  margin-top: 14px;
  overflow: auto;
}

.campaign-slot-table {
  width: max-content;
  min-width: 520px;
  border-collapse: collapse;
  border: 1px solid #d5dde7;
  table-layout: fixed;
}

.campaign-slot-table th:first-child,
.campaign-slot-table td:first-child {
  width: 72px;
}

.campaign-slot-table th,
.campaign-slot-table td {
  min-width: 46px;
  border: 1px solid #d5dde7;
  text-align: center;
  padding: 0;
  height: 30px;
}

.campaign-slot-table th {
  background: #f8fafb;
  color: #5c6675;
  font-weight: 700;
}

.campaign-slot-table th small {
  display: block;
  margin-top: 3px;
}

.slot-toggle {
  width: 100%;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: #fff;
  display: grid;
  place-items: center;
}

.slot-toggle span {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: transparent;
}

.slot-toggle.selected {
  background: #f8dce2;
}

.slot-toggle.selected span {
  background: #f50b3f;
  box-shadow: 0 0 0 2px #ff6b88;
}

.campaign-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.campaign-ad-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.campaign-ad-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #e3e8ee;
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
}

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

.campaign-slot-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.campaign-slot-templates button {
  min-height: 32px;
  padding: 0 10px;
}

.campaign-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e3e8ee;
  border-radius: 7px;
  padding: 10px;
}

.campaign-card > div:first-child {
  display: grid;
  gap: 4px;
  align-self: center;
}

.campaign-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  align-self: center;
  justify-content: flex-end;
}

.campaign-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 36px;
  margin-bottom: 0;
}

.ad-window-list {
  display: grid;
  gap: 10px;
}

.ad-window-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 160px) auto;
  gap: 10px;
  align-items: end;
}

.ad-hour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.ad-hour {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid #ccd4dd;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: #1f2933;
  font-weight: 700;
  cursor: pointer;
}

.ad-hour input {
  width: 16px;
  height: 16px;
}

.ad-hour.selected {
  border-color: #012F46;
  background: #F2F6F8;
  color: #012F46;
}

@media (max-width: 700px) {
  .ad-window-row {
    grid-template-columns: 1fr;
  }

  .campaign-card {
    grid-template-columns: 1fr;
  }

  .campaign-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.playback-warning {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #f2b8a0;
  border-radius: 6px;
  background: #fff4ef;
  color: #8a2d12;
  font-size: 13px;
  line-height: 1.35;
}

.playback-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.playback-metrics span {
  padding: 5px 8px;
  border: 1px solid var(--border-color, #d9dee7);
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
  color: #465264;
}

.playlist-columns.compact {
  margin-top: 10px;
}


@media (max-width: 720px) {
  .custom-audio-player {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .custom-player-main {
    width: 100%;
  }
}


/* 20260612 media search responsive */
@media (max-width: 960px) {
  .media-toolbar {
    flex-wrap: wrap;
  }

  .media-search {
    flex-basis: 100%;
    max-width: none;
    min-width: 0;
    order: 3;
  }
}

/* 20260612 media filter alignment guard
   Keep media filter controls on one visual baseline. Do not replace this with
   older toolbar CSS from local copies: /opt/store-playout/server is the source of truth. */
.media-filterbar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: end;
  column-gap: 10px;
  row-gap: 0;
  min-height: 66px;
}

.media-filterbar.search-open {
  grid-template-columns: 38px minmax(0, 1fr);
}

.media-filter-controls {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: end;
  justify-content: start;
  gap: 10px;
  min-width: 0;
  height: 58px;
}

.media-filterbar.search-open .media-filter-controls {
  max-width: 0;
  width: 0;
}

.media-filter-field {
  display: grid;
  grid-template-rows: 16px 38px;
  align-items: stretch;
  gap: 4px;
  height: 58px;
  min-width: 118px;
}

.media-filter-field span,
.media-search span {
  display: flex;
  align-items: flex-start;
  height: 16px;
  line-height: 14px;
}

.media-search {
  align-self: end;
  height: 58px;
}

.media-filterbar.search-open .media-search {
  flex-basis: auto;
  max-width: none;
}

.media-search-toggle,
.media-filter-controls > button,
.media-filter-field input,
.media-filter-field select,
.media-search input {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
}

.media-search-toggle,
.media-filter-controls > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

.media-search-toggle {
  grid-column: 1;
}

.media-filter-controls,
.media-search {
  grid-column: 2;
}

.media-filter-controls > button {
  padding-top: 0;
  padding-bottom: 0;
}

/* 20260612 point clock scope */
#clockScopeSelect {
  min-width: 220px;
}

#resetPointClockScope {
  white-space: nowrap;
}

/* 20260612 media browser polish: compact tree, color menu, filter alignment */
.media-sidebar {
  gap: 3px;
  padding: 8px 6px;
}

.media-roots,
.media-tree,
.media-tree-item {
  gap: 1px;
}

.media-tree-row {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 3px;
  min-height: 28px;
  padding-left: calc(var(--level, 0) * 12px);
  border-radius: 6px;
}

.media-tree-toggle {
  width: 22px;
  min-width: 22px;
  height: 28px;
  font-size: 13px;
}

.media-kind,
.media-tree-label {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 14px;
  line-height: 18px;
}

.media-kind.archive-kind,
.media-kind.trash-kind {
  margin-top: 5px;
  margin-bottom: 4px;
}

#mediaNewFolderSide {
  min-height: 34px;
  margin-top: 8px;
  padding: 0 10px;
}

.media-context-menu {
  min-width: 230px;
  max-width: min(250px, calc(100vw - 16px));
  overflow-x: hidden;
}

.media-context-menu > button {
  min-height: 34px;
  padding: 7px 10px;
}

.media-filterbar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  min-height: 86px;
  padding: 12px;
  overflow: visible;
}

.media-filter-controls {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: end;
  justify-content: start;
  gap: 10px;
  height: 58px;
  min-width: 0;
}

.media-filter-field {
  display: grid;
  grid-template-rows: 16px 38px;
  gap: 4px;
  align-items: stretch;
  height: 58px;
  min-width: 136px;
}

.media-filter-field:first-child {
  min-width: 118px;
}

.media-filter-field span,
.media-search span {
  display: flex;
  align-items: flex-start;
  height: 16px;
  line-height: 14px;
}

.media-search-toggle,
.media-filter-controls > button,
.media-filter-field input,
.media-filter-field select,
.media-search input {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  margin: 0;
}

.media-search-toggle,
.media-filter-controls > button {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.media-search-toggle {
  grid-column: 1;
  grid-row: 1;
}

.media-filter-controls,
.media-search {
  grid-column: 2;
  grid-row: 1;
}

.media-search {
  align-self: end;
  height: 58px;
}

.media-filterbar.search-open .media-search {
  flex-basis: auto;
  max-width: none;
}

.media-filterbar.search-open .media-filter-controls {
  max-width: 0;
  width: 0;
}





.credentials-economy-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.credentials-economy-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.credentials-economy-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.credentials-economy-features {
  display: grid;
  gap: 8px;
}
.credentials-economy-feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.credentials-economy-feature small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.credentials-economy-feature.disabled {
  opacity: .62;
  background: #f8fafc;
}
@media (max-width: 720px) {
  .credentials-economy-dates { grid-template-columns: 1fr; }
}

/* 20260618 client economy */
.economy-summary-panel .panel-title-row { align-items: center; }
.economy-title-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 12px;
}
.economy-period-fields {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.economy-period-fields .inline-field { min-width: 150px; }
.economy-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.economy-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.economy-metrics span,
.economy-tariff-row label span,
.economy-point-row label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.economy-metrics strong { display: block; font-size: 18px; }
.economy-result-table th,
.economy-result-table td { vertical-align: top; }
.economy-invoice-table th:first-child,
.economy-invoice-table td:first-child {
  width: 56px;
  text-align: center;
}
.economy-invoice-table th:nth-child(3),
.economy-invoice-table td:nth-child(3),
.economy-invoice-table th:nth-child(5),
.economy-invoice-table td:nth-child(5),
.economy-invoice-table th:last-child,
.economy-invoice-table td:last-child {
  width: 128px;
  text-align: right;
}
.economy-invoice-table th:nth-child(4),
.economy-invoice-table td:nth-child(4) { width: 92px; }
.economy-invoice-table td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.25;
}
.economy-tariff-head,
.economy-tariff-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(280px, 2fr) minmax(105px, .65fr) minmax(160px, 1.05fr) minmax(170px, 1.05fr) minmax(145px, .95fr) 68px;
  gap: 12px;
  align-items: start;
}
.economy-tariff-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--line);
}
.economy-tariff-head > span:last-child { text-align: center; }
.economy-tariff-row {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  transition: background-color .15s ease;
}
.economy-tariff-row:last-child { border-bottom: 0; }
.economy-tariff-row:hover { background: #f8fafc; }
.economy-tariff-row > label { min-width: 0; }
.economy-tariff-row > label > span { display: none; }
.economy-tariff-row input,
.economy-tariff-row textarea,
.economy-tariff-row select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  line-height: 1.35;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.economy-tariff-row input:hover,
.economy-tariff-row textarea:hover,
.economy-tariff-row select:hover { border-color: var(--line); background: #fff; }
.economy-tariff-row input:focus,
.economy-tariff-row textarea:focus,
.economy-tariff-row select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent);
  outline: none;
}
.economy-tariff-row textarea {
  display: block;
  resize: none;
  overflow: hidden;
}
.economy-tariff-row input:disabled,
.economy-tariff-row textarea:disabled,
.economy-tariff-row select:disabled { opacity: 1; color: inherit; }
.economy-point-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
}
.economy-point-row input { width: 100%; }
.economy-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.economy-row-actions .checkbox-line { margin: 0; }
.economy-row-actions .economy-tariff-active { width: 16px; min-height: 16px; height: 16px; padding: 0; }
.economy-row-actions .icon-button { width: 30px; min-width: 30px; height: 30px; padding: 0; }
.economy-active-label { display: none !important; }
.economy-points { display: grid; gap: 8px; }
.economy-point-row {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) 160px 160px 120px;
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
}
.economy-point-row small,
.economy-point-amount { display: block; color: var(--muted); }
.economy-point-amount { text-align: right; font-weight: 700; }
.economy-audio-production-panel .section-head.compact { align-items: flex-start; }
.economy-audio-production-panel .section-head.compact > div { max-width: 820px; }
.economy-audio-production-panel .section-head.compact p { margin: 5px 0 0; }
.economy-audio-production-head,
.economy-audio-production-row {
  display: grid;
  grid-template-columns: 160px minmax(190px, 1fr) 110px 140px minmax(180px, 1.2fr) 120px 44px;
  gap: 10px;
  align-items: center;
}
.economy-audio-production-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px 8px;
}
.economy-audio-production-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
}
.economy-audio-production-row label span {
  display: none;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.economy-audio-production-row input,
.economy-audio-production-row select { width: 100%; }
.economy-audio-production-sum { text-align: right; }
@media (max-width: 1180px) {
  .economy-title-row,
  .economy-tariff-head { display: block; }
  .economy-title-row > * { margin-bottom: 10px; }
  .economy-tariff-head { display: none; }
  .economy-tariff-row,
  .economy-point-row,
  .economy-audio-production-row,
  .economy-metrics { grid-template-columns: 1fr; }
  .economy-audio-production-head { display: none; }
  .economy-tariff-row { padding: 12px 0; gap: 8px; }
  .economy-tariff-row > label > span { display: block; }
  .economy-row-actions { justify-content: flex-start; }
  .economy-active-label { display: inline !important; margin: 0 !important; color: inherit !important; font-size: inherit !important; }
  .economy-audio-production-row label span { display: block; }
  .economy-audio-production-sum { text-align: left; }
  .economy-period-fields { align-items: stretch; }
  .economy-period-fields .inline-field { flex: 1 1 150px; }
  .economy-point-amount { text-align: left; }
}


.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.app-release-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.release-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.release-card strong,
.release-card span,
.release-list strong,
.release-list span {
  display: block;
}

.release-card span,
.release-list span,
.release-notes li,
.knowledge-links a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.link-button {
  text-decoration: none;
  white-space: nowrap;
}

.release-notes h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.release-notes ul {
  margin: 0;
  padding-left: 18px;
}

.release-history summary {
  cursor: pointer;
  font-weight: 700;
}

.release-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.release-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.knowledge-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.knowledge-links a {
  font-weight: 700;
}

.os-build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.os-build-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.os-build-grid input,
.os-build-grid select {
  width: 100%;
}

.os-build-tabs {
  margin: 0 0 16px;
}

.linux-distro-upload,
.os-build-settings {
  margin-top: 16px;
}

@media (max-width: 720px) {
  .release-card,
  .release-list div {
    align-items: flex-start;
    flex-direction: column;
  }
}


.settings-section-tabs {
  margin: 0 0 16px;
}

[data-settings-panel][hidden] {
  display: none;
}


.audio-order-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.audio-order-card {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}
.audio-order-card.create {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
}
.audio-order-card.create strong {
  font-size: 38px;
  line-height: 1;
}
.audio-order-card.new {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .25);
}
.audio-order-status {
  color: var(--muted);
  font-size: 12px;
}
.audio-order-card small,
.audio-order-card em {
  color: var(--muted);
  font-style: normal;
}
.audio-order-editor {
  display: grid;
  gap: 14px;
}
.audio-order-editor textarea,
.audio-order-editor input,
.audio-order-editor select { width: 100%; }
.audio-order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
}
.audio-order-upload {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}
.audio-order-upload audio { width: 100%; }
.audio-order-review {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.audio-order-reject {
  display: grid;
  gap: 8px;
  min-width: min(420px, 100%);
}
@media (max-width: 720px) {
  .audio-order-grid { grid-template-columns: 1fr; }
}

.audio-order-chronometrics {
  margin-top: -6px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  font-weight: 700;
}
.audio-order-chronometrics.empty {
  color: #667085;
  font-weight: 600;
}

.audio-order-field {
  position: relative;
  display: grid;
  gap: 6px;
}
.audio-order-field[hidden] {
  display: none;
}
.audio-order-select-button,
.audio-order-field input[type="text"],
.audio-order-price input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #b8c1cc;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.audio-order-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  text-align: left;
}
.audio-order-select-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #334155;
  border-bottom: 2px solid #334155;
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}
.audio-order-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}
.audio-order-select-menu[hidden] {
  display: none;
}
.audio-order-select-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}
.audio-order-select-menu button:hover,
.audio-order-select-menu button[aria-selected="true"] {
  background: #eaf2f6;
}
.audio-order-price {
  max-width: 360px;
}
.audio-order-price input {
  padding: 8px 12px;
}
.audio-order-price span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.audio-order-file-input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.audio-order-dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 118px;
  padding: 18px;
  border: 1px dashed #9aa8b8;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.audio-order-dropzone strong {
  color: var(--text);
  font-size: 16px;
}
.audio-order-dropzone span {
  color: var(--muted);
}
.audio-order-dropzone.dragover,
.audio-order-dropzone.has-file {
  border-color: #012F46;
  background: #eef6f9;
}
#audioOrderUploadForm {
  display: grid;
  gap: 14px;
}
#audioOrderUploadSubmit {
  justify-self: start;
}

.location-row .status.partner {
  color: #365314;
  background: #ecfccb;
}
.location-card.partner-equipment .location-version,
.location-card.partner-equipment .location-now-playing,
.location-card.partner-equipment .location-cache-count,
.location-card.partner-equipment .location-folder-size,
.location-card.partner-equipment .location-activity,
.location-card.partner-equipment .power-state,
.location-card.partner-equipment .location-actions [data-power] {
  display: none;
}
.location-partner-note {
  grid-column: 5 / 11;
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid #c7dcc7;
  border-radius: 8px;
  background: #edf7ed;
  color: #24533a;
  font-weight: 800;
  text-align: center;
}
.location-partner-toggle {
  width: 100%;
  border-color: #b8c1cc;
  background: #fff;
  color: var(--text);
}
.location-partner-toggle.active {
  border-color: #7aa377;
  background: #edf7ed;
  color: #24533a;
}
@media (max-width: 1320px) {
  .location-partner-note { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
  .location-partner-note {
    grid-column: 2;
    justify-items: start;
    padding: 10px 12px;
    text-align: left;
  }
}

.audio-order-date-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}
.audio-order-date-control input[type="text"] {
  width: 100%;
}
.audio-order-date-control .icon-button {
  width: 38px;
  height: 38px;
  font-size: 17px;
}
.audio-order-date-native {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px !important;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
