:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #61707d;
  --line: #d8e0e7;
  --line-strong: #c5d1dc;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --page: #edf2f5;
  --brand: #0077b6;
  --brand-dark: #035f8f;
  --good: #237a4b;
  --danger: #b12a34;
  --danger-dark: #8f2029;
  --shadow: 0 10px 28px rgba(23, 32, 38, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-size: 15px;
  line-height: 1.45;
}

.admin-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  padding: 22px clamp(24px, 5vw, 64px);
  background: #0f1c24;
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.session-user {
  color: #c5d4df;
  font-size: 0.9rem;
  font-weight: 700;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  padding: 24px;
  background: #0f1c24;
  place-items: center;
}

.login-panel {
  width: min(100%, 380px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 26px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

.login-panel h1 {
  margin-bottom: 22px;
  font-size: 2.15rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: #50c2ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  width: min(1320px, calc(100% - 48px));
  margin: 24px auto 48px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.wide {
  grid-column: 1 / -1;
}

.admin-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px max(24px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 16px rgba(23, 32, 38, 0.06);
}

.admin-nav-button {
  min-width: max-content;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-nav-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.admin-nav-button.is-active {
  color: #ffffff;
  background: var(--brand);
}

.dashboard-updated {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.dashboard-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: 8px;
  padding: 17px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  cursor: pointer;
}

.dashboard-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.dashboard-card.is-good { border-top-color: var(--good); }
.dashboard-card.is-warning { border-top-color: #d88918; }
.dashboard-card span { color: var(--muted); font-size: 0.82rem; font-weight: 700; text-transform: uppercase; }
.dashboard-card strong { font-size: 2rem; line-height: 1; }
.dashboard-card small { color: var(--muted); }

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
  margin-top: 18px;
}

.dashboard-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
}

.dashboard-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-section-heading h3 { margin: 0; font-size: 1rem; }
.text-button { border: 0; color: var(--brand-dark); background: transparent; font-weight: 700; cursor: pointer; }
.dashboard-list, .quick-actions { display: grid; gap: 8px; }
#dashboardAttentionList { max-height: 440px; overflow-y: auto; }

.dashboard-list-item,
.quick-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  cursor: pointer;
}

.dashboard-list-item:hover, .quick-action:hover { border-color: var(--brand); background: #f3faff; }
.dashboard-list-item span, .quick-action { display: grid; }
.dashboard-list-item small, .quick-action span { color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.dashboard-list-item em { color: var(--danger); font-size: 0.8rem; font-style: normal; font-weight: 700; }
.dashboard-empty { display: grid; gap: 3px; padding: 22px; color: var(--good); text-align: center; background: #f1faf5; border-radius: 6px; }
.dashboard-empty span { color: var(--muted); }

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
}

.toast { border-radius: 7px; padding: 13px 16px; color: #fff; background: var(--good); box-shadow: 0 12px 32px rgba(0,0,0,.2); font-weight: 700; }
.toast-error { background: var(--danger); }

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.campaign-editor,
.campaign-list-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-soft);
}

.campaign-editor-heading,
.campaign-list-heading,
.campaign-chooser-heading,
.campaign-card-heading,
.campaign-card-actions,
.campaign-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.campaign-editor-heading h3,
.campaign-list-heading h3,
.campaign-card h4 { margin: 0; }
.campaign-editor-heading p,
.campaign-list-heading p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; }

.campaign-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.campaign-name-field { grid-column: 1 / -1; }

.campaign-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0;
  font-weight: 700;
}

.campaign-toggle input,
.campaign-option input { width: auto; }

.campaign-mode-fieldset {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #fff;
}

.campaign-mode-fieldset legend { padding: 0 6px; font-weight: 800; }
.campaign-mode-fieldset label { display: flex; align-items: flex-start; gap: 9px; border-radius: 6px; padding: 10px; background: var(--surface-soft); cursor: pointer; }
.campaign-mode-fieldset input { width: auto; min-height: 20px; }
.campaign-mode-fieldset span { display: grid; gap: 2px; }
.campaign-mode-fieldset small { color: var(--muted); font-weight: 400; }

.campaign-chooser {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: #fff;
}

.campaign-chooser-heading span,
.campaign-help { color: var(--muted); font-size: .82rem; }
.campaign-help { margin: -5px 0 0; }

.campaign-target-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.campaign-target-filters .search-field { grid-column: 1 / -1; }

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

.campaign-filter-actions span { margin-right: auto; color: var(--muted); font-size: .82rem; font-weight: 700; }

.campaign-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 220px;
  overflow: auto;
}

.campaign-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  font-weight: 700;
  cursor: pointer;
}

.campaign-option:hover { border-color: var(--brand); background: #f3faff; }
.campaign-option span { min-width: 0; overflow-wrap: anywhere; }
.campaign-option small { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
.campaign-video-options { max-height: 520px; overflow: auto; padding: 2px; }
.campaign-video-card { cursor: default; }
.campaign-video-card.is-selected { border-color: var(--good); box-shadow: 0 0 0 2px rgba(35,122,75,.16); }
.campaign-video-info { display: grid; gap: 3px; padding-bottom: 10px; }
.campaign-video-info strong { overflow-wrap: anywhere; }
.campaign-video-info small { color: var(--muted); text-transform: capitalize; }
.campaign-order { display: grid; gap: 6px; }
.campaign-order-item { border-radius: 6px; padding: 8px 10px; background: var(--surface-soft); }
.campaign-order-item > div { display: flex; gap: 5px; }
.button.compact { min-height: 28px; padding: 4px 9px; font-size: .75rem; }

.campaign-list { display: grid; gap: 12px; margin-top: 14px; }
.campaign-card { border: 1px solid var(--line); border-radius: 8px; padding: 15px; background: #fff; }
.campaign-card-heading > div { display: flex; align-items: center; gap: 8px; }
.campaign-status { border-radius: 999px; padding: 3px 8px; font-size: .7rem; font-weight: 800; text-transform: uppercase; background: #e8edf1; }
.campaign-status-active { color: #fff; background: var(--good); }
.campaign-status-scheduled { color: #075f8d; background: #dff3ff; }
.campaign-status-paused { color: #76540c; background: #fff0c9; }
.campaign-status-ended { color: var(--muted); background: #e8edf1; }
.campaign-schedule { margin: 12px 0 8px; font-weight: 700; }
.campaign-meta { display: inline-block; margin: 0 12px 12px 0; color: var(--muted); font-size: .84rem; }
.campaign-card-actions { justify-content: flex-start; flex-wrap: wrap; }

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

@media (max-width: 520px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  .admin-nav { padding-inline: 12px; }
  .campaign-fields,
  .campaign-options,
  .campaign-target-filters { grid-template-columns: 1fr; }
  .campaign-editor-heading,
  .campaign-list-heading { align-items: stretch; flex-direction: column; }
}

.panel-heading {
  min-height: 58px;
  margin-bottom: 16px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.row,
.item-main,
.item-actions,
.toolbar {
  display: flex;
  align-items: center;
}

.row {
  justify-content: space-between;
  gap: 16px;
}

.stack,
.pair-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.advertiser-form-block {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  background: #f7fafb;
}

.advertiser-form-block h3 { margin: 0 0 4px; }
.advertiser-form-block h3 span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.advertiser-form-block > p { margin: 0 0 12px; color: var(--muted); font-size: .85rem; }

.video-classification-field {
  border: 1px solid #a7bcc8;
  border-radius: 9px;
  padding: 12px;
  background: #f4f9fb;
}

.video-classification-field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.default-video-upload {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #99c7b1;
  border-radius: 9px;
  padding: 12px;
  background: #f1faf6;
}

.default-video-upload input {
  width: auto;
  margin-top: 3px;
}

.default-video-upload span,
.default-video-upload small {
  display: block;
}

.default-video-upload small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}

.default-video-panel {
  margin: 14px 0;
  border: 1px solid #99c7b1;
  border-radius: 12px;
  padding: 15px;
  background: #f1faf6;
}

.default-video-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.default-video-heading h3,
.default-video-heading p {
  margin: 0;
}

.default-video-heading > strong {
  border-radius: 999px;
  padding: 6px 10px;
  color: #176441;
  background: #dcefe5;
  white-space: nowrap;
}

.default-video-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.default-video-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #c5dfd1;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.default-video-item strong,
.default-video-item small {
  display: block;
}

.default-video-item small {
  margin-top: 2px;
  color: var(--muted);
}

.video-card.is-default-video {
  box-shadow: inset 0 0 0 2px #70aa8a;
}

.video-safety-editor {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  border: 1px solid #a7bcc8;
  border-radius: 7px;
  padding: 9px;
  background: #f4f9fb;
}

.video-safety-editor.is-non-halal {
  border-color: #c43d3d;
  background: #fff4f4;
}

.video-safety-editor.is-unclassified {
  border-color: #c78518;
  background: #fff8e8;
}

.video-safety-editor .button {
  width: 100%;
}

.video-safety-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.video-safety-editor.is-non-halal .video-safety-status { color: #a52d2d; }
.video-safety-editor.is-unclassified .video-safety-status { color: #98620b; }

.classification-grid,
.device-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pair-business-category-field {
  grid-column: 1 / -1;
}

.device-filters {
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: end;
  margin-bottom: 12px;
}

.device-exclusion-chips {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  background: var(--surface-soft);
}

.device-exclusion-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.device-exclusion-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #efc8c8;
  border-radius: 999px;
  padding: 4px 5px 4px 10px;
  color: #8f2424;
  background: #fff4f4;
  font-size: 0.78rem;
  font-weight: 800;
}

.device-exclusion-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #8f2424;
  background: #f7dede;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.device-exclusion-chip button:hover,
.device-exclusion-chip button:focus-visible {
  background: #efc3c3;
}

select optgroup {
  color: var(--ink);
  font-weight: 800;
}

select optgroup option {
  font-weight: 500;
}

select optgroup[data-category-class="non_halal"] {
  color: #a52d2d;
}

select.non-halal-selection {
  border-color: #c43d3d;
  color: #8f2424;
  background: #fff4f4;
  font-weight: 800;
}

.category-safety-note {
  display: block;
  margin-top: 5px;
  color: #a52d2d;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.category-safety-note[hidden] {
  display: none;
}

.toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar select {
  width: 220px;
}

.assignment-control {
  width: 220px;
  gap: 4px;
  font-size: 0.72rem;
}

.assignment-control select {
  width: 100%;
}

.toolbar .button,
.library-actions .button,
.item-actions .button {
  min-width: 118px;
}

#undoPlaylistButton,
#bulkUndoPlaylistButton {
  min-width: 205px;
  min-height: 42px;
  height: auto;
  padding-block: 9px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px);
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.search-field {
  min-width: 0;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pagination[hidden] {
  display: none;
}

.pagination span {
  min-width: 150px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.pagination label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pagination select {
  min-height: 34px;
  padding: 4px 28px 4px 8px;
}

.attention-badge {
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 999px;
  padding: 2px 7px;
  color: #8a4d00;
  background: #fff1d6;
  font-size: 0.62rem;
  font-weight: 800;
  vertical-align: 2px;
}

.attention-badge[hidden] {
  display: none;
}

.bulk-playlist-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
}

.bulk-playlist-actions strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.94rem;
}

.bulk-playlist-actions span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.video-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-soft);
}

.video-selection-bar > div:first-child {
  display: grid;
  gap: 3px;
}

.video-selection-bar span {
  color: var(--muted);
  font-size: 0.8rem;
}

.video-selection-bar .button {
  min-height: 42px;
  height: auto;
  padding-block: 9px;
  line-height: 1.25;
  white-space: normal;
}

.bulk-review-dialog {
  width: min(980px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(8, 23, 33, 0.34);
}

.bulk-review-dialog::backdrop {
  background: rgba(8, 20, 29, 0.72);
  backdrop-filter: blur(2px);
}

.bulk-review-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  max-height: calc(100vh - 32px);
}

.bulk-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f1c24, #123b4d);
}

.bulk-review-header h2 {
  margin: 7px 0 5px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.bulk-review-header p {
  margin: 0;
  color: #cfe0e9;
}

.bulk-review-action-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  color: #0f3444;
  background: #bfeafa;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bulk-review-dialog.is-remove .bulk-review-action-badge {
  color: #721923;
  background: #ffd9dc;
}

.bulk-review-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.bulk-review-close:hover,
.bulk-review-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: 2px solid rgba(255, 255, 255, 0.72);
}

.bulk-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-height: 0;
  padding: 20px 24px 12px;
}

.bulk-review-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.bulk-review-column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: #eef4f7;
}

.bulk-review-column-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.bulk-review-column-heading strong {
  display: inline-flex;
  min-width: 30px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  color: #ffffff;
  background: var(--brand-dark);
  font-size: 0.8rem;
}

.bulk-review-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 180px;
  max-height: min(48vh, 430px);
  overflow-y: auto;
  padding: 10px;
}

.bulk-review-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7e1e7;
  border-radius: 7px;
  padding: 9px 10px;
  background: #ffffff;
}

.bulk-review-index {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #31515f;
  background: #e8f1f5;
  font-size: 0.78rem;
  font-weight: 900;
}

.bulk-review-item-copy {
  min-width: 0;
}

.bulk-review-item-copy strong,
.bulk-review-item-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-review-item-copy strong {
  font-size: 0.9rem;
}

.bulk-review-item-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.bulk-review-item-badge {
  border-radius: 999px;
  padding: 4px 8px;
  color: #075b7b;
  background: #dff3fb;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.bulk-review-item-badge.is-offline,
.bulk-review-item-badge.is-warning {
  color: #71500c;
  background: #fff0c7;
}

.bulk-review-impact {
  margin: 4px 24px 0;
  border-left: 4px solid var(--brand);
  border-radius: 5px;
  padding: 10px 12px;
  color: #29424f;
  background: #edf8fc;
  font-weight: 700;
}

.bulk-review-dialog.is-remove .bulk-review-impact {
  border-left-color: var(--danger);
  color: #6e2028;
  background: #fff1f2;
}

.bulk-review-error {
  min-height: 21px;
  margin: 8px 24px 0;
  color: var(--danger);
}

.bulk-review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px 24px 20px;
}

.bulk-review-edit-actions,
.bulk-review-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-review-dialog.is-remove #bulkReviewConfirm {
  background: var(--danger);
}

.bulk-review-dialog.is-remove #bulkReviewConfirm:hover {
  background: var(--danger-dark);
}

.library-summary {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.selected-order {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.selected-order-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.selected-order-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.selected-order-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.selected-order-list {
  display: grid;
  gap: 8px;
}

.selected-order-item {
  display: grid;
  grid-template-columns: 24px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #cbd8e1;
  border-radius: 6px;
  padding: 6px 8px;
  background: #ffffff;
}

.selected-order-item.is-dragging {
  opacity: 0.58;
}

.selected-order-item.is-drop-target {
  border-color: var(--brand);
  outline: 3px solid rgba(0, 119, 182, 0.14);
}

.selected-order-item.is-tv-disabled {
  border-color: #d8a3a8;
  background: #fff7f8;
}

.selected-order-item.is-tv-disabled .order-title {
  color: var(--danger);
}

.drag-handle,
.order-number {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.drag-handle {
  cursor: grab;
}

.order-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.order-actions .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
  min-width: 82px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #384650;
  font-size: 0.86rem;
  font-weight: 700;
}

.compact-label {
  gap: 5px;
  font-size: 0.76rem;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #bac8d2;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid #bac8d2;
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(0, 119, 182, 0.18);
}

select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(0, 119, 182, 0.18);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  background: var(--brand-dark);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.secondary {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #8fa2b0;
  background: #f5f8fa;
}

.button.danger {
  background: var(--danger);
}

.button.danger:hover {
  background: var(--danger-dark);
}

.message {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--muted);
}

.panel > .message {
  margin-bottom: 14px;
}

.list {
  display: grid;
  gap: 8px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.item-main {
  min-width: 0;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--good);
}

.status-dot.off {
  background: #8996a0;
}

.item-title {
  margin-bottom: 4px;
  font-weight: 800;
}

.item-url,
.item-meta {
  overflow: hidden;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: normal;
}

.item-actions {
  flex: 0 0 auto;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.device-item {
  align-items: flex-start;
  min-height: 0;
  gap: 10px;
  padding: 10px;
}

.device-item.is-archived {
  border-style: dashed;
  opacity: 0.72;
}

.device-item .item-main {
  flex: 1 1 auto;
  gap: 8px;
}

.device-item .item-main > div {
  width: 100%;
  min-width: 0;
}

.device-content {
  display: grid;
  gap: 8px;
}

.device-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.device-summary-copy {
  min-width: 0;
}

.device-summary-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  font-size: 0.92rem;
  font-weight: 800;
}

.device-summary-title [data-device-title] {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-editor {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.device-editor[hidden] {
  display: none;
}

.compact-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.device-primary-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 132px;
  gap: 7px;
  margin-bottom: 7px;
}

.device-classification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}

.device-item .compact-label {
  gap: 3px;
  overflow: hidden;
  font-size: 0.6rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-item input,
.device-item select {
  min-height: 30px;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.device-item .item-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.video-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 32, 38, 0.06);
}

.video-card.is-disabled {
  opacity: 0.62;
}

.video-card.is-archived {
  border-style: dashed;
  opacity: 0.72;
}

.video-preview {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #101820;
  place-items: center;
}

.video-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-placeholder {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
}

.preview-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
  place-items: center;
  transform: translate(-50%, -50%);
}

.preview-duration {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 1;
  border-radius: 5px;
  padding: 3px 6px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0.68rem;
  font-weight: 800;
}

.preview-compatibility {
  position: absolute;
  right: 7px;
  top: 7px;
  left: 62px;
  z-index: 1;
  overflow: hidden;
  border-radius: 5px;
  padding: 3px 6px;
  color: #ffffff;
  background: rgba(15, 28, 36, 0.74);
  font-size: 0.64rem;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-compatibility.is-warning {
  background: rgba(177, 42, 52, 0.88);
}

.preview-timeline {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 3px 5px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.56);
  font-size: 0.62rem;
  font-weight: 800;
}

.preview-timeline input {
  min-height: 14px;
  padding: 0;
  accent-color: #ffffff;
}

.preview-timeline input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.72);
}

.preview-play:hover,
.preview-play:focus-visible {
  background: rgba(0, 119, 182, 0.88);
  outline: none;
}

.preview-play span {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #ffffff;
}

.video-preview.is-playing .preview-play {
  opacity: 0;
  pointer-events: none;
}

.video-preview.is-playing:hover .preview-play,
.video-preview.is-playing .preview-play:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.video-preview.is-playing .preview-play span {
  width: 11px;
  height: 14px;
  margin-left: 0;
  border: 0;
  border-right: 4px solid #ffffff;
  border-left: 4px solid #ffffff;
}

.video-check {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: block;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.video-check input {
  position: absolute;
  opacity: 0;
}

.video-check span {
  display: grid;
  width: 26px;
  height: 26px;
  border: 2px solid #ffffff;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.58);
  place-items: center;
}

.video-check input:checked + span {
  border-color: var(--good);
  background: var(--good);
}

.video-check input:checked + span::after {
  content: "";
  width: 10px;
  height: 5px;
  border-bottom: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.video-info {
  padding: 9px 9px 0;
}

.video-summary-title { margin:0 0 5px;font-size:.95rem;line-height:1.25;overflow-wrap:anywhere; }
.video-summary-meta { margin:0 0 6px;color:var(--muted);font-size:.76rem;line-height:1.4; }
.video-edit-button { width:100%;margin:10px 0 9px; }
.video-editor { display:grid;gap:9px;border-top:1px solid var(--line);padding:12px 0 9px; }
.video-editor[hidden],.video-edit-button[hidden],.video-group-rules[hidden] { display:none; }
.video-editor-controls { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px; }
.video-editor .item-actions { border-top:1px solid var(--line);margin-top:3px;padding:10px 0 0; }

.video-info input {
  min-height: 32px;
  font-weight: 700;
}

.advertiser-editor {
  margin-top: 9px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.advertiser-editor summary {
  color: #087c9f;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
}

.advertiser-contact-grid {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.advertiser-contact-grid .button { width: 100%; }

.device-name-field {
  max-width: none;
  margin-bottom: 0;
}

.device-orientation-field {
  max-width: none;
  margin-bottom: 0;
}

.device-name-field input,
.device-orientation-field select {
  min-height: 30px;
  font-weight: 700;
}

.video-card .item-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  padding: 9px;
}

.video-card .button {
  min-height: 30px;
  padding: 0 8px;
  min-width: 0;
  font-size: 0.78rem;
}

.tv-shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #05080c;
  cursor: none;
}

#player {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #05080c;
  object-fit: contain;
  cursor: none;
}

#player:fullscreen,
#player:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
}

.tv-orientation-portrait #player,
.tv-orientation-portrait #player:fullscreen,
.tv-orientation-portrait #player:-webkit-full-screen {
  object-fit: contain;
}

@media (orientation: landscape) {
  .tv-orientation-portrait #player,
  .tv-orientation-portrait #player:fullscreen,
  .tv-orientation-portrait #player:-webkit-full-screen {
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }

  .tv-orientation-portrait.tv-rotation-counterclockwise #player,
  .tv-orientation-portrait.tv-rotation-counterclockwise #player:fullscreen,
  .tv-orientation-portrait.tv-rotation-counterclockwise #player:-webkit-full-screen {
    transform: translate(-50%, -50%) rotate(-90deg);
  }
}

@media (max-width: 900px), (max-height: 520px) {
  #player,
  #player:fullscreen,
  #player:-webkit-full-screen {
    object-fit: contain !important;
  }

  .tv-orientation-portrait #player,
  .tv-orientation-portrait #player:fullscreen,
  .tv-orientation-portrait #player:-webkit-full-screen {
    object-fit: contain !important;
  }
}

.phone-player #player,
.phone-player #player:fullscreen,
.phone-player #player:-webkit-full-screen,
.phone-portrait #player,
.phone-portrait #player:fullscreen,
.phone-portrait #player:-webkit-full-screen {
  object-fit: contain !important;
}

.pairing-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 56px;
  text-align: center;
  color: #ffffff;
  background: #07131c;
}

.pairing-screen h1 {
  margin-bottom: 18px;
  font-size: clamp(4rem, 15vw, 10rem);
}

.pairing-screen p {
  color: #d7e7f2;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
}

.pairing-screen .pairing-countdown {
  margin-top: 22px;
  color: #9ec5df;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.pairing-screen .pairing-countdown.expiring {
  color: #ffbf47;
}

.tv-status {
  position: fixed;
  left: 18px;
  bottom: 16px;
  max-width: 70vw;
  border-radius: 6px;
  padding: 9px 12px;
  color: #d7e7f2;
  background: rgba(0, 0, 0, 0.58);
  font-size: 0.92rem;
}

.fullscreen-hint {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 5;
  transform: translateX(-50%);
  border-radius: 6px;
  padding: 12px 18px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.68);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
}

.tv-ad-id {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 6;
  border-radius: 5px;
  padding: 7px 10px;
  color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.42);
  font-size: clamp(.72rem,1.15vw,.96rem);
  font-weight: 800;
  letter-spacing: .04em;
}

.public-page { min-height: 100vh; color: #14242e; background: #eef3f6; }
.public-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 56px; }
.public-header,.public-section,.public-ad-detail { border: 1px solid #d9e3e8; border-radius: 14px; background: #fff; box-shadow: 0 12px 35px rgba(7,19,28,.07); }
.public-header { padding: clamp(24px,5vw,48px); color: #fff; background: linear-gradient(135deg,#07131c,#113848); }
.public-header h1 { margin: 4px 0 8px; font-size: clamp(2rem,6vw,4rem); }
.public-header p { color: #cfe3ed; }
.public-host-merchant { display: inline-block; margin-top: 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 8px 14px; color: #fff; font-weight: 800; text-decoration: none; }
.public-brand { margin: 0 0 8px; color: #19a7ce; font-size: .8rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.public-section { margin-top: 20px; padding: clamp(18px,4vw,32px); }
.public-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.public-section-heading h2 { margin: 4px 0; }
.public-section-heading p,.public-ad-copy p { margin: 0; color: #62737d; }
.live-badge { display: inline-block; border-radius: 999px; padding: 4px 9px; color: #fff; background: #c83737; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.public-search { display: grid; gap: 5px; min-width: min(100%,300px); color: #51636d; font-size: .82rem; font-weight: 800; }
.public-merchant-searches { display: grid; grid-template-columns: repeat(2,minmax(190px,1fr)); gap: 12px; }
.public-ad-search-control { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.public-ad-search-control:focus-within { border-color: var(--brand); outline: 3px solid rgba(0,119,182,.18); }
.public-ad-search-prefix { align-self: stretch; display: flex; align-items: center; padding: 0 0 0 12px; color: #203642; font-size: 1rem; font-weight: 900; }
.public-ad-search-control input { width: 100%; border: 0; padding-left: 12px; outline: 0; }
.public-ad-search-control input:focus { border: 0; outline: 0; }
.public-ad-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 18px; }
.public-ad-card { overflow: hidden; border: 1px solid #dce6eb; border-radius: 12px; background: #f8fbfc; }
.public-ad-card.is-current { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(240px,.65fr); }
.public-ad-card video { display: block; width: 100%; min-height: 180px; max-height: 420px; background: #000; object-fit: contain; }
.public-ad-thumbnail,.public-ad-placeholder { display: block; width: 100%; height: 150px; background: #e6f0f4; object-fit: cover; }
.public-ad-placeholder { display: grid; place-items: center; color: #087c9f; font-size: 1.25rem; font-weight: 900; letter-spacing: .08em; }
.public-ad-copy { padding: 16px; }
.public-ad-copy h3 { margin: 7px 0; }
.public-ad-copy .public-advertiser { margin: 0 0 5px; color: #294653; font-weight: 800; }
.public-ad-merchant { margin-top: 8px !important; font-size: .9rem; }
.public-ad-merchant a { color: #087c9f; font-weight: 800; }
.public-ad-id { color: #087c9f; font-weight: 900; letter-spacing: .04em; }
.public-ad-link { display: inline-block; margin-top: 14px; text-decoration: none; }
.public-result-count { margin: -8px 0 16px; color: #62737d; font-size: .9rem; font-weight: 700; }
.public-load-more { display: flex; justify-content: center; margin-top: 22px; }
.public-ad-shell { width: min(780px,calc(100% - 28px)); }
.public-back-link { display: inline-block; margin: 0 0 16px; color: #087c9f; font-weight: 800; text-decoration: none; }
.public-back-button { border: 0; padding: 0; background: transparent; cursor: pointer; font: inherit; }
.public-ad-detail { padding: clamp(20px,5vw,42px); }
.public-ad-detail h1 { margin-bottom: 6px; }
.public-ad-detail video { width: 100%; margin-top: 20px; border-radius: 10px; background: #000; }
.public-ad-contact { margin-top: 24px; border-top: 1px solid #d9e3e8; padding-top: 24px; }
.public-contact-eyebrow { margin: 0 0 5px; color: #62737d; font-size: .82rem; font-weight: 800; text-transform: uppercase; }
.public-ad-contact h2 { margin: 0; }
.public-contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.public-contact-button { text-decoration: none; }
.public-contact-button.is-whatsapp { border-color: #168a4a; background: #168a4a; }
.public-ad-merchant-profile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; border-radius: 9px; padding: 12px 14px; background: #eaf5f8; }
.public-ad-merchant-profile span { color: #62737d; font-size: .82rem; font-weight: 800; text-transform: uppercase; }
.public-ad-merchant-profile a { color: #087c9f; font-size: 1.05rem; font-weight: 900; }
.public-merchant-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 14px; }
.public-merchant-card { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 14px; border: 1px solid #dce6eb; border-radius: 12px; padding: 14px; background: #f8fbfc; }
.public-merchant-card h3,.public-merchant-card p { margin: 0 0 5px; }
.public-merchant-card p { color: #62737d; }
.public-merchant-logo { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 12px; background: #ddecf1; color: #087c9f; object-fit: cover; font-size: 1.6rem; font-weight: 900; }
.public-merchant-shell { width: min(900px,calc(100% - 28px)); }
.public-merchant-header { display: flex; align-items: center; gap: 24px; }
.merchant-profile-logo { width: 112px; height: 112px; border-radius: 18px; background: #fff; object-fit: cover; }
.merchant-description { max-width: 68ch; font-size: 1.08rem; }
.merchant-address { color: #526671; }
.merchant-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 12px; margin-top: 20px; }
.merchant-actions a { text-decoration: none; }
.merchant-contact-card { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 12px; min-width: 0; padding: 16px; border: 1px solid #d5e2e9; border-radius: 12px; background: #fff; color: #173747; text-decoration: none; box-shadow: 0 2px 6px #17374705; transition: border-color .15s,background .15s; }
.merchant-contact-card .merchant-contact-icon { width: 42px; height: 42px; border-radius: 12px; }
.merchant-contact-card .merchant-contact-icon svg { width: 23px; height: 23px; }
.merchant-contact-copy { display: grid; gap: 5px; min-width: 0; }
.merchant-contact-copy strong { color: #526671; font-size: .8rem; font-weight: 700; }
.merchant-contact-value { font-size: .98rem; font-weight: 750; line-height: 1.4; }
.merchant-contact-value,.merchant-contact-copy small { overflow-wrap: anywhere; }
.merchant-contact-copy small { color: #087c9f; font-size: .82rem; line-height: 1.4; }
.merchant-contact-card.merchant-contact-maps { grid-column: 1 / -1; background: #f8fbfc; }
.merchant-contact-card:hover { border-color: #087c9f; background: #eef8fb; }
.merchant-contact-card:focus-visible { outline: 3px solid #087c9f; outline-offset: 3px; }
@media (max-width:600px) { .merchant-actions { grid-template-columns: minmax(0,1fr); } }
.merchant-contact { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #244453; font-size: .85rem; font-weight: 800; }
.merchant-contact-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #e6f2f7; color: #087c9f; transition: transform .15s,background .15s; }
.merchant-contact-icon svg { width: 27px; height: 27px; }
.merchant-contact-whatsapp .merchant-contact-icon { background: #e3f5e9; color: #16773a; }
.merchant-contact-email .merchant-contact-icon { background: #e9e8fb; color: #5547a8; }
.merchant-contact-maps .merchant-contact-icon { background: #fff0e3; color: #a35312; }
.merchant-contact:hover .merchant-contact-icon { transform: translateY(-3px); }
.merchant-contact:focus-visible { outline: 3px solid #087c9f; outline-offset: 5px; border-radius: 8px; }
.merchant-admin-grid { display: grid; grid-template-columns: minmax(300px,360px) minmax(0,1fr); align-items: start; gap: 24px; }
.merchant-create-panel { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: var(--surface-soft); }
.merchant-form-heading h3 { margin: 0 0 4px; font-size: 1rem; }
.merchant-form-heading p { margin: 0 0 6px; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.merchant-search-picker { position: relative; margin-bottom: 12px; }
.merchant-search-picker > label { display: block; margin-bottom: 6px; }
.merchant-search-options { display: grid; max-height: 230px; overflow-y: auto; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 24px #102b3c1c; }
.merchant-search-options[hidden] { display: none; }
.merchant-search-option { width: 100%; border: 0; border-radius: 0; padding: 10px 12px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.merchant-search-option:hover,.merchant-search-option.is-active,.merchant-search-option:focus-visible { background: #e6f2f7; outline: none; }
.merchant-search-empty { margin: 0; padding: 10px 12px; color: var(--muted); }
.merchant-list-summary { margin: 0 0 10px; color: var(--muted); font-size: .78rem; }
.merchant-list { display: grid; gap: 8px; }
.merchant-admin-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; background: #fff; }
.merchant-row-copy { min-width: 0; }
.merchant-row-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.merchant-admin-card h3 { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.merchant-admin-card p { margin: 5px 0 0; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.merchant-status-badge { border-radius: 20px; padding: 3px 7px; background: #edf1f4; color: #526671; font-size: .65rem; font-weight: 800; }
.merchant-status-badge.is-published { background: #e3f5e9; color: #16773a; }
.merchant-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 220px; }
.merchant-row-actions [hidden] { display: none; }
.merchant-count-link { border: 0; padding: 0; background: none; color: var(--brand); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.merchant-count-link:hover { color: var(--brand-dark); }
.merchant-count-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
.merchant-video-filter-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font-weight: 700; }
.merchant-video-filter-banner[hidden] { display: none; }
.merchant-admin-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.merchant-admin-fields .wide-field { grid-column: 1/-1; }
.merchant-admin-fields label { min-width: 0; gap: 5px; font-size: .78rem; }
.merchant-admin-fields input,.merchant-admin-fields select,.merchant-admin-fields textarea { min-width: 0; min-height: 36px; width: 100%; padding: 8px 10px; font: inherit; font-size: .82rem; }
.merchant-admin-fields textarea { resize: vertical; }
.merchant-publish-toggle { display: flex !important; grid-column: 1/-1; align-items: center; gap: 8px; }
.merchant-admin-fields .merchant-publish-toggle input { min-height: 0; width: 16px; height: 16px; margin: 0; }
.merchant-edit-dialog { width: min(720px,calc(100% - 28px)); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--ink); background: #fff; }
.merchant-edit-dialog::backdrop { background: #102b3c80; }
.merchant-edit-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.merchant-edit-heading h2 { margin: 0 0 5px; font-size: 1.25rem; }
.merchant-edit-heading p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.merchant-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width:1050px) { .merchant-admin-card { grid-template-columns: minmax(0,1fr); } .merchant-row-actions { justify-content: flex-start; max-width: none; } }
@media (max-width:700px) { .merchant-edit-dialog { padding: 18px; } .merchant-create-panel { order: 2; padding: 14px; } }

.video-ad-id { margin: 0 0 8px; color: #087c9f; font-size: .8rem; font-weight: 900; letter-spacing: .04em; }
.device-public-panel { display: grid; grid-template-columns: minmax(0,1fr) 140px; align-items: center; gap: 16px; margin-top: 16px; border: 1px solid #d8e4e9; border-radius: 10px; padding: 16px; background: #f4f9fb; }
.device-public-panel p { margin: 6px 0; }
.device-public-panel code { overflow-wrap: anywhere; color: #087c9f; font-weight: 900; }
.device-public-panel img { width: 140px; height: 140px; border: 8px solid #fff; }
.device-public-panel .library-actions { grid-column: 1 / -1; }
.device-public-panel.is-disabled { background: #f7f7f7; }
.public-page-toggle { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; color: var(--text); }
.public-page-toggle input { width: 18px; height: 18px; margin-top: 2px; }
.public-page-toggle span { display: grid; gap: 2px; }
.public-page-toggle small { color: var(--muted); font-weight: 500; line-height: 1.35; }

.report-page {
  min-width: 0;
}

.report-print-only {
  display: none;
}

.report-print-dialog {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(8, 23, 33, 0.34);
}

.report-print-dialog::backdrop {
  background: rgba(8, 20, 29, 0.72);
  backdrop-filter: blur(2px);
}

.report-print-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 32px);
}

.report-print-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f1c24, #123b4d);
}

.report-print-header h2 {
  margin: 7px 0 5px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.report-print-header p {
  max-width: 650px;
  margin: 0;
  color: #cfe0e9;
}

.report-print-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  color: #0f3444;
  background: #bfeafa;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.report-print-body {
  display: grid;
  gap: 18px;
  overflow-y: auto;
  padding: 20px 24px;
}

.report-print-client-name {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 8px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
}

.report-print-client-name span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
}

.report-print-client-name input {
  grid-column: 1 / -1;
}

.report-print-presets,
.report-print-custom-options fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}

.report-print-presets legend,
.report-print-custom-options legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 900;
}

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

.report-print-presets > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  border: 1px solid #d7e1e7;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

.report-print-presets > label:has(input:checked) {
  border-color: var(--brand);
  background: #edf8fc;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.report-print-presets input,
.report-print-custom-options input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.report-print-presets span,
.report-print-presets strong,
.report-print-presets small {
  display: block;
  min-width: 0;
}

.report-print-presets strong {
  font-size: .86rem;
}

.report-print-presets small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
}

.report-print-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #c5dce7;
  border-radius: 9px;
  padding: 12px;
  background: #edf8fc;
  cursor: pointer;
}

.report-print-privacy input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.report-print-privacy strong,
.report-print-privacy small {
  display: block;
}

.report-print-privacy strong { font-size: .86rem; }
.report-print-privacy small { margin-top: 3px; color: var(--muted); font-size: .74rem; line-height: 1.4; }
.report-print-privacy:has(input:disabled) { opacity: .55; cursor: default; }

.report-print-place-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
}

.report-print-place-options legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 900;
}

.report-print-place-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.report-print-place-options input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.report-print-place-options strong,
.report-print-place-options small { display: block; }
.report-print-place-options strong { font-size: .8rem; }
.report-print-place-options small { margin-top: 3px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.report-print-place-options label:has(input:disabled) { opacity: .55; cursor: default; }

.report-print-custom-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  transition: opacity .15s ease;
}

.report-print-custom-options.is-locked {
  opacity: .55;
}

.report-print-custom-options fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.report-print-custom-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.3;
}

.report-print-custom-options input:disabled + span {
  color: var(--muted);
}

.report-print-selection-summary {
  margin: 0;
  border-left: 4px solid var(--brand);
  border-radius: 5px;
  padding: 10px 12px;
  color: #29424f;
  background: #edf8fc;
  font-size: .8rem;
  font-weight: 700;
}

.report-print-error {
  min-height: 21px;
  margin: -8px 0 0;
  color: var(--danger);
}

.report-print-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 16px 24px 20px;
}

.report-print-footer .button {
  min-height: 42px;
  height: auto;
  white-space: normal;
}

.report-client-heading {
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 2px solid #123b4d;
  padding-bottom: 10px;
}

.report-client-heading span,
.report-client-heading strong {
  display: block;
}

.report-client-heading span {
  color: #123b4d;
  font-size: 1.25rem;
  font-weight: 900;
}

.report-client-heading strong {
  margin-top: 3px;
  font-size: .9rem;
}

.report-client-heading small {
  color: #536975;
  font-size: .72rem;
}

.report-export-actions {
  flex: 0 0 auto;
}

.report-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.report-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.report-filters select {
  width: 100%;
}

.report-tabs {
  display: flex;
  gap: 6px;
  margin: 20px 0;
  border-bottom: 1px solid var(--line);
}

.report-tab {
  margin-bottom: -1px;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
}

.report-tab:hover,
.report-tab.is-active {
  border-bottom-color: var(--brand);
  color: var(--brand-dark);
}

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

.report-metrics article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
}

.report-metrics span,
.report-metrics small {
  display: block;
  color: var(--muted);
}

.report-metrics span {
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-metrics strong {
  display: block;
  margin: 6px 0 3px;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1;
}

.report-metrics small {
  font-size: .72rem;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.report-box {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.report-box-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.report-box-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.report-box-heading span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-align: right;
}

.report-trend {
  display: grid;
  grid-template-columns: repeat(var(--report-days, 7), minmax(38px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 190px;
  overflow-x: auto;
  padding: 8px 2px 2px;
}

.report-trend-column {
  display: grid;
  grid-template-rows: 22px 125px 30px;
  gap: 4px;
  min-width: 38px;
  color: var(--muted);
  text-align: center;
}

.report-trend-column strong {
  color: var(--ink);
  font-size: .7rem;
}

.report-trend-column small {
  font-size: .66rem;
  line-height: 1.15;
}

.report-trend-track {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 125px;
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(to top, transparent 24%, #edf2f5 25%, transparent 26%, transparent 49%, #edf2f5 50%, transparent 51%, transparent 74%, #edf2f5 75%, transparent 76%);
}

.report-trend-track span {
  width: min(24px, 70%);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #16a4dc, var(--brand));
}

.report-bars {
  display: grid;
  gap: 13px;
}

.report-bar-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: .76rem;
}

.report-bar-heading span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar-heading strong {
  flex: 0 0 auto;
  font-size: .7rem;
}

.report-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf1;
}

.report-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

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

.report-quality div {
  border-radius: 7px;
  padding: 12px;
  background: var(--surface-soft);
}

.report-quality span,
.report-quality strong {
  display: block;
}

.report-quality span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.report-good { color: var(--good); }
.report-warning { color: #91600a; }
.report-danger { color: var(--danger); }

.report-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: .68rem;
  letter-spacing: .025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.report-table-primary {
  color: var(--ink);
  font-weight: 800;
}

.report-number {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.report-status {
  font-weight: 800;
  text-transform: capitalize;
}

.report-status.is-good,
.report-status.is-completed { color: var(--good); }
.report-status.is-interrupted { color: #91600a; }
.report-status.is-failed { color: var(--danger); }
.report-status.is-started,
.report-status.is-muted { color: var(--muted); }

.report-table-empty {
  padding: 28px !important;
  color: var(--muted);
  text-align: center !important;
}

.report-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .72rem;
}

.empty-state.compact {
  min-height: auto;
  margin: 0;
  padding: 12px 0;
  font-size: .78rem;
}

@media (max-width: 1050px) {
  .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filters .button { min-height: 42px; }
  .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .report-filters,
  .report-metrics,
  .report-quality { grid-template-columns: 1fr; }
  .report-export-actions { justify-content: stretch; }
  .report-export-actions .button { flex: 1; min-width: 0; }
  .report-tabs { overflow-x: auto; }
  .report-tab { flex: 0 0 auto; }
  .report-box { padding: 12px; }
  .report-trend { grid-template-columns: repeat(var(--report-days, 7), minmax(30px, 1fr)); gap: 4px; }
  .report-trend-column { min-width: 30px; }
  .report-print-dialog {
    width: min(100% - 16px, 680px);
    max-height: calc(100vh - 16px);
  }
  .report-print-shell { max-height: calc(100vh - 16px); }
  .report-print-header { padding: 18px 16px 15px; }
  .report-print-body { padding: 16px; }
  .report-print-presets,
  .report-print-custom-options,
  .report-print-place-options { grid-template-columns: 1fr; }
  .report-print-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 14px 16px 16px;
  }
  #reportPrintConfirm { grid-column: 1 / -1; }
}

@media print {
  body.report-printing {
    background: #fff;
    color: #111;
    font-size: 10pt;
  }

  body.report-printing .topbar,
  body.report-printing .admin-nav,
  body.report-printing .admin-page:not([data-admin-page="reports"]),
  body.report-printing .report-export-actions,
  body.report-printing .report-filters,
  body.report-printing .report-tabs,
  body.report-printing .report-pagination,
  body.report-printing #reportMessage {
    display: none !important;
  }

  body.report-printing .admin-grid {
    display: block;
    width: 100%;
    margin: 0;
  }

  body.report-printing [data-admin-page="reports"],
  body.report-printing [data-report-view] {
    display: block !important;
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  body.report-printing [data-report-view] {
    margin-top: 16px;
    break-before: auto;
  }

  body.report-printing .report-print-only {
    display: flex !important;
  }

  body.report-printing .is-print-hidden,
  body.report-printing [data-report-view].is-print-hidden,
  body.report-printing [data-report-print-section].is-print-hidden,
  body.report-printing [data-report-print-field].is-print-hidden {
    display: none !important;
  }

  body.report-printing .report-metrics,
  body.report-printing .report-quality {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  body.report-printing .report-box,
  body.report-printing .report-metrics article {
    break-inside: avoid;
  }

  body.report-printing .report-table-wrap {
    overflow: visible;
  }

  body.report-printing .report-table {
    font-size: 7pt;
  }

  body.report-printing .report-table thead {
    display: table-header-group;
  }
}

@media (max-width:700px) {
  .public-merchant-searches { width: 100%; grid-template-columns: 1fr; }
  .public-merchant-header { align-items: flex-start; flex-direction: column; }
  .merchant-admin-grid,.merchant-admin-fields { grid-template-columns: 1fr; }
  .public-section-heading,.public-ad-card.is-current { display: flex; align-items: stretch; flex-direction: column; }
  .public-search { min-width: 100%; }
  .device-public-panel { grid-template-columns: 1fr; }
  .device-public-panel img { justify-self: center; }
}

@media (max-width: 760px) {
  .topbar,
  .row,
  .list-item {
    align-items: stretch;
    flex-direction: column;
  }

  .list-item {
    display: flex;
    width: 100%;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .button {
    flex: 1;
  }

  .admin-grid {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 680px);
  }

  .item-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .library-controls {
    grid-template-columns: 1fr;
  }

  .video-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .video-selection-bar .library-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .classification-grid,
  .device-filters,
  .device-primary-grid {
    grid-template-columns: 1fr;
  }

  .library-actions {
    justify-content: stretch;
  }

  .bulk-playlist-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-review-dialog {
    width: min(100% - 16px, 680px);
    max-height: calc(100vh - 16px);
  }

  .bulk-review-shell {
    max-height: calc(100vh - 16px);
  }

  .bulk-review-header {
    padding: 18px 16px 15px;
  }

  .bulk-review-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 14px 16px 10px;
  }

  .bulk-review-column {
    min-height: 220px;
  }

  .bulk-review-list {
    min-height: 140px;
    max-height: 220px;
  }

  .bulk-review-impact,
  .bulk-review-error {
    margin-inline: 16px;
  }

  .bulk-review-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px 16px;
  }

  .bulk-review-edit-actions,
  .bulk-review-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .selected-order-heading {
    display: grid;
  }

  .selected-order-item {
    align-items: stretch;
    grid-template-columns: 24px 34px minmax(0, 1fr);
  }

  .order-actions {
    grid-column: 1 / -1;
  }

  .order-actions .button {
    flex: 1;
  }

  .library-actions .button {
    flex: 1;
  }

  .item-actions .button {
    flex: 1 1 120px;
    min-width: 0;
  }

  .assignment-control {
    width: 100%;
    flex-basis: auto;
  }

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

  .pagination span,
  .pagination label {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (min-width: 761px) {
  .device-item .item-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 112px;
  }

  .device-item .item-actions .button {
    min-height: 30px;
    min-width: 0;
    padding: 0 8px;
    font-size: 0.76rem;
    white-space: normal;
  }
}

@media (max-width: 1120px) {
  .library-controls,
  .device-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-classification-grid {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  }
}

@media (min-width: 1121px) and (max-width: 1320px) {
  .device-classification-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Repeat settings share the existing video order controls. */
.playback-rule-controls { display: flex; flex-wrap: wrap; gap: 8px; text-align: left; }
.playback-rule-controls label { display: grid; gap: 3px; margin: 0; font-size: .75rem; color: var(--muted); }
.playback-rule-controls input { width: 90px; }
.playback-rule-controls select { width: 145px; }
.playback-rule-controls input, .playback-rule-controls select { min-height: 36px; padding: 6px 8px; font-size: .85rem; }
.selected-order-item.has-frequency { grid-template-columns: 22px 30px minmax(0,1fr); }
.selected-order-item.has-frequency .order-actions { grid-column: 3; flex-wrap: wrap; justify-content: flex-start; }
.selected-order-item.has-frequency .order-title { min-width: 0; }
.campaign-order-item.has-frequency { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.campaign-order-item.has-frequency > span { grid-column: 1 / -1; overflow-wrap: anywhere; }
.campaign-order-item.has-frequency > .playback-rule-controls { flex-wrap: wrap; gap: 8px; }
.campaign-order-item.has-frequency > div:last-child { align-self: end; }
@media (max-width: 640px) {
  .selected-order-item.has-frequency .order-actions { grid-column: 1 / -1; }
  .campaign-order-item.has-frequency { grid-template-columns: 1fr; }
  .campaign-order-item.has-frequency > div:last-child { justify-self: start; }
}

.group-create-form,.group-edit-form { display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:16px 0; }
.group-item { grid-template-columns:minmax(0,1fr);gap:6px; }
.group-item .group-edit-form { margin:0; }
.group-edit-form[hidden],.group-summary .button[hidden] { display:none; }
.group-summary { display:flex;align-items:center;flex-wrap:wrap;gap:10px; }
.group-summary h3 { margin:0;flex:1 1 180px; }
.group-summary .group-tv-count { min-width:95px; }
.pair-merchant-category,.device-inherited-category { margin:0;color:var(--muted);font-size:.82rem;font-weight:700; }
.device-inherited-category { align-self:center; }
.video-upload-panel .stack { grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px; }
.video-upload-panel label[hidden],#advertiserVideoNote[hidden] { display:none; }
.tv-pair-panel .pair-form { grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 20px; }
.tv-pair-panel .classification-grid { grid-column:1 / -1; }
@media (max-width:800px) {
  .video-upload-panel .stack,.tv-pair-panel .pair-form { grid-template-columns:1fr; }
}
.group-create-form label { display:grid;gap:5px;min-width:180px; }
.group-create-form input,.group-edit-form input { min-height:40px; }
.group-edit-form input:first-child { flex:2 1 180px; }
.group-edit-form input[type=number] { flex:0 1 130px; }
.group-edit-form .message { width:100%;margin:0; }
.video-group-rules { display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin-top:12px; }
.video-group-rules button { align-self:end; }
.grouped-playlist-mode [data-admin-page="videos"] .toolbar,
.grouped-playlist-mode [data-admin-page="videos"] .selected-order,
.grouped-playlist-mode [data-admin-page="videos"] .video-selection-bar,
.grouped-playlist-mode [data-admin-page="videos"] .video-check,
.grouped-playlist-mode [data-admin-page="tvs"] .bulk-playlist-actions { display:none; }

/* Admin polish is scoped to screen views; public pages and print layouts keep their styles. */
@media screen {
  .admin-shell { background: #f1f5f8; color: #172a38; }
  .admin-shell .topbar { min-height: 96px; padding-top: 20px; padding-bottom: 20px; }
  .admin-shell .admin-nav { gap: 8px; border-bottom: 1px solid var(--line); box-shadow: 0 3px 12px rgba(23,32,38,.04); }
  .admin-shell .admin-nav-button { border-radius: 8px; font-size: .95rem; }
  .admin-shell .admin-grid { gap: 24px; }
  .admin-shell .panel { padding: 24px; border-radius: 12px; box-shadow: 0 5px 20px rgba(23,32,38,.05); }
  .admin-shell .panel-heading { margin-bottom: 22px; gap: 16px; }
  .admin-shell .panel-heading h2 { font-size: 1.5rem; line-height: 1.25; }
  .admin-shell .panel-heading p { max-width: 78ch; line-height: 1.55; }
  .admin-shell label { font-size: .9rem; line-height: 1.4; gap: 6px; }
  .admin-shell input:not([type="checkbox"]):not([type="radio"]), .admin-shell select { min-height: 40px; font-size: .92rem; }
  .admin-shell textarea { font-size: .92rem; line-height: 1.5; }
  .admin-shell .button { min-height: 38px; border-radius: 7px; font-size: .87rem; line-height: 1.35; }
  .admin-shell :is(button, a, input, select, textarea):focus-visible { outline: 3px solid #2486c6; outline-offset: 3px; }
  .admin-shell .campaign-help { font-size: .86rem; line-height: 1.5; margin: 0; }
  .admin-shell .campaign-layout { grid-template-columns: minmax(0,1.2fr) minmax(340px,1fr); gap: 24px; }
  .admin-shell .campaign-editor, .admin-shell .campaign-list-panel, .admin-shell .merchant-create-panel { padding: 20px; border-radius: 10px; }
  .admin-shell .campaign-list-heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .admin-shell .campaign-chooser { padding: 16px; gap: 12px; }
  .admin-shell .campaign-mode-fieldset small { font-size: .85rem; line-height: 1.5; }
  .admin-shell .campaign-target-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .admin-shell .campaign-fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .admin-shell .campaign-name-field { grid-column: 1 / -1; }
  .admin-shell .device-item .item-main { align-items: flex-start; }
  .admin-shell .device-item .status-dot { margin-top: 7px; }
  .admin-shell .video-summary-meta { font-size: .88rem; line-height: 1.5; }
  .admin-shell .video-summary-title { font-size: 1.05rem; }
  .admin-shell .group-item .item-meta { font-size: .88rem; line-height: 1.5; }
  .admin-shell .merchant-admin-grid { grid-template-columns: minmax(340px,400px) minmax(0,1fr); }
  .admin-shell .merchant-admin-fields { gap: 14px; }
  .admin-shell .merchant-admin-card { grid-template-columns: minmax(0,1fr); gap: 14px; padding: 18px; border-radius: 10px; }
  .admin-shell .merchant-admin-card h3 { font-size: 1.05rem; }
  .admin-shell .merchant-admin-card p { font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
  .admin-shell .merchant-row-actions { justify-content: flex-start; max-width: none; gap: 8px; }
  .admin-shell .merchant-type-badge { font-size: .76rem; }
  .admin-shell .device-item { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; padding: 18px; border-radius: 10px; }
  .admin-shell .device-summary-title { font-size: 1.05rem; gap: 10px; }
  .admin-shell .device-summary-title [data-device-title] { white-space: normal; overflow-wrap: anywhere; }
  .admin-shell .device-item .item-meta { font-size: .88rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; margin: 3px 0; }
  .admin-shell .device-item > .item-actions { display: flex; flex-wrap: wrap; width: auto; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
  .admin-shell .device-item > .item-actions .button { flex: 0 1 auto; padding: 9px 14px; white-space: normal; }
  .admin-shell .device-item .compact-label { font-size: .85rem; line-height: 1.4; white-space: normal; overflow: visible; }
  .admin-shell .device-classification-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
  .admin-shell .device-primary-grid { grid-template-columns: minmax(0,1fr) minmax(160px,.5fr); gap: 12px; }
  .admin-shell .video-grid:not(.campaign-video-options) { grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 18px; }
  .admin-shell .video-card { border-radius: 10px; }
  .admin-shell .video-info { padding: 16px; }
  .admin-shell .video-info .item-meta, .admin-shell .video-readonly-summary { font-size: .88rem; line-height: 1.5; overflow-wrap: anywhere; }
  .admin-shell .video-group-rules { gap: 12px; }
  .admin-shell .group-create-form { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); gap: 16px; }
  .admin-shell .group-item { padding: 18px; border-radius: 10px; }
  .admin-shell .group-summary { gap: 14px; }
  .admin-shell .library-summary { font-size: .9rem; line-height: 1.55; }
  .admin-shell .device-filters, .admin-shell .library-controls { gap: 14px; }
  .admin-shell .pagination { margin-top: 22px; gap: 12px; }
  .admin-shell .report-filters { gap: 14px; }
  .admin-shell label small { font-weight: 400; line-height: 1.5; }
  .admin-shell .report-tabs { flex-wrap: wrap; }
  @media (max-width: 1100px) {
    .admin-shell .campaign-layout, .admin-shell .merchant-admin-grid { grid-template-columns: minmax(0,1fr); }
    .admin-shell .merchant-create-panel { order: initial; }
  }
  @media (max-width: 640px) {
    .admin-shell .admin-grid { width: calc(100% - 24px); margin-top: 16px; gap: 16px; }
    .admin-shell .panel { padding: 16px; }
    .admin-shell .admin-nav { padding: 10px 12px; }
    .admin-shell .admin-nav-button { padding: 10px 14px; white-space: nowrap; }
    .admin-shell .panel-heading.row { align-items: stretch; flex-direction: column; }
    .admin-shell .device-summary-row { grid-template-columns: minmax(0,1fr); }
    .admin-shell .device-summary-row > button { justify-self: start; }
    .admin-shell .device-primary-grid, .admin-shell .device-classification-grid, .admin-shell .campaign-fields, .admin-shell .campaign-target-filters, .admin-shell .merchant-admin-fields { grid-template-columns: minmax(0,1fr); }
    .admin-shell .video-grid:not(.campaign-video-options) { grid-template-columns: minmax(0,1fr); }
    .admin-shell .device-item > .item-actions .button { flex: 1 1 140px; }
    .admin-shell .campaign-editor, .admin-shell .campaign-list-panel, .admin-shell .merchant-create-panel { padding: 16px; }
    .admin-shell .group-create-form > label { width: 100%; }
  }
}

@media screen { .admin-shell .report-filters { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); } }
.report-scope-notice { padding:14px 16px; border:1px solid #e6cf8f; background:#fff9e9; border-radius:8px; line-height:1.5; font-size:.88rem; }

@media screen {
  .admin-shell .campaign-management-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
  .admin-shell .campaign-management-filters > label:first-child { grid-column:1 / -1; }
  .admin-shell .campaign-ending { display:inline-block; background:#fff0be; color:#6b4700; padding:5px 8px; border-radius:6px; font-size:.8rem; font-weight:700; }
  .admin-shell .campaign-card-heading > div { flex-wrap:wrap; gap:8px; }
  .admin-shell .campaign-overlap { padding:12px; border-left:3px solid #d69e22; background:#fff9e9; font-size:.86rem; line-height:1.5; }
  .admin-shell .dashboard-campaign-reminder { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 16px; width:100%; margin:16px 0; text-align:left; }
  .admin-shell .dashboard-campaign-reminder strong { grid-column:2; grid-row:1 / 3; align-self:center; }
  @media(max-width:640px){.admin-shell .campaign-management-filters {grid-template-columns:minmax(0,1fr);}}
}
