/* HARPS extensions built on ADS tokens. Loaded right after ads-theme.css. Never edit ads-theme.css. */

html[data-theme="ads"] {
  --ads-scrim: rgba(15, 18, 20, 0.50);

  /* Order Details + Invoice section titles. Matches computed ADS Revenue
     headings: MultiPlane Display 20px/24px/500, Gray 600. */
  --harps-section-heading-family: "MultiPlane Display", "MultiPlane", var(--font-family);
  --harps-section-heading-size: 20px;
  --harps-section-heading-leading: 24px;
  --harps-section-heading-weight: 500;
  --harps-section-heading-color: var(--ads-gray-600, #1e2528);
}

/* Semantic KPI values. These live beside the base rule because the base rule
   also sets colour — a page-level modifier of equal specificity would lose to
   it on source order. Typography is inherited; only the hue changes. */
html[data-theme="ads"] .dash-kpi-value--brand,
html[data-theme="ads"] .kpi-value--brand {
  color: var(--ads-brand);
}
html[data-theme="ads"] .dash-kpi-value--warning,
html[data-theme="ads"] .kpi-value--warning {
  color: var(--ads-orange-800);
}

/* Tab geometry must not change with selection. Weight is therefore constant
   across states — a 400/600 swap re-measures the label, which changes the
   tab's width and pushes every tab after it sideways. Selection is carried by
   colour and the underline below. */
html[data-theme="ads"] .owa-tab,
html[data-theme="ads"] .tab,
html[data-theme="ads"] [role="tab"] {
  font-weight: 600;
}

/* ── Detail-page contextual notice ────────────────────────────────────────
   `.page-alert` is the persistent "Peer Review Required" notice rendered on
   the Order and Invoice detail pages. It shipped with EDL orange tints and a
   full-bleed bottom rule; this maps it onto the ADS alert treatment — surface,
   semantic left accent, radius, elevation and type — without touching the 768
   pages that carry the markup. The message is a warning, not an error: the
   user can proceed but owes a second reviewer before export. */
html[data-theme="ads"] .page-alert {
  background: var(--ads-card-bg);
  border: 1px solid var(--ads-card-border);
  border-left: 6px solid var(--ads-orange-100);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 18, 20, 0.30);
  color: var(--ads-gray-600);
  font: var(--ads-font-body-md-reg);
  padding: 16px 56px 16px 16px;
  min-height: 0;
}

html[data-theme="ads"] .page-alert-label {
  font: var(--ads-font-body-md-sem);
  color: var(--ads-gray-600);
}

html[data-theme="ads"] .page-alert-msg {
  font: var(--ads-font-body-md-reg);
  color: var(--ads-gray-600);
}

/* The warning icon takes the semantic hue rather than an EDL orange literal. */
html[data-theme="ads"] .page-alert-icon {
  color: var(--ads-orange-400);
}

/* Dismiss control: ADS icon-button sizing and focus ring, no UA outline. */
html[data-theme="ads"] .page-alert-dismiss {
  color: var(--ads-gray-100);
  border-radius: var(--radius-button);
}
html[data-theme="ads"] .page-alert-dismiss:hover {
  background: rgba(15, 18, 20, 0.05);
  color: var(--ads-gray-600);
}
html[data-theme="ads"] .page-alert-dismiss:focus-visible {
  outline: 2px solid var(--ads-brand);
  outline-offset: 2px;
}
html[data-theme="ads"] .page-alert-dismiss:focus:not(:focus-visible) {
  outline: none;
}

/* ── Existing HARPS dialogs, on the ADS modal surface ─────────────────
   Pages author .edl-modal, .po-modal, the filter/column drawers, and
   Manage Columns inline. These rules only change surface, type, spacing,
   and button hierarchy. Width follows the task: 520 for assignment,
   640 for the SOX explanation, 680 for the PO document, 720 for columns.
   Side drawers stay side drawers. */
html[data-theme="ads"] .edl-modal-overlay,
html[data-theme="ads"] .po-modal-overlay[role="dialog"],
html[data-theme="ads"] .filter-overlay,
html[data-theme="ads"] .colsel-overlay,
html[data-theme="ads"] .manage-columns-backdrop,
html[data-theme="ads"] .rbw-command-palette {
  background: var(--ads-scrim);
}
html[data-theme="ads"] .po-modal-overlay[role="dialog"] {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html[data-theme="ads"] .manage-columns-backdrop {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="ads"] .edl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: var(--ads-scrim);
}
html[data-theme="ads"] .edl-modal-overlay[hidden] {
  display: none !important;
}

html[data-theme="ads"] .edl-modal,
html[data-theme="ads"] .po-modal,
html[data-theme="ads"] .manage-columns-dialog,
html[data-theme="ads"] .rbw-command-panel {
  background: var(--ads-card-bg);
  border: 1px solid var(--ads-card-border);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(15, 18, 20, 0.25), 0 8px 16px rgba(15, 18, 20, 0.10);
  color: var(--ads-gray-600);
  font-family: var(--font-family);
}

/* Assignment is a medium picker. The SOX explanation keeps a wider reading
   width. Neither becomes full screen. */
html[data-theme="ads"] #assignModalOverlay .edl-modal {
  width: min(520px, 100%);
  max-width: 520px;
  max-height: min(640px, calc(100vh - 48px));
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-content {
  flex: 1 1 auto;
  min-height: 0;
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-list-wrap {
  flex: 1 1 auto;
  min-height: 120px;
}
html[data-theme="ads"] #sox-modal .edl-modal {
  width: min(640px, 100%);
  max-width: 640px;
  max-height: min(720px, calc(100vh - 48px));
}
html[data-theme="ads"] .po-modal {
  width: min(680px, calc(100% - 48px));
  max-width: 680px;
  background: var(--ads-card-bg);
}
html[data-theme="ads"] .manage-columns-dialog {
  width: min(720px, calc(100vw - 48px));
  border-radius: 12px;
}

html[data-theme="ads"] .edl-modal-header,
html[data-theme="ads"] .po-modal-header,
html[data-theme="ads"] .manage-columns-header,
html[data-theme="ads"] .filter-panel-header,
html[data-theme="ads"] .colsel-header {
  height: auto;
  min-height: 0;
  padding: 16px 16px 16px 24px;
  border-top: 0;
  border-bottom: 1px solid var(--ads-card-border);
  background: var(--ads-card-bg);
  box-sizing: border-box;
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-header::after {
  content: "Search and select a user to assign this invoice.";
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font: var(--ads-font-body-sm-reg);
  color: var(--ads-gray-100);
}
html[data-theme="ads"] .edl-modal-title,
html[data-theme="ads"] .po-modal-title,
html[data-theme="ads"] .manage-columns-title,
html[data-theme="ads"] .filter-panel-title,
html[data-theme="ads"] .colsel-title {
  margin: 0;
  font: 600 18px/24px var(--font-family);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ads-gray-600);
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-title {
  grid-column: 1;
  grid-row: 1;
}
html[data-theme="ads"] .manage-columns-subtitle,
html[data-theme="ads"] .colsel-helper,
html[data-theme="ads"] .po-modal-file-type,
html[data-theme="ads"] .po-modal-helper {
  font: var(--ads-font-body-sm-reg);
  color: var(--ads-gray-100);
  letter-spacing: 0;
}
html[data-theme="ads"] .edl-modal-close,
html[data-theme="ads"] .po-modal-close,
html[data-theme="ads"] .manage-columns-close,
html[data-theme="ads"] .colsel-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ads-gray-100);
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-close {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}
html[data-theme="ads"] .edl-modal-close:hover,
html[data-theme="ads"] .po-modal-close:hover,
html[data-theme="ads"] .manage-columns-close:hover,
html[data-theme="ads"] .colsel-close:hover {
  background: rgba(15, 18, 20, 0.05);
  color: var(--ads-gray-600);
  border-color: transparent;
}

html[data-theme="ads"] #assignModalOverlay .edl-modal-content,
html[data-theme="ads"] #sox-modal .edl-modal-body,
html[data-theme="ads"] .po-modal-body {
  padding: 16px 24px;
  gap: 16px;
  background: var(--ads-card-bg);
}
html[data-theme="ads"] .edl-modal-search-group {
  gap: 8px;
}
html[data-theme="ads"] .edl-modal-search-label,
html[data-theme="ads"] .filter-field-label,
html[data-theme="ads"] .po-modal-meta-label,
html[data-theme="ads"] .colsel-section-title {
  font: var(--ads-font-body-sm-sem);
  color: var(--ads-gray-100);
  text-transform: none;
  letter-spacing: 0;
}
html[data-theme="ads"] .edl-modal-search-box,
html[data-theme="ads"] .manage-columns-search,
html[data-theme="ads"] .colsel-search,
html[data-theme="ads"] .filter-input,
html[data-theme="ads"] .filter-select,
html[data-theme="ads"] button.filter-ms-btn {
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(15, 18, 20, 0.20);
  border-radius: var(--radius-field);
  background: var(--ads-card-bg);
  color: var(--ads-gray-600);
  font: var(--ads-font-body-md-reg);
  box-shadow: none;
}
html[data-theme="ads"] .edl-modal-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
html[data-theme="ads"] .edl-modal-search-icon,
html[data-theme="ads"] .colsel-search-icon {
  order: -1;
  width: 16px;
  height: 16px;
  color: var(--ads-gray-100);
}
html[data-theme="ads"] .edl-modal-search-input {
  font: var(--ads-font-body-md-reg);
  color: var(--ads-gray-600);
}
html[data-theme="ads"] .edl-modal-search-input::placeholder,
html[data-theme="ads"] .manage-columns-search::placeholder,
html[data-theme="ads"] .colsel-search::placeholder,
html[data-theme="ads"] .filter-input::placeholder {
  color: var(--ads-gray-100);
}
html[data-theme="ads"] .edl-modal-search-box:focus-within,
html[data-theme="ads"] .manage-columns-search:focus,
html[data-theme="ads"] .colsel-search:focus,
html[data-theme="ads"] .filter-input:focus,
html[data-theme="ads"] .filter-select:focus,
html[data-theme="ads"] .filter-input-wrap .filter-input:focus,
html[data-theme="ads"] button.filter-ms-btn:focus {
  outline: none;
  border-color: var(--ads-brand);
  box-shadow: 0 0 0 1px var(--ads-brand);
}

html[data-theme="ads"] #assignModalOverlay .edl-modal-list-wrap {
  max-height: 336px;
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-list-wrap::before {
  content: "Results";
  display: block;
  padding: 0 12px 8px;
  font: var(--ads-font-body-sm-sem);
  color: var(--ads-gray-100);
}
html[data-theme="ads"] .edl-modal-list-item,
html[data-theme="ads"] .colsel-check-row,
html[data-theme="ads"] .manage-columns-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  font: var(--ads-font-body-md-reg);
  color: var(--ads-gray-600);
  box-sizing: border-box;
}
html[data-theme="ads"] .manage-columns-item {
  padding: 8px 24px;
  border-bottom-color: var(--ads-card-border);
  border-radius: 0;
}
html[data-theme="ads"] .edl-modal-list-item:hover,
html[data-theme="ads"] .colsel-check-row:hover,
html[data-theme="ads"] .manage-columns-item:hover {
  background: rgba(15, 18, 20, 0.05);
}
html[data-theme="ads"] .edl-modal-list-item.is-selected {
  background: var(--ads-indigo-50);
  color: var(--ads-gray-600);
  font-weight: 600;
}
html[data-theme="ads"] .edl-modal-list-item.is-selected::after {
  content: "";
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: var(--ads-brand);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3 3 7-7'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3 3 7-7'/></svg>") center / contain no-repeat;
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-list:not(:has(> .edl-modal-list-item:not([style*="display: none"])))::before {
  content: "No matching users";
  display: block;
  padding: 12px;
  font: var(--ads-font-body-md-reg);
  color: var(--ads-gray-100);
}

html[data-theme="ads"] #sox-modal .edl-modal-section-title {
  font: var(--ads-font-body-md-sem);
  text-transform: none;
  letter-spacing: 0;
  color: var(--ads-gray-600);
}
html[data-theme="ads"] #sox-modal .edl-modal-section-body,
html[data-theme="ads"] .po-modal-meta-value,
html[data-theme="ads"] .po-modal-file-name,
html[data-theme="ads"] .manage-columns-label,
html[data-theme="ads"] .colsel-check-label {
  font: var(--ads-font-body-md-reg);
  color: var(--ads-gray-600);
}
html[data-theme="ads"] #sox-modal .edl-modal-divider {
  background: var(--ads-card-border);
  margin: 20px 0 0;
}
html[data-theme="ads"] #sox-modal .edl-modal-section {
  margin-top: 20px;
}
html[data-theme="ads"] .po-modal-file-icon {
  background: var(--ads-gray-50);
  border-radius: 8px;
}
html[data-theme="ads"] .po-modal-meta {
  gap: 12px 32px;
}
html[data-theme="ads"] .filter-field {
  gap: 8px;
}
html[data-theme="ads"] .filter-panel-body,
html[data-theme="ads"] .colsel-body {
  padding: 16px 24px;
  gap: 16px;
}

html[data-theme="ads"] .edl-modal-footer,
html[data-theme="ads"] .po-modal-footer,
html[data-theme="ads"] .manage-columns-footer,
html[data-theme="ads"] .filter-panel-footer,
html[data-theme="ads"] .colsel-footer {
  padding: 16px 24px;
  gap: 8px;
  border-top: 1px solid var(--ads-card-border);
  box-shadow: none;
  background: var(--ads-card-bg);
}
html[data-theme="ads"] #assignModalOverlay .edl-modal-btn--demoted,
html[data-theme="ads"] .manage-columns-footer > .manage-columns-btn,
html[data-theme="ads"] .filter-panel-reset,
html[data-theme="ads"] .colsel-btn-reset {
  margin-right: auto;
}

html[data-theme="ads"] .edl-modal-btn,
html[data-theme="ads"] .po-modal-btn,
html[data-theme="ads"] .manage-columns-btn,
html[data-theme="ads"] .filter-btn-cancel,
html[data-theme="ads"] .filter-btn-apply,
html[data-theme="ads"] .colsel-btn-done,
html[data-theme="ads"] .filter-panel-reset,
html[data-theme="ads"] .colsel-btn-reset {
  min-height: 36px;
  height: auto;
  padding: 8px 16px;
  border-radius: 6px;
  font: var(--ads-font-body-md-sem);
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
  text-decoration: none;
  box-sizing: border-box;
}
html[data-theme="ads"] .edl-modal-btn--primary,
html[data-theme="ads"] .po-modal-btn-primary,
html[data-theme="ads"] .manage-columns-btn--primary,
html[data-theme="ads"] .filter-btn-apply,
html[data-theme="ads"] .colsel-btn-done {
  background: var(--ads-brand);
  border: 1px solid var(--ads-brand);
  color: var(--white);
}
html[data-theme="ads"] .edl-modal-btn--primary:hover,
html[data-theme="ads"] .po-modal-btn-primary:hover,
html[data-theme="ads"] .manage-columns-btn--primary:hover,
html[data-theme="ads"] .filter-btn-apply:hover,
html[data-theme="ads"] .colsel-btn-done:hover {
  background: var(--ads-brand-hover);
  border-color: var(--ads-brand-hover);
  color: var(--white);
}
html[data-theme="ads"] .edl-modal-btn--primary:active,
html[data-theme="ads"] .po-modal-btn-primary:active,
html[data-theme="ads"] .manage-columns-btn--primary:active,
html[data-theme="ads"] .filter-btn-apply:active,
html[data-theme="ads"] .colsel-btn-done:active {
  background: var(--ads-brand-active);
  border-color: var(--ads-brand-active);
}
html[data-theme="ads"] .edl-modal-btn--primary:disabled {
  background: var(--ads-brand);
  border-color: var(--ads-brand);
  color: var(--white);
  opacity: 0.4;
}
html[data-theme="ads"] .edl-modal-btn--secondary,
html[data-theme="ads"] .po-modal-btn-secondary,
html[data-theme="ads"] .manage-columns-footer-actions .manage-columns-btn:not(.manage-columns-btn--primary),
html[data-theme="ads"] .filter-btn-cancel {
  background: transparent;
  border: 1px solid var(--ads-brand);
  color: var(--ads-brand);
}
html[data-theme="ads"] .edl-modal-btn--secondary:hover,
html[data-theme="ads"] .po-modal-btn-secondary:hover,
html[data-theme="ads"] .manage-columns-footer-actions .manage-columns-btn:not(.manage-columns-btn--primary):hover,
html[data-theme="ads"] .filter-btn-cancel:hover {
  background: var(--ads-indigo-50);
  border-color: var(--ads-brand);
  color: var(--ads-brand);
  text-decoration: none;
}
html[data-theme="ads"] .edl-modal-btn--demoted,
html[data-theme="ads"] .manage-columns-footer > .manage-columns-btn,
html[data-theme="ads"] .filter-panel-reset,
html[data-theme="ads"] .colsel-btn-reset {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ads-gray-100);
  padding-left: 8px;
  padding-right: 8px;
}
html[data-theme="ads"] .edl-modal-btn--demoted:hover,
html[data-theme="ads"] .manage-columns-footer > .manage-columns-btn:hover,
html[data-theme="ads"] .filter-panel-reset:hover,
html[data-theme="ads"] .colsel-btn-reset:hover {
  background: rgba(15, 18, 20, 0.05);
  color: var(--ads-gray-600);
  text-decoration: none;
}
html[data-theme="ads"] .filter-input-wrap .filter-input {
  padding: 0 32px 0 12px;
}
html[data-theme="ads"] .filter-input-wrap.has-value .filter-input {
  padding-right: 56px;
}
html[data-theme="ads"] .filter-select-wrap .filter-select,
html[data-theme="ads"] .filter-select-wrap button.filter-ms-btn {
  padding-right: 32px;
}
html[data-theme="ads"] .colsel-search {
  padding: 0 12px 0 36px;
}

html[data-theme="ads"] .edl-toast {
  border: 1px solid var(--ads-card-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 18, 20, 0.20), 0 2px 4px rgba(15, 18, 20, 0.10);
  font-family: var(--font-family);
}
html[data-theme="ads"] .edl-toast__title,
html[data-theme="ads"] .edl-toast__body {
  font-family: var(--font-family);
  letter-spacing: 0;
}

@media (max-width: 720px) {
  html[data-theme="ads"] .edl-modal-overlay {
    padding: 16px;
  }
  html[data-theme="ads"] #assignModalOverlay .edl-modal-footer,
  html[data-theme="ads"] .po-modal-footer,
  html[data-theme="ads"] .manage-columns-footer {
    flex-wrap: wrap;
  }
}


/* ════════════════════════════════════════════════════════════════════════
 * FINANCE CONTENT — legacy values that never reached the token layer
 * ────────────────────────────────────────────────────────────────────────
 * The GL Export KPI captions are coloured by a `.dash-kpi-label` rule in each
 * page's own inline <style>, so there is no shared file to correct and no
 * token to substitute without editing several hundred pages.
 *
 * The equivalent problems in v2-ar.css — EDL indigo on the tab action pills
 * and EDL body text on pagination — were fixed at source instead, by
 * swapping the hex literals for the --indigo-70 and --gray-95 tokens that
 * this file already re-maps. That is the better fix where a shared
 * stylesheet exists: one value, correct in every theme, with nothing here to
 * keep in step. This block is only for the cases where that is not possible.
 * ════════════════════════════════════════════════════════════════════════ */

/* KPI captions describe the figure above them, so they take the ADS
   secondary text grey and let the metric value stay dominant. */
html[data-theme="ads"] .dash-kpi-label,
html[data-theme="ads"] .dash-kpi-sub {
  color: var(--ads-gray-100);
}

/* In-shell Invoice Detail reuses the dedicated invoice card tokens.
   Layout and spacing stay in order-views.css. */
html[data-theme="ads"] .ov-card,
html[data-theme="ads"] .ov-li-card {
  border: 1px solid var(--ads-card-border);
  background: var(--ads-card-bg);
  box-shadow: none;
}

html[data-theme="ads"] .ov-card-title,
html[data-theme="ads"] .ov-li-title,
html[data-theme="ads"] .harps-section-heading {
  font-family: var(--harps-section-heading-family, "MultiPlane Display", "MultiPlane", var(--font-family));
  font-size: var(--harps-section-heading-size, 20px);
  font-weight: var(--harps-section-heading-weight, 500);
  line-height: var(--harps-section-heading-leading, 24px);
  color: var(--harps-section-heading-color, var(--ads-gray-600, #1e2528));
}

html[data-theme="ads"] .ov-field-label {
  font: var(--ads-font-body-md-reg);
  line-height: 21px;
  color: var(--ads-gray-200);
}

html[data-theme="ads"] .ov-field-sub {
  font: var(--ads-font-body-sm-reg);
  color: var(--ads-gray-100);
}

html[data-theme="ads"] .ov-field-value {
  font: var(--ads-font-body-md-sem);
  line-height: 21px;
  color: var(--ads-gray-600);
}

html[data-theme="ads"] .ov-li-edit-count {
  font: var(--ads-font-body-md-sem);
  color: var(--ads-gray-600);
}

html[data-theme="ads"] .ov-li-btn {
  font: var(--ads-font-body-md-sem);
  min-height: 36px;
  border-radius: 6px;
}

html[data-theme="ads"] .ov-li-btn:not(.ov-li-btn--primary):not(.ov-li-btn--text) {
  background: transparent;
  border: 1px solid var(--ads-brand);
  color: var(--ads-brand);
}

html[data-theme="ads"] .ov-li-btn:not(.ov-li-btn--primary):not(.ov-li-btn--text):hover {
  background: var(--ads-indigo-50);
  border-color: var(--ads-brand);
  color: var(--ads-brand);
  text-decoration: none;
}

html[data-theme="ads"] .ov-li-btn--primary {
  background: var(--ads-brand);
  border-color: var(--ads-brand);
  color: #fff;
}

html[data-theme="ads"] .ov-li-btn--primary:hover {
  background: var(--ads-brand-hover, #3b3fba);
  border-color: var(--ads-brand-hover, #3b3fba);
}

html[data-theme="ads"] .ov-adjust-note {
  font: var(--ads-font-body-md-reg);
  line-height: 21px;
  color: var(--ads-gray-200);
}

html[data-theme="ads"] .page-alert.ov-li-adjust {
  border-left-color: var(--ads-blue-100);
  align-items: flex-start;
  position: relative;
}
html[data-theme="ads"] .page-alert.ov-li-adjust .page-alert-icon {
  color: var(--ads-blue-100);
  fill: currentColor;
}
html[data-theme="ads"] .ov-li-card .page-alert {
  width: 100%;
  max-width: none;
}
html[data-theme="ads"] .ov-li-card .page-alert-content {
  max-width: none;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: flex-start;
  min-width: 0;
}
html[data-theme="ads"] .ov-li-card .page-alert-msg {
  white-space: normal;
}
html[data-theme="ads"] .ov-li-card .page-alert-dismiss {
  position: absolute;
  top: 16px;
  right: 16px;
}

html[data-theme="ads"] .ov-li-input.input-field {
  text-align: right;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
html[data-theme="ads"] .ov-li-input.input-field[aria-invalid="true"]:focus {
  border-color: var(--ads-red-100);
}

/* Same selected-row fill as ads-theme `tr.is-selected` — do not invent a color. */
html[data-theme="ads"] .ov-li-table td.ov-li-dirty,
html[data-theme="ads"] .ov-li-table tbody tr:hover td.ov-li-dirty,
html[data-theme="ads"] .ov-li-table td:has(.ov-li-input:focus),
html[data-theme="ads"] .ov-li-table tbody tr:hover td:has(.ov-li-input:focus) {
  background: var(--ads-indigo-50);
}

html[data-theme="ads"] .page-alert.ov-li-edit-error {
  border-left-color: var(--ads-red-100);
}
html[data-theme="ads"] .page-alert.ov-li-edit-error .page-alert-icon {
  color: var(--ads-red-100);
  fill: currentColor;
}

html[data-theme="ads"] .ov-history-card {
  border: 1px solid var(--ads-card-border, rgba(15, 18, 20, 0.20));
  background: var(--ads-card-bg, #fff);
  box-shadow: none;
}

html[data-theme="ads"] .ov-history .ov-title {
  font-family: "MultiPlane Display", "MultiPlane", var(--font-family);
  font-weight: 500;
  font-size: 20px;
  line-height: 24px;
  color: var(--ads-gray-600, #1e2528);
}

html[data-theme="ads"] .ov-history .ov-sub,
html[data-theme="ads"] .ov-field-hint,
html[data-theme="ads"] .ov-filter-note,
html[data-theme="ads"] .ov-result-count {
  font: var(--ads-font-body-sm-reg, 400 12px/18px "Open Sans", sans-serif);
  color: var(--ads-gray-200, #3b4347);
}

html[data-theme="ads"] .ov-history .ov-sub {
  font: var(--ads-font-body-md-reg, 400 14px/20px "Open Sans", sans-serif);
}

html[data-theme="ads"] .gl-table th.gl-th-num,
html[data-theme="ads"] .gl-table td:nth-child(2),
html[data-theme="ads"] .gl-table td:nth-child(3),
html[data-theme="ads"] .gl-table tfoot td:nth-child(2),
html[data-theme="ads"] .gl-table tfoot td:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Even-column helper: drop the trailing flex filler so leftover is in gaps. */
[data-even-cols].table-inner .trow::after {
  content: none;
  display: none;
}
[data-even-cols].table-inner .trow {
  gap: 0;
}
[data-even-cols].table-inner .col-name {
  flex-grow: 0;
}

.invoice-panel[data-even-pinned] {
  position: sticky;
  left: 0;
  box-sizing: border-box;
}
.invoice-panel[data-even-pinned] > .invoice-scroll-area {
  position: sticky;
  left: 0;
  box-sizing: border-box;
}
.invoice-panel[data-even-pinned] .invoice-inner {
  box-sizing: border-box;
}

#harps-peer-review-tip.ads-tooltip {
  max-width: 280px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Even-column tables: never clip measured content at 1440. */
[data-even-cols] .td-stack-primary,
[data-even-cols] .td-stack-secondary,
[data-even-cols] .th-label,
[data-even-cols] .inv-cell-text,
[data-even-cols] .inv-th-label,
[data-even-cols] .inv-name-text,
[data-even-cols] .cp-name {
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}
[data-even-cols].table-inner .col-assigned,
[data-even-cols].table-inner .col-sales,
[data-even-cols].table-inner .col-agency {
  max-width: none;
}

/* Shared H-scroll cue: always-visible bar + right-edge fade. */
.harps-hscroll-host {
  position: relative;
  --harps-hscroll-fade: var(--white, #fff);
}
.invoice-panel.harps-hscroll-host,
.invoice-scroll-area.harps-hscroll-host {
  --harps-hscroll-fade: var(--gray-05, #F8FAFC);
}
.invoice-inner.harps-hscroll-host {
  --harps-hscroll-fade: var(--white, #fff);
}
.harps-hscroll-host::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 8px;
  width: 24px;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background: linear-gradient(to right, transparent, var(--harps-hscroll-fade));
  transition: opacity 120ms linear;
}
.harps-hscroll-host[data-hscroll-more="true"]::after {
  opacity: 1;
}
.harps-hscroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.harps-hscroll::-webkit-scrollbar {
  display: none;
  height: 0;
}
.invoice-panel .invoice-inner.harps-hscroll {
  overflow-x: auto;
}
.harps-hscroll-bar {
  width: 100%;
  height: 8px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--gray-05, #F8FAFC);
  border-top: 1px solid var(--gray-20, #D9DEE7);
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-20, #D9DEE7) var(--gray-05, #F8FAFC);
  display: none;
}
.harps-hscroll-bar::-webkit-scrollbar {
  height: 6px;
  display: block;
}
.harps-hscroll-bar::-webkit-scrollbar-track {
  background: var(--gray-05, #F8FAFC);
}
.harps-hscroll-bar::-webkit-scrollbar-thumb {
  background: var(--gray-20, #D9DEE7);
  border-radius: 3px;
}
.harps-hscroll-bar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-30, #C7D0DB);
}
.harps-hscroll-bar-spacer {
  height: 1px;
  pointer-events: none;
}

/* Order Review: freeze first column + shadow after scroll. */
.or-table-wrap[data-frozen="true"] .or-table th:first-child,
.or-table-wrap[data-frozen="true"] .or-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--white, #fff);
}
.or-table-wrap[data-frozen="true"] .or-table th:first-child::after,
.or-table-wrap[data-frozen="true"] .or-table td:first-child::after {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(15, 18, 20, 0.12), rgba(15, 18, 20, 0));
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}
.or-table-wrap[data-frozen="true"][data-frozen-shadow="true"] .or-table th:first-child::after,
.or-table-wrap[data-frozen="true"][data-frozen-shadow="true"] .or-table td:first-child::after {
  opacity: 1;
}

/* Invoice nested card: freeze name when the card itself scrolls. */
.invoice-inner.harps-hscroll-host[data-frozen="true"] .inv-th.inv-col-name,
.invoice-inner.harps-hscroll-host[data-frozen="true"] .inv-name-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--white, #fff);
}
.invoice-inner.harps-hscroll-host[data-frozen="true"] .inv-th.inv-col-name::after,
.invoice-inner.harps-hscroll-host[data-frozen="true"] .inv-name-cell::after {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(15, 18, 20, 0.12), rgba(15, 18, 20, 0));
  pointer-events: none;
  z-index: 4;
  opacity: 0;
}
.invoice-inner.harps-hscroll-host[data-frozen="true"][data-frozen-shadow="true"] .inv-th.inv-col-name::after,
.invoice-inner.harps-hscroll-host[data-frozen="true"][data-frozen-shadow="true"] .inv-name-cell::after {
  opacity: 1;
}
